22 #ifndef CRNDIFFERENTIAL_HEADER
23 #define CRNDIFFERENTIAL_HEADER
115 void Diffuse(
size_t maxiter,
double maxdiv = std::numeric_limits<double>::max());
173 throw ExceptionDimension(
"The image does not have the same dimensions as the differential.");
174 for (
auto tmp :
Range(img))
200 std::unique_ptr<std::mutex> lazydata;
double GetThreshold() const noexcept
Gets the threshold for lx2ly2.
ImageDoubleGray & GetLy() noexcept
Returns a reference to the internal y derivate.
Abstract class for images.
ScalarRange< T > Range(T b, T e)
Creates a range [[b, e[[.
ImageDoubleGray MakeCorner()
Returns the corner image.
ImageDoubleGray MakeHessianCorner(double s=0.1)
Returns the Hessian corner image.
ImageDoubleGray MakeLvv()
Returns the second derivative of the tangent to the isophote.
ImageDoubleGray & GetLx() noexcept
Returns a reference to the internal x derivate.
std::vector< pixel_type >::reference At(size_t x, size_t y) noexcept
Returns a reference to a pixel.
ImageDoubleGray MakeLww()
Returns the second derivative of the normal to the isophote.
const ImageDoubleGray & GetLxy()
Returns a reference to the internal xy derivate.
size_t GetHeight() const noexcept
ImageDoubleGray & GetLx2Ly2() noexcept
Returns a reference to the internal first derivatives norm.
ImageDoubleGray MakeEdge()
Returns the edge image.
ImageDoubleGray MakeIsophoteCurvature()
Returns the isophote curvature image.
ImageDoubleGray MakeKappa2()
Returns the second eigenvalue of the Hessian as an image.
const ImageDoubleGray & GetLx() const
Returns a reference to the internal x derivate.
static Differential NewHalfDiffAbsMax(const Image< T > &src)
AbsMax half derivatives.
bool IsSignificant(size_t x, size_t y) const noexcept
Is a pixel significant.
static Differential NewHalfDiffAbsMax(const ImageRGB &src, RGBProjection proj)
AbsMax half derivatives.
ImageDoubleGray MakeDivergence()
Creates the continuous image skeleton.
double AutoThreshold()
Computes the best threshold for lx2ly2.
const ImageDoubleGray & GetLy() const
Returns a reference to the internal y derivate.
~Differential()=default
Destructor.
static Differential NewHalfDiff(const ImageRGB &src, RGBProjection proj)
Alternate half derivatives.
static Differential NewGaussian(const ImageRGB &src, RGBProjection proj, double sigma)
Convolution with Gaussian derivatives.
Differential & operator=(const Differential &)=delete
const ImageDoubleGray & GetLxx()
Returns a reference to the internal xx derivate.
Image< double > ImageDoubleGray
double Grayscale image class
void FillNonSignificant(Image< T > &img, T val=T(0)) const
Cleans an image of non-significant values.
const ImageDoubleGray & GetLyx()
Returns a reference to the internal yx derivate.
static Differential NewGaussian(const Image< T > &src, double sigma)
Convolution with Gaussian derivatives.
static Differential NewHalfDiffAbsMin(const ImageRGB &src, RGBProjection proj)
AbsMin half derivatives.
ImageDoubleGray MakeCanny()
Returns Canny's edge detector image.
bool IsSignificant(size_t i) const noexcept
Is a pixel significant.
const ImageDoubleGray & GetLx2Ly2() const
Returns a reference to the internal first derivatives norm.
Gradient image in polar form.
Differential(const Differential &)=delete
ImageDoubleGray MakeKappa1()
Returns the first eigenvalue of the Hessian as an image.
ImageDoubleGray MakeFlowlineCurvature()
Returns the flowline curvature image.
size_t GetWidth() const noexcept
ImageGradient MakeImageGradient()
Returns the gradient image.
static Differential NewHalfDiff(const Image< T > &src)
Alternate half derivatives.
ImageDoubleGray MakeGaussianCurvature()
Returns the Gaussian curvature image.
ImageGray MakeGradientCurvature()
Returns the gradient curvature image.
CRN_ALIAS_SMART_PTR(ImageBW)
Differential computation on images.
void SetThreshold(double d) noexcept
Sets the threshold for lx2ly2.
ImageDoubleGray MakeLw()
Returns the derivative of the normal to the isophotes.
ImageDoubleGray MakeLaplacian()
Returns the Laplacian image.
ImageDoubleGray MakeLvw()
Returns the cross derivative of the tangent and normal to the isophote.
void Diffuse(size_t maxiter, double maxdiv=std::numeric_limits< double >::max())
Diffuses the gradient.
static Differential NewHalfDiffAbsMin(const Image< T > &src)
AbsMin half derivatives.
ImageDoubleGray MakeGradientModule()
Returns the gradient module image.
const ImageDoubleGray & GetLyy()
Returns a reference to the internal yy derivate.