cvLoadHaarClassifierCascade xml formats - old/new
Hi, I have downloaded a ClassifierCascade (https://github.com/geraldstanje/opencv-haar-classifier-training/blob/master/trained_classifiers/banana_classifier.xml) trained with opencv_traincascade, which uses the new xml format... how can you tell cvLoadHaarClassifierCascade that the xml file to load is a new format?
Thanks, Gerald
cvLoadHaarClassifierCascade can only load the old format.
you should avoid the old cv* functions anyway, and use the c++ api, so: CascadeClassifier::load()
why is the feature only available with c++ and not in the c api? is there a tool to convert between both formats?
honestly, better change your code.
i use the golang wrapper for opencv, not sure how i could use c++ code... https://github.com/lazywei/go-opencv any idea?
wow, did not knew that ;) i'll look into it !
unfortunately it builds upon opencv 1.0. like 10 years ago.
join #go-nuts on freenode irc? contribute the go-opencv project? :)
is there a way to port that feature to go-opencv? or is it possible to implement for the opencv c api?
they switched to c++ in 2010 already, and the c-api is definitely being phased out
imho, to wrap the c++ api, one would have to do a c-wrapper around the c++ api again, and link / feed that into cgo. i even tried something similar, but did not get far ... (and yes, the #go-nuts guys were nice and helpful as always ;)
the major pain point whith go was for me, that you still have to do manual memory management, i'll probably restart, if i find a way to trigger all the defer blah.release() statements from within the cgo wrappers, but that's future ;)
also, cgo generates a lot of indirections / boiler plate code under the hood, really disgusting !
is there a way to convert between both xml formats?
as i see the following golang wrapper is around the opencv c api? https://github.com/lazywei/go-opencv ... just join the go-opencv guys and constribute? :)
link hidden above ^^
and yes, lazywei's wrapper is using the c-api directly. unfortunately cgo does not like c++ at all, you can't import c++ functions/classes without further indirection.
(oh, and no, afaik there's no such conversion tool)