1
0
mirror of https://github.com/2martens/uni.git synced 2026-05-06 19:36:26 +02:00

[BV] Assignment2 3-5 finished

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2016-11-01 14:24:07 +01:00
parent 4ecdd157fa
commit de4654c1d7
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,15 @@
function [ intersection ] = hist_dist_intersection( h1, h2 )
%HIST_DIST_INTERSECTION Calculates intersection between 2 histograms
intersection = 0;
s = size(h1);
if s(1) > 1
n = s(1);
else
n = s(2);
end
for i = 1:n
intersection = intersection + min(h1(i), h2(i));
end
end