91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

java openCV 人臉識(shí)別 找茬 java openCV 人臉識(shí)別 找茬 java openCV 人臉識(shí)別 找茬 java openCV 人臉識(shí)別 找茬

資源截圖

代碼片段和文件信息


import?java.util.ArrayList;
import?java.util.List;


import?org.opencv.core.MatOfPoint;
import?org.opencv.core.Rect;
import?org.opencv.core.Scalar;
import?org.opencv.core.Size;
import?org.opencv.core.Point;
import?org.opencv.core.Core;
import?org.opencv.core.Mat;
import?org.opencv.highgui.Highgui;
import?org.opencv.imgproc.Imgproc;

/**
?*?找茬demo
?*/
public?class?FindDifference?{


????public?static?void?main(String[]?args)?{
????????System.loadLibrary(Core.NATIVE_LIBRARY_NAME?);

????????Mat?img1?=?Highgui.imread(“D:\\1.jpg“);
????????Mat?img2?=?Highgui.imread(“D:\\2.jpg“);

????????Mat?img?=?new?Mat();
????????Mat?erodeImg?=?new?Mat();
????????Mat?dilateImg?=?new?Mat();
????????Mat?threshImg?=?new?Mat();
????????List?contours?=?new?ArrayList();

????????Mat?hierarchy?=?new?Mat();
????????//像素做差
????????Core.absdiff(img1?img2?img);

????????Mat?kernel?=?Imgproc.getStructuringElement(1new?Size(46));
????????Mat?kernel1?=?Imgproc.getStructuringElement(1new?Size(23));
????????//腐蝕
????????Imgproc.erode(img?erodeImg?kernelnew?Point(-1-1)1);
????????//膨脹
????????Imgproc.dilate(erodeImg?dilateImg?kernel1);
????????//檢測(cè)邊緣
????????Imgproc.threshold(dilateImg?threshImg?20?255?Imgproc.THRESH_BINARY);
????????//轉(zhuǎn)化成灰度
????????Imgproc.cvtColor(threshImg?threshImg?Imgproc.COLOR_RGB2GRAY);
????????//找到輪廓(3:CV_RETR_TREE,2:CV_CHAIN_APPROX_SIMPLE)
????????Imgproc.findContours(threshImg?contours?hierarchy?Imgproc.RETR_TREE?Imgproc.CHAIN_APPROX_SIMPLE?new?Point(00));

????????List?boundRect?=?new?ArrayList<>(contours.size());
????????for?(MatOfPoint?contour?:?contours)?{
//???????? Mat?conMat?=?(Mat)contours.get(i);
//???????? Imgproc.approxPolyDP((MatOfPoint2f)conMatcontours_poly.get(i)3true);
????????????//根據(jù)輪廓生成外包絡(luò)矩形
????????????Rect?rect?=?Imgproc.boundingRect(contour);
????????????boundRect.add(rect);
????????}

????????for(int?i=0;i????????????Scalar?color?=?new?Scalar(00255);
????????????//繪制輪廓
//???????? Imgproc.drawContours(img1?contours?i?color?1?Core.LINE_8?hierarchy?0?new?Point());
????????????//繪制矩形
????????????System.out.print(“(“+boundRect.get(i).tl().x+““+boundRect.get(i).tl().y+“)“+““);
????????????System.out.println(“(“+boundRect.get(i).br().x+““+boundRect.get(i).br().y+“)“);
????????????Core.rectangle(img1?boundRect.get(i).tl()?boundRect.get(i).br()?color?2?Core.LINE_8?0);
????????}

????????Highgui.imwrite(“D:\\new_diff7.png“?img1);
????}

}

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-08-10?14:21??openCV-java\
?????目錄???????????0??2018-08-15?17:14??openCV-java\.idea\
?????文件?????????734??2018-08-10?10:46??openCV-java\.idea\compiler.xml
?????文件??????????97??2018-08-10?10:46??openCV-java\.idea\description.html
?????文件?????????171??2018-08-10?10:46??openCV-java\.idea\encodings.xml
?????目錄???????????0??2018-08-10?10:46??openCV-java\.idea\inspectionProfiles\
?????文件????????1444??2018-08-10?10:46??openCV-java\.idea\inspectionProfiles\Project_Default.xml
?????目錄???????????0??2018-08-10?14:19??openCV-java\.idea\libraries\
?????文件?????????316??2018-08-10?14:19??openCV-java\.idea\libraries\opencv_2413.xml
?????文件?????????489??2018-08-10?10:46??openCV-java\.idea\misc.xml
?????文件?????????269??2018-08-10?10:48??openCV-java\.idea\modules.xml
?????文件????????8792??2018-08-10?17:32??openCV-java\.idea\uiDesigner.xml
?????文件?????????173??2018-08-10?10:46??openCV-java\.idea\vcs.xml
?????文件???????40912??2018-08-15?17:14??openCV-java\.idea\workspace.xml
?????文件?????????503??2018-08-10?14:19??openCV-java\openCV-java.iml
?????文件??????720129??2018-08-10?14:50??openCV-java\ouput.png
?????目錄???????????0??2018-08-15?17:13??openCV-java\out\
?????目錄???????????0??2018-08-15?17:13??openCV-java\src\
?????文件????????2650??2018-08-10?17:46??openCV-java\src\FindDifference.java
?????文件??????919871??2013-11-09?21:13??openCV-java\src\haarcascade_frontalface_alt.xml
?????文件????????1329??2018-08-10?17:32??openCV-java\src\HumanFace.java

評(píng)論

共有 條評(píng)論

相關(guān)資源