hi im a beginner programmer using EmguCV Eigenface Recognition.
i have a problem with recognizing the image in my database. as i press the recognized button an error occurs.
it says: "IndexOutOfRangeException was unhandled; index was outside the bounds of array "
here is the code:
Dim imagelist(table.Rows.Count - 1) As Image(Of Gray, Byte)
Dim labellist(table.Rows.Count - 1) As String
For a = 0 To table.Rows.Count - 1
Dim tempimage As Bitmap
tempimage = table.Rows(a).Item("Image")
imagelist(a) = New Image(Of Gray, Byte)(tempimage)
labellist(a) = table.Rows(a).Item("Last_Name")
Next
Dim TermCrit As MCvTermCriteria = New MCvTermCriteria(16, 0.001)
Dim maxdistance As Integer = 5000
Dim EobjectRec As EigenObjectRecognizer
EobjectRec = New EigenObjectRecognizer(imagelist, labellist, maxdistance, TermCrit) <-------here is the error occuring
Try
TextBox1.Text = EobjectRec.Recognize(images).Label
Catch ex As Exception
MsgBox("No Saved Image")
End Try
End Sub
--------------
what will i do next?
please really need help.!!!!!
asap. thank you
i have a problem with recognizing the image in my database. as i press the recognized button an error occurs.
it says: "IndexOutOfRangeException was unhandled; index was outside the bounds of array "
here is the code:
Dim imagelist(table.Rows.Count - 1) As Image(Of Gray, Byte)
Dim labellist(table.Rows.Count - 1) As String
For a = 0 To table.Rows.Count - 1
Dim tempimage As Bitmap
tempimage = table.Rows(a).Item("Image")
imagelist(a) = New Image(Of Gray, Byte)(tempimage)
labellist(a) = table.Rows(a).Item("Last_Name")
Next
Dim TermCrit As MCvTermCriteria = New MCvTermCriteria(16, 0.001)
Dim maxdistance As Integer = 5000
Dim EobjectRec As EigenObjectRecognizer
EobjectRec = New EigenObjectRecognizer(imagelist, labellist, maxdistance, TermCrit) <-------here is the error occuring
Try
TextBox1.Text = EobjectRec.Recognize(images).Label
Catch ex As Exception
MsgBox("No Saved Image")
End Try
End Sub
--------------
what will i do next?
please really need help.!!!!!
asap. thank you