Commit cd1b324e authored by Vitaly Tuzov's avatar Vitaly Tuzov

Fix for OpenVX based implementation of wrapAffine HAL API

parent ca1ce5fa
...@@ -517,8 +517,7 @@ inline int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, i ...@@ -517,8 +517,7 @@ inline int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, i
setConstantBorder(border, (vx_uint8)borderValue[0]); setConstantBorder(border, (vx_uint8)borderValue[0]);
break; break;
case CV_HAL_BORDER_REPLICATE: case CV_HAL_BORDER_REPLICATE:
border.mode = VX_BORDER_REPLICATE; // Neither 1.0 nor 1.1 OpenVX support BORDER_REPLICATE for warpings
break;
default: default:
return CV_HAL_ERROR_NOT_IMPLEMENTED; return CV_HAL_ERROR_NOT_IMPLEMENTED;
} }
...@@ -526,8 +525,9 @@ inline int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, i ...@@ -526,8 +525,9 @@ inline int ovx_hal_warpAffine(int atype, const uchar *a, size_t astep, int aw, i
int mode; int mode;
if (interpolation == CV_HAL_INTER_LINEAR) if (interpolation == CV_HAL_INTER_LINEAR)
mode = VX_INTERPOLATION_BILINEAR; mode = VX_INTERPOLATION_BILINEAR;
else if (interpolation == CV_HAL_INTER_AREA) //AREA interpolation is unsupported
mode = VX_INTERPOLATION_AREA; //else if (interpolation == CV_HAL_INTER_AREA)
// mode = VX_INTERPOLATION_AREA;
else if (interpolation == CV_HAL_INTER_NEAREST) else if (interpolation == CV_HAL_INTER_NEAREST)
mode = VX_INTERPOLATION_NEAREST_NEIGHBOR; mode = VX_INTERPOLATION_NEAREST_NEIGHBOR;
else else
...@@ -576,8 +576,7 @@ inline int ovx_hal_warpPerspectve(int atype, const uchar *a, size_t astep, int a ...@@ -576,8 +576,7 @@ inline int ovx_hal_warpPerspectve(int atype, const uchar *a, size_t astep, int a
setConstantBorder(border, (vx_uint8)borderValue[0]); setConstantBorder(border, (vx_uint8)borderValue[0]);
break; break;
case CV_HAL_BORDER_REPLICATE: case CV_HAL_BORDER_REPLICATE:
border.mode = VX_BORDER_REPLICATE; // Neither 1.0 nor 1.1 OpenVX support BORDER_REPLICATE for warpings
break;
default: default:
return CV_HAL_ERROR_NOT_IMPLEMENTED; return CV_HAL_ERROR_NOT_IMPLEMENTED;
} }
...@@ -585,8 +584,9 @@ inline int ovx_hal_warpPerspectve(int atype, const uchar *a, size_t astep, int a ...@@ -585,8 +584,9 @@ inline int ovx_hal_warpPerspectve(int atype, const uchar *a, size_t astep, int a
int mode; int mode;
if (interpolation == CV_HAL_INTER_LINEAR) if (interpolation == CV_HAL_INTER_LINEAR)
mode = VX_INTERPOLATION_BILINEAR; mode = VX_INTERPOLATION_BILINEAR;
else if (interpolation == CV_HAL_INTER_AREA) //AREA interpolation is unsupported
mode = VX_INTERPOLATION_AREA; //else if (interpolation == CV_HAL_INTER_AREA)
// mode = VX_INTERPOLATION_AREA;
else if (interpolation == CV_HAL_INTER_NEAREST) else if (interpolation == CV_HAL_INTER_NEAREST)
mode = VX_INTERPOLATION_NEAREST_NEIGHBOR; mode = VX_INTERPOLATION_NEAREST_NEIGHBOR;
else else
...@@ -1132,8 +1132,10 @@ inline int ovx_hal_cvtOnePlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b, ...@@ -1132,8 +1132,10 @@ inline int ovx_hal_cvtOnePlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b,
#undef cv_hal_warpAffine #undef cv_hal_warpAffine
#define cv_hal_warpAffine ovx_hal_warpAffine #define cv_hal_warpAffine ovx_hal_warpAffine
#undef cv_hal_warpPerspective //OpenVX perspective warp use round to zero policy at least in sample implementation
#define cv_hal_warpPerspective ovx_hal_warpPerspectve //while OpenCV require round to nearest
//#undef cv_hal_warpPerspective
//#define cv_hal_warpPerspective ovx_hal_warpPerspectve
#undef cv_hal_filterInit #undef cv_hal_filterInit
#define cv_hal_filterInit ovx_hal_filterInit #define cv_hal_filterInit ovx_hal_filterInit
......
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