image and video processing

1 view (last 30 days)
Ariff pasha
Ariff pasha on 27 Nov 2015
Commented: Ariff pasha on 29 Nov 2015
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.

Accepted Answer

Thorsten
Thorsten on 27 Nov 2015
Edited: Thorsten on 27 Nov 2015
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 Comments
Image Analyst
Image Analyst on 27 Nov 2015
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)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!