I'm trying to run the PCA code downloaded from here . I have no problems running with the provided images that are in .jpg. However, when I try to run with my own images (greyscale, in .png format), I keep getting the error
Error using rgb2gray>parse_inputs (line 77)MAP must be a m x 3 array.Error in rgb2gray (line 52)[X, threeD] = parse_inputs(X);Error in CreateDatabase (line 43) img = rgb2gray(img);Error in example (line 26)T = CreateDatabase(TrainDatabasePath);
I even tried to convert the .png files to .jpg, first using imread to read the file, then imwrite to convert, but I still get the same error.
What is wrong?
Best Answer