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

熱點內容
簡單內核程序 瀏覽:675
怎麼建立桌面文件袋 瀏覽:257
花椒新版本下載 瀏覽:123
ico文件怎麼生成 瀏覽:424
兩個不同結構的資料庫同步mysql 瀏覽:897
c盤系統文件佔多少內存 瀏覽:562
今日說法微信聯系方式 瀏覽:238
ai文件導出pdf字體無法嵌入 瀏覽:777
ps保存後會有個文件在桌面 瀏覽:677
sf文件夾 瀏覽:47
怎麼查看qq悄悄話好友 瀏覽:13
excel表格保存後怎麼恢復數據 瀏覽:372
wps文件怎麼改只讀文件 瀏覽:396
java自動補全 瀏覽:54
怎麼提高網路問卷通過率 瀏覽:656
數控火焰切割半圓弧怎麼編程 瀏覽:501
一加六手機數據備份在哪裡 瀏覽:264
手機app脫殼之後怎麼解壓 瀏覽:823
7700用win10 瀏覽:72
搖搖棒c程序 瀏覽:837

友情鏈接