Page 1 of 1

upper quartile

Posted: Thu Jun 13, 2019 10:42 am
by chrisPyres66
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 :

Code: Select all

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,

Re: upper quartile

Posted: Wed Jun 19, 2019 11:25 am
by kwagyeman
Hi, I need to answer this. Will do in a few hours.

Re: upper quartile

Posted: Fri Jul 05, 2019 5:45 am
by chrisPyres66
Up for memory :)

Re: upper quartile

Posted: Fri Jul 05, 2019 12:00 pm
by kwagyeman
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.

Re: upper quartile

Posted: Tue Jul 09, 2019 1:48 am
by kwagyeman
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: https://github.com/openmv/openmv/issues/548