I am trying to code a face recognition program in Python (I am going to use the k-nn algorithm for classification).
First of all, I converted the images to grayscale, and then created a long column vector (using the Opencv imagedata function) with image pixels (128x128 = 16384 functions)
So, I have a dataset, such as the following (the last column is the class label, and I showed only the first 7 datasets instead of 16384).
176, 176, 175, 175, 177, 173, 178, 1
162, 161, 167, 162, 167, 166, 166, 2
But when I apply k-nn to this dataset, I get inconvenient results. Is it necessary to apply additional processes to this data set, and not just convert the image into a pixel representation?
Thank.
source
share