Sam
Sam

Reputation: 949

Resizing an image in matlab without introducing interpolated values

I have a categorical image and I need to make it smaller. But, by default, when I use imresize in matlab, the output is not categorical either (it will be continuous). However, there are some methods like Otsu to convert it to categorical image, but I do not want to use those methods.

Is there any method in matlab by which I will be able to resize a categorical image to another categorical image without using any other operation on the resized image?

Upvotes: 2

Views: 2106

Answers (1)

moooeeeep
moooeeeep

Reputation: 32512

If you use nearest neighbor interpolation, it should only use values that were in the image before, i.e., no weighted averages.

As from the docs, to achieve this, you should add 'nearest' to the function call to specify the nearest neighbor interpolation method. Default is bicubic interpolation.

Upvotes: 7

Related Questions