accord-net / framework

Machine learning, computer vision, statistics and general scientific computing for .NET
http://accord-framework.net
GNU Lesser General Public License v2.1
4.49k stars 1.99k forks source link

GC-86: Add support for the new Haar classifier definition format in OpenCV #83

Open cesarsouza opened 9 years ago

cesarsouza commented 9 years ago

The OpenCV code has been recently updated to support a new Haar cascade definition format. It would be nice if the framework could support this new format as well.

Examples of the two different formats are available at

In order to add support for the new format, it would be necessary to implement a new HaarCascadeSerializationObject (in https://github.com/accord-net/framework/blob/development/Sources/Accord.Vision/Detection/Haar%20Cascade/HaarCascadeStage.cs ) and, most likely, rewrite the existing XML attributes over the classes methods with the different schema. Compatibility with the older format must be preserved.

JimBobSquarePants commented 9 years ago

I'm glad this is on your radar. I had a quick look at the two different format but couldn't figure out the correlation between elements. Only very few elements like leafValues and left_val, right_val seemed obvious to me.

hzawary commented 8 years ago

Dear Dr,

I found the issue and your advice (support for the new Haar classifier definition format in OpenCV) for support new XML training file formats in Accord. I need to use it, but unfortunately the issue isn't done yet! May it done in closest time?! I also implements a interface tool in my repository for create xml training files by OpenCV facilities by a convenient WPF app.

Best regards, Hashem :)

JimSEOW commented 7 years ago

@cesarsouza @JimBobSquarePants Will this link help? Perhaps someone here has tried?

Any update to this issue ?

cesarsouza commented 7 years ago

Hi @JimSEOW,

Actually this issue is quite low priority in my current to-do list (the first one right now being the TensorFlowSharp integration - #92 and #279) .

Please, may I ask where (in which circumstances) do you actually need to use the new Haar Cascade format? I am not giving that much priority to this issue because I understand the code still works fine with the previous format (which had already plenty of working different classifier definitions at the time).

However, if you have a very interesting use case in mind, I might give it a bit more attention (or at least help with the particular application you are working with).

Regards, Cesar

JimSEOW commented 7 years ago

@cesarsouza The goal is to get a detailed facial landmark compatible to what can be provided by e.g. Kinect. I understand your commitment to TensorflowSharp. Definitely it is of highest priority. I already contacted the author of Dlib PInvoke wrapper (68 landmark features detection) perhaps we can get a .NET friendly wrapper for x86, X64 and ARM