upper quartile

Dear all,

I try to analyse area of image, and i get different values of upper quartile for the same area.
Here is the test code :

import sensor, image, time

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time=1000)

while(True):
   img = sensor.snapshot()
   #Uq_mask = img.draw_rectangle(120, 0, 200, 240, color = (0, 0, 0), fill = True, copy_to_fb=True).get_statistics(threshold=[(10,255)]).uq()
   Uq_roi =  img.histogram(roi=(0, 0, 120, 240)).get_statistics().uq()
   #Uq_mask = img.draw_rectangle(120, 0, 200, 240, color = (0, 0, 0), fill = True).histogram(threshold=[(10,255)]).get_statistics().uq()
   Uq_mask = img.draw_rectangle(120, 0, 200, 240, color = (0, 0, 0), fill = True).get_statistics(threshold=[(10,255)]).uq()
   print(Uq_roi, Uq_mask)
   print(" -------------------------- ")
   time.sleep(1000)

It seems the threshold does not work to get supper quartile through histogram or get_statistics (in documentation it is thresholds but it does not work at all).
Any help would be very appreciated ?

Thanks,

Hi, I need to answer this. Will do in a few hours.

Up for memory :slight_smile:

Sorry about now answering this yet… In Boston for a Wedding. Can you just email me this to do? I can track things better there.

Hi, okay, I sat down and I see what you are doing.

So… the threshold argument doesn’t adjust the count of pixels sampled it looks like. This would be a bug.

Good find: Threshold arugment of get_histogram() doesn't adjust number of pixels sampled. · Issue #548 · openmv/openmv · GitHub