提交 057c10ba 编写于 作者: V Vadim Pisarevsky

Merge pull request #8377 from ottogin:interpMultichannelImg

......@@ -5019,10 +5019,14 @@ void cv::remap( InputArray _src, OutputArray _dst,
{
if( interpolation == INTER_LINEAR )
ifunc = linear_tab[depth];
else if( interpolation == INTER_CUBIC )
else if( interpolation == INTER_CUBIC ){
ifunc = cubic_tab[depth];
else if( interpolation == INTER_LANCZOS4 )
CV_Assert( _src.channels() <= 4 );
}
else if( interpolation == INTER_LANCZOS4 ){
ifunc = lanczos4_tab[depth];
CV_Assert( _src.channels() <= 4 );
}
else
CV_Error( CV_StsBadArg, "Unknown interpolation method" );
CV_Assert( ifunc != 0 );
......@@ -6003,6 +6007,10 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
{
CV_INSTRUMENT_REGION()
int interpolation = flags & INTER_MAX;
CV_Assert( _src.channels() <= 4 || (interpolation != INTER_LANCZOS4 &&
interpolation != INTER_CUBIC) );
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat() &&
_src.cols() <= SHRT_MAX && _src.rows() <= SHRT_MAX,
ocl_warpTransform_cols4(_src, _dst, _M0, dsize, flags, borderType,
......@@ -6021,7 +6029,6 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
double M[6];
Mat matM(2, 3, CV_64F, M);
int interpolation = flags & INTER_MAX;
if( interpolation == INTER_AREA )
interpolation = INTER_LINEAR;
......
......@@ -1703,6 +1703,8 @@ TEST(Imgproc_Warp, multichannel)
int width = rng.uniform(3, 333);
int height = rng.uniform(3, 333);
int cn = rng.uniform(1, 15);
if(inter == INTER_CUBIC || inter == INTER_LANCZOS4)
cn = rng.uniform(1, 5);
Mat src(height, width, CV_8UC(cn)), dst;
//randu(src, 0, 256);
src.setTo(0.);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册