Search code examples
c++opencvremap

opencv remap to a different size image


Can I use remap to map one image into another image with a different size?

for example assume that I want to map all pixels from image one (with size a,b) that x+y<100 into a new image and the size of new image should be 2a+b, 2b+a.


Solution

  • remap is more suited for geometical transformations of image. If you are aiming for image resizing only imresize is a better option for image resizing images. In your case your can simply write

    resize(source_Img, destination_Img, Size(2a+b,2b+a), 0, 0, interpolation);