Skip to content
Discussion options

You must be logged in to vote

I agree, we should introduce convolution with arbitrary kernel.

We actually have something quite this already, but its in DetectEdges: You can provide there an DenseMatrix as a kernel.

@alan0428a: until we have something like this you could (miss-)use the EdgeDetection processor for your purpose:

DenseMatrix<float> kernel = new float[,]
{
    { 1,  2,  3,  2,  1 },
    { 2,  4,  5,  4,  2 },
    { 3,  5,  6,  5,  3 },
    { 2,  4,  5,  4,  2 },
    { 1, 2,  3,  2,  1 }
};
image.Mutate(img => img.DetectEdges(new EdgeDetectorKernel(kernel)));

I believe the kernel values need to be divided by the sum of the kernel values to actually make this a blur kernel.
Also you can provide to 1D kernel…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@alan0428a
Comment options

@antonfirsov
Comment options

Comment options

You must be logged in to vote
2 replies
@JimBobSquarePants
Comment options

@alan0428a
Comment options

Answer selected by alan0428a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants