Note that there are some explanatory texts on larger screens.

plurals
  1. POCant save image using OpenCV
    primarykey
    data
    text
    <p>I was trying to save images from a video file but It couldn't save any image in my hard drive. I compiled following program without errors.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;cv.h&gt; #include &lt;cxcore.h&gt; #include &lt;highgui.h&gt; int main(int argc, char* argv[]) { int c=1; IplImage* img=0; IplImage* small; IplImage* small=new IplImage(inputArray); char buffer[1000]; CvCapture* cv_cap=cvCaptureFromFile("test.avi"); cvNamedWindow("Video",CV_WINDOW_AUTOSIZE); while(1) { img=cvQueryFrame(cv_cap); cvShowImage("Video",img); small = cvCreateImage(cvSize(img-&gt;width/2,img-&gt;height/2), 8, 3); sprintf(buffer,"C:/image%u.jpg",c); c++; if (cvWaitKey(100)== 27) break; } cvDestroyWindow("Video"); return 0; } </code></pre> <p>I am using a 2.3.1 openCV library and Visual Studio 2010. How can I save the image from a video file?</p> <hr> <p>I have also tried this code,above program code are something wrong.please see following program code.After i adding following code ,also there was a same problem. </p> <pre><code> cvSaveImage(buffer,img); </code></pre> <p>Corrected program is shown below.please see this and tell me what i did wrong.but there is not compile error.after i run the program it doesn't save any image.</p> <pre><code> #include"stdafx.h" #include&lt;cv.h&gt; #include&lt;highgui.h&gt; #include&lt;cxcore.h&gt; int main(int argc, char* argv[]) { int c=1; IplImage* img=0; char buffer[1000]; CvCapture* cv_cap=cvCaptureFromCAM(-1); cvNamedWindow("Video",CV_WINDOW_AUTOSIZE); while(1) { img=cvQueryFrame(cv_cap); cvShowImage("Video",img); sprintf(buffer,"D:/image%u.jpg",c); cvSaveImage(buffer,img); c++; if (cvWaitKey(100)== 27) break; } cvDestroyWindow("Video"); return 0; } </code></pre> <p>can you tell me how to save a image .above program doesn't save any images.please give me your suggestions.thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload