Esempio n. 1
0
 private void GetImageDetailsFromTree(BinaryNode node)
 {
     if (node.IsLeaf())
     {
         imageInformation.Add(new ImageDetails(node.image, node.coordinates, node.size));
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Assign inner nodes a 'Vertical' or 'Horizontal' split at random (50/50 chance)
 /// </summary>
 private void SetNodeSplit(BinaryNode node)
 {
     if (!node.IsLeaf())
     {
         if (node.assignedSplit == Split.None)
         {
             node.assignedSplit = GetRandomSplit();
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Assign images and aspect ratios to all leaf nodes
 /// </summary>
 private void SetImageToLeafNode(BinaryNode node)
 {
     if (node.IsLeaf())
     {
         if (numImagesAssignedToNodes < images.Count)
         {
             Image image = images[numImagesAssignedToNodes++];
             node.image       = image;
             node.aspectRatio = (float)image.Width / (float)image.Height;
         }
     }
 }