OfxPCA
OpenFrameworks addon for PCA dimensionality reduction technique
Install / Use
/learn @atduskgreg/OfxPCAREADME
ofxPCA
An OpenFrameworks addon that implements the Principal Component Analysis dimensionality reduction technique. This technique is useful for finding the axes that explain the most variation in data. This can be used for finding the orientation of a set of points or the normal to a cluster of unoriented points.
This library uses the Eigen linear algebra library for its matrix routines.
Usage
// Make a vector of ofVec3fs that you want to do PCA on,
// for example the vertices of an ofMesh:
ofxPCAResult result = pca.analyze(mesh.getVertices());
// The ofxPCAResult object gives you the eigenvectors and
// eigenvalues sorted in descending order of the eigenvalues,
// i.e. by the most principal component to the least:
cout << "top eigenvalue: " << result.eigenvalues[0] << endl;
ofVec3f ev1 = result.eigenvectors[0]
cout << "top eigenvector: " << ev1.x << "m" << ev1.y << "," << ev1.z << endl;
Protip
If you get weird compilation errors after importing this addon, make sure that inside of ofxPCA/libs/Eigen/include/Eigen the src/ folder is not included in XCode as a compilation target. If that folder appears in your XCode project, delete it (but make sure to select Remove References rather than Move to Trash). We need those files to exist, but we don't want XCode to try to compile them.
Related Skills
node-connect
350.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
