Forum: Ruby Image/Pattern Recognition

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9b36dd37d32d10083549f08cabbdac16?d=identicon&s=25 Becky Franklin (bex3000)
on 2009-02-27 15:57
Hey folks,

I have a project I'm trying to work out the feasibility of being able to
do - I want to process images that consist of a grid of squares
containing symbols, and I want to be able to break down the grid so that
the program can work out how many of each symbol there are and where it
is on the grid. Not sure if this is something that's going to be do-able
from what I've googled! Does RMagick or any of the gems have a possible
solution to this?

Hope that makes some sense!
Becky
7b8e1744137ecbad51b24ab2d169779b?d=identicon&s=25 Serabe (Guest)
on 2009-02-27 16:09
(Received via mailing list)
2009/2/27 Becky Franklin <bex_3000@hotmail.com>:
> Hey folks,
>
> I have a project I'm trying to work out the feasibility of being able to
> do - I want to process images that consist of a grid of squares
> containing symbols, and I want to be able to break down the grid so that
> the program can work out how many of each symbol there are and where it
> is on the grid. Not sure if this is something that's going to be do-able
> from what I've googled! Does RMagick or any of the gems have a possible
> solution to this?

You can use get_pixels (
http://www.imagemagick.org/RMagick/doc/image2.html... ) for
getting pixels in a region and store_pixels for (yes, you guessed it)
store pixels in a image.

Regards,

Serabe
9b36dd37d32d10083549f08cabbdac16?d=identicon&s=25 Becky Franklin (bex3000)
on 2009-02-27 16:15
Serabe wrote:
> 2009/2/27 Becky Franklin <bex_3000@hotmail.com>:
>> Hey folks,
>>
>> I have a project I'm trying to work out the feasibility of being able to
>> do - I want to process images that consist of a grid of squares
>> containing symbols, and I want to be able to break down the grid so that
>> the program can work out how many of each symbol there are and where it
>> is on the grid. Not sure if this is something that's going to be do-able
>> from what I've googled! Does RMagick or any of the gems have a possible
>> solution to this?
>
> You can use get_pixels (
> http://www.imagemagick.org/RMagick/doc/image2.html... ) for
> getting pixels in a region and store_pixels for (yes, you guessed it)
> store pixels in a image.
>
> Regards,
>
> Serabe

Wow that's pretty simple! Gotta love Ruby :o) Thanks so much for the
quick response :o)
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-02-27 16:26
(Received via mailing list)
Serabe wrote:

> Becky Franklin:

> getting pixels in a region and store_pixels for (yes, you guessed it)
> store pixels in a image.

That is as far from pattern recognition as atoms are from elephants!

Becky needs to google for "chain code". I really doubt a Ruby
implementation is
available, because the algorithms to do it in less than polynomial time
are secret.
7b8e1744137ecbad51b24ab2d169779b?d=identicon&s=25 Serabe (Guest)
on 2009-02-27 16:27
(Received via mailing list)
BTW, you can use import_pixels and export_pixels too.

Regards,

Serabe
23172b6630dc631a134c9bad2fec2a39?d=identicon&s=25 Chris Hulan (Guest)
on 2009-02-27 16:45
(Received via mailing list)
On Feb 27, 9:56 am, Becky Franklin <bex_3...@hotmail.com> wrote:
> Hope that makes some sense!
> Becky
> --
> Posted viahttp://www.ruby-forum.com/.

Haven't used it but the camellia Image processing library looks like
it might be useful
http://camellia.sourceforge.net/index.html

Cheers
Chris
7b8e1744137ecbad51b24ab2d169779b?d=identicon&s=25 Serabe (Guest)
on 2009-02-27 16:55
(Received via mailing list)
2009/2/27 Phlip <phlip2005@gmail.com>:
>
> That is as far from pattern recognition as atoms are from elephants!

Becky said that images consist of a grid of squares. I just pointed
him that RMagick has some methods for retrieve and store pixels. I
know it is not pattern recognition, but at least, he is one step
closer now.

Regards,

Serabe
9b36dd37d32d10083549f08cabbdac16?d=identicon&s=25 Becky Franklin (bex3000)
on 2009-02-27 17:01
Thanks so much for the responses folks they've been so helpful!

I think with a load of maths I can iterate through each of the squares
in the grid as it will only be black and white - unless Camellia or
RMagick have any sort of compare pixels functionality?
9b36dd37d32d10083549f08cabbdac16?d=identicon&s=25 Becky Franklin (bex3000)
on 2009-02-27 17:08
Becky Franklin wrote:
> Thanks so much for the responses folks they've been so helpful!
>
> I think with a load of maths I can iterate through each of the squares
> in the grid as it will only be black and white - unless Camellia or
> RMagick have any sort of compare pixels functionality?

Looks like find_similar_region might be what I'm looking for - love this
language!
7b8e1744137ecbad51b24ab2d169779b?d=identicon&s=25 Serabe (Guest)
on 2009-02-27 17:10
(Received via mailing list)
2009/2/27 Becky Franklin <bex_3000@hotmail.com>:
> Thanks so much for the responses folks they've been so helpful!
>
> I think with a load of maths I can iterate through each of the squares
> in the grid as it will only be black and white - unless Camellia or
> RMagick have any sort of compare pixels functionality?

Here:

http://www.imagemagick.org/RMagick/doc/struct.html#Pixel

Take a look at <=> and fcmp methods.

Regards,

Serabe
This topic is locked and can not be replied to.