Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you should use opencv functions, to save / load your image:

// write:
int counter = 0;
VideoCapture cap = new VideoCapture(0);
while(cap.isOpened()) {
     Mat frame = new Mat();
     if (cap.read(frame)) {
         Imgcodecs.write( "my."+counter+".png", frame); // Highgui, for outdated opencv2.4
         counter++;    
     }
}

// read:
Mat img = Imgcodecs.imread("my.17.png");