to detect small foreign objects

Very sorry …
Please kindly continue to teach.

Can you post what else you were asking?

Below is my question:

  1. What is the effect if the offset value is increased or decreased?
    By using this new method:
  2. Does the object color/grayscale threshold value still have to be defined?
  3. Does img.mean() has a returned object, so draw_rectangle() can be used on found object?


  1. Was answered above.

  2. No more work on that is needed.

  3. Do:

img.find_blobs([(90, 100, -128, 127, -128, 127)])

For a RGB565 image and:

img.find_blobs([(250, 255)])

For a grayscale image.

After the automatic thresholding is run pixels will only be 0 to max values. So, the thresholds to be used with find_blobs are now constants.

Thank you for your advice.
I have tried the attached script and I receive “OSError: Image format is not supported” message when set the frame size to VGA.
Does img.mean() not work in VGA mode?

You can do VGA in grayscale. But, not in RGB565. This is because for RGB565 (for VGA) mode we actually switch to operating in bayer pattern mode and jpeg compress the images to get video output. We have to do this because we don’t have the RAM for a full VGA RGB565 image. Anyway, VGA for RGB565 is just for taking jpeg compressed images and nothing else.

Thanks again for your guidance.

Regarding the thresholds constant, what exactly does each value in the threshold variable do?

Im trying to do the same thing but I dont understand what each value is representing?

Ex: thresholds = (70, 100, -128, 127, -128, 127)

I saw this example code below, which makes sense. Which finds extremely bright areas. But why use more than 2 values?

The below grayscale threshold is set to only find extremely bright white areas.

thresholds = (245, 255)

Hi, those values correspond to thresholds on the LAB color settings:

L, A, and B define the LAB color space. L is the lighting, and A/B define the color. The thresholds are then (LMin, LMax, AMin, AMax. BMin, BMax). L goes from 0-100, A/B go from -128 to 127.

Grayscale just has 0-255 which maps roughly to the 0-100 for L.

What lense do you use for this small object ?
Can I use this lense ?

Buy it and try it out. I don’t know. It’s not a magnification lens however.

can you suggest which magnification lense I should use ?

Sorry, I don’t have any information on which ones to use.