資源簡介
基于opencv的輪廓和園檢測,可以由于圓形目標的檢測
代碼片段和文件信息
#include?
#include?
#include?
int?main(int?argc?char**?argv)
{
IplImage*?img;
if(?argc?==?2?&&?(img=cvLoadImage(argv[1]?1))!=?0)
{
IplImage*?gray?=?cvCreateImage(?cvGetSize(img)?8?1?);
CvMemStorage*?storage?=?cvCreateMemStorage(0);
cvCvtColor(?img?gray?CV_BGR2GRAY?);
cvSmooth(?gray?gray?CV_GAUSSIAN?9?9?);?//?smooth?it?otherwise?a?lot?of?false?circles?may?be?detected
?CvSeq*?circles?=?cvHoughCircles(?gray?storage?CV_
- 上一篇:MFC_酒店管理系統
- 下一篇:用C語言實現八數碼問題的寬度優先搜索
評論
共有 條評論