Good day to all.
In January, Microsoft released the Tag Scanning SDK for Windows Phone 7 and I was already lucky enough to work with it. On the possibilities, limitations and specific points and will be this post.
Microsoft Tag Description
')
On Habré there
was a post in which it was told about this technology. In short, this is a two-dimensional (High Capacity Color Barcode - HCCB) barcode developed by Microsoft. It was specifically designed for recognition with cameras embedded in mobile phones. Designed for quick identification and receipt on the device of pre-prepared information tied to the code and stored on the server of Microsoft (from Wikipedia).
You can read about its advantages and disadvantages on the Internet, but the main difference is the
need to connect to the Microsoft server .
Start of development
In addition to the standard tools for developing for Windows Phone 7, you will need to download the SDK and get the key to work. Keys are of 2 types: trial and for commercial purpose.
Trial:
- For developing and testing applications
- Max 100 scans per day
- Associated payload unavailable
Commercial:
- For publishing applications
- No limit on the number of scans
Associated payload - a special identifier associated with a specific application (type String, maximum length 2048 characters). A kind of identifier, which can then be used.
To get a trial-key, you need to go to
Key Manager using your Live ID, where you can also download the SDK.
To get a commercial-key, you need to write a Microsoft Tag Team letter describing the application.
At the time of publication, the SDK version is 7832. I hope there will be new versions, where the functionality will be brought to the level of other platforms.
Here I would like to make a retreat ...
SDK history
Initially, the SDK was available on 2 systems: iOS and Android. This is due to the fact that the class needed to work with the camera in Windows Phone 7 appeared only in the latest version (Mango, 7.5). This is the
PhotoCamera class. It provides basic functionality for working with the camera (main and front). So that the user can monitor the received image in real time and reduce the number of unsuccessful recognitions (Each time the user would launch the Camera Task and only after that the image would be recognized).
SDK Composition
- Microsoft.Tag.Core.dll - the main DLL
- CHM documentation
- SDK Review for Mango
- Example
Algorithm recognition on the client side
1) The PhotoCamera object is initialized (when navigating to the page - OnNavigatedTo)
2) Image acquisition
3) Image scan
4) Attempt to recognize
5) Running the output of the result (LaunchExperience)
6) Cleaning up resources and objects (when navigating from the page - OnNavigatingFrom)
This algorithm is taken from an example, but there are some points to be aware of:
- In the example, there is no InitializeTagSdk method, in which you specify your key. It can be taken from the Microsoft Tag Scanning SDK Overview Mango.pdf.
- In the comments to the image acquisition method (GetImageAndDecode) it is indicated that it is better (read - mandatory) to remove the focus to another method or link to another event, since the call will occur too often. The first time you start it even scares a little what happens to the camera. In my application, I shifted the focus to events when I clicked on the screen, but you can use the CameraButtons class to link to the physical button of the phone
- And continuing the topic of focusing, it is logical to scan the image after focusing, and not all the time. The call to GetImageAndDecode is transferred immediately after the focus call.
- The call to output the result from the history occurs on another page. This is done because with the initial algorithm (when the image is scanned continuously), no parallelization of tasks occurs. That is, you can either try to recognize the picture, or cause a result from the history. In the case where the scan occurs after focusing - this is already fixed.
- Since initialization happens on OnNavigatedTo, if you use the MVVM template, there may be some difficulties. Everything is solved by writing auxiliary classes or simply referring to the DataContext, but still ...
You can add to this list the lack of offline-call, which is in versions for other platforms (Android, for example). This allows you to download the result without scanning, simply by specifying an identifier. I think this will be fixed in the next version.
There are also some restrictions on the type of applications being created. It can be found in the description of the Scanning SDK. Basic: you can not create a multi-format code scanner.
Reference materials:
Microsoft Tag Scanning SDK OverviewMicrosoft Tag Application RequirementsTerms and Agreements for Tag SDKMicrosoft Tag - Description in Wikipedia