Raspberry Pi: Reading 7-Segment Displays
Intro: Raspberry Pi: Reading 7-Segment Displays
Reading Seven Segment Displays
Introduction Many sensors do not have a simple way to plug directly into them -- and even when there is a way to hack it, it often involves mad-surface-mount soldering skills. Simply reading a seven segment diplay allows one to share one's tools with the robot and have the "hey, can you do this for me?" kind of feel. While normal black-and-white text is easy, seven-segment displays are super hard for bots! Thankfully and thanks to the creators of ssocr, there is a way we can give our bots this essential skill.
Installation Of Seven-Segment-Optical-Character-Recognition (ssocr) First we must install the dependencies: sudo apt-get install libimlib2 libimlib2-dev Next we download the ssocr binary from the following site: http://www.unix-ag.uni-kl.de/~auerswal/ssocr/ Extract it, cd into the directory, then make the project with a simple: make ...that was simple. For good measure let's also install it into our system for use outside the folder: sudo make install
Example/Demo ssocr crop 190 73 80 100 -d 2 image.jpg -t 20 The code above resulted in 19 being placed into standard-out.
Usage You will need to make sure that the number of digits is known, and the bounding box for the digits.
Notes
Installation Of Seven-Segment-Optical-Character-Recognition (ssocr) First we must install the dependencies: sudo apt-get install libimlib2 libimlib2-dev Next we download the ssocr binary from the following site: http://www.unix-ag.uni-kl.de/~auerswal/ssocr/ Extract it, cd into the directory, then make the project with a simple: make ...that was simple. For good measure let's also install it into our system for use outside the folder: sudo make install
Example/Demo
Usage You will need to make sure that the number of digits is known, and the bounding box for the digits.
Notes
- Bounding Box
- grab x and y of top-left corner (pixels measured from top-left as per usual)
- get the width and height in pixels respectively
- Enter the number of digits after -d
- Enter the black-white threshold in % after -t
2 Comments
eastpole 4 years ago
shreevidya 5 years ago
For the image you have used in your example has actual pixel width and height of 300 pixels,i just wanted to know how exactly your determining crop area whether you are doing it manually or through code.
I tried the sample code with different image that i have attached below ,but i am getting error found too many digits ,so please let me know the solution and cause for this error