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. 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. 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. 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. 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. 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. How to call JAVA (see JNI2OpenCV) 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. JNI2OpenCV provides FaceDetection.java test program, the program code is as follows: Face Recognition Java Source Code Case Study 1: With Link Address """ http://yuncode.net/code/c_53b7c4006a97981 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. 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: Class JNIOpenCV { Static { System.loadLibrary("JNI2OpenCV"); } Public native int[] detectFace(int minFaceWidth, int minFaceHeight, String cascade, String filename); } Public class FaceDetection { Private JNIOpenCV myJNIOpenCV; Private FaceDetection myFaceDetection; Public FaceDetection() { myJNIOpenCV = new JNIOpenCV(); String filename = "5.jpg"; String cascade = " Int[] detectedFaces = myJNIOpenCV.detectFace(40, 40, cascade, filename); Int numFaces = detectedFaces.length / 4; System.out.println("numFaces = " + numFaces); For (int i = 0; i < numFaces; i++) { System.out.println("Face " + i + ":" + detectedFaces[4 * i + 0] + " " + detectedFaces[4 * i + 1] + " " + detectedFaces[4 * i + 2] + " " + detectedFaces[4 * i + 3]); } } Public static void main(String args[]) { FaceDetection myFaceDetection = new FaceDetection(); } } Note: The project will run on Linux. The .dll dynamic library file cannot be called under Linux. 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! 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