upsp.intensity_mapping.node_pixel_mapping
¶
- node_to_pixel_mapping_keyframe(rmat, tvec, cameraMatrix, distCoeffs, vis_checker, nodes, normals)[source]¶
Returns data on the projected visible nodes for a keyframe
Returns a numpy array of the pixel positions of the projected locations of the visible nodes. Additionally returns the gradient of the pixel position with respect to the rotation vector and translation vector. Non-visible nodes are given a pixel position and gradient value of NAN. Additionally returns a sorted numpy array of the indices of the nodes that are visible.
- Parameters
rmat (
numpy.ndarray
,shape (3
,3)
,float
) – The rotation matrix from the camera to the modeltvec (
numpy.ndarray
,shape (3
,1)
,float
) – The translation vector from the camera to the modelcameraMatrix (
numpy.ndarray
,shape (3
,3)
,float
) – The (openCV formatted) camera matrix for the cameradistCoeffs (
numpy.ndarray
,shape (5
,1)
or(5,)
,float
) – The (openCV formatted) distortion coefficients for the cameravis_checker (
VisibilityChecker
) –VisibilityChecker
object with the relevant BVH and oblique viewing anglenodes (
numpy.ndarray
,shape (N
,3)
,float
) – A numpy array of the X, Y, and Z values of the nodes.nodes[n]
is associated withnormals[n]
normals (
numpy.ndarray
,shape (N
,3)
,float
) – A numpy array of the i, j, and k values of the node normals.normals[n]
is associated withnodes[n]
- Returns
projections (
numpy.ndarray
,shape (N
,2)
,float
) – Pixel locations of the projected nodes. Non-visibles nodes will be NAN.projections[i]
is associated withnodes[i]
andjacobian[i]
jacobians (
numpy.ndarray
,shape (N
,2
,6)
,float
) – Jacobian of pixel locations of the projected nodes. Non-visibles nodes will be NAN. Jacobian axis 2 refers to (rvec | tvec).jacobian[i]
is associated withnodes[i]
andprojections[i]
visible_indices (
numpy.ndarray
,shape (V,)
,int
) – Sorted numpy array of the indices of the visibles nodes
See also
node_to_pixel_mapping_non_keyframe
use outputs to quickly map non-keyframes
- node_to_pixel_mapping_non_keyframe(rmat_key, tvec_key, rmat_curr, tvec_curr, projs, jacs, vis_idxs)[source]¶
Returns data on the projected visible nodes for a non-keyframe
Returns a numpy array of the pixel positions of the projected locations of the visible nodes. Non-visible nodes are given a pixel position of NAN. Assumes set of nodes visible in keyframe is same for nearby non-keyframes. Uses the Jacobian to quickly approximate the projected location
- Parameters
rmat_key (
numpy.ndarray
,shape (3
,3)
,float
) – The rotation matrix from the camera to the model of the keyframetvec_key (
numpy.ndarray
,shape (3
,1)
,float
) – The translation vector from the camera to the model of the keyframermat_curr (
numpy.ndarray
,shape (3
,3)
,float
) – The rotation matrix from the camera to the model of the current non-keyframetvec_curr (
numpy.ndarray
,shape (3
,1)
or(3,)
,float
) – The translation vector from the camera to the model of the current non-keyframeprojs (
numpy.ndarray
,shape (N
,2)
,float
) – Projected locations of the nodes in the keyframejacs (
numpy.ndarray
,shape (N
,2
,6)
, float) – Jacobians of the projected locationsvis_idxs (
numpy.ndarray
,shape (V,)
,float
) – Indices of the visible nodes.
- Returns
updated_projections – Approximate pixel locations of the projected nodes. Non-visibles nodes will be NAN.
updated_projections[i]
is associated withprojs[i]
- Return type
numpy.ndarray
,shape (N
,2)
,float
See also
node_to_pixel_mapping_keyframe
create keyframe inputs
- node_to_pixel_mapping_non_keyframe_full(rmat, tvec, cameraMatrix, distCoeffs, nodes, vis_idxs)[source]¶
Returns data on the projected visible nodes for a non-keyframe
Returns a numpy array of the pixel positions of the projected locations of the visible nodes. Non-visible nodes are given a pixel position of NAN. Assumes set of nodes visible in keyframe is same for nearby non-keyframes. Fully computes the projection
- Parameters
rmat (
numpy.ndarray
,shape (3
,3)
,float
) – The rotation matrix from the camera to the model of the current non-keyframetvec (
numpy.ndarray
,shape (3
,1)
,float
) – The translation vector from the camera to the model of the current non-keyframecameraMatrix (
numpy.ndarray
,shape (3
,3)
,float
) – The (openCV formatted) camera matrix for the cameradistCoeffs (
numpy.ndarray
,shape (5
,1)
or(5,)
,float
) – The (openCV formatted) distortion coefficients for the cameranodes (
numpy.ndarray
,shape (N
,3)
,float
) – A numpy array of the X, Y, and Z values of the nodes.nodes[n]
is associated withnormals[n]
vis_idxs (
numpy.ndarray
,shape (V,)
,float
) – Indices of the visible nodes
- Returns
updated_projections – Pixel locations of the projected nodes. Non-visibles nodes will be NAN.
updated_projections[i]
is associated withnodes[i]
- Return type
numpy.ndarray
,shape (N
,2)
,float
See also
node_to_pixel_mapping_keyframe
create vis_idxs based on a keyframe