Camera tracking : solving floor plane when the floor is not flat How would you go about adding a floor plane of a camera tracked shot with multiple tracks on the floor but the floor is not flat (like the unevened surface of a mountaine top or something)   therefore the tracks are all one different height from each other
If modelling a simple approximation isn't good enough and the scene and ground remains relatively static in the footage in terms of moving objects and lighting changes, I'd try photogrammetry. This allows you to create a 3D model of the scene which can edit however you like. For instance you can extract the ground and use it as shadow catcher.

For open source photogrammetry software I'd suggest MeshRoom. Another good software is COLMAP, it misses some features that MeshRoom has, e.g. texture extraction for the mesh.