October 2018
Intermediate to advanced
472 pages
10h 57m
English
This Python file contains two functions, namely plot_limb() and plot_joints(), as shown:
"""This module contains functions to plot the joints and the limbs."""import cv2 as cvimport numpy as npdef plot_limb(img, joints, i, j, color): """Limb plot function.""" cv.line(img, joints[i], joints[j], (255, 255, 255), thickness=2, lineType=16) cv.line(img, joints[i], joints[j], color, thickness=1, lineType=16) return imgdef plot_joints(img, joints, groundtruth=True, text_scale=0.5): """Joint and Limb plot function.""" h, w, c = img.shape if groundtruth: # left hand to left elbow img = plot_limb(img, joints, 0, 1, (0, 255, 0)) # left elbow to left shoulder img = plot_limb(img, joints, 1, 2, (0, 255, 0)) # left shoulder to right ...
Read now
Unlock full access