在Matlab中选择图像上的像素时索引是指什么? [英] What does the index refer to when selecting a pixel on an image in Matlab?

查看:1057
本文介绍了在Matlab中选择图像上的像素时索引是指什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Matlab中查看图像的单个像素时,该索引是指什么? X / Y是指像素的坐标,RGB是指颜色,但是关于索引是什么的任何想法?



澄清,当我查看时在Matlab中使用数据并使用数据光标选择一个点,显示的三行是:



X:### Y:###



索引:###



RGB:###,###,###



我试图将几个dicom图像平均在一起,看来添加和操作的数字是这个索引值,但我不确定是什么它指的是。



例如,这是我可能正在阅读的图片:

 %加载MRI 
I = dicomread(文件名); %进入MRI

%显示MRI
数字
imshow(I)
imcontrast

然后,使用Matlab图上的工具栏,我使用数据光标查看一个像素。



谢谢!<如果你想谈论索引,我们需要进入所谓的



如您所见,索引图像为您提供了正确的行需要从颜色图中进行采样,以便您可以使用正确的颜色填充相应的位置。因此,对于索引图像中带圆圈的像素,索引为5,这意味着我们需要获取颜色贴图的第五行,这就是我们需要在屏幕上绘制的颜色。






对于灰度图像,索引只是强度。如果你想盲目地看一下,索引就是图像本身看到的值,无论是索引图像还是灰度图像。但是,根据上下文,索引意味着从颜色图中采样,或者只是查看图像本身的强度。


When looking at a single pixel of an image in Matlab, what does this index refer to? X/Y refer to the coordinates of the pixel, and RGB refers to the color, but any ideas on what the index is?

To clarify, when I am viewing a figure in Matlab and use the data cursor to select a point, the three lines shown are:

X: ### Y: ###

Index: ###

RGB: ###, ###, ###

I am trying to "average" several dicom images together, and it appears that the numbers that are added and being manipulated is this index value, but I'm not sure what it refers to.

For example, here is an image that I might be reading:

%loads MRI
I = dicomread(filename); %enters MRI

%displays MRI
figure
imshow(I)
imcontrast

Then, using the toolbar on the Matlab figure, I used the data cursor to look at a pixel.

Thanks!

解决方案

If you want to talk about "index", we need to go into what are known as indexed images. Take for example the mandrill data set that you can load into MATLAB via:

>> load mandrill

You see that there is a colour map called map and an indexed image called X. The colour map is a N x 3 matrix where each row gives you a unique RGB tuple that describes a particular colour. The first column is the proportion of red, the next column is the proportion of green and the last column is the proportion of blue that describes the colour in that row. All colours are between [0,1] which make sense as we're describing proportions.

When we take a look at indexed images, each location in this image gives you the location in the colour map that you would need to sample from in order to represent what colour this pixel is at this point. A great pictorial representation can be shown here:

Source: MathWorks

As you can see, the indexed image gives you the right row you need to sample from in the colour map so that you can fill in the corresponding location with the right colour. As such, for the circled pixel in the indexed image, the index is 5, which means that we need to get the fifth row of the colour map and that's the colour that we would need to paint onto the screen.


For the case of grayscale images, the index is simply the intensity. If you want to look at it blindly, the index is simply the value seen at the image itself, whether it be an indexed image or a grayscale image. However, depending on the context, the index means to either sample from a colour map, or just look at the intensity of the image itself.

这篇关于在Matlab中选择图像上的像素时索引是指什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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