SPUG: pack and unpack of binary raster graphic files

David Innes davidinnes at chicagoscience.com
Fri Aug 22 15:03:18 CDT 2003


Hmm.  I though maybe you could subvert primitives from Perl-based Optical
Character Recognition modules but I couldn't really find anything along
those lines on CPAN.  

Starting very long ago NASA and DoD has done a whole bunch of research on
machine recognition of shapes in images.  You'd think some of it would be
available if not on CPAN then at least on Google. I think I might not be
using the right terminology.

For what it's worth, CPAN appears to offer very little in the way of shape
recognition beyond something called No::OCRData.  The first line in the
description says "This documentation is written in Norwegian, for others,
suffice to say that it does not really have much to do with Optical
Character Recognition."  (The module is evidently intended to operate on
data scanned from standard Norwegian bank forms.)

Surely someone out there has already solved some of these problems and
published solutions.

I called a friend who got his start in graphics doing portraits on
etch-a-sketches and went from there.  He suggested that if you can define
something that's unique about the objects you're trying to detect you might
be able to use the Gimp's magic wand or intelligent scissors tools to find
the boundaries for you.  CPAN does have a bunch of modules for the Gimp.

But I should also mention that he said "wow, this is a classic case where
'example a' and 'example b' would make the problem a lot easier to solve."

Just for fun, and to make SPUG more interesting, I think there's supposed to
be an anti-porn filter for enterprise firewalls that can filter incoming
image streams for anything showing too large a proportion of uninterrupted
flesh tones.  It seems sort of silly to me but the key thing is that if
firewall-level apps can distinguish the shapes of naked people in real time
(very irregular in both the corporate and graphical sense) then it shouldn't
be that hard to detect more regular shapes in your images.

But for better or worse, "example a" and "example b" for that problem
probably wouldn't make it past our enterprise firewalls.

:-)
		-- David Innes

-----Original Message-----
From: spug-list-bounces at mail.pm.org [mailto:spug-list-bounces at mail.pm.org]
On Behalf Of Richard Wood
Sent: Friday, August 22, 2003 11:17 AM
To: 'Seattle Perl Users Group'
Subject: RE: SPUG: pack and unpack of binary raster graphic files

James, 

I have a pretty specialized need.  I am not aware of
any tools in ImageMagick that would do what I need to
do.  I have to process through the scanlines looking
for repeating patterns then determine where these
patterns occur.  Once I have information that defines
some bounding rectangles, I have to either remove
external content or internal content depending upon
the situation.  Identifying the bounding rectangles is
the trick!  At that time, when I know the coordinates,
I might end up using ImageMagick.  

The number of graphics that I am working with is in
the 100's of thousands, and they are not necessarily
very consistent.

Thanks for the thought, it did cause me to review the
functionality available in ImageMagick.

Regards,

Rich Wood






More information about the spug-list mailing list