Borrar filtros
Borrar filtros

Plot the image intensities in 3D plot.

6 visualizaciones (últimos 30 días)
Lizan
Lizan el 17 de Oct. de 2012
Comentada: Osman el 10 de Nov. de 2014
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?

Respuestas (1)

Image Analyst
Image Analyst el 17 de Oct. de 2012
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 comentarios
Image Analyst
Image Analyst el 17 de Oct. de 2012
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 el 10 de Nov. de 2014
% 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)

Iniciar sesión para comentar.

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by