Ask Your Question

Revision history [back]

Though @berak answer is valid, refer to my answer if

  1. If the memory issue becomes a REAL problem and you are willing to switch over to the OpenCV Python API
  2. Stumbled on this question but are using Python instead of C++

Since images are numpy arrays in OpenCV, you can leverage scikit learn for incremental PCA which allows you to declare your desired batch size. Here's an example of how to use it.