Skip to content

Conversation

@maxrohleder
Copy link
Owner

@maxrohleder maxrohleder commented Apr 15, 2021

adding this pull request to track progress on this feature

Maximilian Rohleder added 6 commits April 6, 2021 12:31
The parenthesis in the macro UPDATE and INTERPOLATE
are causing problems when compiling on Windows.

See arcadelab#26
for more details.

This is a second pull request, as the changes in
arcadelab#29 got lost by mistake.
A bug in Projector.project() stopped code execution when no
C-Arm class was provided upon construction of the Object.

Fixing this by moving the logging into the clause.
In order to achieve more realistic projections I suppose to allow
the construction of CameraProjections from 3x4 matrices.

To do so, the 3x4 matrix is decomposed using a RQ-decomposition
into the intrinsics (K) and extrinsics (R, t). Then, the existing
classmethod _from_rtk()_ is reused.

Resources which were useful to comprehend the decomposition:

- https://ksimek.github.io/2012/08/14/decompose
- Siemens internal decomposition software
5 sample matrices are included. They were taken from a cios spin
C-Arm device.

DONT include this in a pull-request
The CameraProjection Class now can be instantiated from both a
3x4 matrix and a intrinsic and extrinsic. The latter case shall be
done with the classmethod.

The current implementation of from_intrinsic_extrinsic is a bit
hacky, but I couldnt think of a better way. This is more pythonic than
to create an overloaded constructor with kwargs e.g.
CameraProjection.index_from_world and its inverse are projecting
from 3d to 2d space and vice verse. Thus they are not Affine
Transforms anymore, but projective transforms. Concluding, they
should not be casted to FrameTransforms but to regular Transforms.

Carm.get_camera3d_from_world should return a FrameTransform, but the
typing fails here. Fixed this with a type cast at return time.
@maxrohleder maxrohleder self-assigned this Apr 15, 2021
* Removed the FLIPX component as its not been tested.
* Added the de-homogenization to the assert in CameraProjection.
* Fixed formatting of Projection matrices xml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants