image and video processing

6 vues (au cours des 30 derniers jours)
Ariff pasha
Ariff pasha le 27 Nov 2015
Commenté : Ariff pasha le 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.

Réponse acceptée

Thorsten
Thorsten le 27 Nov 2015
Modifié(e) : Thorsten le 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 commentaires
Image Analyst
Image Analyst le 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)
Ariff pasha
Ariff pasha le 29 Nov 2015
tq sir :)0

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by