|
|
@ -426,18 +426,18 @@ imread_( const String& filename, int flags, int hdrtype, Mat* mat=0 ) |
|
|
|
/// set the filename in the driver
|
|
|
|
/// set the filename in the driver
|
|
|
|
decoder->setSource( filename ); |
|
|
|
decoder->setSource( filename ); |
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
CV_TRY |
|
|
|
{ |
|
|
|
{ |
|
|
|
// read the header to make sure it succeeds
|
|
|
|
// read the header to make sure it succeeds
|
|
|
|
if( !decoder->readHeader() ) |
|
|
|
if( !decoder->readHeader() ) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
CV_CATCH (cv::Exception, e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
CV_CATCH_ALL |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
@ -482,16 +482,16 @@ imread_( const String& filename, int flags, int hdrtype, Mat* mat=0 ) |
|
|
|
|
|
|
|
|
|
|
|
// read the image data
|
|
|
|
// read the image data
|
|
|
|
bool success = false; |
|
|
|
bool success = false; |
|
|
|
try |
|
|
|
CV_TRY |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (decoder->readData(*data)) |
|
|
|
if (decoder->readData(*data)) |
|
|
|
success = true; |
|
|
|
success = true; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
CV_CATCH (cv::Exception, e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
CV_CATCH_ALL |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
std::cerr << "imread_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
} |
|
|
|
} |
|
|
@ -548,18 +548,18 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats) |
|
|
|
decoder->setSource(filename); |
|
|
|
decoder->setSource(filename); |
|
|
|
|
|
|
|
|
|
|
|
// read the header to make sure it succeeds
|
|
|
|
// read the header to make sure it succeeds
|
|
|
|
try |
|
|
|
CV_TRY |
|
|
|
{ |
|
|
|
{ |
|
|
|
// read the header to make sure it succeeds
|
|
|
|
// read the header to make sure it succeeds
|
|
|
|
if( !decoder->readHeader() ) |
|
|
|
if( !decoder->readHeader() ) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
CV_CATCH (cv::Exception, e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
CV_CATCH_ALL |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
@ -587,16 +587,16 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats) |
|
|
|
// read the image data
|
|
|
|
// read the image data
|
|
|
|
Mat mat(size.height, size.width, type); |
|
|
|
Mat mat(size.height, size.width, type); |
|
|
|
bool success = false; |
|
|
|
bool success = false; |
|
|
|
try |
|
|
|
CV_TRY |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (decoder->readData(mat)) |
|
|
|
if (decoder->readData(mat)) |
|
|
|
success = true; |
|
|
|
success = true; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
CV_CATCH (cv::Exception, e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
CV_CATCH_ALL |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
std::cerr << "imreadmulti_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
} |
|
|
|
} |
|
|
@ -738,16 +738,16 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool success = false; |
|
|
|
bool success = false; |
|
|
|
try |
|
|
|
CV_TRY |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (decoder->readHeader()) |
|
|
|
if (decoder->readHeader()) |
|
|
|
success = true; |
|
|
|
success = true; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
CV_CATCH (cv::Exception, e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
CV_CATCH_ALL |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush; |
|
|
|
} |
|
|
|
} |
|
|
@ -800,16 +800,16 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
success = false; |
|
|
|
success = false; |
|
|
|
try |
|
|
|
CV_TRY |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (decoder->readData(*data)) |
|
|
|
if (decoder->readData(*data)) |
|
|
|
success = true; |
|
|
|
success = true; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (const cv::Exception& e) |
|
|
|
CV_CATCH (cv::Exception, e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (...) |
|
|
|
CV_CATCH_ALL |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
std::cerr << "imdecode_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush; |
|
|
|
} |
|
|
|
} |
|
|
|