OpenCap pipeline locally

New project for OpenCap, which is a new software package to estimate 3D human movement dynamics from smartphone videos. OpenCap strongly relies on OpenSim.
User avatar
Scott Uhlrich
Posts: 125
Joined: Tue Jan 20, 2015 4:29 pm

Re: OpenCap pipeline locally

Post by Scott Uhlrich » Tue Dec 03, 2024 1:38 pm

This is most likely an issue with camera calibration parameters (intrinsics or extrinsics). Make sure the camera model you are using (i.e., the intrinsic/extrinsic parameters in the mathematical camera model) matches what is used in the code base. The distortion parameters are a likely culprit here.

User avatar
Carlos Gonçalves
Posts: 139
Joined: Wed Jun 08, 2016 4:56 am

Re: OpenCap pipeline locally

Post by Carlos Gonçalves » Wed Dec 04, 2024 11:38 am

Thanks a lot Scott,

As I mentioned, I collected gait data with OpenCap online, downloaded the files, and tried running everything locally. I'm using the already used (online) calibration file "cameraIntrinsicsExtrinsics.pickle".

So, do you have any guess where to change the camera model in the available code?

I'm doing my tests making changes to the main.py file in opencap-core directory.

Best regards.

User avatar
Carlos Gonçalves
Posts: 139
Joined: Wed Jun 08, 2016 4:56 am

Re: OpenCap pipeline locally

Post by Carlos Gonçalves » Wed Dec 04, 2024 2:29 pm

About the camera model, I'm using the same metadata file from the OpenCap session.

So it is iPhone14,7 for this data.

Is that it?

Printing CamParamDict I think is right. The inial values are the same, the last ones are different (I suppose this first ones are intrinsic values):

Code: Select all

{'Cam0': {'distortion': array([[ 1.33330036e-01, -4.24884275e-01, -4.19435795e-04,
         7.74451704e-05,  4.77849416e-01]]), 'intrinsicMat': array([[917.37931162,   0.        , 360.43991397],
       [  0.        , 917.79164758, 636.84639784],
       [  0.        ,   0.        ,   1.        ]]), 'imageSize': array([[1280.],
       [ 720.]]), 'rotation': array([[-0.8987816 , -0.03383321,  0.43708917],
       [ 0.01267564, -0.99860628, -0.05123309],
       [ 0.43821337, -0.04050698,  0.89795781]]), 'translation': array([[ 121.41596193],
       [1019.86963964],
       [2891.45558384]]), 'rotation_EulerAngles': array([[ 0.70043917],
       [-0.07341272],
       [ 3.03713135]])}, 'Cam1': {'distortion': array([[ 1.33330036e-01, -4.24884275e-01, -4.19435795e-04,
         7.74451704e-05,  4.77849416e-01]]), 'intrinsicMat': array([[917.37931162,   0.        , 360.43991397],
       [  0.        , 917.79164758, 636.84639784],
       [  0.        ,   0.        ,   1.        ]]), 'imageSize': array([[1280.],
       [ 720.]]), 'rotation': array([[-9.06270219e-01, -8.72180304e-04, -4.22697917e-01],
       [ 2.11763384e-02, -9.98835865e-01, -4.33414009e-02],
       [-4.22168038e-01, -4.82302150e-02,  9.05233668e-01]]), 'translation': array([[ 241.63476081],
       [1056.79149861],
       [2964.82450638]]), 'rotation_EulerAngles': array([[-0.67743632],
       [-0.07342459],
       [ 3.05523322]])}}

User avatar
Carlos Gonçalves
Posts: 139
Joined: Wed Jun 08, 2016 4:56 am

Re: OpenCap pipeline locally

Post by Carlos Gonçalves » Thu Dec 05, 2024 1:20 pm

Update!

I tried with another video, and it worked!

I still need to figure out why, but the intrinsic and extrinsic configurations are ok for all trials.

I hope I can get back here with the augmented TRC file.

Best regards.

POST REPLY