Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class gambar
- Public Shared Function GetGrayScale(ByVal pic As Bitmap) As Double(,)
- Dim tmp(pic.Width - 1, pic.Height - 1) As Double
- Dim w As New Bitmap(pic.Width, pic.Height)
- For i As Integer = 0 To pic.Height - 1
- For j As Integer = 0 To pic.Width - 1
- Dim warna As New Color
- warna = pic.GetPixel(j, i)
- Dim grey As Integer = (CInt(warna.R) + warna.G + warna.B) / 3
- tmp(i, j) = grey
- Next
- Next
- Return tmp
- End Function
- Public Shared Function GetPictArray(ByVal pic As Bitmap) As Double(,)
- Dim tmp(pic.Width - 1, pic.Height - 1) As Double
- Dim w As New Bitmap(pic.Width, pic.Height)
- For i As Integer = 0 To pic.Height - 1
- For j As Integer = 0 To pic.Width - 1
- Dim warna As New Color
- warna = pic.GetPixel(j, i)
- tmp(i, j) = warna.R
- Next
- Next
- Return tmp
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement