i'm trying to implement the Eigenface in android with opencv my problem is when i'm trying to show the eigenvectors returns form PCACompute in imageview it is black the size of each image is 128*128 first of all i'v read the images and store them in ArrayList , convert them to column matrix and pass it to PCACompute as shown below what should i do after that i know that i have to use PCAProject but i don't have any idea about it help me please
private void Test() {
mTemp = new Mat();
File directoryOfMatFiles = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "FacesDB"); // it points to the directory that contains mat files
File[] contentOfDirectoryOfMatFiles = directoryOfMatFiles.listFiles();
mImages = new ArrayList<>();
for (File f : contentOfDirectoryOfMatFiles) {
try {
mTemp = Imgcodecs.imread(f.getAbsolutePath(), 0);
mImages.add(mTemp);
} catch (Exception e) {
Log.e("Error","error");
}
}
tv.setText("Count:" + mImages.size());
mData = new Mat(1,128*128,CvType.CV_8UC1);
for(int i=0; i < mImages.size(); i++) {
mImages.set(i, mImages.get(i).reshape(1,1));
}
Core.vconcat(mImages, mData);
mEigenFace = new Mat();
mEigenValue = new Mat();
mAvarage = new Mat();
Core.PCACompute(mData, mAvarage, mEigenFace,mImages.size()-1);
mAvarage= mAvarage.reshape(1, 128);
bmp = bmp.createBitmap(mAvarage.cols(), mAvarage.rows(), Bitmap.Config.ARGB_8888);Utils.matToBitmap(mat, bmp);
imageView.setImageBitmap(bmp);