run cascade file openmv3 automatically disconnects from IDE

Discussion related to "under the hood" OpenMV topics.
kk2333
Posts: 5
Joined: Tue Jan 23, 2018 8:33 pm

run cascade file openmv3 automatically disconnects from IDE

Postby kk2333 » Tue Jan 23, 2018 8:46 pm

Hello,every one! when I loaded my cascade file from openmv-cascade.py generated,the openmv3 cam disconnects from IDE.How to solve this issue?Thanks!The source as follow:

Code: Select all

# Face Detection Example
#
# This example shows off the built-in face detection feature of the OpenMV Cam.
#
# Face detection works by using the Haar Cascade feature detector on an image. A
# Haar Cascade is a series of simple area contrasts checks. For the built-in
# frontalface detector there are 25 stages of checks with each stage having
# hundreds of checks a piece. Haar Cascades run fast because later stages are
# only evaluated if previous stages pass. Additionally, your OpenMV Cam uses
# a data structure called the integral image to quickly execute each area
# contrast check in constant time (the reason for feature detection being
# grayscale only is because of the space requirment for the integral image).

import sensor, time, image

# Reset sensor
sensor.reset()

# Sensor settings
sensor.set_contrast(1)
sensor.set_gainceiling(16)
# HQVGA and GRAYSCALE are the best for face tracking.
sensor.set_framesize(sensor.HQVGA)
sensor.set_pixformat(sensor.GRAYSCALE)

# Load Haar Cascade
# By default this will use all stages, lower satges is faster but less accurate.
face_cascade = image.HaarCascade("/pick.cascade")
print(face_cascade)

# FPS clock
clock = time.clock()

while (True):
    clock.tick()

    # 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(face_cascade, threshold=0.75, scale_factor=1.25)
    print(objects)
    # Draw objects
    for r in objects:
        img.draw_rectangle(r)

    # Print FPS.
    # Note: Actual FPS is higher, streaming the FB makes it slower.
    print(clock.fps())

Attach the xml file and cascade file
Attachments
classifier.zip
include xml file and cascade file
(5.26 KiB) Downloaded 13 times
Last edited by kk2333 on Tue Jan 23, 2018 8:58 pm, edited 1 time in total.
kk2333
Posts: 5
Joined: Tue Jan 23, 2018 8:33 pm

Re: run cascade file openmv3 automatically disconnects from IDE

Postby kk2333 » Tue Jan 23, 2018 8:49 pm

I had copied the file again and then eject (or safe remove) the drive, reset the cam and then try to run the script again
with the firmware 2.6.0 and firmware 2.7.0, but all failed.
User avatar
kwagyeman
Posts: 2281
Joined: Sun May 24, 2015 2:10 pm

Re: run cascade file openmv3 automatically disconnects from IDE

Postby kwagyeman » Tue Jan 23, 2018 9:50 pm

Ibrahim, any thoughts?

Anyway, can you post the algorithm in the mean time?
Nyamekye,
kk2333
Posts: 5
Joined: Tue Jan 23, 2018 8:33 pm

Re: run cascade file openmv3 automatically disconnects from IDE

Postby kk2333 » Wed Jan 24, 2018 1:53 am

kwagyeman wrote:
Tue Jan 23, 2018 9:50 pm
Ibrahim, any thoughts?

Anyway, can you post the algorithm in the mean time?
Hi, kwagyeman.
Sorry,I can't undestand which algorithm you mean? Is it the first post of mine?
User avatar
kwagyeman
Posts: 2281
Joined: Sun May 24, 2015 2:10 pm

Re: run cascade file openmv3 automatically disconnects from IDE

Postby kwagyeman » Wed Jan 24, 2018 3:01 am

Sorry, was reading this on my phone. I see that you posted the cascade with issues.
Nyamekye,
kk2333
Posts: 5
Joined: Tue Jan 23, 2018 8:33 pm

Re: run cascade file openmv3 automatically disconnects from IDE

Postby kk2333 » Wed Jan 24, 2018 3:38 am

kwagyeman wrote:
Wed Jan 24, 2018 3:01 am
Sorry, was reading this on my phone. I see that you posted the cascade with issues.
I have found a solution and a new issue.
Solution:
Running openmv-cascade.py on Ubuntu. The size of the cascade file generated on Ubuntu is different from the one generated on Windows10.

New issue:
After using the solution, it detects nothing and "objects" is always null.

Firmware Version:2.7.0
Attachments
pick_linux.zip
generated on Ubuntu
(1 KiB) Downloaded 11 times
User avatar
iabdalkader
Posts: 542
Joined: Sun May 24, 2015 3:53 pm

Re: run cascade file openmv3 automatically disconnects from IDE

Postby iabdalkader » Wed Jan 24, 2018 11:46 am

Hi, the cascade generator doesn't work on Windows, we'll add it to the IDE at some point. If you got it working and it detects nothing, try changing the threshold and/or scale factor.
kk2333
Posts: 5
Joined: Tue Jan 23, 2018 8:33 pm

Re: run cascade file openmv3 automatically disconnects from IDE

Postby kk2333 » Fri Jan 26, 2018 12:52 am

iabdalkader wrote:
Wed Jan 24, 2018 11:46 am
Hi, the cascade generator doesn't work on Windows, we'll add it to the IDE at some point. If you got it working and it detects nothing, try changing the threshold and/or scale factor.
OK! Thank you very much!

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests