Releases: Yoonit-Labs/nativescript-yoonit-camera
v3.2.0
🗑 Deprecated
- [Method] Removed
setFacePaddingPercentfunctionality;
✨ New Feature
| Function | Props | Input Type | Valid Values | Description |
|---|---|---|---|---|
| setDetectionTopSize | detectionTopSize | number | 0 |
Represents the percentage. Positive value enlarges and negative value reduce the top side of the detection. |
| setDetectionRightSize | detectionRightSize | number | 0 |
Represents the percentage. Positive value enlarges and negative value reduce the right side of the detection. |
| setDetectionBottomSize | detectionBottomSize | number | 0 |
Represents the percentage. Positive value enlarges and negative value reduce the bottom side of the detection. |
| setDetectionLeftSize | detectionLeftSize | number | 0 |
Represents the percentage. Positive value enlarges and negative value reduce the left side of the detection. |
🐛 Bug Fix
- Fix saved image orientation when using camera lens back;
📝 Update Readme
- Add Variables section;
- Add Image Quality specifications:
Image Quality
The image quality is the classification of the three attributes: darkness, lightness and sharpness. Result available in the imageCapture event. Let's see each parameter specifications:
| Threshold | Classification |
|---|---|
| Darkness | |
| darkness > 0.7 | Too dark |
| darkness <= 0.7 | Acceptable |
| Lightness | |
| lightness > 0.65 | Too light |
| lightness <= 0.65 | Acceptable |
| Sharpness | |
| sharpness >= 0.1591 | Blurred |
| sharpness < 0.1591 | Acceptable |
⬆️ Upgrade Dependencies
- android-yoonit-facefy update from
2.10.0to2.11.0; - ios-yoonit-camera update from
2.6.0to2.7.0;
v3.1.0
💥 Breaking Changes
Changes in the event imageCaptured. Add the image quality parameters:
- darkness: image darkness classification;
- lightness: image lightness classification;
- sharpness: image sharpness classification;
Before:
imageCaptured(
type: string,
count: number,
total: number,
imagePath: string,
inferences: []
)Now:
imageCaptured(
type: string,
count: number,
total: number,
imagePath: string,
inferences: []
darkness: number,
lightness: number,
sharpness: number
)✨ New Feature
Image Quality
| Event | Parameters | Description |
|---|---|---|
| imageCaptured | { type: string, count: number, total: number, image: object = { path: string, source: any, binary: any }, inferences: [{ ['model name']: model output }], darkness: number, lightness: number, sharpness: number } |
Must have started capture type of face/frame. Emitted when the face image file saved:
|
Face Contours for iOS
| Function | Parameters | Valid values | Return Type | Description |
|---|---|---|---|---|
| setFaceContours | enable: boolean |
true or false |
void | Enable/disable display list of points on a detected face. |
| setFaceContoursColor | color: string |
Hexadecimal color | void | Set face contours color. |
🐛 Bug Fix
Android
- Fix qrcode reading in specific devices;
- Fix face analysis when using the back camera lens;
iOS
- Fix drawing face bounding box;
- Fix face analysis when using the back camera lens;
📝 Update Readme
- Update project description;
- Update image captured event usage;
- Update face contours description;
⬆️ Upgrade Dependencies
v3.0.0
🔊 Yoonit Camera 3.0
Hello Devs, how have you been?
We are happily announcing the 3.0 version. This release is very important to the entire team, and we expect to the world too.
👥 New Contributor
Let's begin announcing a new contributor, our team mate and friend @gabrielrizzo. He is already in the Yoonit-Labs team and have been advising the project long ago. In this release he decided to code.
Now, let's see what we have in this release:
Detection Size
The detection validation by size is not related only to face anymore. It's applicable to QR code detection too. Soon, this feature will be applicable to the "computer vision" features.
- [Prop]
faceMinSizerenamed todetectionMinSize: is applicable whenroienabled; - [Prop]
faceMaxSizerenamed todetectionMaxSize: ignored whenroienabled; - [Method]
setFaceCaptureMinSizerenamed tosetDetectionMinSize: is applicable whenroienabled; - [Method]
setFaceCaptureMaxSizerenamed tosetDetectionMaxSize: ignored whenroienabled; - [Message]
INVALID_CAPTURE_FACE_MIN_SIZErenamed toINVALID_MINIMUM_SIZE; - [Message]
INVALID_CAPTURE_FACE_MAX_SIZErenamed toINVALID_MAXIMUM_SIZE;
Region of Interest
ROI is not related only to face detection, it's generic and can be applicable to QR code detection. Soon, the ROI will be applicable to the entire camera frame. In the name of the consistency and pattern, changes made necessary not only internal, but also method's names and some were removed:
- [Prop]
faceROIrenamed toroi; - [Prop]
faceROITopOffsetrenamed toroiTopOffset; - [Prop]
faceROIRightOffsetrenamed toroiRightOffset; - [Prop]
faceROIBottomOffsetrenamed toroiBottomOffset; - [Prop]
faceROILeftOffsetrenamed toroiLeftOffset; - [Prop]
faceROIMinSizeremoved; - [Prop]
faceDetectionBoxrenamed todetectionBox; - [Method]
setFaceROIEnablerenamed tosetROI; - [Method]
setFaceROITopOffsetrenamed tosetROITopOffset; - [Method]
setFaceROIRightOffsetrenamed tosetROIRightOffset; - [Method]
setFaceROIBottomOffsetrenamed tosetROIBottomOffset; - [Method]
setFaceROILeftOffsetrenamed tosetROILeftOffset; - [Method]
setFaceROIAreaOffsetrenamed tosetROIAreaOffset; - [Method]
setFaceROIMinSizeremoved; - [Method]
setFaceDetectionBoxrenamed tosetDetectionBox; - [Message]
INVALID_CAPTURE_FACE_OUT_OF_ROIrenamed toINVALID_OUT_OF_ROI; - [Message]
INVALID_CAPTURE_FACE_ROI_MIN_SIZEremoved;
Face Analysis
Now, the face is not only detected, it is analyzed. What this really means? Well, this means that we can "understand" the face gestures, like smiles, blinks and the head movements.
This changes is the reflect of the core, the native layer. The main change is the integration in the native layer with the new projects:
- android-yoonit-facefy to the android-yoonit-camera;
- ios-yoonit-facefy to the ios-yoonit-camera;
🎉 Yoonit Facefy
This project has the focus in the face detection and analysis. He is the responsible for the Face Analysis features.
- Avoid inflate Yoonit Camera project and better maintenance;
- Enables other projects that not use the camera to analyse faces too;
Add in the event faceDetect the Face Analysis parameters.
Before:
faceDetected(
x: number,
y: number,
width: number,
height: number
)Now:
faceDetected(
x: number,
y: number,
width: number,
height: number,
leftEyeOpenProbability: number,
rightEyeOpenProbability: number,
smilingProbability: number,
headEulerAngleX: number,
headEulerAngleY: number,
headEulerAngleZ: number
)Computer Vision
Computer vision is the "feature" kit with the focus in the usage of the Machine Learning in the edge. Only for Android.
➕ New Dependency: PyTorch
With the integration in the native layer, now it is possible to use any trained model in the images captured. It's only the beginning and we have big expectations with this integration.
Before:
imageCapture({
type: string,
count: number,
total: number,
image: object = {
path: string,
source: blob,
bynary: blob
}
})Now:
imageCapture({
type: string,
count: number,
total: number,
image: object = {
path: string,
source: any,
binary: any
},
inferences: [{
['model_name']: []
}]
})API
| Function | Props | Input Type | Valid Values | Default Value | Description |
|---|---|---|---|---|---|
| setComputerVision | computerVision | boolean | - | false |
Enable/disable computer vision model. |
| setComputerVisionLoadModels | - | Array | - | [] |
Set model to be used when image is captured. |
| computerVisionClearModels | - | - | - | - | Clear models that was previous added using setComputerVisionLoadModels. |
✨ New Features
Android & iOS
| Function | Props | Input Type | Valid Values | Default Value | Description |
|---|---|---|---|---|---|
| setTorch | torch | boolean | - | false |
Enable/disable device torch. Available only to camera lens "back". |
| setDetectionColor | detectionColor | string | - | "#ffffff73" |
Set detection box color. |
| setROIAreaOffsetColor | roiAreaOffsetColor | string | - | "#ffffff73" |
Set display of the region of interest area offset color. |
Android Only
| Function | Props | Input Type | Valid Values | Default Value | Description |
|---|---|---|---|---|---|
| setFaceContours | faceContours | boolean | - | false |
Enable/disable display list of points on a detected face. |
| setFaceContoursColor | faceContoursColor | string | - | "#FFFFFF" |
Set face contours color. |
⬆️ Upgrade Dependencies
v2.3.0
✨ New Feature
- [Method] Add new method
destroyto stop preview and destroy the camera session;
⚡ Improvements
- In android and iOS
disposeNativeView, calldestroymethod and remove all listeners; - In
vue.js, replacestopCapturebydestroymethod;
📝 Update Readme
- Add new method
destroydefinitions;
⬆️ Upgrade Dependencies
- android-yoonit-camera update from
2.5.2to2.5.3; - ios-yoonit-camera update from
2.2to2.2.1;
v2.2.0
🔊 Special Thanks!
Special thanks for @RGBvision and @ramosestudiante for your contributions that make this library better and better!
-
@RGBvision for report the issue #37:
Photo broken on Android 7.0; -
@ramosestudiante for report the issue #41 and resolve with your Pull Request #42:
TypeError: Cannot read property 'forEach' of null;
💥 Breaking Changes
Changed the functions and pros names for a better understanding and improve pattern.
The motivation for this changes:
- Pattern and group the functions that is related with a specific feature. For example:
faceROI(face region of interest),face(face detection),imageCapture(image capture amount, interval, width...); - Prepare for news features:
computerVisionandfaceLandmarks;
Some functions and props will be changed yet and the input type not changed.
Pattern functions and props names:
| Old Function | Old Prop | New Function | New Prop | |
|---|---|---|---|---|
| - | initialLens | ➡️ | - | lens |
| setSaveImageCaptured | saveImageCaptured | ➡️ | setImageCapture | imageCapture |
| setNumberOfImages | numberOfImages | ➡️ | setImageCaptureAmount | imageCaptureAmount |
| setTimeBetweenImages | timeBetweenImages | ➡️ | setImageCaptureInterval | imageCaptureInterval |
| setOutputImageWidth | outputImageWidth | ➡️ | setImageCaptureWidth | imageCaptureWidth |
| setOutputImageHeight | outputImageHeight | ➡️ | setImageCaptureHeight | imageCaptureHeight |
🐛 Bug Fix
-
Fixed the issue #37 reported by @RGBvision: changed the color encoding from "YUV" to "RGB" as default:
Photo broken on Android 7.0; -
Fixed the issue #41 reported by @ramosestudiante:
TypeError: Cannot read property 'forEach' of null;
✨ New Feature
- [Android] Add new method (
setImageCaptureColorEncoding) and props (colorEncoding) to change the color encoding the captured images. See more in theREADME.md.
⚡ Improvements
- Add new decorator to save and execute native view on init;
📝 Update Readme
Add new function definitions:
| Function | Parameters | Valid Values | Default Value |
|---|---|---|---|
| setImageCaptureColorEncoding | colorEncoding: string | "YUV" or "RGB" | "RGB" |
Add new props definitions:
| Props | Input Type | Valid Values | Default Value |
|---|---|---|---|
| colorEncoding | string | "YUV" or "RGB" | "RGB" |
🔀 Accepted Pull Requests
- Special thanks to @ramosestudiante for your Pull Request #42 that fixed the issue #41;
⬆️ Upgrade Dependencies
- android-yoonit-camera update from
2.4.0to2.5.2; - ios-yoonit-camera use CocoaPods;
v2.1.0
✨ New Feature
- Add new method
setCameraLens;
♻️ Refactor
- Change
getLensreturn; - Remove
setLensmethod;
⚡ Improvements
Now it is possible to use props before YoonitCamera component is loaded. Internally we have the following events:
- Using decorator, all props is stored;
- In the moment that the
YoonitCamerais created (initView), the native functions is called; - The decorator does not store the props anymore;
📝 Update Readme
- Add new method
setCameraLensdefinitions; - Change
getCameraLensdefinitions; - Remove
setLensmethod definitions;
⬆️ Upgrade Dependencies
- android-yoonit-camera update to 2.2.1;
- ios-yoonit-camera update to 2.1.1;
- Accept PR 33
- Accept PR 34
v2.0.0
💥 Breaking Changes
Unify methods setFaceNumberOfImages and setFrameNumberOfImages into setNumberOfImages:
- Changed for better understanding and usage;
- The number of images is used to capture face and frame;
- The number of images value "0" still capture unlimited number of images;
- Add validation: the number of images value can not be negative;
Unify methods setFaceTimeBetweenImages and setFrameTimeBetweenImages into setTimeBetweenImages;
- Changed for better understanding and usage simplification;
- The time between of images is used to capture face and frame;
- The time between of images value is still in milliseconds;
- Add validation: the time between of images value can not be negative;
Split methods setFaceImageSize in setOutputImageWidth and setOutputImageHeight;
- Changed for better understanding;
- Add validation: the output image width value can not be negative;
- Add validation: the output image height value can not be negative;
Unify events onFaceImageCreated and onFrameImageCreated into onImageCaptured;
- Changed for better understanding and usage simplification;
- The number of images is used to capture face and frame;
- The event is used when a face or frame image is saved;
Refactor face region of interest inputs into four new methods:
- Remove method
setFaceROIOffset; - Add new method
setFaceROITopOffset; - Add new method
setFaceROIRightOffset; - Add new method
setFaceROIBottomOffset; - Add new method
setFaceROILeftOffset;
Some others changes:
- Change event name from
onBarcodeScannedtoonQRCodeScanned; - Change method name from
setFaceSaveImagestosetSaveImageCaptured; - Change method
startCaptureTypeinput from "barcode" to "qrcode";
✨ New Feature
Now the component accepts props. Internally the component call the functions related and delegate if necessary.
| Props | Function Called |
|---|---|
initialLens |
setLens |
captureType |
startCapture |
numberOfImages |
setNumberOfImages |
timeBetweenImages |
setTimeBetweenImages |
outputImageWidth |
setOutputImageWidth |
outputImageHeight |
setOutputImageHeight |
faceMinSize |
setFaceCaptureMinSize |
faceMaxSize |
setFaceCaptureMaxSize |
faceDetectionBox |
setFaceDetectionBox |
saveImageCaptured |
setSaveImageCaptured |
faceROI |
setFaceROIEnable |
faceROITopOffset |
setFaceROITopOffset |
faceROIRightOffset |
setFaceROIRightOffset |
faceROIBottomOffset |
setFaceROIBottomOffset |
faceROILeftOffset |
setFaceROILeftOffset |
faceROIMinSize |
setFaceROIMinSize |
🥅 Catch Errors
Add validation when inputing value in the following methods:
startCapture: Valid values "none", "face", "frame" and "qrcode";setLens: Valid values "front" and "back";setNumberOfImages: Value can not be negative;setTimeBetweenImages: Value can not be negative;setOutputImageWidth: Format must be "NNpx";setOutputImageHeight: Format must be "NNpx";setFacePaddingPercent: Format must be "NN%";setFaceCaptureMinSize: Format must be "NN%";setFaceCaptureMaxSize: Format must be "NN%";setFaceDetectionBox: Must be a boolean;setSaveImageCaptured: Must be a boolean;setFaceROIEnable: Must be a boolean;setFaceROITopOffset: Format must be "NN%";setFaceROIRightOffset: Format must be "NN%";setFaceROIBottomOffset: Format must be "NN%";setFaceROILeftOffset: Format must be "NN%";setFaceROIMinSize: Value must be between 0 and 1;
🏗️ Architectural Changes
With the new ios-yoonit-camera version 2.0.2 it is possible to use iOS functions like Android.
That means all the native functions implementations in Yoonit.Camera.android.ts and Yoonit.Camera.ios.ts moved to the Yoonit.Camera.common.ts.
- No more duplicated (android & ios) native functions implementations maintenance;
- No more duplicated (android & ios) native functions code review;
- Reduce many (many, many...) lines of codes;
📝 Update Readme
- Add new method
setNumberOfImagesdefinition; - Add new method
setTimeBetweenImagesdefinition; - Add new method
setOutputImageHeightdefinition; - Add new method
onImageCaptureddefinition; - Add new method
setFaceROITopOffset; - Add new method
setFaceROIRightOffset; - Add new method
setFaceROIBottomOffset; - Add new method
setFaceROILeftOffset; - Add new event
onQRCodeScanneddefinition; - Remove event
onFaceImageCreateddefinition; - Remove event
onFrameImageCreateddefinition; - Remove method
setFaceROIOffset;
Add new section, the Props:
| Props | Input/Format | Default value | Description |
|---|---|---|---|
initialLens |
`"front" | "back"` | "front" |
captureType |
`"none" | "front" | "frame" |
numberOfImages |
number | 0 |
The number of images to be captured. |
timeBetweenImages |
number | 1000 |
The time interval in milliseconds to capture between images. |
outputImageWidth |
NNpx |
"200px" |
The output image width in pixels to be captured. |
outputImageHeight |
NNpx |
"200px" |
The output image height in pixels to be captured. |
faceMinSize |
NN% |
"0%" |
The face minimum size percentage to be captured. |
faceMaxSize |
NN% |
"100%" |
The face maximum size percentage to be captured. |
faceDetectionBox |
boolean | false |
The indicator to show/hide the face detection box. |
saveImageCaptured |
boolean | false |
The indicator to enable/disabled when an image captured. |
faceROI |
boolean | false |
The indicator to enable.disable the region of interest. |
faceROITopOffset |
NN% |
"0%" |
The "top" offset percentage region of interest. |
faceROIRightOffset |
NN% |
"0%" |
The "right" offset percentage region of interest. |
faceROIBottomOffset |
NN% |
"0%" |
The "bottom" offset percentage region of interest. |
faceROILeftOffset |
NN% |
"0%" |
The "left" offset percentage region of interest. |
faceROIMinSize |
NN% |
"0%" |
The minimum face related with the ROI. |
⬆️ Upgrade Dependencies
- android-yoonit-camera update from
1.5.0to2.0.2; - ios-yoonit-camera update from
1.6.0to2.0.2;
➕ New Dependencies
- Add new dependency:
reflect-metadataversion^0.1.13. Used to implement decorators.
v1.8.0
✨ New Feature
ROI - Region of Interest
- Add new method to set camera lens;
- Add new method to enable/disable face capture with ROI restrictions;
- Add new method to set top, right, bottom and left offsets of the ROI. Emit a
Messagewhen a face is going out of the ROI; - Add new method to set face minimum size inside the ROI. Emit a
Messagewhen a face is smaller than the minimum size set;
📝 Update Readme
- Add method
setFaceROIEnabledefinition; - Add method
setFaceROIOffsetdefinition; - Add method
setFaceROIMinSizedefinition; - Add
KeyErrorINVALID_FACE_ROI_MIN_SIZEdefinition; - Add
MessageINVALID_CAPTURE_FACE_OUT_OF_ROIdefinition; - Add
MessageINVALID_CAPTURE_FACE_ROI_MIN_SIZEdefinition;
⬆️ Upgrade Dependencies
- android-yoonit-camera update from
1.4.0to1.5.0; - ios-yoonit-camera update from
1.5.0to1.6.0;
v1.7.0
✨ New Feature
- Add new method to enable/disable face save images when started capture type face;
📝 Update Readme
- Add method
setFaceSaveImagesdefinition;
⬆️ Upgrade Dependencies
- android-yoonit-camera update from
v1.3.2to1.4.0; - ios-yoonit-camera update from
1.4.1to1.5.0;
v1.6.0
⚡ Improvements
iOS Improve project architecture, video and metadata capture always instantiated:
- Do not blink preview when start/stop capture type;
- Improve crop position face from the camera image;
⬆️ Upgrade Dependencies
- android-yoonit-camera update from
v1.3.1tov1.3.2; - ios-yoonit-camera update from
1.4.0to1.4.1;