code explanation in image processing

2 ビュー (過去 30 日間)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012 年 8 月 24 日
a = imread('cameraman.tif');
threshold = 150
a(a>threshold)
...
Hi, This is my code and can anyone tell me what exactly the code does?
Regards, Siva

回答 (1 件)

Jürgen
Jürgen 2012 年 8 月 24 日
編集済み: Image Analyst 2012 年 8 月 24 日
Hi, It gives you all values of a that are higher than threshold a>150 gives a logical (0 or 1) matrix from the same size as a: 0 (false) if element < or = 150 ; 1 (true) if element > 150 if you use that as index => you get the values of a larger than 150 greetings
  1 件のコメント
Image Analyst
Image Analyst 2012 年 8 月 24 日
The third line will also print all the gray level values of all pixels to the command window, since he did not end the line with a semicolon.

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

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by