Cant save image using OpenCV

前端 未结 2 1313
谎友^
谎友^ 2021-01-29 09:36

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.

#include 

        
相关标签:
2条回答
  • 2021-01-29 09:56

    Don't know if you solved the problem or not. if not you can use imwrite("test.jpg",img); to save an image,

    here is an example- while(1) {

      img=cvQueryFrame(cv_cap);
      cvShowImage("Video",img);
      imwrite("test.jpg",img);
    }
    
    0 讨论(0)
  • 2021-01-29 10:06

    You forgot to actually save the image:

    cvSaveImage(buffer ,img);
    

    Also, the following is redundant:

    IplImage* small; // <-- you don't need this
    IplImage* small=new IplImage(inputArray);
    
    0 讨论(0)
提交回复
热议问题