Use the native iOS 11+ "Vision" framework in Axway Titanium.
| Original image | Processed image |
|---|---|
- Titanium SDK 6.2.0 or later
image(String | Ti.Blob - Required)callback(Function - Required)reportCharacterBoxes(Boolean - Optional)regionOfInterest(Object(x, y, width, height) - Optional)
image(String | Ti.Blob - Required)callback(Function - Required)regionOfInterest(Object(x, y, width, height) - Optional)
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();cd iphone
appc ti build -p ios --build-onlyThis 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.