新聞中心
如何開發(fā)Java動(dòng)態(tài)人臉識(shí)別
1.環(huán)境搭建
成都創(chuàng)新互聯(lián)公司IDC提供業(yè)務(wù):成都移動(dòng)云計(jì)算中心,成都服務(wù)器租用,成都移動(dòng)云計(jì)算中心,重慶服務(wù)器租用等四川省內(nèi)主機(jī)托管與主機(jī)租用業(yè)務(wù);數(shù)據(jù)中心含:雙線機(jī)房,BGP機(jī)房,電信機(jī)房,移動(dòng)機(jī)房,聯(lián)通機(jī)房。
整個(gè)項(xiàng)目的結(jié)構(gòu)圖
2.編寫DetectFaceDemo.java,代碼如下:
[java] view plaincopy
package com.njupt.zhb.test;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objdetect.CascadeClassifier;
//
// Detects faces in an image, draws boxes around them, and writes the results
// to "faceDetection.png".
//
public class DetectFaceDemo {
public void run() {
System.out.println("\nRunning DetectFaceDemo");
System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
// Create a face detector from the cascade file in the resources
// directory.
//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//Mat image = Highgui.imread(getClass().getResource("lena.png").getPath());
//注意:源程序的路徑會(huì)多打印一個(gè)‘/’,因此總是出現(xiàn)如下錯(cuò)誤
/*
* Detected 0 faces Writing faceDetection.png libpng warning: Image
* width is zero in IHDR libpng warning: Image height is zero in IHDR
* libpng error: Invalid IHDR data
*/
//因此,我們將第一個(gè)字符去掉
String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);
Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
MatOfRect faceDetections = new MatOfRect();
faceDetector.detectMultiScale(image, faceDetections);
System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));
// Draw a bounding box around each face.
for (Rect rect : faceDetections.toArray()) {
Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));
}
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
3.編寫測(cè)試類:
[java] view plaincopy
package com.njupt.zhb.test;
public class TestMain {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
// Load the native library.
System.loadLibrary("opencv_java246");
new DetectFaceDemo().run();
}
}
//運(yùn)行結(jié)果:
//Hello, OpenCV
//
//Running DetectFaceDemo
///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//Detected 8 faces
//Writing faceDetection.png
javaweb怎么最人臉識(shí)別?
這個(gè)看報(bào)錯(cuò)就是數(shù)組越
界,你要看下它的文檔
說明,都有的,第二個(gè),
jsp肯定好做,就是要錢
,都是找的第三方短信
平臺(tái)提供商,同樣,會(huì)
提供文檔
人臉識(shí)別門禁系統(tǒng)Java源代碼
基于彈性模板匹配的人臉表情識(shí)別程序。首先針對(duì)靜態(tài)表情圖像進(jìn)行表情圖像的灰度、尺寸歸一化,然后利用Gabor小波變換提取人臉表情特征以構(gòu)造表情彈性圖,最后提出基于彈性模板匹配及K-近鄰的分類算法實(shí)現(xiàn)人臉表情的識(shí)別。
java 人臉識(shí)別 問題!
no jniopencv_objdetect in java.library.path
opencv的相應(yīng)的dll,沒有放到環(huán)境變量PATH 所指的目錄
求人臉識(shí)別源代碼
基于Gabor特征提取和人工智能的人臉檢測(cè)系統(tǒng)源代碼Face Detection System
這是一個(gè)使用了Gabor特征提取和人工智能的人臉檢測(cè)系統(tǒng)源代碼關(guān)鍵內(nèi)容
使用步驟:
1. 拷貝所有文件到MATLAB工作目錄下(確認(rèn)已經(jīng)安裝了圖像處理工具箱和人工智能工具箱)
2. 找到"main.m"文件
3. 命令行中運(yùn)行它
4. 點(diǎn)擊"Train Network",等待程序訓(xùn)練好樣本
5. 點(diǎn)擊"Test on Photos",選擇一個(gè).jpg圖片,識(shí)別。
6. 等待程序檢測(cè)出人臉區(qū)域
createffnn.m, drawrec.m, gabor.m, im2vec.m, imscan.m, loadimages.m, main.m, template1.png, template2.png, trainnet.m
網(wǎng)站欄目:java人臉識(shí)別登錄代碼的簡(jiǎn)單介紹
分享網(wǎng)址:http://www.dlmjj.cn/article/phgicc.html