《学习OpenCV》练习题第三章第七题

#include <highgui.h> 3 #include <cv.h> 4 #include <stdio.h>comment (lib,”opencv_calib3d231d.lib”) 7 #pragma comment (lib,”opencv_contrib231d.lib”) 8 #pragma comment (lib,”opencv_core231d.lib”) 9 #pragma comment (lib,”opencv_features2d231d.lib”)10 #pragma comment (lib,”opencv_flann231d.lib”)11 #pragma comment (lib,”opencv_gpu231d.lib”)12 #pragma comment (lib,”opencv_haartraining_engined.lib”)13 #pragma comment (lib,”opencv_highgui231d.lib”)14 #pragma comment (lib,”opencv_imgproc231d.lib”)15 #pragma comment (lib,”opencv_legacy231d.lib”)16 #pragma comment (lib,”opencv_ml231d.lib”)17 #pragma comment (lib,”opencv_objdetect231d.lib”)18 #pragma comment (lib,”opencv_ts231d.lib”)19 #pragma comment (lib,”opencv_video231d.lib”) *《学习OpenCV》第三章第五题23 * 完成时间:0:41 3/3 星期日 2013 main()27 {IplImage * srcImage = cvLoadImage(, 1);IplImage* red_plane = cvCreateImage(cvGetSize(srcImage), srcImage->depth, 1);33IplImage* green_plane = cvCreateImage(cvGetSize(srcImage), srcImage->depth, 1);34IplImage* blue_plane = cvCreateImage(cvGetSize(srcImage), srcImage->depth, 1); cvSplit(srcImage, blue_plane, green_plane, red_plane, NULL);IplImage* clone1 = cvCloneImage(green_plane);41IplImage* clone2 = cvCloneImage(green_plane); dMaxValue, dMinValue;45cvMinMaxLoc(green_plane, &dMinValue, &dMaxValue, NULL, NULL, NULL);, dMaxValue, dMinValue);unsigned char thresh = (dMaxValue – dMinValue)/2;50cvSet(clone1, cvScalarAll(thresh), 0);cvSet(clone2, cvScalarAll(0), 0); cvCmp(green_plane, clone1, clone2, CV_CMP_GE);cvSubS(green_plane, cvScalarAll(thresh/2), green_plane, clone2 );, clone1);, clone2);, red_plane);, green_plane);, blue_plane);, srcImage);6768cvvWaitKey(0);69 70cvReleaseImage(&srcImage);71cvReleaseImage(&red_plane);72cvReleaseImage(&green_plane);73cvReleaseImage(&blue_plane);74cvReleaseImage(&clone1);75cvReleaseImage(&clone2);76 cvDestroyAllWindows();;78 },香港虚拟主机,服务器空间,香港虚拟主机年岁有加,并非垂老,理想丢弃,方堕暮年。

《学习OpenCV》练习题第三章第七题

相关文章:

你感兴趣的文章:

标签云: