Parsing / Scraping information from an image - image-processing

I am looking for a library that would help scrape the information from the image below.
I need the current value so it would have to recognise the values on the left and then estimate the value of the bottom line.
Any ideas if there is a library out there that could do something like this? Language isn't really important but I guess Python would be preferable.
Thanks

I don't know of any "out of the box" solution for this and I doubt one exists. If all you have is the image, then you'll need to do some image processing. A simple binarization method (like Otsu binarization) would make it easier to process:
The binarization makes it easier because now the pixels are either "on" or "off."
The locations for the lines can be found by searching for some number of pixels that are all on horizontally (5 on in a row while iterating on the x axis?).
Then a possible solution would be to pass the image to an OCR engine to get the numbers (tesseractOCR is an open source OCR engine hosted at Google (C++): tesseractOCR). You'd still have to find out where the numbers are in the image by iterating through it.
Then, you'd have to find where the lines are relative to the keys on the left and do a little math and you can get your answer.
OpenCV is a beefy computer vision library that has things like the binarization. It is also a C++ library.
Hope that helps.

Related

OCR: scan specific part of image

I'm quite new in computer vision, currently learning about google cloud vision SDK using Go. And right now I have one problem.
So I have an image scanned using the DetectTexts() method. The result was great! all of the texts are scanned.
However, I don't actually need all of those texts. I only need some of it. Below is the image I use as a sample. What I want to get is the two blocks highlighted in red.
Images
Result
WE-2
Sam WHO
Time
PM 1:57
SYS
mmHg
mmHg
DIA
mmHg
90
62
82
mmHg
PUL
/MIN
MR AVGA
SET
START
STOP
MEM
I do not know what is the best approach to do it. What's in my mind right now is these approaches:
split the images that are highlighted in red, then perform OCR scan on those new images
or, get all of the texts, and then use some algorithm (NLP maybe?) to get the highlighted texts.
Can somebody please help what is the correct and best approach to solves this problem?
You mentioned that you were using Go, which unfortunately I dont have any experience with, but I have approached this problem in other languages like Python and C#. What I would recommend is just create an ROI, or Region of Interest. Basically what that means is you would be cropping the image to only the highlighted region that you want to detect text from. Like I said, I'm not entirely sure if you can do that in Go, so you might have to do some raw pixel manipulation rather than just using a member function. I assumed that the position of the regions that you wanted to detect text from would remain the same. If your open to it, you could just create a simple python script that generates a ROI, and pipes the cropped image to GO.
import cv2
img = cv2.imread('inputImg.png')
output = img[c1:c1+25,r1:r1+25]
#You could do something like this
cv2.imwrite("path/to/output/outputimg.png", output)

image processing close edge matlab

I have the following image
What I need to do is connect the edges in MATLAB that are obviously of the same object in order to use regionprops later. By 'obviously' I mean the edges of the inside object and those of the outside one. What I thought is that I somehow must keep the pixels of each edge in a struct and then for each edge find the one that is closer to it and then apply some fitting(polynomial, bspline etc). The problem is that I have to make it for thousands of such images so I need a robust algorithm and I cannot do it by hand for all of them. Is there a way for somebody to help me? The image of which the previous image is obtained is this one. Ideally I have to catch the two interfaces shown there.
Thank you very much in advance

Computer Vision - Use Image Matching or OCR to recognize page of a text only book?

I want to be able to recognize what page of a text only (no images) book I'm on... what is the best approach:
I was initially thinking some sort of image matching but the pages of an all text book look so similar not sure how well this would work?
Second thought was to use OCR??
Any ideas or suggestions... thanks!
I think image matching is really useless in your case...
If you want to detect on which page you are and that the book has numbered pages you can use an OCR like Tesseract.
1) Locate the page number (top left hand corner, right, bottom..)
2) Extract it (extract the imaget to proceed to decoding on it)
( 2bis) Preprocess the imaget... )
3) Decode it (use Tesseract or another OCR)
If you don't want to use an OCR you can look at Hu Moments, if the numbers are standard printed numbers it can be quite good at recognising them.

Semi-Automatic Text Highlighting in Images?

Greetings Overflowers,
Given that:
I have images of documents with text of mixed languages
I need this text to be highlightable (word by word) by end users
I have this text in plain digital format already
I will help my program to figure out where words are
I do not want my help to be tedious to me
I will also manually fix small inaccuracies after my program
What is the best easy help I can provide for my program to be able to draw rectangles around selected words ? What algorithm would you use for this program ? I tried OCR stuff like OmniPage Pro but they do not provide this functionality.
Regards
I have implemented a word bounding box and highlighted words in my application some years ago. You said "I have this text in plain digital format". One key component is to have coordinates of characters or words in order to map them to proper image areas. Like in searchable PDF, when you select text it is internally mapped to the image layer, and opposite selection on the image selects matching text. But even from PDF those coordinates cannot be exported I believe. If no such coordinate informaiton exists currently in your text, easiest is probably to re-OCR images with a high quality engine that can produce coordinates as part of output. If you were to use WiseTREND OCR Cloud 2.0, then XML output will produce all that detailed metadata. If coordinates informaiton exists, then all major components are there and it is just work around efficient UI design.

Character extraction methods overview

I am searching for a good character extraction method,
or sometimes it is called stroke-model or stroke filter.
So, I;ve seen many papers, but they all take a long time for understanding and implementation,
I want to ask if someone knows some good source codes or demos?
Also I want to get some kind of full overview of methods available on these theme : character extraction from images, (grayscale).
The main problem is to get a regions of image that include only characters and then some binarization can be made. After that the feature extraction is done (actually OCR works then).
Maybe GNU Ocrad can be interesting? I haven't looked at the source though.
An area with characters is recognized by a large number of sharp edges. There will be some preferential directions, but this is not as strong as you'd see with box shapes.
You seem to assume that it is possible to get "regions of image that include only characters". This is too optimistic. Just look at this very page. There are symbols mixed in with text. And above this editing box, the first four toolbuttons are B, I, a globe and ". Five, if you count the thin divider bar | after the I

Resources