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 8 years ago.
Improve this question
I am creating a program which relies heavily on image recognition. I am doing this by taking a screenshot, and then determining whether a pre-determined image exists in the location of my screenshotting.
However, for my program, I also need to be able to take a screenshot of a location in which there will be text, specifically numbers. It will be regular, in the same font, but it will be different numbers every time.
How can I turn this kind of information from a bitmap into an integer I can use in my code?
Thanks.
This is not an easy task, it is essentially optical character recognition (OCR). There is a very similar conversation here.
OCR with the Tesseract interface
You might also want to look at this:
http://www.leadtools.com/sdk/ocr/default.htm?SrcOrigin=Google-CPC-OCR%20API&MatchType=e&AdPos=1t2&gclid=CLjXx4Gx6K8CFdA2pAodAXth1Q
Even beyond the OCR, you will need to scan the image and find the actual text, and this might be tricky as well. If the text is not always in the same location you will quickly find yourself in the "computer vision" space.
You're going to need to look for OCR, or Optical Character Recognition, in order to pull data from images into a string. This is an entire field in and of itself, so sadly there's no simple answer, but there may be a C# library out there for you to use, or C++ if you're comfortable with wrapping.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
after one hour searching I'm writing this question.
how to read,write and modify a text in text editor while the text editor is open, the text editor might be anything such as notepad or vs or word.
the type of c# application isn't matter whatever it be.
Writing to another memory's process is more complex and less stable. Better idea is to send a message/event to another process. This link demonstrates it for notepad, but idea is similar for other editors.
You need to connect to the process, it involves a lot of Windows API and it is different for different applications. My advise, don't do it, I cannot imagine an architecture which includes this kind of actions, it is asking for bugs.
But, if you still want to do it, Google: "connect to a process notepad and change text c#"
You will find many links which explain. For example this one:
https://www.codeproject.com/Articles/670373/Csharp-Read-Write-Another-Process-Memory
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 5 years ago.
Improve this question
Looking to write a piece of software that can take in images like this, and count the number of circular "holes" in the picture. You can see that there are circular holes, as well as non-circular holes. The image is basically a plastic plane consisting of cylinders melted together, and the diamond-ish holes should not be counted.
I am at the point where I can load the image into a C# WPF application, and resize or recenter the image to where I want to work with, but how to count the shadows or circular holes is not something I've been able to find in my research so far.
What I've thought about is having the user place a line on top of the image that crosses the holes, and counting how many times on that line the color drops approaching black, but that seems time consuming.
Any help in solving this problem would be appreciated even if it's referring to a manual or textbook/reference on image processing in this form.
I will not go too much into detail here. What you are attempting to do is a very common problem in image processing. Finding groups of similar pixels and sorting them by shape / size.
https://en.wikipedia.org/wiki/Blob_detection
https://en.wikipedia.org/wiki/Image_segmentation
https://en.wikipedia.org/wiki/Statistical_classification
Will give you a good starting point into this topic.
Basically you separate the image into regions that belong to the plastic and regions that belong to the holes. Then you find connected regions of "hole-pixels". Once you have that you can calculate their area and/or some shape descriptors like circularity to classify your regions.
I suggest you read any book on image processing fundamentals befor you continue. That's very basic knowledge anyone should know befor writing any code...
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 5 years ago.
Improve this question
I am trying to remove text from images, like for example we have a screenshot of instagram post, now we tried to fetch only image from this screenshot, in our .NET/C# code we read all pixel and check its color to see if we are getting white space, so that we can remove all unused space and extract only picture, but it didn't worked as expected, Does anyone has idea to do it correctly?
To extract text from image u need to use some OCR lib like Tesseract.
https://github.com/tesseract-ocr/tesseract
If necessary, u can use some type of image editor lib for .Net like AForge.
https://github.com/andrewkirillov/AForge.NET
This is a very broad question. divide your problem into steps and start solving from the first step.
Best .Net library is EMGUCV, an OpenCV wrapper which is broadly used in image processing.
AForge.Net is another good one. Follow the documentation to process text data from images.
The logic is
1. Track texts in the image.
2. if the font and size is similar and static, you can input fixed pattern and match patterns.
3. Then there are several option to remove a found object (here you will find texts as object or area.)
4. You have to tune after removing texts from the pictures. That will need image reconstruction algorithms. These all are available in EMGUCV.
Please see the documentation.
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 5 years ago.
Improve this question
F.E. we have a scanned text document. For now, I have wrote a program which can get an image of a letter and recognize it. The thing which I don't understand now is how can I get from the whole scanned document the image representation of each text symbol? Is it possible?
As a basic technique, use binarization and connected component analysis. This will give you "blobs" corresponding to the individual characters and you can get their bounding boxes.
You will face extra difficulties:
some characters can touch and form a single blob. You will need some detection logics to split them, for instance based on size and/or bad recognition score. In the nasty cases (several touching characters, characters of uneven width), you will have to try different splitting hypothesis and keep the best.
some characters are made of several blobs (such as accented letters), and some characters can appear fragmented. You can detect these situations when there are small blobs in a close vicinity. Here again, you will have to try grouping hypothesis (with a risk to group unrelated pieces) and keep the best.
the blobs will be reported to you in random order and you will need some extra logics to reorder them in the reading sequence.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Hi sirs I'm just wondering if is it possible for me to measure the height or width of an object using canny edge?
and if there's other way?
As #BartoszKP correctly stated, there are numerous ways on how to solve your problem. If, however, you want to go ahead and solve it with the help of the Canny edge detection you could do something like this:
Create Canny edge image
Do Hough line detection (here is an example in Emgu) to get geometrical information on where the lines in your image are - they might now represent your clothing article outline in a much more usable way
Use the geometrical information to rule out the non-shoulder lines - normally you should have all the information you need on all the lines (like where they are exactly in the image). That information might just enable you to throw away, let's say, the bottom end of the clothing article.
Use the geometrical information of the remaining lines to calculate your shoulder width or whatever you want to calculate.