没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
#include "stdafx.h"
#include <iostream>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <math.h>
using namespace std;
/*
coded and updated by Huang, Haiqiao 2010-01-13
Examples of using cvHoughLines2 and cvHoughCircles
*/
int main(int argc, char** argv)
{
int i;
//cout << "Lines and Circles OpenCV!"<<endl; //\\cameraman.jpg
//char* filename="D:\\OpenCV_stuff\\SampleImages\\pattern512.bmp";
IplImage* imgRGB = cvLoadImage(filename);
IplImage* imgGrey = cvLoadImage(filename,0); //grey image
char* filename1="D:\\OpenCV_stuff\\SampleImages\\circle3.jpg";
IplImage* imgcircle = cvLoadImage(filename1,1); //color image
if (imgGrey==NULL){
cout << "No valid image input."<<endl;
char c=getchar();
return 1;
}
IplImage* cannyImg = cvCreateImage(cvSize(imgGrey->width,imgGrey->height),IPL_DEPTH_8U,1);
cvCanny(imgGrey,cannyImg,170,200,3);
#include <iostream>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <math.h>
using namespace std;
/*
coded and updated by Huang, Haiqiao 2010-01-13
Examples of using cvHoughLines2 and cvHoughCircles
*/
int main(int argc, char** argv)
{
int i;
//cout << "Lines and Circles OpenCV!"<<endl; //\\cameraman.jpg
//char* filename="D:\\OpenCV_stuff\\SampleImages\\pattern512.bmp";
IplImage* imgRGB = cvLoadImage(filename);
IplImage* imgGrey = cvLoadImage(filename,0); //grey image
char* filename1="D:\\OpenCV_stuff\\SampleImages\\circle3.jpg";
IplImage* imgcircle = cvLoadImage(filename1,1); //color image
if (imgGrey==NULL){
cout << "No valid image input."<<endl;
char c=getchar();
return 1;
}
IplImage* cannyImg = cvCreateImage(cvSize(imgGrey->width,imgGrey->height),IPL_DEPTH_8U,1);
cvCanny(imgGrey,cannyImg,170,200,3);
资源评论
- wj25926322012-09-10没怎么用着,貌似只能检测圆
- liboauto2011-12-11只能检测规则的圆
- fernandomclaren2011-11-14直接用了opencv的内置函数,不好
- bbs61872012-06-21假的,只能检测园
yutin102
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功