@brief: useful transformations
@author: Kyle de Nobel
@note: Comments above file are for Doxygen support and are the same as the docstrings
| def camera.utils.transformations.pixelToWorkspace |
( |
np.ndarray |
coordinates, |
|
|
np.ndarray |
depthMap, |
|
|
np.ndarray |
gWC, |
|
|
np.ndarray |
camMTX |
|
) |
| |
calculates the workspace coordinates given pixel coordinates and a depth map
- Parameters
-
| [in] | coordinates | an ndarray of the u,v coordinates of a pixel in an image |
| [in] | gWC | an ndarray (4, 4) of the transformation from camera to workspace |
| [in] | camMTX | an ndarray (3,3) of the camera's intrinsic parameters |
| [in] | depthMap | a 2D ndarray of the depth map of your image. This must be the same size as your color image |
- Returns
- out an ndarray (3,1) of the X,Y,Z coordinates in the workspace frame
calculates the workspace coordinates given pixel coordinates and a depth map
Args:
coordinates (ndarray (2,1)) : the u,v coordinates of a pixel in your image
depthMap (ndarray (N,M)) : the depth map of your N by M image
gWC (ndarray (4,4)) : an ndarray (4, 4) of the transformation from camera to workspace
camMTX (ndarray (3,3)) : an ndarray (3,3) of the camera's intrinsic parameters
Returns:
an ndarray (3,1) of the X,Y,Z coordinates in the workspace frame
| def camera.utils.transformations.workspaceToPixel |
( |
np.ndarray |
coordinates, |
|
|
|
gCW = None, |
|
|
|
camMTX = None |
|
) |
| |
calculates the pixel coordinates given the world coordinates
- Parameters
-
| [in] | coordinates | an ndarray (3,1) of the X,Y,Z coordinates of an object in the workspace frame |
| [in] | gCW | an ndarray (4, 4) of the transformation from workspace to camera |
| [in] | camMTX | an ndarray (3,3) of the camera's intrinsic parameters |
- Returns
- out an ndarray (2,1) of the pixel coordinates -> np.array([[u],[v]])
calculates the pixel coordinates given the world coordinates.
Args:
coordinates (ndarray (3,1)) : the X,Y,Z coordinates of an object in the workspace frame
gCW (ndarray (4,4)) : an ndarray (4, 4) of the transformation from workspace to camera
camMTX (ndarray (3,3)) : an ndarray (3,3) of the camera's intrinsic parameters
Returns:
an ndarray (2,1) of the pixel coordinates -> np.array([[u],[v]])