2020 08 16 Control orientation of contour lines - syntaxmonkey/Thesis GitHub Wiki

Adding orientation to the regions

Currently, the orientation of the contour lines are random. Options:

  1. Set orientation based on the intensity.
  2. Set orientation based on x, y coordinates of the region.
  3. Set orientation based on the triangle distribution in the flattened mesh.

SLIC0

Could we utilize this mode to produce better segmentation? https://www.epfl.ch/labs/ivrl/research/slic-superpixels/#SLICO

Results of SLIC0

SLIC0 tends to make the regions more normal in shape. The first image is without SLIC0 while the second impact is with SLIC0. We tend to lose some shape information.

image Without SLIC0 image With SLIC0

Line continuity between regions

We are going to try to add line continuity between regions.
TODO:

  1. Create distance metric for each region.
  2. Find the pixels that are within 2 pixels of the edge. We will utilize chessboard metric instead of taxicab metric. https://stackoverflow.com/questions/40492159/find-distance-from-the-edge-of-a-numpy-array.
  3. Find the

Distance raster

We can now generate a distance raster based on the region raster. The distance raster will now be used to determine which points are close enough to an edge for potential merging with other regions. We will also use the distance raster as the basis for region adjacency graph.

image image

TODO:

  1. Based on the Distance raster, we need to detect which lines are in the edge.
  2. We can check the distance between points from each region. However, we would need to constant perform transformations. Is there an alternative?

We also crop the contour lines based on the region raster.

When we draw the contour lines, we adjust for relative location.

We can calculate the topLeftTarget and bottomRightTarget with

regionCoordinates = regionMap.get( index )

topLeftTarget, bottomRightTarget = SLIC.calculateTopLeft( regionCoordinates )

Finding points on the region edge pixels

Can now find and plot the points that exist on the edge pixels.

For diagnostic purposes, we mark the edge points with a green 'x'. Here is a rendered region with the highlighted edge points.

image

This is a close of the region providing a better view of the edge points.

image
⚠️ **GitHub.com Fallback** ⚠️