简体   繁体   English

Matlab导入B&W 16位TIFF然后绘图?

[英]Matlab import B&W 16-bit tiff then plot?

I have a 16-bit tiff that is b&w. 我有一个16位的tiff,是b&w。 It has no color mapping. 它没有颜色映射。

I import it like the following: 我将其导入如下:

Tiff = imread('MyImage.tif')

That gives me a Variable with a value 'single' named Tiff. 这给了我一个名为“ Tiff”的变量,其值为“单”。 It is just a grid/matrix of intensity values for each pixel. 它只是每个像素的强度值的网格/矩阵。

I have tried then using 我尝试过然后使用

image(Tiff);

But I end up with an image that is all Yellow. 但是我最终得到的图像全是黄色。

If I do 如果我做

imagesc(Tiff);

Then it kind of works, but its not grayscale, it is more like a heat map. 然后,它是可行的,但不是灰度的,更像是一张热图。

How do I plot the tiff on a graph? 如何在图表上绘制tiff? I want to be able to then then graph other lines on top of that tiff image. 然后,我希望能够在该tiff图像上方绘制其他线条。

Try this, 尝试这个,

[I,cmap] = imread('your_image.tif');
img  = ind2rgb(I,cmap); 

To plot something on top of your image you can do this: 要在图像上绘制一些内容,您可以执行以下操作:

figure, imshow(img);
hold on;
plot(your_x_data,your_y_data); % or whatever yo want plot on top that image. 

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

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