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


Java Mat類代碼示例

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


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

示例1: Mat_to_vector_KeyPoint

import org.opencv.core.Mat; //導入依賴的package包/類
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
 
開發者ID:raulh82vlc,項目名稱:Image-Detection-Samples,代碼行數:17,代碼來源:Converters.java

示例2: findHomography

import org.opencv.core.Mat; //導入依賴的package包/類
public static Mat findHomography(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints, int method, double ransacReprojThreshold, Mat mask, int maxIters, double confidence)
{
    Mat srcPoints_mat = srcPoints;
    Mat dstPoints_mat = dstPoints;
    Mat retVal = new Mat(findHomography_0(srcPoints_mat.nativeObj, dstPoints_mat.nativeObj, method, ransacReprojThreshold, mask.nativeObj, maxIters, confidence));
    
    return retVal;
}
 
開發者ID:johnhany,項目名稱:MOAAP,代碼行數:9,代碼來源:Calib3d.java

示例3: drawMatchesKnn

import org.opencv.core.Mat; //導入依賴的package包/類
public static void drawMatchesKnn(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg)
{
    Mat keypoints1_mat = keypoints1;
    Mat keypoints2_mat = keypoints2;
    List<Mat> matches1to2_tmplm = new ArrayList<Mat>((matches1to2 != null) ? matches1to2.size() : 0);
    Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm);
    drawMatchesKnn_1(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj);
    
    return;
}
 
開發者ID:jmpaaak,項目名稱:EyeShopping,代碼行數:11,代碼來源:Features2d.java

示例4: imencode

import org.opencv.core.Mat; //導入依賴的package包/類
public static boolean imencode(String ext, Mat img, MatOfByte buf)
{
    Mat buf_mat = buf;
    boolean retVal = imencode_1(ext, img.nativeObj, buf_mat.nativeObj);
    
    return retVal;
}
 
開發者ID:johnhany,項目名稱:MOAAP,代碼行數:8,代碼來源:Imgcodecs.java

示例5: detectAndCompute

import org.opencv.core.Mat; //導入依賴的package包/類
public  void detectAndCompute(Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors)
{
    Mat keypoints_mat = keypoints;
    detectAndCompute_1(nativeObj, image.nativeObj, mask.nativeObj, keypoints_mat.nativeObj, descriptors.nativeObj);
    
    return;
}
 
開發者ID:beast,項目名稱:react-native-scan-doc,代碼行數:8,代碼來源:Feature2D.java

示例6: fastNlMeansDenoisingMulti

import org.opencv.core.Mat; //導入依賴的package包/類
public static void fastNlMeansDenoisingMulti(List<Mat> srcImgs, Mat dst, int imgToDenoiseIndex, int temporalWindowSize, float h, int templateWindowSize, int searchWindowSize)
{
    Mat srcImgs_mat = Converters.vector_Mat_to_Mat(srcImgs);
    fastNlMeansDenoisingMulti_0(srcImgs_mat.nativeObj, dst.nativeObj, imgToDenoiseIndex, temporalWindowSize, h, templateWindowSize, searchWindowSize);
    
    return;
}
 
開發者ID:johnhany,項目名稱:MOAAP,代碼行數:8,代碼來源:Photo.java

示例7: compute

import org.opencv.core.Mat; //導入依賴的package包/類
public  void compute(Mat image, MatOfKeyPoint keypoints, Mat imgDescriptor)
{
    Mat keypoints_mat = keypoints;
    compute_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, imgDescriptor.nativeObj);
    
    return;
}
 
開發者ID:linzuzeng,項目名稱:Microsphere,代碼行數:8,代碼來源:BOWImgDescriptorExtractor.java

示例8: detect

import org.opencv.core.Mat; //導入依賴的package包/類
public  void detect(Mat image, MatOfKeyPoint keypoints, Mat mask)
{
    Mat keypoints_mat = keypoints;
    detect_0(nativeObj, image.nativeObj, keypoints_mat.nativeObj, mask.nativeObj);
    
    return;
}
 
