Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 1.62 KB

README.md

File metadata and controls

68 lines (52 loc) · 1.62 KB

iOS 11+ Vision in Titanium

Use the native iOS 11+ "Vision" framework in Axway Titanium.

Original image Processed image
Before After

Requirements

  • Titanium SDK 6.2.0 or later

API's

Methods

detectTextRectangles(args)

  • image (String | Ti.Blob - Required)
  • callback (Function - Required)
  • reportCharacterBoxes (Boolean - Optional)
  • regionOfInterest (Object(x, y, width, height) - Optional)

detectFaceRectangles(args)

  • image (String | Ti.Blob - Required)
  • callback (Function - Required)
  • regionOfInterest (Object(x, y, width, height) - Optional)

Example

var Vision = require('ti.vision');

var win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});

var btn = Ti.UI.createButton({
    title: 'Recognize Image Rectangles'
});

btn.addEventListener('click', function() {
    if (!Vision.isSupported()) {
        return Ti.API.error('Sorry dude, iOS 11+ only!');
    }
    
    Vision.detectTextRectangles({
        image: 'image_sample_tr.png',
        callback: function(e) {
            if (!e.success) {
                return Ti.API.error(e.error);
            }
            
            Ti.API.info(e);
        }
    });
});

win.add(btn);
win.open();

Build

cd iphone
appc ti build -p ios --build-only

Legal

This module is Copyright (c) 2017-Present by Appcelerator, Inc. All Rights Reserved. Usage of this module is subject to the Terms of Service agreement with Appcelerator, Inc.