Plot the image intensities in 3D plot.

2 次查看(过去 30 天)
Lizan
Lizan 2012-10-17
评论: Osman 2014-11-10
Hi,
I have stored images in an array, example of the first image is
myPict{1,1}{1,1}
and the second,
myPict{1,1}{1,2} or myPict{2,1}{1,1}
Not important, anyways,..
I would like to plot the pixel intensity in a 3D plot. How can I do this?
I tried with,
y = 1:480; x = 1:640; [x,y] = meshgrid(x,y); surface(x,y,myPict{1,1}{1,1}(:,:,1))
but I only get an empty figure.
Anyone know what the problem is?

回答(1 个)

Image Analyst
Image Analyst 2012-10-17
Try this:
rgbImage = myPict{1,1}{1,1}(:,:,1);
[rows columns numberOfColorChannels] = size(rgbImage)
figure;
imshow(rgbImage);
what does it say in the command window for the size of the image? Does it show any 2D color image in the axes of the new figure?
  3 个评论
Image Analyst
Image Analyst 2012-10-17
OK - it's actually a monochrome (grayscale) image. What does this say
class(rgbImage)
If it says single or double, do this
imshow(rgbImage, []);
See if that will show something.
Osman
Osman 2014-11-10
% Convert your image to double scale then plot using surf or mesh.. I = imread('your image'); J = double(I); % if the image is RGB convert to gray scale. % Displaying x1 = 640; % Number of row y1 = 480; % Number of column [x,y] = meshgrid(1:y1,1:x1); figure, Surf(x,y,J)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by