-2
嘿窺視什麼試圖在這裏做的是加載視頻播放它,捕獲幀,而視頻播放和輸出它在新窗口。這是下面的代碼atm。模糊,閾值,平滑邊緣捕獲
但我想現在通過添加模糊到捕獲的幀和閾值它可能會平滑邊緣之前或之後的閾值。
#include<opencv\cv.h>
#include<opencv\highgui.h>
#include<opencv\ml.h>
#include<opencv\cxcore.h>
#include<fstream>
int main(int argc, char** argv) {
//Main Window
cvNamedWindow("DisplayVideo", CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCreateFileCapture(argv[1]); //Video captured and stored in CAPTURE
IplImage* frame; //Image captured and stored in FRAME
int num=0;
char s [20];
while(1) {
num++;
frame = cvQueryFrame(capture);
if(!frame) break;
cvShowImage("DisplayVideo", frame);
char c = cvWaitKey(33);
if(c == 27) break;
if (c == 'f')
{
sprintf(s,"frame%d.jpg",num);
cvSaveImage(s,frame);
cvNamedWindow("FrameWindow", 0);
cvShowImage("FrameWindow",frame);
}
}
cvReleaseCapture(&capture);
cvDestroyWindow("DisplayVideo");
}
所以你的問題是? – Smash