Fix n_cams_off > min_cams_for_triangulation in personAssociation#203
Fix n_cams_off > min_cams_for_triangulation in personAssociation#203davidpagnon merged 2 commits intoperfanalytics:mainfrom
Conversation
|
Hi Léa, Thanks for your well-documented pull request! It makes sense but it is a bit technical, so before merging it, I'll have to dive into it and test it--and as you point out, I'll have to figure out why you can have a result while all cameras are disabled. Also, out of interest, how do you have so many excluded cameras? Is the participant hiding so as not to be seen by any of them? |
|
Hi David, Thanks for your quick answer. I'm currently using a public dataset of figure skating. The participant moves a lot and is not always seen by all cameras. Plus, I have a doubt about the calibration file. All that could explain why the triangulation can't succeed with >2 cameras. |
|
That would be my guess, I would expect, one, maybe two cameras to be excluded, but not more. |
|
Hi Léa, I think you did your pull request on an older Pose2Sim version, do you think you could update it? Also, be aware that the single-person mode might disappear in the future, as it is pretty slow. Instead, I'll add a parameter to let people choose how many people they want to triangulate (1, 2, more, or all), and how to sort them (on click, largest affinity, largest displacement, etc). Sorry for the late reply, and I wish you a happy new year's eve! |
|
Hi David, Sorry for the old version that sneaked in. It should now be updated with the latest Pose2Sim commit. I understand that the part I modified won't be useful without the single-person mode. I'll be very interested in the largest displacement sorting! Also, FYI, I figured out that I had so many excluded cameras because of a calibration mismatch. |
|
Okay, good to know! |
In the last version of the code, the algorithm to find the best persons and cameras combination during the person association stage allows to turn off too many cameras.
This is due to the fact that cameras are turned off at three places :
persons_combinations(), if nobody's detected is one view, the camera is turned offbest_persons_and_cameras_combination(), the main function we're looking at, many combinations are created randomly turning off n_cams_off cameras at each iteration while n_cams - nb_cams_off >= min_cameras_for_triangulationtriangulate_comb(), if the confidence score is below the threshold, supplementary cameras can be turned off.The only constraint ensuring that there are enough active cameras is in (2), but it doesn't take into account the cameras that were off at step (1) nor the ones that are turned off at step (3). This result in triangulation with 2, 1 or even 0 cameras and thus incoherent results.
For example, with a 12-cameras setup is get this output for Pose2Sim.personAssociation(), when min_cameras_for_triangulation = 3 :
I still don't understand how it is possible to get a triangulation error with all cameras off (nan)...
No error is raised until I run Pose2Sim.trinagulation() and get :
With my fix, the personAssociation fails directly as expected, meaning that the mean reprojection error is way above the threshold.