CNF:Weighted Mesh To Image: Difference between revisions

From crtc.cs.odu.edu
Jump to navigation Jump to search
Spyridon97 (talk | contribs)
No edit summary
Spyridon97 (talk | contribs)
No edit summary
Line 1: Line 1:
__TOC__
__TOC__
[https://odu.app.box.com/folder/115714696781 Box folder that includes code]


=Code=
=Code=

Revision as of 10:11, 18 June 2020

Box folder that includes code

Code

Summer 2020

Create a new image using the weights of:

  1. k-nearest-neighbors points as values in a weighted-mean, were weight[i] = 1 / distance(pixel-point, neighbor-point[i]) ^ power.
  2. cell points as values in a weighted-mean, were weight[i] = 1 / distance(pixel-point, cell-point[i]) ^ power.
    1. Note: If the pixel point is not inside a cell, then the algorithm `1` will be used.
  3. the intersection set of k-nearest-neighbors points and cell points as values in a weighted-mean, were weight[i] = 1 / distance(pixel-point, intersection-point[i]) ^ power.
    1. Note 1: If the Intersection set is empty, then the algorithm `2` will be used.
    2. Note 2: If the pixel point is not inside a cell, then the algorithm `1` will be used.
  4. cell points as values in a weighted-mean, were weight[i] = probe-value[i] based on the location of each pixel point inside a cell. Probing values are result of FindCell function.
    1. Note: If the pixel point is not inside a cell, then the algorithm `1` will be used.

Comparison Metrics:

  1. Let a and b be the sets of pixel values of input and output image, then the mean weighted pixel difference value is:
    1. File:MeanWeightedPixelValueFormula.png
  2. Average Hausdorff Distance (itk filter)
  3. Similarity Index (itk filter)

Comparison Examples

Summer 2020

Left: Image, Middle: Algorithm Result. Right: Mesh

KNN, number of points = 4, power = 1.5

  1. Mean Weighted pixel value difference: 0.000395461
  2. Average Hausdorff Distance: 0.030885
  3. Similarity Index: 0.986463

Cell Points, number of points = 4, power = 1.5

  1. Mean Weighted pixel value difference: 0.0002258
  2. Average Hausdorff Distance: 0.030885
  3. Similarity Index: 0.986463

Intersection of KNN and Cell points, number of points = 5, power = 1.5

  1. Mean Weighted pixel value difference: 0.000273839
  2. Average Hausdorff Distance: 0.030885
  3. Similarity Index: 0.986463

Cell points with probing weights, number of points = 4, power = 1.5

  1. Mean Weighted pixel value difference: 9.17551e-05
  2. Average Hausdorff Distance: 0.030885
  3. Similarity Index: 0.986463

Best Algorithm

Evidently, the best algorithm both visually and by looking into the metrics is algorithm 4.

Examples of PODM with changed weights

Summer 2020

Modifying Area based on X coordinate

Algorithm 4 will be used

auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end());
for (size_t i = 0; i < numberOfPoints; ++i) {
    if (points[i][0] >= 15 && points[i][0] <= 20)
        pointWeights[i] = maxWeight + pointWeights[i];
}

Modifying Area based on Y coordinate

Algorithm 4 will be used

auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end());
for (size_t i = 0; i < numberOfPoints; ++i) {
    if (points[i][1] >= 95 && points[i][1] <= 101)
        pointWeights[i] = maxWeight + pointWeights[i];
}

Modifying Area based on Z coordinate

Algorithm 4 will be used

auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end());
for (size_t i = 0; i < numberOfPoints; ++i) {
    if (points[i][2] >= 43 && points[i][2] <= 53)
        pointWeights[i] = maxWeight + pointWeights[i];
}