Re: help with neural/fuzzy image color recognition


Subject: Re: help with neural/fuzzy image color recognition
From: Robin B. Lake (rbl@hal.EPBI.CWRU.Edu)
Date: Sun Feb 06 2000 - 12:25:10 MET


It was asked:

> KS wrote:
> "I would like to know if there exist some already written program
> (preferably in C) that does the following things: takes an image in input
> and classifies its pixels as belonging to classes of colors
> (green, yellow, black, white, cyan, blue, magenta). The output should be
> this classification, preferably shown with an output image whose pixels are
> colored each with the color representative of the class the pixel belongs to
> (for example all the pixels that are "near green" in the input image should
> be green in the output image). The program should use neural networks and/or
> fuzzy logic algorithms. Is there any kind of program that does these things?
> Do you know any tool (code generators, fuzzy/neural systems) that can help
> me?"
>
> I don't know of any existing code to do this. One might define (in some
> colorspace, such as RGB) the target colors and simply check pixels against
> each of these, assigning the closest. I would imagine that something like
> YIQ (the NTSC standard) would give better results than RGB.
>
> Will Dwinnell
> predictor@compuserve.com
>

There is a freely available package, written in C, called "pbm" (for
Portable Bit Map). It will take a wide variety of image formats and
convert them to and from other formats. Convert your image to an RGB
image with 3 X (0-255) valued bytes per pixel.

Then, you could use a C program derived from the classic "tree.c" binary
tree example. I called mine "strsub". Strsub adds an additional element
to the basic tree.c node structure. This element is the byte that will
be substituted for the original byte.

Strsub takes two files as input, one to populate the binary tree with
3 * (0-255) values (don't do this sequentially, or you'll ruin the
left/right advantage of the binary tree!) and one file to match line-for-line
the value you want to substitute for the original pixel value. Then
scan the input image thru strsub and get the color-transformed image
as output.

Of course, you could just use NIH Image or NCSA Image (I've forgotten
which one does it best). These have interactive palates (sp?) that
you can establish or code to do the desired color transformations.

Cheers,
Robin Lake
Environmental Modeling Inc.
rbl@hal.cwru.edu
 

############################################################################
This message was posted through the fuzzy mailing list.
(1) To subscribe to this mailing list, send a message body of
"SUB FUZZY-MAIL myFirstName mySurname" to listproc@dbai.tuwien.ac.at
(2) To unsubscribe from this mailing list, send a message body of
"UNSUB FUZZY-MAIL" or "UNSUB FUZZY-MAIL yoursubscription@email.address.com"
to listproc@dbai.tuwien.ac.at
(3) To reach the human who maintains the list, send mail to
fuzzy-owner@dbai.tuwien.ac.at
(4) WWW access and other information on Fuzzy Sets and Logic see
http://www.dbai.tuwien.ac.at/ftp/mlowner/fuzzy-mail.info
(5) WWW archive: http://www.dbai.tuwien.ac.at/marchives/fuzzy-mail/index.html



This archive was generated by hypermail 2b25 : Thu Apr 06 2000 - 15:59:44 MET DST