0
$\begingroup$

I need to extract low resolution patches from an image. For example, 32x32 patches from a 500x500 image.

Method One

  1. Down res 500x500 image (by bicubic interpolation, both down res and up res).
  2. Extract 32x32 patches.

Method Two

  1. Extract 32x32 patches.
  2. Down res (by bicubic interpolation, both down res and up res) 32x32 patches.

Will the patches extracted be identical? If they aren't, how different will they be?

$\endgroup$
  • $\begingroup$ Amazing to see how people often evoke bicubic interpolation for image subsampling. This is a nonsense. The issue is that you need proper sampling and most of the time the image contains frequencies above the Nyquist limit (for the lower resolution). Bicubic resampling will just result in terrible aliasing. The correct way is to apply a low-pass filter, such as a Gaussian, then decimate. Then interpolation is of no use, nearest-neighbor is good enough, as the filtered image is very smooth. (Interpolation is only useful for upsampling or when the resampling frequency is of the order of the initi $\endgroup$ – Yves Daoust Oct 25 '17 at 6:36
-1
$\begingroup$

The short answer is no. The order of operations doesn't matter and the final result would be similar within reasonable approximation errors.

The long answer is:

A given image $I$ has a pixel resolution of $M \times N$ pixels and a pixel size of $P \times Q$mm. Therefore, the image physical size is $M \cdot P \times N \cdot Q$mm.

If you downsample that (with any interpolation method) by some factor $d \in \left(0 \ldots 1\right)$, then its new physical size will be $d \cdot M \cdot P \times d \cdot N \cdot Q$. Obviously, here $d \cdot M \le 32$ and $d \cdot N \le 32$.

By the way, since at this point we are talking about reduction in physical size, this means that some of the original pixels, some of the original actual information content, had to be thrown away

If you then select the $32 \times 32$ patch, you are selecting some "space" out of the "shrunk" image, some of which information content has now been thrown away. ($32 \cdot d \cdot M \cdot P$)

If you were to select a $32 \times 32$ patch out of the original $M \cdot P \times N \cdot Q$ image, then you select a patch at full resolution.

Once you have selected the patch, the rest of the image is "thrown away". Any downsampling of that patch will produce a new patch whose dimensions (and actual information content) will be lower than $32 \times 32$. If you are thinking at this point "Oh, its alright, I will cut out a $32 \times 32$ patch, downsample it to (for instance) $12 \times 12$ and then upsample that patch back to $32 \times 32$" then, in terms of actual information content you are not gaining anything and you are back to the first case.

In fact, practically, because of the double interpolation (one to downsample and then one to upsample), this second case will have more opportunity for numerical errors but in terms of actual information content, actual spatial resolution, you don't gain anything.

The "dangerous" bit here is the downsampling. Once that takes place, that is where actual information is thrown away. This is why, when you are trying to resample a signal by a non-integer factor $\frac{u}{v}$, you first upsample by $u$ (where no new information content is added but the same information is distributed over larger space) and then downsample by $v$ (where actual information get's limited).

In your case, you have two different routes that both include downsampling by the same factor at some point. Their end result will be similar within reasonable approximations afforded by the interpolation steps.

Hope this helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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