© Ron Dai 2019
R. DaiLearn Java with Mathhttps://doi.org/10.1007/978-1-4842-5209-3_31

31. IOU Computation

Ron Dai1 
(1)
Seattle, WA, USA
 
IOU means “Intersection Over Union.” It is used as a metric in image detection technology. This metric computes a ratio of the overlap area between two rectangles over their union area. For simplicity, the two rectangles are in the same direction, as you will see R1 and R2 in Figure 31-1.
../images/485723_1_En_31_Chapter/485723_1_En_31_Fig1_HTML.png
Figure 31-1

Two rectangles and their overlap

To figure out this ratio, we need to find out their overlap area named X. If the areas for the two rectangles are R1.area and R2.area, then
  • IOU = X / (R1.area + R2.area – X)

We define the location ...

Get Learn Java with Math: Using Fun Projects and Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.