mirror of
https://github.com/opencv/opencv.git
synced 2025-06-18 08:05:23 +08:00
Fix for OpenVX based implementation of wrapAffine HAL API
This commit is contained in:
parent
ca1ce5fa5c
commit
cd1b324e5e
22
3rdparty/openvx/include/openvx_hal.hpp
vendored
22
3rdparty/openvx/include/openvx_hal.hpp
vendored
@ -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
|
|||||||
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
|
|||||||
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
|
|||||||
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,
|
|||||||
|
|
||||||
#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
|
||||||
|
Loading…
Reference in New Issue
Block a user