Filter löschen
Filter löschen

Plot the image intensities in 3D plot.

6 Ansichten (letzte 30 Tage)
Lizan
Lizan am 17 Okt. 2012
Kommentiert: Osman am 10 Nov. 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?

Antworten (1)

Image Analyst
Image Analyst am 17 Okt. 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 Kommentare
Image Analyst
Image Analyst am 17 Okt. 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 am 10 Nov. 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)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by