- Requirements
- Configuration Files
- Ubuntu >= 20.04
- Python 3.9
- Install dependencies:
pip install -r requirements.txt - An Azure Kinect and/or a fisheye (mouth) camera device (connected over USB). Note: The fisheye camera applied in this prototype is a 'MACROSIL AV TO USB2.0' device.
-
in
config/main_config.pySetting Value options Description ACTIVE_MODEenum ModeTypeThe active mode to run. .CALIBRATION_IMAGESETCalibration over existing imageset. A connected device is not required. .CALIBRATION_REALTIMECaptures images and calibrates afterwards. One device has to be connected. .TRANSFORMATION_REALTIMETransformation of detected features from source to target device. Both devices have to be connected. SHOW_CAPTUREenum DisplayTypeThe camera image to display in a window. .BOTHDisplay captured images of both devices. Both devices have to be connected. .KINECTDisplay captured images of a Kinect device. A Kinect device has to be connected. .FISHEYEDisplay captured images of a Fisheye device. A Fisheye device has to be connected.
-
in
config/modes/calibration_config.py:Setting Value options Description DEVICE_NAMEstring Device identifier. This setting will name the output .xml file. The output file will have this format '<timestamp>_<DEVICE_NAME>_<SENSOR_TYPE>.xml'e.g. 'kinect'Example output file: '2023-01-06_17-10-35_fisheye_COLOR.xml'OUTPUT_PATHstring e.g. '_data/calibration/xml/'SENSOR_TYPEenum SensorType.COLOR.DEPTHIMAGE_RESOLUTIONdataclass KinectColorResolutionPre-defined resolutions for the Kinect color camera. .COLOR_1280x720.COLOR_1920x1080.COLOR_2048x1536.COLOR_2560x1440.COLOR_3840x2160dataclass KinectDepthResolutionPre-defined resolutions for the Kinect depth camera. .DEPTH_NFOV_2X2BINNED320 x 288 .DEPTH_WFOV_2X2BINNED512 x 512 .DEPTH_NFOV_UNBINNED640 x 576 .DEPTH_PASSIVE_IR1024 x 1024 dataclass FisheyeColorResolutionPre-defined resolutions for the applied Fisheye camera 'MACROSIL AV TO USB2.0'. .COLOR_640x480.COLOR_320x240.COLOR_160x120.COLOR_720x480IMAGE_PATHstring Path to an pre-existing imageset or output path for newly captured images. e.g. '_data/calibration/imageset/charuco/kinect/color/'IMAGE_EXTstring The image format. e.g. '.png'MIN_IMAGE_COUNTint The minimum of images for calibration. e.g. 50PATTERN_DETECTORenum PatternDetectorTypeThe desired pattern to detect for calibration. .CHARUCO.CHESSBOARD
-
in
config/modes/transformation_config.py:Setting Value options Description DETECTORenum DetectorTypeThe desired feature detector. .FANThe Facial Alignment Network by Adrian Bulat et al. .DLIBDlib's Shape Predictor based on the Ensemble of Regression Trees by Vahid Kazemi et al. .CHARUCOOpenCV's Charuco Detector. .CHESSBOARDOpenCV's Chessboard Detector.
-
in
config/devices/device_config.py:KinectDevice Configuration
Setting Value options Description KINECT_ID_MODELstring The udev ID_MODELof the Kinect device. *e.g. 'Azure_Kinect_4K_Camera'KINECT_COLOR_RESOLUTIONdataclass KinectColorResolution.COLOR_1280x720.COLOR_1920x1080.COLOR_2048x1536.COLOR_2560x1440.COLOR_3840x2160KINECT_DEPTH_RESOLUTIONdataclass KinectDepthResolution.DEPTH_NFOV_2X2BINNED.DEPTH_WFOV_2X2BINNED.DEPTH_NFOV_UNBINNED.DEPTH_PASSIVE_IRKINECT_FRAMERATEdataclass KinectFramerate.FPS_5.FPS_15.FPS_30KINECT_DISABLE_STREAMING_LEDbool TrueorFalseKINECT_USE_INTERNAL_CALIBRATIONbool TrueorFalseKINECT_COLOR_CALIBRATIONstring Path to a custom color camera calibration .xml file. Leave empty when none available. e.g. '_data/calibration/xml/2022-12-23_00-38-14_kinect.xml'KINECT_DEPTH_CALIBRATIONstring Path to a custom depth camera calibration .xml file. Leave empty when none available. e.g. ''FisheyeDevice Configuration
Setting Value options Description FISHEYE_ID_MODELstring The udev ID_MODELof the Fisheye device. *e.g. 'AV_TO_USB2.0'FISHEYE_COLOR_RESOLUTIONdataclass FisheyeColorResolution.COLOR_640x480.COLOR_320x240.COLOR_160x120.COLOR_720x480FISHEYE_FRAMERATEdataclass FisheyeFramerate.FPS_30FISHEYE_COLOR_CALIBRATIONstring Path to a color camera calibration .xml file. Leave empty when none available. e.g. '_data/calibration/xml/fisheye.xml'* On Ubuntu: Find the
ID_MODELof video devices usingudevsudo apt-get install udev udevadm info --query=all /dev/video* | grep 'ID_MODEL'
-
in
config/detectors/pattern_detector_config.py:ChAruco Configuration
Setting Value options Description CHARUCO_SHAPEtuple e.g. (6, 6)SQUARE_LENGTH_MMfloat e.g. 21.0MARKER_LENGTH_MMfloat e.g. 16.0MIN_MARKERS_TO_DETECTint e.g. 6DICTIONARYOpenCV PredefinedDictionaryType e.g. cv.aruco.DICT_4X4_50POSE_ESTIMATIONenum PoseEstimationType.SOLVEPNP.CHARUCO.BOARDUSE_CUSTOM_PARAMETERSbool TrueorFalseCORNER_REFINEMENT_METHODOpenCV CornerRefineMethod e.g. cv.aruco.CORNER_REFINE_CONTOURADAPTIVE_TRESH_CONSTANTint e.g. 7ADAPTIVE_TRESH_WIN_SIZE_MINint e.g. 5ADAPTIVE_TRESH_WIN_SIZE_MAXint e.g. 21ADAPTIVE_TRESH_WIN_SIZE_STEPint e.g. 4MIN_MARKER_PERIMETER_RATEfloat e.g. 0.01MIN_MARKER_DISTANCE_RATEfloat e.g. 0.01PERSPECTIVE_REMOVE_PIXEL_PER_CELLint e.g. 10PERSPECTIVE_REMOVE_IGNORED_MARGIN_PER_CELLfloat e.g. 0.2Chessboard Configuration
Setting Value options Description CHESSBOARD_SHAPEtuple e.g. (9, 6)TERMINATION_CRITERIAOpenCV TermCriteria e.g. (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 30, 0.1)WINDOW_SIZEtuple e.g. (5, 5)ZERO_ZONEtuple e.g. (-1, -1)
-
in
config/detectors/landmark_detector_config.py:Facial Alignment Network (FAN) Configuration
Setting Value options Description FAN_PROCESSING_DEVICEdataclass FANProcessingDevice.CUDA.CPUFAN_FLIP_IMAGESbool TrueorFalseFAN_LANDMARK_TYPEenum LandmarksType._2D._2halfD._3DFAN_NETWORK_SIZEenum NetworkSize.LARGEFAN_VERBOSEbool TrueorFalseFAN_FACE_DETECTORdataclass FANFaceDetector.SFD.DLIBFAN_SFD_FILTER_TRESHOLDfloat e.g. 0.8FAN_DLIB_MODEL_PATHstring e.g. '_data/models/mmod_human_face_detector.dat'Dlib's Shape Predictor (Ensemble of Regression Trees (ERT)) Configuration
Setting Value options Description DLIB_MODEL_PATHstring '_data/models/shape_predictor_68_face_landmarks.dat'