diplib/binary.h file

Functions for binary image processing. See Binary image filters.

Contents

Classes

class dip::Interval
Represents the shape of an interval for inf-generating and sup-generating operators.

Aliases

using dip::IntervalArray = std::vector<Interval>
An array of intervals.

Functions

void dip::BinaryDilation(dip::Image const& in, dip::Image& out, dip::sint connectivity = -1, dip::uint iterations = 3, dip::String const& edgeCondition = S::BACKGROUND)
Binary morphological dilation operation.
void dip::BinaryErosion(dip::Image const& in, dip::Image& out, dip::sint connectivity = -1, dip::uint iterations = 3, dip::String const& edgeCondition = S::OBJECT)
Binary morphological erosion operation.
void dip::BinaryClosing(dip::Image const& in, dip::Image& out, dip::sint connectivity = -1, dip::uint iterations = 3, dip::String const& edgeCondition = S::SPECIAL)
Binary morphological closing operation.
void dip::BinaryOpening(dip::Image const& in, dip::Image& out, dip::sint connectivity = -1, dip::uint iterations = 3, dip::String const& edgeCondition = S::SPECIAL)
Binary morphological opening operation.
void dip::IsotropicDilation(dip::Image const& in, dip::Image& out, dip::dfloat distance)
Isotropic dilation of binary image.
void dip::IsotropicErosion(dip::Image const& in, dip::Image& out, dip::dfloat distance)
Isotropic erosion of binary image.
void dip::IsotropicClosing(dip::Image const& in, dip::Image& out, dip::dfloat distance)
Isotropic closing of binary image.
void dip::IsotropicOpening(dip::Image const& in, dip::Image& out, dip::dfloat distance)
Isotropic opening of binary image.
void dip::BinaryPropagation(dip::Image const& inSeed, dip::Image const& inMask, dip::Image& out, dip::sint connectivity = 1, dip::uint iterations = 0, dip::String const& edgeCondition = S::BACKGROUND)
Morphological propagation of binary objects.
void dip::EdgeObjectsRemove(dip::Image const& c_in, dip::Image& out, dip::uint connectivity = 1)
Remove edge objects from a binary or labeled image.
void dip::FillHoles(dip::Image const& in, dip::Image& out, dip::uint connectivity = 1)
Fill holes in binary image.
void dip::ConditionalThickening2D(dip::Image const& c_in, dip::Image const& c_mask, dip::Image& out, dip::uint iterations = 0, dip::String const& endPixelCondition = S::LOSE, dip::String const& edgeCondition = S::BACKGROUND)
Thickens the image in conditioned on the mask (2D only).
void dip::ConditionalThinning2D(dip::Image const& in, dip::Image const& mask, dip::Image& out, dip::uint iterations = 0, dip::String const& endPixelCondition = S::LOSE, dip::String const& edgeCondition = S::BACKGROUND)
Thins the image in conditioned on the mask (2D only).
void dip::BinaryAreaOpening(dip::Image const& in, dip::Image& out, dip::uint filterSize, dip::uint connectivity = 0, dip::String const& edgeCondition = S::BACKGROUND)
Computes the area opening of a binary image
void dip::BinaryAreaClosing(dip::Image const& in, dip::Image& out, dip::uint filterSize, dip::uint connectivity = 0, dip::String const& s_edgeCondition = S::BACKGROUND)
Computes the area closing of a binary image, by calling dip::BinaryAreaOpening on the inverse of the input image.
void dip::EuclideanSkeleton(dip::Image const& in, dip::Image& out, dip::String const& endPixelCondition = S::NATURAL, dip::String const& edgeCondition = S::BACKGROUND)
Accurate binary skeleton (2D and 3D only).
void dip::CountNeighbors(dip::Image const& in, dip::Image& out, dip::uint connectivity = 0, dip::String const& mode = S::FOREGROUND, dip::String const& edgeCondition = S::BACKGROUND)
Counts the number of set neighbors for each pixel in the binary image in.
void dip::MajorityVote(dip::Image const& in, dip::Image& out, dip::uint connectivity = 0, dip::String const& edgeCondition = S::BACKGROUND)
Filters the binary image by setting each pixel to the phase with more pixels in the neighborhood.
void dip::GetSinglePixels(dip::Image const& in, dip::Image& out, dip::uint connectivity = 0, dip::String const& edgeCondition = S::BACKGROUND)
Returns the isolated pixels in the binary image in. That is, the set pixels with zero neighbors. See dip::CountNeighbors.
void dip::GetEndPixels(dip::Image const& in, dip::Image& out, dip::uint connectivity = 0, dip::String const& edgeCondition = S::BACKGROUND)
Returns the end pixels in the skeleton image in. That is, the set pixels with one neighbor. See dip::CountNeighbors.
void dip::GetLinkPixels(dip::Image const& in, dip::Image& out, dip::uint connectivity = 0, dip::String const& edgeCondition = S::BACKGROUND)
Returns the link pixels in the skeleton image in. That is, the set pixels with two neighbors. See dip::CountNeighbors.
void dip::GetBranchPixels(dip::Image const& in, dip::Image& out, dip::uint connectivity = 0, dip::String const& edgeCondition = S::BACKGROUND)
Returns the branch pixels in the skeleton image in. That is, the set pixels with more than two neighbors. See dip::CountNeighbors.
void dip::Invert(dip::IntervalArray& array)
Inverts the intervals in the array, swapping foreground and background pixels. Works correctly if intervals in the array share data. However, this function could also affect other intervals not in the array, if data is shared.
void dip::SupGenerating(dip::Image const& in, dip::Image& out, dip::Interval const& interval, dip::String const& boundaryCondition = S::ADD_ZEROS)
Sup-generating operator, also known as hit-miss operator.
void dip::InfGenerating(dip::Image const& in, dip::Image& out, dip::Interval const& interval, dip::String const& boundaryCondition = S::ADD_ZEROS)
Inf-generating operator, the dual of the hit-miss operator.
void dip::UnionSupGenerating(dip::Image const& in, dip::Image& out, dip::IntervalArray const& intervals, dip::String const& boundaryCondition = S::ADD_ZEROS)
Union of sup-generating operators.
void dip::UnionSupGenerating2D(dip::Image const& in, dip::Image& out, dip::Interval const& interval, dip::uint rotationAngle = 45, dip::String const& rotationDirection = S::INTERLEAVED_CLOCKWISE, dip::String const& boundaryCondition = S::ADD_ZEROS)
Union of sup-generating operators.
void dip::IntersectionInfGenerating(dip::Image const& in, dip::Image& out, dip::IntervalArray const& intervals, dip::String const& boundaryCondition = S::ADD_ZEROS)
Intersection of inf-generating operators.
void dip::IntersectionInfGenerating2D(dip::Image const& in, dip::Image& out, dip::Interval const& interval, dip::uint rotationAngle = 45, dip::String const& rotationDirection = S::INTERLEAVED_CLOCKWISE, dip::String const& boundaryCondition = S::ADD_ZEROS)
Intersection of inf-generating operators.
void dip::Thickening(dip::Image const& in, dip::Image const& mask, dip::Image& out, dip::IntervalArray const& intervals, dip::uint iterations = 0, dip::String const& boundaryCondition = S::ADD_ZEROS)
Applies the thickening operator, optionally constrained by a mask, to an image.
void dip::Thickening2D(dip::Image const& in, dip::Image const& mask, dip::Image& out, dip::Interval const& interval, dip::uint iterations = 0, dip::uint rotationAngle = 45, dip::String const& rotationDirection = S::INTERLEAVED_CLOCKWISE, dip::String const& boundaryCondition = S::ADD_ZEROS)
Applies the thickening operator, optionally constrained by a mask, to an image.
void dip::Thinning(dip::Image const& in, dip::Image const& mask, dip::Image& out, dip::IntervalArray const& intervals, dip::uint iterations = 0, dip::String const& boundaryCondition = S::ADD_ZEROS)
Applies the thinning operator, optionally constrained by a mask, to an image.
void dip::Thinning2D(dip::Image const& in, dip::Image const& mask, dip::Image& out, dip::Interval const& interval, dip::uint iterations = 0, dip::uint rotationAngle = 45, dip::String const& rotationDirection = S::INTERLEAVED_CLOCKWISE, dip::String const& boundaryCondition = S::ADD_ZEROS)
Applies the thinning operator, optionally constrained by a mask, to an image.
auto dip::HomotopicThinningInterval2D(dip::uint connectivity = 2) -> dip::IntervalArray
Returns a 2D interval array for homotopic thinning.
auto dip::HomotopicThickeningInterval2D(dip::uint connectivity = 2) -> dip::IntervalArray
Returns a 2D interval array for homotopic thickening.
auto dip::EndPixelInterval2D(dip::uint connectivity = 2) -> dip::IntervalArray
Returns an interval array for detecting end pixels. Includes isolated pixels.
auto dip::HomotopicEndPixelInterval2D(dip::uint connectivity = 2) -> dip::IntervalArray
Returns an interval array for detecting end pixels. Excludes isolated pixels
auto dip::HomotopicInverseEndPixelInterval2D(dip::uint connectivity = 2) -> dip::IntervalArray
Returns an interval array for detecting end background pixels. Excludes isolated pixels.
auto dip::SinglePixelInterval(dip::uint nDims = 2) -> dip::Interval
Returns an interval for detecting single pixels. Use with dip::SupGenerating to detect isolated pixels. Note that dip::GetSinglePixels is more efficient.
auto dip::BranchPixelInterval2D() -> dip::IntervalArray
Returns a 2D interval array for detecting branch pixels.
auto dip::BoundaryPixelInterval2D() -> dip::Interval
Returns a 2D interval for detecting boundary pixels.
auto dip::ConvexHullInterval2D() -> dip::IntervalArray
Returns a 2D interval array to thicken to a convex hull.