OCR: Extract text from Image [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am working on the program to extract text from the image. For that I tried with Tessaract and Ocropus libraries and I am able to convert simple plain text (black and white with simple font) from image to text string. For example:
But I am not able to extract texts from complex image. Let's say for example from this image:
Does anyone know how to achieve this? Is there any library available for extract text from complex images (with unpredictable different backgrounds? I will prefer Python, but language is not a bar.

How all this word recognition work is machine learning algorithm is fed a lot of images with already interpreted corresponding text. It learns to understand letters from different fonts and appearances it is given.
However, logos are made with very specific font. Almost no two logos use similar one. That makes it very hard, if not impossible, to create a learning data to recognize what is written.
That is possible to train algorithm to recognize Sprite trademark everywhere it sees it. For that, you'd need to use OpenCV and train it on Sprite logos of different qualities, pictures of logos of Sprite on stores, bottles, etc. That way, it will be able to see this particular logo (you also will need a dataset of non-Sprite logos, like Coke logo or picture of something completely irrelevant, like cat).
The reasons humans, unlike computers, can learn to recognize these things is because human brain is so much more powerful that the neural network you can create to understand that kind of things in computer. When computers will be as powerful as humans are in terms of computational capacity, re-ask this question and you will receive automatic answer from human-like machine.

Related

Trying to read these plates using OCR but they are blurry. Where do I start? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
Hi I am a student doing research in my university. This is my first time using computer vision (openCV) and I am fairly new to image preprocessing. I have these images of License Plates and I would like to use easyOCR/pytesseract to read the plates. Currently all I have done is convert the image to grayscale, rotate it by a few degrees, but the reading results are very inconsistent. How do I improve that?
I have tried using kernels to sharpen the images but they seem to be fairly inconsistent too.
Here are some images I have to give you a general idea of what the images are like:
I would start with image enhancement. It's hard to tell what exactly is applicable but here are some possible manuevers:
As usual recognition algorithms are not invariant to rotation. And every image seems to be geometically distorted similarly. You can try to normalize the geometry by warpPerspective function from Opencv with appropriate transformation matrix. Rotation is a subset of all possible transformations covered by perspective transform.
You can try to use advanced deblurring techniques like wiener filter or deeplearning. It seems like point spread function is different from image to image that complecates the recovery.
There is some periodic signal in your images (vertical blue-white-blue stripes). That can possibly can be enhanced by doing FFT -> removing components of the specific wavelength -> iFFT.
Anyway looking on your images, I am not sure if it will be easy to achieve the desired result without diving into the OCR pipeline.

How to crop image based on contents (Python & OpenCV)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Well currently I'm working on a personal project which is the identification of products in a scanned image taken from a store catalog.
As you may see in the image there's no lines separation between products, so using Hough lines to locate the products won't really solve the problem!
Using Tesseract is really amazing to extract the image content, the only problem that I'm facing is finding the image products automatically, I mean not cropping the image manually but I want to detect the products, cropping them with their text description and price and then extract content using OCR.
I have tried many image processing techniques but still nothing (I'm using Python and OpenCV).
Thanks in advance :)
The problem you have is usually called background removal, or alternatively foreground extraction. In this example, it might actually be relatively easy, as the background is mostly in shades of the same color - my recommendation would be to look at the GrabCut algorithm which is described here: https://docs.opencv.org/3.4.3/d8/d83/tutorial_py_grabcut.html

Comparing two images - python, openCV [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Which is the best way to compare two images from same domain, different features in python. Histogram or Image quality functions ?
I have two images for different scenes, the contents inside the images are different, but both of the images are taken during morning.
I want to compare how much these two images are related to each other ?, like my important metric, is to say that these two images were taken during morning for example, even if different contents.
Any idea or way how to do this ?
There is no easy answer to your question. It depends on how do you consider images similar or different. And this is a subjective measure that is totally dependable on what do you want to do with this information.
Anyway, for this kind of problems, opencv is your friend. Here I list some ideas:
use histograms: cv2.histogram https://docs.opencv.org/3.1.0/d1/db7/tutorial_py_histogram_begins.html
with histograms you can know how blueish, greenish or redish an image is. You can compare if 2 images are in the same range (bin) of a specific color. This is something very common when you want to detect skin color.
if you have an specific object that appears in different images, use SIFT or SURF.

2D image projections to 3D Volume [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am looking for a library, example or similar that allows me to loads a set of 2D projections of an object and then converts it into a 3D volume.
For example, I could have 6 pictures of a small toy and the program should allow me to view it as a 3D volume and eventually save it.
The object I need to convert is very similar to a cylinder (so the program doesn't have to 'understand' what type of object it is).
There are several things you can mean, I think none of which currently exists in free software (but I may be wrong about that), and they differ in how hard they are to implement:
First of all, "a 3D volume" is not a clear definition of what you want. There is not one way to store this information. A usual way (for computer games and animations) is to store it as a mesh with textures. Getting the textures is easy: you have the photographs. Creating the mesh can be really hard, depending on what exactly you want.
You say your object looks like a cylinder. If you want to just stitch your images together and paste them as a texture over a cylindrical mesh, that should be possible. If you know the angles at which the images are taken, the stitching will be even easier.
However, the really cool thing that most people would want is to create any mesh, not just a cylinder, based on the stitching "errors" (which originate from the parallax effect, and therefore contain information about the depth of the pictures). I know Autodesk (the makers of AutoCAD) have a web-based tool for this (named 123-something), but they don't let you put it into your own program; you have to use their interface. So it's fine for getting a result, but not as a basis for a program of your own.
Once you have the mesh, you'll need a viewer (not view first, save later; it's the other way around). You should be able to use any 3D drawing program, for example Blender can view (and edit) many file types.

Create video with effects from image [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am currently working on a project where I generate several images and then transform them into a video.
I am using OpenCV for the whole image processing thing, and especially cv.WriteFrame.
Even though it is working quite well, I would like to add some effects for image transition.
Simple things in fact, I would like the images to blend into each other to avoid the "violent" way it is currently done.
I also have problems with the fps in cv.WriteFrames (which is not accurate).
I searched on the internet without finding any library/utility to do that, so I started thinking about implementing it by myself. It would be quite a hassle though.
Would you know about an option to do such a thing?
I am open to any solution !
Thanks
To have a smooth transition you most likely have to put some extra frames between the 2 images. Those extra frames could be the 2 images progressively adding each other.
Usually opencv addWeighted is used to blend 2 images, it has parameters to set the weights.
addWeighted docs:
http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#addweighted
Well, I've never worked with OpenCV, but if you want to do a fade in or fade out I could envision doing something like creating frames that have progressively more alpha transparency and adding them into the stack thats being written to the video file. Something like that could be done in just a few lines of code with PIL.

Categories