Area_Threshold vs Pixel_Threshold

OpenMV related project discussion.
Chris19
Posts: 19
Joined: Tue Apr 23, 2019 5:28 pm

Area_Threshold vs Pixel_Threshold

Postby Chris19 » Tue Apr 23, 2019 7:28 pm

Good Day!

From the find_blobs definition https://docs.openmv.io/library/omv.imag ... find_blobs we have
image.find_blobs(thresholds[, invert=False[, roi[, x_stride=2[, y_stride=1[, area_threshold=10[, pixels_threshold=10[, merge=False[, margin=0[, threshold_cb=None[, merge_cb=None[, x_hist_bins_max=0[, y_hist_bins_max=0]]]]]]]]]]]])

. . .

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.


When should area_threshold be used vs pixel_threshold vs both? Which is faster and/or optimal?

Your sample programs use both - but our team cannot figure out why:

Code: Select all

    for blob in img.find_blobs([threshold], pixels_threshold=100, area_threshold=100, merge=True, margin=10):
Thanks,
User avatar
kwagyeman
Posts: 3188
Joined: Sun May 24, 2015 2:10 pm

Re: Area_Threshold vs Pixel_Threshold

Postby kwagyeman » Tue Apr 23, 2019 7:46 pm

It enforces blob density. E.g. the blob is large and mostly full of matching pixels. You don't need to check both however.
Nyamekye,
Chris19
Posts: 19
Joined: Tue Apr 23, 2019 5:28 pm

Re: Area_Threshold vs Pixel_Threshold

Postby Chris19 » Wed Apr 24, 2019 5:40 am

Thanks, that makes sense!

So when would you only use one and when do you recommend using both Area and Pixel in the search parameters?
User avatar
kwagyeman
Posts: 3188
Joined: Sun May 24, 2015 2:10 pm

Re: Area_Threshold vs Pixel_Threshold

Postby kwagyeman » Wed Apr 24, 2019 2:00 pm

I recommend both to filter out noise pixels. It's quite hard to get color bounds setup to only target some pixel. So, these values are essential for removing noise blobs. Thus you can relax color bounds.
Nyamekye,
Chris19
Posts: 19
Joined: Tue Apr 23, 2019 5:28 pm

Re: Area_Threshold vs Pixel_Threshold

Postby Chris19 » Wed Apr 24, 2019 6:54 pm

Thanks! Very appreciated

Return to “Project Discussion”

Who is online

Users browsing this forum: Bing [Bot] and 14 guests