Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to develop a tree to store the features extracted from the images. Let's say I have 1000 data points (features) in space XY coordinates. Now I am performing k-mean clustering (3 Clusters) on this data. As a result I get three groups. Now I create a tree with three nodes. These 3 nodes will contain data points which belong to the respective nodes.So in this way all data points will be partitioned.

Now I go to first child node. Again apply k-mean clustering to create further 3 child nodes and further store the info in these nodes. Then I go to second child node and again create 3 child nodes and so on. This is depth 2.

So in this way I have to generate a tree. I can go up to any depth and number of child nodes may also vary from 3 e.g. 5 or 10 etc.

I hope this information will give a clear picture what i am trying to make. Normally we call it vocabulary tree used in Bag of Word Model for scene recognition. Problem is to generate the tree. I have already generated a static tree with 3 nodes and up to depth 3. But I need dynamic mechanism.
Posted

Did you have a look at Matlab, have a look Wikipedia article[^]
Thanks to you, now I know what is "Bags of words" !
 
Share this answer
 
Comments
[no name] 17-Dec-10 4:41am    
Oops I posted here because it appeared on the top of the list after your comment, but this question was asked 2.5 month ago...
You could create a struct like this:

typedef struct{
    void  *mydata;
    int   numchildren;
    void  **children;
}mytree;


Where mydata is a pointer to the data you wish to associate with each tree item, numchildren the number of a children a tree item has, and children a pointer to an array of mytree structs for each child.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900