Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::Gradient Namespace Reference

Computes image gradients. More...

Functions

template<class D >
Image< D > Canny (const Image< D > &suppressed_sobel, float lower_threshold, float higher_threshold)
 Returns Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0. More...
 
template<class D >
Image< D > Canny (const Image< D > &img, float lower_threshold, float higher_threshold, float sigma)
 Returns Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0. More...
 
template<class D >
Image< D > NonMaxSobelSuppression (const Image< D > &img)
 Returns the sobel magnitude image with non-maximum intensities suppressed. More...
 
template<class D >
Image< D > NonMaxSobelSuppression (const Image< D > &magnitude, const Image< int > &direction)
 Returns the sobel magnitude image with non-maximum intensities suppressed. More...
 
template<class D >
Image< D > Directional (const Image< D > &img, const Adjacency &adj)
 Returns a gradient composed by the sum of differences between a pixel and its adjacents. More...
 
template<class D >
void Gabor (const Image< D > &img, float sigma, Image< D > *magnitude=nullptr, Image< int > *direction=nullptr)
 Returns the directional Gabor filter over image. More...
 
template<class D >
Image< D > Morphological (const Image< D > &image)
 Computes the gradient image (dilation - erosion) using spherical adjacency relation of one pixel of radius. More...
 
template<class D >
Image< D > Morphological (const Image< D > &image, const Adjacency &adjacency)
 Computes the gradient image. More...
 
template<class D >
Image< D > CloseHoles (const Image< D > &canny)
 Returns Canny gradient with one pixel wide holes closed. More...
 
template<class D >
void RemoveRedundantPoint (Image< D > &canny)
 Removes redundant points from components leaving the minimal width components. More...
 
template<class D >
void RemoveBifurcation (Image< D > &canny)
 Removes points of bifurcation. It tries to keep straighter lines when possible. More...
 
Vector< size_t > Extremities (const Image< int > &label)
 Gets one of the extremities of each segment. More...
 
template<class D >
void RemoveSmallSegments (Image< D > &canny, size_t min_seg_size)
 Removes the edges that are smaller than the given size. More...
 
template<class D >
Image< D > ScaleCanny (const Image< D > &img, size_t window_scale, float lower_threshold, float higher_threshold)
 Returns a scaled Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0. More...
 
template<class D >
Image< D > SubScaleCanny (const Image< D > &img, const Image< D > &base_grad, size_t window_scale, float lower_threshold)
 Returns a sub scaled Canny edge detection image. Lower threshold as a frequency from 0.0 to 1.0. More...
 
template<class D >
Image< D > MultiScaleCanny (const Image< D > &img, float lower_threshold, float higher_threshold, float sigma, size_t scales)
 Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0. More...
 
template<class D >
Image< D > MultiSubScaleCanny (const Image< D > &img, float lower_threshold, float higher_threshold, float sigma, size_t scales)
 Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0. More...
 
template<class D >
Image< D > MultiScaleSizeCanny (const Image< D > &img, float lower_threshold, float higher_threshold, float sigma, size_t scales, float fraction)
 Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0. More...
 
template<class D >
Image< D > DirectionalSobel (const Image< D > &img, size_t direction)
 Returns the directional Sobel filter over image. More...
 
template<class D >
void Sobel (const Image< D > &img, Image< D > *magnitude=nullptr, Image< int > *direction=nullptr)
 Returns the directional Sobel filter over image. More...
 

Detailed Description

Computes image gradients.

Function Documentation

template<class D >
Image< D > Bial::Gradient::Canny ( const Image< D > &  suppressed_sobel,
float  lower_threshold,
float  higher_threshold 
)

Returns Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0.

Date
2013/Nov/21
Parameters
suppressed_sobelSuppressed gradient image given.
lower_thresholdLower hysteresis threshold.
higher_thresholdHigher hysteresis threshold.
Returns
Canny edge detection image.
Warning
none.
template<class D >
Image< D > Bial::Gradient::Canny ( const Image< D > &  img,
float  lower_threshold,
float  higher_threshold,
float  sigma 
)

