導航:首頁 > 編程語言 > java人臉識別jar包

java人臉識別jar包

發布時間:2023-03-15 05:08:12

1. 如何開發java動態人臉識別

1.環境搭建
整個項目的結構圖

2.編寫DetectFaceDemo.java,代碼如下:
[java] view plain
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());
//注意:源程序的路徑會多列印一個『/』,因此總是出現如下錯誤
/*
* 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
*/
//因此,我們將第一個字元去掉
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.編寫測試類:
[java] view plain
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();
}
}
//運行結果:
//Hello, OpenCV
//
//Running DetectFaceDemo
///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//Detected 8 faces
//Writing faceDetection.png

2. 有沒有人臉識別JAVA的demo

有,但是不過得是雲從封裝好的,

3. 人臉識別門禁系統Java源代碼

基於彈性模板匹配的人臉表情識別程序。首先針對靜態表情圖像進行表情圖內像的灰度、尺寸歸一化容,然後利用Gabor小波變換提取人臉表情特徵以構造表情彈性圖,最後提出基於彈性模板匹配及K-近鄰的分類演算法實現人臉表情的識別。

4. 人臉識別系統使用java的開發

現在主流的還是用的網路,千搜等公司的在線API,就是傳圖片過去,等接收結果就行,seetaface這個東西太復雜了。

5. 用OpenCV開發人臉識別軟體,用Java好還是用C/C++好

java的opencv頂多調用攝像頭用,圖像處理都用c++的opencv。對於opencv的開發,不管從開發效率還是執行效率,絕對是c++。java版的opencv想都不要想。

6. java 人臉識別 問題!

no jniopencv_objdetect in java.library.path

opencv的相應的dll,沒有放到環境變數PATH 所指的目錄

7. java怎麼實現人臉識別

應該可以通過java調用別人的人臉識別的介面,主要是利用圖像處理的技術,識別關鍵點

8. java人臉識別有二次開發包嗎

虹軟現在的SDK就有JAVA的 識別率比較高 主要是離線

閱讀全文

與java人臉識別jar包相關的資料

熱點內容
在電腦上怎麼找不到微信文件夾 瀏覽:116
u盤打開後有文件沒內容 瀏覽:210
編程怎麼輸出逗號 瀏覽:421
微信玩紅包怎麼定大小 瀏覽:825
電腦病毒測試代碼 瀏覽:118
得物app為什麼總是更新 瀏覽:965
銀企對賬程序 瀏覽:164
r讀取excel文件 瀏覽:363
上古卷軸5控制台附魔代碼 瀏覽:514
緩存文件合並找不到文件 瀏覽:871
桌面保存一下文件找不到 瀏覽:645
程序美工標准 瀏覽:191
漂流瓶的文件在哪裡 瀏覽:319
數據的正負偏差怎麼計算 瀏覽:242
文件名用不用帶TXT 瀏覽:968
小米十數據線是哪個 瀏覽:463
caddws文件 瀏覽:962
js獲取復選框是否選中 瀏覽:289
wps查文件路徑 瀏覽:28
ps作圖完成後怎麼保存文件 瀏覽:429

友情鏈接