VOOZH about

URL: https://www.geeksforgeeks.org/machine-learning/ocr-of-handwritten-digits-opencv/

⇱ OCR of Handwritten digits | OpenCV - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

OCR of Handwritten digits | OpenCV

Last Updated : 17 Jan, 2025

OCR which stands for Optical Character Recognition is a computer vision technique used to identify the different types of handwritten digits that are used in common mathematics. To perform OCR in OpenCV we will use the KNN algorithm which detects the nearest k neighbors of a particular data point and then classifies that data point based on the class type detected for n neighbors.

Data Used

👁 digits1

This data contains 5000 handwritten digits where there are 500 digits for every type of digit. Each digit is of 20x20 pixel dimensions. We will split the data such that 250 digits are for training and 250 digits are for testing for every class. Below is the implementation.

Output

91.64

You can download the source code by clicking here.

Comment