0

I'm trying to use a kernel filter in my custom loss, to help to identify pixels continuity (lines).

I want to apply this kernel to value line-like shapes and depreciate blocks of pixels.

For example, I want to use kernels for image processing, like this link of Wikipedia.

https://en.wikipedia.org/wiki/Kernel_(image_processing)

Then, my idea is to use a kernel that steps over the tensor, with stride 1 and padding 1, like it happens with a convolution operation.

But I don't know how to do that or if it is possible.

I tried to use regular operations, like pad, foldl and roll, but I don't know if it is the correct and best way to do it.

Best regards,

Felipe Reis
  • 41
  • 1
  • 7
  • This [answer](https://stackoverflow.com/questions/42883547/intuitive-understanding-of-1d-2d-and-3d-convolutions-in-convolutional-neural-n/59099278#59099278) explains how you can do that. Refer the `2D Convolution` section. – thushv89 Dec 06 '19 at 23:51
  • Read the backend documentation for keras, search for `conv2d` functions. – Daniel Möller Dec 07 '19 at 03:20

0 Answers0