<?xml version="1.0" encoding="UTF-8"?>
<hdevelop file_version="1.1" halcon_version="13.0">
<procedure name="region_bb_overlap">
<interface>
<io>
<par name="Candidate" base_type="iconic" dimension="0"/>
</io>
<ic>
<par name="box_coordinate" base_type="ctrl" dimension="0"/>
</ic>
<oc>
<par name="overlap" base_type="ctrl" dimension="0"/>
</oc>
</interface>
<body>
<c> * Copyright (c) MVTec Software GmbH.  All rights reserved.</c>
<c> *</c>
<c> * All use of this software is subject to the terms of the revised BSD</c>
<c> * license.  You should have received a copy of this license along</c>
<c> * with this source code in a file named "license.txt."    </c>
<c></c>
<l>gen_rectangle2 (Rectangle, box_coordinate[0], box_coordinate[1], rad(box_coordinate[4]), (box_coordinate[2]-1)/2.0, (box_coordinate[3]-1)/2.0)</l>
<l>intersection (Candidate, Rectangle, RegionIntersection)</l>
<l>area_center (RegionIntersection, AreaIntersection, _, _)</l>
<l>union2 (Candidate, Rectangle, RegionUnion)</l>
<l>area_center (RegionUnion, AreaUnion, _, _)</l>
<c>* </c>
<l>if (AreaUnion&gt;0)</l>
<l>    overlap := real(AreaIntersection)/AreaUnion</l>
<l>else </l>
<l>    overlap := 0.0</l>
<l>endif</l>
<l>return ()</l>
</body>
<docu id="region_bb_overlap">
<parameters>
<parameter id="Candidate"/>
<parameter id="box_coordinate"/>
<parameter id="overlap"/>
</parameters>
</docu>
</procedure>
</hdevelop>
