The k-NN algorithm all by itself is very simple, and can be used on vectors of any dimensionality to classify them. Let me write it down here for the sake of answer completeness:
- store all your vectors from the training set
- store the class of each vector together with them
- when a new, unclassified, vector arrives, compare it to all the vectors from the training set
- select the $k$ neighbours that have the smallest distance to the new neighbour
- the class assigned to the new vector is the most common class among those $k$ closest vectors
Now, that said, the value of $k$ you choose depends greatly on the size of your training set. E.g. if you have a training set of size $100$, and set $k=100$, the result will always be the same, equal to the most frequent class in your training set. If you set $k=1$, the new vector will be classified as the geometrically closest vector (Euclidean distance) every time.
If you're just supposed to present the results for different $k$ for the sake of discussion and learning, I suggest you start from $k=1$ and test for all the $k$'s sequentially: it will make a nice graph and a nice analysis. Maybe you can skip the even values of $k$ (for $k=2$, if you get two different classes as the closest, you're unable to make a decision).
What's really important is how are you going to shape your descriptor vectors. Each component in your descriptor vector is a feature you describe numerically which should be able to help you make a decision. You also have the curse of dimensionality to worry about: more components your vector has, slower the decision making process is.
You have two approaches here:
- Decide carefully on features that are confirmed to be good at the task (do some research), and limit yourself to a certain number.
- Work with features you think would be good, but don't worry too much about how good they are. Then, when you have a big number of features, use a method like Principal Component Analysis (PCA) or Fisher's linear discriminant (FLD) to reduce the dimensionality of your descriptor vectors before the k-NN
Lastly, let me give you some ideas about features you might want to use to form your feature vectors. I'm not guaranteeing for any of them, I'm just writing ideas off the top of my head:
Down-sample (shrink) your sample images to $3 \times 3$ or $3 \times 4$ pixel black and white images, and take the 0/1 values of all the 9 or 12 pixels as features. You might want to do a morphological thining or get the skeleton of the pen stroke before you shrink your images.
Instead of taking each pixel from a down-sampled image, you could take only the count of background/foreground pixels in each row and column in the downsampled image, making for a total of 6 or 7 non-binary features as opposed to 9 or 12 binary ones.
Count the number of holes in your (binarized) image. By "hole", I mean a connected component of background pixels not connected to the image border.
Take a simple measure such as describing the elongation of the object, e.g. the horizontal distance between two horizontally furthest pixels divided by the vertical distance between two vertically furthest pixels.
Use the Hu set of invariant image moments (wikipedia, article) It's very old work, but I've used them while making a letter-recognition project during my studies, and for simple uses such as this they can still be helpfull.