code explanation in image processing

조회 수: 1 (최근 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 CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by