Finding small circles

Discussion related to "under the hood" OpenMV topics.
doodah
Posts: 33
Joined: Wed Jan 30, 2019 10:15 pm

Finding small circles

Postby doodah » Thu Jan 30, 2020 5:16 pm

I am trying to locate white circles on a dark, consistent and static background. I was originally using a standard lens and find_circles pretty successfully. I experimented with a fisheye and realized how much more area I can cover. The downside is that the circles are so small that the find_circles algorithm doesn't seem to find them (as low as a 2 pixel radius.) I looked at find_blobs, but unlike the find_circles method there is only a minimum blob size and no upper bound. I know I can filter after the fact with blob.area, but I was wondering if putting an upper bound to the find_blobs would improve performance like it does withe find_circles.

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

Re: Finding small circles

Postby kwagyeman » Thu Jan 30, 2020 5:40 pm

A 2 pixel radius is not really seeable. Um, can you post some pictures from the camera?

Also, find_circles is scheduled for optimization. We can get some massive gains on its performance.
Nyamekye,
doodah
Posts: 33
Joined: Wed Jan 30, 2019 10:15 pm

Re: Finding small circles

Postby doodah » Thu Jan 30, 2020 6:05 pm

Picture attached with an arrow pointing at what I'm trying to locate. This is in my (messy) shop, but when it's in its intended environment, the background will be very consistent.

If I can figure out how to reliably find something this small, then I can use a fisheye lens and reduce the camera count from 4 to 2 in my product. If I can't then I need to use 4 cameras and will go back to find_circles. I'd still like to contribute to it, and will send you an email.

Thanks!
Attachments
test.jpg
User avatar
kwagyeman
Posts: 4230
Joined: Sun May 24, 2015 2:10 pm

Re: Finding small circles

Postby kwagyeman » Fri Jan 31, 2020 1:17 am

The circle detector technically can see those... but the noise floor from other things is so high that it will pickup a lot of other stuff too... i.e. there is a white patch near the top right that would be detected too.

Anyway, just use find_blobs(). Regarding detection speed... the algorithm iterates over all blobs it finds and then applies the size filter on blobs. The lower bound doesn't improve the speed, it just filters out smaller blobs from the result. If you want to make it go faster there's a stride option that can speed it up but then it might miss small objects. Find_blobs() hits 20 FPS on grayscale VGA however. it should be fast enough.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests