Hello there,
I have some contours (multiple std::vector of cv::Point) that I get using [cv::findContours](http://docs.opencv.org/3.1.0/d3/dc0/group__imgproc__shape.html#ga17ed9f5d79ae97bd4c7cf18403e1689a&gsc.tab=0) and I would like to modify the values of each point (meaning remapping the contours) using both maps that I got from [cv::fisheye::initUndistortRectifyMap](http://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#ga0d37b45f780b32f63ed19c21aa9fd333).
Is there any way to use [cv::remap](http://docs.opencv.org/3.1.0/da/d54/group__imgproc__transform.html#gab75ef31ce5cdfb5c44b6da5f3b908ea4) with contours as inputs and outputs ? When I try to use it, I get this assertion from [matrix.cpp](https://github.com/opencv/opencv/blob/master/modules/core/src/matrix.cpp) :
**OpenCV Error: Assertion failed (d == 2 && (sizes[0] == 1 || sizes[1] == 1 || sizes[0]*sizes[1] == 0)) in create, file /home/lemaker/Documents/opencv-github/modules/core/src/matrix.cpp, line 2363**
I am aware of the existence of [cv::fisheye::undistortPoints](http://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#gab738cdf90ceee97b2b52b0d0e7511541) but it seems that [cv::remap](https://github.com/opencv/opencv/blob/master/modules/imgproc/src/imgwarp.cpp#L4796) is optimized for my case (NEON support + parallel_for_) and I don't need to re-calculate the maps matrix each time (as undistortPoints seems to do it by itself), that is why **cv::remap** would be a good solution.
Thank you in advance for your answer, and have a good day ! :)
↧