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


Java MatOfByte類代碼示例

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


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

示例1: imshow

import org.opencv.core.MatOfByte; //導入依賴的package包/類
/**
 * Display image in a frame
 *
 * @param title
 * @param img
 */
public static void imshow(String title, Mat img) {
	 
    
    // Convert image Mat to a jpeg
    MatOfByte imageBytes = new MatOfByte();
    Highgui.imencode(".jpg", img, imageBytes);
    
    try {
        // Put the jpeg bytes into a JFrame window and show.
        JFrame frame = new JFrame(title);
        frame.getContentPane().add(new JLabel(new ImageIcon(ImageIO.read(new ByteArrayInputStream(imageBytes.toArray())))));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
        frame.setLocation(30 + (windowNo*20), 30 + (windowNo*20));
        windowNo++;
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:fossasia,項目名稱:zooracle,代碼行數:27,代碼來源:OpenCVUtils.java

示例2: drawMatches

import org.opencv.core.MatOfByte; //導入依賴的package包/類
public static void drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, MatOfByte matchesMask, int flags)
{
    Mat keypoints1_mat = keypoints1;
    Mat keypoints2_mat = keypoints2;
    Mat matches1to2_mat = matches1to2;
    Mat matchesMask_mat = matchesMask;
    drawMatches_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:johnhany,項目名稱:MOAAP,代碼行數:11,代碼來源:Features2d.java

示例3: imencode

import org.opencv.core.MatOfByte; //導入依賴的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:vulovicv23,項目名稱:opencv-documentscanner-android,代碼行數:8,代碼來源:Imgcodecs.java

示例4: calcOpticalFlowPyrLK

import org.opencv.core.MatOfByte; //導入依賴的package包/類
public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint2f prevPts, MatOfPoint2f nextPts, MatOfByte status, MatOfFloat err, Size winSize, int maxLevel)
{
    Mat prevPts_mat = prevPts;
    Mat nextPts_mat = nextPts;
    Mat status_mat = status;
    Mat err_mat = err;
    calcOpticalFlowPyrLK_1(prevImg.nativeObj, nextImg.nativeObj, prevPts_mat.nativeObj, nextPts_mat.nativeObj, status_mat.nativeObj, err_mat.nativeObj, winSize.width, winSize.height, maxLevel);
    
    return;
}
 
開發者ID:beast,項目名稱:react-native-scan-doc,代碼行數:11,代碼來源:Video.java

示例5: imencode

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

示例6: drawMatches2

import org.opencv.core.MatOfByte; //導入依賴的package包/類
public static void drawMatches2(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);
    drawMatches2_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:johnhany,項目名稱:MOAAP,代碼行數:13,代碼來源:Features2d.java

示例7: calcOpticalFlowPyrLK

import org.opencv.core.MatOfByte; //導入依賴的package包/類
public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint2f prevPts, MatOfPoint2f nextPts, MatOfByte status, MatOfFloat err)
{
    Mat prevPts_mat = prevPts;
    Mat nextPts_mat = nextPts;
    Mat status_mat = status;
    Mat err_mat = err;
    calcOpticalFlowPyrLK_2(prevImg.nativeObj, nextImg.nativeObj, prevPts_mat.nativeObj, nextPts_mat.nativeObj, status_mat.nativeObj, err_mat.nativeObj);
    
    return;
}
 
開發者ID:vulovicv23,項目名稱:opencv-documentscanner-android,代碼行數:11,代碼來源:Video.java

示例8: calcOpticalFlowPyrLK

import org.opencv.core.MatOfByte; //導入依賴的package包/類
public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint2f prevPts, MatOfPoint2f nextPts, MatOfByte status, MatOfFloat err, Size winSize, int maxLevel, TermCriteria criteria, int flags, double minEigThreshold)
{
    Mat prevPts_mat = prevPts;
    Mat nextPts_mat = nextPts;
    Mat status_mat = status;
    Mat err_mat = err;
    calcOpticalFlowPyrLK_0(prevImg.nativeObj, nextImg.nativeObj, prevPts_mat.nativeObj, nextPts_mat.nativeObj, status_mat.nativeObj, err_mat.nativeObj, winSize.width, winSize.height, maxLevel, criteria.type, criteria.maxCount, criteria.epsilon, flags, minEigThreshold);
    
    return;
}
 
開發者ID:yippeesoft,項目名稱:NotifyTools,代碼行數:11,代碼來源:Video.java

示例9: drawMatchesKnn

import org.opencv.core.MatOfByte; //導入依賴的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:jorenham,項目名稱:fingerblox,代碼行數:13,代碼來源:Features2d.java

示例10: mat2Image

import org.opencv.core.MatOfByte; //導入依賴的package包/類
/**
 * Convert a Mat object (OpenCV) in the corresponding Image for JavaFX
 * 
 * @param frame
 *            the {@link Mat} representing the current frame
 * @return the {@link Image} to show
 */
private Image mat2Image(Mat frame)
{
	// create a temporary buffer
	MatOfByte buffer = new MatOfByte();
	// encode the frame in the buffer, according to the PNG format
	Imgcodecs.imencode(".png", frame, buffer);
	// build and return an Image created from the image encoded in the
	// buffer
	return new Image(new ByteArrayInputStream(buffer.toArray()));
}
 
開發者ID:MeAnupSarkar,項目名稱:ExoVisix,代碼行數:18,代碼來源:FaceDetectionController.java


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