ethz-asl / panoptic_mapping

A flexible submap-based framework towards spatio-temporally consistent volumetric mapping and scene understanding.
BSD 3-Clause "New" or "Revised" License
275 stars 31 forks source link

Question on calculation in Trackinginfo::insertRenderdPoint #57

Closed Kin-Zhang closed 1 year ago

Kin-Zhang commented 1 year ago

Codes here: https://github.com/ethz-asl/panoptic_mapping/blob/354597b7e4b5f5cfef4e57c467a0e4ec4230f9c3/panoptic_mapping/src/tracking/tracking_info.cpp#L36-L37

Question: It's a little bit weird for the width calculation. we assume that u<size_x, and the width will be 3*size_x+1, but the truth we want should be 2*size_x+1 according to the u.

const int u_min = std::max(0, u - size_x);
const int width = u_min + 2 * size_x + 1;

Is there any other I missed for understanding?

Schmluk commented 1 year ago

Hi @Kin-Zhang Thanks for pointing this out. The idea is that u is the row coordinate in the image in [0, image_width], whereas size_x is half of the diameter of the area that is filled in by one vertex.

Therefore the width should be width = 2 * size_x + 1, the second term + (u - u_min) is to compensate for the case that the vertex overlaps with the left end of the image (right end is handled during aggregation). This term u-u_min is size_x if u - size_x > 0, i.e. when no shortening of the width is required, otherwise the width will be cropped. Therefore, the equation should be width = u - u_min + size_x + 1.

This should be fixed with of #58.