Finding Circle and Color Detection

Discussion related to "under the hood" OpenMV topics.
eeengineer
Posts: 2
Joined: Thu Jan 10, 2019 10:43 am

Finding Circle and Color Detection

Postby eeengineer » Thu Jan 10, 2019 10:54 am

Dear Sirs Good Day

Just 30 minutes ago , I got my new Open Mv M7 product and tried to make simple color dedection with examples which are already included on OpenMV IDE.

But when I try to make resolition (640*480 to VGA) its giving failure like OS ERRRO :IMAGE FORMAT NOT SUPPORTED.

Also I tried to see circle detection with VGA RESULUTION and I GOT SAME FAILURE.


Is there anyway to use together with VGA resulition and two features together(Circle detection and Color Detection) ???


Also when I change the Resulition to VGA FPS is getting slower like 4.2 or lower.(What is the reason for this and not supposed to be 30 fps or not ?)


Thanks a lot.


Best Regards
User avatar
kwagyeman
Posts: 2606
Joined: Sun May 24, 2015 2:10 pm

Re: Finding Circle and Color Detection

Postby kwagyeman » Thu Jan 10, 2019 11:55 am

Hi, we can't process a VGA image with all the algorithms. Please keep in mind you are using a microcontroller with only 512KB of RAM onboard and not a full linux system with GBs of RAM.

find_blobs() works on a VGA image. But, it's rather slow since there's so many pixels to process. Unless you need that extra resolution for accuracy you're wasting compute for no reason. It will not help you in your application if your goal is to look at an object close by.

You want to stick to resolutions of 160x120, or 320x240 if you really need it, for the best results. You only need the higher resolution if you want to do distance and close up image processing at the same time. Most applications don't require this however. If you are working close up then just reducing the resolution is fine. If you are working far away try out a telephoto lens.

...

In regards to find_circles(), that algorithm requires a rather large amount of data structures to work which prevent it from running on images larger than 160x120.
Nyamekye,
eeengineer
Posts: 2
Joined: Thu Jan 10, 2019 10:43 am

Re: Finding Circle and Color Detection

Postby eeengineer » Thu Jan 10, 2019 2:20 pm

Hi

I am a little bit disappointed right now. Because my app requires at least 640x480 res. Bcs of distance requirements whic is at least 600x400 mm.

I don't know even the without any algorithm on mcu 640x480 vga rgb565 fps max looks like b\w 4-5



Please give me some advice to be success on my aps.


Thanks
User avatar
kwagyeman
Posts: 2606
Joined: Sun May 24, 2015 2:10 pm

Re: Finding Circle and Color Detection

Postby kwagyeman » Thu Jan 10, 2019 3:18 pm

Hi, okay, 640x480 runs at 20 fps actually if only using find_blob() in grayscale. If you are in RGB565 it's slower.

Keep in mind that the frame buffer display cuts the frame rate. So, if you click the disable frame buffer button in the IDE you will see your FPS jump. This is the frame rate your actual algorithm in real life will get.

Finally, the find_circles() method can run on a 640x480 image if you use the ROI feature to only select a sub set of the pixels in the array. find_blobs() similarly speeds usp if you do this too.

So, what's your algorithm steps. Do you need to process the entire image? If not, and you only need a particular part then select that area in the IDE frame buffer, you will see a x,y,w,h value under the frame buffer. Then pass that value as a tuple to the roi= argument in find_blobs() this will greatly reduce the work find_blobs() has to do. Then, you can also pass the x_stride and y_stride options to further speed up the processing of the image. x_stride and y_stride allow find_blobs() to search less pixels for the starting point of a blob. However, the algorithm is still pixel accurate when connecting all pixels within a blob.

As for find_circles(), if you use find_blobs() to find the initial blob you can then call find_circles() on the blob ROI to skip having to process the whole image. Additionally, you can specify a minimum and maximum radius for the method to look for greatly increasing the algorithms speed since it will no longer hace to search for all radisues possible in an ROI.

(ROI means region of interest).

Anyway, there are tricks you can do to speed things up and reduce memory usage. I think find_circles() also supports the stride arguments.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests