Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 506d2a6

Browse files
committed
New HAL API for remap
1 parent 197626a commit 506d2a6

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

modules/imgproc/src/hal_replacement.hpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,36 @@ inline int hal_ni_warpPerspective(int src_type, const uchar *src_data, size_t sr
298298
#define cv_hal_warpPerspective hal_ni_warpPerspective
299299
//! @endcond
300300

301+
/**
302+
@brief hal_remap
303+
@param src_type source and destination image type
304+
@param src_data source image data
305+
@param src_step source image step
306+
@param src_width source image width
307+
@param src_height source image height
308+
@param dst_data destination image data
309+
@param dst_step destination image step
310+
@param dst_width destination image width
311+
@param dst_height destination image height
312+
@param mapx map for x values
313+
@param mapx_step mapx matrix step
314+
@param mapy map for y values
315+
@param mapy_step mapy matrix step
316+
@param interpolation interpolation mode (CV_HAL_INTER_NEAREST, ...)
317+
@param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...)
318+
@param borderValue values to use for CV_HAL_BORDER_CONSTANT mode
319+
@sa cv::remap
320+
*/
321+
inline int hal_ni_remap(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height,
322+
uchar *dst_data, size_t dst_step, int dst_width, int dst_height,
323+
float* mapx, size_t mapx_step, float* mapy, size_t mapy_step,
324+
int interpolation, int borderType, const double borderValue[4])
325+
{ return CV_HAL_ERROR_NOT_IMPLEMENTED; }
326+
327+
//! @cond IGNORED
328+
#define cv_hal_remap hal_ni_remap
329+
//! @endcond
330+
301331
/**
302332
@brief hal_cvtBGRtoBGR
303333
@param src_data source image data

modules/imgproc/src/imgwarp.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,6 @@ void cv::remap( InputArray _src, OutputArray _dst,
17991799
_dst.create( map1.size(), src.type() );
18001800
Mat dst = _dst.getMat();
18011801

1802-
18031802
CV_OVX_RUN(
18041803
src.type() == CV_8UC1 && dst.type() == CV_8UC1 &&
18051804
!ovx::skipSmallImages<VX_KERNEL_REMAP>(src.cols, src.rows) &&
@@ -1816,6 +1815,10 @@ void cv::remap( InputArray _src, OutputArray _dst,
18161815
if( dst.data == src.data )
18171816
src = src.clone();
18181817

1818+
if ((map1.type() == CV_32FC1) && (map2.type() == CV_32FC1))
1819+
CALL_HAL(remap, hal_remap, src.type(), src.data, src.step, src.cols, src.rows, dst.data, dst.step, dst.cols, dst.rows,
1820+
(float*)map1.data, map1.step, (float*)map2.data, map2.step, interpolation, borderType, borderValue);
1821+
18191822
interpolation &= ~WARP_RELATIVE_MAP;
18201823
if( interpolation == INTER_AREA )
18211824
interpolation = INTER_LINEAR;

0 commit comments

Comments
 (0)