6a4fa82792bddc6126eaf944956f49f0a0cb7ca7,kornia/filters/sobel.py,,sobel,#,199
Before Change
See :class:`~kornia.filters.Sobel` for details.
return Sobel(normalized, eps)(input)
After Change
raise TypeError("Input type is not a torch.Tensor. Got {}"
.format(type(input)))
if not len(input.shape) == 4:
raise ValueError("Invalid input shape, we expect BxCxHxW. Got: {}"
.format(input.shape))
// comput the x/y gradients
edges: torch.Tensor = spatial_gradient(input, normalized=normalized)
// unpack the edges
gx: torch.Tensor = edges[:, :, 0]
gy: torch.Tensor = edges[:, :, 1]
// compute gradient maginitude
magnitude: torch.Tensor = torch.sqrt(gx * gx + gy * gy + eps)
return magnitude
class SpatialGradient(nn.Module):
rComputes the first order image derivative in both x and y using a Sobel
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: kornia/filters/sobel.py
Class Name:
Method Name: sobel
Project Name: luispedro/mahotas
Commit Name: 7f5d55e309efbd0eee135ff5af520e3ddea310fb
Time: 2010-11-12
Author: lpc@cmu.edu
File Name: mahotas/freeimage.py
Class Name:
Method Name: _array_from_bitmap
Project Name: kwgoodman/numerox
Commit Name: 7cb19d316a24705ad57bb1169396449d7aa62636
Time: 2018-10-12
Author: kwgoodman@gmail.com
File Name: numerox/leaderboard.py
Class Name: Leaderboard
Method Name: __contains__