# Finding Circle and Color Detection

**URL:** https://forums.openmv.io/t/finding-circle-and-color-detection/1074
**Category:** OpenMV Boards
**Created:** [January 10, 2019, 3:54pm UTC](https://forums.openmv.io/t/finding-circle-and-color-detection/1074 "2019-01-10T15:54:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![eeengineer](https://avatars.discourse-cdn.com/v4/letter/e/df705f/32.png) [@eeengineer](https://forums.openmv.io/u/eeengineer)
#### Post date: [January 10, 2019, 3:54pm UTC](https://forums.openmv.io/t/finding-circle-and-color-detection/1074/1 "2019-01-10T15:54:11Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [January 10, 2019, 4:55pm UTC](https://forums.openmv.io/t/finding-circle-and-color-detection/1074/2 "2019-01-10T16:55:23Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![eeengineer](https://avatars.discourse-cdn.com/v4/letter/e/df705f/32.png) [@eeengineer](https://forums.openmv.io/u/eeengineer)
#### Post date: [January 10, 2019, 7:20pm UTC](https://forums.openmv.io/t/finding-circle-and-color-detection/1074/3 "2019-01-10T19:20:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [January 10, 2019, 8:18pm UTC](https://forums.openmv.io/t/finding-circle-and-color-detection/1074/4 "2019-01-10T20:18:56Z")

</div>

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.
