1

I,m trying to make a laplacian pyramid for image reconstruction but I,ve got a problem.

When downsampling I just get the even rows/columns and discard the rest, when upsampling I duplicate each row/column.

But this creates a situation where sizes of images may not be the same, not allowing me to create a LoG by subtraction. If I downsample a odd size img and the upsample it it will be even.

How do I do this correctly so I can reconstruct the original image perfectly?

  • Crop or resize to start with power of 2 size images. – fmw42 Oct 26 '21 at 18:33
  • look at OpenCV's `pyrDown`. it convolves the image with a gaussian before decimation. look at `pyrUp` too. – Christoph Rackwitz Oct 26 '21 at 19:16
  • Obviously you need to know the size of the original image to be able to upsample correctly. Simply do what you do (though it's not the best method, interpolation would be better), then remove any rows and columns from the end that are outside the original image's domain. – Cris Luengo Oct 26 '21 at 19:47

0 Answers0