Exclude portion of image?

Love our H7’s, they are truly fantastic.

They are working great to find colored objects - now in windowed 640x480 thanks to your advice >>>

sensor.set_windowing((100,0,420,480))

We’re trying to optimize the fps by excluding a region in the center of the image that will never change from the image.find_blobs call.

Something like an inverted ROI would be perfect - and it appears that the image.mask_rectangle/mask_circle/mask_ellipse functions might appear to help. However, when we test with these, they perform the exact OPPOSITE function - excluding everything not in the mask.

Can you suggest any options?

Thanks,

Yes that’s what mask functions do they mask everything except the shape. Maybe you need to draw a filled object ? Try draw_rectangle(…, fill=True)
http://docs.openmv.io/library/omv.image.html?highlight=draw#image.image.draw_rectangle

WOW! You are amazing and appreciated with the lighting fast response!

Running this code snippet we get the following image in the IDE. The entire image is black except for the area we want to mask out, which is exactly the opposite of what we’re looking for.

Any advice on what we’re doing wrong is appreciated!

while(True):
    clock.tick()
    sensor.set_windowing((WindowStartX,WindowStartY,WindowSizeX,WindowSizeY))
    img = sensor.snapshot() 
    img.mask_circle(150,150,50)

    for blob in img.find_blobs(thresholds, pixels_threshold=25, area_threshold=25):

Also tried the following with the same result

while(True):
    clock.tick()
    sensor.set_windowing((WindowStartX,WindowStartY,WindowSizeX,WindowSizeY))
    img = sensor.snapshot() 

    for blob in img.mask_circle(150,150,50).find_blobs(thresholds, pixels_threshold=25, area_threshold=25):

Mask.png

I answered your question already, try draw_circle with fill = True:

img.draw_circle(img.width()//2, img.height()//2, 100, (0, 0, 0), fill=True)

Also please see the docs:

http://docs.openmv.io/library/omv.image.html?highlight=draw#image.image.draw_circle

Thanks! That makes sense and was far too easy :smiley: