Clopema libs (package)

The clopema_libs package is a collection of C++ and Python functions and libraries. Both implementations should provide same functionality. The functionality should be tested. The source code is divide in two directories src_cpp and src_python for C++ and Python respectively.

The python implementation is tested using doctest.

- topic_utils Tools to work with topics.

Geometry

Plane line intersection

Rotation axis and angle

Rotation axis and angle to matrix

Normal from three points

Quaternion from rotation matrix

Camera

Projection matrix decomposition

>>> K = np.matrix([[1,0,50],[0,2,50],[0,0,1]])                                                                                                                               
>>> R = np.matrix([[-1,0,0],[0,1,0],[0,0,-1]])                                                                                                                               
>>> t = np.matrix([10,-10,0])                                                                                                                                                
>>> P = K*np.hstack((R,t.T))                                                                                                                                                 
>>> K_,R_,t_ = P2KRt(P)                                                                                                                                                      
>>> np.all(K_ == K)                                                                                                                                                          
True                                                                                                                                                                         
>>> np.all(R_ == R)                                                                                                                                                          
True                                                                                                                                                                         
>>> np.all(t_ == t)                                                                                                                                                               
True