JuliaImages / ImageFiltering.jl

Julia implementations of multidimensional array convolution and nonlinear stencil operations
Other
99 stars 49 forks source link

2D Tophat (Disk) Kernel #165

Open mileslucas opened 4 years ago

mileslucas commented 4 years ago

This adds a 2D "tophat" kernel. This is geometrically just a disk. I'm not an images guy, per se, so if there is a more apt name than tophat, please inform me!

The two functions added to Kernel are

I've added a docstring and imported correctly under ImageFiltering.jl. I've added it to the Kernel module docstring, too. Unfortunately I'm not having a great time parsing the test suite, so I don't have any tests. Please let me know where I can test this.

mileslucas commented 4 years ago

Bumping this

jw3126 commented 4 years ago

I think this can be tested in a @testset "tophat" in test/2d.jl. Is this tophat function coming from matlab or somehow standard? There are a lot of variantions on how to turn a circle into pixels. E.g. constant value strictly inside, value proportional to circle area intersected with pixel etc.

mileslucas commented 4 years ago

This implementation is based off the skimage.draw.disk implementation which is used in the python library which inspired this PR.