Merge pull request #25399 from asmorkalov:as/HAL_remap

New HAL API for remap
pull/25432/head
Alexander Smorkalov 11 months ago committed by GitHub
commit 577ad0a5ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 30
      modules/imgproc/src/hal_replacement.hpp
  2. 7
      modules/imgproc/src/imgwarp.cpp

@ -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…
Cancel
Save