Class Corner

java.lang.Object
imagingbook.common.corners.Corner
All Implemented Interfaces:
Pnt2d, Primitive2d, ShapeProducer, Comparable<Corner>

public class Corner extends Object implements Pnt2d, Comparable<Corner>
This class represents a 2D corner. A corner is essentially a Pnt2d plus a scalar quantity q for the corner strength.
Version:
2022/09/05
  • Constructor Details

    • Corner

      public Corner(float x, float y, float q)
      Constructor.
      Parameters:
      x - horizontal position
      y - vertical position
      q - corner score value
  • Method Details

    • getX

      public double getX()
      Description copied from interface: Pnt2d
      Returns the x-coordinate of this point.
      Specified by:
      getX in interface Pnt2d
      Returns:
      the x-coordinate value
    • getY

      public double getY()
      Description copied from interface: Pnt2d
      Returns the y-coordinate of this point.
      Specified by:
      getY in interface Pnt2d
      Returns:
      the y-coordinate value
    • getQ

      public double getQ()
      Returns this corner's score value.
      Returns:
      score value
    • compareTo

      public int compareTo(Corner other)
      Specified by:
      compareTo in interface Comparable<Corner>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getShape

      public Shape getShape(double size)
      Description copied from interface: Pnt2d
      Returns a round dot (Shape instance) for drawing this point.
      Specified by:
      getShape in interface Pnt2d
      Specified by:
      getShape in interface ShapeProducer
      Parameters:
      size - the dot radius
      Returns:
      the shape