Luxand FaceSDK – Mask-on Face Detection

To detect faces covered by masks, you need to adjust the settings of several parameters. You also need to download a model file trained specifically on masked faces (for visual face detection) and put it into the working directory of your application:

If you are using FSDK_DetectFace or FSDK_DetectMultipleFaces to detect faces (i.e. you don't use Tracker API), use the following code to set the recommended face detection parameters and use the latest model file:

int err = 0;
FSDK_SetFaceDetectionParameters(true, false, 1024);

if (FSDKE_OK !=
fprintf(stderr, "Error loading face detection model!\n");

Alternatively, if you are using Tracker API, use the following calls:

int err = 0;
FSDK_SetTrackerMultipleParameters(tracker, "RecognizeFaces=false; HandleArbitraryRotations=true;
DetermineFaceRotationAngle=false; InternalResizeWidth=1024; FaceDetectionThreshold=5;", &err);

if (FSDKE_OK != FSDK_SetTrackerMultipleParameters(tracker,
fprintf(stderr, "Error loading face detection model!\n");

In the code above, the TrimFacesWithUncertainFacialFeatures parameter is set to false. When it is set to true, faces with uncertain facial features are removed from the detection result. As masks may cover many facial features, this setting was preventing such faces from being detected. You can learn more about this parameter here:

We don't recommend that you use face matching when this parameter is set to false, since it will give a higher amount of false acceptances. We plan to update our face recognition models so they support mask-on face matching soon.

We recommend setting the InternalResizeWidth parameter to 1024 so the faces that are far from the camera are detected. If you don't expect your faces to be that far, you can lower the parameter value to 512 or 256 to increase the speed of detection.


Next chapterFace Matching


Get in touch

Luxand, Inc.
815 N. Royal St. Suite 202
Alexandria, VA
+1 800 471 5636

Join our newsletter

And always stay informed of the latest company news and events!

Sign up >> Protection Status