Today to see the simple small program written earlier, suddenly want to tidy up, hope to be useful to everyone
#include <cv.h>
#include
#pragma comment (lib, "Cv.lib")
#pragma comment (lib, "Cxcore.lib")
#pragma comment (lib, "Highgui.lib")
int main ()
{
cvmat* SRCMAT1;
cvmat* SrcMat2;
cvmat* SRCMAT3;
cvmat* SRCMAT4;
int radius;
Double Angle,start_angle,end_angle;
Cvpoint Cirpoint1,cirpoint2;
Cvsize axes;
Cvscalar Circolor;
SRCMAT1 = Cvcreatemat (A. cv_8uc3);100*100 3-Channel byte type
SRCMAT2 = Cvcreatemat (A. cv_8uc3);100*100 3-Channel byte type
SRCMAT3 = Cvcreatemat (A. cv_8uc3);100*100 3-Channel byte type
SRCMAT4 = Cvcreatemat (A. cv_8uc3);100*100 3-Channel byte type
Cvsetzero (SRCMAT1);Clear Zero
Cvsetzero (SRCMAT2);Clear Zero
Cvsetzero (SRCMAT3);Clear Zero
Cvsetzero (SRCMAT3);Clear Zero
CirPoint1 = Cvpoint (150, 150); Coordinates one
CirPoint2 = Cvpoint (400, 400);Coordinate two
Axes=cvsize (140,60);
Radius = 40;//Radius
angle=0;
start_angle=0;
end_angle=360;
Circolor = Cvscalar (255, 255,255,0);//Blue
Cvline (SRCMAT1, CirPoint1, CirPoint2, circolor,1,8,0);Draw a Circle
Cvcircle (srcmat2,cirpoint1,radius,circolor,1,8,0);
Cvrectangle (srcmat3,cirpoint1,cirpoint2,circolor,1,8,0);
Cvellipse (srcmat4,cirpoint1,axes,angle,start_angle,end_angle,circolor,1,8,0);
Cvnamedwindow ("Exam301", cv_window_autosize);
Cvshowimage ("Exam301", (iplimage*) SRCMAT1);
Cvnamedwindow ("Exam302", cv_window_autosize);
Cvshowimage ("Exam302", (iplimage*) SRCMAT2);
Cvnamedwindow ("Exam303", cv_window_autosize);
Cvshowimage ("Exam303", (iplimage*) SRCMAT3);
Cvnamedwindow ("Exam304", cv_window_autosize);
Cvshowimage ("Exam304", (iplimage*) SRCMAT4);
Cvwaitkey (0);
Cvreleasemat (&SRCMAT1);
Cvreleasemat (&SRCMAT2);
Cvreleasemat (&SRCMAT3);
Cvreleasemat (&SRCMAT4);
Cvdestroywindow ("Exam301");
Cvdestroywindow ("Exam302");
Cvdestroywindow ("Exam303");
Cvdestroywindow ("Exam304");
return 0;
}
OpenCV draw straight Round ellipse rectangle