Hi! i am trying to take and save a snapshot using java. How to remove the error generated as below:
error : OpenCV(3.4.1) Error: Unspecified error (could not find a writer for the specified extension) in cv::imwrite_, file C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\imgcodecs\src\loadsave.cpp, line 678
Snapshot button code : int returnVal = jFileChooser1.showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = jFileChooser1.getSelectedFile(); Imgcodecs.imwrite(file.getPath(), frame); } else { System.out.println("File access cancelled by user.");