ReadFramework
|
Contains basic algorithms to manipulate images. More...
#include <Algorithms.h>
Public Types | |
enum | MorphShape { SQUARE = 0, DISK } |
enum | MorphBorder { BORDER_ZERO = 0, BORDER_FLIP } |
Static Public Member Functions | |
static cv::Mat | dilateImage (const cv::Mat &bwImg, int seSize, MorphShape shape=Algorithms::SQUARE, int borderValue=0) |
Dilates the image bwImg with a given structuring element. More... | |
static cv::Mat | erodeImage (const cv::Mat &bwImg, int seSize, MorphShape shape=Algorithms::SQUARE, int borderValue=255) |
Erodes the image bwimg with a given structuring element. More... | |
static cv::Mat | createStructuringElement (int seSize, int shape) |
Creates the structuring element for morphological operations. More... | |
static cv::Mat | convolveSymmetric (const cv::Mat &hist, const cv::Mat &kernel) |
Convolves a histogram symmetrically. Symmetric convolution means that the convolution is flipped around at the histograms borders. This is specifically useful for orientation histograms (since 0° corresponds to 360° More... | |
static cv::Mat | get1DGauss (double sigma) |
Computes a 1D Gaussian filter kernel. The kernel's size is adjusted to the standard deviation. More... | |
static cv::Mat | threshOtsu (const cv::Mat &srcImg, int thType=CV_THRESH_BINARY_INV) |
Threshold an image using Otsu as threshold. More... | |
static cv::Mat | convolveIntegralImage (const cv::Mat &src, const int kernelSizeX, const int kernelSizeY=0, MorphBorder norm=BORDER_ZERO) |
Convolves an integral image by means of box filters. This functions applies box filtering. It is specifically useful for the computation of image sums, mean filtering and standard deviation with big kernel sizes. More... | |
static void | setBorderConst (cv::Mat &src, float val=0.0f) |
Sets the border to a constant value (1 pixel width). More... | |
static void | invertImg (cv::Mat &srcImg, cv::Mat mask=cv::Mat()) |
Inverts the img. More... | |
static void | mulMask (cv::Mat &src, cv::Mat mask=cv::Mat()) |
Applies a mask to the image. More... | |
static cv::Mat | preFilterArea (const cv::Mat &img, int minArea, int maxArea=-1) |
Prefilters an binary image according to the blob size. Should be done to remove small blobs and to reduce the runtime of cvFindContours. More... | |
static cv::Mat | computeHist (const cv::Mat img, const cv::Mat mask=cv::Mat()) |
Computes the histogram of an image. More... | |
static double | getThreshOtsu (const cv::Mat &hist, const double otsuThresh=0) |
Gets the Otsu threshold based on a certain histogram. More... | |
static double | normAngleRad (double angle, double startIvl=0.0, double endIvl=2.0 *CV_PI) |
Computes the normalized angle within startIvl and endIvl. More... | |
static double | angleDist (double angle1, double angle2, double maxAngle=2.0 *CV_PI) |
Computes the distance between two angles. Hence, min(angleDiff, CV_PI*2-(angleDiff)) More... | |
static cv::Mat | estimateMask (const cv::Mat &src, bool preFilter=true) |
Estimates the mask. More... | |
static cv::Mat | rotateImage (const cv::Mat &src, double angleRad, int interpolation=cv::INTER_CUBIC, cv::Scalar borderValue=cv::Scalar(0)) |
Rotates an image according to the angle obtained. The new image bounds are minimized with respect to the angle obtained. positive angle values mean counterclockwise rotation More... | |
static double | logGammaLanczos (double x) |
Computes the natural logarithm of the absolute value of the gamma function of x using the Lanczos approximation. See http ://www.rskey.org/gamma.htm More... | |
static double | logGammaWindschitl (double x) |
Computes the natural logarithm of the absolute value of the gamma function of x using Windschitl method. More... | |
static double | logGamma (double x) |
Computes the natural logarithm of the absolute value of the gamma function of x.When x>15 use log_gamma_windschitl(), otherwise use log_gamma_lanczos(). More... | |
static int | doubleEqual (double a, double b) |
The resulting rounding error after floating point computations depend on the specific operations done.The same number computed by different algorithms could present different rounding errors.For a useful comparison, an estimation of the relative rounding error should be considered and compared to a factor times EPS.The factor should be related to the cumulated rounding error in the chain of computation.Here, as a simplification, a fixed factor is used. More... | |
static double | absAngleDiff (double a, double b) |
static double | signedAngleDiff (double a, double b) |
static QPointF | calcRotationSize (double angleRad, const QPointF &srcSize) |
Calculates the image size of the rotated image. More... | |
static double | min (const QVector< double > &vec) |
Returns the minimum of the vector or DBL_MAX if vec is empty. More... | |
static double | max (const QVector< double > &vec) |
Returns the maximum value of vec or -DBL_MAX if vec is empty. More... | |
template<typename numFmt > | |
static double | statMoment (const QList< numFmt > &valuesIn, double momentValue, int interpolated=1) |
Computes robust statistical moments (quantiles). More... | |
template<typename sFmt , typename mFmt > | |
static void | mulMaskIntern (cv::Mat src, const cv::Mat mask) |
template<typename sFmt > | |
static void | setBorderConstIntern (cv::Mat src, sFmt val) |
Contains basic algorithms to manipulate images.
|
static |
|
static |
Computes the distance between two angles. Hence, min(angleDiff, CV_PI*2-(angleDiff))
angle1 | The angle1. |
angle2 | The angle2. |
|
static |
Calculates the image size of the rotated image.
angleRad | The angle in radians. |
srcSize | Size of the source image. |
|
static |
Computes the histogram of an image.
img | The source img CV_32FC1. |
mask | The mask CV_8UC1 or CV_32FC1. |
|
static |
Convolves an integral image by means of box filters. This functions applies box filtering. It is specifically useful for the computation of image sums, mean filtering and standard deviation with big kernel sizes.
src | The integral image CV_64FC1. |
kernelSizeX | The box filter's size. |
kernelSizeY | The box filter's size. |
norm | If BORDER_ZERO an image sum is computed, if BORDER_FLIP a mean filtering is applied. |
|
static |
Convolves a histogram symmetrically. Symmetric convolution means that the convolution is flipped around at the histograms borders. This is specifically useful for orientation histograms (since 0° corresponds to 360°
hist | The histogram CV_32FC1. |
kernel | The convolution kernel CV_32FC1. |
|
static |
Creates the structuring element for morphological operations.
seSize | Size of the structuring element. |
shape | The shape (either Square or Disk). |
|
static |
Dilates the image bwImg with a given structuring element.
bwImg | The bwImg: a grayscale image CV_8U (or CV_32F [0 1] but slower). |
seSize | The structuring element's size. |
shape | The shape (either Square or Disk). |
borderValue | The border value. |
|
static |
The resulting rounding error after floating point computations depend on the specific operations done.The same number computed by different algorithms could present different rounding errors.For a useful comparison, an estimation of the relative rounding error should be considered and compared to a factor times EPS.The factor should be related to the cumulated rounding error in the chain of computation.Here, as a simplification, a fixed factor is used.
a | Input a |
b | Input b |
|
static |
Erodes the image bwimg with a given structuring element.
bwImg | The bwimg: a grayscale image CV_8U (or CV_32F [0 1] but slower). |
seSize | The structuring element's size. |
shape | The shape (either Square or Disk). |
borderValue | The border value. |
|
static |
Estimates the mask.
src | The source image. |
|
static |
Computes a 1D Gaussian filter kernel. The kernel's size is adjusted to the standard deviation.
sigma | The standard deviation of the Gaussian. |
|
static |
Gets the Otsu threshold based on a certain histogram.
hist | The histogram CV_32FC1. |
otsuThresh | The otsu threshold - deprecated. |
|
static |
Inverts the img.
srcImg | The source img CV_32FC1 [0 1] or CV_8UC1. |
mask | The mask. |
|
static |
Computes the natural logarithm of the absolute value of the gamma function of x.When x>15 use log_gamma_windschitl(), otherwise use log_gamma_lanczos().
x | The Input x. |
|
static |
Computes the natural logarithm of the absolute value of the gamma function of x using the Lanczos approximation. See http ://www.rskey.org/gamma.htm
x | Input value |
|
static |
Computes the natural logarithm of the absolute value of the gamma function of x using Windschitl method.
x | Input Value x |
|
static |
Returns the maximum value of vec or -DBL_MAX if vec is empty.
vec | A vector with double values. |
|
static |
Returns the minimum of the vector or DBL_MAX if vec is empty.
vec | A vector with double values. |
|
static |
Applies a mask to the image.
src | The source img CV_8U or CV_32F. |
mask | The optional mask CV_8U or CV_32F. |
|
inlinestatic |
|
static |
Computes the normalized angle within startIvl and endIvl.
angle | The angle in rad. |
startIvl | The intervals lower bound. |
endIvl | The intervals upper bound. |
|
static |
Prefilters an binary image according to the blob size. Should be done to remove small blobs and to reduce the runtime of cvFindContours.
img | The source img CV_8UC1. |
minArea | The blob size threshold in pixel. |
maxArea | The maximum area. |
|
static |
Rotates an image according to the angle obtained. The new image bounds are minimized with respect to the angle obtained. positive angle values mean counterclockwise rotation
src | The source image. |
angleRad | The angle in RAD. |
interpolation | The interpolation. |
borderValue | The border value. |
|
static |
Sets the border to a constant value (1 pixel width).
src | The source image CV_32F or CV_8U. |
val | The border value. |
|
inlinestatic |
|
static |
|
inlinestatic |
Computes robust statistical moments (quantiles).
valuesIn | The statistical set (samples). |
momentValue | The statistical moment value (0.5 = median, 0.25 and 0.75 = quartiles). |
interpolated | A flag if the value should be interpolated if the length of the list is even. |
|
static |
Threshold an image using Otsu as threshold.
srcImg | The source img CV_8UC1 or CV_8UC3. |