comparison toolboxes/FullBNT-1.0.7/KPMtools/rectintC.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
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);