October 2018
Intermediate to advanced
472 pages
10h 57m
English
Let's also define the plotting functions that will plot the limbs on the resized image. The following defined plot_joints() function accepts the resized image and its joints and returns an image of the same shape with the limbs plotted on top:
def plot_limb(img, joints, i, j, color): """Function to plot the limbs""" 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): """Function to draw the joints""" 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 = ...
Read now
Unlock full access