IIT-PAVIS / Social-Distancing

Code for estimating social distances from RGB cameras.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues setting the horizontal_ratio and the vertical_ratio

bpogorelc opened this issue · comments

Hi! I am enjoying this excellently written code. Congratulations!

Using videos with different perspectives and the horizontal_ratio and vertical_ratio as default, sometimes the distance estimation does not work well. My problem is that I don't know how to properly set the horizontal_ratio and vertical_ratio.

I have found this description in the code:

parser.add_argument("--horizontal_ratio", default="0.7",
                    help="Ratio between the closest horizontal line of the scene to the furthest visible. It must be a float value in (0,1)")

parser.add_argument("--vertical_ratio", default="0.7",
                    help="Ratio between the height of the trapezoid wrt the rectangular bird’s view scene (image height). It must be a float value in (0,1)")

and read your paper (https://arxiv.org/abs/2005.04813) but still I am not sure how to set these values correctly.
Could you be so kind and explain using some of your sample videos (samples in the repo), how would you best set the horizontal_ratio and vertical_ratio for the particular video and why?

Thank you in advance

Hi, thanks for the compliment.
We are currently busy answering your question in detail, sorry for that. We are although working on publishing a note to explain better all details and intuitions behind this work, in just a few days. please stay tuned. Cheers,

Hi @mayaghaei et al. Thank you very much for your kind notice!

I will definitely stay tuned for the explanations of the horizontal_ratio and the vertical_ratio, because leaving them as default values, in some videos the result of the recognition of people and thus also the result of measuring the social distance is not very good.

And as the code description says "These two parameters need to be manually tuned to estimate best the scene perspective", I suspected it could be improved setting them correctly.

Cheers

Can you please explain your intuition behind e horizontal_ratio and vertical_ratio , its not very clear form the argument description .
**parser.add_argument("--horizontal_ratio", default="0.7",
help="Ratio between the closest horizontal line of the scene to the furthest visible. It must be a float value in (0,1)")

parser.add_argument("--vertical_ratio", default="0.7",
help="Ratio between the height of the trapezoid wrt the rectangular bird’s view scene (image height). It must be a float value in (0,1)")**

i have been waiting from a very long time in this thread . i will be highly obliged
thanks in advance and the ides is amazing

Hi guys, sorry we had to make you wait a while. I am still hoping that we can soon share with you a more detailed explanation of the intuition behind the code, but for now I try to explain it yet in a simple way:

Imagine the bird's view of a scene shown within a rectangular shape image with height H and width W. Now try to imagine how that bird's view rectangular image of the scene would change if the camera rotates in Pitch angle only (considering Yaw and Roll angles constant); according to our imagination, the rectangular scene deforms to a trapezoidal shape under the pitch rotation of the camera. This trapezoid, according to the camera pitch angle and its distance from the ground, has hight H' (which is smaller than H). On the other side, while the long width of the trapezoid is almost the size of W, the short width of the trapezoid W', is the size of the furthest visible line of the scene from the bird's view image in the perspective image.

Given this, the horizontal ratio is defined as W'/W and the vertical ratio is defined as H'/H. In the same way, by providing these two ratios, the values of W' and H' are accessible. These ratios have been used to transform the circle around each person (in the bird's view model) into the perspective scene.

I hope this explanation leaves the intuition a little more clear. I still need to mention that as soon as our paper regarding this work gets published we will refer you to it to have a more detailed analysis of everything.

Thank you for the explanation @mayaghaei

Congratulations for the paper!! Hope to have it published soon because I want to read it also.