Type: Feature Enhancement / Band-Pass Filter
Library: OpenCV (cv2.subtract)
Application: Edge & Blob Detection
The Difference of Gaussians (DoG) is a feature enhancement algorithm that involves the subtraction of one blurred version of an original image from another, less blurred version of the original. This mimics how the human retina processes visual information to extract edges.
The DoG function is obtained by subtracting two Gaussian kernels with different standard deviations, σ1 and σ2.
Where σ1 < σ2. This operation acts as a band-pass filter, removing high-frequency noise (via the blurring) and low-frequency uniform backgrounds (via the subtraction), leaving only the structural edges and blobs.
On the ImageStylo server, we process this using matrix subtraction. We allow the user to define independent sigma values for the X and Y axes, enabling the detection of directional features.
Note: We normalize the result to the 0-255 range to ensure the output is visible as an image.
DoG is computationally efficient because the Gaussian blur operation is separable. A 2D Gaussian convolution can be performed as two 1D convolutions (one horizontal, one vertical).
This makes DoG a much faster alternative to the "Laplacian of Gaussian" (LoG) operator while providing nearly identical results for blob detection tasks.
Try the DoG Tool:
Launch Live Tool