国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁(yè) > news >正文

網(wǎng)站建設(shè)糾紛怎么投訴自己怎樣開網(wǎng)站

網(wǎng)站建設(shè)糾紛怎么投訴,自己怎樣開網(wǎng)站,linux的wordpress滲透,WordPress會(huì)員積分插件轉(zhuǎn)載請(qǐng)注明出處:小鋒學(xué)長(zhǎng)生活大爆炸[xfxuezhang.cn] 此代碼可以替代內(nèi)置的images.findImage函數(shù)使用,但可能會(huì)誤匹配,如果是對(duì)匹配結(jié)果要求比較高的,還是得謹(jǐn)慎使用。 runtime.images.initOpenCvIfNeeded(); importClass(java.uti…

轉(zhuǎn)載請(qǐng)注明出處:小鋒學(xué)長(zhǎng)生活大爆炸[xfxuezhang.cn]

????????此代碼可以替代內(nèi)置的images.findImage函數(shù)使用,但可能會(huì)誤匹配,如果是對(duì)匹配結(jié)果要求比較高的,還是得謹(jǐn)慎使用。


runtime.images.initOpenCvIfNeeded();
importClass(java.util.ArrayList);
importClass(java.util.List);
importClass(java.util.LinkedList);
importClass(org.opencv.imgproc.Imgproc);
importClass(org.opencv.imgcodecs.Imgcodecs);
importClass(org.opencv.core.Core);
importClass(org.opencv.core.Mat);
importClass(org.opencv.core.MatOfDMatch);
importClass(org.opencv.core.MatOfKeyPoint);
importClass(org.opencv.core.MatOfRect);
importClass(org.opencv.core.Size);
importClass(org.opencv.features2d.DescriptorMatcher);
importClass(org.opencv.features2d.Features2d);
importClass(org.opencv.features2d.SIFT);
importClass(org.opencv.features2d.ORB);
importClass(org.opencv.features2d.BRISK);
importClass(org.opencv.features2d.AKAZE);
importClass(org.opencv.features2d.BFMatcher);
importClass(org.opencv.core.MatOfPoint2f);
importClass(org.opencv.calib3d.Calib3d);
importClass(org.opencv.core.CvType);
importClass(org.opencv.core.Point);
importClass(org.opencv.core.Scalar);
importClass(org.opencv.core.MatOfByte);/** 用法示例:* var image1 = captureScreen();* var image2 = images.read('xxxx');* match(image1, image2);*/function match(img1, img2, method) {console.time("匹配耗時(shí)");// 指定特征點(diǎn)算法SIFTvar match_alg = null;if(method == 'sift') {match_alg = SIFT.create();}else if(method == 'orb') {match_alg = ORB.create();}else if(method == 'brisk') {match_alg = BRISK.create();}else {match_alg = AKAZE.create();}var bigTrainImage = Imgcodecs.imdecode(new MatOfByte(images.toBytes(img1)), Imgcodecs.IMREAD_UNCHANGED);var smallTrainImage = Imgcodecs.imdecode(new MatOfByte(images.toBytes(img2)), Imgcodecs.IMREAD_UNCHANGED);// 轉(zhuǎn)灰度圖// console.log("轉(zhuǎn)灰度圖");var big_trainImage_gray = new Mat(bigTrainImage.rows(), bigTrainImage.cols(), CvType.CV_8UC1);var small_trainImage_gray = new Mat(smallTrainImage.rows(), smallTrainImage.cols(), CvType.CV_8UC1);Imgproc.cvtColor(bigTrainImage, big_trainImage_gray, Imgproc.COLOR_BGR2GRAY);Imgproc.cvtColor(smallTrainImage, small_trainImage_gray, Imgproc.COLOR_BGR2GRAY);// 獲取圖片的特征點(diǎn)// console.log("detect");var big_keyPoints = new MatOfKeyPoint();var small_keyPoints = new MatOfKeyPoint();match_alg.detect(bigTrainImage, big_keyPoints);match_alg.detect(smallTrainImage, small_keyPoints);// 提取圖片的特征點(diǎn)// console.log("compute");var big_trainDescription = new Mat(big_keyPoints.rows(), 128, CvType.CV_32FC1);var small_trainDescription = new Mat(small_keyPoints.rows(), 128, CvType.CV_32FC1);match_alg.compute(big_trainImage_gray, big_keyPoints, big_trainDescription);match_alg.compute(small_trainImage_gray, small_keyPoints, small_trainDescription);// console.log("matcher.train");var matcher = new BFMatcher();matcher.clear();var train_desc_collection = new ArrayList();train_desc_collection.add(big_trainDescription);// vector<Mat>train_desc_collection(1, trainDescription);matcher.add(train_desc_collection);matcher.train();// console.log("knnMatch");var matches = new ArrayList();matcher.knnMatch(small_trainDescription, matches, 2);//對(duì)匹配結(jié)果進(jìn)行篩選,依據(jù)distance進(jìn)行篩選// console.log("對(duì)匹配結(jié)果進(jìn)行篩選");var goodMatches = new ArrayList();var nndrRatio = 0.8;var len = matches.size();for (var i = 0; i < len; i++) {var matchObj = matches.get(i);var dmatcharray = matchObj.toArray();var m1 = dmatcharray[0];var m2 = dmatcharray[1];if (m1.distance <= m2.distance * nndrRatio) {goodMatches.add(m1);}}var matchesPointCount = goodMatches.size();//當(dāng)匹配后的特征點(diǎn)大于等于 4 個(gè),則認(rèn)為模板圖在原圖中,該值可以自行調(diào)整if (matchesPointCount >= 4) {log("模板圖在原圖匹配成功!");var templateKeyPoints = small_keyPoints;var originalKeyPoints = big_keyPoints;var templateKeyPointList = templateKeyPoints.toList();var originalKeyPointList = originalKeyPoints.toList();var objectPoints = new LinkedList();var scenePoints = new LinkedList();var goodMatchesList = goodMatches;var len = goodMatches.size();for (var i = 0; i < len; i++) {var goodMatch = goodMatches.get(i);objectPoints.addLast(templateKeyPointList.get(goodMatch.queryIdx).pt);scenePoints.addLast(originalKeyPointList.get(goodMatch.trainIdx).pt);}var objMatOfPoint2f = new MatOfPoint2f();objMatOfPoint2f.fromList(objectPoints);var scnMatOfPoint2f = new MatOfPoint2f();scnMatOfPoint2f.fromList(scenePoints);//使用 findHomography 尋找匹配上的關(guān)鍵點(diǎn)的變換var homography = Calib3d.findHomography(objMatOfPoint2f, scnMatOfPoint2f, Calib3d.RANSAC, 3);/*** 透視變換(Perspective Transformation)是將圖片投影到一個(gè)新的視平面(Viewing Plane),也稱作投影映射(Projective Mapping)。*/var templateCorners = new Mat(4, 1, CvType.CV_32FC2);var templateTransformResult = new Mat(4, 1, CvType.CV_32FC2);var templateImage = smallTrainImage;var doubleArr = util.java.array("double", 2);doubleArr[0] = 0;doubleArr[1] = 0;templateCorners.put(0, 0, doubleArr);doubleArr[0] = templateImage.cols();doubleArr[1] = 0;templateCorners.put(1, 0, doubleArr);doubleArr[0] = templateImage.cols();doubleArr[1] = templateImage.rows();templateCorners.put(2, 0, doubleArr);doubleArr[0] = 0;doubleArr[1] = templateImage.rows();templateCorners.put(3, 0, doubleArr);//使用 perspectiveTransform 將模板圖進(jìn)行透視變以矯正圖象得到標(biāo)準(zhǔn)圖片Core.perspectiveTransform(templateCorners, templateTransformResult, homography);//矩形四個(gè)頂點(diǎn)var pointA = templateTransformResult.get(0, 0);var pointB = templateTransformResult.get(1, 0);var pointC = templateTransformResult.get(2, 0);var pointD = templateTransformResult.get(3, 0);var y0 = Math.round(pointA[1])>0?Math.round(pointA[1]):0;var y1 = Math.round(pointC[1])>0?Math.round(pointC[1]):0;var x0 = Math.round(pointD[0])>0?Math.round(pointD[0]):0;var x1 = Math.round(pointB[0])>0?Math.round(pointB[0]):0;console.timeEnd("匹配耗時(shí)");return {x: x0, y: y0};} else {console.timeEnd("匹配耗時(shí)");log("模板圖不在原圖中!");return null;}
}
http://m.aloenet.com.cn/news/32223.html

相關(guān)文章:

  • wordpress博客xiu北京seo供應(yīng)商
  • asp.net 旅游網(wǎng)站開發(fā)淘寶seo優(yōu)化排名
  • 上海消費(fèi)品網(wǎng)絡(luò)營(yíng)銷推廣公司長(zhǎng)沙seo排名優(yōu)化公司
  • 鮮花網(wǎng)站怎么做寧波seo推廣服務(wù)
  • wordpress 去除頁(yè)面標(biāo)題seo點(diǎn)擊軟件手機(jī)
  • 做健身網(wǎng)站東莞網(wǎng)站制作
  • 色無(wú)極網(wǎng)站正在建設(shè)中seo值是什么意思
  • 網(wǎng)站開發(fā)中的抓包工具網(wǎng)站代運(yùn)營(yíng)多少錢一個(gè)月
  • 氣象服務(wù)網(wǎng)站建設(shè)計(jì)算機(jī)培訓(xùn)
  • 網(wǎng)站開發(fā)和桌面開發(fā)哪個(gè)難百度搜索熱詞查詢
  • 視頻網(wǎng)站開發(fā)前景創(chuàng)建網(wǎng)站的流程
  • 東莞建站網(wǎng)站模板站長(zhǎng)查詢工具
  • 做視頻網(wǎng)站需要多少帶寬優(yōu)化網(wǎng)站標(biāo)題名詞解釋
  • 寧波網(wǎng)站建設(shè)論壇日喀則網(wǎng)站seo
  • 德州手機(jī)網(wǎng)站建設(shè)費(fèi)用網(wǎng)絡(luò)推廣的方式有哪些
  • 邯鄲市網(wǎng)絡(luò)建站百度百度一下就知道
  • 我是做性視頻網(wǎng)站懷化seo推廣
  • 深圳網(wǎng)站建設(shè)公司哪家可以建app企業(yè)網(wǎng)絡(luò)營(yíng)銷策劃方案范文
  • 有沒有找人做標(biāo)書的網(wǎng)站寧波網(wǎng)絡(luò)營(yíng)銷公司有哪些
  • 垂直+網(wǎng)站開發(fā)西安seo公司哪家好
  • 雜志網(wǎng)站建設(shè)方案優(yōu)化大師免安裝版
  • 東莞網(wǎng)站優(yōu)化推廣方案四川整站優(yōu)化關(guān)鍵詞排名
  • 企業(yè)網(wǎng)站系統(tǒng)seo行業(yè)
  • 免費(fèi)自己制作網(wǎng)站方法日本站外推廣網(wǎng)站
  • 朝陽(yáng)網(wǎng)站建設(shè) 慈云寺網(wǎng)絡(luò)營(yíng)銷推廣方案模板
  • 龍巖網(wǎng)站設(shè)計(jì)較好的公司上海今天最新新聞10條
  • 動(dòng)漫網(wǎng)站開發(fā)需求分析本周新聞熱點(diǎn)
  • 小語(yǔ)種網(wǎng)站寧德seo培訓(xùn)
  • 青海省住房和城鄉(xiāng)建設(shè)廳門戶網(wǎng)站深圳做網(wǎng)站
  • 旬陽(yáng)做網(wǎng)站湖南seo快速排名