Convert .xml to .cascade

General discussion about topics related to OpenMV.
FeKTapano
Posts: 8
Joined: Tue Jan 02, 2018 8:39 pm

Convert .xml to .cascade

Postby FeKTapano » Sun Aug 05, 2018 12:58 pm

Where is your algorithm for binary haar cascade converter located? The old link for that seems to be broken.
User avatar
kwagyeman
Posts: 2111
Joined: Sun May 24, 2015 2:10 pm

Re: Convert .xml to .cascade

Postby kwagyeman » Sun Aug 05, 2018 3:47 pm

Nyamekye,
FeKTapano
Posts: 8
Joined: Tue Jan 02, 2018 8:39 pm

Re: Convert .xml to .cascade

Postby FeKTapano » Sun Aug 05, 2018 5:33 pm

Ok, I got it.
Now I am trying to open my xml with it, however it will always create a blank file. Is this the right way to use it?
oelalfey
Posts: 3
Joined: Mon Aug 06, 2018 12:27 pm

Re: Convert .xml to .cascade

Postby oelalfey » Mon Aug 06, 2018 1:09 pm

FeKTapano wrote:
Sun Aug 05, 2018 5:33 pm
Ok, I got it.
Now I am trying to open my xml with it, however it will always create a blank file. Is this the right way to use it?
Hi,

1) If you need to train a new cascade, follow OpenCV tutorials to train a haar cascade:

https://docs.opencv.org/3.3.0/dc/d88/tu ... scade.html
https://github.com/mrnugget/opencv-haar ... r-training
https://coding-robin.de/2013/07/22/trai ... ifier.html

* Note you have to use -baseFormatSave to save the cascade in the old format

2) Convert the xml cascade to binary using the converter script:

Code: Select all

python2 cascade_convert.py my_cascade.xml
3) Copy my_cascade.cascade to camera storage (flash or SD) and run the example script.
FeKTapano
Posts: 8
Joined: Tue Jan 02, 2018 8:39 pm

Re: Convert .xml to .cascade

Postby FeKTapano » Mon Aug 06, 2018 4:02 pm

I was training it with the new format, so now I have them in the correct base format.
Now instead of creating a blank file, when I open my xml with the converter script, no file is generated whatsoever.
What should I do?

(I am sending the xml if that helps)
Attachments
cascade.xml
(46.75 KiB) Downloaded 6 times
User avatar
iabdalkader
Posts: 497
Joined: Sun May 24, 2015 3:53 pm

Re: Convert .xml to .cascade

Postby iabdalkader » Tue Aug 07, 2018 4:16 pm

FeKTapano wrote:
Mon Aug 06, 2018 4:02 pm
Now instead of creating a blank file, when I open my xml with the converter script, no file is generated whatsoever.
Please run the following command from the command line on Linux:

Code: Select all

python2 cascade_convert.py cascade.xml

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 3 guests