jactorch.vision.gradient#

Classes

Functions

image_gradient(image[, return_angle])

laplacian(image)

scharr(image[, norm])

sobel(image[, kernel_size, norm])

Class ImageGradient

class ImageGradient[source]#

Bases: Module

__init__()[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(image, return_angle=False)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Class Laplacian

class Laplacian[source]#

Bases: CustomKernel

__init__()[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(input)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Class Scharr

class Scharr[source]#

Bases: SobelBase

__init__(norm=1)[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(image, return_angle=False)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Class Sobel

class Sobel[source]#

Bases: SobelBase

__init__(kernel_size=3, norm=1)[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(image, return_angle=False)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Class SobelBase

class SobelBase[source]#

Bases: Module

__init__(kernel_x, kernel_y, norm=1)[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(image, return_angle=False)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Functions

image_gradient(image, return_angle=False)[source]#
laplacian(image)[source]#
scharr(image, norm=1)[source]#
sobel(image, kernel_size=3, norm=1)[source]#