画矩形
//画矩形#include "stdafx.h" #include "highgui.h" #include "cv.h" int _tmain(int argc, _TCHAR* argv[]) { cvNamedWindow("ShowImage", CV_WINDOW_AUTOSIZE); //创建100*100矩阵,并置零 IplImage* image= cvCreateImage(cvSize(100, 100), IPL_DEPTH_8U, 3); cvZero(image); cvRectangle(image, cvPoint(10, 10), cvPoint(60, 60), cvScalar(0, 255, 0), 1); cvShowImage("ShowImage", image); cvWaitKey(0); cvReleaseImage(&image); cvDestroyWindow("ShowImage"); return 0; } #include "stdafx.h" #include "highgui.h" #include "cv.h" int _tmain(int argc, _TCHAR* argv[]) { cvNamedWindow("ShowImage", CV_WINDOW_AUTOSIZE); //创建100*100矩阵,并置零 IplImage* image= cvCreateImage(cvSize(100, 100), IPL_DEPTH_8U, 3); cvZero(image); cvRectangle(image, cvPoint(10, 10), cvPoint(60, 60), cvScalar(0, 255, 0), 1); cvShowImage("ShowImage", image); cvWaitKey(0); cvReleaseImage(&image); cvDestroyWindow("ShowImage"); return 0; }
补充:软件开发 , C++ ,