Hi,
Noob question here : is there a way to assign a constant value for a rectangle in an image object?
I’m trying to have a black image and update it with white boxes. This would look something like:
while(True):
img = sensor.snapshot().histeq() # data image
imbin=img.clear() #mask image to be updated, initially set to zero
for r in ROIS: #I establish a ROIS list
blobs = img.find_blobs([thresholds[threshold_index]], roi=r[0:4], merge=False)
if blobs: # Find index of blob with most pixels.
most_pixels = 0
largest_blob = 0
for i in range(len(blobs)):
if blobs[i].pixels() > most_pixels:
most_pixels = blobs[i].pixels()
largest_blob = i
#Now I want update binary image with value= (255,255,255) for blobs[largest_blob].rect()
imbin.set_value(blobs[largest_blob].rect(),(255,255,255)) #What is the best way for this??