大作业2(Sobel算子)
来源:互联网 发布:世界顶级音乐学院知乎 编辑:程序博客网 时间:2024/06/06 03:16
include
include
using namespace cv;
int main(int argc, char **argv){
Mat src = imread(“C:/opencv/test.jpg”);
if (src.empty()){
printf(“could not load image..\n”);
return -1;
}
namedWindow(“MyWindow”, CV_WINDOW_AUTOSIZE);
imshow(“MyWindow”, src);
Mat dst, gray_dst;
GaussianBlur(src, src, Size(3, 3), 0, 0);
cvtColor(src, gray_dst, CV_BGR2GRAY);
Mat kernel_x = (Mat_(3, 3) << -1, 0, 1, -2, 0, 2, -1, 0, 1);
Mat kernel_y = (Mat_(3, 3) << -1, -2, -1, 0, 0, 0, 1, 2, 1);
Mat mat_x, mat_y;
filter2D(gray_dst, mat_x, -1, kernel_x, Point(-1, -1));
filter2D(gray_dst, mat_y, -1, kernel_y, Point(-1, -1));
imshow(“kernel_x”, mat_x);
imshow(“kernel_y”, mat_y);
addWeighted(mat_x, 0.5, mat_y, 0.5, 0, dst);
imshow(“Final”, dst);
cvWaitKey(0);
return 0;
}
- 大作业2(Sobel算子)
- sobel算子(转)
- Sobel算子
- Sobel算子
- sobel算子
- Sobel算子
- Sobel算子
- sobel算子
- Sobel算子
- sobel算子
- Sobel算子
- sobel算子
- 边缘检测(Sobel算子,拉普拉斯算子,Canny算子)
- Sobel算子边缘检测(vc实现)
- Sobel算子边缘检测(vc实现)
- OpenCV-Python教程(6、Sobel算子)
- Sobel算子(cvSobel)边缘检测
- Sobel算子及cvSobel(二)
- 2017多校第二场 HDU 6040 Hints of sd0061 快速排序
- string的find和find_first_of的区别
- CODEVS 1343(伸展树)
- 使用Composer安装Laravel
- 二叉搜索树
- 大作业2(Sobel算子)
- 单片机——按键扫描
- 自定义函数实现strcpy,strcat,strcmp的功能
- C语言——实例015 条件运算符,成绩等级
- Detecting Visual Relationships with Deep Relational Networks(阅读笔记)
- spark读写hbase
- 大作业3(验证码处理)
- POJ 3186 Treats for the Cows(区间DP)【区间最大值模板】
- JSP之EL表达式之遍历