導航:首頁 > 編程語言 > 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包相關的資料

熱點內容
iphone6s單手模式 瀏覽:79
vivo怎麼找刪除的app軟體 瀏覽:852
360裝機大師怎麼用教程 瀏覽:168
高一編程語言是什麼 瀏覽:421
phpword插入圖片 瀏覽:261
數控編程s300什麼意思 瀏覽:871
linuxab壓力測試 瀏覽:818
編程語言為什麼是c 瀏覽:797
悅me只能網關密碼錯誤 瀏覽:844
三星交集工具 瀏覽:939
資料庫中怎麼復製表結構 瀏覽:417
戴爾win10平板裝系統嗎 瀏覽:816
編程的變數名有哪些 瀏覽:124
360版本海島奇兵下載 瀏覽:370
常州ug數控編程培訓哪個學校好 瀏覽:802
資料庫的不等於怎麼寫 瀏覽:664
qq關閉送禮物動畫 瀏覽:128
京東健康碼在哪個文件夾里 瀏覽:891
數據線黑了怎麼消除 瀏覽:883
iphone6快捷鎖屏 瀏覽:55

友情鏈接