问题来源: http://answers.opencv.org/question/162480/contour-detection-for-gray-stickers-on-white-background/
题目的大概意思就是这样的白板,寻找上面的各种便签条。
我找到了橘色的,结果是这样
代码是这样
= imread( "gray-stickers.png");
Mat temp;
vector <Mat > planes;
cvtColor(src,src,COLOR_BGR2HSV);
split(src,planes);
//open method
Mat element = getStructuringElement(MORPH_RECT,cv :
:Size(
33,
33));
cv : :morphologyEx(planes[
1],temp,MORPH_OPEN,element);
//threshold
threshold(temp,temp, 100, 255,THRESH_OTSU);
//yeah!find the orange
"oragne-stickers-result.png"
此外,我认为在白色的板子上面找白色的便签条真不是个好的想法,不知道你有什么想法?
标签:src,temp,白板,寻找,planes,threshold,签条,stickers From: https://blog.51cto.com/jsxyhelu2017/5968411