在matlab中调整图像大小而不引入插值 [英] Resizing an image in matlab without introducing interpolated values

查看:390
本文介绍了在matlab中调整图像大小而不引入插值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个分类图像,我需要把它缩小。但是,默认情况下,当我在matlab中使用imresize时,输出也不是分类的(它将是连续的)。但是,像Otsu这样的方法可以将其转换为分类图像,但我不想使用这些方法。

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.

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

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, i.e., no weighted averages.

文档开始,实现这样,你应该在函数调用中添加'nearest'来指定最近邻居插值方法。默认为双三次插值。

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.

这篇关于在matlab中调整图像大小而不引入插值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