OpenCV 2.4.3.2

org.opencv.core
Class Point

java.lang.Object
  extended by org.opencv.core.Point

public class Point
extends java.lang.Object

Template class for 2D points specified by its coordinates x and y. An instance of the class is interchangeable with C structures, CvPoint and CvPoint2D32f. There is also a cast operator to convert point coordinates to the specified type. The conversion from floating-point coordinates to integer coordinates is done by rounding. Commonly, the conversion uses this operation for each of the coordinates. Besides the class members listed in the declaration above, the following operations on points are implemented:

pt1 = pt2 + pt3;

// C++ code:

pt1 = pt2 - pt3;

pt1 = pt2 * a;

pt1 = a * pt2;

pt1 += pt2;

pt1 -= pt2;

pt1 *= a;

double value = norm(pt); // L2 norm

pt1 == pt2;

pt1 != pt2;

For your convenience, the following type aliases are defined:

typedef Point_ Point2i;

typedef Point2i Point;

typedef Point_ Point2f;

typedef Point_ Point2d;

Example:

Point2f a(0.3f, 0.f), b(0.f, 0.4f);

Point pt = (a + b)*10.f;

cout << pt.x << ", " << pt.y << endl;

See Also:
org.opencv.core.Point_

Field Summary
 double x
           
 double y
           
 
Constructor Summary
Point()
           
Point(double[] vals)
           
Point(double x, double y)
           
 
Method Summary
 Point clone()
           
 double dot(Point p)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean inside(Rect r)
           
 void set(double[] vals)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y
Constructor Detail

Point

public Point()

Point

public Point(double[] vals)

Point

public Point(double x,
             double y)
Method Detail

clone

public Point clone()
Overrides:
clone in class java.lang.Object

dot

public double dot(Point p)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

inside

public boolean inside(Rect r)

set

public void set(double[] vals)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

OpenCV 2.4.3.2 Documentation