Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm doing something with vb net 2005 and emgu cv 2.9.0.1922. I want some help.
I have an error i can't understand since days :( :( :( :( :( and it's on this line

Dim haar As HaarCascade = New HaarCascade(".\haarcascade_frontalface_alt_tree.xml")

____________________________

the code is the following

Private Sub ProcessFame(ByVal sender As Object, ByVal arg As EventArgs)
' Get frames from camera
Dim ImageFrame As Image(Of Emgu.CV.Structure.Bgr, Byte) = capturee.QueryFrame()

Dim haar As HaarCascade = New HaarCascade(".\haarcascade_frontalface_alt_tree.xml")

If Not (ImageFrame Is Nothing) Then
' Convert image to gray scale
Dim grayFrame As Image(Of Emgu.CV.Structure.Gray, Byte) = ImageFrame.Convert(Of Emgu.CV.Structure.Gray, Byte)()

' Detect faces form the gray-scale image and store into an array
Dim faces = grayFrame.DetectHaarCascade(haar, 1.4, 4, CvEnum.HAAR_DETECTION_TYPE.DO_CANNY_PRUNING, New Size(20, 20))

'' Draw a green rectangle on each detected face in image
For Each face As MCvAvgComp In faces
ImageFrame.Draw(face.rect, New Bgr(Color.Green), 3)
Next

' Number of faces detected
Me.Label1.Text = "Total faces detected : " & faces.Length

End If


'Show pictures into CamImageBox
CamImageBox.Image = ImageFrame

'Show pictures into pic_prise
pic_prise.Image = ImageFrame.ToBitmap()

'End Sub
________________________________________________

the error is the following

L'exception Emgu.CV.Util.CvException n'a pas été gérée
ErrorStr="Unspecified error"
Message="OpenCV: The node does not represent a user object (unknown type?)"
Source="Emgu.CV"
StackTrace:
à Emgu.CV.CvInvoke.CvErrorHandler(Int32 status, String funcName, String errMsg, String fileName, Int32 line, IntPtr userData)
à Emgu.CV.CvInvoke._cvLoad(String fileName, IntPtr memstorage, String name, IntPtr realName)
à Emgu.CV.CvInvoke.cvLoad(String fileName, IntPtr memstorage, String name, IntPtr realName)
à Emgu.CV.HaarCascade..ctor(String fileName)
à WindowsApplication1.CameraCapture.ProcessFame(Object sender, EventArgs arg)
à System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.Run(ApplicationContext context)
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
à WindowsApplication1.My.MyApplication.Main(String[] Args)
à System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()


Thank you for your help.
Posted
Comments
Amogh Shah 11-Mar-16 5:00am    
How do you solved this?

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