Skip to content

Releases: Yoonit-Labs/nativescript-yoonit-camera

v3.2.0

15 Apr 18:24
Compare
Choose a tag to compare

🗑 Deprecated

  • [Method] Removed setFacePaddingPercent functionality;

✨ 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

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

v3.1.0

07 Apr 21:02
Compare
Choose a tag to compare

💥 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:
  • type: "face" or "frame"
  • count: current index
  • total: total to create
  • image.path: the face/frame image path
  • image.source: the blob file
  • image.binary: the blob file
  • inferences: An Array with models output
  • darkness: image darkness classification.
  • lightness: image lightness classification.
  • sharpness: image sharpness classification.

    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

    • android-yoonit-facefy: update from 2.9.0 to 2.10.0;
    • ios-yoonit-camera: update from 2.5.0 to 2.6.0;

    v3.0.0

    05 Apr 12:26
    Compare
    Choose a tag to compare

    🔊 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] faceMinSize renamed to detectionMinSize: is applicable when roi enabled;
    • [Prop] faceMaxSize renamed to detectionMaxSize: ignored when roi enabled;
    • [Method] setFaceCaptureMinSize renamed to setDetectionMinSize: is applicable when roi enabled;
    • [Method] setFaceCaptureMaxSize renamed to setDetectionMaxSize: ignored when roi enabled;
    • [Message] INVALID_CAPTURE_FACE_MIN_SIZE renamed to INVALID_MINIMUM_SIZE;
    • [Message] INVALID_CAPTURE_FACE_MAX_SIZE renamed to INVALID_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] faceROI renamed to roi;
    • [Prop] faceROITopOffset renamed to roiTopOffset;
    • [Prop] faceROIRightOffset renamed to roiRightOffset;
    • [Prop] faceROIBottomOffset renamed to roiBottomOffset;
    • [Prop] faceROILeftOffset renamed to roiLeftOffset;
    • [Prop] faceROIMinSize removed;
    • [Prop] faceDetectionBox renamed to detectionBox;
    • [Method] setFaceROIEnable renamed to setROI;
    • [Method] setFaceROITopOffset renamed to setROITopOffset;
    • [Method] setFaceROIRightOffset renamed to setROIRightOffset;
    • [Method] setFaceROIBottomOffset renamed to setROIBottomOffset;
    • [Method] setFaceROILeftOffset renamed to setROILeftOffset;
    • [Method] setFaceROIAreaOffset renamed to setROIAreaOffset;
    • [Method] setFaceROIMinSize removed;
    • [Method] setFaceDetectionBox renamed to setDetectionBox;
    • [Message] INVALID_CAPTURE_FACE_OUT_OF_ROI renamed to INVALID_OUT_OF_ROI;
    • [Message] INVALID_CAPTURE_FACE_ROI_MIN_SIZE removed;

    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:

    🎉 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

    • android-yoonit-camera update to 2.9.0;
    • ios-yoonit-camera update to 2.5.0;

    v2.3.0

    25 Jan 22:22
    Compare
    Choose a tag to compare

    ✨ New Feature

    • [Method] Add new method destroy to stop preview and destroy the camera session;

    ⚡ Improvements

    • In android and iOS disposeNativeView, call destroy method and remove all listeners;
    • In vue.js, replace stopCapture by destroy method;

    📝 Update Readme

    • Add new method destroy definitions;

    ⬆️ Upgrade Dependencies

    • android-yoonit-camera update from 2.5.2 to 2.5.3;
    • ios-yoonit-camera update from 2.2 to 2.2.1;

    v2.2.0

    23 Jan 11:54
    Compare
    Choose a tag to compare

    🔊 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: computerVision and faceLandmarks;

    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 the README.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

    ⬆️ Upgrade Dependencies

    • android-yoonit-camera update from 2.4.0 to 2.5.2;
    • ios-yoonit-camera use CocoaPods;

    v2.1.0

    11 Jan 18:25
    Compare
    Choose a tag to compare

    New Feature

    • Add new method setCameraLens;

    ♻️ Refactor

    • Change getLens return;
    • Remove setLens method;

    ⚡ Improvements

    Now it is possible to use props before YoonitCamera component is loaded. Internally we have the following events:

    1. Using decorator, all props is stored;
    2. In the moment that the YoonitCamera is created (initView), the native functions is called;
    3. The decorator does not store the props anymore;

    📝 Update Readme

    • Add new method setCameraLens definitions;
    • Change getCameraLens definitions;
    • Remove setLens method definitions;

    ⬆️ Upgrade Dependencies

    v2.0.0

    15 Dec 12:08
    Compare
    Choose a tag to compare

    💥 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 onBarcodeScanned to onQRCodeScanned;
    • Change method name from setFaceSaveImages to setSaveImageCaptured;
    • Change method startCaptureType input 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 setNumberOfImages definition;
    • Add new method setTimeBetweenImages definition;
    • Add new method setOutputImageHeight definition;
    • Add new method onImageCaptured definition;
    • Add new method setFaceROITopOffset;
    • Add new method setFaceROIRightOffset;
    • Add new method setFaceROIBottomOffset;
    • Add new method setFaceROILeftOffset;
    • Add new event onQRCodeScanned definition;
    • Remove event onFaceImageCreated definition;
    • Remove event onFrameImageCreated definition;
    • 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.0 to 2.0.2;
    • ios-yoonit-camera update from 1.6.0 to 2.0.2;

    New Dependencies

    • Add new dependency: reflect-metadata version ^0.1.13. Used to implement decorators.

    v1.8.0

    27 Nov 01:20
    Compare
    Choose a tag to compare

    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 Message when a face is going out of the ROI;
    • Add new method to set face minimum size inside the ROI. Emit a Message when a face is smaller than the minimum size set;

    📝 Update Readme

    • Add method setFaceROIEnable definition;
    • Add method setFaceROIOffset definition;
    • Add method setFaceROIMinSize definition;
    • Add KeyError INVALID_FACE_ROI_MIN_SIZE definition;
    • Add Message INVALID_CAPTURE_FACE_OUT_OF_ROI definition;
    • Add Message INVALID_CAPTURE_FACE_ROI_MIN_SIZE definition;

    ⬆️ Upgrade Dependencies

    • android-yoonit-camera update from 1.4.0 to 1.5.0;
    • ios-yoonit-camera update from 1.5.0 to 1.6.0;

    v1.7.0

    26 Nov 11:23
    Compare
    Choose a tag to compare

    New Feature

    • Add new method to enable/disable face save images when started capture type face;

    📝 Update Readme

    • Add method setFaceSaveImages definition;

    ⬆️ Upgrade Dependencies

    • android-yoonit-camera update from v1.3.2 to 1.4.0;
    • ios-yoonit-camera update from 1.4.1 to 1.5.0;

    v1.6.0

    17 Nov 20:52
    Compare
    Choose a tag to compare

    ⚡ 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.1 to v1.3.2;
    • ios-yoonit-camera update from 1.4.0 to 1.4.1;