PDA

View Full Version : qt with opencv2.3.1



antinkuntin
18th June 2013, 12:34
hi,
i want to save image ,that is captured from webcam, to a file. How can i do that?

alainstgt
18th June 2013, 16:37
just a snippet:

int main(int, char**)
{
VideoCapture cap(0); // create an instance of video capture
if ( !cap.isOpened() ) return -1; // didn´t work?
Mat frame; // create an empty matrix to hold the frame
cap >> frame; // put camera frame into the matrix
frame.imwrite( "videoframe.jpg", frame ); // write videoframe to disk
return 0;
}

more infos in the documentation:
http://opencv.willowgarage.com/documentation/cpp/reading_and_writing_images_and_video.html

antinkuntin
26th June 2013, 13:45
it is ok but i want to save image to a specific file which is available in D:\

ChrisW67
28th June 2013, 05:44
Well then, tell the OpenCV function to do that.

BTW: This has nothing to do with Qt.