Skip to content

Commit

Permalink
change overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
rhenerose committed Apr 5, 2022
1 parent 37fcbe4 commit 8bcbfbc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,9 @@ def main(args: argparse.Namespace):
# overlay on frame
# plot_img = cv2.resize(plot_img, (320, 240))
plot_img = cv2.cvtColor(plot_img, cv2.COLOR_RGB2BGR)
frame[0 : plot_img.shape[0], 0 : plot_img.shape[1]] = np.where(
plot_img == (255, 255, 255),
frame[0 : plot_img.shape[0], 0 : plot_img.shape[1]],
plot_img,
)
alpha = 0.5
overlay_img = cv2.addWeighted(plot_img, alpha, frame[0 : plot_img.shape[0], 0 : plot_img.shape[1]], 1 - alpha, 0)
frame[0 : plot_img.shape[0], 0 : plot_img.shape[1]] = overlay_img

if cv2.waitKey(1) & 0xFF == 27:
break
Expand Down

0 comments on commit 8bcbfbc

Please sign in to comment.