Skip to Content
Learning OpenCV 4 Computer Vision with Python 3 - Third Edition
book

Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

by Joseph Howse, Joe Minichino
February 2020
Intermediate to advanced
372 pages
9h 26m
English
Packt Publishing
Content preview from Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Drawing the tracking results and masking the tracked object

We will implement one helper method, _draw_object_axes, to draw a visualization of the tracked object's X, Y, and Z axes. We will also implement another helper method, _make_and_draw_object_mask, to project the object's vertices from 3D to 2D, create a mask based on the object's silhouette, and tint this masked region yellow as a visualization.

Let's start with the implementation of _draw_object_axes. We can consider it in three stages:

  1. First, we want to take a set of 3D points located along the axes, and project these points to the 2D image space. Remember that we defined the 3D axis points in our __init__ method, in the Initializing the tracker section. They will simply serve ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Computer Vision Projects with OpenCV 4 and C++

Building Computer Vision Projects with OpenCV 4 and C++

David Millan Escriva, Prateek Joshi, Vinicius G. Mendonca, Roy Shilkrot

Publisher Resources

ISBN: 9781789531619Supplemental Content