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

    Constructors
    Constructor
    Description
    Component(int label, int area, int centroidX, int centroidY, int boundsX, int boundsY, int boundsWidth, int boundsHeight)
    Creates an instance of a Component record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the area record component.
    int
    Returns the value of the boundsHeight record component.
    int
    Returns the value of the boundsWidth record component.
    int
    Returns the value of the boundsX record component.
    int
    Returns the value of the boundsY record component.
    int
    Returns the value of the centroidX record component.
    int
    Returns the value of the centroidY record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the label record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a Component record class.
      Parameters:
      label - the value for the label record component
      area - the value for the area record component
      centroidX - the value for the centroidX record component
      centroidY - the value for the centroidY record component
      boundsX - the value for the boundsX record component
      boundsY - the value for the boundsY record component
      boundsWidth - the value for the boundsWidth record component
      boundsHeight - the value for the boundsHeight record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • label

      public int label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • area

      public int area()
      Returns the value of the area record component.
      Returns:
      the value of the area record component
    • centroidX

      public int centroidX()
      Returns the value of the centroidX record component.
      Returns:
      the value of the centroidX record component
    • centroidY

      public int centroidY()
      Returns the value of the centroidY record component.
      Returns:
      the value of the centroidY record component
    • boundsX

      public int boundsX()
      Returns the value of the boundsX record component.
      Returns:
      the value of the boundsX record component
    • boundsY

      public int boundsY()
      Returns the value of the boundsY record component.
      Returns:
      the value of the boundsY record component
    • boundsWidth

      public int boundsWidth()
      Returns the value of the boundsWidth record component.
      Returns:
      the value of the boundsWidth record component
    • boundsHeight

      public int boundsHeight()
      Returns the value of the boundsHeight record component.
      Returns:
      the value of the boundsHeight record component