Solved

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

Posted on 2011-09-16
4
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 110

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

717 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