Can you Describe what you mean by a feature?
Are you reading an image from a database and want to know its size?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
I don't know of any classes in Java SE that can do that. You should ask google if there are 3rd party packages that do what you are looking for
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
no..features like texture,color and shape of objects depicted etc...i wanted to search an image on an image database based upon these extracted features...
I don't want to discourage you, but identifying and encoding info like texture or shape is a really really difficult computational problem, in any language. Is there anything else you could be doing instead for this project?
JamesCherrill
... trying to help
8,497 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29
OK. That's going to be a very interesting project - I'm sure that many of us here will be following it and trying to contribute!
You are certainly going to need some code along the lines of ztini's post above. You'll almost certainly run into some performance issues combining image processing and genetic algorithms, so it's probably worth some fine-tuning of the lower-level methods - have a look at the PixelGrabber class to give access to multiple pixels in a very efficient way.
ztini's code that you asked about is to extract the three colour components is based on the assumption that the image is internally stored as one int per pixel, with the four bytes of the int holding Alpha, R, G, B values. It uses bit-shifting and masking to extract the RGB bytes into separate ints.
Comparing images by colour set? Rather than just building a collection of every colour in the image, you may do better to build a histrogram that shows how many of each colour is present, eg so the peak of the histogram will be the predominant colour. with (2 power 24) colours you'll need to compact it a bit, eg by having 3 256-element histograms for RGB separately, or by "posterising" the image into a smaller number of colours, eg by ignoring the last 3 or 4 bits of each color component.
JamesCherrill
... trying to help
8,497 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29
like to compare the histograme
Define what the structure of your histogram is and what the results of comparing two of them would be?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
You show 3 rows of numbers with 3 numbers on a row.
When you compare those three rows of three numbers,
what would the results be?
Row by row,
col by col,
item by item
sum of row vs sum of row
etc
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16