Abstract-In this paper an image processing algorithm for automatic evaluation of scanned examination sheets is described. The discussed image contains selected function graphs sketched on a prepared sheets. This type of task is characteristic of final high school exams of natural sciences. Our challenge was to develop an evaluation algorithm, which works with a precision comparable to the teacher. If the image contains the correct solution, the algorithm should husk it from a set of random lines, deletions, amendments, drafts, bearing in mind, that lines were drawn by hand. In addition, the algorithm should calculate scores for partially correct solutions. An essential part of our proposal, which is image segmentation and identification, is based on leastsquares fitting combined with 1-NN classification. The proposed solution is flexible and can be extended to other types of tasks such as drawing geometrical figures.