image-rs / imageproc

Image processing operations
MIT License
735 stars 145 forks source link

support grayscale morphology operators #576

Closed Morgane55440 closed 4 months ago

Morgane55440 commented 4 months ago

currently the operators in the morphology module only do binary operations (background = 0, foreground = 255).

but when doing morphological operations on actual operations, it is often necessary to do greyscale operations, using the whole range of values available.

i would like to propose to add greyscale variants of all the currently existing functions, as well as a Mask Struct to replace the Norm arguments, allowing for user defined masks.

if that is something that seems appropriate to add, i would love to work on the implementation myself.

see the wikipedia article on grayscale morphology

theotherphil commented 4 months ago

That would be a welcome addition - thanks!

theotherphil commented 4 months ago

Implemented in https://github.com/image-rs/imageproc/pull/581