Commit 3c5eb513 authored by Vitaly Tuzov's avatar Vitaly Tuzov

Fixed OpenVX to OpenCV compatibility for NN remap

parent f8b4d287
......@@ -4766,12 +4766,28 @@ static bool openvx_remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation
#endif
break;
case INTER_NEAREST:
/* NEAREST_NEIGHBOR mode disabled since OpenCV round half to even while OpenVX sample implementation round half up
#if VX_VERSION > VX_VERSION_1_0
inter_type = VX_INTERPOLATION_NEAREST_NEIGHBOR;
#else
inter_type = VX_INTERPOLATION_TYPE_NEAREST_NEIGHBOR;
#endif
if (!map1.empty())
for (int y = 0; y < map1.rows; ++y)
{
float* line = map1.ptr<float>(y);
for (int x = 0; x < map1.cols; ++x)
line[x] = cvRound(line[x]);
}
if (!map2.empty())
for (int y = 0; y < map2.rows; ++y)
{
float* line = map2.ptr<float>(y);
for (int x = 0; x < map2.cols; ++x)
line[x] = cvRound(line[x]);
}
break;
*/
case INTER_AREA://AREA interpolation mode is unsupported
default:
return false;
......
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