How to use Principal component Analysis(PCA) to extract feature from images
PCA is mostly used to reduce the dimensionality of the features. 

You should first use a feature detector before you can use PCA to reduce the dimensions of these features. Common feature detectors are SIFT, SURF, ORB etc. Some of them are even available in OpenCV.