寻找白板上的便签条
                            
                            
                            問題來源:http://answers.opencv.org/question/162480/contour-detection-for-gray-stickers-on-white-background/ 題目的大概意思就是這樣的白板,尋找上面的各種便簽條。我找到了橘色的,結(jié)果是這樣
代碼是這樣? ? Mat?src?=?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
? ? imwrite("oragne-stickers-result.png",temp);
此外,我認為在白色的板子上面找白色的便簽條真不是個好的想法,不知道你有什么想法?
來自為知筆記(Wiz)
                            
                        
                        
                        代碼是這樣? ? Mat?src?=?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
? ? imwrite("oragne-stickers-result.png",temp);
此外,我認為在白色的板子上面找白色的便簽條真不是個好的想法,不知道你有什么想法?
來自為知筆記(Wiz)
總結(jié)
 
                            
                        - 上一篇: 密码系统的安全性
- 下一篇: 邮箱app哪个好用 手机邮件软件排行榜
