Technical specifications : Insert Data into Pixee App - Mobile SDK/API - Production example : Pixee App on AppStore

Technical Specifications - Visual Search Software Development Kit (SDK) Pixee

The SDK provides visual recognition, bar code reading and optical caracter recognition, to be integrated in a few minutes into your mobile application.
Download SDK versioning
Download demo project

Table of contents


1. Introduction

This aim of this document is to define the MilPix / Pixee SDK and the relevent part of the MilPix API and is described using iOS sample code.

2. API Constraints

2.1. Target Platforms

The API should be able to be included and compilable on iOS 4 (or above).

2.2. Frameworks

The API is based on these frameworks which must be included in the project :
  • Foundation
  • UIKit
  • CoreGraphics
  • CoreLocation
  • MapKit
  • QuartzCore
  • SystemConfiguration
  • AVFoundation

2.3. Project configuration

To properly use the Pixee SDK, the project must be configured by following these steps :
  • In the Build Settings add the flag -all_load in Other Linker Flags
  • Copy the provided files anywhere in the project, xcode should add the file to the current target and configure the library search path itself. If not, refer to the iOS reference documentation and Xcode help do so.
  • Import MilpixSDK.h either in the project .pch file or in each file calling the SDK classes.
  • Add all the required frameworks in the Link Binaries With Libraries build phase of the project.

3. Public API

3.1. PXSearchManager

This class handles the search requests. Searches can be initiated with an existing picture or start the camera to capture a new one.

3.1.1. sharedSearchManager

Is called to get a unique instance of the search manager.

[PXSearchManager sharedSearchManager];

3.1.2. Start picture search from camera

This is done by calling the pxStartPicSearchFromCameraWithFilters method. Filters can be set to choose the language and the layer to search in.

pxStartPicSearchFromCameraWithFilters:(NSDictionary*)filters delegate:(id<PXSearchDelegate>)delegate

Search results are returned as an array through the given delegate. If the camera is not available an alert pop-up is displayed and the gallery is started for the user to choose an existing picture.

Parameters
filters : a dictionary that contain the following search parameters :

  • « layers » : Array of layer names to search in.
  • « language » : language used for the search.
delegate : the PXDelegate used to receive the search results.

NSArray* layers = [NSArray arrayWithObject:@"myLayer"];
NSDictionary* filters = [NSDictionary dictionaryWithObjectsAndKeys:@"fr",@"language",layers,@"layers",nil];
PXSearchManager* searchManager = [PXSearchManager sharedSearchManager];
[searchManager pxStartPicSearchFromCameraWithFilters:filters delegate:self];

Choosing default camera
You can choose the intially used camera (front or rear camera) by changing useFrontalCamera value.

PXSearchManager* searchManager = [PXSearchManager sharedSearchManager];
searchManager.useFrontalCamera = NO;

3.1.3. Start picture search from existing picture in gallery

This is done by calling the pxStartPicSearchFromGalleryWithFilters method. The usage is the same as the pxStartPicSearchFromCameraWithFilters method.

3.2. PXSearchDelegate

This is the protocol to receive events from Milpix search manager.

3.2.1. Receive search results

The method pxSearchEndedWithResults is called when a search has completed successfully.

PxSearchEndedWithResults:(NSArray*)results

3.2.2. Handle errors

If search fails, the method pxSearchFailed is called.

pxSearchFailed

3.2.3. Result format

The structure of the result object is defined by Milpix SA. Be careful to catch the possible absence of some fields depending on the returned object type.

3.3. UI Customization

User interface can be customized by calling pxSetTheme:andColor method.

pxSetTheme:(PXTheme)theme andColor:(UIColor*)colorOrNil

Theme can be any of these two values :

  • PXThemeLight : to display black icons on a light toolbar
  • PXThemeDark : to display white buttons on a dark toolbar
The color argument is a ting applied to the toolbar. Be careful to set a color that will display correctly according to the chosen theme.
If no color is provided the toolbar will take a default color depending on the chosen theme.

4. Thank you !

We hope the SDK will deliver the best for your business and we deeply thank you for your interest in our products. Do not hesitate to contact us via the help button on the right side.