Principal component analysis (PCA) aims to determine the importance of dimensions in data and build up a new basis. In this new basis, directions are selected to have the most independence from others. Because of maximal independence, we can understand which data dimensions carry more information and which carry less. PCA is used in many applications, primarily in data analysis and data compression, but also it can be used in computer vision; for example, to determine and track the orientation of an object. This recipe will show you how to do it in OpenCV.
Principal component analysis
Getting ready
Before you proceed with this recipe, you need to install the OpenCV 3.0 (or greater) Python API package.