Clear Filters
Clear Filters

how to get a 3D view of grey image?

2 views (last 30 days)
adi on 15 Jun 2020
Commented: Ameer Hamza on 15 Jun 2020
Hi every one,
so i have a gray image and i want to have a view of the different regions in the image (steep/flat regions)
how can i display a 3D view so the x,y will represent the pixel location and z will represent the value of the pixel?
thank you!

Accepted Answer

Ameer Hamza
Ameer Hamza on 15 Jun 2020
You can use surf()
img = im2double(imread('pears.png'));
img_gray = rgb2gray(img);
shading interp

More Answers (0)


Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!