how to create a surface from a gray level image?

Let I be a gray level image and (x,y) be the standard coordinate. I multiplied this image 'I' with a constant value μ for μ=[0,1] and called it as scaled version of the image. Then i want to plot this scaled version image in a surface 'S' which is parameterised by ψ:(x,y)-->(x,y,μI(x,y)).How can i solve this?

14 Comments

Once you have a matrix, surf works to plot the surface. Did you try surf ?
I tried surf.but in this case what will give to x,y,z coordinates
z will be your image values, x,y if you provide it will take or else the indices according to the size of image.
sir, i tried the below code I=imread('lena.jpg'); x=[0:225]; y=[0:225]; z=I; surf(x,y,z); but got an error 'Data dimensions must agree.'
I=imread('lena.jpg');
[m,n,p] = size(I) ;
x=[1:n]; y=[1:m];
z=I(:,:,1);
surf(x,y,z);
z=I(:,:,1); what does it mean sir?
Read about imread. When you read a image you will get RGB values, your z will be 3D matrix. 1,2,3 corresponds to R (Red),G (green),B (blue) respectively.
Thank you sir.i just started to studying Matlab. if the image is a gray image, then what will write?
[m,n,p] = size(I) ;
x=[1:n]; y=[1:m];
surf(x,y,z); % z will be a 1D matrix
can I use this surface for my further steps other than using the image I?
What for you want to use?
I want to find out the tangent and normals
For tangent and normals why you need z? x, y are needed isn't it?
here i am trying to construct an orthonormal moving frame of an image. for that, i am taking two vector field z1: which indicates the direction of steepest slope at each point of surface and z2: which indicate the lowest slope at each point of the surface. N is normal to the surface. then can construct these on an image

Sign in to comment.

Answers (0)

Tags

Asked:

on 15 Feb 2017

Commented:

on 15 Feb 2017

Community Treasure Hunt

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

Start Hunting!