|
|
@ -437,12 +437,12 @@ imread_( const String& filename, int flags, Mat& mat ) |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imread_('" << filename << "'): can't read header: " << e.what()); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imread_('" << filename << "'): can't read header: unknown exception"); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -475,11 +475,11 @@ imread_( const String& filename, int flags, Mat& mat ) |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imread_('" << filename << "'): can't read data: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imread_('" << filename << "'): can't read data: unknown exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!success) |
|
|
|
if (!success) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -542,12 +542,12 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats, int star |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imreadmulti_('" << filename << "'): can't read header: " << e.what()); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imreadmulti_('" << filename << "'): can't read header: unknown exception"); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -591,11 +591,11 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats, int star |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imreadmulti_('" << filename << "'): can't read data: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imreadmulti_('" << filename << "'): can't read data: unknown exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!success) |
|
|
|
if (!success) |
|
|
|
break; |
|
|
|
break; |
|
|
@ -672,7 +672,7 @@ size_t imcount_(const String& filename, int flags) |
|
|
|
return collection.size(); |
|
|
|
return collection.size(); |
|
|
|
} catch(cv::Exception const& e) { |
|
|
|
} catch(cv::Exception const& e) { |
|
|
|
// Reading header or finding decoder for the filename is failed
|
|
|
|
// Reading header or finding decoder for the filename is failed
|
|
|
|
std::cerr << "imcount_('" << filename << "'): can't read header or can't find decoder: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imcount_('" << filename << "'): can't read header or can't find decoder: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -768,14 +768,13 @@ static bool imwrite_( const String& filename, const std::vector<Mat>& img_vec, |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imwrite_('" << filename << "'): can't write data: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imwrite_('" << filename << "'): can't write data: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imwrite_('" << filename << "'): can't write data: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imwrite_('" << filename << "'): can't write data: unknown exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CV_Assert( code );
|
|
|
|
|
|
|
|
return code; |
|
|
|
return code; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -851,11 +850,11 @@ imdecode_( const Mat& buf, int flags, Mat& mat ) |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imdecode_('" << filename << "'): can't read header: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imdecode_('" << filename << "'): can't read header: unknown exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!success) |
|
|
|
if (!success) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -864,7 +863,7 @@ imdecode_( const Mat& buf, int flags, Mat& mat ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (0 != remove(filename.c_str())) |
|
|
|
if (0 != remove(filename.c_str())) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "unable to remove temporary file:" << filename << std::endl << std::flush; |
|
|
|
CV_LOG_WARNING(NULL, "unable to remove temporary file:" << filename); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
@ -896,18 +895,18 @@ imdecode_( const Mat& buf, int flags, Mat& mat ) |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imdecode_('" << filename << "'): can't read data: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imdecode_('" << filename << "'): can't read data: unknown exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!filename.empty()) |
|
|
|
if (!filename.empty()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (0 != remove(filename.c_str())) |
|
|
|
if (0 != remove(filename.c_str())) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "unable to remove temporary file:" << filename << std::endl << std::flush; |
|
|
|
CV_LOG_WARNING(NULL, "unable to remove temporary file: " << filename); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1000,11 +999,11 @@ imdecodemulti_(const Mat& buf, int flags, std::vector<Mat>& mats, int start, int |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imreadmulti_('" << filename << "'): can't read header: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imreadmulti_('" << filename << "'): can't read header: unknown exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int current = start; |
|
|
|
int current = start; |
|
|
@ -1025,7 +1024,7 @@ imdecodemulti_(const Mat& buf, int flags, std::vector<Mat>& mats, int start, int |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (0 != remove(filename.c_str())) |
|
|
|
if (0 != remove(filename.c_str())) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "unable to remove temporary file:" << filename << std::endl << std::flush; |
|
|
|
CV_LOG_WARNING(NULL, "unable to remove temporary file: " << filename); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
@ -1060,11 +1059,11 @@ imdecodemulti_(const Mat& buf, int flags, std::vector<Mat>& mats, int start, int |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
catch (const cv::Exception& e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imreadmulti_('" << filename << "'): can't read data: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
catch (...) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "imreadmulti_('" << filename << "'): can't read data: unknown exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!success) |
|
|
|
if (!success) |
|
|
|
break; |
|
|
|
break; |
|
|
@ -1087,7 +1086,7 @@ imdecodemulti_(const Mat& buf, int flags, std::vector<Mat>& mats, int start, int |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (0 != remove(filename.c_str())) |
|
|
|
if (0 != remove(filename.c_str())) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "unable to remove temporary file:" << filename << std::endl << std::flush; |
|
|
|
CV_LOG_WARNING(NULL, "unable to remove temporary file: " << filename); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1317,10 +1316,10 @@ Mat ImageCollection::Impl::readData() { |
|
|
|
success = true; |
|
|
|
success = true; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception &e) { |
|
|
|
catch (const cv::Exception &e) { |
|
|
|
std::cerr << "ImageCollection class: can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "ImageCollection class: can't read data: " << e.what()); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) { |
|
|
|
catch (...) { |
|
|
|
std::cerr << "ImageCollection class:: can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
CV_LOG_ERROR(NULL, "ImageCollection class:: can't read data: unknown exception"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!success) |
|
|
|
if (!success) |
|
|
|
return cv::Mat(); |
|
|
|
return cv::Mat(); |
|
|
|