當前位置: 首頁>>代碼示例>>Java>>正文


Java Point類代碼示例

本文整理匯總了Java中org.opencv.core.Point的典型用法代碼示例。如果您正苦於以下問題:Java Point類的具體用法?Java Point怎麽用?Java Point使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Point類屬於org.opencv.core包,在下文中一共展示了Point類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findAllColors

import org.opencv.core.Point; //導入依賴的package包/類
public static Point[] findAllColors(ImageWrapper image, int color, int threshold, Rect rect) {
    Mat bi = new Mat();
    Scalar lowerBound = new Scalar(Color.red(color) - threshold, Color.green(color) - threshold,
            Color.blue(color) - threshold, 255);
    Scalar upperBound = new Scalar(Color.red(color) + threshold, Color.green(color) + threshold,
            Color.blue(color) + threshold, 255);
    if (rect != null) {
        Core.inRange(new Mat(image.getMat(), rect), lowerBound, upperBound, bi);
    } else {
        Core.inRange(image.getMat(), lowerBound, upperBound, bi);
    }
    Mat nonZeroPos = new Mat();
    Core.findNonZero(bi, nonZeroPos);
    if (nonZeroPos.rows() == 0 || nonZeroPos.cols() == 0) {
        return new Point[0];
    }
    Point[] points = new MatOfPoint(nonZeroPos).toArray();
    if (rect != null) {
        for (int i = 0; i < points.length; i++) {
            points[i].x += rect.x;
            points[i].y += rect.y;
        }
    }
    return points;
}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:26,代碼來源:ColorFinder.java

示例2: phaseCorrelate

import org.opencv.core.Point; //導入依賴的package包/類
public static Point phaseCorrelate(Mat src1, Mat src2, Mat window, double[] response)
{
    double[] response_out = new double[1];
    Point retVal = new Point(phaseCorrelate_0(src1.nativeObj, src2.nativeObj, window.nativeObj, response_out));
    if(response!=null) response[0] = (double)response_out[0];
    return retVal;
}
 
開發者ID:daquexian,項目名稱:DNNLibrary,代碼行數:8,代碼來源:Imgproc.java

示例3: findContours

import org.opencv.core.Point; //導入依賴的package包/類
public static void findContours(Mat image, List<MatOfPoint> contours, Mat hierarchy, int mode, int method, Point offset)
{
    Mat contours_mat = new Mat();
    findContours_0(image.nativeObj, contours_mat.nativeObj, hierarchy.nativeObj, mode, method, offset.x, offset.y);
    Converters.Mat_to_vector_vector_Point(contours_mat, contours);
    contours_mat.release();
    return;
}
 
開發者ID:vipycm,項目名稱:mao-android,代碼行數:9,代碼來源:Imgproc.java

示例4: drawText

import org.opencv.core.Point; //導入依賴的package包/類
public static void drawText(Mat img, String text, Point origin, float scale, Color color, Anchor locationOnImage) {
    if (locationOnImage == Anchor.BOTTOMLEFT)
        Transform.flip(img, Transform.FlipType.FLIP_ACROSS_Y);
    Imgproc.putText(img, text, origin, Core.FONT_HERSHEY_SIMPLEX, scale, color.getScalarRGBA(), 2, Core.LINE_8,
            (locationOnImage == Anchor.BOTTOMLEFT || locationOnImage == Anchor.BOTTOMLEFT_UNFLIPPED_Y));
    if (locationOnImage == Anchor.BOTTOMLEFT)
        Transform.flip(img, Transform.FlipType.FLIP_ACROSS_Y);
}
 
開發者ID:ykarim,項目名稱:FTC2016,代碼行數:9,代碼來源:Drawing.java

示例5: transpose

import org.opencv.core.Point; //導入依賴的package包/類
/**
 * Transpose this rectangle so that x becomes y and vice versa
 *
 * @return Transposed rectangle instance
 */
@SuppressWarnings("SuspiciousNameCombination")
public Ellipse transpose() {
    return new Ellipse(new RotatedRect(
            new Point(rect.center.y, rect.center.x),
            new Size(rect.size.height, rect.size.width), rect.angle));
}
 
開發者ID:ykarim,項目名稱:FTC2016,代碼行數:12,代碼來源:Ellipse.java

示例6: edgeDst

import org.opencv.core.Point; //導入依賴的package包/類
public  int edgeDst(int edge, Point dstpt)
{
    double[] dstpt_out = new double[2];
    int retVal = edgeDst_0(nativeObj, edge, dstpt_out);
    if(dstpt!=null){ dstpt.x = dstpt_out[0]; dstpt.y = dstpt_out[1]; } 
    return retVal;
}
 
開發者ID:johnhany,項目名稱:MOAAP,代碼行數:8,代碼來源:Subdiv2D.java

示例7: edgeOrg

import org.opencv.core.Point; //導入依賴的package包/類
public  int edgeOrg(int edge, Point orgpt)
{
    double[] orgpt_out = new double[2];
    int retVal = edgeOrg_0(nativeObj, edge, orgpt_out);
    if(orgpt!=null){ orgpt.x = orgpt_out[0]; orgpt.y = orgpt_out[1]; }
    return retVal;
}
 
開發者ID:wblgers,項目名稱:OpenCV_Android_Plus,代碼行數:8,代碼來源:Subdiv2D.java

示例8: getMeanPoint

import org.opencv.core.Point; //導入依賴的package包/類
public static Point getMeanPoint(List<Point> points) {
    if (points.size() == 0) return null;
    double x = 0;
    double y = 0;
    for(Point point : points) {
        x += Math.pow(point.x, 2);
        y += Math.pow(point.y, 2);
    }
    return new Point(Math.sqrt(x/points.size()), Math.sqrt(y/points.size()));
}
 
開發者ID:GTHSRobotics,項目名稱:DogeCV,代碼行數:11,代碼來源:Points.java

示例9: locate

import org.opencv.core.Point; //導入依賴的package包/類
public  int locate(Point pt, int[] edge, int[] vertex)
{
    double[] edge_out = new double[1];
    double[] vertex_out = new double[1];
    int retVal = locate_0(nativeObj, pt.x, pt.y, edge_out, vertex_out);
    if(edge!=null) edge[0] = (int)edge_out[0];
    if(vertex!=null) vertex[0] = (int)vertex_out[0];
    return retVal;
}
 
開發者ID:daquexian,項目名稱:DNNLibrary,代碼行數:10,代碼來源:Subdiv2D.java

示例10: getVertex

import org.opencv.core.Point; //導入依賴的package包/類
public  Point getVertex(int vertex, int[] firstEdge)
{
    double[] firstEdge_out = new double[1];
    Point retVal = new Point(getVertex_0(nativeObj, vertex, firstEdge_out));
    if(firstEdge!=null) firstEdge[0] = (int)firstEdge_out[0];
    return retVal;
}
 
開發者ID:csarron,項目名稱:renderscript_examples,代碼行數:8,代碼來源:Subdiv2D.java

示例11: minEnclosingCircle

import org.opencv.core.Point; //導入依賴的package包/類
public static void minEnclosingCircle(MatOfPoint2f points, Point center, float[] radius)
{
    Mat points_mat = points;
    double[] center_out = new double[2];
    double[] radius_out = new double[1];
    minEnclosingCircle_0(points_mat.nativeObj, center_out, radius_out);
    if(center!=null){ center.x = center_out[0]; center.y = center_out[1]; } 
    if(radius!=null) radius[0] = (float)radius_out[0];
    return;
}
 
開發者ID:johnhany,項目名稱:MOAAP,代碼行數:11,代碼來源:Imgproc.java

示例12: KeyPoint

import org.opencv.core.Point; //導入依賴的package包/類
public KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave, int _class_id)
{
    pt = new Point(x, y);
    size = _size;
    angle = _angle;
    response = _response;
    octave = _octave;
    class_id = _class_id;
}
 
開發者ID:vipycm,項目名稱:mao-android,代碼行數:10,代碼來源:KeyPoint.java

示例13: findNearest

import org.opencv.core.Point; //導入依賴的package包/類
public  int findNearest(Point pt, Point nearestPt)
{
    double[] nearestPt_out = new double[2];
    int retVal = findNearest_0(nativeObj, pt.x, pt.y, nearestPt_out);
    if(nearestPt!=null){ nearestPt.x = nearestPt_out[0]; nearestPt.y = nearestPt_out[1]; } 
    return retVal;
}
 
開發者ID:csarron,項目名稱:renderscript_examples,代碼行數:8,代碼來源:Subdiv2D.java

示例14: vector_Point2f_to_Mat

import org.opencv.core.Point; //導入依賴的package包/類
public static Mat vector_Point2f_to_Mat(List<Point> pts) {
    return vector_Point_to_Mat(pts, CvType.CV_32F);
}
 
開發者ID:jocstech,項目名稱:AndroidCameraSudokuSolver,代碼行數:4,代碼來源:Converters.java

示例15: Mat_to_vector_Point2f

import org.opencv.core.Point; //導入依賴的package包/類
public static void Mat_to_vector_Point2f(Mat m, List<Point> pts) {
    Mat_to_vector_Point(m, pts);
}
 
開發者ID:hollaus,項目名稱:TinyPlanetMaker,代碼行數:4,代碼來源:Converters.java


注:本文中的org.opencv.core.Point類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。