ximgproc_anisotropicDiffusion
import { ximgproc_anisotropicDiffusion } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Performs anisotropic diffusion on an image.
The function applies Perona-Malik anisotropic diffusion to an image. This is the solution to the partial differential equation:
{\frac {\partial I}{\partial t}}={\mathrm {div}}\left(c(x,y,t)\nabla I\right)=\nabla c\cdot \nabla I+c(x,y,t)\Delta I
Suggested functions for c(x,y,t) are:
c\left(\|\nabla I\|\right)=e^{{-\left(\|\nabla I\|/K\right)^{2}}}
or
c\left(\|\nabla I\|\right)={\frac {1}{1+\left({\frac {\|\nabla I\|}{K}}\right)^{2}}}
ximgproc_anisotropicDiffusion(src: Mat, dst: Mat, alpha: number, K: number, niters: number): void;srcSource image with 3 channels.
dstOutput destination, filled by the native operation. Destination image of the same size and the same number of channels as src .
alphaThe amount of time to step forward by on each iteration (normally, it's between 0 and 1).
Ksensitivity to the edges
nitersThe number of iterations
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.