9

I know tl;dr;

I'll try to explain my problem without bothering you with ton's of crappy code. I'm working on a school assignment. We have pictures of smurfs and we have to find them with foreground background analysis. I have a Decision Tree in java that has all the data (HSV histograms) 1 one single node. Then tries to find the best attribute (from the histogram data) to split the tree on. Then executes the split and creates a left and a right sub tree with the data split over both node-trees. All the data is still kept in the main tree to be able to calculate the gini index.

So after 26 minutes of analysing smurfs my pc has a giant tree with splits and other data. Now my question is, can anyone give me a global idea of how to analyse a new picture and determine which pixels could be "smurf pixels". I know i have to generate a new array of data points with the HSV histograms of the new smurf and then i need to use the generated tree to determine which pixels belong to a smurf.

Can anyone give me a pointer on how to do this?

Some additional information.
Every Decision Tree object has a Split object that has the best attribute to split on, the value to split on and a gini index.

If i need to provide any additional information I'd like to hear it.

Yuval F
  • 20,565
  • 5
  • 44
  • 69
TFennis
  • 1,393
  • 1
  • 14
  • 23
  • 1
    Probably this is my own ignorance about image processing, but anyway: It sounds like you want to use the decision tree for classification. It is unclear what you classify: is it specific pixels or the whole image? The general decision tree paradigm says: a. Represent every object to be classified by features. b. Learn a decision tree mapping the features to a label. c. To classify a new object, first represent it as features, then run the tree on the object and get the suggested label. – Yuval F Feb 13 '11 at 14:49
  • "then run the tree on the object and get the suggested label" this is the part where i need help – TFennis Feb 13 '11 at 14:58

1 Answers1

2

OK. Basically, in unoptimized pseudo-code: In order to label pixels in a new image:

For each pixel in the new image:

  • Calculate pixel's HSV features
  • Recursively, starting from the tree's root :
  • Is this a leaf? if it is, give the pixel the dominant label of the node.
  • Otherwise, check the splitting criterion against the pixel's features, and go to the right or left child accordingly

I hope this makes sense in your context.

Yuval F
  • 20,565
  • 5
  • 44
  • 69