Unable to find the location of the pixel with the minimum gray level

1 回表示 (過去 30 日間)
Warid Islam
Warid Islam 2021 年 7 月 28 日
コメント済み: Warid Islam 2021 年 7 月 29 日
I want to find the location of the pixel in the image which has the minimum gray level. I tried the code below. But it gives me the coordinates of more than one pixel. What I need is to find the location of one pixel that has the minimum gray level. Any suggestion would be appreciated.
I=imread('FP00000f002b04u_01.png')
minValue = min(I(:))
[row, column] = find(I == minValue);

採用された回答

Yongjian Feng
Yongjian Feng 2021 年 7 月 28 日
A quick guess. Maybe there are more than one minimum? Then you need to decide. Maybe anyone is good enough?
  3 件のコメント
DGM
DGM 2021 年 7 月 29 日
If any one minimal point is sufficient, then how about the first?
[row, column] = find(I == minValue,1,'first');
I'm not really sure how you intend to use it, but that's one way.
Warid Islam
Warid Islam 2021 年 7 月 29 日
Hi @DGM,
That helps. Thank you.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by