简体   繁体   中英

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.

Yes you can do that if you provide map image of required size. See documentation of remap .

Is there any reason that you can't use resize function for that?

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM