image and video processing

조회 수: 4 (최근 30일)
Ariff pasha
Ariff pasha 2015년 11월 27일
댓글: Ariff pasha 2015년 11월 29일
hi.i want to find accuracy(100%) in binary image.for example my roi size is 241x77.if all columns(77) detect 1 instead of 0 then i say its 100%. so i use yy= find(ROI_2(:,end)==1) to know which column has 1.

채택된 답변

Thorsten
Thorsten 2015년 11월 27일
편집: Thorsten 2015년 11월 27일
ROI = rand(241,77) > 0; % sample data
any(ROI) give 1 for each column that contains at least one 1.
acc = nnz(any(ROI))/size(ROI, 2);
  댓글 수: 2
Image Analyst
Image Analyst 2015년 11월 27일
And for an example where the accuracy is not 100%, because some columns do not have a 1 in them:
% Create sample data where some columns won't have a 1 in them:
ROI = rand(241,77) > 0.995;
% any(ROI) gives a 1 for each column that contains at least one 1.
accuracyPercentage = nnz(any(ROI)) / size(ROI, 2)
Ariff pasha
Ariff pasha 2015년 11월 29일
tq sir :)0

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by