I remove the distortion from my images with cv::remap(). The necessary maps are created with cv::initUndistortRectifyMap(). Now I’d like to also resize the images and if possible I want to include this in my maps such that cv::remap() would remove the distortion and resize the images at once.
Is there an easy way to change the maps such that they do the two task at the same time? I have to change the maps and can’t compute them from scratch since I don’t have the input parameters from cv::initUndistortRectifyMap() anymore.
I could just calculate every entry myself, but I was hopping for different solution.
OpenCV does offer some functions which calculate the maps for cv::remap()
However, none of these can be used to combine two transforms. The only chance to use them together is to build your custom function. Looking at the code for warpAffine – which can be used to resize an image, can give you some help in the task.