Grayscale Blob Detection

Discussion related to "under the hood" OpenMV topics.
jimmie
Posts: 22
Joined: Wed Aug 21, 2019 11:22 pm

Grayscale Blob Detection

Postby jimmie » Sun Sep 01, 2019 11:51 am

I would appreciate help in the format of the statement needed to detect "large" blobs in a grayscale image?

In my application, I am not interested in detecting color, rather, I want to detect larger objects regardless of their color.

For example, for the statement:

Code: Select all

 img.find_blobs(thresholds, pixels_threshold=200, area_threshold=200)
What does one use for thresholds and pixels_threshold in this case? I am very new to OpenMV and would appreciate some help.

Thanks in advance.
User avatar
iabdalkader
Posts: 1142
Joined: Sun May 24, 2015 3:53 pm

Re: Grayscale Blob Detection

Postby iabdalkader » Sun Sep 01, 2019 12:17 pm

If a blob’s bounding box area is less than area_threshold it is filtered out.

If a blob’s pixel count is less than pixel_threshold it is filtered out.
Please see the docs for the meaning of the args:

http://docs.openmv.io/library/omv.image ... find_blobs
User avatar
kwagyeman
Posts: 3829
Joined: Sun May 24, 2015 2:10 pm

Re: Grayscale Blob Detection

Postby kwagyeman » Sun Sep 01, 2019 12:17 pm

Thresholds is a list of grayscale upper and lower tuples.

[(100, 255), (0, 50)] and etc. All pixels with values in it are considered part of a blob, all pixels out of it are not the blob. The API is clear on this...

Pixels_threshold removes blobs that are too small (e.g. noise) from the list of output blobs if they don't meet he pixel threshold. I.e. the number of connected pixels in the blob is less than the threshold.
Nyamekye,
jimmie
Posts: 22
Joined: Wed Aug 21, 2019 11:22 pm

Re: Grayscale Blob Detection

Postby jimmie » Sun Sep 01, 2019 12:48 pm

Thank you gentlemen.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests