2020 08 09 Refine and back to basic shapes. - syntaxmonkey/Thesis GitHub Wiki

Goals for this week

This week, we focus on applying the tool to basic shapes. At the moment, segmenting and contouring portraits still doesn't provide the viewer with enough information for the user to discern the original image. We work on refining the algorithm to display details of the original image.

We will also experiment with the following parameters:

  1. Number of segments. This can be set based on the size of the image. Try to determine at what point the number of regions produces enough details.
  2. Try controlling the angle of the lines based on the distribution of triangles in the flattened mesh.
  3. Control the density of lines in a region based on the greyscale intensity of the region.
  4. Try some other basic images
  1. Basic square
  2. Basic letter
  3. More complex simple shapes

Controlling line density based on the region intensity

We currently calculate the greyscale intensity for regions in range [0...1]. Darker regions are toward 0 while lighter regions are toward 1.

We can now control the line density base on the intensity of the region, however, it is still not perfect.

Set the intended region count dynamically

Currently we don't have a logical approach to the number of regions. One approach is to target the number of pixels in each region. Some values to try:

  1. 800
  2. 700
  3. 600
  4. 500
  5. 400
  6. 300

Implemented this feature. We now set the region target pixel count. The tool dynamically calculates the number of regions.

Basic shapes

Simple Square

Based on a simple square, we can do some etching. Unfortunately, the white regions should ideally be blank. We can improve this behaviour.

Output the generated images to file.

The output filename should match the following format:

  1. [filename][numberOfRegions][targetRegionPixels]_WithSLIC
  2. [filename][numberOfRegions][targetRegionPixels]_NoSLIC
  3. [filename][numberOfRegions][targetRegionPixels]_GreyscaleSLIC

Instead of specifying the number of pixels per region, we specify the percent of X, Y values. The targetRegion = X * percent * Y * percent.

Updated tool to run through each image with multiple target percent values: 0.05, 0.1, 0.15, and 0.2.

Add logic to allow blank regions

In the current implementation, we draw lines in a region based on the intensity of the region. However, this still allows for regions that have intensity of 255 still have minor marks. These minor marks make it appear the blank regions still have content.

Added logic that checks the intensity of the region. If the region intensity is above 250, then we skip drawing any lines in the region.

Generate many sample images

We generate many images using test target pixel counts: 25, 50, 100, 200, 400, 800, and 1600 pixels.

Need to set the output image vertices to appropriate size

When we save the merged image to file, the saved content only contains x-axis and y-axis that is sufficiently large that it contains all non-zero content. We need to manually set the axis values so that the merged image is the same size as the original image.

Add label to image files

Adding naming convention to the contour image: Merged Image - [filename] - Segments: [segment count] - regionPixels: [region Pixel Count]