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


Java Imgproc.warpPerspective方法代碼示例

本文整理匯總了Java中org.opencv.imgproc.Imgproc.warpPerspective方法的典型用法代碼示例。如果您正苦於以下問題:Java Imgproc.warpPerspective方法的具體用法?Java Imgproc.warpPerspective怎麽用?Java Imgproc.warpPerspective使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.opencv.imgproc.Imgproc的用法示例。


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

示例1: adaptativeProcess

import org.opencv.imgproc.Imgproc; //導入方法依賴的package包/類
public static Mat adaptativeProcess(Mat img){
	Mat im = new Mat();
	Imgproc.threshold(img,im,120,255,Imgproc.THRESH_TRUNC);
	im = Thresholding.adaptativeThresholding(im);
	Imgproc.medianBlur(im,im,7);
	Mat threshImg = Thresholding.InvertImageColor(im);
	Thresholding.gridDetection(threshImg);
	
		Mat mat = Mat.zeros(4,2,CvType.CV_32F);
	mat.put(0,0,0); mat.put(0,1,512);
	mat.put(1,0,0); mat.put(1,1,0);
	mat.put(2,0,512); mat.put(2,1,0);
	mat.put(3,0,512); mat.put(3,1,512);
	
	mat = Imgproc.getPerspectiveTransform(Thresholding.grid,mat);
	
	Mat M = new Mat();
	
	Imgproc.warpPerspective(threshImg,M,mat, new Size(512,512));
	
	Imgproc.medianBlur(M,M,3);
	Imgproc.threshold(M,M,254,255,Imgproc.THRESH_BINARY);
	
	return Thresholding.InvertImageColor(M);
}
 
開發者ID:Sanahm,項目名稱:SudoCAM-Ku,代碼行數:26,代碼來源:Thresholding.java

示例2: normalProcess

import org.opencv.imgproc.Imgproc; //導入方法依賴的package包/類
public static Mat normalProcess(Mat img){
	Mat threshImg = Thresholding.InvertImageColor(img);
	Thresholding.gridDetection(threshImg);
	Mat mat = Mat.zeros(4,2,CvType.CV_32F);
	mat.put(0,0,0); mat.put(0,1,512);
	mat.put(1,0,0); mat.put(1,1,0);
	mat.put(2,0,512); mat.put(2,1,0);
	mat.put(3,0,512); mat.put(3,1,512);
	
	mat = Imgproc.getPerspectiveTransform(Thresholding.grid,mat);
	
	Mat M = new Mat();
	
	Imgproc.warpPerspective(threshImg,M,mat, new Size(512,512));
	return Thresholding.InvertImageColor(M);
}
 
開發者ID:Sanahm,項目名稱:SudoCAM-Ku,代碼行數:17,代碼來源:Thresholding.java

示例3: doProjection

import org.opencv.imgproc.Imgproc; //導入方法依賴的package包/類
private static void doProjection(ImgWindow projWnd) {
    if (corners.size() == 4) {
        Mat cornersMat = Converters.vector_Point2f_to_Mat(corners);
        Mat targetMat = Converters.vector_Point2f_to_Mat(target);
        trans = Imgproc.getPerspectiveTransform(cornersMat, targetMat);
        invTrans = Imgproc.getPerspectiveTransform(targetMat, cornersMat);
        proj = new Mat();
        Imgproc.warpPerspective(img, proj, trans, new Size(img.cols(), img.rows()));
        if (projWnd.isClicked()) {
            perspPoints.add(new Point(projWnd.mouseX, projWnd.mouseY));
        }
    }
}
 
開發者ID:nbfontana,項目名稱:pdi,代碼行數:14,代碼來源:TransformacaoPerspectiva.java


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