Class ColorDetection

java.lang.Object
synapse.pipelines.color.ColorDetection

public class ColorDetection extends Object
Represents the result of a color detection pipeline. Contains bounding box, center coordinates, and area of the detected color region.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    Area of the detected color region in pixels squared.
    float[]
    Bounding box of the detected color region as [x, y, width, height].
    float[]
    Center of the detected color region as [x, y].
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares this ColorResult to another object for equality.
    int
    Computes a hash code for this ColorResult.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • bbox

      public float[] bbox
      Bounding box of the detected color region as [x, y, width, height].
    • center

      public float[] center
      Center of the detected color region as [x, y].
    • area

      public float area
      Area of the detected color region in pixels squared.
  • Constructor Details

    • ColorDetection

      public ColorDetection()
      Default constructor.
  • Method Details

    • hashCode

      public int hashCode()
      Computes a hash code for this ColorResult.
      Overrides:
      hashCode in class Object
      Returns:
      hash code based on bbox, center, and area.
    • equals

      public boolean equals(Object obj)
      Compares this ColorResult to another object for equality. Two ColorResult objects are equal if their bbox, center, and area are all equal.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare to
      Returns:
      true if equal, false otherwise