▶️Getting Started
The camera SDK is a PPG recording module that you can use in combination with the FibriCheck Flutter SDK. This page help you to get started with this module.
Intro
A FibriCheck measurement consists of PPG data. To gather this PPG data, the Camera SDK will natively communicate with the underlying iOS/Android camera layer, process this data, and return an object that is ready to be submitted to our backend for analysis. Multiple properties and listeners can be adjusted/attached for improving the visualization/customization of the process.
A FibriCheck Measurement consists of multiple phases:
Finger detection
Checks for the presence of a finger on the camera. A timeout can be set to 0 to skip this phase. By default, this is
-1
which means that it will keep checking until a finger has been detected.
Pulse detection
Checks if a pulse is present. When no pulse has been detected for 10 seconds, the calibration phase will start.
Calibration
When performing a measurement, a baseline needs to be calculated. When this baseline has been calculated, the calibration is ready and recording can commence.
Recording
The real deal. The recording calculates the PPG data by communicating with the native camera layers. The default length of the recording is 60 seconds, but can be changed by updating the sampleTime.
Processing
When the recording is finished, some additional processing needs to be done on the measurement. When done, a measurement object is presented via the onMeasurementProcessed event.
Installation
In your project, you can add the package below to the pubspec.yaml
file. Replace {TOKEN} with your personal access token. You can get a new one here. Make sure you enable the repo
scope.
Making your first recording
Permissions
The recording makes use of the device's camera. So to begin, you need to provide camera permissions. Check out the permission_handler package or a similar package on how to accomplish this easily.
Also, don't forget to define these permissions:
Android
Add this to the AndroidManifest.xml
file:
For more information regarding Android permissions, check the official Android documentation.
iOS
Add this to the Info.plist
file:
For more information regarding these iOS permissions, check the official iOS documentation.
Widget
When the permissions are all set up, you can implement the FibriCheck widget like this:
Pitfalls
Using the correct camera lens
In order to aid the user in using the correct camera lens, you can provide a preview of the relevant camera via the following package: https://pub.dev/packages/camera.
The camera SDK uses the wide angle camera, which is in almost all the cases the first one of the camera
array.
Last updated