Find Dominant Color in a region

Hello,

This is my first post and I am excited to be using my OpenMV cam.

Let us say I take a snapshot of an image like the one attached.

How can I find out the dominant color in the black rectangular region of the image? (For example in the attached image the dominant color is red.)

Thanks in advance.
region.jpg

Use the get_stats() method with an ROI set to the area. Then return the mode state which is the dominant color.

Thank you.