openmv-cascade to be use

When use the at python2.7 .some error shows as follow:

[code]usage: [-h] [-i] [-n NAME] [-s STAGES] [-c] file error: too few arguments

Traceback (most recent call last):
  File "C:\Documents and Settings\fff\My Documents\Downloads\openmv-master (1)\usr\", line 257, in <module>
  File "C:\Documents and Settings\fff\My Documents\Downloads\openmv-master (1)\usr\", line 241, in main
    args = parser.parse_args()
  File "D:\Python27\lib\", line 1656, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "D:\Python27\lib\", line 1688, in parse_known_args
    return self._parse_known_args(args, namespace)
  File "D:\Python27\lib\", line 1901, in _parse_known_args
    self.error(_('too few arguments'))
  File "D:\Python27\lib\", line 2311, in error
    self.exit(2, _('%s: error: %s\n') % (self.prog, message))
  File "D:\Python27\lib\", line 2299, in exit
SystemExit: 2
>>> stop_sign.xml
SyntaxError: invalid syntax

please how to use the to convert the opencv xml file to be use in openmv platform.Thanks!Attach the xml file ,thank you very much!
trafffic xml.rar (20.3 KB)

Ibrahim will have to look at this. Um, did you see this thread?

Yes,I had looked the thread,but it can’t solve my issue! doesn’t support the new cascade format.

Thanks iabdalkader.I also use the official xml file, the same error message appears。

This should happen, can you try this?

python2 data/haar/haarcascade_frontalface_default.xml

Hello,everyone!Forgive me,I am a Chinese who is not good at English.So my statement may be hard to understand. :smiley:
I want to use the openmv to identify the car license plate,but I meet the similar issue.I think the haarcascade_licence_plate_rus_16stages.xml file format is shorter than required.When I use the to convert the xml file to casacde file,some error shows as follow:

D:\Model\cascade file>python D:\Model\ D:\Model\licence_plate_rus_16stages.xml
Traceback (most recent call last):
  File "D:\Model\", line 257, in <module>
  File "D:\Model\", line 254, in main
    cascade_binary(args.file, args.stages,
  File "D:\Model\", line 112, in cascade_binary
    fout.write(struct.pack('h', int(float(a.childNodes[0].nodeValue)*256))) #int16_t
 struct.error: short format requires SHRT_MIN <= number <= SHRT_MAX

Could you help me solve this issue or give me some suggestions?Thank you very much!
haarcascade_licence_plate_rus_16stages.xml (46.7 KB)

Hi, your cascade has a very unusual value in one of the trees:


This value overflows a signed short because it’s scaled by 256. Typically it’s small. I can’t change the data type because all cascades are using signed short for this value. You could fix this value by making it smaller (not sure if it will break the cascade) example:


Ok,I see.I’ll try your way.

Thanks for your help!

@ iabdalkader ,when I used the attach the cascade file(the .rar file include the .xml file) ,the openmv3 be crashed ,How solve this issue.Thank you for kindly support.