imageproc icon indicating copy to clipboard operation
imageproc copied to clipboard

add a general nxm convolution filter (a generalization of filter3x3)

Open vsuryamurthy opened this issue 2 years ago • 6 comments

This PR is a generalization of the filter3x3 and extends to odd shaped kernels of dimensions nxm.

vsuryamurthy avatar Apr 17 '23 14:04 vsuryamurthy

Maybe we can just call it filter? 🤔 Although this is already inside a module called filter.

cospectrum avatar Mar 12 '24 00:03 cospectrum

Or we can expose it to users as a Kernel method. clamped_filter, for example.

cospectrum avatar Mar 12 '24 00:03 cospectrum

Sure, either works. What would be the prefernce?

vsuryamurthy avatar Mar 14 '24 08:03 vsuryamurthy

Sure, either works. What would be the prefernce?

Let's ask the owner @theotherphil. Do you have any preferences or maybe some criticism of this pr?

cospectrum avatar Mar 14 '24 09:03 cospectrum

The strange thing is that this only works for odd sizes. I have an implementation of 2d convolution in Rust via "Im2Col" and matrix multiplication (compatible with torch), and the kernels are of any size.

cospectrum avatar Mar 14 '24 09:03 cospectrum

Thanks for the PR. I’m not sure about the filternxm function - filter3x3 exists mainly because it initially had a special cased implementation. I’d accept a PR to add a clamped_filter function to Kernel.

theotherphil avatar Mar 14 '24 19:03 theotherphil