weilin_1216

导航

2013年7月3日

使用floodfill()函数颜色填充一个联通的区域

摘要: 使用floodfill()函数:#include "opencv2/imgproc/imgproc.hpp"#include "opencv2/highgui/highgui.hpp"#include using namespace cv;using namespace std;//floodfill()//Fills a connected component with the given color.static void help(){ cout = 2 ? argv[1] : (char*)"pic5.png"; image0 阅读全文

posted @ 2013-07-03 14:45 weilin_1216 阅读(819) 评论(0) 推荐(0) 编辑

opencv图像分割

摘要: 本次试验基于opencv2.4.5版本中自带的一个sample。其主要过程是,首先设置好参数,然后用函数pyrMeanShiftFiltering()对输入的图像进行分割。分割后的结果保存在该函数的第二个参数即输出图像中,最后根据该分割图像的特点用floodFill()函数对其分割的结果用不同的颜色进行填充。实现代码如下:#include "opencv2/highgui/highgui.hpp"#include "opencv2/core/core.hpp"#include "opencv2/imgproc/imgproc.hpp" 阅读全文

posted @ 2013-07-03 10:30 weilin_1216 阅读(891) 评论(0) 推荐(0) 编辑