mirror of
https://github.com/opencv/opencv.git
synced 2025-07-25 22:57:53 +08:00
Fixed OpenVX to OpenCV compatibility for NN remap
This commit is contained in:
parent
f8b4d28745
commit
3c5eb513dd
@ -4766,12 +4766,28 @@ static bool openvx_remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case INTER_NEAREST:
|
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
|
#if VX_VERSION > VX_VERSION_1_0
|
||||||
inter_type = VX_INTERPOLATION_NEAREST_NEIGHBOR;
|
inter_type = VX_INTERPOLATION_NEAREST_NEIGHBOR;
|
||||||
#else
|
#else
|
||||||
inter_type = VX_INTERPOLATION_TYPE_NEAREST_NEIGHBOR;
|
inter_type = VX_INTERPOLATION_TYPE_NEAREST_NEIGHBOR;
|
||||||
#endif
|
#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;
|
break;
|
||||||
|
*/
|
||||||
case INTER_AREA://AREA interpolation mode is unsupported
|
case INTER_AREA://AREA interpolation mode is unsupported
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user