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

3 次查看(过去 30 天)
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.

采纳的回答

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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by