Filter löschen
Filter löschen

What does this code compute?

1 Ansicht (letzte 30 Tage)
Anushka
Anushka am 13 Feb. 2015
Bearbeitet: Image Analyst am 14 Feb. 2015
what does this code compute? mask ( inside ) = ones ( size ( inside ) )

Akzeptierte Antwort

Titus Edelhofer
Titus Edelhofer am 13 Feb. 2015
It set's all entries in mask, where inside is true, to one. I guess
mask(inside) = 1;
should do the same in fact.
Titus
  2 Kommentare
Anushka
Anushka am 13 Feb. 2015
Thank you sir for your kind response
Anushka
Anushka am 13 Feb. 2015
Bearbeitet: Image Analyst am 14 Feb. 2015
d = size(img); % dimension
img = double(img);
%---------- Normalize co-ordinates to [-sqrt2,sqrt2] (centroid assumed @ origin)
xstep = 2/(d(1)-1);
ystep = 2/(d(2)-1);
[x,y] = meshgrid(-1:xstep:1,-1:ystep:1);
Sir can you please explain this too.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB 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