Package anlavn.opencv
Class FaceRecognition
java.lang.Object
anlavn.opencv.FaceRecognition
The FaceRecognition class supports to face recognition in java, using python program compiled.
This class provides methods to load necessary libraries, set images for recognition, configure settings, and perform face recognition.
This class provides methods to load necessary libraries, set images for recognition, configure settings, and perform face recognition.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final void
Use this method to check Module support for face recognition.
Run this method first.static final FaceRecognition.Result
Use this method to recognition and get result after setup successfully all parameter.static final void
setImageOrginal
(BufferedImage buff) Use this method to set image for original face from BufferedImage.static final void
setImageOrginal
(String image) Use this method to set image for original face from File or URL.static final void
setImageTesting
(BufferedImage buff) Use this method to set image for testing face from BufferedImage.static final void
setImageTesting
(String image) Use this method to set image for testing face from File or URL.static final void
Use this method to set the required percentage for face recognition.
-
Field Details
-
API_KEY
-
-
Constructor Details
-
FaceRecognition
public FaceRecognition()
-
-
Method Details
-
loadModule
public static final void loadModule()Use this method to check Module support for face recognition.
Run this method first. -
setImageOrginal
Use this method to set image for original face from File or URL.- Parameters:
image
- is specific location of face image, it can be local path in computer or link address of image.
Example: "C:/Users/Admin/Pictures/funfact.jpg"
or "https://www.onthisday.com/images/people/rowan-atkinson-medium.jpg"- Throws:
IOException
- throw an exception if there is no internet connection or can't download image from link.- See Also:
-
setImageTesting
Use this method to set image for testing face from File or URL.- Parameters:
image
- is specific location of face image, it can be local path in computer or link address of image.
Example: "C:/Users/Admin/Pictures/funfact.jpg"
or "https://www.onthisday.com/images/people/rowan-atkinson-medium.jpg"- Throws:
IOException
- throw an exception if there is no internet connection or can't download image from link.- See Also:
-
setImageOrginal
Use this method to set image for original face from BufferedImage.- Parameters:
buff
- is BufferedImage of face image.- Throws:
IOException
- throw an exception if can't write BufferedImage to file.- See Also:
-
setImageTesting
Use this method to set image for testing face from BufferedImage.- Parameters:
buff
- is BufferedImage of face image.- Throws:
IOException
- throw an exception if can't write BufferedImage to file.- See Also:
-
setRequirementPercent
Use this method to set the required percentage for face recognition. More high more hard. 65 is typical best performance and the default value also.- Parameters:
per
- is percentage required for face recognition to returntrue
.- See Also:
-
recognition
Use this method to recognition and get result after setup successfully all parameter.- Returns:
- Result after recognition.
-