8000 h_maxima/minima strange behaviors on floating point image input · Issue #4194 · scikit-image/scikit-image · GitHub
[go: up one dir, main page]

Skip to content
h_maxima/minima strange behaviors on floating point image input #4194
@w-hc

Description

@w-hc

Description

I have been trying to use the h_maxima implementation but this function seems to exhibit unstable behaviors. For example,

  1. when the input is all zeros, h_maxima returns a marker filled with all 1s. This seems incorrect.

  2. Also, when my input consists of floating point values, and h set to a floating point threshold, even with a slight 0.1 change in h value, the number of detected instances can vary quite a bit.

Way to reproduce

img = np.zeros((10, 10), dtype=float)
marker = h_maxima(img, h=1)
print(np.unique(marker))

Version information

# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print("scikit-image version: {}".format(skimage.__version__))
import numpy; print("numpy version: {}".format(numpy.__version__))
3.6.8 |Anaconda custom (64-bit)| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0]
Linux-3.10.0-957.5.1.el7.x86_64-x86_64-with-centos-7.6.1810-Core
scikit-image version: 0.15.0
numpy version: 1.16.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚠️ PriorityThis issue or PR should be given priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0