简体   繁体   中英

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?

If you use nearest neighbor interpolation, it should only use values that were in the image before, ie, 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM