1

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.

mans
  • 17,104
  • 45
  • 172
  • 321
  • 2
    yes, you can. you need to create a mapping function map.create(newimage.size(), CV_32FC1); and populate it. example here, check result 2 with a new size: http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/remap/remap.html – baci Feb 26 '14 at 12:16

2 Answers2

2

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?

Michael Burdinov
  • 4,348
  • 1
  • 17
  • 28
  • Thanks for your reply. Yes I want to remap an image to another one (geometric transformation) and the result is not the same as input image. For example converting a panoramic image to cubeface images (http://www.tiempo-digital.com/en/software/tocube/tocube.html ) – mans Mar 04 '14 at 09:51
1

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

Genutek
  • 387
  • 1
  • 5
  • 11
  • "I want to map all pixels from image one (with size a,b) that x+y<100" it looks like he wants to map a triangle area to a rectangle, so.. – baci Feb 26 '14 at 12:27
  • sorry! misunderstood the question.Thanks for clearification.If thats the case then I second your comment above. – Genutek Feb 26 '14 at 12:54