Returns Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0.

Date
2013/Nov/21
Parameters
imgInput image.
lower_thresholdLower hysteresis threshold.
higher_thresholdHigher hysteresis threshold.
sigmaStandard deviation of Gaussian filter.
Returns
Canny edge detection image.
Warning
none.
template<class D >
Image< D > Bial::Gradient::CloseHoles ( const Image< D > &  canny)

Returns Canny gradient with one pixel wide holes closed.

Date
2015/Apr/10
Parameters
cannyInput Canny gradient image.
Returns
none.
Warning
none.
template<class D >
Image< D > Bial::Gradient::Directional ( const Image< D > &  img,
const Adjacency adj 
)

Returns a gradient composed by the sum of differences between a pixel and its adjacents.

Date
2013/Dec/19
Parameters
imgInput image.
adjAn adjacency relation.
Returns
Gradient composed by the sum of differences between a pixel and its adjacents.
Warning
none.
template<class D >
Image< D > Bial::Gradient::DirectionalSobel ( const Image< D > &  img,
size_t  direction 
)

Returns the directional Sobel filter over image.

Date
2013/Nov/22
Parameters
imgInput image.
directionOne of the dimensions of the input image.
Returns
Directional Sobel filter over image.
Warning
none.
Vector< size_t > Bial::Gradient::Extremities ( const Image< int > &  label)

Gets one of the extremities of each segment.

Date
2015/Jul/08
Parameters
labelAn image containing labeled Canny gradient segments.
Returns
Vector with pixel indexs containing one extremity of each component.
Warning
Only implemented for 2D images.
template<class D >
void Bial::Gradient::Gabor ( const Image< D > &  img,
float  sigma,
Image< D > *  magnitude = nullptr,
Image< int > *  direction = nullptr 
)

Returns the directional Gabor filter over image.

Date
2015/Jun/03
Parameters
imgInput image.
sigmaStandard deviation of the Gaussian.
magnitudeGabor magnitude image.
directionOutput Gabor direction image.
Returns
Directional Gabor filter over image.
Warning
none.
template<class D >
Image< D > Bial::Gradient::Morphological ( const Image< D > &  image)

Computes the gradient image (dilation - erosion) using spherical adjacency relation of one pixel of radius.

Date
2012/Sep/21
Parameters
imageInput image.
Returns
Gradient image.
Warning
none.
template<class D >
Image< D > Bial::Gradient::Morphological ( const Image< D > &  image,
const Adjacency adjacency 
)

Computes the gradient image.

Date
2012/Sep/21
Parameters
imageInput image.
adjacencyAdjacency relation used by dilation and erosion opperations.
Returns
Gradient image.
Warning
none.
template<class D >
Image< D > Bial::Gradient::MultiScaleCanny ( const Image< D > &  img,
float  lower_threshold,
float  higher_threshold,
float  sigma,
size_t  scales 
)

Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0.

Date
2015/Jan/26
Parameters
imgInput image.
lower_thresholdLower hysteresis threshold.
higher_thresholdHigher hysteresis threshold.
sigmaStandard deviation of Gaussian filter.
scalesNumber of scales to run Canny.
Returns
Multi scale Canny edge detection image.
Warning
none.
template<class D >
Image< D > Bial::Gradient::MultiScaleSizeCanny ( const Image< D > &  img,
float  lower_threshold,
float  higher_threshold,
float  sigma,
size_t  scales,
float  fraction 
)

Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0.

Date
2015/Jun/02
Parameters
imgInput image.
lower_thresholdLower hysteresis threshold.
higher_thresholdHigher hysteresis threshold.
sigmaStandard deviation of Gaussian filter.
scalesNumber of scales to run Canny.
fractionFraction of the maximum size edge that specifies the minimum edge size. (0.0, 1.0)
Returns
Multi scale Canny edge detection image.
Warning
none.
template<class D >
Image< D > Bial::Gradient::MultiSubScaleCanny ( const Image< D > &  img,
float  lower_threshold,
float  higher_threshold,
float  sigma,
size_t  scales 
)

