-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dealing with nan in ..._filt_<filter>.trc causing condition 'convertOk' not met during kinematics #143
Comments
Issue: #114: fill_large_gaps_with = 'last_value' # 'last_value', 'nan', or 'zeros' |
Hi, You need at least 2 cameras to triangulate the coordinates. When there is a hole for a few frames you can interpolate it, but if a point is not seen for the whole sequence, it is not going to work. Here are a few ideas, by order of hackiness:
Please tell me how it goes! |
Hi, <IKMarkerTask name="RSmallToe">
<!--Whether or not this task will be used during inverse kinematics solve, default is true.-->
<!-- <apply>true</apply> -->
<apply>false</apply>
<!--Weight given to the task when solving inverse kinematics problems, default is 0.-->
<weight>1</weight>
</IKMarkerTask> in With In Opensim there are some issues with it as maybe the number of Cameras may not be enough or the alignment of the two used Cameras is not properly. The person is not really standing nor doing what it did in the Video. In OpenCap there were no problems with two cameras. |
There are definitely issues in your triangulated trc files. How did you calibrate? |
Hi, You did not specify which issues there are in the trc files. |
Check this thread starting from the linked comment maybe. It seems like if you download synchronized videos from OpenCap, they are exported at half the resolution, which leads to a faulty calibration EDIT: Sorry I had not seen your last message, let me read it |
The issues are that the trc files look don't look like a human being doing anything 😅 Synchronization is likely to be another issue indeed. Check the appropriate doc section to make sure it is correct: https://github.com/perfanalytics/pose2sim/blob/main/README.md#synchronization
|
I think in calibration.py you should check the resolution of all the videos and their frames per second. Got new camera. I'll try my final setting tomorrow. Synchronization: |
Calibration does check the resolution of videos, I just tried to make a guess based on the information your provided but I went in the wrong direction. To be clearer, if you capture with OpenCap and convert its calibration files, and the export the wrong videos, you will have a discrepancy between the resolutions of the calibration file and the videos. But that's not what you did. The framerate is also detected automatically, see Config.toml: Synchronization should be deterministic if you run on the same videos with the same parameters. If the right wrist clearly raises only at one time, it should not give you such different results, unless there is a problem in the parameters of your Config.toml file. If you want to send some of your data to [email protected], I can look at it and search for the bug. |
What does Pose2Sim.personAssociation() do? \personAssociation.py:588: RuntimeWarning: Mean of empty slice mean_error_px = np.around(np.nanmean(error), decimals=1) --> Mean reprojection error for Neck point on all frames is nan px, which roughly corresponds to nan mm. --> In average, 0.01 cameras had to be excluded to reach the demanded 20 px error threshold after excluding points with likelihood below 0.3. Tracked json files are stored in ... Associating persons took 00h00m02s. Then when running triangulation I get: ... raise Exception('No persons have been triangulated. Please check your calibration and your synchronization, or the triangulation parameters in Config.toml.') Exception: No persons have been triangulated. Please check your calibration and your synchronization, or the triangulation parameters in Config.toml. |
personAssociation sorts out people to ensure that you triangulate the same person across cameras rather than trying to triangulate two different persons together (in single-person mode, it removes people in the background). If you only have one person in the scene, you do not need to run it. This error still means that either your calibration or your synchronization is not good. Did you try trimming the video by hand to make sure the problem was not about synchronization? |
Before I had one Webcam vertical and one Smartphone horizontal because of DroidCam-Setting. Now: It seems that also personAssociation (and perhaps triangulation) need some minimal video length to work properly (in addition to synchronization). Perhaps you should display a warning or even an error. Switched temporarily to lightweight for my local computer. What means 0.03 excluded cameras? 3% of something? |
Hi again, |
I am getting the same error as you when trying to process the demo videos on the OpenCap page. I have downloaded the raw videos (.mov) and it does all the steps correctly, but when I try to calculate the inverse kinematics, it returns this error:
The only video from which I have been able to calculate the inverse kinematics is the one for the activity '1legjumpdroplanding' . All the others have given me the same error. |
Hi, in my video cam01.mp4 with the script below I can see that if I use 9 times each 30th frame I get different rvecs values than if I do it only one, two or three times. If you use cv2.drawChessboardCorners(img, CHECKERBOARD, corners2, ret) usually the chessboard is red to ... in colors. At some point you can see that the Chessboard is ... to red, so 180 degress rotated or something like that. Perhaps this helps finding the problem. Btw.: Could not execute "caliscope" after pip installing it. How large must the Charuco board be for Freemocap? |
Hi all, sorry my job is keeping me quite busy, but I'll try to answer by the end of the week! |
Hi Jens and Mario, @medpar, It seems like there is something shady with OpenCap data that I can't figure out there. Would you mind sending me your full project folders, including the calibration files and/or videos?). I suppose there must be some Nan in the TRC file, which would be caused by a bad triangulation. Are results for "1legjumpdroplanding" good? @jtoerber I just tried the data you are sent me.
|
Hi, there is a misunderstanding. I do not use Opencap. Hence Calibration is done by Pose2Sim. And: Would you please so kind and remove the Image in your last Post. Thanks in advance. |
Sure, sorry for the image! Okay, I may have misunderstood concerning OpenCap then. In this case, you just need to flip Y and Z coordinates and make Z=-Z in your configuration file and you should have the person upright! So by order of impact, you should:
|
Hi,
I have 2 Cameras. One of the camera could see my right small toe all of the time, the other not.
So after FIltering I have nan in the trc-File for the corresponding Landmark/Keypoint.
When I do Inverse Kinematics to get the angles, I get an error message:
Lowering the thresholds did not work.
I am not able to work with more than two Cameras as they need high FPS (>=100) in my case.
In this specific case I am able to adjust the positions of the cameras.
But, in another case I want to track arm and fingers and it will happen that there are gaps, which are even larger than (large) interp_if_gap_smaller_than-Parameter, especially for landmarks/keypoints, which are in a specific case not interesting.
How am I able to get InverseKinematics running?
I could replace nan with 0.0?
I could (at least try to) remove the non interesting landmark(s)?
Any recommendations?
Interestingly the filtering has a problem with that not the triangulation, which may decide to take the Landmark/Keypoint from the Camera, that is able to see it.
The text was updated successfully, but these errors were encountered: