upper quartile

Discussion related to "under the hood" OpenMV topics.
User avatar
chrisPyres66
Posts: 104
Joined: Mon Jul 16, 2018 9:22 am
Location: France

upper quartile

Postby chrisPyres66 » Thu Jun 13, 2019 10:42 am

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,
User avatar
kwagyeman
Posts: 3134
Joined: Sun May 24, 2015 2:10 pm

Re: upper quartile

Postby kwagyeman » Wed Jun 19, 2019 11:25 am

Hi, I need to answer this. Will do in a few hours.
Nyamekye,
User avatar
chrisPyres66
Posts: 104
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Re: upper quartile

Postby chrisPyres66 » Fri Jul 05, 2019 5:45 am

Up for memory :)
User avatar
kwagyeman
Posts: 3134
Joined: Sun May 24, 2015 2:10 pm

Re: upper quartile

Postby kwagyeman » Fri Jul 05, 2019 12:00 pm

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.
Nyamekye,
User avatar
kwagyeman
Posts: 3134
Joined: Sun May 24, 2015 2:10 pm

Re: upper quartile

Postby kwagyeman » Tue Jul 09, 2019 1:48 am

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
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests