Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi great members of this group

i am new face detection and recognition. I want to develop an school attendance system. so far i was able to write a code that detect the face and capture it and store in a folder. but i dont have a clue on how to call it back and make the comparison. below is my code that detect, capture and save the face in a folder. thanks for your support.



VB
Imports Emgu.CV
Imports Emgu.CV.Util
Imports Emgu.CV.Structure
Imports System.IO

Public Class FaceDetection
    Dim capturez As Capture = New Capture

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim imagez As Image(Of Bgr, Byte) = capturez.QueryFrame
        Dim faceDetector As New HaarCascade("C:\Users\USER\Documents\Visual Studio 2010\Projects\WindowsApplication1\WindowsApplication1\bin\Debug\haarcascade_frontalface_default.xml")
        Dim imgGray As Image(Of Gray, Byte) = imagez.Convert(Of Gray, Byte)()
        For Each face As MCvAvgComp In faceDetector.Detect(imgGray, 1.1, 10, CvEnum.HAAR_DETECTION_TYPE.DO_CANNY_PRUNING, New Size(20, 20), Size.Empty)
            imagez.Draw(face.rect, New Bgr(Color.Blue), 1)


        Next
        PictureBox1.Image = imagez.ToBitmap()

       



    End Sub

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        Dim number As String
        number = TextBox1.Text
        Dim strBasePath As String

        Dim strFileName As String
        strFileName = number + ".jpg"
        strBasePath = Application.StartupPath & "\Photos"
        If Directory.Exists(strBasePath) = False Then
            Call Directory.CreateDirectory(strBasePath)

        End If
        Call PictureBox1.Image.Save(strBasePath & "\" & strFileName, System.Drawing.Imaging.ImageFormat.Jpeg)
        MsgBox(number + " " + "has been captured successfully", MsgBoxStyle.Information)
    End Sub
End Class
Posted
Updated 3-Sep-16 12:10pm
v2
Comments
Taylor Enoch 9-Nov-16 11:02am    
Am stuck the same. Just don't know how to make comparism. Have you been able to do it yet?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900