Skip to content

Add functions to compute Union & Intersection Area of two rectangles #484

@AlexandreBrown

Description

@AlexandreBrown

Feature Request

Use Case

  • When doing object detection using deep learning, we have to do what is known as non-max supression. To do so we need to compute the IoU (Intersection over Union) of two rectangles (compute area of the union and the area of the intersection of the two rectangles). Adding it to KMath would allow us to make use of it for the IoU computation without implementing the area computation part from scratch. Even though it is not very hard to do, I think it could be a nice addition to KMath since its usage can be much broader than just for deep learning, area computation is pretty generic in maths.

Proposal

  • A function/method similar to getIntersectionArea(Rect1, Rect2)
  • A function/method similar to getUnionArea(Rect1, Rect2)
    or
  • A single function getIoU(Rect1, Rect2)
    Ideally the solution should be mockable so that library users have more freedom.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions