dog

arrayfire.dog(image: Array, radius1: int, radius2: int, /) Array

Performs the Difference of Gaussians (DoG) operation on an image. This operation is a band-pass filter that highlights regions of an image with high spatial frequency, which correspond to edges. Typically used in edge detection and as a preprocessing step in feature extraction algorithms like SIFT.

Parameters

imageArray

The input image as a 2D ArrayFire array.

radius1int

The radius of the first Gaussian blur kernel. This parameter indirectly controls the sigma (standard deviation) of the Gaussian function, with a larger radius resulting in a more significant blur.

radius2int

The radius of the second Gaussian blur kernel. As with radius1, this parameter controls the degree of blur, but typically radius2 > radius1 to ensure a broader range of spatial frequencies are captured.

Returns

Array

An ArrayFire array containing the result of the DoG operation. The output array highlights edges and transitions in the input image, with higher intensity values corresponding to stronger edges.

Note

The effective sigma values for the Gaussian blurs are calculated as 0.25 * radius, where the radius is the parameter passed to the function. The DoG operation is sensitive to the choice of radius parameters, which should be chosen based on the specific requirements of the application and the characteristics of the input image.