Info

この質問は閉じられています。 編集または回答するには再度開いてください。

design a function to identify whether the gray scale of the specified area meets the conditions

1 回表示 (過去 30 日間)
Xiaoya Jiang
Xiaoya Jiang 2020 年 11 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
We have a gray image I, and we need to create a function F(I,a,b) to return a binary matrix F that is of the same size as I, where 1 for pixels satisfying the domain condition and 0 otherwise. a and b means the domain [a, b].

回答 (1 件)

Sindhu Karri
Sindhu Karri 2020 年 11 月 11 日
You can use below attached code as a reference
function I=F(I,a,b)
[c, d]=size(I);
for i=1:c
for j=1:d
if(a<=I(i,j)&&I(i,j)<=b)
I(i,j)=1;
else
I(i,j)=0;
end
end
end
end

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by