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.

 Akzeptierte Antwort

Thorsten
Thorsten am 27 Nov. 2015
Bearbeitet: Thorsten am 27 Nov. 2015

0 Stimmen

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 Kommentare

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 am 29 Nov. 2015
tq sir :)0

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by