開發者ID:johnhany,項目名稱:MOAAP,代碼行數:8,代碼來源:FeatureDetector.java

示例9: drawMatchesKnn

import org.opencv.core.Mat; //導入依賴的package包/類
public static void drawMatchesKnn(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, List<MatOfByte> matchesMask, int flags)
{
    Mat keypoints1_mat = keypoints1;
    Mat keypoints2_mat = keypoints2;
    List<Mat> matches1to2_tmplm = new ArrayList<Mat>((matches1to2 != null) ? matches1to2.size() : 0);
    Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm);
    List<Mat> matchesMask_tmplm = new ArrayList<Mat>((matchesMask != null) ? matchesMask.size() : 0);
    Mat matchesMask_mat = Converters.vector_vector_char_to_Mat(matchesMask, matchesMask_tmplm);
    drawMatchesKnn_0(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj, matchColor.val[0], matchColor.val[1], matchColor.val[2], matchColor.val[3], singlePointColor.val[0], singlePointColor.val[1], singlePointColor.val[2], singlePointColor.val[3], matchesMask_mat.nativeObj, flags);
    
    return;
}
 
開發者ID:SCHS-Robotics,項目名稱:Team9261-2017-2018,代碼行數:13,代碼來源:Features2d.java

示例10: solvePnPRansac

import org.opencv.core.Mat; //導入依賴的package包/類
public static boolean solvePnPRansac(MatOfPoint3f objectPoints, MatOfPoint2f imagePoints, Mat cameraMatrix, MatOfDouble distCoeffs, Mat rvec, Mat tvec, boolean useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, Mat inliers, int flags)
{
    Mat objectPoints_mat = objectPoints;
    Mat imagePoints_mat = imagePoints;
    Mat distCoeffs_mat = distCoeffs;
    boolean retVal = solvePnPRansac_0(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs_mat.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess, iterationsCount, reprojectionError, confidence, inliers.nativeObj, flags);
    
    return retVal;
}
 
開發者ID:johnhany,項目名稱:MOAAP,代碼行數:10,代碼來源:Calib3d.java

示例11: match

import org.opencv.core.Mat; //導入依賴的package包/類
public  void match(Mat queryDescriptors, MatOfDMatch matches)
{
    Mat matches_mat = matches;
    match_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj);
    
    return;
}
 
開發者ID:beast,項目名稱:react-native-scan-doc,代碼行數:8,代碼來源:DescriptorMatcher.java

示例12: polylines

import org.opencv.core.Mat; //導入依賴的package包/類
public static void polylines(Mat img, List<MatOfPoint> pts, boolean isClosed, Scalar color, int thickness)
{
    List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0);
    Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm);
    polylines_1(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3], thickness);
    
    return;
}
 
開發者ID:daquexian,項目名稱:DNNLibrary,代碼行數:9,代碼來源:Imgproc.java

示例13: cornerSubPix

import org.opencv.core.Mat; //導入依賴的package包/類
public static void cornerSubPix(Mat image, MatOfPoint2f corners, Size winSize, Size zeroZone, TermCriteria criteria)
{
    Mat corners_mat = corners;
    cornerSubPix_0(image.nativeObj, corners_mat.nativeObj, winSize.width, winSize.height, zeroZone.width, zeroZone.height, criteria.type, criteria.maxCount, criteria.epsilon);
    
    return;
}
 
開發者ID:jmpaaak,項目名稱:EyeShopping,代碼行數:8,代碼來源:Imgproc.java

示例14: detect

import org.opencv.core.Mat; //導入依賴的package包/類
public  void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights)
{
    Mat foundLocations_mat = foundLocations;
    Mat weights_mat = weights;
    detect_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj);

    return;
}
 
開發者ID:hollaus,項目名稱:TinyPlanetMaker,代碼行數:9,代碼來源:HOGDescriptor.java

示例15: phaseCorrelate

import org.opencv.core.Mat; //導入依賴的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:ykarim,項目名稱:FTC2016,代碼行數:8,代碼來源:Imgproc.java


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