Commit eb7ff99f authored by Ilya Lavrenov's avatar Ilya Lavrenov

fixed cv::remap and cv::convertMaps for map types CV_16SC2 && CV_16UC1

parent 098d4e61
......@@ -2935,7 +2935,10 @@ public:
if( m1->type() == CV_16SC2 && (m2->type() == CV_16UC1 || m2->type() == CV_16SC1) )
{
bufxy = (*m1)(Rect(x, y, bcols, brows));
bufa = (*m2)(Rect(x, y, bcols, brows));
const ushort* sA = (const ushort*)(m2->data + m2->step*(y+y1)) + x;
for( x1 = 0; x1 < bcols; x1++ )
A[x1] = (ushort)(sA[x1] & (INTER_TAB_SIZE2-1));
}
else if( planar_input )
{
......@@ -3242,7 +3245,7 @@ void cv::convertMaps( InputArray _map1, InputArray _map2,
{
for( x = 0; x < size.width; x++ )
{
int fxy = src2 ? src2[x] : 0;
int fxy = src2 ? src2[x] & (INTER_TAB_SIZE2-1) : 0;
dst1f[x] = src1[x*2] + (fxy & (INTER_TAB_SIZE-1))*scale;
dst2f[x] = src1[x*2+1] + (fxy >> INTER_BITS)*scale;
}
......@@ -3251,7 +3254,7 @@ void cv::convertMaps( InputArray _map1, InputArray _map2,
{
for( x = 0; x < size.width; x++ )
{
int fxy = src2 ? src2[x] : 0;
int fxy = src2 ? src2[x] & (INTER_TAB_SIZE2-1): 0;
dst1f[x*2] = src1[x*2] + (fxy & (INTER_TAB_SIZE-1))*scale;
dst1f[x*2+1] = src1[x*2+1] + (fxy >> INTER_BITS)*scale;
}
......
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