|
Core 1.0
|
A base two-dimensional field of real values. More...
#include <scalarfield.h>
Public Member Functions | |
| ScalarField2 () | |
| Empty. | |
| ScalarField2 (const Array2 &, const double &=0.0) | |
| Create the field structure. | |
| ScalarField2 (const Box2 &, int, int, const double &=0.0) | |
| Create the field structure. | |
| ScalarField2 (const Box2 &, int, int, const QVector< double > &) | |
| Create the field structure. | |
| ScalarField2 (const Box2 &, const QImage &, const double &=0.0, const double &=256.0 *256.0 - 1.0, bool=true) | |
| Create a field structure from an image. | |
| ScalarField2 (const QImage &, const double &=1.0, const double &=1.0, bool=true) | |
| Create a field structure from an image. | |
| ScalarField2 (const QString &, double=0.0, double=1.0) | |
| Create a field structure from an image. | |
| ScalarField2 (const Array2I &) | |
| Create a ScalarField2 from an Integer Array (int). | |
| ScalarField2 (const Array2I &, const std::vector< double > &) | |
| Create a ScalarField2 from an Integer Array (int) with a lookup table for the double values. | |
| virtual | ~ScalarField2 () |
| Empty. | |
| Array2 | GetArray () const |
| Return the array representing the grid domain. | |
| void | GetRange (double &, double &) const |
| Get the range of the field. | |
| Ia | GetQQRange () const |
| Get the range of the field. | |
| double | Integral () const |
| Get the integral of the scalar field. | |
| double | Sum () const |
| Compute the sum of the elements in the scalar field. | |
| double | Average () const |
| Compute the average value of the elements in the scalar field. | |
| double | ScaledNorm () const |
| Compute the Euclidean norm of the scalar field, divided by the number of samples. | |
| void | Symmetry (bool=true, bool=false) |
| Perform a symmetry. | |
| void | Rotate () |
| Counter-clockwise rotation, keep the center of the domain unchanged. | |
| Histogram | GetHistogram (int) const |
| Compute the histogram of the scalar field. | |
| Histogram | GetHistogram (int, double, double) const |
| Compute the histogram of the scalar field. | |
| QVector< std::pair< double, int > > | OldHistogram (int) const |
| Compute a histogram. | |
| QVector< std::pair< double, int > > | CumulativeHistogram (int) const |
| Compute a cumulative histogram. | |
| QVector< std::pair< double, double > > | CumulativeNormedHistogram (int) const |
| Compute a normalized cumulative histogram. | |
| void | HistogramTransfer (const Histogram &) |
| Transfer the distribution of values of a histogram to the field. | |
| std::vector< double > | GetPercentiles (const std::vector< double > &) const |
| Compute the values of the field at given percentiles. | |
| virtual Vector2 | Gradient (int, int) const |
| Compute the gradient at a given array vertex. | |
| virtual Vector2 | GradientSmooth (int, int) const |
| Compute the smooth gradient at a given array vertex using a second order approximation. | |
| virtual Matrix2 | Hessian (int, int) const |
| Compute the hessian at a given array vertex. | |
| virtual double | Value (int, int) const |
| Return the field value at a given array vertex. | |
| virtual double | K () const |
| Compute the Lipschitz constant of the elevation function. | |
| void | CutEpsilon (const double &=1e-6) |
| Set all values in the field that are lower than epsilon to true zero. | |
| double | at (int, int) const |
| Return the field value at a given array vertex. | |
| double | at (const QPoint &) const |
| Return the field value at a given array vertex. | |
| double & | operator() (int, int) |
| Return the field value at a given array vertex. | |
| double & | operator() (const QPoint &) |
| Return the field value at a given array vertex. | |
| double | at (int) const |
| Return the data in the field. | |
| double & | operator[] (int) |
| Return the data in the field. | |
| double | StandardDeviation () const |
| Compute the standard deviation. | |
| double | StandardDeviation (const double &) const |
| Compute the standard deviation. | |
| QImage | CreateImage (bool=true) const |
| Create an image from the field. | |
| QImage | CreateImage (const AnalyticPalette &, bool=false, bool=false) const |
| Create an image from the field using a palette. | |
| QImage | CreateImage (const double &, const double &, const AnalyticPalette &, bool=false) const |
| Create an image from the field using a palette. | |
| QImage | CreateImage (const Palette &) const |
| Create an image from the field using a palette. | |
| QImage | CreateImage (const double &, const double &, const GenericPalette &, bool=false) const |
| Create an image from the field using a palette. | |
| QImage | CreateImage (const GenericPalette &) const |
| Create an image from the field using a palette. | |
| QImage | CreateImage (const double &, const double &, bool=true) const |
| Create an image from the field. | |
| bool | ExportPGM (const QString &) const |
| Export the scalarfield as a PGM file in 16 bits. | |
| bool | ExportPGM (const QString &, const double &, const double &) const |
| Export the scalarfield as a PGM file in 16 bits. | |
| ScalarField2 | Resized (int, int, bool=false) const |
| Change the resolution of the scalar field. | |
| ScalarField2 | Sample (const Box2 &, int, int, bool=false) const |
| Resample a rectangular region in the scalar field. | |
| ScalarField2 | Sample (const Segment2 &, const double &, int, int) const |
| Sample along a thick segment. | |
| ScalarField2 | Sample (const Segment2 &, const double &) const |
| Sample along a thick segment. | |
| ScalarField2 | Crop (const QPoint &, const QPoint &) const |
| Crops a rectangular region in the scalar field. | |
| ScalarField2 | DownSample (int) const |
| Lower the resolution of the scalarfield. | |
| ScalarField2 | UpSample (int, bool=false) const |
| Upsampling of the scalarfield. | |
| virtual double | Value (const Vector2 &) const |
| Get the field value at a given point. | |
| virtual double | Triangular (const Vector2 &) const |
| Get the field value with world coordinate system. | |
| virtual double | BiCubic (const Vector2 &) const |
| Get the field value with world coordinate system. | |
| virtual double | BiCubicValue (const Vector2 &) const |
| Compute the bicubic interpolation. | |
| virtual double | Closest (const Vector2 &) const |
| Compute the value of the field at the closest grid point. | |
| ScalarField2 | SummedAreaTable () const |
| Compute the summed area table of a scalar field. | |
| void | Fill (const double &) |
| Sets the entire field with a constant value. | |
| void | Subdivide () |
| Subdivide the scalar field. | |
| void | Smooth (const Vector2 &, double) |
| Smooth the scalar field within a given region. | |
| void | Flatten (const Vector2 &, const double &, const double &=0.25) |
| Flatten the scalar field. | |
| void | Multiply (const Vector2 &, const double &, const double &=1.0) |
| Multiply the scalar field by a scaling factor locally (not equivalent to Flatten()). | |
| void | Level (const Vector2 &, const double &, const double &) |
| Level the scalar field. | |
| void | Gaussian (const Vector2 &, const double &, const double &) |
| Add material with a Gaussian distribution. | |
| void | Add (const Vector2 &, const double &) |
| Add a value to the scalar field with diffusion. | |
| ScalarField2 | MedianFiltered () const |
| Compute the median filtered scalar field. | |
| void | Smooth () |
| Smooth the scalar field using a discrete gaussian kernel. | |
| void | Smooth (int) |
| Applies several smoothing steps to the scalar field. | |
| void | Blur () |
| Blurs the scalar field. | |
| void | Blur (int) |
| Applies several blurring steps to the scalar field. | |
| void | SmoothSmall () |
| Small smoothing of the scalar field using a discrete gaussian kernel. | |
| void | MedianFilter () |
| Filter the field in place with a median filter. | |
| ScalarField2 | GaussianBlur (int) const |
| Perform a Gaussian blur. | |
| ScalarField2 | GaussianBlur (const double &) const |
| Perform a Gaussian blur. | |
| void | Translate (const Vector2 &) |
| Translate the domain of the scalar field. | |
| void | Scale (const Vector2 &) |
| Scale the domain of the scalar field. | |
| void | Scale (const double &) |
| Scale the scalar field. | |
| void | Normalize () |
| Normalize the values of a scalar field to unit interval. | |
| void | Unitize () |
| Linearly scale the values of a scalar field to unit interval. | |
| void | Clamp (const double &, const double &) |
| Clamp the values of a scalar field. | |
| ScalarField2 & | operator*= (const ScalarField2 &) |
| Multiplication. | |
| ScalarField2 & | operator*= (const double &) |
| Scale the values of a scalar field. | |
| ScalarField2 & | operator/= (const double &) |
| Scale the values of a scalar field. | |
| ScalarField2 & | operator-= (const ScalarField2 &) |
| Subtraction. | |
| ScalarField2 & | operator-= (const double &) |
| Subtract a constant to the values the scalar field. | |
| ScalarField2 & | operator+= (const ScalarField2 &) |
| Addition. | |
| ScalarField2 & | operator+= (const double &) |
| Add a constant to the values the scalar field. | |
| ScalarField2 | operator- () const |
| Negates the values of the scalar field. | |
| void | Pow (const double &) |
| Power. | |
| void | Atan () |
| Compute the arctangent of the values of a scalar field, may be usefull for converting slope to angles. | |
| void | Step (const double &, const double &) |
| Perform a linear step over the values of a scalar field. | |
| void | SetRange (const double &, const double &) |
| Scales the scalar field to a given range interval. | |
| void | Binarize (const double &) |
| Transform the field into a binary (0, 1 values) field using a threshold. | |
| ScalarField2 | Binarized (const double &) |
| Convert the field into a binary (0, 1 values) field using a threshold. | |
| void | Invert () |
| Inversion (take the opposite of each field value). | |
| void | Negate () |
| Negate (invert 0 and 1 values of a binary field). | |
| void | SmoothStep (const double &, const double &, bool=false) |
| Perform a smooth step over the values of a scalar field. | |
| void | Abs () |
| Compute the absolute value of a scalar field. | |
| void | Lerp (const ScalarField2 &, const ScalarField2 &, const double &) |
| Linear interpolation between two scalar fields. | |
| void | Lerp (const ScalarField2 &, const ScalarField2 &, const ScalarField2 &) |
| Interpolation between two scalar fields with an alpha scalar field. | |
| void | AdaptiveBilateralFiltering (double, double) |
| Adaptive bilateral filtering. | |
| void | AdaptiveBilateralFiltering (int, double) |
| Adaptive bilateral filtering. | |
| ScalarField2 | Convolution (double[], int) |
| Apply a kernel to the field. | |
| void | MorphDilate () |
| Dilate the binary field using a D4 structuring element. | |
| void | MorphErode () |
| Erode the binary field using a D4 structuring element. | |
| void | MorphRemoveEnds () |
| Remove the ends of lines by authorizing at least 3 pixels. | |
| void | MorphHitAndMiss (double[], int) |
| Perform a hit and miss operation on the field. | |
| void | MorphThin (double[], int) |
| Thinning by using a kernel. | |
| ScalarField2 | MorphSkeleton (int) |
| Compute the skeleton using successive erosion/dilatations. | |
| ScalarField2 | MorphSkeletonConnected (int) |
| Compute the skeleton using thinning. | |
| VectorField2 | Gradient () const |
| Compute the gradient field. | |
| VectorField2 | GradientSmooth () const |
| Compute the smooth gradient field. | |
| ScalarField2 | GradientNorm () const |
| Compute the gradient norm scalar field. | |
| ScalarField2 | GradientSmoothNorm () const |
| Compute the gradient norm scalar field. | |
| ScalarField2 | Ln () const |
| Compute the logarithm of the scalar field. | |
| ScalarField2 | Sqrt () const |
| Compute the square root of the scalar field. | |
| ScalarField2 | Cbrt () const |
| Compute the quartic root of the scalar field. | |
| ScalarField2 | Qurt () const |
| Compute the cubic root of the scalar field. | |
| void | Sqrted () |
| Compute the square root of the scalar field. | |
| void | SelfOp (const std::function< double(double)> &) |
| Applies a function to the scalar field. | |
| ScalarField2 | Op (const std::function< double(double)> &) const |
| Applies a function to the scalar field. | |
| ScalarField2 | Op (const std::function< double(const ScalarField2 &, int, int)> &) const |
| Applies a function to the scalar field. | |
| virtual ScalarField2 | Laplacian () const |
| Compute the Laplacian field. | |
| virtual double | Laplacian (int, int) const |
| Compute the Laplacian at a given sample. | |
| QVector< ScalarPoint2 > | GetScalarPoints () const |
| Create the set of scalar points. | |
| FloatArray | GetAsFloats () const |
| Compute and return an array of 4 byte floats. | |
| QVector< double > | GetField () const |
| Return the field. | |
| Vector2 | Dichotomy (Vector2, Vector2, double, double, double, const double &, const double &) const |
| Compute the intersection between a segment and the scalar field. | |
| int | Memory () const |
| Compute the memory size of a scalarfield. | |
| ScalarField2 | DistanceTransform (const double &) const |
| Compute the squared distance field from a scalar field. | |
| ScalarField2 | EuclideanTransformBrute () const |
| Exact Euclidean distance transform. | |
| ScalarField2 | EuclideanTransform () const |
| Exact Euclidean distance transform. | |
| void | SignalError (const ScalarField2 &, double &, double &) const |
| Compute PSNR and RMSE between two fields. | |
| void | SignalError (const ScalarField2 &, double &, double &, double &) const |
| Compute PSNR, MSE and RMSE between two fields. | |
| ScalarField2 | CurvatureProfile () const |
| Compute the profile curvature, i.e., the curvature along flow direction. | |
| ScalarField2 | CurvatureContour () const |
| Compute the Contour Curvature, i.e. curvature along the XY plane. | |
| ScalarField2 | CurvatureTangential () const |
| Compute the Tangential Curvature, i.e. curvature on a plane tangential to the surface. | |
| ScalarField2 | CurvatureGaussian () const |
| Compute the Gaussian Curvature. | |
| ScalarField2 | CurvatureMean () const |
| Compute the Mean Curvature. | |
| ScalarField2 | CurvatureMin () const |
| Compute the minimum curvature. | |
| ScalarField2 | CurvatureMax () const |
| Compute the maximum curvature. | |
| ScalarField2 | MaxFilter (int) const |
| Compute the max filtered scalar field. | |
| ScalarField2 | MinFilter (int) const |
| Compute the min filtered scalar field. | |
| Mesh2 | Polygonize (const double &=0.0) const |
| Polygonize the scalar field into a surface mesh using the marching square algorithm. | |
| SegmentSet2 | LineSegments (const double &, bool=false) const |
| Compute the iso-contour of the scalar field. | |
| QImage | Texture (const QImage &) const |
| Compute a texture based on the sediment field. | |
| void | Draw (QGraphicsScene &) const |
| Draw the scalar field in a QGraphicsScene. | |
| Public Member Functions inherited from Array2 | |
| Array2 () | |
| Empty array, with empty box. | |
| Array2 (const Box2 &, int, int) | |
| Create the lattice structure. | |
| Array2 (const Box2 &, int) | |
| Create the lattice structure. | |
| Array2 (const Array &) | |
| Create the lattice structure. | |
| Array2 | DownSample (int) const |
| Downsample the array. | |
| Array2 | UpSample (int) const |
| Upsample the array. | |
| ~Array2 () | |
| Empty. | |
| int | VertexSize () const |
| Return the size of the vertex array. | |
| int | GetSizeX () const |
| Get the vertex size of the array for x axis. | |
| int | GetSizeY () const |
| Get the vertex size of the array for y axis. | |
| int | VertexBorderSize () const |
| Return the number of vertices on the boundary of the rectangle. | |
| int | CellSize () const |
| Return the size of the cell array. | |
| int | CellSizeX () const |
| Get the cell size of the array for x axis. | |
| int | CellSizeY () const |
| Get the cell size of the array for y axis. | |
| QSize | GetQtSize () const |
| Return the Qt size of the vertex array. | |
| Box2 | Cell (int) const |
| Return the geometry of the cell. | |
| Box2 | Cell (int, int) const |
| Return the geometry of the cell. | |
| void | HalfCell (int, int, bool, Triangle2 &, Triangle2 &) const |
| Return the geometry of the cell. | |
| Vector2 | CellCenter (int, int) const |
| Return the center of the cell. | |
| void | Scale (const Vector2 &) |
| Scales the lattice structure. | |
| void | Scale (const double &) |
| Scales the array structure. | |
| Box2 | GetBox () const |
| Get the box of the array. | |
| Box2 | UnitCell () const |
| Return the geometry of a generic cell. | |
| Vector2 | CellDiagonal () const |
| Return the cell diagonal vector. | |
| double | CellArea () const |
| Return the area of a cell. | |
| Vector2 | ArrayVertex (int, int) const |
| Compute the coordinates of a point on the lattice. | |
| Vector2 | ArrayVertex (const QPoint &) const |
| Compute the coordinates of a point on the lattice. | |
| QVector< Vector2 > | ArrayVertexes (const QVector< QPoint > &) const |
| Compute the coordinates of a set of points on the lattice. | |
| Vector2 | Size () const |
| Return the size of the array. | |
| QRect | AreaInteger () const |
| Return the range of integer values for the domain. | |
| QImage | ImageGrid (const Box2 &, const double &) const |
| Create a texture with a regular grid. | |
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draw the cells of the lattice. | |
| void | Subdivide () |
| Change the resolution. | |
| bool | IsEmpty () const |
| Detect if the array is empty, i.e., any dimension equal to zero. | |
| QPoint | VertexBorder (int) const |
| Compute the k-th point on the boundary of the domain. | |
| int | VertexBorderIndex (int, int) const |
| Compute the index of a point on the boundary of the domain. | |
| void | VertexInteger (const Vector2 &, int &, int &) const |
| Compute the coordinates of a vertex inside a cell. | |
| QPoint | VertexInteger (const Vector2 &) const |
| Compute the coordinates of a vertex inside a cell. | |
| QPoint | VertexInteger (const Vector2 &, double &, double &) const |
| Compute the integer coordinates of the cell containing a point, which are those of its first vertex, and the local coordinates of the point in the cell. | |
| QRect | VertexIntegerArea (const Box2 &) const |
| Compute the integer coordinates of the vertices embedding a box. | |
| QRect | VertexIntegerArea (const Circle2 &) const |
| Compute the integer coordinates of the vertices embedding a circle. | |
| QRect | VertexIntegerArea (const QRect &) const |
| Compute the integer coordinates span of the vertices embedding a rectangle. | |
| QRect | VertexIntegerArea (int, int, int) const |
| Compute the integer coordinates of the vertices embedding a cell with prescribed integer radius. | |
| void | CellInteger (const Vector2 &, int &, int &) const |
| Compute the coordinates of a vertex inside a cell. | |
| void | CellInteger (const Vector2 &, int &, int &, double &, double &) const |
| Compute the point on the lattice given an input point. | |
| QPoint | CellInteger (const Vector2 &) const |
| Compute the coordinates of a vertex inside a cell. | |
| QPoint | CellInteger (const Vector2 &, double &, double &) const |
| Compute the point on the lattice given an input point. | |
| QRect | CellIntegerArea (const Box2 &) const |
| Compute the integer coordinates of the cells of the array embedding an input box. | |
| QRect | CellIntegerArea (const Circle2 &) const |
| Compute the integer coordinates of the cells of the array embedding an input circle. | |
| void | Translate (const Vector2 &) |
| Translate the array. | |
| Vector2 | Center () const |
| Return the center of the array. | |
| constexpr bool | InsideVertexIndex (int, int) const |
| Check if the indexes are within range. | |
| constexpr bool | OutsideVertexIndex (int, int) const |
| Check if the indexes are outside or on the border. | |
| constexpr bool | InsideVertexIndex (const QPoint &) const |
| Check if the indexes are within range. | |
| constexpr bool | InsideVertexIndex (int, int, int) const |
| Check if the indexes are within k-range. | |
| bool | Inside (const Vector2 &) const |
| Check if a point is in the rectangular domain. | |
| constexpr bool | BorderVertexIndex (int, int) const |
| Check if the indexes are on the border. | |
| constexpr bool | BorderVertexIndex (const QPoint &) const |
| Check if the indexes are on the border. | |
| constexpr int | VertexIndex (int, int) const |
| Compute the index of a given vertex. | |
| constexpr int | VertexIndex (const QPoint &) const |
| Compute the index of a given vertex. | |
| QPoint | Next (const QPoint &, int) const |
| Compute the point next to another one. | |
| QString | Statistics () const |
| Get statistics. | |
| void | ClampVertexIndex (int &, int &) const |
| Clamp vertex indexes to the size of the array. | |
| Vector2 | VertexUV (const Vector2 &) const |
| Compute the coordinates of a point inside the box given uv coordinates. | |
Static Public Member Functions | |
| static ScalarField2 | LoadFromR32 (const Box2 &, const QString &) |
| Import FAW Float 32 bits format from World Machine. | |
| static ScalarField2 | Load (Box2, const QString &, double=0.0, double=1.0) |
| Loads a scalar field from an image. | |
| Static Public Member Functions inherited from Array2 | |
| static int | NeighborCode (int, int) |
| Convert a direction to an 8 bit integer code. | |
| static QPoint | CodeToDir (int) |
| Convert an 8 bit integer code direction into a direction vector. | |
Protected Member Functions | |
| void | SetBorder (const double &=0.0) |
| Set the border of the scalar field to a constant value. | |
| double | SmoothPoint (int, int) const |
| Compute a smoothed value at a given point in the scalar field. | |
| Matrix | Local (int, int) const |
| Compute the local neighborhood in the one-ring aroung a point. | |
| void | CopyEdges (ScalarField2 &) const |
| Copy the values of the edges to a new field. | |
| Protected Member Functions inherited from Array2 | |
| constexpr void | InverseVertexIndex (int, int &, int &) const |
| Compute the coordinates of a given vertex. | |
| constexpr QPoint | InverseVertexIndex (int) const |
| Compute the coordinates of a given vertex. | |
| constexpr int | CellIndex (int, int) const |
| Compute the index of a given cell. | |
| constexpr int | CellIndex (const QPoint &) const |
| Compute the index of a given cell. | |
| constexpr bool | InsideCellIndex (int, int) const |
| Check if the indexes are within range. | |
| constexpr bool | InsideCellIndex (const QPoint &) const |
| Check if the indexes are within range. | |
| void | InverseCellIndex (int, int &, int &) const |
| Compute the coordinates of a given cell. | |
| Protected Member Functions inherited from Box2 | |
| Box2 () | |
| Empty. | |
| Box2 (const double &) | |
| Create a square box centered at the origin and of given half side length. | |
| Box2 (const double &, const double &) | |
| Create a box centered at the origin and of given dimensions. | |
| Box2 (const Vector2 &) | |
| Create a box from a single vertex. | |
| Box2 (const Vector2 &, const Vector2 &) | |
| Create a box. | |
| Box2 (const Vector2 &, const double &) | |
| Creates a box. | |
| Box2 (const Vector2 &, const double &, const double &) | |
| Create a box given a center point and its width, length, and height. | |
| Box2 (const Box &) | |
| Create a box in the plane given a box. | |
| Box2 (const Box2 &, const Box2 &) | |
| Create a box embedding two boxes. | |
| Box2 (const Box2 &, const Matrix2 &) | |
| Creates an axis aligned bounding box from a box and a transformation matrix. | |
| Box2 (const Box2 &, const Frame2 &) | |
| Creates an axis aligned bounding box from a box and a frame. | |
| Box2 (const Box2 &, const FrameScaled2 &) | |
| Creates an axis aligned bounding box from a box and a frame. | |
| Box2 (const QVector< Vector2 > &) | |
| Compute the bounding box of a set of points. | |
| Box2 (const QSize &) | |
| Create a box from a Qt size. | |
| Vector2 & | operator[] (int) |
| Returns either end vertex of the box. | |
| Vector2 | operator[] (int) const |
| Overloaded. | |
| Vector2 | Size () const |
| Compute the size (width and height) of a box. | |
| double | Width () const |
| Compute the width of a box. | |
| double | Height () const |
| Compute the height of a box. | |
| Vector2 | Diagonal () const |
| Returns the diagonal of the box. | |
| double | Radius () const |
| Returns the radius of the box, i.e. the length of the half diagonal of the box. | |
| double | Area () const |
| Compute the surface area of a box. | |
| double | Perimeter () const |
| Compute the perimeter of the box. | |
| Vector2 | Center () const |
| Returns the center of the box. | |
| Vector2 | Vertex (int) const |
| Returns the k-th vertex of the box. | |
| Segment2 | Edge (int) const |
| Returns the k-th edge of the box. | |
| Vector2 | Vertex (int, int, int, int) const |
| Compute the coordinates of a grid aligned point. | |
| Vector2 | VertexUV (const Vector2 &) const |
| Compute the coordinates of a point inside the box given uv coordinates. | |
| Box2 | Sub (int) const |
| Computes the sub-box in the n-th quadrant. | |
| double | R (const Vector2 &) const |
| Compute the squared distance between the box and a point. | |
| Vector2 | Normal (const Vector2 &) const |
| Compute the distance vector between the box and a point. | |
| double | Signed (const Vector2 &) const |
| Computes the signed distance between the box and a point. | |
| double | R (const Box2 &) const |
| Compute the squared Euclidean distance between two boxes. | |
| void | Translate (const Vector2 &) |
| Translates a box. | |
| void | Scale (const Vector2 &) |
| Scales a box. | |
| void | Scale (const double &) |
| Scales a box. | |
| Box2 | Translated (const Vector2 &) const |
| Translated box. | |
| Box2 | Scaled (const double &) const |
| Scales a box and return the scaled box. | |
| Box2 | Scaled (const Vector2 &) const |
| Scales a box and return the scaled box. | |
| Box2 | Scaled (const QSize &) const |
| Scales a box according to a Qt size. | |
| Box2 | ScaledTo (const double &) const |
| Scale the box so that the largest side should equal the argument value. | |
| Box2 | ScaledCentered (const double &) const |
| Scales a box while preserving its center. | |
| Box2 | Rotated (const double &) const |
| Compute the box embedding the rotated box. | |
| Box2 | Rotated (const Matrix2 &) const |
| Compute the box embedding the rotated box. | |
| Box2 | Centered () const |
| Compute the box translated to origin. | |
| Box2 | InscribedCube () const |
| Creates the biggest cube inscribed in the box. | |
| Box2 | Cube () const |
| Return the tightest embedding cube from an arbitrarilly shaped box. | |
| void | Extend (const double &) |
| Extend the limits of the box by a given distance. | |
| void | Extend (const Vector2 &) |
| Extend the limits of the box given a point. | |
| Box2 | Extended (const double &) const |
| Extend the limits of the box by a given distance. | |
| void | SetParallelepipedic (int, int &, int &) |
| Inflates a box so that its dimensions should be a fraction of its maximum side length. | |
| void | SetParallelepipedic (const double &, int &, int &) |
| Creates a parallelepipedic box whose dimensions are integer multiples of a given input reference size. | |
| bool | Inside (const Vector2 &) const |
| Test if a point is inside the box. | |
| bool | Inside (const Vector2 &, const double &) const |
| Test if a point lies withing a given range of the box. | |
| bool | Intersect (const Box2 &) const |
| Check if the box intersects another box. | |
| double | OverlapArea (const Box2 &) const |
| Computes the overlapping area of two boxes. | |
| Box2 | Intersection (const Box2 &) const |
| Computes the intersection between two boxes. | |
| Box | ToBox (const double &, const double &) const |
| Convert a planar Box2 to a Box. | |
| int | Quadrant (const Vector2 &) const |
| Computes quadrant index of a vertex with respect to the box center. | |
| bool | Intersect (const Ray2 &, double &, double &) const |
| Computes the intersection between a box and a ray. | |
| bool | Intersect (const Ray2 &) const |
| Computes the intersection between a box and a ray. | |
| bool | Intersect (const Line2 &, double &, double &) const |
| Computes the intersection between a box and a line. | |
| bool | Intersect (const Segment2 &, double &, double &) const |
| Compute the intersection between a box and a segment. | |
| bool | Intersect (const Line2 &) const |
| Check the intersection between a box and a line. | |
| bool | Intersect (const Segment2 &) const |
| Check the intersection between a box and a segment. | |
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draw a rectangle. | |
| Vector2 | RandomInside (Random &=Random::R239) const |
| Generate a random vector inside the box. | |
| Vector2 | RandomOn (Random &=Random::R239) const |
| Generate a random vector on the perimeter of the box. | |
| QRectF | GetQtRect () const |
| Create the Qt rectangle. | |
| QRect | TileRange (const Box2 &) const |
| Compute the range of index for tiling the argument box so that it covers the box. | |
| Box2 | Tile (int, int) const |
| Return the tiled the box using integer coordinates. | |
| Box2 | Tile (const QRect &) const |
| Return the tiled the box using integer coordinates. | |
| Segment2 | GetSegment (const double &, bool=true) const |
| Compute the horizontal or vertical segment dividing the box into u and 1-u parts. | |
| Ia | AxisInterval (const Vector2 &) const |
| Project a the vertexes of the box onto an axis. | |
| QVector< Vector2 > | Poisson (const double &, int, Random &=Random::R239) const |
| Compute a Poisson disc distribution inside a box. | |
| QVector< Vector2 > | Poisson (const double &, int, const QVector< Vector2 > &, bool=true, Random &=Random::R239) const |
| Compute a Poisson disc distribution inside a box. | |
| QVector< Vector2 > | GridSampling (double) const |
| Compute a regular grid sampling inside the box. | |
| QVector< Vector2 > | GridSampling (double, Random &) const |
| Compute a jittered grid sampling inside the box. | |
Protected Attributes | |
| QVector< double > | field |
| Field samples. | |
| Protected Attributes inherited from Box2 | |
| Vector2 | b = Vector2(1.0) |
| Lower and upper vertexes of the box. | |
Friends | |
| ScalarField2 | operator- (const double &x, const ScalarField2 &a) |
| Subtraction. | |
| ScalarField2 | operator- (const ScalarField2 &a, const double &x) |
| Subtraction. | |
| ScalarField2 | operator- (const ScalarField2 &a, const ScalarField2 &b) |
| Subtraction. | |
| ScalarField2 | operator+ (const ScalarField2 &a, const ScalarField2 &b) |
| Addition. | |
| ScalarField2 | operator+ (const ScalarField2 &a, const double &x) |
| Addition. | |
| ScalarField2 | operator* (const ScalarField2 &a, const double &x) |
| Multiplication. | |
| ScalarField2 | operator* (const double &x, const ScalarField2 &a) |
| Multiplication. | |
| ScalarField2 | operator* (const ScalarField2 &a, const ScalarField2 &b) |
| Multiplication. | |
| ScalarField2 | operator/ (const ScalarField2 &a, const double &x) |
| Division. | |
| ScalarField2 | operator/ (const double &x, const ScalarField2 &a) |
| Inverse. | |
| std::ostream & | operator<< (std::ostream &s, const ScalarField2 &scalar) |
| Overloaded. | |
Additional Inherited Members | |
| Public Attributes inherited from Array2 | |
| int | ny = 0 |
| Sizes. | |
| Vector2 | celldiagonal = Vector2::Null |
| Cell diagonal. | |
| Vector2 | inversecelldiagonal = Vector2::Null |
| Inverse cell diagonal. | |
| Static Protected Member Functions inherited from Box2 | |
| static Box2 | MinMax (const Vector2 &, const Vector2 &) |
| Create a box from any two points. | |
| Static Protected Attributes inherited from Array2 | |
| static const QPoint | next [8] = { QPoint(1, 0), QPoint(1, 1), QPoint(0, 1), QPoint(-1, 1), QPoint(-1, 0), QPoint(-1, -1), QPoint(0, -1), QPoint(1, -1) } |
| Array of points in the 1-ring neighborhood. | |
| static const double | length [8] = { 1.0, sqrt(2.0), 1.0, sqrt(2.0), 1.0, sqrt(2.0), 1.0, sqrt(2.0) } |
| Length to the i-th neighbor. | |
| static const double | inverselength [8] = { 1.0, 1.0 / sqrt(2.0), 1.0, 1.0 / sqrt(2.0), 1.0, 1.0 / sqrt(2.0), 1.0, 1.0 / sqrt(2.0) } |
| Inverse length. | |
| Static Protected Attributes inherited from Box2 | |
| static const int | edge [8] |
| Edge vertex indexes. | |
| static const double | epsilon = 1.0e-5 |
| Epsilon value used to check intersections and some round off errors. | |
| static const Box2 | Infinity |
| Huge bounding box, which should enclose any other. | |
| static const Box2 | Null |
| Null box, equivalent to. | |
| static const Box2 | Unit |
| Unit box, defined as. | |
A base two-dimensional field of real values.
| ScalarField2::ScalarField2 | ( | const Array2 & | a, |
| const double & | v = 0.0 ) |
Create the field structure.
| a | Array representing the grid domain. |
| v | Constant value of field. |
|
explicit |
Create the field structure.
| box | The box. |
| x,y | Size of the array. |
| v | Constant value of field. |
|
explicit |
Create the field structure.
| box | The box. |
| x,y | Size of the array. |
| v | Array of scalar values. |
|
explicit |
Create a field structure from an image.
| box | The box. |
| image | The image. |
| a,b | Range of values to scale the image. |
| grayscale | Read image as grayscale if set to true, otherwize use color for a better accuracy. |
|
explicit |
Create a field structure from an image.
| image | The image. |
| v | Range of values to scale the image, values will vary between 0.0 and v. |
| d | Distance between samples. |
| grayscale | Read image as grayscale if set to true, otherwize use color for a better accuracy. |
|
explicit |
Create a field structure from an image.
This is a convenience constructor which is the same as:
| name | Name of the image. |
| a,b | Range of values to scale the image. |
|
explicit |
Create a ScalarField2 from an Integer Array (int).
| a | Integer array. |
|
explicit |
Create a ScalarField2 from an Integer Array (int) with a lookup table for the double values.
The lookup table is a vector of double values where the index corresponds to the integer value in the array. This allows for mapping integer values to specific double values in the scalar field.
| a | Integer array. |
| v | Vector of double values used as a lookup table for mapping integer values to double values in the scalar field. |
| void ScalarField2::AdaptiveBilateralFiltering | ( | double | w, |
| double | s ) |
Adaptive bilateral filtering.
| w | Width of spatial gaussian kernel. |
| s | Intensity gaussian kernel. |
| void ScalarField2::AdaptiveBilateralFiltering | ( | int | spatial_sigma, |
| double | range_sigma ) |
Adaptive bilateral filtering.
| spatial_sigma | Width (in number of cells) of spatial gaussian kernel. |
| range_sigma | Intensity gaussian kernel. |
| void ScalarField2::Add | ( | const Vector2 & | p, |
| const double & | x ) |
Add a value to the scalar field with diffusion.
The value is distributed among the neighboring vertices.
| p | Point. |
| x | Value. |
|
inline |
Return the field value at a given array vertex.
| q | Point. |
|
inline |
Return the data in the field.
| c | Index. |
|
inline |
Return the field value at a given array vertex.
| i,j | Integer coordinates of the vertex. |
| void ScalarField2::Atan | ( | ) |
Compute the arctangent of the values of a scalar field, may be usefull for converting slope to angles.
Optimized with AVX
| double ScalarField2::Average | ( | ) | const |
|
virtual |
Get the field value with world coordinate system.
This function computes a bicubic interpolation of the values, with null derivatives.
| p | Point (should be strictly within bounding box of the domain). |
|
virtual |
Compute the bicubic interpolation.
| p | Point (should be strictly within bounding box of the domain). |
| void ScalarField2::Binarize | ( | const double & | t | ) |
Transform the field into a binary (0, 1 values) field using a threshold.
| t | Threshold. |
| ScalarField2 ScalarField2::Binarized | ( | const double & | t | ) |
Convert the field into a binary (0, 1 values) field using a threshold.
| t | Threshold. |
| void ScalarField2::Blur | ( | ) |
Blurs the scalar field.
The function uses a \( 3^2 \) blur kernel.
| void ScalarField2::Blur | ( | int | n | ) |
Applies several blurring steps to the scalar field.
| n | Number of blurring steps. |
| ScalarField2 ScalarField2::Cbrt | ( | ) | const |
Compute the quartic root of the scalar field.
Direct quartic root computation is more efficicent that calling ScalarField2::Sqrt() twice.
Optimized with AVX
| void ScalarField2::Clamp | ( | const double & | a, |
| const double & | b ) |
Clamp the values of a scalar field.
| a,b | Interval. |
|
virtual |
Compute the value of the field at the closest grid point.
| p | Point (should be strictly inside the box domain). |
| ScalarField2 ScalarField2::Convolution | ( | double | t[], |
| int | s ) |
Apply a kernel to the field.
The kernel is not flipped: this function actually computes a correlation, which is the same as a convolution for the symmetric kernels. The samples outside the field are ignored, as if they were null.
| t | Array of scalar values, stored by rows of s values. |
| s | Size (odd number) of the square kernel. |
|
protected |
Copy the values of the edges to a new field.
| s | New scalar field. |
| QImage ScalarField2::CreateImage | ( | bool | grayscale = true | ) | const |
Create an image from the field.
| grayscale | Export as grayscale if set to true, and to color otherwise (provides a better precision). |
| QImage ScalarField2::CreateImage | ( | const AnalyticPalette & | palette, |
| bool | symmetric = false, | ||
| bool | transparent = false ) const |
Create an image from the field using a palette.
| palette | The palette. |
| symmetric | If set to true, adapt the range interval so that shading should be performed with median alignment. |
| transparent | If set to true, the lowest values of the scalar field will be transparent. |
| QImage ScalarField2::CreateImage | ( | const double & | a, |
| const double & | b, | ||
| bool | grayscale = true ) const |
Create an image from the field.
| a,b | Range of elevation that will be mapped to image scale. |
| grayscale | Export as grayscale if set to true, color otherwise. |
| QImage ScalarField2::CreateImage | ( | const double & | a, |
| const double & | b, | ||
| const AnalyticPalette & | palette, | ||
| bool | transparent = false ) const |
Create an image from the field using a palette.
| a,b | Range of elevation that will be mapped to image scale. |
| palette | The palette. |
| transparent | If set to true, the lowest values of the scalar field will be transparent. |
| QImage ScalarField2::CreateImage | ( | const double & | a, |
| const double & | b, | ||
| const GenericPalette & | palette, | ||
| bool | transparent = false ) const |
Create an image from the field using a palette.
| a,b | Range of elevation that will be mapped to image scale. |
| palette | The palette. |
| transparent | If set to true, the lowest values of the scalar field will be transparent. |
| QImage ScalarField2::CreateImage | ( | const GenericPalette & | palette | ) | const |
Create an image from the field using a palette.
| palette | The palette. |
| QImage ScalarField2::CreateImage | ( | const Palette & | palette | ) | const |
Create an image from the field using a palette.
| palette | The palette. |
| ScalarField2 ScalarField2::Crop | ( | const QPoint & | a, |
| const QPoint & | b ) const |
Crops a rectangular region in the scalar field.
Note that the corners of the region of the scalar field are (0,0) and (nx-1,ny-1).
| a,b | Rectangular region. |
| QVector< std::pair< double, int > > ScalarField2::CumulativeHistogram | ( | int | n | ) | const |
| QVector< std::pair< double, double > > ScalarField2::CumulativeNormedHistogram | ( | int | n | ) | const |
| ScalarField2 ScalarField2::CurvatureContour | ( | ) | const |
Compute the Contour Curvature, i.e. curvature along the XY plane.
Sign convention: the field is seen as a height z, and the curvature is positive where the surface is concave up (valley, bowl, e.g. z = x^2+y^2) and negative where it is convex up (ridge, dome).
See [Schmidt et al 2003, Comparison of polynomial models for land surface curvature calculation] for a complete reference of the formulations of the different curvatures.
| ScalarField2 ScalarField2::CurvatureGaussian | ( | ) | const |
Compute the Gaussian Curvature.
The Gaussian curvature, product of the principal curvatures, does not depend on the orientation of the height: it is positive for a bowl or a dome and negative for a saddle.
| ScalarField2 ScalarField2::CurvatureMax | ( | ) | const |
Compute the maximum curvature.
See ScalarField2::CurvatureMin() for the clamping of the discriminant.
See Schmidt et al 2003, Comparison of polynomial models for land surface curvature calculation, for a complete reference of the formulations of the different curvatures.
| ScalarField2 ScalarField2::CurvatureMean | ( | ) | const |
Compute the Mean Curvature.
Sign convention: the field is seen as a height z, and the curvature is positive where the surface is concave up (valley, bowl, e.g. z = x^2+y^2) and negative where it is convex up (ridge, dome).
| ScalarField2 ScalarField2::CurvatureMin | ( | ) | const |
Compute the minimum curvature.
See Schmidt et al 2003, Comparison of polynomial models for land surface curvature calculation, for a complete reference of the formulations of the different curvatures.
Min curvature is expressed as \( H - \sqrt{H^2 - K} \) with H being mean curvature and K gaussian curvature. See Table 2.2 in Florinsky's book "Digital Terrain Analysis in Soil Science and Geology"
The discrete approximations of H and K may give \( H^2 < K \), whereas \( H^2 \geq K \) for the exact curvatures (equality at umbilic points): the discriminant is then clamped to zero, so that the minimum and the maximum curvatures are both equal to H.
| ScalarField2 ScalarField2::CurvatureProfile | ( | ) | const |
Compute the profile curvature, i.e., the curvature along flow direction.
Sign convention: the field is seen as a height z, and the curvature is positive where the surface is concave up (valley, bowl, e.g. z = x^2+y^2) and negative where it is convex up (ridge, dome).
| ScalarField2 ScalarField2::CurvatureTangential | ( | ) | const |
Compute the Tangential Curvature, i.e. curvature on a plane tangential to the surface.
Sign convention: the field is seen as a height z, and the curvature is positive where the surface is concave up (valley, bowl, e.g. z = x^2+y^2) and negative where it is convex up (ridge, dome). Similar but not exactly the same as the Contour Curvature.
| void ScalarField2::CutEpsilon | ( | const double & | e = 1e-6 | ) |
Set all values in the field that are lower than epsilon to true zero.
| e | Epsilon coefficient. |
| Vector2 ScalarField2::Dichotomy | ( | Vector2 | a, |
| Vector2 | b, | ||
| double | va, | ||
| double | vb, | ||
| double | length, | ||
| const double & | T, | ||
| const double & | epsilon ) const |
Compute the intersection between a segment and the scalar field.
| a,b | End vertices of the segment straddling the surface. |
| va,vb | Field function value at those end vertices. |
| length | Distance between vertices. |
| epsilon | Precision. |
| T | Threshold value. |
| ScalarField2 ScalarField2::DistanceTransform | ( | const double & | threshold | ) | const |
Compute the squared distance field from a scalar field.
Points with values below the threshold value are considered as inside, others as outside.
| threshold | Threshold value defining inside and outside. |
| ScalarField2 ScalarField2::DownSample | ( | int | f | ) | const |
Lower the resolution of the scalarfield.
| f | Lowering factor. |
| void ScalarField2::Draw | ( | QGraphicsScene & | scene | ) | const |
Draw the scalar field in a QGraphicsScene.
| scene | Graphics scene. |
| ScalarField2 ScalarField2::EuclideanTransformBrute | ( | ) | const |
Exact Euclidean distance transform.
This is an \( O(n^4) \) algorithm, only use for validation purposes.
| bool ScalarField2::ExportPGM | ( | const QString & | url | ) | const |
Export the scalarfield as a PGM file in 16 bits.
| url | File name. |
| bool ScalarField2::ExportPGM | ( | const QString & | url, |
| const double & | a, | ||
| const double & | b ) const |
Export the scalarfield as a PGM file in 16 bits.
| url | File name. |
| a,b | Interval range, values in the field will be clamped to [a,b] and rescaled 16 bits range. |
| void ScalarField2::Fill | ( | const double & | s | ) |
Sets the entire field with a constant value.
| s | Scalar. |
| void ScalarField2::Flatten | ( | const Vector2 & | center, |
| const double & | radius, | ||
| const double & | scaling = 0.25 ) |
Flatten the scalar field.
| center | Center. |
| radius | Radius. |
| scaling | Scaling of the effect. |
| void ScalarField2::Gaussian | ( | const Vector2 & | center, |
| const double & | radius, | ||
| const double & | height ) |
Add material with a Gaussian distribution.
| center | Center of the distribution. |
| radius,height | Radius and maximum height of the distribution |
| ScalarField2 ScalarField2::GaussianBlur | ( | const double & | r | ) | const |
Perform a Gaussian blur.
| r | Radius of blur. |
| ScalarField2 ScalarField2::GaussianBlur | ( | int | r | ) | const |
Perform a Gaussian blur.
| r | Radius (in cells) of blur. |
| Histogram ScalarField2::GetHistogram | ( | int | n | ) | const |
Compute the histogram of the scalar field.
| n | Discretization. |
| Histogram ScalarField2::GetHistogram | ( | int | n, |
| double | a, | ||
| double | b ) const |
Compute the histogram of the scalar field.
| a,b | Interval. |
| n | Discretization. |
| std::vector< double > ScalarField2::GetPercentiles | ( | const std::vector< double > & | perc | ) | const |
Compute the values of the field at given percentiles.
The values are selected with std::nth_element, without sorting the whole field: the value at the percentile p is the sample of rank int(p n), clamped to the valid ranks, in the sorted values of the n samples of the field.
| perc | Percentiles, which are reals in [0,1]. |
| Ia ScalarField2::GetQQRange | ( | ) | const |
Get the range of the field.
Optimized with AVX
| void ScalarField2::GetRange | ( | double & | a, |
| double & | b ) const |
Get the range of the field.
Optimized with AVX
| a,b | Returned minimum and maximum. |
|
virtual |
Compute the gradient at a given array vertex.
| i,j | Integer coordinates of the array vertex. |
|
virtual |
Compute the smooth gradient at a given array vertex using a second order approximation.
| i,j | Integer coordinates of the array vertex. |
|
virtual |
Compute the hessian at a given array vertex.
| i,j | Integer coordinates of the array vertex. |
| void ScalarField2::HistogramTransfer | ( | const Histogram & | histo | ) |
Transfer the distribution of values of a histogram to the field.
The samples of the field are sorted by value and replaced, by rank, with the values of the histogram at the same percentile: the order of the values is preserved, and their distribution is the one of the histogram.
| histo | Target histogram. |
| double ScalarField2::Integral | ( | ) | const |
Get the integral of the scalar field.
Compute the sum of all the elements and make the product by the area of small cell element.
|
virtual |
Compute the Lipschitz constant of the elevation function.
Note that this is equivalent to the following code, with the difference that this function does not store the norm of the gradient in memory.
|
virtual |
Compute the Laplacian field.
Returns a discrete approximation of Laplace�s differential operator applied to the field. The implementation is equivalent to the 4*del2(U) Matlab function, except on the edges of the field.
|
virtual |
Compute the Laplacian at a given sample.
Returns a discrete approximation of Laplace�s differential operator applied to the field. The implementation is equivalent to the 4*del2(U) Matlab function, except on the edges of the field.
| i,j | Integer coordinates of the sample. |
| void ScalarField2::Lerp | ( | const ScalarField2 & | a, |
| const ScalarField2 & | b, | ||
| const double & | t ) |
Linear interpolation between two scalar fields.
| a,b | Scalar fields, should have the same resolution. |
| t | Interpolant. Optimized with AVX |
| void ScalarField2::Lerp | ( | const ScalarField2 & | a, |
| const ScalarField2 & | b, | ||
| const ScalarField2 & | t ) |
Interpolation between two scalar fields with an alpha scalar field.
Compute (1-t) a + t b.
| a,b | Scalar fields, should have the same resolution. |
| t | Alpha. Optimized with AVX |
| void ScalarField2::Level | ( | const Vector2 & | center, |
| const double & | radius, | ||
| const double & | z ) |
Level the scalar field.
| center | Center. |
| radius | Radius. |
| z | Elevation. |
| SegmentSet2 ScalarField2::LineSegments | ( | const double & | T, |
| bool | closed = false ) const |
Compute the iso-contour of the scalar field.
| T | Threshold. |
| closed | Set to true if polylines should be closed at the border of the domain. |
|
static |
Loads a scalar field from an image.
The function uses a specific image reader with unlimited allocation limit.
| box | The box. |
| path | Name of the image. |
| a,b | Range of values to scale the image. |
|
static |
Import FAW Float 32 bits format from World Machine.
Suppose that the domain is a square.
|
protected |
Compute the local neighborhood in the one-ring aroung a point.
| i,j | Point. |
| ScalarField2 ScalarField2::MaxFilter | ( | int | w | ) | const |
Compute the max filtered scalar field.
| w | Window size. |
| void ScalarField2::MedianFilter | ( | ) |
Filter the field in place with a median filter.
Use ScalarField2::MedianFiltered() to get the filtered field without modifying the field.
| ScalarField2 ScalarField2::MedianFiltered | ( | ) | const |
Compute the median filtered scalar field.
The field is not modified, the filtered field is returned. Edges are not processed.
| ScalarField2 ScalarField2::MinFilter | ( | int | w | ) | const |
Compute the min filtered scalar field.
| w | Window size. |
| void ScalarField2::MorphHitAndMiss | ( | double | k[], |
| int | s ) |
Perform a hit and miss operation on the field.
| k | is the kernel, containing 1 and -1 for hit and miss resp. and 0 for "don't care" |
| s | Size of the kernel (should be odd) |
| ScalarField2 ScalarField2::MorphSkeleton | ( | int | n | ) |
Compute the skeleton using successive erosion/dilatations.
| n | Maximum number of iterations, which is related to the maximum thickness of the shape. |
| ScalarField2 ScalarField2::MorphSkeletonConnected | ( | int | n | ) |
Compute the skeleton using thinning.
| n | Maximum number of iterations, which is related to the maximum thickness of the shape. |
| void ScalarField2::MorphThin | ( | double | k[], |
| int | s ) |
Thinning by using a kernel.
| k | Kernel, containing 1 and -1 for hit and miss respectively, and 0 for don't care. |
| s | Size of the kernel (should be odd). |
| void ScalarField2::Multiply | ( | const Vector2 & | center, |
| const double & | radius, | ||
| const double & | scaling = 1.0 ) |
Multiply the scalar field by a scaling factor locally (not equivalent to Flatten()).
| center | Center. |
| radius | Radius. |
| scaling | Scaling of the effect. |
| void ScalarField2::Normalize | ( | ) |
Normalize the values of a scalar field to unit interval.
Compute range and apply the affine transformation to map values to [0,1].
| QVector< std::pair< double, int > > ScalarField2::OldHistogram | ( | int | n | ) | const |
Compute a histogram.
Compute the range of values taken by the scalar field, and compute the histogram.
| n | Discretization. |
| ScalarField2 ScalarField2::Op | ( | const std::function< double(const ScalarField2 &, int, int)> & | function | ) | const |
Applies a function to the scalar field.
| function | The function. |
| ScalarField2 ScalarField2::Op | ( | const std::function< double(double)> & | function | ) | const |
Applies a function to the scalar field.
| function | The function. |
|
inline |
Return the field value at a given array vertex.
| q | Point. |
|
inline |
Return the field value at a given array vertex.
| i,j | Integer coordinates of the vertex. |
| ScalarField2 & ScalarField2::operator*= | ( | const double & | s | ) |
Scale the values of a scalar field.
| s | Scaling factor. |
| ScalarField2 & ScalarField2::operator*= | ( | const ScalarField2 & | s | ) |
Multiplication.
| s | Scalar field. |
| ScalarField2 & ScalarField2::operator+= | ( | const double & | c | ) |
Add a constant to the values the scalar field.
| c | Constant. |
| ScalarField2 & ScalarField2::operator+= | ( | const ScalarField2 & | s | ) |
Addition.
| s | Scalar field. Optimized with AVX |
|
inline |
Subtract a constant to the values the scalar field.
Provided out of consistency, simply calls ScalarField2::operator+=(const double&) with the negated constant.
| c | Constant. |
| ScalarField2 & ScalarField2::operator-= | ( | const ScalarField2 & | s | ) |
Subtraction.
| s | Scalar field. |
Optimized with AVX
|
inline |
Scale the values of a scalar field.
| s | Scaling factor. |
|
inline |
Return the data in the field.
| c | Index. |
| Mesh2 ScalarField2::Polygonize | ( | const double & | T = 0.0 | ) | const |
Polygonize the scalar field into a surface mesh using the marching square algorithm.
| T | Threshold. |
| void ScalarField2::Pow | ( | const double & | s | ) |
Power.
| s | Real. |
| ScalarField2 ScalarField2::Qurt | ( | ) | const |
Compute the cubic root of the scalar field.
The cubic root is defined for negative values.
Optimized with AVX
| ScalarField2 ScalarField2::Resized | ( | int | x, |
| int | y, | ||
| bool | bicubic = false ) const |
Change the resolution of the scalar field.
Note that because the box should be strictly inside the original domain, this function is not the same as:
| x,y | Sampling size. |
| bicubic | Bicubic flag, set to true to use bicubic interpolation. |
| ScalarField2 ScalarField2::Sample | ( | const Box2 & | box, |
| int | x, | ||
| int | y, | ||
| bool | bicubic = false ) const |
Resample a rectangular region in the scalar field.
| box | Rectangular region, should be strictly inside the domain. |
| x,y | Sampling size. |
| bicubic | Bicubic flag, set to true to use bicubic interpolation. |
| ScalarField2 ScalarField2::Sample | ( | const Segment2 & | segment, |
| const double & | radius ) const |
Sample along a thick segment.
| segment | The segment. |
| radius | Distance in the orthogonal direction to the segment. |
Discretization is adapted from the resolution of the scalar field. At least two samples are used in each direction.
| ScalarField2 ScalarField2::Sample | ( | const Segment2 & | segment, |
| const double & | radius, | ||
| int | nx, | ||
| int | ny ) const |
Sample along a thick segment.
| segment | The segment. |
| radius | Distance in the orthogonal direction to the segment. |
The resulting scalar field is defined over a box of size (length, 2 radius) centered at the origin, its x axis is aligned with the segment. Samples outside of the domain of the scalar field are set to 0.
| nx,ny | Discretization, should be at least 2. |
| void ScalarField2::Scale | ( | const double & | s | ) |
Scale the scalar field.
This function also scales the values, it is different from ScalarField2::Scale(const Vector2&);
| s | Scaling factor. |
| void ScalarField2::Scale | ( | const Vector2 & | s | ) |
Scale the domain of the scalar field.
| s | Scaling factor. |
| double ScalarField2::ScaledNorm | ( | ) | const |
Compute the Euclidean norm of the scalar field, divided by the number of samples.
The result is \( \sqrt{\sum_i f_i^2} / n \) where n is the number of vertices of the field, which is not the root mean square value.
Optimized with AVX
| void ScalarField2::SelfOp | ( | const std::function< double(double)> & | function | ) |
Applies a function to the scalar field.
| function | The function. |
|
protected |
Set the border of the scalar field to a constant value.
| c | Constant. |
| void ScalarField2::SetRange | ( | const double & | a, |
| const double & | b ) |
Scales the scalar field to a given range interval.
| a,b | Interval. |
| void ScalarField2::SignalError | ( | const ScalarField2 & | s, |
| double & | psnr, | ||
| double & | rmse ) const |
Compute PSNR and RMSE between two fields.
PSNR is computed assuming the data has a normalized [0,1] range.
| s | Second scalar field. |
| psnr | Returned PSNR. |
| rmse | Returned RMSE. |
| void ScalarField2::SignalError | ( | const ScalarField2 & | s, |
| double & | psnr, | ||
| double & | mse, | ||
| double & | rmse ) const |
Compute PSNR, MSE and RMSE between two fields.
| s | Second scalar field. |
| psnr | Returned PSNR. |
| mse | Returned MSE. |
| rmse | Returned RMSE. |
| void ScalarField2::Smooth | ( | ) |
Smooth the scalar field using a discrete gaussian kernel.
The function uses a \( 3^2 \) approximation of the Gaussian kernel.
| void ScalarField2::Smooth | ( | const Vector2 & | center, |
| double | r ) |
Smooth the scalar field within a given region.
The smoothing will be applied using the cubic falloff function Cubic::Smooth(const double&, const double&)
| center | Center. |
| r | Radius. |
| void ScalarField2::Smooth | ( | int | n | ) |
Applies several smoothing steps to the scalar field.
| n | Number of smoothing steps. |
|
protected |
Compute a smoothed value at a given point in the scalar field.
The function uses a \( 3^2 \) approximation of the Gaussian kernel.
| x,y | Integer coordinates of the point. |
| void ScalarField2::SmoothSmall | ( | ) |
Small smoothing of the scalar field using a discrete gaussian kernel.
The function uses a \( 3^2 \) approximation of the Gaussian kernel.
| void ScalarField2::SmoothStep | ( | const double & | a, |
| const double & | b, | ||
| bool | s = false ) |
Perform a smooth step over the values of a scalar field.
Either the function Cubic::Step() or Quintic::Step() is applied to all the values of the field.
| a,b | Interval. |
| s | Smoothing Boolean value, apply a quintic smoothing kernel if set to true. |
| ScalarField2 ScalarField2::Sqrt | ( | ) | const |
Compute the square root of the scalar field.
Optimized with AVX
| void ScalarField2::Sqrted | ( | ) |
Compute the square root of the scalar field.
This function changes the values of the field.
| double ScalarField2::StandardDeviation | ( | ) | const |
Compute the standard deviation.
Optimized with AVX
| double ScalarField2::StandardDeviation | ( | const double & | m | ) | const |
Compute the standard deviation.
| m | Mean. |
| void ScalarField2::Step | ( | const double & | a, |
| const double & | b ) |
Perform a linear step over the values of a scalar field.
The function Linear::Step() is applied to all the values of the field.
| a,b | Interval. |
| void ScalarField2::Subdivide | ( | ) |
Subdivide the scalar field.
Simply doubles the resolution and interpolate the values from the existing ones.
| double ScalarField2::Sum | ( | ) | const |
Compute the sum of the elements in the scalar field.
Optimized with AVX
| void ScalarField2::Symmetry | ( | bool | x = true, |
| bool | y = false ) |
Perform a symmetry.
| x,y | Axes of symmetry. |
| QImage ScalarField2::Texture | ( | const QImage & | texture | ) | const |
Compute a texture based on the sediment field.
| texture | Input texture. |
| void ScalarField2::Translate | ( | const Vector2 & | t | ) |
Translate the domain of the scalar field.
| t | Translation vector. |
|
virtual |
Get the field value with world coordinate system.
This function computes a triangular interpolation of the values.
| p | Point (should be strictly within bounding box of the domain). |
| void ScalarField2::Unitize | ( | ) |
Linearly scale the values of a scalar field to unit interval.
This function differs from ScalarField2::Normalize() which maps values to [0,1]. Instead, we divide scalard field values by the maximum of the absolute value of the scalar field, which maps values to [-1,1] and preserves 0 and the sign of the values. A constant field is mapped to its sign (-1, 0 or 1), and a null field is left unchanged.
Optimized with AVX
| ScalarField2 ScalarField2::UpSample | ( | int | f, |
| bool | bicubic = false ) const |
Upsampling of the scalarfield.
| f | Upsampling factor. |
| bicubic | Bicubic flag, set to true to use bicubic interpolation. |
|
virtual |
Get the field value at a given point.
This function computes a bi-linear interpolation of the values.
| p | Point (should be strictly inside the box domain). |
|
virtual |
Return the field value at a given array vertex.
| i,j | Integer coordinates of the array vertex. |
|
friend |
Multiplication.
| a | Scalar field. |
| x | Real. |
|
friend |
Multiplication.
| a | Scalar field. |
| x | Real. |
|
friend |
Multiplication.
| a | Scalar field. |
| b | Scalar field. |
|
friend |
Addition.
| a | Scalar field. |
| x | Real. |
|
friend |
Addition.
| a,b | Scalar fields. |
|
friend |
Subtraction.
| x | Real. |
| a | Scalar field. |
|
friend |
Subtraction.
| a | Scalar field. |
| x | Real. |
|
friend |
Subtraction.
| a,b | Scalar fields. |
|
friend |
Inverse.
| a | Scalar field. |
| x | Real. |
|
friend |
Division.
Rely on multiplication by inverse.
| a | Scalar field. |
| x | Real. |
|
friend |
Overloaded.
| s | Stream. |
| scalar | The scalar field. |