Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Sobel Filters

Sobel image filters. More...

Functions

SIMD_API void SimdSobelDx (const uint8_t *src, size_t srcStride, size_t width, size_t height, uint8_t *dst, size_t dstStride)
 Calculates Sobel's filter along x axis. More...
 
SIMD_API void SimdSobelDxAbs (const uint8_t *src, size_t srcStride, size_t width, size_t height, uint8_t *dst, size_t dstStride)
 Calculates absolute value of Sobel's filter along x axis. More...
 
SIMD_API void SimdSobelDy (const uint8_t *src, size_t srcStride, size_t width, size_t height, uint8_t *dst, size_t dstStride)
 Calculates Sobel's filter along y axis. More...
 
SIMD_API void SimdSobelDyAbs (const uint8_t *src, size_t srcStride, size_t width, size_t height, uint8_t *dst, size_t dstStride)
 Calculates absolute value of Sobel's filter along y axis. More...
 
template<template< class > class A>
SIMD_INLINE void SobelDx (const View< A > &src, View< A > &dst)
 Calculates Sobel's filter along x axis. More...
 
template<template< class > class A>
SIMD_INLINE void SobelDxAbs (const View< A > &src, View< A > &dst)
 Calculates absolute value of Sobel's filter along x axis. More...
 
template<template< class > class A>
SIMD_INLINE void SobelDy (const View< A > &src, View< A > &dst)
 Calculates Sobel's filter along y axis. More...
 
template<template< class > class A>
SIMD_INLINE void SobelDyAbs (const View< A > &src, View< A > &dst)
 Calculates absolute value of Sobel's filter along y axis. More...
 

Detailed Description

Sobel image filters.

Function Documentation

◆ SimdSobelDx()

void SimdSobelDx ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
uint8_t *  dst,
size_t  dstStride 
)

Calculates Sobel's filter along x axis.

All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:
dst[x, y] = (src[x+1,y-1] + 2*src[x+1, y] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x-1, y] + src[x-1, y+1]).

Note
This function has a C++ wrappers: Simd::SobelDx(const View<A>& src, View<A>& dst).
Parameters
[in]src- a pointer to pixels data of the input image.
[in]srcStride- a row size of the input image.
[in]width- an image width.
[in]height- an image height.
[out]dst- a pointer to pixels data of the output image.
[in]dstStride- a row size of the output image (in bytes).

◆ SimdSobelDxAbs()

void SimdSobelDxAbs ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
uint8_t *  dst,
size_t  dstStride 
)

Calculates absolute value of Sobel's filter along x axis.

All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:

dst[x, y] = (src[x+1,y-1] + 2*src[x+1, y] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x-1, y] + src[x-1, y+1]).
Note
This function has a C++ wrappers: Simd::SobelDxAbs(const View<A>& src, View<A>& dst).
Parameters
[in]src- a pointer to pixels data of the input image.
[in]srcStride- a row size of the input image.
[in]width- an image width.
[in]height- an image height.
[out]dst- a pointer to pixels data of the output image.
[in]dstStride- a row size of the output image (in bytes).

◆ SimdSobelDy()

void SimdSobelDy ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
uint8_t *  dst,
size_t  dstStride 
)

Calculates Sobel's filter along y axis.

All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:

dst[x, y] = (src[x-1,y+1] + 2*src[x, y+1] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x, y-1] + src[x+1, y-1]);
Note
This function has a C++ wrappers: Simd::SobelDy(const View<A>& src, View<A>& dst).
Parameters
[in]src- a pointer to pixels data of the input image.
[in]srcStride- a row size of the input image.
[in]width- an image width.
[in]height- an image height.
[out]dst- a pointer to pixels data of the output image.
[in]dstStride- a row size of the output image (in bytes).

◆ SimdSobelDyAbs()

void SimdSobelDyAbs ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
uint8_t *  dst,
size_t  dstStride 
)

Calculates absolute value of Sobel's filter along y axis.

All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:

dst[x, y] = abs((src[x-1,y+1] + 2*src[x, y+1] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x, y-1] + src[x+1, y-1]));
Note
This function has a C++ wrappers: Simd::SobelDyAbs(const View<A>& src, View<A>& dst).
Parameters
[in]src- a pointer to pixels data of the input image.
[in]srcStride- a row size of the input image.
[in]width- an image width.
[in]height- an image height.
[out]dst- a pointer to pixels data of the output image.
[in]dstStride- a row size of the output image (in bytes).

◆ SobelDx()

void SobelDx ( const View< A > &  src,
View< A > &  dst 
)

Calculates Sobel's filter along x axis.

All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:

dst[x, y] = (src[x+1,y-1] + 2*src[x+1, y] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x-1, y] + src[x-1, y+1]).
Note
This function is a C++ wrapper for function SimdSobelDx.
Parameters
[in]src- an input image.
[out]dst- an output image.

◆ SobelDxAbs()

void SobelDxAbs ( const View< A > &  src,
View< A > &  dst 
)

Calculates absolute value of Sobel's filter along x axis.

All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:

dst[x, y] = abs((src[x+1,y-1] + 2*src[x+1, y] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x-1, y] + src[x-1, y+1])).
Note
This function is a C++ wrapper for function SimdSobelDxAbs.
Parameters
[in]src- an input image.
[out]dst- an output image.

◆ SobelDy()

void SobelDy ( const View< A > &  src,
View< A > &  dst 
)

Calculates Sobel's filter along y axis.

All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:

dst[x, y] = (src[x-1,y+1] + 2*src[x, y+1] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x, y-1] + src[x+1, y-1]);
Note
This function is a C++ wrapper for function SimdSobelDy.
Parameters
[in]src- an input image.
[out]dst- an output image.

◆ SobelDyAbs()

void SobelDyAbs ( const View< A > &  src,
View< A > &  dst 
)

Calculates absolute value of Sobel's filter along y axis.

All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:

dst[x, y] = abs((src[x-1,y+1] + 2*src[x, y+1] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x, y-1] + src[x+1, y-1]));
Note
This function is a C++ wrapper for function SimdSobelDyAbs.
Parameters
[in]src- an input image.
[out]dst- an output image.