Does 'imresize' generate artificial pixel RGB values which are not contained in the original image?

2 visualizaciones (últimos 30 días)
Hi,
I would like to know whether 'imresize' generate artificial pixel values which are not contained in the original image.
For instance, if my image is 2 rows by 3 columns (extreme case, won't happen in the real life). There will be 6 pixels contained in the image.
For instance, if these 6 pixels are
[0 0 0], [1 1 1], [2 2 2], [3 3 3], [4 4 4], [5 5 5], [6 6 6]
After I imresize the image to 1/2. There will only be 3 pixels left. Will some of these 3 pixels be like [1.5 1.5 1.5] which does not belong to the original 6 pixels.
  2 comentarios
Adam
Adam el 30 de Oct. de 2019
Editada: Adam el 30 de Oct. de 2019
Yes.
If you don't want it to I'd suggest using
doc interp2
with 'nearest neighbour' interpolation method instead.

Iniciar sesión para comentar.

Respuesta aceptada

Sai Bhargav Avula
Sai Bhargav Avula el 30 de Oct. de 2019
Editada: Sai Bhargav Avula el 30 de Oct. de 2019
Hi,
Yes for interpolation methods like bilinear, bicubic. But if you want to avoid it.
As suggested by Adam you can try interp2.
I would also suggest something similar. The imresize has 'nearest' as it's Interpolation method. You can try that too.
J = imresize(I, 0.5, 'nearest');
This shrinks by factor of two using nearest-neighbor interpolation. This is the fastest method, but it has the lowest quality.
  2 comentarios
Salad Box
Salad Box el 30 de Oct. de 2019
Hi Thanks for your answer.
I don't fully understand about 'nearest neighbor' and why it has the lowest quality.
For instance, if I have 6 pixels in the order
[5 5 5], [0 0 0], [3 3 3], [3 3 3], [1 1 1]
How the nearest neighbor method work and why this is the lowest quality? Quality of what? How to improve the quality?
Sai Bhargav Avula
Sai Bhargav Avula el 30 de Oct. de 2019
Editada: Sai Bhargav Avula el 30 de Oct. de 2019

The major issue with this method is aliasing(jagged edges).

This is because it uses the nearest neighbour and applies it's intensity value.

To address this you can either use better interpolation method or Use spatial domain image filtering

You can refer the link below for further explanation https://www.mathworks.com/help/vision/ug/interpolation-methods.html

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by