i have made already an inspection that workings on 60 fps in WVGA2 and 50 pixels high with:
sensor.set_windowing((752, 50))
this works great on 60 frames per second!
img = sensor.snapshot() # Take a picture and return the image.
blob_list1 = img.find_blobs([thresholds],invert=False,roi=(0,0,50,50),pixels_threshold=200, area_threshold=200, merge=True)
blob_count1 = len(blob_list1)
if blob_count1>0:
led.on()
else:
led.off()
for blob in blob_list1:
img.draw_rectangle(blob.rect())
img.draw_cross(blob.cx(), blob.cy())
when i am trying to use a second blob for a second area the fps dicrease to 30 fps.
But if i use more find blobs the fps remains the same 30fps.
This is the code for all 4 find blobs:
img = sensor.snapshot() # Take a picture and return the image.
blob_list1 = img.find_blobs([thresholds],invert=False,roi=(0,0,50,50),pixels_threshold=200, area_threshold=200, merge=True)
blob_count1 = len(blob_list1)
if blob_count1>0:
led.on()
else:
led.off()
for blob in blob_list1:
img.draw_rectangle(blob.rect())
img.draw_cross(blob.cx(), blob.cy())
blob_list2 = img.find_blobs([thresholds],invert=False,roi=(100,0,50,50),pixels_threshold=200, area_threshold=200, merge=True)
blob_count2 = len(blob_list2)
if blob_count2>0:
led1.on()
else:
led1.off()
for blob in blob_list2:
img.draw_rectangle(blob.rect())
img.draw_cross(blob.cx(), blob.cy())
blob_list3 = img.find_blobs([thresholds],invert=False,roi=(200,0,50,50),pixels_threshold=200, area_threshold=200, merge=True)
blob_count3 = len(blob_list3)
if blob_count3>0:
led2.on()
else:
led2.off()
for blob in blob_list3:
img.draw_rectangle(blob.rect())
img.draw_cross(blob.cx(), blob.cy())
blob_list4 = img.find_blobs([thresholds],invert=False,roi=(300,0,50,50),pixels_threshold=200, area_threshold=200, merge=True)
blob_count4 = len(blob_list4)
if blob_count4>0:
led.on()
else:
led.off()
for blob in blob_list4:
img.draw_rectangle(blob.rect())
img.draw_cross(blob.cx(), blob.cy())
what is your opinion? is this ok?
why the inspection time is the same with 2,3,4 find blobs and with only one find blob is too much faster?
DO i miss something again?