Record Class TemplateMatchOp.MatchResult

java.lang.Object
java.lang.Record
cloud.opencode.base.image.analysis.TemplateMatchOp.MatchResult
Record Components:
x - the x coordinate of the top-left corner of the match | 匹配左上角的 x 坐标
y - the y coordinate of the top-left corner of the match | 匹配左上角的 y 坐标
score - the NCC score in [-1, 1], where 1.0 = perfect match | NCC 分数,范围 [-1, 1],1.0 = 完美匹配
Enclosing class:
TemplateMatchOp

public static record TemplateMatchOp.MatchResult(int x, int y, double score) extends Record
A template match result at a specific position with its NCC score. 特定位置的模板匹配结果及其 NCC 分数。
Since:
JDK 25, opencode-base-image V2.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Summary

    Constructors
    Constructor
    Description
    MatchResult(int x, int y, double score)
    Creates an instance of a MatchResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the score record component.
    final String
    Returns a string representation of this record class.
    int
    x()
    Returns the value of the x record component.
    int
    y()
    Returns the value of the y record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MatchResult

      public MatchResult(int x, int y, double score)
      Creates an instance of a MatchResult record class.
      Parameters:
      x - the value for the x record component
      y - the value for the y record component
      score - the value for the score 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.
    • x

      public int x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public int y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • score

      public double score()
      Returns the value of the score record component.
      Returns:
      the value of the score record component