|
libcrn
3.9.5
A document image processing library
|
Differential computation on images. More...
#include <CRNDifferential.h>
Public Types | |
| enum | RGBProjection { RGBProjection::ABSMAX, RGBProjection::SUM } |
Public Member Functions | |
| ~Differential ()=default | |
| Destructor. More... | |
| Differential (const Differential &)=delete | |
| Differential (Differential &&)=default | |
| Differential & | operator= (const Differential &)=delete |
| Differential & | operator= (Differential &&)=default |
| ImageDoubleGray & | GetLx () noexcept |
| Returns a reference to the internal x derivate. More... | |
| const ImageDoubleGray & | GetLx () const |
| Returns a reference to the internal x derivate. More... | |
| ImageDoubleGray & | GetLy () noexcept |
| Returns a reference to the internal y derivate. More... | |
| const ImageDoubleGray & | GetLy () const |
| Returns a reference to the internal y derivate. More... | |
| ImageDoubleGray & | GetLx2Ly2 () noexcept |
| Returns a reference to the internal first derivatives norm. More... | |
| const ImageDoubleGray & | GetLx2Ly2 () const |
| Returns a reference to the internal first derivatives norm. More... | |
| const ImageDoubleGray & | GetLxx () |
| Returns a reference to the internal xx derivate. More... | |
| const ImageDoubleGray & | GetLxy () |
| Returns a reference to the internal xy derivate. More... | |
| const ImageDoubleGray & | GetLyx () |
| Returns a reference to the internal yx derivate. More... | |
| const ImageDoubleGray & | GetLyy () |
| Returns a reference to the internal yy derivate. More... | |
| void | Diffuse (size_t maxiter, double maxdiv=std::numeric_limits< double >::max()) |
| Diffuses the gradient. More... | |
| ImageDoubleGray | MakeLw () |
| Returns the derivative of the normal to the isophotes. More... | |
| ImageDoubleGray | MakeLvv () |
| Returns the second derivative of the tangent to the isophote. More... | |
| ImageDoubleGray | MakeLww () |
| Returns the second derivative of the normal to the isophote. More... | |
| ImageDoubleGray | MakeLvw () |
| Returns the cross derivative of the tangent and normal to the isophote. More... | |
| ImageDoubleGray | MakeKappa1 () |
| Returns the first eigenvalue of the Hessian as an image. More... | |
| ImageDoubleGray | MakeKappa2 () |
| Returns the second eigenvalue of the Hessian as an image. More... | |
| ImageDoubleGray | MakeHessianCorner (double s=0.1) |
| Returns the Hessian corner image. More... | |
| ImageDoubleGray | MakeLaplacian () |
| Returns the Laplacian image. More... | |
| ImageDoubleGray | MakeIsophoteCurvature () |
| Returns the isophote curvature image. More... | |
| ImageDoubleGray | MakeFlowlineCurvature () |
| Returns the flowline curvature image. More... | |
| ImageDoubleGray | MakeEdge () |
| Returns the edge image. More... | |
| ImageDoubleGray | MakeCorner () |
| Returns the corner image. More... | |
| ImageDoubleGray | MakeGaussianCurvature () |
| Returns the Gaussian curvature image. More... | |
| ImageGradient | MakeImageGradient () |
| Returns the gradient image. More... | |
| ImageDoubleGray | MakeGradientModule () |
| Returns the gradient module image. More... | |
| ImageGray | MakeGradientCurvature () |
| Returns the gradient curvature image. More... | |
| ImageDoubleGray | MakeCanny () |
| Returns Canny's edge detector image. More... | |
| ImageDoubleGray | MakeDivergence () |
| Creates the continuous image skeleton. More... | |
| double | AutoThreshold () |
| Computes the best threshold for lx2ly2. More... | |
| double | GetThreshold () const noexcept |
| Gets the threshold for lx2ly2. More... | |
| void | SetThreshold (double d) noexcept |
| Sets the threshold for lx2ly2. More... | |
| bool | IsSignificant (size_t i) const noexcept |
| Is a pixel significant. More... | |
| bool | IsSignificant (size_t x, size_t y) const noexcept |
| Is a pixel significant. More... | |
| template<typename T > | |
| void | FillNonSignificant (Image< T > &img, T val=T(0)) const |
| Cleans an image of non-significant values. More... | |
Static Public Member Functions | |
| static Differential | NewGaussian (const ImageRGB &src, RGBProjection proj, double sigma) |
| Convolution with Gaussian derivatives. More... | |
| static Differential | NewHalfDiff (const ImageRGB &src, RGBProjection proj) |
| Alternate half derivatives. More... | |
| static Differential | NewHalfDiffAbsMax (const ImageRGB &src, RGBProjection proj) |
| AbsMax half derivatives. More... | |
| static Differential | NewHalfDiffAbsMin (const ImageRGB &src, RGBProjection proj) |
| AbsMin half derivatives. More... | |
| template<typename T > | |
| static Differential | NewGaussian (const Image< T > &src, double sigma) |
| Convolution with Gaussian derivatives. More... | |
| template<typename T > | |
| static Differential | NewHalfDiff (const Image< T > &src) |
| Alternate half derivatives. More... | |
| template<typename T > | |
| static Differential | NewHalfDiffAbsMax (const Image< T > &src) |
| AbsMax half derivatives. More... | |
| template<typename T > | |
| static Differential | NewHalfDiffAbsMin (const Image< T > &src) |
| AbsMin half derivatives. More... | |
| static Differential | NewGaussian (const ImageDoubleGray &src, double sigma) |
| Convolution with Gaussian derivatives. More... | |
| static Differential | NewHalfDiff (const ImageDoubleGray &src) |
| Alternate half derivatives. More... | |
| static Differential | NewHalfDiffAbsMax (const ImageDoubleGray &src) |
| AbsMax half derivatives. More... | |
| static Differential | NewHalfDiffAbsMin (const ImageDoubleGray &src) |
| AbsMin half derivatives. More... | |
Differential computation on images.
This class extracts differential features from an image.
Definition at line 50 of file CRNDifferential.h.
|
strong |
| Enumerator | |
|---|---|
| ABSMAX | |
| SUM | |
Definition at line 53 of file CRNDifferential.h.
|
default |
Destructor.
|
delete |
|
default |
| double Differential::AutoThreshold | ( | ) |
Computes the best threshold for lx2ly2.
Computes the best mingrad value
Definition at line 827 of file CRNDifferential.cpp.
| void Differential::Diffuse | ( | size_t | maxiter, |
| double | maxdiv = std::numeric_limits<double>::max() |
||
| ) |
Diffuses the gradient.
Diffuses the gradient. All other buffers are freed in order to be recomputed if needed.
| [in] | maxiter | Maximum number of iterations |
| [in] | maxdiv | Maximum divergence allowed to modify a pixel, value in ]0.0, 2.0] or >2 to always modify |
Definition at line 864 of file CRNDifferential.cpp.
|
inline |
Cleans an image of non-significant values.
| ExceptionDimension | wrong image dimensions |
| [in] | img | the image to clean |
| [in] | val | the value that represents non-significant pixels |
Definition at line 170 of file CRNDifferential.h.
|
inlinenoexcept |
Returns a reference to the internal x derivate.
Definition at line 94 of file CRNDifferential.h.
|
inline |
Returns a reference to the internal x derivate.
Definition at line 96 of file CRNDifferential.h.
|
inlinenoexcept |
Returns a reference to the internal first derivatives norm.
Definition at line 102 of file CRNDifferential.h.
|
inline |
Returns a reference to the internal first derivatives norm.
Definition at line 104 of file CRNDifferential.h.
| const ImageDoubleGray & Differential::GetLxx | ( | ) |
Returns a reference to the internal xx derivate.
Returns the x second derivate. Computes it if needed.
Definition at line 480 of file CRNDifferential.cpp.
| const ImageDoubleGray & Differential::GetLxy | ( | ) |
Returns a reference to the internal xy derivate.
Returns the xy derivate. Computes it if needed.
Definition at line 517 of file CRNDifferential.cpp.
|
inlinenoexcept |
Returns a reference to the internal y derivate.
Definition at line 98 of file CRNDifferential.h.
|
inline |
Returns a reference to the internal y derivate.
Definition at line 100 of file CRNDifferential.h.
| const ImageDoubleGray & Differential::GetLyx | ( | ) |
Returns a reference to the internal yx derivate.
Returns the yx derivate. Computes it if needed.
Definition at line 536 of file CRNDifferential.cpp.
| const ImageDoubleGray & Differential::GetLyy | ( | ) |
Returns a reference to the internal yy derivate.
Returns the y second derivate. Computes it if needed.
Definition at line 498 of file CRNDifferential.cpp.
|
inlinenoexcept |
Gets the threshold for lx2ly2.
Definition at line 158 of file CRNDifferential.h.
|
inlinenoexcept |
Is a pixel significant.
Definition at line 162 of file CRNDifferential.h.
|
inlinenoexcept |
Is a pixel significant.
Definition at line 164 of file CRNDifferential.h.
| ImageDoubleGray Differential::MakeCanny | ( | ) |
Returns Canny's edge detector image.
Canny's edge detector image
Definition at line 959 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeCorner | ( | ) |
Returns the corner image.
Returns the corner image. Lvv * Lw²
Definition at line 703 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeDivergence | ( | ) |
Creates the continuous image skeleton.
Creates a continuous skeleton from gradient divergence.
Definition at line 911 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeEdge | ( | ) |
Returns the edge image.
Returns the edge image. Lww / Lw
Definition at line 685 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeFlowlineCurvature | ( | ) |
Returns the flowline curvature image.
Returns the flowline curvature image. Lvw / Lw
Definition at line 667 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeGaussianCurvature | ( | ) |
Returns the Gaussian curvature image.
Returns the Gaussian curvature image. Lxx*Lyy - Lxy*Lyx
Definition at line 717 of file CRNDifferential.cpp.
| ImageGray Differential::MakeGradientCurvature | ( | ) |
Returns the gradient curvature image.
Returns the gradient curvature image
Definition at line 742 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeGradientModule | ( | ) |
Returns the gradient module image.
Returns the gradient module image
Definition at line 731 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeHessianCorner | ( | double | s = 0.1 | ) |
Returns the Hessian corner image.
Returns the Hessian corner image. Lxx*Lyy - Lxy*Lyx - s * (Lxx+Lyy)²
| [in] | s | a value between 0.04 and 0.15 |
Definition at line 808 of file CRNDifferential.cpp.
| ImageGradient Differential::MakeImageGradient | ( | ) |
Returns the gradient image.
Returns the gradient image
Definition at line 753 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeIsophoteCurvature | ( | ) |
Returns the isophote curvature image.
Returns the isophote curvature image. Lvv / Lw
Definition at line 649 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeKappa1 | ( | ) |
Returns the first eigenvalue of the Hessian as an image.
Returns the first eigenvalue of the Hessian as an image. (Lxx+Lyy + sqrt(|(Lxx+Lyy)² - 4*(Lxx*Lyy - Lxy*Lyx)|)) / 2
Definition at line 766 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeKappa2 | ( | ) |
Returns the second eigenvalue of the Hessian as an image.
Returns the second eigenvalue of the Hessian as an image. (Lxx+Lyy - sqrt(|(Lxx+Lyy)² - 4*(Lxx*Lyy - Lxy*Lyx)|)) / 2
Definition at line 787 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeLaplacian | ( | ) |
Returns the Laplacian image.
Returns the laplacian image. Lxx + Lyy
Definition at line 635 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeLvv | ( | ) |
Returns the second derivative of the tangent to the isophote.
Returns the second derivate of the tangent to the isophotes. (Lx²*Lyy + Ly²*Lxx - Lx*Ly*(Lxy + Lyx)) / (Lx² + Ly²) Computes it if needed.
Definition at line 568 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeLvw | ( | ) |
Returns the cross derivative of the tangent and normal to the isophote.
Returns the cross derivative of the tangent and the normal to the isophotes. (Lx*Ly*(Lyy-Lxx) + Lxy*Lx² - Lyx*Ly²) / (Lx² + Ly²) Computes it if needed.
Definition at line 612 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeLw | ( | ) |
Returns the derivative of the normal to the isophotes.
Returns the first derivate of the normal to the isophotes. sqrt(Lx²+Ly²). Computes it if needed.
Definition at line 554 of file CRNDifferential.cpp.
| ImageDoubleGray Differential::MakeLww | ( | ) |
Returns the second derivative of the normal to the isophote.
Returns the second derivative of the normal to the isophotes. (Lx²*Lxx + Ly²*Lyy + Lx*Ly*(Lxy + Lyx)) / (Lx² + Ly²) Computes it if needed.
Definition at line 590 of file CRNDifferential.cpp.
|
static |
Convolution with Gaussian derivatives.
Convolution with Gaussian derivatives.
| ExceptionDomain | sigma<0 |
| [in] | src | the image to derivate |
| [in] | proj | the method of projection from R, G and B derivatives to a single derivative. If proj = ABSMAX, the 2nd derivatives are not cached and will be approximated. |
| [in] | sigma | the standard deviation of the Gaussian (if null, the derivation convolutions are [-1 0 1] and [1 -2 1]) |
Definition at line 212 of file CRNDifferential.cpp.
|
inlinestatic |
Convolution with Gaussian derivatives.
Definition at line 64 of file CRNDifferential.h.
|
static |
Convolution with Gaussian derivatives.
Convolution with Gaussian derivatives
| ExceptionDomain | sigma<0 |
| [in] | src | the image to derivate |
| [in] | sigma | the standard deviation of the Gaussian (if null, the derivation convolutions are [-1 0 1] and [1 -2 1]) |
Definition at line 403 of file CRNDifferential.cpp.
|
static |
Alternate half derivatives.
Alternate half derivatives (left and top for 1st derivatives and right and bottom for 2nd derivatives)
| [in] | src | the image to derivate |
| [in] | proj | the method of projection from R, G and B derivatives to a single derivative |
Definition at line 253 of file CRNDifferential.cpp.
|
inlinestatic |
Alternate half derivatives.
Definition at line 67 of file CRNDifferential.h.
|
static |
Alternate half derivatives.
Alternate half derivatives (left and top for 1st derivatives and right and bottom for 2nd derivatives)
| [in] | src | the image to derivate |
Definition at line 413 of file CRNDifferential.cpp.
|
static |
AbsMax half derivatives.
AbsMax half derivatives. The 2nd derivatives are not cached and will be approximated.
| [in] | src | the image to derivate |
| [in] | proj | the method of projection from R, G and B derivatives to a single derivative |
Definition at line 299 of file CRNDifferential.cpp.
|
inlinestatic |
AbsMax half derivatives.
Definition at line 70 of file CRNDifferential.h.
|
static |
AbsMax half derivatives.
AbsMax half derivatives. The 2nd derivatives are not cached and will be approximated.
| [in] | src | the image to derivate |
Definition at line 430 of file CRNDifferential.cpp.
|
static |
AbsMin half derivatives.
AbsMin half derivatives. The 2nd derivatives are not cached and will be approximated.
| [in] | src | the image to derivate |
| [in] | proj | the method of projection from R, G and B derivatives to a single derivative |
Definition at line 350 of file CRNDifferential.cpp.
|
inlinestatic |
AbsMin half derivatives.
Definition at line 73 of file CRNDifferential.h.
|
static |
AbsMin half derivatives.
AbsMin half derivatives. The 2nd derivatives are not cached and will be approximated.
| [in] | src | the image to derivate |
Definition at line 449 of file CRNDifferential.cpp.
|
delete |
|
default |
|
inlinenoexcept |
Sets the threshold for lx2ly2.
Definition at line 160 of file CRNDifferential.h.
1.8.6