using circle detection and system works for a bit then disconnects itself and then end by opens its internal flash drive with blue led flashing
please advise
Tom
Find Circles Example
This example shows off how to find circles in the image using the Hough
Hi, can you post the script using code tags and then let me know the firmware version and camera model you are using? I should be able to duplicate the issue then. Sounds like you are hitting a bug causing memory corruption causing a system reboot.
# Find Circles Example
#
# This example shows off how to find circles in the image using the Hough
# Transform. https://en.wikipedia.org/wiki/Circle_Hough_Transform
#
# Note that the find_circles() method will only find circles which are completely
# inside of the image. Circles which go outside of the image/roi are ignored...
import sensor, image, time,pyb
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # grayscale is faster
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
ledRed =pyb.LED(1)
while(True):
clock.tick()
img = sensor.snapshot().lens_corr(1.8)
# Circle objects have four values: x, y, r (radius), and magnitude. The
# magnitude is the strength of the detection of the circle. Higher is
# better...
# `threshold` controls how many circles are found. Increase its value
# to decrease the number of circles detected...
# `x_margin`, `y_margin`, and `r_margin` control the merging of similar
# circles in the x, y, and r (radius) directions.
# r_min, r_max, and r_step control what radiuses of circles are tested.
# Shrinking the number of tested circle radiuses yields a big performance boost.
for c in img.find_circles(threshold = 2000, x_margin = 10, y_margin = 10, r_margin = 10,
r_min = 2, r_max = 100, r_step = 2):
img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))
ledRed.on()
print("Circle Detected");
print(c)
pyb.delay(500)
ledRed.off()
# print("FPS %f" % clock.fps())
print ("*")
Thank you, what is odd is that I can run HelloWorld w/o crashing. All other project and example run but at some point stop and disconnect the camera. I can easily reconnect and resume but again the disconnect occurs at some random interval . Seems like a buffer overflow? I am running under Window 10 and using an HP Specter with core I7 , lots of ram etc. I check both flash disk and USB all installed ok. The Open MV has a 2G SD card. It is not visible to Windows probably only the camera processor.
Hope this helps.
Regards,
Tom
I tired it and unfortunately got same results. The system runs and then disconnects after a time to USB, causing a need to reconnect.
I even uninstalled and reinstalled Open MV IDE w/o difference.
with frame buffer off it runs longer before disconnecting.
It sounds like the camera is fine and the issue is your PC. Does the program stop working on the camera? Like, does the camera stop showing a red light when circles are in front of it? If not, then that means the camera is working fine and that your USB system is dropping packets and the IDE is not getting a response from the camera in a fast enough interval. The IDE disconnects when it is not able to poll the camera over USB. This can happen due to packet loss. That said, the IDE has a timeout of 3 seconds… So, for that to be violated means your PC has some bad USB issues.
Thanks I agree . The PC is new Windows HP Spectre with both USB 2.0 and 3.0
Has anyone else experience a similar problem? Is there a way to configure setting on USB?
Tom
Ok I tried several USBs ( short, long, gold plated) still occasional crash!
I use USB all the tIme with ESP32 , Arduino, PIC32 w/o issue.
The though that bugs me is that Full frame Helloword works w/o any issue no crashes High FPS, It only occurs when I do other examples.
I am purchasing another Open MV from Sparkfun to determine if the current card is an issue.
Also when I return home from Florida I try my other laptop.
Something has got to shake loose.
Other observations- if I delay the processing loop to achieve low FPS it seems to work for circles detection!?
I think your product is very cool, however, for me to use it I got to overcome this bump in the road.
I will keep you informed
Regards,
Tom
I tired a separate power source , same issue, FYI the unit draws less then 130ma under several different examples, more interesting though, is I purchased and received a new unit from SparkFun and it runs under same conditions flawlessly. I tested it for five hours w/0 a hiccup. What does this say?
I would be willing to ship you the faulty unit if you want so you can take a closer look at it directly.
Regards,
Tom