Skip to content
  • Mohammad Akhlaghi's avatar
    NoiseChisel bug fixed by 8 connected labeling · 7300ebf6
    Mohammad Akhlaghi authored
    Until now, in labeling the dilated image, I used 4-connected
    components. However, in the segmentation step, the 8-connected
    neighbors of each river pixel are checked. When the rivers of the
    edges of the detections are checked, these two different neighbor
    definitions would cause a problem: two separate 4-connected regions
    can be 8-connected.
    
    The fix of this bug was a simple change of `4' to `8' in the main
    NoiseChisel function. However it took me several (very frustrating)
    hours to find it! While Valgrind's messages are usually very useful,
    in this case (because they resulted from my own convention), they
    caused even more confusion. The valgrind error said something like
    this: "You are trying to reference an internal array of another
    function that was allocated and freed in another funciton". In short
    the array it was complaining about didn't exist when the function
    giving the error was called!!! This really confused me! I finally
    found it through individual checks of all the detections without using
    Valgrind.
    
    In the meantime, I also removed all the checks for NaN (masked) pixels
    in oversegment (clumps.c). Since NaN pixels are no longer in the
    indexs that are fed to this function.
    7300ebf6
To find the state of this project's repository at the time of any of these versions, check out the tags.