Class FaceDetection

java.lang.Object
com.anlavn.opencv.FaceDetection

public final class FaceDetection extends Object
The FaceDetection class supports to face detection using the world’s largest computer vision library - OpenCV.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final void
    Use this method to end face detection.
    static final BufferedImage
    Use this method to get the BufferedImage of the entire frame being displayed on the JPanel.
    static final boolean
    Use this method to get the value of whether or not a face is being detected.
    static final boolean
    Use this method to get value of face detection is running or not.
    static final void
    Use this method to load Module support for face detection.
    Run this method first.
    static final void
    setDetectFace(boolean detectFace, Color color, int thickness)
    Use this method to set the rectangle when detect face.
    static final void
    Use this method to set the panel where will display the camera capture.
    static final void
    setDetectPanel(JPanel pan, int borderRadius)
    Use this method to set the panel with corner where will display the camera capture.
    static final void
    startDetection(int index)
    Use this method to start face detection using ID camera.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.
      See Also:
    • setDetectPanel

      public static final void setDetectPanel(JPanel pan)
      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

      public static final void setDetectPanel(JPanel pan, int borderRadius)
      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

      public static final void setDetectFace(boolean detectFace, Color color, int thickness)
      Use this method to set the rectangle when detect face.
      Parameters:
      detectFace - true if you want detect face, a rectangle will display when we detect a face. false if 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:
      true if you was set to detect a face, false if 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:
      true if startDetection() method is running, false if not.
      See Also:
    • getBufferedImage

      public static final BufferedImage 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.