How to do it...

Let's consider a simple object—a bench in a park. We took an image of the following bench using the camera and lens system that we calibrated in the previous recipe. We have also manually identified eight distinct image points on the bench that we will use for our camera pose estimation:

By having access to this object, it is possible to take a number of physical measurements. The bench is composed of a seat that is 242.5 cm x 53.5 cm x 9 cm and a back that is 242.5 cm x 24 cm x 9 cm, which is fixed 12 cm over the seat. Using this information, we can easily derive the 3D coordinates of the eight identified points in an object-centric ...

Get OpenCV 4 Computer Vision Application Programming Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.