Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


Examples of using Principle Component Analysis in Processing with pca_transform.

Using PCA with basic numerical data

PCA with basic data

This example demonstrates the most basic application of PCA to find the main axes of variation amongst some random 2D points.

Using PCA with OpenCV to find object orientation

PCA and OpenCV to find object orientation in Processing

This example uses OpenCV to reduce an image of a pen on a white background to a binary image (each pixel 100% white or black). It then treats these pixels as points to perform PCA. The resulting principle components make up the axes of orientation of the object.

Using PCA with OpenCV for live object orienation

<iframe src="" width="500" height="313" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

PCA Object Orientation Tracking with Processing from Greg Borenstein on Vimeo.

This example improves on the one above by applying the same technique to live video to find object orientation interactively.

Using PCA with Kinect to find Head and Hand Orientation

PCA with Kinect for head orientation

PCA with Kinect for hand orientation

This example uses the SimpleOpenNI Kinect library to access the depth points and joint data from the Kinect. It finds all of the depth points within a bounding box around a given joint (in this case, the head) and then conducts PCA on those points in order to find the orientation of the joint. This gives you head or hand orientation, which is otherwise not available from the Kinect joint data.


Principal Component Analysis Toolkit for Processing



No releases published


You can’t perform that action at this time.