?? contour3.dpr
字號:
program HoughLines;
uses
Forms,
IPL in '..\openCV\Ipl.pas',
OpenCV in '..\openCV\OpenCV.pas',
highGui in '..\openCV\highGui.pas';
{$R *.res}
const w = 500 ;
var imgA,imgB,img : pIplImage;
box : CvBox2D ;
storage : pcvMemStorage;
contours,Approx_contours : pCvSeq;
res : integer;
cS : cvSize ;
i,j : integer;
levels : integer = 3;
rect :cvRect;
pt : array [0..3] of CvPoint2D32f;
var dx,dy : integer;
white , black : CvScalar;
angle : double;
begin
imgA := cvLoadImage( 'image_sample16.bmp', -1);
imgB := cvCreateImage( cvSize_(imgA.Width,imgA.Height), 8, 3 );
cvZero( imgB );
// cvCvtColor( imgA, imgB, CV_GRAY2BGR);
cvNamedWindow( 'image', 1 );
cvShowImage( 'image', imgA );
storage := cvCreateMemStorage(0);
cvFindContours( imgA, storage, @contours, sizeof(CvContour),
CV_RETR_LIST, CV_CHAIN_APPROX_NONE, cvPoint_(0,0) );
//--- Esta funcion no esta Andando
// Approx_contours := cvApproxPoly( @contours, sizeof(CvContour), storage, 0, 10.0, 1 );
cvDrawContours( imgB, contours, CV_RGB(255,0,0), CV_RGB(0,255,0), 7, 3, CV_AA, cvPoint_(0,0) );
rect := cvBoundingRect( contours, 0);
cvRectangle( imgB, cvPoint_(rect.x,rect.y), cvPoint_( rect.x+rect.width,rect.y+rect.height), CV_RGB( 255, 0, 0), 2, 8, 0);
cvNamedWindow( 'contours', 1 );
cvWaitKey(0);
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -