In the C++ version, there are int, int64, float, and double based Point types.
typedef Point_<int> Point2i;
typedef Point_<int64> Point2l;
typedef Point_<float> Point2f;
typedef Point_<double> Point2d;
In the Java-based OpenCV, there is only Point
(double-based), but the Java vector_Point(|2d|2f)_to_Mat APIs will create a Mat with the corresponding CvType (via the native/C++ call) :
CvType.CV_32SC2 (vector_Point_to_Mat)
CvType.CV_32FC2 (vector_Point2f_to_Mat)
CvType.CV_64FC2 (vector_Point2d_to_Mat)
For info on types: see this SO: What's the difference between cvtype values in OPENCV?
public static Mat vector_Point_to_Mat(List<Point> pts) {
return vector_Point_to_Mat(pts, CvType.CV_32S);
}
public static Mat vector_Point2f_to_Mat(List<Point> pts) {
return vector_Point_to_Mat(pts, CvType.CV_32F);
}
public static Mat vector_Point2d_to_Mat(List<Point> pts) {
return vector_Point_to_Mat(pts, CvType.CV_64F);
}
re: https://github.com/opencv/opencv/blob/2c6f1ab57d4250ee46e32d1b51c056431965b470/modules/java/generator/src/java/org/opencv/utils/Converters.java#L37