Shiven Solanki 5bb1be7693 imgproc: support 5.x depths in remap/warp with INTER_NEAREST (#30595)
* imgproc: support 5.x depths in remap/warp with INTER_NEAREST

nn_tab in cv::remap only had entries for CV_8U..CV_64F, so remap,
warpAffine and warpPerspective with INTER_NEAREST failed with
"nnfunc != 0" for CV_16F, CV_16BF, CV_Bool, CV_64U, CV_64S, CV_32U and
both fp8 depths. Nearest neighbor only copies pixels, so add the
remapNearest instances for these types, in both the absolute and the
WARP_RELATIVE_MAP rows. Using the real element types keeps the border
value conversion right (e.g. CV_Bool border 2 becomes 1).

Add an Imgproc_Warp_NearestNewDepths test.

* imgproc: use MatDepth in Imgproc_Warp_NearestNewDepths

A plain int parameter prints a failing case as GetParam() = 13. MatDepth prints the depth name instead.

* imgproc: convert remap nearest border once, dispatch copy by element size
2026-11-22 19:28:31 +05:30
2018-10-11 17:57:51 +00:00
2026-11-18 19:15:21 +03:00
2026-11-18 19:15:21 +03:00
2025-08-07 10:35:20 +03:00

OpenCV: Open Source Computer Vision Library

Resources

Contributing

Please read the contribution guidelines before starting work on a pull request.

Summary of the guidelines:

  • One pull request per issue;
  • Choose the right base branch;
  • Include tests and documentation;
  • Clean up "oops" commits before submitting;
  • Follow the coding style guide.

Additional Resources

Description
Languages
C++ 87.7%
C 3.1%
Python 2.9%
CMake 2%
Java 1.5%
Other 2.6%