Reader small image

You're reading from  Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Product typeBook
Published inFeb 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781789531619
Edition3rd Edition
Languages
Tools
Right arrow
Authors (2):
Joseph Howse
Joseph Howse
author image
Joseph Howse

Joseph Howse lives in a Canadian fishing village, where he chats with his cats, crafts his books, and nurtures an orchard of hardy fruit trees. He is President of Nummist Media Corporation, which exists to support his books and to provide mentoring and consulting services, with a specialty in computer vision. On average, in 2015-2022, Joseph has written 1.4 new books or new editions per year for Packt. He also writes fiction, including an upcoming novel about the lives of a group of young people in the last days of the Soviet Union.
Read more about Joseph Howse

Joe Minichino
Joe Minichino
author image
Joe Minichino

Joe Minichino is an R&D labs engineer at Teamwork. He is a passionate programmer who is immensely curious about programming languages and technologies and constantly experimenting with them. Born and raised in Varese, Lombardy, Italy, and coming from a humanistic background in philosophy (at Milan's Università Statale), Joe has lived in Cork, Ireland, since 2004. There, he became a computer science graduate at the Cork Institute of Technology.
Read more about Joe Minichino

View More author details
Right arrow

Implementing the demo application

We are going to implement our demo in a single script, ImageTrackingDemo.py, which will contain the following components:

  1. Import statements
  2. A helper function for a custom grayscale conversion
  3. Helper functions to convert keypoints from 2D to 3D space
  4. An application class, ImageTrackingDemo, which will encapsulate a model of the camera and lens, a model of the reference image, a Kalman filter, 6DOF tracking results, and an application loop that will track the image and draw a simple AR visualization
  5. A main function to launch the application

The script will depend on one other file, reference_image.png, which will represent the image that we want to track.

Without further ado, let's dive into the script's implementation.

Importing modules

...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning OpenCV 4 Computer Vision with Python 3 - Third Edition
Published in: Feb 2020Publisher: PacktISBN-13: 9781789531619

Authors (2)

author image
Joseph Howse

Joseph Howse lives in a Canadian fishing village, where he chats with his cats, crafts his books, and nurtures an orchard of hardy fruit trees. He is President of Nummist Media Corporation, which exists to support his books and to provide mentoring and consulting services, with a specialty in computer vision. On average, in 2015-2022, Joseph has written 1.4 new books or new editions per year for Packt. He also writes fiction, including an upcoming novel about the lives of a group of young people in the last days of the Soviet Union.
Read more about Joseph Howse

author image
Joe Minichino

Joe Minichino is an R&D labs engineer at Teamwork. He is a passionate programmer who is immensely curious about programming languages and technologies and constantly experimenting with them. Born and raised in Varese, Lombardy, Italy, and coming from a humanistic background in philosophy (at Milan's Università Statale), Joe has lived in Cork, Ireland, since 2004. There, he became a computer science graduate at the Cork Institute of Technology.
Read more about Joe Minichino