IIT-PAVIS / Social-Distancing

Code for estimating social distances from RGB cameras.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you get the coordinates of the corresponding points between src and dst?

HenryZhangJianhe opened this issue · comments

commented

rationed_hight = im_size[1] * self.vertical_ratio
rationed_width = im_size[0] * self.horizontal_ratio
src = np.array([[0, 0], [0, im_size[1]],
[im_size[0], im_size[1]],
[im_size[0], 0]])
dst = np.array([[0+rationed_width/2, 0+rationed_hight],
[0, im_size[1]], [im_size[0],im_size[1]],
[im_size[0]-rationed_width/2, 0+rationed_hight]], np.int32)
图片
图片

I do not understand how to get dst points coordinates from your description in paper

I do not very well understand your question. you'd like to obtain the trapezoid coordinates in relation to the original rectangular image? If this is the question, I think you need to do some coding yourself to extract that from the (imaginary) trapezoid. Note that we do not actually draw a trapezoid, but we implicitly make use of it to tune the parameters.

commented

image
1 Does the ‘image plane’ mean the ground plane in the image?
2 what does the ‘with metrics' mean? what's the difference between this 'metric' and 's' ?

Hi Henry, to answer your questions: (1) yes. When taking about the homography, it is always referring to the same planar surface from different projections. In our case, the plane is the ground plane. (2) "with metrics" means this homography matrix accounts for the mapping from the pixels to metric units, e.g. meters. This metric is more related to the intrinsic matrix K. Instead "s" is just the scale factor. Its role is for scaling the metric unit at the calibration time to the one you would like to use. Hope this helps.

commented

I do not very well understand your question. you'd like to obtain the trapezoid coordinates in relation to the original rectangular image? If this is the question, I think you need to do some coding yourself to extract that from the (imaginary) trapezoid. Note that we do not actually draw a trapezoid, but we implicitly make use of it to tune the parameters.

As you can see from the figure below, the vertex coordinates A' and D' of the trapezoid defined in your code are incorrect. I think the correct coordinates should be A'=[(w-w')/2,h'] , D' = [(w+w')/2, h'].

image

Hi @HenryZhangJianhe, thanks for your very close look at the code and the paper. Probably our visualization in the paper made you think that our code is wrong, but the truth is the visualization is only in an abstract way describes how the code works. To probably make it easier for you to understand how the code works, W' cannot be described independently from the original image, hence (0,0) and (image_size[0],0). therefore, our code is the way it is.
Hope this resolves your doubt.