java.lang.Object
imagingbook.common.regions.BinaryRegion
imagingbook.common.regions.SegmentationBackedRegion
- All Implemented Interfaces:
GenericProperties,Comparable<BinaryRegion>,Iterable<Pnt2d>
Defines a binary region that is backed by the label array of a region segmentation. A
SegmentationBackedRegion instance does not have its own list or array of contained pixel coordinates but
refers to the label array of the associated BinaryRegionSegmentation instance.- Version:
- 2020/12/21
-
Nested Class Summary
Nested classes/interfaces inherited from interface imagingbook.common.util.GenericProperties
GenericProperties.PropertyKey<T>, GenericProperties.PropertyMap -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(int u, int v) Checks if the given pixel position is contained in thisSegmentationBackedRegioninstance.Get the x/y axes-parallel bounding box as a rectangle (including the extremal coordinates).Get all inner contours of this region if available, null otherwise.intgetLabel()Returns the label (number) of this region.Returns the (single) outer contour of this region if available, null otherwise.intgetSize()Get the size of this region.longgetX1Sum()Returns the sum of the x-coordinates of the points contained in this region.longgetX2Sum()Returns the sum of the squared x-coordinates of the points contained in this region.longgetXYSum()Returns the sum of the mixed x*y-coordinates of the points contained in this region.longgetY1Sum()Returns the sum of the y-coordinates of the points contained in this region.longgetY2Sum()Returns the sum of the squared y-coordinates of the points contained in this region.iterator()Methods inherited from class imagingbook.common.regions.BinaryRegion
compareTo, contains, getCenter, getCentralMoments, getCovarianceMatrix, getEquivalentEllipse, getMoments, getPropertyMap, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface imagingbook.common.util.GenericProperties
clearAllProperties, getProperty, removeProperty, setPropertyMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getLabel
Returns the label (number) of this region.- Returns:
- the region label
-
getSize
Description copied from class:BinaryRegionGet the size of this region.- Specified by:
getSizein classBinaryRegion- Returns:
- the number of region points.
-
getX1Sum
Description copied from class:BinaryRegionReturns the sum of the x-coordinates of the points contained in this region.- Specified by:
getX1Sumin classBinaryRegion- Returns:
- the sum of x-values.
-
getY1Sum
Description copied from class:BinaryRegionReturns the sum of the y-coordinates of the points contained in this region.- Specified by:
getY1Sumin classBinaryRegion- Returns:
- the sum of y-values.
-
getX2Sum
Description copied from class:BinaryRegionReturns the sum of the squared x-coordinates of the points contained in this region.- Specified by:
getX2Sumin classBinaryRegion- Returns:
- the sum of squared x-values.
-
getY2Sum
Description copied from class:BinaryRegionReturns the sum of the squared y-coordinates of the points contained in this region.- Specified by:
getY2Sumin classBinaryRegion- Returns:
- the sum of squared y-values.
-
getXYSum
Description copied from class:BinaryRegionReturns the sum of the mixed x*y-coordinates of the points contained in this region.- Specified by:
getXYSumin classBinaryRegion- Returns:
- the sum of xy-values.
-
getBoundingBox
Description copied from class:BinaryRegionGet the x/y axes-parallel bounding box as a rectangle (including the extremal coordinates).- Specified by:
getBoundingBoxin classBinaryRegion- Returns:
- the bounding box rectangle.
-
iterator
-
getOuterContour
Description copied from class:BinaryRegionReturns the (single) outer contour of this region if available, null otherwise. Points on an outer contour are arranged in clockwise order.- Specified by:
getOuterContourin classBinaryRegion- Returns:
- the outer contour or
nullif not available
-
getInnerContours
Description copied from class:BinaryRegionGet all inner contours of this region if available, null otherwise. Points on inner contours are arranged in counter-clockwise order.- Specified by:
getInnerContoursin classBinaryRegion- Returns:
- the (possibly empty) list of inner contours or
nullif not available
-
contains
Checks if the given pixel position is contained in thisSegmentationBackedRegioninstance.- Specified by:
containsin classBinaryRegion- Parameters:
u- x-coordinatev- y-coordinate- Returns:
- true if (u,v) is contained in this region
-