Creating contour and then perform pixel analysis (OpenCV)

If I have an RGB image and a binary mask (1 channel), and I want to create contours for the RGB image based on the connected pixels of the binary mask. After that I want to compare the pixel values (eg check if each pixel in the contours is having a blue value > 150), then how can I implement the above by using OpenCV?

Thanks a lot!


Assuming the images are the same size and shape then simply scan over the pixels in the binary image looking for the contours and check the pixel values at the same row/col in the color image

See Fastest way to extract individual pixel data? for details

链接地址: http://www.djcxy.com/p/89722.html

上一篇: 在使用ROI(OpenCV)识别区域之后在图像上绘制矩形

下一篇: 创建轮廓,然后执行像素分析(OpenCV)