简体   繁体   English

在Matlab中调整图像大小而不引入插值

[英]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). 但是,默认情况下,当我在matlab中使用imresize时,输出也不是分类的(它将是连续的)。 However, there are some methods like Otsu to convert it to categorical image, but I do not want to use those methods. 但是,有一些方法,如Otsu将其转换为分类图像,但我不想使用这些方法。

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? 在matlab中是否有任何方法可以将分类图像调整为另一个分类图像,而无需在调整大小的图像上使用任何其他操作?

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. docs开始 ,要实现此目的,应在函数调用中添加'nearest'以指定最近的邻居插值方法。 Default is bicubic interpolation. 默认为双三次插值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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