随笔分类 -  OpenCv

摘要:#include "stdafx.h"#include <atltime.h>#include <highgui.h>int main(){ int c; CTime time; IplImage *img; CvCapture* capture = cvCaptureFromCAM(1); cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE); cvMoveWindow("mainWin", 50, 50); while(1) { img=cvQueryFrame(capt 阅读全文
posted @ 2012-06-04 20:42 Epirus 阅读(4852) 评论(0) 推荐(0)
摘要:#include "stdafx.h"#include "cv.h"#include "highgui.h"CvRect box;bool drawing_box=false;void draw_box(IplImage* img,CvRect rect){ cvRectangle(img,cvPoint(box.x,box.y),cvPoint(box.x+box.width,box.y+box.height),cvScalar(0xff,0x00,0x00));}void my_mouse_callback(int event , 阅读全文
posted @ 2012-06-04 20:08 Epirus 阅读(1657) 评论(0) 推荐(0)
摘要:#include "stdafx.h"#include "cv.h"#include "highgui.h"int main(){ IplImage* image=cvLoadImage("test.jpg"); int x=200; int y=200; int width=200; int height=200; int add=150; cvSetImageROI(image,cvRect(x,y,width,height)); cvAddS(image,cvScalar(add),image);// cvR 阅读全文
posted @ 2012-05-30 22:38 Epirus 阅读(253) 评论(0) 推荐(0)
摘要:高斯化就是,让不在高斯曲线中的值回来。也就是回到正态分布图像中区域最大的部分,让那些叛逆的像素都回来#include "stdafx.h"#include "cv.h"#include "highgui.h"int main(){ IplImage* image=cvLoadImage("test.jpg"); cvNamedWindow("Example"); cvShowImage("Example",image); IplImage* outputImage=cvCre 阅读全文
posted @ 2012-05-30 17:04 Epirus 阅读(405) 评论(0) 推荐(0)
摘要:#include "stdafx.h"#include "cv.h"#include "highgui.h"void saturate_sv(IplImage* img){ for(int y=0;y<img->height;y++) { uchar* ptr=(uchar*)(img->imageData+y*img->widthStep); for(int x=0;x<img->width;x++) { ptr[3*x+1]=255; ptr[3*x+2]=255; } } ... 阅读全文
posted @ 2012-05-30 16:59 Epirus 阅读(304) 评论(0) 推荐(0)
摘要:1 #include "stdafx.h" 2 #include "highgui.h" 3 int g_slider_position = 0; 4 CvCapture* g_capture = NULL; 5 void onTrackbarSlide(int pos) 6 { 7 cvSetCaptureProperty(g_capture, CV_CAP_PROP_POS_FRAMES,pos); 8 } 9 10 int main()11 {12 cvNamedWindow("Test Vedio Slide",CV_WIND 阅读全文
posted @ 2012-05-29 19:25 Epirus 阅读(207) 评论(0) 推荐(0)
摘要:1 #include "stdafx.h" 2 #include "highgui.h" 3 int main() 4 { 5 cvNamedWindow("example",CV_WINDOW_AUTOSIZE); 6 CvCapture* capture=cvCreateFileCapture("test.avi");//load avi file 7 IplImage* frame; 8 while(1){ 9 frame=cvQueryFrame(capture);//read the frame10 if 阅读全文
posted @ 2012-05-29 14:26 Epirus 阅读(163) 评论(0) 推荐(0)
摘要:#include "stdafx.h"#include "highgui.h"int main(){ IplImage* img=cvLoadImage("test.jpg"); cvNamedWindow("Example1",CV_WINDOW_AUTOSIZE); cvShowImage("Example1",img); cvWaitKey(0); //press any key to be continued cvReleaseImage(&img); cvDestroyWind 阅读全文
posted @ 2012-05-29 13:59 Epirus 阅读(147) 评论(0) 推荐(0)
摘要:总的感觉不大好配置~1、下载好opencv cmake vs20102、使用cmake编译好3、vs2010 的Property Manager 中的VC++ Directory 中加入对应的库文件inclue directory :D:\Program files\opencv\include\opencv2D:\Program files\opencv\build\include\opencvD:\Program files\opencv\build\include4、在Linker的选中Inputopencv_features2d231d.libopencv_highgui231d... 阅读全文
posted @ 2012-05-23 20:02 Epirus 阅读(309) 评论(0) 推荐(0)