1 | initial version |
the image you're trying to encode was never loaded / is empty() !
please add a check after the imread() call:
String file = "C:/EXAMPLES/OpenCV/sample.jpg";
Mat image = Imgcodecs.imread(file);
if (image.empty() {
// can't go on !
}
2 | No.2 Revision |
the image you're trying to encode was never loaded / is empty() !
please add a check after the imread() call:
String file = "C:/EXAMPLES/OpenCV/sample.jpg";
Mat image = Imgcodecs.imread(file);
if (image.empty() (image.empty()) {
// can't go on !
}