Matlab中的灰度 [英] Grayscale in matlab
本文介绍了Matlab中的灰度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将2D数组转换为灰度,但使用mat2gray却无济于事,并且imshow()似乎创建了一个二进制图像,当我绘制图形时我无法旋转它,例如原始数组为2d,但映射为3d.那么,在Matlab中对2d数组进行灰度处理的最佳方法是什么,那么如果您有A = rand(5,10)或其他东西并且想要对灰度进行灰度处理,什么是最佳方法?
I'm trying to convert a 2D array to grayscale but using mat2gray doesn't do anything and imshow() appears to create a binary image that when I graph I cannot rotate it, e.g. the original array is 2d but maps in 3d. So, what is the best way to take a grayscale of 2d array in Matlab so if you have A=rand(5,10) or something and want to take a grayscale of that, what is the best way?
推荐答案
如果在2D图像上使用imshow
,则最好使用自动缩放.
If you use imshow
on a 2D image, it is a good idea to use autoscaling.
img = randn(100);
imshow(img,[]);
这篇关于Matlab中的灰度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文