Developer Guide

Obtain the bounding boxes of the results of image recognition with CraftAR

icon Date Developer Guide

icon Date Dec 22, 2020

icon author Catchoom Team

icon folder , ,

A bounding box is an optional parameter that can be returned with every recognized item to indicate the position of the matched reference image inside the query image. More specifically, a bounding box represents the four corners of the matched reference image projected into the query image.

The order of the corners is: top-left, top-right, bottom-left, bottom-right. Each coordinate is represented by two values, horizontal and vertical positions, normalized with respect to the query image size. For example, coordinates [0.0, 0.0] indicate a position at the top-left corner within the query, coordinates [0.5, 0.5] indicate its center, and coordinates [1.0,1.0] fall exactly at the bottom-right corner of the query.

If a reference image does not fit entirely inside the query, some of its coordinates can exceed the range [0.0, 1.0], but they will never exceed the range [-1.27, 1.27].

The example below shows a match with its bounding box [0.56, 0.31], [0.73, 0.16], [0.87, 0.51], [1.04, 0.36].

Related Posts in Developer Guide