Record Class ConnectedComponentsOp.Result
java.lang.Object
java.lang.Record
cloud.opencode.base.image.analysis.ConnectedComponentsOp.Result
- Record Components:
labels- 2D label matrix where labels[y][x] is the component label (0 = background) | 二维标签矩阵,labels[y][x] 为连通域标签(0 = 背景)components- the list of detected components sorted by label | 按标签排序的检测到的连通域列表
- Enclosing class:
ConnectedComponentsOp
public static record ConnectedComponentsOp.Result(int[][] labels, List<ConnectedComponentsOp.Component> components)
extends Record
The result of connected component analysis.
连通域分析结果。
- Since:
- JDK 25, opencode-base-image V2.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionResult(int[][] labels, List<ConnectedComponentsOp.Component> components) Create a result with defensive copy of the component list. -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of connected components found.Returns the value of thecomponentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.int[][]labels()Returns the value of thelabelsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Result
Create a result with defensive copy of the component list. 创建结果,对连通域列表进行防御性拷贝。- Parameters:
labels- the label matrix | 标签矩阵components- the component list | 连通域列表
-
-
Method Details
-
componentCount
public int componentCount()Get the number of connected components found. 获取找到的连通域数量。- Returns:
- the component count | 连通域数量
-
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 withObjects::equals(Object,Object). -
labels
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-