diplib/generation.h file

Functions for generating image data. See Generation.

Contents

Classes

class dip::FreeTypeTool
Class used to draw text using a specified font file (TTF, OTF, etc).
struct dip::TestObjectParams
Describes the parameters for a test object, used by dip::TestObject.

Functions

void dip::SetBorder(dip::Image& out, dip::Image::Pixel const& value = {0}, dip::UnsignedArray const& sizes = {1})
Sets the pixels at the border of out to value.
void dip::ApplyWindow(dip::Image const& in, dip::Image& out, dip::String const& type = "Hamming", dip::dfloat parameter = 0.5)
Multiplies the image with a windowing function.
void dip::DrawLine(dip::Image& out, dip::UnsignedArray const& start, dip::UnsignedArray const& end, dip::Image::Pixel const& value = {1}, dip::String const& blend = S::ASSIGN)
Draws a Bresenham line in an image.
void dip::DrawLines(dip::Image& out, dip::CoordinateArray const& points, dip::Image::Pixel const& value = {1}, dip::String const& blend = S::ASSIGN)
Draws a series of Bresenham lines in an image.
void dip::DrawPolygon2D(dip::Image& out, dip::Polygon const& polygon, dip::Image::Pixel const& value = {1}, dip::String const& mode = S::FILLED)
Draws a polygon in a 2D image.
void dip::DrawEllipsoid(dip::Image& out, dip::FloatArray const& sizes, dip::FloatArray const& origin, dip::Image::Pixel const& value = {1})
Draws a solid ellipsoid in an image.
void dip::DrawDiamond(dip::Image& out, dip::FloatArray const& sizes, dip::FloatArray const& origin, dip::Image::Pixel const& value = {1})
Draws a solid diamond in an image.
void dip::DrawBox(dip::Image& out, dip::FloatArray const& sizes, dip::FloatArray const& origin, dip::Image::Pixel const& value = {1})
Draws a solid box (rectangle) in an image.
void dip::DrawBandlimitedPoint(dip::Image& out, dip::FloatArray origin, dip::Image::Pixel const& value = {1}, dip::FloatArray sigmas = {1.0}, dip::dfloat truncation = 3.0)
Draws an approximately bandlimited point in the image, in the form of a Gaussian blob.
void dip::DrawBandlimitedLine(dip::Image& out, dip::FloatArray start, dip::FloatArray end, dip::Image::Pixel const& value = {1}, dip::dfloat sigma = 1.0, dip::dfloat truncation = 3.0)
Draws an approximately bandlimited line between two points in the image, using Gaussian profiles.
void dip::DrawBandlimitedBall(dip::Image& out, dip::dfloat diameter, dip::FloatArray origin, dip::Image::Pixel const& value = {1}, dip::String const& mode = S::FILLED, dip::dfloat sigma = 1.0, dip::dfloat truncation = 3.0)
Draws an approximately bandlimited ball (disk) or an n-sphere (circle) in an image, using Gaussian profiles.
void dip::DrawBandlimitedBox(dip::Image& out, dip::FloatArray sizes, dip::FloatArray origin, dip::Image::Pixel const& value = {1}, dip::String const& mode = S::FILLED, dip::dfloat sigma = 1.0, dip::dfloat truncation = 3.0)
Draws an approximately bandlimited box (rectangle) in an image, using Gaussian profiles.
void dip::BlendBandlimitedMask(dip::Image& out, dip::Image const& mask, dip::Image const& value = dip::Image({255}), dip::IntegerArray pos = {})
Blends value into out at position pos, according to mask.
void dip::DrawText(dip::Image& out, dip::String const& text, dip::FloatArray origin, dip::Image::Pixel const& value = {1}, dip::dfloat orientation = 0, dip::String const& align = S::LEFT)
Draws text with the built-in, fixed-sized glyphs.
auto dip::DrawText(dip::String const& text, dip::dfloat orientation = 0) -> dip::Image
Alternate version of the function above that returns a new image tightly cropped around the rendered text.
void dip::GaussianEdgeClip(dip::Image const& in, dip::Image& out, dip::Image::Pixel const& value = {1}, dip::dfloat sigma = 1.0, dip::dfloat truncation = 3.0)
Maps input values through an error function, can be used to generate arbitrary band-limited objects.
void dip::GaussianLineClip(dip::Image const& in, dip::Image& out, dip::Image::Pixel const& value = {1}, dip::dfloat sigma = 1.0, dip::dfloat truncation = 3.0)
Maps input values through a Gaussian function, can be used to generate arbitrary band-limited lines.
void dip::FillDelta(dip::Image& out, dip::String const& origin = "")
Fills an image with a delta function.
void dip::CreateDelta(dip::Image& out, dip::UnsignedArray const& sizes, dip::String const& origin = "")
Creates a delta function image.
auto dip::CreateDelta(dip::UnsignedArray const& sizes, dip::String const& origin = "") -> dip::Image
Overload for the function above, which takes image sizes instead of an image.
void dip::CreateGauss(dip::Image& out, dip::FloatArray const& sigmas, dip::UnsignedArray derivativeOrder = {0}, dip::dfloat truncation = 3.0, dip::UnsignedArray exponents = {0})
Creates a Gaussian kernel.
void dip::CreateGabor(dip::Image& out, dip::FloatArray const& sigmas, dip::FloatArray const& frequencies, dip::dfloat truncation = 3.0)
Creates a Gabor kernel.
void dip::FTEllipsoid(dip::Image& out, dip::FloatArray radius = {1}, dip::dfloat amplitude = 1)
Generates the Fourier transform of an ellipsoid.
auto dip::FTEllipsoid(dip::UnsignedArray const& sizes, dip::FloatArray radius = {1}, dip::dfloat amplitude = 1) -> dip::Image
Overload for the function above, which takes image sizes instead of an image.
void dip::FTBox(dip::Image& out, dip::FloatArray length = {1}, dip::dfloat amplitude = 1)
Generates the Fourier transform of a box.
auto dip::FTBox(dip::UnsignedArray const& sizes, dip::FloatArray length = {1}, dip::dfloat amplitude = 1) -> dip::Image
Overload for the function above, which takes image sizes instead of an image.
void dip::FTCross(dip::Image& out, dip::FloatArray length = {1}, dip::dfloat amplitude = 1)
Generates the Fourier transform of a cross.
auto dip::FTCross(dip::UnsignedArray const& sizes, dip::FloatArray length = {1}, dip::dfloat amplitude = 1) -> dip::Image
Overload for the function above, which takes image sizes instead of an image.
void dip::FTGaussian(dip::Image& out, dip::FloatArray sigma, dip::dfloat amplitude = 1, dip::dfloat truncation = 3)
Generates the Fourier transform of a Gaussian.
auto dip::FTGaussian(dip::UnsignedArray const& sizes, dip::FloatArray sigma, dip::dfloat amplitude = 1, dip::dfloat truncation = 3) -> dip::Image
Overload for the function above, which takes image sizes instead of an image.
void dip::TestObject(dip::Image& out, dip::TestObjectParams const& params, dip::Random& random)
Generates a test object according to params.
auto dip::TestObject(dip::UnsignedArray const& sizes, dip::TestObjectParams const& params, dip::Random& random) -> dip::Image
Overload for the function above, which takes image sizes instead of an image.
void dip::TestObject(dip::Image& out, dip::TestObjectParams const& params = {})
Calls the main dip::TestObject function with a default-initialized dip::Random object.
auto dip::TestObject(dip::UnsignedArray const& sizes = {256,256}, dip::TestObjectParams const& params = {}) -> dip::Image
Overload for the function above, which takes image sizes instead of an image.
void dip::FillPoissonPointProcess(dip::Image& out, dip::Random& random, dip::dfloat density = 0.01)
Fills the binary image out with a Poisson point process of density.
void dip::CreatePoissonPointProcess(dip::Image& out, dip::UnsignedArray const& sizes, dip::Random& random, dip::dfloat density = 0.01)
Creates a binary image with a Poisson point process of density.
void dip::FillRandomGrid(dip::Image& out, dip::Random& random, dip::dfloat density = 0.01, dip::String const& type = S::RECTANGULAR, dip::String const& mode = S::TRANSLATION)
Fills the binary image out with a grid that is randomly placed over the image.
void dip::CreateRandomGrid(dip::Image& out, dip::UnsignedArray const& sizes, dip::Random& random, dip::dfloat density = 0.01, dip::String const& type = S::RECTANGULAR, dip::String const& mode = S::TRANSLATION)
Creates a binary image with a random grid.
void dip::FillRamp(dip::Image& out, dip::uint dimension, dip::StringSet const& mode = {})
Fills an image with a ramp function.
void dip::CreateRamp(dip::Image& out, dip::UnsignedArray const& sizes, dip::uint dimension, dip::StringSet const& mode = {})
Creates a ramp function image.
void dip::FillXCoordinate(dip::Image& out, dip::StringSet const& mode = {})
Fills an image with a ramp function that increases along the x-axis.
void dip::CreateXCoordinate(dip::Image& out, dip::UnsignedArray const& sizes, dip::StringSet const& mode = {})
Creates a ramp function image.
void dip::FillYCoordinate(dip::Image& out, dip::StringSet const& mode = {})
Fills an image with a ramp function that increases along the y-axis.
void dip::CreateYCoordinate(dip::Image& out, dip::UnsignedArray const& sizes, dip::StringSet const& mode = {})
Creates a ramp function image.
void dip::FillZCoordinate(dip::Image& out, dip::StringSet const& mode = {})
Fills an image with a ramp function that increases along the z-axis.
void dip::CreateZCoordinate(dip::Image& out, dip::UnsignedArray const& sizes, dip::StringSet const& mode = {})
Creates a ramp function image.
void dip::FillRadiusCoordinate(dip::Image& out, dip::StringSet const& mode = {})
Fills an image with the distance to the origin.
void dip::CreateRadiusCoordinate(dip::Image& out, dip::UnsignedArray const& sizes, dip::StringSet const& mode = {})
Creates an image filled with the distance to the origin.
void dip::FillRadiusSquareCoordinate(dip::Image& out, dip::StringSet const& mode = {})
Fills an image with the square distance to the origin.
void dip::CreateRadiusSquareCoordinate(dip::Image& out, dip::UnsignedArray const& sizes, dip::StringSet const& mode = {})
Creates an image filled with the square distance to the origin.
void dip::FillPhiCoordinate(dip::Image& out, dip::StringSet const& mode = {})
Fills an image with the angle to the x-axis within the x-y plane.
void dip::CreatePhiCoordinate(dip::Image& out, dip::UnsignedArray const& sizes, dip::StringSet const& mode = {})
Creates an image filled with the angle to the x-axis within the x-y plane.
void dip::FillThetaCoordinate(dip::Image& out, dip::StringSet const& mode = {})
Fills an image with the angle to the z-axis.
void dip::CreateThetaCoordinate(dip::Image& out, dip::UnsignedArray const& sizes, dip::StringSet const& mode = {})
Creates an image filled with the angle to the z-axis.
void dip::FillCoordinates(dip::Image& out, dip::StringSet const& mode = {}, dip::String const& system = S::CARTESIAN)
Fills an image with the coordinates of each pixel.
void dip::CreateCoordinates(dip::Image& out, dip::UnsignedArray const& sizes, dip::StringSet const& mode = {}, dip::String const& system = S::CARTESIAN)
Creates an image filled with the coordinates of each pixel.
void dip::FillDistanceToPoint(dip::Image& out, dip::FloatArray const& point, dip::String const& distance = S::EUCLIDEAN, dip::FloatArray scaling = {})
Fills an image with the distance to a given point.
void dip::DistanceToPoint(dip::Image& out, dip::UnsignedArray const& sizes, dip::FloatArray const& point, dip::String const& distance = S::EUCLIDEAN, dip::FloatArray scaling = {})
Creates an image filled with the distance to a given point.
void dip::EuclideanDistanceToPoint(dip::Image& out, dip::UnsignedArray const& sizes, dip::FloatArray const& point, dip::FloatArray scaling = {})
Creates an image filled with the Euclidean distance to a given point.
void dip::CityBlockDistanceToPoint(dip::Image& out, dip::UnsignedArray const& sizes, dip::FloatArray const& point, dip::FloatArray scaling = {})
Creates an image filled with the city block distance to a given point.
void dip::UniformNoise(dip::Image const& in, dip::Image& out, dip::Random& random, dip::dfloat lowerBound = 0.0, dip::dfloat upperBound = 1.0)
Adds uniformly distributed white noise to the input image.
void dip::GaussianNoise(dip::Image const& in, dip::Image& out, dip::Random& random, dip::dfloat variance = 1.0)
Adds normally distributed white noise to the input image.
void dip::PoissonNoise(dip::Image const& in, dip::Image& out, dip::Random& random, dip::dfloat conversion = 1.0)
Adds Poisson-distributed white noise to the input image.
void dip::BinaryNoise(dip::Image const& in, dip::Image& out, dip::Random& random, dip::dfloat p10 = 0.05, dip::dfloat p01 = 0.05)
Adds noise to the binary input image.
void dip::SaltPepperNoise(dip::Image const& in, dip::Image& out, dip::Random& random, dip::dfloat p0 = 0.05, dip::dfloat p1 = 0.05, dip::dfloat white = 1.0)
Adds salt-and-pepper noise to the input image.
void dip::FillColoredNoise(dip::Image& out, dip::Random& random, dip::dfloat variance = 1.0, dip::dfloat color = -2.0)
Fills out with colored (Brownian, pink, blue, violet) noise.
void dip::ColoredNoise(dip::Image const& in, dip::Image& out, dip::Random& random, dip::dfloat variance = 1.0, dip::dfloat color = -2.0)
Adds colored (Brownian, pink, blue, violet) noise to in.