Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This algorithm attempts to solve the previous problem by applying an extra layer of filtering before the island separation with the sole purpose of separating the islands. The pseudocode goes as follows: 0-

  1. A range of thresholds for the filter to apply to the image is initialized (th_min,th_max), so th_min is equal to the noise threshold that was applied, and th_max is equal to the larges value of the image.
  2. The threshold is set to the mean of the range th_try=(th_min+th_max)/2 and applied to a copy of the image
  3. An algorithm is applied to find the number of reasonable size islands, based on comparing the volume of the large islands, to the next islands, to filter out islands made out of noise.
  4. Based on the number of reasonable size islands:
    1. If there are too few reasonable sized islands we decrease the upper limit, because we clearly thresholded too much: th_max=th_try
    2. If we have the right number of reasonable sized islands we decrease the upper limit, because even though it worked, we might have got away by thresholding a bit less: th_max=th_try.
    3. If less reasonable sized island than we expect, then we have to threshold more to separate the island, so: th_min=th_try
  5. We repeat steps 1-3 24 times.
  6. We repeat steps 2-3 a 25th time but using th_try=th_max. To make sure that if we ever where able to separate into the right number of islands, this will also be achieved in the last iteration, which is the one that we will used to do the final separation of the islands.

...