knime-ip / knip

KNIME Image Processing Extension
https://www.knime.com/community/image-processing
49 stars 11 forks source link

Distance Map creates gradient image if no background present #465

Open imagejan opened 7 years ago

imagejan commented 7 years ago

The Distance Map node, when fed an entirely white (foreground-only) image, produces a gradient image with intensities I(y) = (w+h) + y, which can lead to misleading results.

Of course, when ignoring image borders, a foreground-only image is a pretty much undefined case, but I'd expect to get a flat image rather than an image that suggests any kind of directionality.

Here's an example workflow reproducing the issue: Distance Map Issue.zip

gudlap commented 6 years ago

Wouldn't adding the "Out of Bounds Strategy" (Zero-Value) to the Distance Map node actually solve this issue?

imagejan commented 6 years ago

Yes, allowing the user to specify the out-of-bounds strategy would definitely solve this. Also, defaulting to an extendBorder strategy would lead to a less surprising behavior for most use cases, I assume.