surkit.gradient package

Submodules

surkit.gradient.sobelfilter module

class surkit.gradient.sobelfilter.SobelFilter(imsize, correct=True)[source]

Bases: object

Get image gradient, only support pytorch now.

grad_h(image, filter_size=3)[source]

Get image gradient along horizontal direction, or x axis. Option to do replicate padding for image before convolution. This is mainly for estimate the du/dy, enforcing Neumann boundary condition.

Parameters:
  • image – input image; tensor

  • filter_size – different SobelFilter kernel size

Returns:

horizontal gradient

grad_v(image, filter_size=3)[source]

Get image gradient along vertical direction, or y axis. Option to do replicate padding for image before convolution. This is mainly for estimate the du/dx, enforcing Neumann boundary condition.

Parameters:
  • image – input image; tensor

  • filter_size – different SobelFilter kernel size

Returns:

horizontal gradient

Module contents