LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-15-2005, 09:03 AM   #1
ashirazi
Member
 
Registered: Jul 2004
Posts: 60

Rep: Reputation: 15
graphics structure locator


Hi,

I was wonder if it would be possible to create a program that could search an image for geometric structures i.e. squares or circles? I had no clue as to how to go about it, so any hints or readings would be helpful. I dont really mind using VB or JAVA.

Appreciate the help.

Raven
 
Old 06-15-2005, 09:15 AM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
Quote:
I was wonder if it would be possible to create a program that could search an image for geometric structures i.e. squares or circles?
... as long as the language is turing-complete, yes

In the real world, in depends on what your definition of circles and squares are--how closely must the colors match, how closely must they mismatch their neighbour, how thick may the lines be, etc.

It's rather simple to do:
Code:
for each (x0, y0):
    for each (x1, y1):
        if spanssquare((x0, y0), (x1, y1)): yield ((x0, y0), (x1, y1))

def spanssquare((x0, y0), (x1, y1)):
    for each (xt, yt) in (x0, y0) to (x1, y0):
        if not color((xt, yt)) == color((x0, y0)): return False
    for each (other line):
        the same
    return True
But it has the stupid effect of saying that any monochromatic area consists of squares all over the place.

So, the hard part is the definition of what a square is.

hth --Jonas
 
Old 06-15-2005, 10:12 AM   #3
ashirazi
Member
 
Registered: Jul 2004
Posts: 60

Original Poster
Rep: Reputation: 15
But how do we read the image file, pixel wise?
 
Old 06-15-2005, 10:27 AM   #4
ashirazi
Member
 
Registered: Jul 2004
Posts: 60

Original Poster
Rep: Reputation: 15
Does anyone know of a binary image processing tutorial?
 
Old 06-15-2005, 04:08 PM   #5
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
Quote:
But how do we read the image file, pixel wise?
for python, you can use the Python Imaging Library (http://effbot.org/downloads/);
for other languages--GIYF

hth --Jonas
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
graphics programmes and wacom graphics tablets? bigjohn Linux - Newbie 9 05-29-2005 05:03 PM
where to find S3 graphics pro savage DDR graphics jcolon Linux - Hardware 5 02-16-2005 04:53 PM
Graphics issues with Intel 82856G Graphics Adapter herrmag Linux - Newbie 1 08-09-2004 02:52 PM
graphics programming in vi: using the structure REGS is giving a compilation error sohamdas Programming 1 04-26-2004 04:38 PM
vsftp directory locator bytebrowser Linux - Networking 0 03-15-2004 06:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration