识别Paint

时间:2018-07-26 06:01:21

标签: opencv computer-vision

我有几张照片。其中一些具有由Paint添加的线条,圆圈和手。我想识别一张具有用单色着色的手写轮廓或图元的照片。

1 个答案:

答案 0 :(得分:0)

一个好的开始是将源图像的所有3个RGB通道分开,然后在3个通道上应用一些经典的高斯模糊和自适应阈值以及findCountour()方法。

要提取所有3个RGB通道,请使用以下代码(source):

Mat src = imread("img.png",CV_LOAD_IMAGE_COLOR); //load  image

Mat bgr[3];   //destination array
split(src,bgr);//split source  

//Note: OpenCV uses BGR color order
imwrite("blue.png",bgr[0]); //blue channel
imwrite("green.png",bgr[1]); //green channel
imwrite("red.png",bgr[2]); //red channel