# Detect numbers in grid

**URL:** https://forum.opencv.org/t/detect-numbers-in-grid/10416
**Category:** Python
**Tags:** ocr, imgproc, text, programming
**Created:** [October 4, 2022, 8:12am UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416 "2022-10-04T08:12:55Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Harry\_Rudulph](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@Harry\_Rudulph](https://forum.opencv.org/u/Harry_Rudulph)
#### Post date: [October 4, 2022, 8:12am UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/1 "2022-10-04T08:12:56Z")

</div>

hello all ,

I have been recently trying to do a program using opencv (in python) which will take an image as input and return a matrix with positions and numbers identified . For example to the image shown the output must be something like **[22,“null”,“null”] ; [“null”,“null”,16] ; [“null”, 25, “null”]**.

I am not knowing how to get started ; help is much appreciated.

 ![2b4f1898-eb14-4e16-8826-1f9f9e4c43c4](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/2/26ab5c20be7c4e48d4999cca4b93f849f3b03bcf.jpeg)

the example input image ☝

---

<div class="post-metadata">

### Author: ![sturkmen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sturkmen/32/13_2.png) [@sturkmen](https://forum.opencv.org/u/sturkmen)
#### Post date: [October 4, 2022, 2:42pm UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/2 "2022-10-04T14:42:44Z")

</div>

take a look at [this sample](https://github.com/opencv/opencv/blob/4.x/samples/python/digits_video.py)

---

<div class="post-metadata">

### Author: ![Harry\_Rudulph](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@Harry\_Rudulph](https://forum.opencv.org/u/Harry_Rudulph)
#### Post date: [October 7, 2022, 8:44am UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/3 "2022-10-07T08:44:43Z")

</div>

didn’t actually help me 🙃 but thank you , atleast you tried to help me.  
Like i just want to detect them using image processing only , or maybe something like ocr, tesseract , But I can’t include M.L into it

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [October 7, 2022, 8:52am UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/4 "2022-10-07T08:52:35Z")

</div>

> [@Harry\_Rudulph](#):
>
> I can’t include M.L into it

why can’t you do that?

---

<div class="post-metadata">

### Author: ![Harry\_Rudulph](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@Harry\_Rudulph](https://forum.opencv.org/u/Harry_Rudulph)
#### Post date: [October 7, 2022, 8:57am UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/5 "2022-10-07T08:57:57Z")

</div>

like , I actually need to implement this in Elixir ( a functional programming language) using a library called [evision](https://github.com/cocoa-xu/evision)  
That is basically an opencv binding. And I need to use image processing (or) somehting like tesseract-ocr-elixir .  
As all these are bindings of opencv , I thought maybe if I can implement this in openCV in python ; then i can translate the code to Elixir.

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [October 7, 2022, 11:15am UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/6 "2022-10-07T11:15:59Z")

</div>

ok, sure, but why can’t you include ML?

the example you rejected is OpenCV

---

<div class="post-metadata">

### Author: ![anurag629](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/anurag629/32/6502_2.png) [@anurag629](https://forum.opencv.org/u/anurag629)
#### Post date: [November 14, 2022, 11:53pm UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/7 "2022-11-14T23:53:22Z")

</div>

Hey, have you got any solution

---

<div class="post-metadata">

### Author: ![Harry\_Rudulph](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@Harry\_Rudulph](https://forum.opencv.org/u/Harry_Rudulph)
#### Post date: [November 15, 2022, 8:53pm UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/8 "2022-11-15T20:53:06Z")

</div>

yes , i got the solution ig ; like it’s working for most of the cases

---

<div class="post-metadata">

### Author: ![anurag629](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/anurag629/32/6502_2.png) [@anurag629](https://forum.opencv.org/u/anurag629)
#### Post date: [November 16, 2022, 3:36am UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/9 "2022-11-16T03:36:45Z")

</div>

Hey, can you share with me ‘akvermaav629@gmail.com’

---

<div class="post-metadata">

### Author: ![Harry\_Rudulph](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@Harry\_Rudulph](https://forum.opencv.org/u/Harry_Rudulph)
#### Post date: [November 19, 2022, 6:59pm UTC](https://forum.opencv.org/t/detect-numbers-in-grid/10416/10 "2022-11-19T18:59:44Z")

</div>

hey hii @anurag629 ,  
Well I don’t actually have it in Python ; as I have done it in Elixir. I don’t think of doing it again in Python any time soon . If at all I do it in python ; i’ll definitely let you know . Wishing you good luck .
