point pixel coordinates in opencv
I have a matrix with floating-point pixel coordinates and corresponding matrix of greyscale values in this floating-point pixel coordinates. I need to remap an image from floating-point pixel coordinates to the regular grid. The cv::remap function from opencv transforms a source image like this: dst(x,y) = src(mapx(x,y), mapy(x,y)) In my case I have something like this: dst(mapx(x,y), mapy(x,y)) = src(x,y) From the equation above I need to determine destination image (dst(x,y)). Is there an easy way in OpenCv to perform such remapping or can you suggest any other open source image processing library to solve the problem?
std::vector<cv::Point> dstPts, srcPts
. cv::findHomography(dstPts, srcPtrs,...)
It works if the transform defined in your maps is a homographic transform. It doesn't work if it's some swirling, fisheye effect, lens correction map, etc.
链接地址: http://www.djcxy.com/p/89784.html下一篇: opencv中的点像素坐标