mod_switchvar module#
- mod_switchvar.deriv1and2(h)#
- mod_switchvar.div(px, py)#
Calculates the divergence of a 2D field. For the specific application of image denoising, the calculation follows Chambolle (REF) ## BELOW, TO BE CLARIFIED The x component of M (Mx) first row is = to the first row of px. The x component of M (Mx) last row is = to - the before last row of px. (last one = 0) The y component of M (My) first column is = to the first column of py. The y component of M (My) last column is = to - the before last column of py. (last one = 0) ??#(de sorte que div=-(grad)^*) Parameters: two 2D ndarray Returns: 2D ndarray
- mod_switchvar.gradx(I)#
Calculates the gradient in the x-direction of an image I and gives as output M. In order to keep the size of the initial image the last row is left as 0s.
- mod_switchvar.grady(I)#
Calculates the gradient in the y-direction of an image I and gives as output M. In order to keep the size of the initial image the last column is left as 0s.
- mod_switchvar.laplacian(u)#
Calculates laplacian using the divergence and gradient functions defined in the module. Parameter: 2D ndarray Returns: 2D ndarray