Build Post

Single Post Permalink

View Thread: Am Developing Hand Palm Pattern analysis (With vb.net)
  • User profile image
    Annael

    I have a funny project in vb.net.

    This project based on palmistry issues. Am developing application which will analyse the palm image and give the result of the pattern. Then it will query the pattern information according to palmistry pre-defined data.

    Check the starting code process:

     Public Function loadImage(ByVal Location As String) As Bitmap
            Dim max As Integer = 0
            Dim min As Integer = 255
            Dim bmp1 As New Bitmap(Location)
            Dim bmp2 As New Bitmap(Location)
            Dim bmp3 As New Bitmap(bmp2.Width, bmp1.Height)
            Dim gr As Graphics = Graphics.FromImage(bmp3)
            gr.Clear(Color.Black)
            For x As Integer = 0 To bmp2.Width - 1
                For y As Integer = 0 To bmp2.Height - 1
                    Dim C = bmp2.GetPixel(x, y)
                    Dim A As Integer = C.A
                    Dim R As Integer = C.R
                    Dim G As Integer = C.G
                    Dim B As Integer = C.B
                    Dim avg As Integer = (B + G + R) / 3
                    If max < avg Then
                        max = avg
                    End If
                    If avg < min Then
                        min = avg
                    End If
                    If avg < 90 Then
                        avg = 0
                        bmp2.SetPixel(x, y, Color.FromArgb(0, 0, 0, 0))
    
                    Else
                        bmp2.SetPixel(x, y, Color.FromArgb(A, avg, avg, avg))
                    End If
    
                Next
            Next
    
            For x As Integer = 0 To bmp2.Width - 1
                For y As Integer = 0 To bmp2.Height - 1
                    Dim C = bmp2.GetPixel(x, y)
                    Dim A As Integer = C.A
                    Dim R As Integer = C.R
                    Dim G As Integer = C.G
                    Dim B As Integer = C.B
                    Dim avg As Integer = (B + G + R) / 3
                    Dim val1 As Integer = (max + min) / 2
                    If avg >= min And avg <= min + 50 Then
                        ' bmp2.SetPixel(x, y, Color.FromArgb(0, 0, 0, 0))
                    ElseIf avg >= max - 30 And avg <= max Then
                        bmp2.SetPixel(x, y, Color.FromArgb(0, 0, 0, 0))
                    ElseIf avg >= val1 - 60 And avg <= val1 + 60 Then
    
                        bmp2.SetPixel(x, y, Color.Red)
                    Else
                        bmp2.SetPixel(x, y, Color.FromArgb(0, 0, 0, 0))
                    End If
    
    
    
    
    
                Next
            Next
            Return bmp2
        End Function

    Is the stage 1 

    I will be posting according.

    Any suggestion