0

I want to classify an image as a specific letter/number using KNN algorithm. The problem is that the dataset is all png images and I don't know how could I apply this algorithm to this dataset. Should I convert all my dataset and my the image I want to classify as a CSV file first?

I'm trying an implemented python KNN algorithm, that reads a ".data" file, and I don't have much experience working with classification algorithms, images or datasets. I'm struggling on how to use the images I have.

Thank you.

Leonardo Burrone
  • 339
  • 2
  • 5
  • 13
  • 1
    PNG image can be directly read to your python. I think you should find tutorial on the web first about using python to read and write image, and try to follow simple tutorial about classification. Stackoverflow is site for asking a specific question – malioboro Sep 03 '17 at 14:38
  • simple google search leads me to this site https://machinelearningmastery.com/tutorial-to-implement-k-nearest-neighbors-in-python-from-scratch/ – malioboro Sep 03 '17 at 14:39
  • You basically have to do the 3 steps: 1) Read you images to some numpy array 2) extract features from an array that represents an image 3) Use your features to run your classification algorithm. Step 2) is the hardest. – Akavall Sep 03 '17 at 15:08
  • @malioboro I'm trying to use this algorithm. The problem is that I have images and not a ".data" file as my dataset. I wanted to know what's the best way to use my dataset. If I really need to convert the images to a CSV file to use with this algorithm. – Leonardo Burrone Sep 03 '17 at 16:01

0 Answers0