Raw image encoder error: Empty JPEG image (DNL not supported)) in throwOnEror

OpenCV Error: Unknown error code -10 (Raw image encoder error: Empty JPEG image (DNL not supported)) in throwOnEror, file /home/program/opencv-3.2.0/modules/imgcodecs/src/grfmt_base.cpp, line 139
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/program/opencv-3.2.0/modules/imgcodecs/src/grfmt_base.cpp:139: error: (-10) Raw image encoder error: Empty JPEG image (DNL not supported) in function throwOnEror

cv::Mat img = cv::imread("background0.jpg");
 
获取图像后未能判断是Mat否为空,导致传递给后面处理的数据为null导致、。
原文地址:https://www.cnblogs.com/rohens-hbg/p/11975711.html