Mask_rcnn: understand shift in norm_boxes and denorm_boxes

Created on 17 Apr 2018  路  1Comment  路  Source: matterport/Mask_RCNN

Most helpful comment

There are actually two transformations happening in this function:

  1. Converting pixel coordinates to normalized coordinates. This one is clear.
  2. Changing how a range is described. In pixel coordinates, we follow the Python practice of having the second value of the range be outside the range. For example, range(0, 10) means 0, 1, 2, ..., 9 but does not include 10. Similarly, x1=0, x2=10 includes the pixels 0,1, ...9 but not 10. In the normalized coordinates, though, this doesn't work and the second value of a range is included in the range. So, a range of 0-1 includes pixels 0, 0.1, 0.2, ..., and 1.0.

The comment in the function hints at it, but doesn't delve into the details.

https://github.com/matterport/Mask_RCNN/blob/2a7bcfc82294c7856ad63a07cc27a4dfd90696ab/mrcnn/utils.py#L863-L864

>All comments

There are actually two transformations happening in this function:

  1. Converting pixel coordinates to normalized coordinates. This one is clear.
  2. Changing how a range is described. In pixel coordinates, we follow the Python practice of having the second value of the range be outside the range. For example, range(0, 10) means 0, 1, 2, ..., 9 but does not include 10. Similarly, x1=0, x2=10 includes the pixels 0,1, ...9 but not 10. In the normalized coordinates, though, this doesn't work and the second value of a range is included in the range. So, a range of 0-1 includes pixels 0, 0.1, 0.2, ..., and 1.0.

The comment in the function hints at it, but doesn't delve into the details.

https://github.com/matterport/Mask_RCNN/blob/2a7bcfc82294c7856ad63a07cc27a4dfd90696ab/mrcnn/utils.py#L863-L864

Was this page helpful?
0 / 5 - 0 ratings