upsp.cam_cal_utils.visualization
¶
- plot_coord_sys(rmat, tvec, ax, scale=10, text=None)[source]¶
Given a pose, plots the basis of that coordinate system in the given matplotlib axis
In the plot, the x axis is blue, the y axis is orange, and the z axis is green
- Parameters
rmat (array_like,
shape (3
,3)
) – Rotation Matrix. Columns represent the basis of the coordinate systemtvec (array_like, ,
shape (3,)
) – Origin of the coordinate systemax (
mpl_toolkits.mplot3d.axes3d.Axes3D
) – matplotlib axisscale (
int
orfloat
, optional) – Size of the vcoordinate system vectorstext (
str
, optional) – Label of the coordinate system. IfNone
(default), no text is added.
- plot_pts_and_norms(pts_and_norms, ax, scale=5, c='r')[source]¶
Helper function to plot points with normals
- Parameters
pts_and_norms (
list
ofdict
) – Each dictionary has keys ‘tvec’ and ‘norm’ tvec refers to the translation vector from the origin to the point norm refers to the point’s normal vectorax (
mpl_toolkits.mplot3d.axes3d.Axes3D
) – matplotlib axisc (
str
, optional) – Color of points and normals
- show_coord_transforms(cs1_rmat, cs1_tvec, cs2_rmat, cs2_tvec, figname=None, texts=[None, None, None], compares=[False, False, False])[source]¶
Shows the transformation from coordinate system 1 (cs1) to coordinate system 2 (cs2)
Additionally, shows the origin coordinate system. Draws a line from cs1 to cs2 Texts is the label to be shown for the origin, cs1, and cs2 respectively compares is a list of booleans that determines if a line is drawn from the origin to cs1 (compares[0]), from cs1 to cs2 (compares[1]), and from cs2 to the origin (compares[2])
- show_image_locations(img, img_locations, fig_name, scale=5, c='w')[source]¶
Displays an image with the given image locations indicated with a marker of the given color (white by default)
- show_projection_matching(img, proj_pts, matching_points, num_matches=None, name='', bonus_pt=None, scale=10.0, ax=None)[source]¶
Show the projected target matching.
Projected points are labeled in red. Matching points are labeled in white. Line connecting point to match is drawn in black
- Parameters
img (array_like) – Display image
proj_pts (array_like,
shape (n
,2)
) – :rojected locations of 3D pointsmatching_points (array_like,
shape (n
,2)
) – Image location of pointname (
str
,optinoal
) – Figure name prefixbonus_pt (array_like, optional) – Optional input. Point to be shown in blue
- show_pts_and_norms(rmat, tvec, pts_and_norms, ax=None, c='r', texts=(None, None))[source]¶
Helper function to plot transformation from the origin to given coordinate system, and show a set of points. Originally intended to plot the tgts frame and the targets with their normals
- Parameters
rmat (array_like,
shape (3
,3)
) – Basis of the coordinate system to be showntvec (array_like,
shape (3,)
) – Origin of coordinate system to be shownpts_and_norms (
list
ofdict
) – Each dictionary has keys ‘tvec’ and ‘norm’ tvec refers to the translation vector from the origin to the point norm refers to the point’s normal vector. Points and normals are in the coordinate frame of the originax (
matplotlib.Axes
, optional) – matplotlib axis. If not provided, a figure and 3D axes are created.c (
str
, optional) – Color of points and normalstexts (
tuple
, optional) – Labels for the origin and transformed coordinate system.