Tuesday, April 1, 2014

Updates 4/1: Expansion Algorithm

Currently I'm still working on implementing the expansion algorithm, which is described as a grammar-like rewriting process. The system uses two non-terminal symbols to denote the candidate node and an instantiated node, and a terminal symbol that represents a node that has been added to the graph and that cannot be expanded.


While stepping through the algorithm, I realized that while the paper indicated how to calculate the elevation (y) of each newly created node, there was nothing for their (x, z) positions. I emailed one of the authors, Dr. Bene, and was told that the main direction is given by the direction to the previous node and is modified by the gradient of the river slope and other factors. I'm still using dummy constants for the river slope values, but it looks like I will either have to find an image processing library that covers gradients, or roll it out myself (which someone recommended in conjunction with using stb_img.c to read in the slope map).

Here is what one step 2.2 in the expansion chart looks like (this is with dummy slope and gradient values. You can tell by how the river pretty much aims straight to the origin)

Bird's eye view down y-axis

Breaking the next few weeks down into chunks, I have the following tasks left:

  • Implement function that reads in an image map describing the slope values in grey scale and scales it to fit the bounding box of the CV curve in order to determine the elevation of every node.
  • Calculate the gradient of the river slope map to determine expansion direction of newly instantiated nodes. 
  • Finish implementing expansion with symmetric Horton-Strahler junction creation 
  • Implement expansion with asymmetric Horton-Strahler junction creation
  • Implement expansion with just river growth
  • Implement compatibility check, which determines if a node is able to be expanded
  • Design and implement expansion loop
  • Calculate distance between edge and all other edges to avoid collisions in the graph
  • Calculate distance between a river node (point) and the contour curve
  • Check if a point lies within a curve (this is to ensure no nodes are created beyond the river contour)
  • Create a user interface in MEL

No comments:

Post a Comment