SRE02_AN_Migrating_from_API_3.6.52_to..

APPLICATION NOTE SRE02
Migrating from SmartRay API v3.6.52 → v4.1.2
Relevant Products
ECCO 35 Series
ECCO 55 Series
ECCO 75 Series
SR5600 Series
SR9600 Series
SR1200 Series
SR1400 Series
Version 1.0
REVISION 1
Migrating from API v3.6.52 to v4.1.2
Imprint
SmartRay GmbH
Bgm.-Finsterwalder-Ring 12
82515 Wolfratshausen
GERMANY
Tel.: +49 (0) 8171 9683 400
Fax: +49 (0) 8171 9683 401
E-Mail: [email protected]
Version 1.1
Migrating from API v3.6.52 to v4.1.2
2
Table of Contents
Table of Contents
1
Introduction ....................................................................................................................................... 4
2
Migration Steps for C/C++ Developers ............................................................................................ 5
Flowchart .......................................................................................................................................... 5
Working with ECCO 75 Series ......................................................................................................... 6
3
Migration Steps for C# Software Developers ................................................................................... 7
Flowchart .......................................................................................................................................... 7
What has changed in general? ........................................................................................................ 8
Working with ECCO 75 Series ......................................................................................................... 8
4
Support ............................................................................................................................................. 9
Feedback .......................................................................................................................................... 9
Version 1.1
Migrating from API v3.6.52 to v4.1.2
3
Migrating from API v3.6.52 to v4.1.2
1 Introduction
The goal of this application note is to help software developers to migrate their application software from SmartRay
API v3.6.52 to v4.1.2.The application note describes the steps to follow to ensure a smooth migration.
Note

SmartRay API v3.6.52 released with StarterKit Software 3.6.50.0.0 Service Pack 1

SmartRay API v4.1.2 released with StarterKit Software 4.1.2.X
Version 1.1
Migrating from API v3.6.52 to v4.1.2
4
Migrating from API v3.6.52 to v4.1.2
2 Migration Steps for C/C++ Developers
Flowchart
Install StarterKit Software 4.1.2.X
Get the latest version of SmartRay API 4.1.2.X
Run Studio 4 with your Sensor
Verify that your sensor performs as expected
Open your software application/framework
Change Include Path
C:\SmartRay\SR_StarterKit_Software\SR_SDK\SR_API\inc\opencv
C:\SmartRay\SR_StarterKit_Software\SR_SDK\SR_API\inc\sr_api
Change Library Path
C:\SmartRay\SR_StarterKit_Software\SR_SDK\SR_API\lib\opencv
C:\SmartRay\SR_StarterKit_Software\SR_SDK\SR_API\lib\sr_api
Change Linker Settings to use OpenCV 2.4.10
opencv_core2410.lib
opencv_highgui2410.lib
SR_API.lib
Modify the following lines of code
Replace the following lines of code
#include "cv.h"
#include "opencv2/core/core.hpp"
#include "highgui.h"
#include "opencv2/highgui/highgui.hpp"
Compile & Link your Software Application
contd…
Version 1.1
Migrating from API v3.6.52 to v4.1.2
5
Migrating from API v3.6.52 to v4.1.2
Working with ECCO 75 Series
Before integrating a sensor from the ECCO 75 Series with your application, please make sure that:
1.
The following callback functions are registered

To capture Live Image
SR_API_RegisterUserCB (SRCB_CAMDATAMODE, 0x8010, CBcommand0x8010);

To capture 3D Data
SR_API_RegisterUserCB (SRCB_SENSORDEFAULTMODE, 0x8020, CBcommand0x8020);
2.
Modify your Live Image Callback function as follows

Use memcpy (liveImg->imageData, pdata, liveImg->height*liveImg->width*sizeof(char)) instead of
cvSetData(…)

Version 1.1
Use liveImg=cvCreateImage (aktsize,IPL_DEPTH_8U,1) instead of cvCreateImageHeader(…)
Migrating from API v3.6.52 to v4.1.2
6
Migrating from API v3.6.52 to v4.1.2
3 Migration Steps for C# Software Developers
Flowchart
Install StarterKit Software 4.1.2.X
Get the latest version of SmartRay API 4.1.2.X
Run Studio 4 with your Sensor
Verify that your sensor performs as expected
Open your software application/framework
Exclude/Include References
EXCLUDE or REMOVE references to the old C# API
INCLUDE or ADD references to the new C# API
Update to OpenCV 2.4.10

The new API 4.1.2 uses OpenCV 2.4.10 instead of OpenCV 1.X.X
(The versions are downward compatible)

Therefore, you can keep working with the old syntax in case you
use OpenCV for your project. But, the new API 4.1.2 requires the
new OpenCV DLL’s
Compile your Software Application
Version 1.1
Migrating from API v3.6.52 to v4.1.2
7
Migrating from API v3.6.52 to v4.1.2
What has changed in general?

Callback Function for Live Image expects the following structure
o
Use callBk_LiveImage (int SensorId, int dattyp, int startX, int height, int width, ref byte[] data)
…instead of callBk_LiveImage (int SensorId, int dattyp, int startX, int height, int width, ref short[] data)

Connection Management
o
The API function SRAPI.getCnnectionState (int SensorID) returns an exception if the sensor was
not initialized properly
Note: In the old API v3.6.52, this function would return -1
Working with ECCO 75 Series
The data generated by ECCO 75 3D sensors can be much larger compared to the other sensor series. Therefore,
before integrating a sensor from the ECCO 75 Series in your application, please make sure that:

You have enough memory allocated, in case you used static arrays for storing data.
Version 1.1
Migrating from API v3.6.52 to v4.1.2
8
Migrating from API v3.6.52 to v4.1.2
4 Support
Feedback
For general questions about the SmartRay 3D Sensors, get in touch with SmartRay Customer Services by writing
to [email protected]
Version 1.1
Migrating from API v3.6.52 to v4.1.2
9