A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
sobel
ArrayFire Functions | ArrayFire Functions by Category » Image Processing » Filters

Sobel Operators More...

## Functions
AFAPI void | sobel (array &dx, array &dy, const array &img, const unsigned ker_size=3)
| C++ Interface for extracting sobel gradients.
AFAPI array | sobel (const array &img, const unsigned ker_size=3, const bool isFast=false)
| C++ Interface for sobel filtering.
AFAPI af_err | af_sobel_operator (af_array *dx, af_array *dy, const af_array img, const unsigned ker_size)
| C Interface for getting sobel gradients.

## Detailed Description

Sobel Operators

Sobel operators perform a 2-D spatial gradient measurement on an image to emphasize the regions of high spatial frequency, namely edges. A more in depth discussion on it can be found here.

## Function Documentation

## ◆ af_sobel_operator()

AFAPI af_err af_sobel_operator | ( | af_array * | dx,
|  | af_array * | dy,
|  | const af_array | img,
|  | const unsigned | ker_size )

C Interface for getting sobel gradients.

Parameters

  [out] | dx | is derivative along horizontal direction
  [out] | dy | is derivative along vertical direction
  [in] | img | is an array with image data
  [in] | ker_size | sobel kernel size or window size

Returns
  AF_SUCCESS if sobel derivatives are computed successfully, otherwise an appropriate error code is returned.

Note
  If `img` is 3d array, a batch operation will be performed.

## ◆ sobel() [1/2]

AFAPI void sobel | ( | array & | dx,
|  | array & | dy,
|  | const array & | img,
|  | const unsigned | ker_size = 3 )

C++ Interface for extracting sobel gradients.

Parameters

  [out] | dx | is derivative along horizontal direction
  [out] | dy | is derivative along vertical direction
  [in] | img | is an array with image data
  [in] | ker_size | sobel kernel size or window size

Note
  If `img` is 3d array, a batch operation will be performed.

Examples
  image_processing/filters.cpp.

## ◆ sobel() [2/2]

AFAPI array sobel | ( | const array & | img,
|  | const unsigned | ker_size = 3,
|  | const bool | isFast = false )

C++ Interface for sobel filtering.

Parameters

  [in] | img | is an array with image data
  [in] | ker_size | sobel kernel size or window size
  [in] | isFast | = true uses \(G=G_x+G_y\), otherwise \(G=\sqrt (G_x^2+G_y^2)\)

Returns
  an array with sobel gradient values

Note
  If `img` is 3d array, a batch operation will be performed.