Commit f5ddbbf6 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #11722 from gnthibault:3.4

parents 1187a7fa b46fef32
...@@ -3672,7 +3672,7 @@ void resize(int src_type, ...@@ -3672,7 +3672,7 @@ void resize(int src_type,
{ {
CV_INSTRUMENT_REGION() CV_INSTRUMENT_REGION()
CV_Assert((dst_width * dst_height > 0) || (inv_scale_x > 0 && inv_scale_y > 0)); CV_Assert((dst_width > 0 && dst_height > 0) || (inv_scale_x > 0 && inv_scale_y > 0));
if (inv_scale_x < DBL_EPSILON || inv_scale_y < DBL_EPSILON) if (inv_scale_x < DBL_EPSILON || inv_scale_y < DBL_EPSILON)
{ {
inv_scale_x = static_cast<double>(dst_width) / src_width; inv_scale_x = static_cast<double>(dst_width) / src_width;
...@@ -3684,7 +3684,7 @@ void resize(int src_type, ...@@ -3684,7 +3684,7 @@ void resize(int src_type,
int depth = CV_MAT_DEPTH(src_type), cn = CV_MAT_CN(src_type); int depth = CV_MAT_DEPTH(src_type), cn = CV_MAT_CN(src_type);
Size dsize = Size(saturate_cast<int>(src_width*inv_scale_x), Size dsize = Size(saturate_cast<int>(src_width*inv_scale_x),
saturate_cast<int>(src_height*inv_scale_y)); saturate_cast<int>(src_height*inv_scale_y));
CV_Assert( dsize.area() > 0 ); CV_Assert( !dsize.empty() );
CV_IPP_RUN_FAST(ipp_resize(src_data, src_step, src_width, src_height, dst_data, dst_step, dsize.width, dsize.height, inv_scale_x, inv_scale_y, depth, cn, interpolation)) CV_IPP_RUN_FAST(ipp_resize(src_data, src_step, src_width, src_height, dst_data, dst_step, dsize.width, dsize.height, inv_scale_x, inv_scale_y, depth, cn, interpolation))
...@@ -4041,13 +4041,13 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize, ...@@ -4041,13 +4041,13 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
Size ssize = _src.size(); Size ssize = _src.size();
CV_Assert( ssize.width > 0 && ssize.height > 0 ); CV_Assert( !ssize.empty() );
CV_Assert( dsize.area() > 0 || (inv_scale_x > 0 && inv_scale_y > 0) ); CV_Assert( !dsize.empty() || (inv_scale_x > 0 && inv_scale_y > 0) );
if( dsize.area() == 0 ) if( dsize.area() == 0 )
{ {
dsize = Size(saturate_cast<int>(ssize.width*inv_scale_x), dsize = Size(saturate_cast<int>(ssize.width*inv_scale_x),
saturate_cast<int>(ssize.height*inv_scale_y)); saturate_cast<int>(ssize.height*inv_scale_y));
CV_Assert( dsize.area() > 0 ); CV_Assert( !dsize.empty() );
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment