This mean is surf and sift is not free, give the money to use in commercially.
But how to know using this lib or not?
em..
I don't know.
Thank you.
void main() { VideoCapture stream1(0); //0 is the id of video device.0 if you have only one camera VideoCapture stream2(1); //0 is the id of video device.0 if you have only one camera if (!stream1.isOpened()) { //check if video device has been initialised cout << "cannot open camera 1"; } if (!stream2.isOpened()) { //check if video device has been initialised cout << "cannot open camera 2"; } namedWindow("Processing"); namedWindow("CAM1"); namedWindow("CAM2"); //unconditional loop while (true) { Mat cameraFrame1; stream1.read(cameraFrame1); //get one frame form video imshow("CAM1", cameraFrame1); Mat cameraFrame2; stream2.read(cameraFrame2); //get one frame form video imshow("CAM2", cameraFrame2); if (waitKey(30) >= 0) break; } destroyAllWindows(); }/////
void main() { VideoCapture stream1(1); //0 is the id of video device.0 if you have only one camera if (!stream1.isOpened()) { //check if video device has been initialised cout << "cannot open camera"; } namedWindow("Processing"); namedWindow("Origin"); //unconditional loop while (true) { Mat cameraFrame; stream1.read(cameraFrame); //get one frame form video imshow("Origin", cameraFrame); Sobel(cameraFrame, cameraFrame, CV_8U, 1, 0); //sobel processing imshow("Processing",cameraFrame); if (waitKey(30) >= 0) break; } destroyAllWindows(); }...
int main() { VideoCapture capture("rhinos.avi"); Mat frame; //Set properties int askFileTypeBox = 0; //-1 is show box of codec int Color = 1; Size S = Size((int)capture.get(CV_CAP_PROP_FRAME_WIDTH), (int)capture.get(CV_CAP_PROP_FRAME_HEIGHT)); //make output video file VideoWriter outVideo; //save video file by origin paramers outVideo.open(".\\outVideo.avi", askFileTypeBox, capture.get(CV_CAP_PROP_FPS), S, Color); double fps = capture.get(CV_CAP_PROP_FPS); //check if (!capture.isOpened()) { printf("AVI file can not open.\n"); return 0; } //create window namedWindow("w"); while (1) { //grab frame from file & throw to Mat capture >> frame; if (frame.empty()) //Is video end? break; //processing example //Sobel(frame, frame, frame.depth(), 1, 0); //////////////////// //outVideo.write(frame); outVideo << frame; //display and delay imshow("w", frame); //delay by origin fps if (waitKey((1 / fps) * 1000) > 0) break; } return 0; }...
//file load VideoCapture capture(".\\video.avi"); Mat frame; //check if( !capture.isOpened() ) { printf("AVI file can not open.\n"); return; } //create window namedWindow("w"); while(1) { //grab frame from file & throw to Mat capture >> frame; if(frame.empty() ) //Is video end? break; //processing example Sobel(frame,frame,frame.depth(),1,0); //////////////////// //display and delay imshow("w", frame); if(waitKey(10) > 0) break; }...