logo

二值化图像之后,白色为0,黑色为1,如何把白色像素数量统计出来?

2022-05-05 11:37
K
_5bx3
29141a74-01f3-4446-af0e-204c81dd7ae6.png
2022-05-05 20:07
I
网红小智智 星瞳科技

https://docs.singtown.com/micropython/zh/latest/openmvcam/library/omv.image.html#image.Image.image.get_histogram

https://book.openmv.cc/example/10-Color-Tracking/image-histogram-info.html

bin参数为2,那么一个是黑色的百分比,一个是白色的百分比。