C# haar cascade can't read xml [closed]

asked 2015-11-02 18:20:23 -0600

Papercut gravatar image

Hi,

I am having a weird problem and struggling with it now..

using( CvHaarClassifierCascade cascade = 
CvHaarClassifierCascade.FromFile( @"C:\opencv\2.4.11\opencv\sources\data\haarcascades\haarcascade_frontalface_alt2.xml" ) )

Above is my code. And this is really basic cascade loading function which I could find many places. But this code returns an error:

The node does not represent a user object (unknown type?)

I tried other xml files but still getting the same error..

Why did it happen and how do I fix it? Please help!!

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2015-11-02 22:08:13.218415

Comments

OpenCV does not have an official C# wrapper

LorenaGdL gravatar imageLorenaGdL ( 2015-11-02 18:35:45 -0600 )edit

It's not OpenCV's official wraper but it's in NuGet and widely used.

Papercut gravatar imagePapercut ( 2015-11-02 18:51:58 -0600 )edit
1

Seems that old cacade xml and recent cacades have different format..

Papercut gravatar imagePapercut ( 2015-11-02 19:01:12 -0600 )edit
1

@Papercut, yes, the c-based wrappers can't read the new format.

it's a deficiancy of your c# wrapper (it's built on an outdated api), not an opencv problem

berak gravatar imageberak ( 2015-11-02 22:10:38 -0600 )edit