canny边沿检测2
来源:互联网 发布:发卡平台源码免签约 编辑:程序博客网 时间:2024/04/29 03:10
#include "cv.h"#include "highgui.h"char wndname[] = "Edge";char tbarname[] = "Threshold";int edge_thresh = 1;IplImage *image = 0, *cedge = 0, *gray = 0, *edge = 0;// 定义跟踪条的 callback 函数void on_trackbar(int h){cvSmooth( gray, edge, CV_BLUR, 3, 3, 0 );//////////////////////////////////////////////////////////////cvNot( gray, edge );////////////////////////////////////////////////////////////////////////////// 对灰度图像进行边缘检测cvCanny(gray, edge, (float)edge_thresh, (float)edge_thresh*3, 3);cvZero( cedge );// copy edge pointscvCopy( image,cedge,edge );//掩码到彩色图像上,没这句话就是灰度图像// 显示图像cvShowImage(wndname, cedge);}int main( int argc, char** argv ){image = cvLoadImage("f:\\vc\\cv\\adc.jpg", 1);// Create the output imagecedge = cvCreateImage(cvSize(image->width,image->height), IPL_DEPTH_8U, 3);// 将彩色图像转换为灰度图像gray = cvCreateImage(cvSize(image->width,image->height), IPL_DEPTH_8U, 1);edge = cvCreateImage(cvSize(image->width,image->height), IPL_DEPTH_8U, 1);cvCvtColor(image, gray, CV_BGR2GRAY);// Create a windowcvNamedWindow(wndname, 1);// create a toolbar cvCreateTrackbar(tbarname, wndname, &edge_thresh, 100, on_trackbar); //需要手动触发// Show the imageon_trackbar(0);// Wait for a key stroke; the same function arranges events processingcvWaitKey(0);cvReleaseImage(&image);cvReleaseImage(&gray);cvReleaseImage(&edge);cvDestroyWindow(wndname);return 0;}
0 0
- canny边沿检测2
- canny边沿检测
- 边沿检测
- 边沿检测
- Canny边缘检测2
- canny边缘检测2
- 边沿检测(转)
- 边沿检测(转)
- FPGA的边沿检测
- 边沿检测技术
- FPGA的边沿检测
- cvfindcontours边沿检测
- halcon 边沿检测识别
- FPGA的边沿检测
- 边沿检测&门控时钟
- FPGA的边沿检测
- Verilog 脉冲边沿检测
- OPENCV例程2 :CANNY算子边缘检测
- Java内存模型FAQ(五)旧的内存模型有什么问题?
- C++实验2-标准体重
- 报错:jstl标签——The absolute uri: http://java.sun.com/jsp/jstl/core cannot beresolved in either web.xml o
- 【Java】线程的创建和启动
- VisionMobile:2015年Android使用的全球趋势(五)Android演进导致更少解锁
- canny边沿检测2
- Java内存模型FAQ(六)没有正确同步的含义是什么?
- 搭建 Cocos2d-html5环境与webstorm的配置
- 开发人员系统功能设计常用办公软件分享
- QT学习
- 双系统开机 进入grub resource,并且进不bios
- 第二次上机实验(标准体重)
- 网易2016-3-22笔试回顾
- c++实验2项目1