Record Class ConnectedComponentsOp.Component
java.lang.Object
java.lang.Record
cloud.opencode.base.image.analysis.ConnectedComponentsOp.Component
- Record Components:
label- the unique label identifier | 唯一标签标识area- the number of pixels in this component | 该连通域的像素数量centroidX- the x coordinate of the centroid (mean x) | 质心 x 坐标(x 均值)centroidY- the y coordinate of the centroid (mean y) | 质心 y 坐标(y 均值)boundsX- the x coordinate of the bounding box top-left | 边界框左上角 x 坐标boundsY- the y coordinate of the bounding box top-left | 边界框左上角 y 坐标boundsWidth- the width of the bounding box | 边界框宽度boundsHeight- the height of the bounding box | 边界框高度
- Enclosing class:
ConnectedComponentsOp
public static record ConnectedComponentsOp.Component(int label, int area, int centroidX, int centroidY, int boundsX, int boundsY, int boundsWidth, int boundsHeight)
extends Record
A single connected component with its statistics.
单个连通域及其统计信息。
- Since:
- JDK 25, opencode-base-image V2.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionComponent(int label, int area, int centroidX, int centroidY, int boundsX, int boundsY, int boundsWidth, int boundsHeight) Creates an instance of aComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintarea()Returns the value of thearearecord component.intReturns the value of theboundsHeightrecord component.intReturns the value of theboundsWidthrecord component.intboundsX()Returns the value of theboundsXrecord component.intboundsY()Returns the value of theboundsYrecord component.intReturns the value of thecentroidXrecord component.intReturns the value of thecentroidYrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlabel()Returns the value of thelabelrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Component
public Component(int label, int area, int centroidX, int centroidY, int boundsX, int boundsY, int boundsWidth, int boundsHeight) Creates an instance of aComponentrecord class.- Parameters:
label- the value for thelabelrecord componentarea- the value for thearearecord componentcentroidX- the value for thecentroidXrecord componentcentroidY- the value for thecentroidYrecord componentboundsX- the value for theboundsXrecord componentboundsY- the value for theboundsYrecord componentboundsWidth- the value for theboundsWidthrecord componentboundsHeight- the value for theboundsHeightrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
label
-
area
-
centroidX
-
centroidY
-
boundsX
-
boundsY
-
boundsWidth
public int boundsWidth()Returns the value of theboundsWidthrecord component.- Returns:
- the value of the
boundsWidthrecord component
-
boundsHeight
public int boundsHeight()Returns the value of theboundsHeightrecord component.- Returns:
- the value of the
boundsHeightrecord component
-