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

1 回表示 (過去 30 日間)
Nupur Goyal
Nupur Goyal 2019 年 7 月 2 日
コメント済み: Nupur Goyal 2019 年 7 月 3 日
I have an binary image I want to slide 3*3 window across it.

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 2 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 2 日
conv2 or imfilter all are sliding window concept.
  10 件のコメント
Jan
Jan 2019 年 7 月 2 日
@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 2019 年 7 月 3 日
thanku i did that code its really helpful

サインインしてコメントする。

その他の回答 (1 件)

Rik
Rik 2019 年 7 月 2 日
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.
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 2 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 2 日
@RIK Yes +1 @Nupur referred this answer

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by