Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detekcio_kiertekeles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vass Zóra
detekcio_kiertekeles
Commits
580e1882
Commit
580e1882
authored
May 25, 2020
by
Vass Zóra
Browse files
Options
Downloads
Patches
Plain Diff
Add new file
parents
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
track_result
+127
-0
127 additions, 0 deletions
track_result
with
127 additions
and
0 deletions
track_result
0 → 100644
+
127
−
0
View file @
580e1882
function track_result(algo_xml, annot_xml, track_num, allframes)
annotation=parseXML(annot_xml); %fájlok beolvasása, structok létrehozása
algorithm=parseXML(algo_xml);
TP=zeros(1, allframes); %hit
TN=zeros(1, allframes);
FP=zeros(1, allframes); %false alarm
FN=zeros(1, allframes); %miss
AreaOverlap=zeros(1, allframes);
AreaMissed=zeros(1, allframes);
CdistMean=zeros(1, allframes);
%megkeressük, hogy létezik e mindkettőben az adott track
[algo_track, algo_success]=getTrack(track_num, algorithm);
[annot_track, annot_success]=getTrack(track_num, annotation); %megvizsgáljam, hogy ugyanolyan típusúak?
if algo_success && annot_success %ha mindkettőben megtaláltuk az adott track-et
for i=1:allframes %végigmegyünk a frameken
%megkeressük a hozzájuk tartozó boxok mindkettőben
[algo_box, algo_box_success]=getBox(i, algo_track);
[annot_box, annot_box_success]=getBox(i, annot_track);
if algo_box_success && annot_box_success %mindkettő talált
%ugyanott talált-e-> overlap-et meg kell nézni
[T_overlap, T_annot, T_algo, Distance]=calculate_overlap(annot_box, algo_box);
AreaOverlap(i)=T_overlap;
AreaMissed(i)=(T_annot-T_overlap)+(T_algo-T_overlap);
CdistMean(i)=Distance;
if T_overlap>0 %ugyanott talált
TP(i)=1;
else %nem ugyanott talált
FP(i)=1;
FN(i)=1;
end
elseif ~algo_box_success && annot_box_success %van, de nem talált
FN(i)=1; %itt csak ott kéne rakni 1-est, ahol meg is találta az objektumot
AreaMissed(i)=calculate_area(annot_box);
elseif ~annot_box_success && algo_box_success %nincs, de talált
FP(i)=1;
else %nincs, és nem is talált
TN(i)=1;
end
end
elseif ~algo_success && annot_success %van annotálva, de nem találta meg az algoritmus
%mindenhol miss, ahol van annotáció
for i=1:allframes
[annot_box, annot_box_success]=getBox(i, annot_track);
if annot_box_success
FN(i)=1;
AreaMissed(i)=calculate_area(annot_box);
else
TN(i)=1;
end
end
elseif ~annot_success && algo_success %ha nincs annotálva, de az algoritmus talált
for i=1:allframes
[algo_box, algo_box_success]=getBox(i, algo_track);
if algo_box_success
FP(i)=1;
else
TN(i)=1;
end
end
else
error('nem létezik a kiválasztott track');
end
if annot_success || algo_success %ha nincs ilyen track, akkor nem rajzolunk ki semmit
P=zeros(1,allframes);
R=zeros(1,allframes);
POD=zeros(1,allframes);
for i=1:allframes
if TP(i)+FP(i)>0
P(i)=TP(i)/(TP(i)+FP(i));
end
if TP(i)+FN(i)>0
R(i)=TP(i)/(TP(i)+FN(i));
end
if P(i)+R(i)>0
POD(i)=(2*P(i)*R(i))/(P(i)+R(i));
end
end
figure('units','normalized','outerposition',[0 0 1 1])
tiledlayout('flow')
x=linspace(1, allframes, allframes);
nexttile
scatter(x, TP, 15)
ylim([0 1])
title('TP')
nexttile
scatter(x, TN, 15)
ylim([0 1])
title('TN')
nexttile
scatter(x, FP, 15)
title('FP')
ylim([0 1])
nexttile
scatter(x, FN, 15)
ylim([0 1])
title('FN')
nexttile
scatter(x, POD, 15)
ylim([0 inf])
title('Probability of detection')
nexttile
scatter(x, AreaOverlap, 15)
ylim([0 inf])
title('Area Overlapping')
nexttile
scatter(x, AreaMissed, 15)
ylim([0 inf])
title('Area Missed')
nexttile
scatter(x, CdistMean, 15)
ylim([0 inf])
title('CdistMean')
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment