mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
Merge pull request #11722 from gnthibault:3.4
This commit is contained in:
commit
f5ddbbf659
@ -3672,7 +3672,7 @@ void resize(int src_type,
|
||||
{
|
||||
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)
|
||||
{
|
||||
inv_scale_x = static_cast<double>(dst_width) / src_width;
|
||||
@ -3684,7 +3684,7 @@ void resize(int 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),
|
||||
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))
|
||||
|
||||
@ -4041,13 +4041,13 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
|
||||
Size ssize = _src.size();
|
||||
|
||||
CV_Assert( ssize.width > 0 && ssize.height > 0 );
|
||||
CV_Assert( dsize.area() > 0 || (inv_scale_x > 0 && inv_scale_y > 0) );
|
||||
CV_Assert( !ssize.empty() );
|
||||
CV_Assert( !dsize.empty() || (inv_scale_x > 0 && inv_scale_y > 0) );
|
||||
if( dsize.area() == 0 )
|
||||
{
|
||||
dsize = Size(saturate_cast<int>(ssize.width*inv_scale_x),
|
||||
saturate_cast<int>(ssize.height*inv_scale_y));
|
||||
CV_Assert( dsize.area() > 0 );
|
||||
CV_Assert( !dsize.empty() );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user