By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,916 Members | 1,328 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,916 IT Pros & Developers. It's quick & easy.

Image Search / recognition

P: n/a
Jmc
Hi
I would like to build an image search system, that can match both
colors and/or shapes.
The pictures will be quite simple picture with normaly 4-10 colors
(maybe 20 in extreme cases).
Large areas with the same color (no photographs) or extremely details.
Gor any poiters how to do this, what technique should I use, has anyone
done this in c# and sql server?
The picture database will probably contain millions of pictures when
its done, the pictures wont be very large, probably 200-300 pixels in
height and width.

/Jimmy

Jul 12 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
KJ
Hello Jmc,

I have some ideas for you based on my limited experience. The Image
object has a Palette.Entries property which is a Color[] array. You can
store these values (i.e., call the ToArgb() method of each entry) in a
table when you load your images into your repository, then search for
them later.

An easy way to check if two files are identical is to create MD5 hash
codes for all your files, store them as varbinary(16), then compare
these values. Use the MD5CryptoServiceProvider to create the hashes,
e.g.,

byte[] MD5hash (byte[] data)
{
MD5 md5 = new MD5CryptoServiceProvider();
byte[] result = md5.ComputeHash(data);
return result;
}

As far as finding shapes goes, I have no idea. I have a feeling it
would require some intimate knowledge of byte arrangement in the file
types you are using. Perhaps not.

HTH.
-KJ

Jmc wrote:
Hi
I would like to build an image search system, that can match both
colors and/or shapes.
The pictures will be quite simple picture with normaly 4-10 colors
(maybe 20 in extreme cases).
Large areas with the same color (no photographs) or extremely details.
Gor any poiters how to do this, what technique should I use, has anyone
done this in c# and sql server?
The picture database will probably contain millions of pictures when
its done, the pictures wont be very large, probably 200-300 pixels in
height and width.

/Jimmy
Jul 12 '06 #2

P: n/a
Jmc
Hi KJ
I need a bit more advanced functionality.
To break it down I would need 3 different recognition functions.
1.
Basically what I would like to do is to have a picture lets say a ball,
the image regognision system should be able to identify an exakt copy
of the picture (OR the same placement of pixels regardless of color).
Imagine that I have a picture of a green ball and some one colors it
yellow, I would still like it to identify it as the "same" picture but
with color variation.

2.
Also I would like to be able to store patterns in a database, lets say
the shape of a balloon, I want my application to be able to identify a
simular shape and then suggest that the picture might illustrate a
baloon.

3. And simularities in colors a red picture should find other red
pictures (but not the exact rgb value but rather a red-ish color) That
part I think I can handle using the CIE algoritm.

The most imortant function is no 1 (and perhaps the most simple(?))

Hope someone can point me in the right direction.
/Jimmy

Jul 13 '06 #3

P: n/a
Task 1) You may be able to do task one using as method similar to the
following:

1) Convert the images to monochrome
2) Increase their contrast without regard to clipping, bring them close
to black & white
3) Compare them, if a (very) close match, you have a hit
4) If no match, invert one of them and compare them again, if a very
close match you have a hit, otherwise you have a miss.

There probably is a bit more to it than that but its a start.

Task 2) That's a tough one...not really sure...something similar to the
MPEG motion estimation algorithm perhaps, extended to account for
rotation of an object? (I'm sure there are better ideas out there.)

Task 3) Not familiar with the CIE algorithim. Is that a heuristics
algorithm (which is something that could work.)

Hope this helps a little.

-Ted

Jmc wrote:
Hi KJ
I need a bit more advanced functionality.
To break it down I would need 3 different recognition functions.
1.
Basically what I would like to do is to have a picture lets say a ball,
the image regognision system should be able to identify an exakt copy
of the picture (OR the same placement of pixels regardless of color).
Imagine that I have a picture of a green ball and some one colors it
yellow, I would still like it to identify it as the "same" picture but
with color variation.

2.
Also I would like to be able to store patterns in a database, lets say
the shape of a balloon, I want my application to be able to identify a
simular shape and then suggest that the picture might illustrate a
baloon.

3. And simularities in colors a red picture should find other red
pictures (but not the exact rgb value but rather a red-ish color) That
part I think I can handle using the CIE algoritm.

The most imortant function is no 1 (and perhaps the most simple(?))

Hope someone can point me in the right direction.
/Jimmy
Jul 26 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.