|
37 | 37 | | assistSpeed | object | Show assist message whenever camera is moving faster than maxSpeed. [see properties](#values-for-optionsassistspeed) | |
38 | 38 | | autoCaptureInterval | integer | If set any number n, on each n interval camera will capture | |
39 | 39 | | captureOverlay | boolean | If set picture will be cropped according to overlay widget | |
40 | | -| faceDetection | object | Enable face detection. [see properties](#values-for-optionsfacedetection) | |
41 | 40 |
|
42 | 41 | ##### Values for options.assistAngle |
43 | 42 |
|
|
54 | 53 | | maxSpeed | number | Maximum speed in km/hr. | |
55 | 54 | | assistSpeedMessage | number | Custom message to show when condition is hit. | |
56 | 55 |
|
57 | | -##### Values for options.faceDetection |
58 | | - |
59 | | -| Property | Type | Description | |
60 | | -| :------------------------ | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | |
61 | | -| enabled | boolean | Enable face detection. | |
62 | | -| message | string | use this pass a message above the camera | |
63 | | -| messageStyle | object | style applied to the message widget | |
64 | | -| showControls | boolean | set false to hide all controls | |
65 | | -| showCaptureControl | boolean | set false to hide capture control icon | |
66 | | -| showFlashControl | boolean | set false to hide flash control control icon | |
67 | | -| showCameraLensControl | boolean | set false to hide camera lens control icon | |
68 | | -| indicatorShape | string | use this to change the shape of the face indicator `circle`, `square` | |
69 | | -| autoDisableCaptureControl | boolean | set true to disable capture control widget when no face is detected | |
70 | | -| autoCapture | boolean | set true to capture image on face detected | |
71 | | -| imageResolution | string | use this to set image resolution `low`, `medium`, `high` | |
72 | | -| defaultFlashMode | string | use this to set initial flash mode `off`, `auto`, `always` | |
73 | | -| performanceMode | string | Use this to set your preferred performance mode. `accurate`, `fast` | |
74 | | -| accuracyConfig | object | Use this to set accuracy config for face detection. Accuracy config is only supported on web. [see properties](#values-for-optionsfacedetectionaccuracyconfig) | |
75 | | - |
76 | | -##### Values for options.faceDetection.accuracyConfig |
77 | | - |
78 | | -> [Note] |
79 | | -> Accuracy config is only supported on web. |
80 | | -
|
81 | | -| Property | Type | Description | |
82 | | -| :------------------------- | :----- | :--------------------------------------------------------------------------- | |
83 | | -| detectionThreshold | number | Minimum confidence score required to consider a face detection valid. | |
84 | | -| intersectionRatioThreshold | number | Minimum allowed overlap ratio between the detected face and expected region. | |
85 | | -| extraHeightFactor | number | Additional height factor added to the face bounding box. | |
86 | | -| inputSize | number | Size of the input image used for face detection. | |
87 | | -| landmarkRatio | number | Minimum acceptable alignment accuracy for facial landmarks. | |
88 | | -| frameMargin | number | Margin ratio to ensure face is not too close to frame edges. | |
89 | | -| tiltAngleThreshold | number | Maximum allowed tilt angle of the detected face (in degrees). | |
90 | | -| horizontalCenterTolerance | number | Allowed tolerance for how centered the face must be horizontally. | |
91 | | -| earThreshold | number | Minimum Eye Aspect Ratio (EAR) to detect open eyes. | |
92 | | -| minFaceWidthRatio | number | Minimum ratio of face width relative to the frame. | |
93 | | -| maxFaceWidthRatio | number | Maximum ratio of face width relative to the frame. | |
94 | | -| qualityPassThreshold | number | Minimum quality score required for a face to pass detection. | |
95 | | -| yawLowerThreshold | number | Lower bound of acceptable yaw (left-right head rotation) ratio. | |
96 | | -| yawUpperThreshold | number | Upper bound of acceptable yaw (left-right head rotation) ratio. | |
97 | | - |
98 | | - |
99 | 56 | **Usage Examples** |
100 | 57 |
|
101 | | - |
102 | | - |
103 | 58 | ```yaml |
104 | 59 | View: |
105 | 60 | header: |
@@ -273,55 +228,4 @@ You can clear previous camera results while recapturing using `cameraId.clear()` |
273 | 228 | id: captureLatest |
274 | 229 | ``` |
275 | 230 |
|
276 | | -Capture image on face detected |
277 | | - |
278 | | -```yaml |
279 | | -- Button: |
280 | | - label: Open Camera |
281 | | - onTap: |
282 | | - openCamera: |
283 | | - id: cameraWithFaceDetection |
284 | | - options: |
285 | | - initialCamera: front |
286 | | - faceDetection: |
287 | | - enabled: true |
288 | | - autoCapture: false |
289 | | - performanceMode: accurate |
290 | | - accuracyConfig: # accuracyConfig is only supported on web |
291 | | - detectionThreshold: 0.5 |
292 | | - intersectionRatioThreshold: 0.9 |
293 | | - extraHeightFactor: 0.6 |
294 | | - inputSize: 224 |
295 | | - landmarkRatio: 0.95 |
296 | | - frameMargin: 0.05 |
297 | | - tiltAngleThreshold: 6 |
298 | | - horizontalCenterTolerance: 0.08 |
299 | | - earThreshold: 0.25 |
300 | | - minFaceWidthRatio: 0.18 |
301 | | - maxFaceWidthRatio: 0.82 |
302 | | - qualityPassThreshold: 0.8 |
303 | | - yawLowerThreshold: 0.85 |
304 | | - yawUpperThreshold: 1.15 |
305 | | - message: "Align your face in the square" |
306 | | - messageStyle: |
307 | | - color: "#FF0000" |
308 | | - fontSize: 20 |
309 | | - onCapture: |
310 | | - uploadFiles: |
311 | | - id: uploader |
312 | | - files: ${cameraWithFaceDetection.files[0]} |
313 | | - uploadApi: fileUploadApi |
314 | | - fieldName: file |
315 | | - onComplete: |
316 | | - showDialog: |
317 | | - body: |
318 | | - Column: |
319 | | - children: |
320 | | - - TextInput: |
321 | | - value: ${cameraWithFaceDetection.files[0]} |
322 | | - - Image: |
323 | | - source: ${cameraWithFaceDetection.files[0].path} |
324 | | -``` |
325 | | - |
326 | | - |
327 | 231 | To learn more about openCamera functionalities, test it out here in [Ensemble Kitchen Sink](https://studio.ensembleui.com/app/e24402cb-75e2-404c-866c-29e6c3dd7992/screen/USuOaOZApSgzE2uVrqlv) app. |
0 commit comments