Face recognition java code share java face recognition source code case analysis

Face recognition Java code how to write? How to write JAVA face detection applet? Java face recognition source code case study. Face recognition is a very hot biometric recognition technology in recent years. It is an algorithm based on facial feature extraction and matching of users. It can be implemented with a variety of development tools. Among them, JAVA is widely used. This paper focuses on face recognition java code cases. Analyze and introduce some basic situations. lmK smart lock China

2017-05-17_091651.jpg lmK smart lock China

Directly using Java to achieve human identification and positioning examples are difficult to find on the Internet, mostly rely on JNI call OpenCV native method to achieve, then here to talk about this approach, first recognize the JNI and opencv. lmK smart lock China

JNI is the abbreviation of Java Native Interface, Chinese is JAVA native call. Beginning with Java 1.1, the Java Native Interface (JNI) standard became part of the Java platform, allowing Java code to interact with code written in other languages. lmK smart lock China

OpenCV is an open source computer vision library supported by Intel Corporation. It is lightweight and efficient - consists of a series of C functions and a small number of C++ classes, implementing many common algorithms for image processing and computer vision. lmK smart lock China

Part of face recognition Java code OpenCV introduction

OpenCV is an Intel-funded open source computer vision library. It consists of a series of C functions and a small number of C++ classes, implementing many common algorithms for image processing and computer vision. lmK smart lock China

OpenCV has a cross-platform middle and high level API that includes more than 300 C functions. It does not depend on other external libraries - although some external libraries can also be used. OpenCV is free for non-commercial and commercial applications. OpenCV provides a transparent interface for Intel® Integrated Performance Primitives (IPP). This means that if there is an IPP library optimized for a particular processor, OpenCV will automatically load these libraries at runtime. lmK smart lock China

How to call JAVA (see JNI2OpenCV) lmK smart lock China

JNI2OpenCV compiles OpenCV C/C++ program code into dynamic link library files. Java can then use native methods to invoke a series of functions and algorithms in OpenCV's computer vision library. lmK smart lock China

JNI2OpenCV provides FaceDetection.java test program, the program code is as follows: lmK smart lock China

2017-05-17_091651_72x72.jpg lmK smart lock China

Face Recognition JAVA Source Code Case Study

Face Recognition Java Source Code Case Study 1: With Link Address """ http://yuncode.net/code/c_53b7c4006a97981 lmK Smart Lock China

Directly available after the code is imported, with test images and videos. Users can also use their own face to identify. Not only can the face in the camera be identified, but also the face in a picture or video file can be recognized and applied to the feature face recognition technology. lmK smart lock China

2017-05-17_091748.jpg lmK smart lock China

The code is not difficult, just import the relevant XML file and library file (haarcascade_frontalface_alt_tree.xml, JNI2OpenCV.dll, etc.) The following code can be achieved: lmK smart lock China

Class JNIOpenCV { lmk smart lock China

Static { lmk smart lock China

System.loadLibrary("JNI2OpenCV"); lmK Smart Lock China

} lmK smart lock China

Public native int[] detectFace(int minFaceWidth, int minFaceHeight, String cascade, String filename); lmK smart lock China

} lmK smart lock China

Public class FaceDetection { lmK smart lock China

Private JNIOpenCV myJNIOpenCV; lmK smart lock China

Private FaceDetection myFaceDetection; lmK Smart Lock China

Public FaceDetection() { lmk smart lock China

myJNIOpenCV = new JNIOpenCV(); lmK Smartlock China

String filename = "5.jpg"; lmK smart lock China

String cascade = " haarcascade_frontalface_alt_tree.xml "; lmK smart lock China

Int[] detectedFaces = myJNIOpenCV.detectFace(40, 40, cascade, filename); lmK Smartlock China

Int numFaces = detectedFaces.length / 4; lmK smart lock China

System.out.println("numFaces = " + numFaces); lmK Smart Lock China

For (int i = 0; i < numFaces; i++) { lmk smart lock China

System.out.println("Face " + i + ":" + detectedFaces[4 * i + 0] + " " + detectedFaces[4 * i + 1] + " " + detectedFaces[4 * i + 2] + " " + detectedFaces[4 * i + 3]); lmK Smart Lock China

} lmK smart lock China

} lmK smart lock China

Public static void main(String args[]) { lmk smart lock China

FaceDetection myFaceDetection = new FaceDetection(); lmK Smart Lock China

} lmK smart lock China

} lmK smart lock China

Note: The project will run on Linux. The .dll dynamic library file cannot be called under Linux. lmK smart lock China

The above is published by Smart Lock China Network Xiaobian according to the content of network sharing, more biometric technology please pay attention to this site! lmK smart lock China

Overhead Shower

Overhead Shower,Aquasource Shower Head,Shower Head for Taps,Matte Black Rain Shower Head

kaiping aida sanitary ware technology co.,ltd , https://www.aidafaucets.com