I am trying to reduce vector size usig PCA in java. I am dealing with 40 objects(col), and each object has 644 feature vector(row). I want to reduce feature vector size 50% which means resultant feature vector would be (322) I use following code segment,there is a mistake.And I can not see the fail! How can I reduce using PCACommpute and PCAProject? Thanks in advance.
code: float[] a= new float[]{(....}; Mat srcMat = new Mat(644,40,CvType.CV_32FC1); srcMat.put(0,0,a); Mat Avg = new Mat(1,644,CvType.CV_32FC1); Mat EginenValue = new Mat(644,1,CvType.CV_32FC1); Mat EigenVector = new Mat(644,644,CvType.CV_32FC1); PCACompute(srcMat,Avg,EigenVector,322)