[英]Best way to measure area using OpenCV
enter image description here在此处输入图片说明
I'm trying to measure the orange-colored area in the image above using OpenCV.我正在尝试使用 OpenCV 测量上图中的橙色区域。 The orange area I mean here is the high temperature area.
我这里的橙色区域是高温区域。 The scale on the right is the color scale of the temperature for this thermal camera imaging and my target area is from 250 degree Celcius and above.
右侧的刻度是此热像仪成像的温度色标,我的目标区域是 250 摄氏度及以上。
I haven't actually coded yet, but from what I think the best way to measure this is using histogram computation for a certain range, thus getting the area.我还没有真正编码,但我认为最好的测量方法是使用一定范围的直方图计算,从而得到面积。
Is there any better way to do this?有没有更好的方法来做到这一点?
Any kind of help is very much appreciated.非常感谢任何形式的帮助。
Convert to grayscale 1 channel image, then blur and threshold.转换为灰度 1 通道图像,然后模糊和阈值。 Also you may try growing region algorithm or watershed algorithm instead thresholding.
您也可以尝试使用增长区域算法或分水岭算法代替阈值。 Anyway, segmentation will give you mask of region, then use cv.countNonZero(), to get number of white pixels.
无论如何,分割将为您提供区域掩码,然后使用 cv.countNonZero() 来获取白色像素的数量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.