Solved

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

Posted on 2011-09-16
4
414 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 30

Accepted Solution

by:
Zoppo earned 500 total points
Comment Utility
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
Comment Utility
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 30

Expert Comment

by:Zoppo
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now