3
$\begingroup$

Is there any way how to compute convolution matrix for Nearest Neighbor (bicubic, bilinear) image scaling (upscale/downscale)?

$\endgroup$
1
  • $\begingroup$ Convolution cannot change image size (except adding borders). $\endgroup$ Commented Dec 14, 2014 at 7:37

2 Answers 2

2
$\begingroup$

This can't be done as a convolution because some of the operations you mentioned are not linear. Additionally, convolution by definition (multiplication by a toplitz matrix) shouldn't ever change the input and output size.

For bicubic:

http://en.wikipedia.org/wiki/Bicubic_interpolation#Bicubic_convolution_algorithm

enter image description here

Notice the high order terms.

$\endgroup$
2
$\begingroup$

As others have mentioned, convolution operation cannot change the size of the image. However, interpolation is a convolution operation. You just need to upsample by zero padding the image before performing the convolution (filtering) operation.

For example, say you want to interpolate a 1D signal times 2. The original signal is given by $a_0, a_1, .. , a_n$. You first zero pad it to get $a_0, 0, a_1, 0, ..$, then you filter the result. If the filter taps are 0.5, 1, 0.5, you will get simple linear interpolation. Similar scheme can be used in 2D images for biliniear interpolation, spline interpolation, etc.

$\endgroup$
1
  • $\begingroup$ I'm not sure bilinear interpolation can be done in the Fourier domain. For example, there is a constant term and a production of the two directions and is hence nonlinear. Most interesting, useful, things aren't linear :-) $\endgroup$
    – Mikhail
    Commented Jan 6, 2015 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.