MATLAB Answers

0

How does the function "mesh" work?

Asked by sana3 sal on 8 Sep 2019
Latest activity Commented on by sana3 sal on 8 Sep 2019
Hi,
I have the following code,
my question is, what is the algorithm that the function mesh works on?
I have got great results after exporting the mesh into an obj file, so I need an explanation for that.
clear all
a = imread('spect2.jpg');
imshow(a);
f = ones(5) * 1/25;
a = imfilter(a, f, "symmetric");
b = rgb2gray(a);
b = im2double(b);
imshow(b);
shading interp
colormap(hot)
FV=mesh(b);

  1 Comment

dpb
on 8 Sep 2019
Precisely is proprietary to TMW and so isn't documented (nor will TMW comment if you ask).
A tutorial presentation of what is behind the idea is at Drawing-lines-triangles a graphics coding tutorial (one of a series).

Sign in to comment.

1 Answer

Answer by darova
on 8 Sep 2019

Since you didn't specify X and Y for mesh()
[m,n] = size(b);
[X,Y] = meshgrid(1:m,1:n);
mesh(X,Y,b)
Is that you wanted to know?

  1 Comment

No i need only the idea of the algorithm inside the function "mesh"

Sign in to comment.