Mercurial > hg > camir-ismir2012
comparison toolboxes/FullBNT-1.0.7/KPMtools/rectintC.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cc4b1211e677 |
---|---|
1 function [overlap, normoverlap] = rectintC(A,B) | |
2 % | |
3 % A(i,:) = [x y w h] | |
4 % B(j,:) = [x y w h] | |
5 % overlap(i,j) = area of intersection | |
6 % normoverlap(i,j) = overlap(i,j) / min(area(i), area(j)) | |
7 % | |
8 % Same as built-in rectint, but faster and uses less memory (since avoids repmat). | |
9 | |
10 | |
11 leftA = A(:,1); | |
12 bottomA = A(:,2); | |
13 rightA = leftA + A(:,3); | |
14 topA = bottomA + A(:,4); | |
15 | |
16 leftB = B(:,1)'; | |
17 bottomB = B(:,2)'; | |
18 rightB = leftB + B(:,3)'; | |
19 topB = bottomB + B(:,4)'; | |
20 | |
21 verbose = 0; | |
22 [overlap, normoverlap] = rectintLoopC(leftA, rightA, topA, bottomA, leftB, rightB, topB, bottomB, verbose); |