www.gusucode.com > vision 源码程序 matlab案例代码 > vision/ComputeTheOverlapRatioBetweenEveryPairOfBoundingBoxesExample.m
%% Compute Overlap Ratio Between Each Pair of Bounding Boxes % Randomly generate two sets of bounding boxes. % Copyright 2015 The MathWorks, Inc. bboxA = 10*rand(5,4); bboxB = 10*rand(10,4); %% % Ensure that the width and height of the boxes are positive. bboxA(:,3:4) = bboxA(:,3:4) + 10; bboxB(:,3:4) = bboxB(:,3:4) + 10; %% % Compute the overlap ratio between each pair. overlapRatio = bboxOverlapRatio(bboxA,bboxB)