After buying, there is a camera, I go back to work.
I am having problems with the examples.
For example with find_circle .py
I get the error message
AttributeError Image object has no attribute find_circles
I have the same type of error with find_lines.py
2 °) I do not understand the management of the colors, by moment it is specified RGB565 and to others one finds RGB888.
The camera works in 2 or 3 bytes.
3 °) The documentation on the web is numbered 1.9.2 and the last downloadable version is 1.8.1. Why?
4 °) If I delete the last line (“img = sensor.snapshot ()”) in the following program:
Hi, sorry for not getting back to you quicker. I can only answer questions on my phone during the day. For your questions I need my desktop:
I don’t get this error. Can you post the script you are using? Getting this kinda of error means something was corrupted or your firmware version is old.
The camera is RGB565, but, from the user interface you supply RGB888 colors or LAB colors.
There are 3 versions of things, we using MicroPython which is the version 1.9.2, then OpenMV IDE has a version 1.8.1, and then our build of MicroPython’s firmware with our vision libraries is 2.7.0. It’s not really possible to keep all them in sync since they update at different rates.
The frame buffer is transferred to the PC when snapshot is run and a new frame is then captured. Without the line at the end the transfer doesn’t happen. That said, I just had an idea to transfer the frame buffer on script end. I will fix that for the next firmware release. We’ve been busy for the last month fixing tons of stuff in the library to bring it up to having a similar suite of features as OpenCV.
No problem, I manage several projects donations when I’m stuck for one I always work for others.
1 °) I simply use the openMV find_circle.py sample file
# 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
sensor.set_pixformat(sensor.RGB565) # grayscale is faster
sensor.skip_frames(time = 2000)
clock = time.clock()
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
# `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.
for c in img.find_circles(threshold = 2000, x_margin = 10, y_margin = 10, r_margin = 10):
img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))
print("FPS %f" % clock.fps())
2 °) In the IDE I put (255,0,0) to have flashing red and in the camera, there will be (1111100000000000) 2 = (63488) 10?
3 °) I was confusing between openMV and Micropyton.
The script seems to run fine on my OpenMV Cam. Using the latest 2.7.0 firmware. Are you using a M7 camera? The M4 is missing a lot of features.
Yes, however, the binary data is stored byte reversed. So, the internal data format is RGB565 like you have below but with the top and bottom bytes swapped. It’s like this because of how the data bus output of the OV7725 camera works.
Let’s say that the 2 functions are not functional. But
// find_lines () is required by the old find_line_segments () #if defined (IMLIB_ENABLE_FIND_LINE_SEGMENTS)
&&! defined (IMLIB_ENABLE_FIND_LINES) #define IMLIB_ENABLE_FIND_LINES #endif
the IMLIB_ENABLE_FIND_LINES function is functional.
??? // # define IMLIB_ENABLE_FIND_LINES and #define IMLIB_ENABLE_FIND_LINES ???
I find the idea to be able to make his own firmware very interesting.
I’m leaving for a few days on vacation. If you have the time, I want you to make me the firmware for the recognition of lines, segments, …
so that I can test on my return.