필터 지우기
필터 지우기

How can I give different thresholds to an image

조회 수: 5 (최근 30일)
Joydeb Saha
Joydeb Saha 2022년 4월 11일
댓글: Joydeb Saha 2022년 5월 10일
How can I give different thresholds to an image? If 'cot' is the image matrix I have attached how can i give a threshold of zero, implying all pixels with non-zero values? Then all pixels above 1, and then all those above 5?

채택된 답변

Walter Roberson
Walter Roberson 2022년 4월 11일
first_answer = cot ~= 0;
second_answer = cot > 1;
third_answer = cot > 5;
If you are trying to categorize the pixels by range, then see discretize()
  댓글 수: 1
Joydeb Saha
Joydeb Saha 2022년 5월 10일
ncFiles = dir('E:\data\2002\*.nc');
N = length(ncFiles) ;
Q = zeros(N,1) ;
for i = 1:N
ncFile = fullfile(ncFiles(i).folder,ncFiles(i).name) ;
data_Wwind=netcdf(ncFile);
cot=data_Wwind{'M2TMNXRAD_5_12_4_TAUHGH'}(:);
th5 = cot > 3;
B = double(th5);
Q(i)=sum(B(:) == 1);
end
I have used this code to find the total number of pixels those are above threshold 3 for all the data files in the folder. How can I find the mean value of cot for all the data files (every month) only for the pixels those are above threshold three(3)?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by