• 大小: 2.16MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-08
  • 语言: 其他
  • 标签: 检测  椭圆  

资源简介

很好的检测圆的代码,直接下在可以使用,自己写的很实用,稳定性好

资源截图

代码片段和文件信息

#include “cv.h“
#include “cxcore.h“
#include “highgui.h“

int main()
{
IplImage* srcImg* grayImg;

if ( (srcImg=cvLoadImage(“a.jpg“1))==0)
{
return -1;
}

grayImg=cvCreateImage(cvGetSize(srcImg)81);
    
cvCvtColor(srcImggrayImgCV_BGR2GRAY);
cvSmooth(grayImggrayImgCV_GAUSSIAN99);
    
srcImg->origin=0;
grayImg->origin=1;
CvMemStorage *memstorage=cvCreateMemStorage(0);

CvSeq * Circles=cvHoughCircles(grayImgmemstorageCV_HOUGH_GRADIENT2grayImg->height/8200100);

for (int i=0;itotal;i++)

float* p=(float*)cvGetSeqElem(Circlesi);
    cvCircle(srcImgcvPoint(cvRound(p[0])cvRound(1))3CV_RGB(25500)-180);
cvCircle(srcImgcvPoint(cvRound(p[0])cvRound(1))cvRound(p[2])CV_RGB(00255)380);
}

cvNamedWindow( “circles“ 1 );
cvShowImage( “circles“ srcImg );
//cvNamedWindow(“grayImg“);
//cvShowImage(“grayImg“grayImg);
    cvWaitKey();
return 0;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        547  2011-03-24 16:41  Hough检测圆\Hough检测圆.dsw

     文件      41984  2011-05-04 15:32  Hough检测圆\Hough检测圆.ncb

     文件     164864  2011-05-04 15:30  Hough检测圆\Debug\vc60.idb

     文件      94208  2011-05-04 15:18  Hough检测圆\Debug\vc60.pdb

     文件     199300  2011-05-04 15:18  Hough检测圆\Debug\Hough检测圆.ilk

     文件     188493  2011-05-04 15:18  Hough检测圆\Debug\Hough检测圆.exe

     文件       1011  2011-04-26 17:46  Hough检测圆\Debug\Hough检测圆.log

     文件         76  2011-04-26 17:46  Hough检测圆\Debug\Hough检测圆.lastbuildstate

     文件          0  2011-04-26 17:46  Hough检测圆\Debug\Hough检测圆.unsuccessfulbuild

     文件      19456  2011-04-26 17:46  Hough检测圆\Debug\vc100.idb

     文件      36864  2011-04-26 17:46  Hough检测圆\Debug\vc100.pdb

     文件        284  2011-04-26 17:46  Hough检测圆\Debug\CL.read.1.tlog

     文件        182  2011-04-26 17:46  Hough检测圆\Debug\CL.write.1.tlog

     文件        656  2011-04-26 17:46  Hough检测圆\Debug\cl.command.1.tlog

     文件     459776  2011-05-04 15:18  Hough检测圆\Debug\Hough检测圆.pdb

     文件     736040  2011-05-04 15:18  Hough检测圆\Debug\Hough检测圆.pch

     文件      16628  2011-05-04 15:18  Hough检测圆\Debug\Hough检测圆.obj

     文件      82429  2009-09-27 05:48  Hough检测圆\1.jpg

     文件        256  2011-05-04 15:30  Hough检测圆\Hough检测圆.plg

     文件      72860  2011-03-24 17:27  Hough检测圆\a.jpg

     文件       3896  2011-03-24 17:59  Hough检测圆\Hough检测圆.dsp

     文件       6836  2011-04-26 17:45  Hough检测圆\Hough检测圆.vcxproj

     文件        143  2011-04-26 17:45  Hough检测圆\Hough检测圆.vcxproj.user

     文件        910  2011-04-26 17:45  Hough检测圆\Hough检测圆.vcxproj.filters

     文件     479232  2011-04-26 17:49  Hough检测圆\Hough检测圆.sdf

     文件       1095  2011-04-26 17:46  Hough检测圆\Hough检测圆.sln

    ..A..H.     11264  2011-04-26 17:49  Hough检测圆\Hough检测圆.suo

     文件        950  2011-05-04 15:18  Hough检测圆\Hough检测圆.cpp

     文件     606267  2011-05-04 15:27  Hough检测圆\highgui100.dll

     文件     634934  2011-05-04 15:26  Hough检测圆\cv100.dll

............此处省略12个文件信息

评论

共有 条评论