Package com.anlavn.opencv
Class FaceDetection
java.lang.Object
com.anlavn.opencv.FaceDetection
The FaceDetection class supports to face detection using the world’s largest computer vision library - OpenCV.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidUse this method to end face detection.static final BufferedImageUse this method to get the BufferedImage of the entire frame being displayed on the JPanel.static final booleanUse this method to get the value of whether or not a face is being detected.static final booleanUse this method to get value of face detection is running or not.static final voidUse this method to load Module support for face detection.
Run this method first.static final voidsetDetectFace(boolean detectFace, Color color, int thickness) Use this method to set the rectangle when detect face.static final voidsetDetectPanel(JPanel pan) Use this method to set the panel where will display the camera capture.static final voidsetDetectPanel(JPanel pan, int borderRadius) Use this method to set the panel with corner where will display the camera capture.static final voidstartDetection(int index) Use this method to start face detection using ID camera.
-
Constructor Details
-
FaceDetection
public FaceDetection()
-
-
Method Details
-
loadModule
public static final void loadModule()Use this method to load Module support for face detection.
Run this method first. -
setDetectPanel
Use this method to set the panel where will display the camera capture.- Parameters:
pan- is JPanel you want to display the camera capture.- See Also:
-
setDetectPanel
Use this method to set the panel with corner where will display the camera capture.- Parameters:
pan- is JPanel you want to display the camera capture.borderRadius- is corner border radius of JPanel.- See Also:
-
startDetection
public static final void startDetection(int index) Use this method to start face detection using ID camera.- Parameters:
index- ID of the video capturing device to open. To open default camera using 0 value.- See Also:
-
endDetection
public static final void endDetection()Use this method to end face detection.- See Also:
-
setDetectFace
Use this method to set the rectangle when detect face.- Parameters:
detectFace-trueif you want detect face, a rectangle will display when we detect a face.falseif you don't want.color- is the color of rectangle when it display.thickness- is the thickness of rectangle when it display.- See Also:
-
isDetectFace
public static final boolean isDetectFace()Use this method to get the value of whether or not a face is being detected.- Returns:
trueif you was set to detect a face,falseif you wasn't set value or set to not detect a face.- See Also:
-
isDetection
public static final boolean isDetection()Use this method to get value of face detection is running or not.- Returns:
trueif startDetection() method is running,falseif not.- See Also:
-
getBufferedImage
Use this method to get the BufferedImage of the entire frame being displayed on the JPanel.- Returns:
- a BufferedImage of entire frame in JPanel.
-