When averaging pixel values as proposed in Get RGB histogram statistics (not in LAB format!) - #5 by kwagyeman, is the average taken from the raw uncompressed (not jpeg compressed) RGB565 image? What is the exact processing pipeline here? RGB565 → lab888 → avg() → send()?
The script below shows the code I’m using to calculate the average on an OpenMV H7 plus.
import sensor, image, utime, pyb, omv
omv.disable_fb(True)
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.ioctl(sensor.IOCTL_SET_READOUT_WINDOW, (0,0,800,600))
sensor.set_framesize(sensor.SVGA)
sensor.set_windowing((300,300))
sensor.skip_frames(time = 2000)
while True:
F1 = utime.ticks_ms()/1000
img = sensor.snapshot()
h = img.histogram().get_statistics()
LABvals = (h[0], h[8], h[16]) #LAB
RGBvals = image.lab_to_rgb(LABvals)
print(RGBvals)
F2 = utime.ticks_ms()/1000
print("FPS: ", 1/(F2-F1))