run cascade file openmv3 crash

Hello,every one! when I loaded my cascade file from generated,the openmv3 crash and disconnect from IDE.How to solve this issue?Thanks!The source as follow:

cars_cascade = image.HaarCascade("/cars.cascade", stages = 13)

# FPS clock
clock = time.clock()


while (True):

    # Capture snapshot
    img = sensor.snapshot()

    # Find objects.
    # Note: Lower scale factor scales-down the image more and detects smaller objects.
    # Higher threshold results in a higher detection rate, with more false positives.
    objects = img.find_features(cars_cascade, threshold=0.75, scale_factor=1.25)

    # Draw objects
    for r in objects:

Attach the cars xml file and cars.cascade
cars.rar (14.9 KB)

Ibrahim can debug this.

Hi, I tested your cascade on M4 and M7 it works on both. If I have to guess I’d say the file wasn’t fully written/flushed before you reset the cam, so try this copy the file again and then eject (or safe remove) the drive, reset the cam and then try to run the script again.


I tried this cascade and got OpenMV3 crashed. I wonder on what version of firmware did you try this? And would you please share the py test code ?

Thank you!


I’m using the latest FW image:

And I used the example script that comes with the IDE, just replaced the cascade name and set stages = 13. I got one crash, then I copied the cascade again and it worked, which made me think that the file wasn’t fully written the first time. So my advise is to try again, but this time make sure the file is written (eject/safe remove the uSD after copying the file, then reset the cam from the IDE)

I tried your way ,but failed again. I’m using v2.3 too.
I’ll try to get this resolved. Thank you anyway.

I’ll try your cascade again and get back to you.

Hello,iabdalkader,about the load cascade file crash issue have new methold to be solved?Thanks!

Tried again and it works, can you test the attached cascade ? (2.73 KB)