How would I detect gray/white pixels in a picture?

1 回表示 (過去 30 日間)
Ali Almakhmari
Ali Almakhmari 2022 年 8 月 8 日
回答済み: Walter Roberson 2022 年 8 月 9 日
I am trying to write a function to detect white-like and gray-like pixels in a given colored picture. I am stuck on how to go about it. Any help is appreciated.
  1 件のコメント
yanqi liu
yanqi liu 2022 年 8 月 9 日
yes,sir,may be upload your image file to analysis

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

採用された回答

Walter Roberson
Walter Roberson 2022 年 8 月 9 日
Convert for HSV, check for "high" V (near 1) and "small" (near 0) S. You will need to decide on the exact boundaries, depending how "white like" or "gray like" you want to allow.

その他の回答 (1 件)

KSSV
KSSV 2022 年 8 月 8 日
REad about find. Gve the pixle value as zero and use find. This will give you the indices.
[y,x] = find(I==0) ; % I is gray image
  1 件のコメント
Ali Almakhmari
Ali Almakhmari 2022 年 8 月 8 日
But that would require me to manually identifiy the gray pixels and assign them to zero. Which is the thing I am trying to automate with this function.

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by