summaryrefslogtreecommitdiff
path: root/macros/bboxOverlapRatio.sci
diff options
context:
space:
mode:
authorshamikam2017-01-16 02:56:17 +0530
committershamikam2017-01-16 02:56:17 +0530
commita6df67e8bcd5159cde27556f4f6a315f8dc2215f (patch)
treee806e966b06a53388fb300d89534354b222c2cad /macros/bboxOverlapRatio.sci
downloadFOSSEE_Image_Processing_Toolbox-a6df67e8bcd5159cde27556f4f6a315f8dc2215f.tar.gz
FOSSEE_Image_Processing_Toolbox-a6df67e8bcd5159cde27556f4f6a315f8dc2215f.tar.bz2
FOSSEE_Image_Processing_Toolbox-a6df67e8bcd5159cde27556f4f6a315f8dc2215f.zip
First CommitHEADmaster
Diffstat (limited to 'macros/bboxOverlapRatio.sci')
-rw-r--r--macros/bboxOverlapRatio.sci37
1 files changed, 37 insertions, 0 deletions
diff --git a/macros/bboxOverlapRatio.sci b/macros/bboxOverlapRatio.sci
new file mode 100644
index 0000000..682b8c8
--- /dev/null
+++ b/macros/bboxOverlapRatio.sci
@@ -0,0 +1,37 @@
+function [ overlapRatio ] = bboxOverlapRatio(bboxA, bboxB, ratioType)
+// Compute the overlap ratio between the bounding boxes A and B.
+//
+// Calling Sequence
+// [ overlapRatio ] = bboxOverlapRatio(bboxA, bboxB);
+// [ overlapRatio ] = bboxOverlapRatio(bboxA, bboxB, ratioType);
+//
+// Parameters
+// bboxA: Bounding box A of the form [x, y, width, height];
+// bboxB: Boundng box B of the form [x, y, width, height];
+// ratioType (Optional Argument): Method to be used to compute the ratio. Set this to either 'Union' or 'Min'. Default computation method is set to 'Union'.
+// overlapRatio: Overlap ratio between the bounding boxes A and B.
+//
+// Description
+// Compute the overlap ratio between the bounding boxes A and B.
+//
+// Examples
+// bboxA = [1 2 3 4];
+// bboxB = bboxA + 100;
+// overlapRatioMin = bboxOverlapRatio(bboxA, bboxB, 'Min');
+// overlapRatioUnion = bboxOverlapRatio(bboxA, bboxB);
+//
+// Authors
+// Tanmay Chaudhari
+
+ [lhs rhs] = argn(0)
+ if rhs>3 then
+ error(msprintf("Too many input arguments"))
+ elseif rhs==3 then
+ a=opencv_bboxOverlapRatio(input1,input2,varargin(1))
+ out=a
+ elseif rhs==2 then
+ a=opencv_bboxOverlapRatio(input1,input2)
+ out=a
+ end
+
+endfunction