Help with using SURF to analyze an image?

17 Ansichten (letzte 30 Tage)
Taylor Gates
Taylor Gates am 13 Jul. 2018
Beantwortet: Image Analyst am 14 Jul. 2018
So I am trying to analyze and image using "surf" to make a 3D plot whose z value is the gray scale, where darker image will have lower z (Black is 0, White is 255). How would I use surf to analyze an image like that?

Akzeptierte Antwort

Rik
Rik am 13 Jul. 2018
What your goal is, is not really clear to me, but you can use the code below to view an image as a surf. I used an example image packaged with the IPT, so if you don't have that toolbox, you'll have to use your actual image.
figure(1),clf(1)
peppers = double(imread('peppers.png'));
IM=peppers(:,:,1)*.3+peppers(:,:,1)*.6+peppers(:,:,1)*.1;
[X,Y]= meshgrid(1:size(IM,2),size(IM,1):-1:1);
surf(X,Y,IM,'EdgeColor','none')
colormap('gray')
view(10,90)
  6 Kommentare
Taylor Gates
Taylor Gates am 14 Jul. 2018
for example. If I delete the last line of the code you provided, it should display (in mine at least) a 3D surf of the grayscale. That is what I was trying to get.
Rik
Rik am 14 Jul. 2018
Just to clarify: you can still 3D rotate this. The line with view just sets the camera to a point where you can easily recognize the image.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Image Analyst
Image Analyst am 14 Jul. 2018

Image Analyst
Image Analyst am 13 Jul. 2018
You wouldn't. The surf() function in base MATLAB just for visualization of smooth images, as opposed to SURF from the Computer Vision System Toolbox. The surf() function is not very good for visualizing rough images, and no good at all for analysis. See my Image Segmentation Tutorial in my File Exchange for an intro to image analysis.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by