how to enter mask

2 visualizaciones (últimos 30 días)
vetri veeran
vetri veeran el 24 de Oct. de 2014
Comentada: Image Analyst el 24 de Oct. de 2014
Hi sir,
I want to enter this mask given below to 288*543.
288*543 contains initially 1000 as non object and 0 as object.
To that I have to enter this mask,
mask=[1.414,1,1.414; 1,1,1000; 1000,1000,1000];
and I need to apply this algorithm,
d_new(i,j)=min([d_new(i,j);1+d_new(i+1,j); 1.41+d_new(i+1,j+1);1+d_new(i,j+1);1.41+d_new(i-1,j+1)]);
and i need to update the values by d_new(i,j)
How can I achieve this in for loop.
Thanks in advance.

Respuesta aceptada

Image Analyst
Image Analyst el 24 de Oct. de 2014
Do you mean to replicate the mask out to a size of 288-by-543? Like this:
workspace;
% Initial 3-by-3 mask.
mask=[1.414,1,1.414; 1,1,1000; 1000,1000,1000]
% Make copies out to a size of 288-by-543
mask2 = repmat(mask, [96, 181]);
  1 comentario
Image Analyst
Image Analyst el 24 de Oct. de 2014
Regarding your edited question and new "Answer" (which is the same as your question now, and I'll probably delete)...your mask is 3-by-3 (9 elements) whereas your "algorithm" only has 5 elements. How do you reconcile that?

Iniciar sesión para comentar.

Más respuestas (1)

vetri veeran
vetri veeran el 24 de Oct. de 2014
Hi sir,
I want to enter this mask given below to 288*543.
288*543 contains initially 1000 as non object and 0 as object.
To that I have to enter this mask,
mask=[1.414,1,1.414; 1,1,1000; 1000,1000,1000];
and I need to apply this algorithm,
d_new(i,j)=min([d_new(i,j);1+d_new(i+1,j); 1.41+d_new(i+1,j+1);1+d_new(i,j+1);1.41+d_new(i-1,j+1)]);
and i need to update the values by d_new(i,j)
How can I achieve this in for loop.
Thanks in advance.

Categorías

Más información sobre Author Block Masks en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by