image.statistics(x,y,1,1)

Hi,

In attached files, you find an image and a program that I wrote to explain my problem
Can you tell me why the results of image.statistics (i, j, 1,1) are not equivalent to the image.rgb_to_lab () conversion function?

Why are not the circles drawn in blue on the test image?

The image.statistics function works perfectly in (sensor.GRAYSCALE)

thank you
tests_OpenMV02_imgStats.py (2.62 KB)
test_imgStats.jpg

At job currently, will look at this tonight. What’s the magnitude of the difference?

The difference is important because image.statics () returns similar values for the three colors,

and the figures draw are only in white.

Sorry for the derangement, later

Ah!

I know the problem!

Stats has to be passed an roi=(i,j,1,1).

MP doesn’t really handle telling you you’re passing arguments to the function incorrectly. Currently, the stats function in your code is ignoring all arguments.

so: img.statistics(roi=(i,j,1,1))

Thanks,

That’s right, thank you for this debug, on the other hand what do you think for the circle that remains white when it should be blue?

You have to pass the color as a keyword argument:

img.draw_circle(i, j, 12, color=color)

Please call the color tuple not “color” too. Call it red, etc.

https://openmv.io/docs/library/omv.image.html#image.image.draw_circle

Please pay attention to the keyword arguments. If you don’t explicitly say the keyword then the argument is ignored.

We can actually make the function forgiving us this in the firmware, but, it gets rather tricky when you have multiple keyword arguments, etc. In the future I suppose the firmware will be built to be more forgiving.

Thanks for your quick and efficient replies, good night