How to Slide a 3X3 window across a pixel of the image in matlab.

1 visualización (últimos 30 días)
I have an binary image I want to slide 3*3 window across it.

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 2 de Jul. de 2019
Editada: KALYAN ACHARJYA el 2 de Jul. de 2019
conv2 or imfilter all are sliding window concept.
  10 comentarios
Jan
Jan el 2 de Jul. de 2019
@Nupur: You are asking for trivial code. Why don't you try this by your own? Simply insert a if BW(i,j)==1.
Nupur Goyal
Nupur Goyal el 3 de Jul. de 2019
thanku i did that code its really helpful

Iniciar sesión para comentar.

Más respuestas (1)

Rik
Rik el 2 de Jul. de 2019
You can still use the convolution tools:
im=randi([0 1], 315, 274);
kernel=[1 1 1;1 0 1;1 1 1];
sum_of_8=convn(im,kernel,'same');
L_bifurcation = im==1 & sum_of_8==3;
L_termination = im==1 & sum_of_8==1;
The last two variable contain the positions you are interested in.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by