'Comparing Two 3D Models of the Same Object to Determine Relative Transform

I am working on a project where I want to compare a 3D reconstructed model of an object with a pre-defined 3D model of that same object to figure out if their orientations differ, and if so, how. I want to know how much to transform to get from one orientation to the other. An example of this can be seen here (example picture) where the data obtained would say that the 3D reconstructed model would need to rotate 45 degrees counter-clockwise in the XZ-plane or something to that effect.

It sounds relatively simple in theory but I know that comparing 3D models will be much more complicated than comparing 2D images. I am wondering if anyone has some resources or anything that would be able to help guide me in the right direction.

Thanks in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source