Solved

Detect Position of Images, Ignoring Noise (C# or PHP or ImageMagick)

Posted on 2011-09-16
4
421 Views
Last Modified: 2012-05-12
I have some 2bit (black & white) images which contain a lot of noise and also images.

I need to detect roughly where the images are on the page.

What I'm thinking is if I separate the file into blocks, then count the number of black pixels in each block. I can then take an average for all the blocks. Then I know that blocks with significantly more black pixels in their block than average will contain an image.

What is the best and fastest way of coding this? I can do it in any language. It's being run from command line on Debian 6.

Thank you for your help!
0
Comment
Question by:ADFB
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 500 total points
ID: 36548492
Hi ADFB,

maybe it's overkill for your need, but you should take a look at the open source library OpenCV (http://en.wikipedia.org/wiki/OpenCV) which is especially made for things like image segmentation and recognition. This cross-platform library can be used from C, C++, C#, Python, Ruby, Java, maybe more ...

ZOPPO
0
 

Author Comment

by:ADFB
ID: 36548569
Looks very interesting...

How would I do this with OpenCV?

The pages are B&W and consist of text, images, and lots of noise (in large black dots and some small lines). How would I use OpenCV to remove all the noise, keeping the text and images? (Or just keeping the images since I have an image mask for protecting the text anyway.)
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 36548593
Sorry, I don't have any experience with OpenCV - I just found it some years ago and took a look at some samples and found it very interesting. But about how to solve your problem with OpenCV I cannot help you much ...
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 36552122
Make a Google search for "Image Recognition" and you will see where we are in this rapidly advancing field.  The Wiki article appears to be particularly good.
http://en.wikipedia.org/wiki/Computer_vision
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question