Closed Bohrhh closed 3 years ago
Hi, the naming warped_coord_cells
is a bit unfortunate. If you follow the operations, the cell_distances
is computed on the warped image. So coord_cells
actually refers to the unchanged coordinates in the warped image, and warped_coord_cells
corresponds to the coordinates of the original image that have been warped by the homography.
On the contrary, descriptors
corresponds to the original image, and warped_descriptors
corresponds to the warped image. So the correct association is coord_cells
<->warped_descriptors
and warped_coord_cells
<->descriptors
, as is currently used in the code.
I hope this is a bit clearer now. I agree that this part of the code is a bit confusing to parse.
got it, thank you very much for your explanation!
I'm confused by cell_distances and dot_product_desc. cell_distances = tf.norm(coord_cells - warped_coord_cells, axis=-1) where coord_cells with shape (1,1,1,Hc,Wc,2) and warped_coord_cells with shape (batch_size, Hc, Wc, 1, 1, 2)
However, dot_product_desc = tf.reduce_sum(descriptors * warped_descriptors, -1) where descriptors with shape (batch_size, Hc, Wc, 1, 1, -1) and warped_descriptors with shape (batch_size, 1, 1, Hc, Wc, -1)
They are inconsistent for the position of Hc and Wc. The shape of coord_cells should be (1,Hc,Wc,1,1,2) and the shape of warped_coord_cells should be (batch_size, 1, 1, Hc, Wc, 2). Am I right?