mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 09:25:45 +08:00
Merge pull request #25399 from asmorkalov:as/HAL_remap
New HAL API for remap
This commit is contained in:
commit
577ad0a5ad
@ -298,6 +298,36 @@ inline int hal_ni_warpPerspective(int src_type, const uchar *src_data, size_t sr
|
||||
#define cv_hal_warpPerspective hal_ni_warpPerspective
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
@brief hal_remap with floating point maps
|
||||
@param src_type source and destination image type
|
||||
@param src_data source image data
|
||||
@param src_step source image step
|
||||
@param src_width source image width
|
||||
@param src_height source image height
|
||||
@param dst_data destination image data
|
||||
@param dst_step destination image step
|
||||
@param dst_width destination image width
|
||||
@param dst_height destination image height
|
||||
@param mapx map for x values
|
||||
@param mapx_step mapx matrix step
|
||||
@param mapy map for y values
|
||||
@param mapy_step mapy matrix step
|
||||
@param interpolation interpolation mode (CV_HAL_INTER_NEAREST, ...)
|
||||
@param border_type border processing mode (CV_HAL_BORDER_REFLECT, ...)
|
||||
@param border_value values to use for CV_HAL_BORDER_CONSTANT mode
|
||||
@sa cv::remap
|
||||
*/
|
||||
inline int hal_ni_remap32f(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height,
|
||||
uchar *dst_data, size_t dst_step, int dst_width, int dst_height,
|
||||
float* mapx, size_t mapx_step, float* mapy, size_t mapy_step,
|
||||
int interpolation, int border_type, const double border_value[4])
|
||||
{ return CV_HAL_ERROR_NOT_IMPLEMENTED; }
|
||||
|
||||
//! @cond IGNORED
|
||||
#define cv_hal_remap32f hal_ni_remap32f
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
@brief hal_cvtBGRtoBGR
|
||||
@param src_data source image data
|
||||
|
@ -1799,7 +1799,6 @@ void cv::remap( InputArray _src, OutputArray _dst,
|
||||
_dst.create( map1.size(), src.type() );
|
||||
Mat dst = _dst.getMat();
|
||||
|
||||
|
||||
CV_OVX_RUN(
|
||||
src.type() == CV_8UC1 && dst.type() == CV_8UC1 &&
|
||||
!ovx::skipSmallImages<VX_KERNEL_REMAP>(src.cols, src.rows) &&
|
||||
@ -1816,6 +1815,12 @@ void cv::remap( InputArray _src, OutputArray _dst,
|
||||
if( dst.data == src.data )
|
||||
src = src.clone();
|
||||
|
||||
if ((map1.type() == CV_32FC1) && (map2.type() == CV_32FC1))
|
||||
{
|
||||
CALL_HAL(remap32f, cv_hal_remap32f, src.type(), src.data, src.step, src.cols, src.rows, dst.data, dst.step, dst.cols, dst.rows,
|
||||
map1.ptr<float>(), map1.step, map2.ptr<float>(), map2.step, interpolation, borderType, borderValue.val);
|
||||
}
|
||||
|
||||
interpolation &= ~WARP_RELATIVE_MAP;
|
||||
if( interpolation == INTER_AREA )
|
||||
interpolation = INTER_LINEAR;
|
||||
|
Loading…
Reference in New Issue
Block a user