openmv-cascade.py for new OpenCV XML format ?

General discussion about topics related to OpenMV.
isigmund
Posts: 2
Joined: Wed Jan 11, 2017 4:07 am

openmv-cascade.py for new OpenCV XML format ?

Postby isigmund » Wed Jan 11, 2017 4:29 am

Hello,
we are in the process of training a completely new haar cascade with openCV for our application. We have a running prototype that uses this cascade with openCV and we are now in the process of porting this to the openMV cam.
For this we need to convert the openCV cascade using the openmv-cascade.py tool. Unfortunately this utility seems to expect the old openCV cascade XML format and we did use the new openCV format for our training runs. The training runs take several days/weeks to complete so running them again to produce the old format (-baseFormatSave parameter) is not really an option.

Is there an option to request a new version of openmv-cascade.py that can consume the new openCV cascade XML format to convert for using on the openMV cam ? Or are there any other options to transform the new format into the old one in order to use the openmv-cascade.py without having to retrain our cascades ?

Thanks in advance
Ingo
User avatar
kwagyeman
Posts: 3132
Joined: Sun May 24, 2015 2:10 pm

Re: openmv-cascade.py for new OpenCV XML format ?

Postby kwagyeman » Wed Jan 11, 2017 9:28 am

Ibrahim will have to check on this for you. It should be possible to update the conversion script to support the new format too.
Nyamekye,
isigmund
Posts: 2
Joined: Wed Jan 11, 2017 4:07 am

Re: openmv-cascade.py for new OpenCV XML format ?

Postby isigmund » Wed Jan 11, 2017 10:28 am

super - thanks a lot.....
User avatar
kwagyeman
Posts: 3132
Joined: Sun May 24, 2015 2:10 pm

Re: openmv-cascade.py for new OpenCV XML format ?

Postby kwagyeman » Wed Jan 11, 2017 10:58 am

K, we took a lot at this and to support the new format would require a rewrite of the haar code. This is not really feasible for us. The new haar format uses a different type of data structure so it's not even just fixing renames and etc.

Can you load the new format back into OpenCV and then save it as the old format?
Nyamekye,
normen
Posts: 1
Joined: Wed Jul 12, 2017 7:54 am

Re: openmv-cascade.py for new OpenCV XML format ?

Postby normen » Wed Jul 12, 2017 7:55 am

Apparently they misjudged the situation, I fixed the importer to work with the new Haar XML format :) Its been merged into the github master for OpenMV.
User avatar
iabdalkader
Posts: 883
Joined: Sun May 24, 2015 3:53 pm

Re: openmv-cascade.py for new OpenCV XML format ?

Postby iabdalkader » Wed Jul 12, 2017 11:08 am

normen wrote:
Wed Jul 12, 2017 7:55 am
Apparently they misjudged the situation, I fixed the importer to work with the new Haar XML format :) Its been merged into the github master for OpenMV.
This is true, the new format is now supported thanks to Normen :)

I should also mention that I fixed 2 bugs related to Haar in the current FW in case anyone encounters these issues:

1) The cascade path needed a slash "/" to find a file.
2) Loading a cascade printed misaligned access warnings (meaning DMA wasn't used).

They are fixed now and will be included in the next release.

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 6 guests