首页 > 其他分享 >寻找白板上的便签条

寻找白板上的便签条

时间:2022-12-25 22:05:00浏览次数:65  
标签:src temp 白板 寻找 planes threshold 签条 stickers

问题来源: ​​http://answers.opencv.org/question/162480/contour-detection-for-gray-stickers-on-white-background/​


寻找白板上的便签条_jj


题目的大概意思就是这样的白板,寻找上面的各种便签条。


我找到了橘色的,结果是这样




寻找白板上的便签条_jj_02


代码是这样


​​= 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

相关文章