Returns multi scale Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0.

Date
2015/Jan/27
Parameters
imgInput image.
lower_thresholdLower hysteresis threshold.
higher_thresholdHigher hysteresis threshold.
sigmaStandard deviation of Gaussian filter.
scalesNumber of scales to run Canny.
Returns
Multi scale Canny edge detection image.
Warning
none.
template<class D >
Image< D > Bial::Gradient::NonMaxSobelSuppression ( const Image< D > &  img)

Returns the sobel magnitude image with non-maximum intensities suppressed.

Date
2013/Aug/08
Parameters
imgInput image.
Returns
Sobel magnitude image with non-maximum intensities suppressed.
Warning
none.
template<class D >
Image< D > Bial::Gradient::NonMaxSobelSuppression ( const Image< D > &  magnitude,
const Image< int > &  direction 
)

Returns the sobel magnitude image with non-maximum intensities suppressed.

Date
2013/Aug/08
Parameters
magnitudeSobel magnitude image.
directionSobel magnitude direction.
Returns
Sobel magnitude image with non-maximum intensities suppressed.
Warning
none.
template<class D >
void Bial::Gradient::RemoveBifurcation ( Image< D > &  canny)

Removes points of bifurcation. It tries to keep straighter lines when possible.

Date
2015/Jul/08
Parameters
cannyA Canny gradient image.
Returns
none.
Warning
Only implemented for 2D images.
template<class D >
void Bial::Gradient::RemoveRedundantPoint ( Image< D > &  canny)

Removes redundant points from components leaving the minimal width components.

Date
2015/Jul/08
Parameters
cannyA Canny gradient image.
Returns
none.
Warning
Only implemented for 2D images.
template<class D >
void Bial::Gradient::RemoveSmallSegments ( Image< D > &  canny,
size_t  min_seg_size 
)

Removes the edges that are smaller than the given size.

Date
2015/Apr/29
Parameters
cannyA Canny gradient image.
min_seg_sizeMinimum size of a segment.
Returns
none.
Warning
none.
template<class D >
Image< D > Bial::Gradient::ScaleCanny ( const Image< D > &  img,
size_t  window_scale,
float  lower_threshold,
float  higher_threshold 
)

Returns a scaled Canny edge detection image. Lower and higher threshold as frequencies from 0.0 to 1.0.

Date
2014/Jun/09
Parameters
imgInput image.
window_scaleScale by which image is divided to generate the window.
lower_thresholdLower hysteresis threshold.
higher_thresholdHigher hysteresis threshold.
Returns
Scaled Canny edge detection image.
Warning
none.
template<class D >
void Bial::Gradient::Sobel ( const Image< D > &  img,
Image< D > *  magnitude = nullptr,
Image< int > *  direction = nullptr 
)

Returns the directional Sobel filter over image.

Date
2013/Nov/22
Parameters
imgInput image.
magnitudeSobel magnitude image.
directionOutput Sobel direction image.
Returns
Directional Sobel filter over image. The directions are coded: 2D and 3D: No-dir:0 E:1 W:2 S:4 SE:5 SW:6 N:8 NE:9 NW:10 3D: U:16 UE:17 UW:18 US:20 NSE:21 USW:22 UN:24 UNE:25 UNW:26 3D: D:32 DE:33 DW:34 DS:36 DSE:37 DSW:38 DN:40 DNE:41 DNW:42
Warning
none.
template<class D >
Image< D > Bial::Gradient::SubScaleCanny ( const Image< D > &  img,
const Image< D > &  base_grad,
size_t  window_scale,
float  lower_threshold 
)

Returns a sub scaled Canny edge detection image. Lower threshold as a frequency from 0.0 to 1.0.

Date
2015/Jan/27
Parameters
imgInput image.
base_gradGradient from higher levels with greater windows.
window_scaleScale by which image is divided to generate the window.
lower_thresholdLower hysteresis threshold.
Returns
Sub scaled Canny edge detection image.
Warning
none.