Classes | |
struct | _CSCamera |
struct | _CSData |
struct | _ImgEntry |
structure used in SR_GetImageList() More... | |
struct | _ParamVal |
Defines | |
#define | CM_CAM_SELECT 0x0030 |
#define for SR_FuncCB | |
#define | CM_CHANGED 0x0011 |
#define for SR_FuncCB | |
#define | CM_CHANGING 0x0010 |
#define for SR_FuncCB | |
#define | CM_MSG_DISPLAY 0x0001 |
#define for SR_FuncCB | |
#define | CM_PROGRESS 0x0020 |
#define for SR_FuncCB | |
#define | CM_SRS_FILE 0x0002 |
#define for SR_FuncCB | |
#define | CP_AFFECTS_BUFFER 0x0001 |
#define for SR_FuncCB | |
#define | CP_CAM_REBOOT 0x0005 |
#define for SR_FuncCB | |
#define | CP_CONNECT 0x0004 |
#define for SR_FuncCB | |
#define | CP_CS_CLOSEDLG 0x0005 |
#define for SR_FuncCB | |
#define | CP_CS_OPENDLG 0x0000 |
#define for SR_FuncCB | |
#define | CP_DONE 0x0006 |
#define for SR_FuncCB | |
#define | CP_FIND_DONE 0x0003 |
#define for SR_FuncCB | |
#define | CP_FLASH_ERASE 0x0001 |
#define for SR_FuncCB | |
#define | CP_FLASH_READ 0x0003 |
#define for SR_FuncCB | |
#define | CP_FLASH_WRITE 0x0002 |
#define for SR_FuncCB | |
#define | CP_FOUND_CAM 0x0002 |
#define for SR_FuncCB | |
#define | CP_FPGA_BOOT 0x0004 |
#define for SR_FuncCB | |
#define | CP_GET_FILENAME 0x0006 |
#define for SR_FuncCB | |
#define | CP_SCAN_CAM 0x0001 |
#define for SR_FuncCB | |
#define | CP_SRS_EOF 0x0001 |
#define for SR_FuncCB | |
#define | CP_SRS_FRAMEPOS 0x0002 |
#define for SR_FuncCB | |
#define | CP_UNKNOWN 0x0000 |
#define for SR_FuncCB | |
Typedefs | |
typedef struct _CSCamera | CSCamera |
typedef struct _CSData | CSData |
typedef struct _ImgEntry | ImgEntry |
structure used in SR_GetImageList() | |
typedef struct _ParamVal | ParamVal |
typedef struct _ParamVal | |
typedef int( | SR_FuncCB )(SRCAM srCam, unsigned int msg, unsigned int param, void *data) |
typedef struct _CMesaDevice * | SRCAM |
handle to camera | |
Enumerations | |
enum | AcquireMode { AM_COR_FIX_PTRN = 0x01, AM_MEDIAN = 0x04, AM_TOGGLE_FRQ = 0x08, AM_CONV_GRAY = 0x10, AM_SW_ANF = 0x20, AM_RESERVED0 = 0x40, AM_RESERVED1 = 0x80, AM_CONF_MAP = 0x0100, AM_HW_TRIGGER = 0x0200, AM_SW_TRIGGER = 0x0400, AM_DENOISE_ANF = 0x0800, AM_MEDIANCROSS = 0x1000 } |
enum | FSCmd { FS_JMP_FRAME_REL, FS_JMP_FRAME_BEGIN, FS_JMP_FRAME_END, FS_GET_NUM_FRAME } |
Switches to jump/setup the reading of srs streams. More... | |
enum | IPBArg { IPB_SETUP_GUI, IPB_SETUP_CONV, IPB_SETUP_BINARIZE, IPB_HISTOGRAM, IPB_CONV0, IPB_CONV1, IPB_IN_THRESHOLD_MIN, IPB_IN_THRESHOLD_MAX, IPB_OUT_THRESHOLD_MIN, IPB_OUT_THRESHOLD_MAX } |
enum | IPBinatizeSetup { IPBS_BINARIZE_IN = 0x01, IPBS_BINARIZE_OUT = 0x02 } |
enum | IPConvSetup { IPCS_SRC_DIST = 0x00, IPCS_SRC_AMPL = 0x80, IPCS_OPP_ADD = 0x00, IPCS_OPP_SUB = 0x20, IPCS_OPP_ABS = 0x10 } |
enum | ModulationFrq { MF_40MHz = 0, MF_30MHz, MF_21MHz, MF_20MHz, MF_19MHz, MF_60MHz, MF_15MHz, MF_10MHz, MF_29MHz, MF_31MHz, MF_14_5MHz, MF_15_5MHz, MF_LAST } |
enum | SRMsgCategory { MC_GENERAL = 0x0000, MC_DLL_FUNC = 0x0100, MC_CAM = 0x0200, MC_USB = 0x0300, MC_CONFIG = 0x0400, MC_FIRMWARE = 0x0500, MC_XML = 0x0600, MC_CAM_DLG = 0x0700, MC_HTTP = 0x0800, MC_ETH = 0x0900, MC_RESERVED = 0x0a00, MC_FILEIO = 0x0b00, MC_B_GIG_E = 0x0c00 } |
Message Category: enum for function SR_FuncCB with message type CM_MSG_DISPLAY. More... | |
enum | SRMsgKind { MK_DEBUG_STRING = 0x00, MK_BOX_INFO = 0x01, MK_BOX_WARN = 0x02, MK_BOX_ERR = 0x03 } |
Message Kind: enum for function SR_FuncCB with message type CM_MSG_DISPLAY. More... | |
Functions | |
SR_API (enum ModulationFrq) SR_GetModulationFrequency(SRCAM srCam) | |
SR_API (void *) SR_GetImage(SRCAM srCam | |
SR_API (unsigned int) SR_GetRows(SRCAM srCam) | |
returns the number of rows the camera will deliver | |
SR_API (void) SR_SetTimeout(SRCAM srCam | |
SR_API (SR_FuncCB *) SR_SetCallback(SR_FuncCB *cb) | |
SR_API (int) SR_GetVersion(unsigned short version[4]) | |
returns the version of this libMesaSR library. | |
Variables | |
const char * | addr |
char * | buf |
char int | buflen |
unsigned char unsigned char unsigned char unsigned char | desiredPos |
unsigned short | distOfs |
const unsigned char const unsigned char const unsigned short * | iDst |
unsigned char | idx |
ImgEntry ** | imgEntryArray |
unsigned int DWORD | inAddr |
unsigned int DWORD DWORD | inMask |
unsigned char | intTime |
IPBArg | |
const unsigned char * | iX |
const unsigned char const unsigned char * | iY |
unsigned char unsigned char | maxIntTime |
unsigned char | minIntTime |
int | mode |
enum ModulationFrq | modFrq |
int | ms |
const unsigned char const unsigned char const unsigned short short short unsigned short int | num |
unsigned int | numSrCam |
const unsigned char const unsigned char const unsigned short short * | oX |
const unsigned char const unsigned char const unsigned short short short * | oY |
const unsigned char const unsigned char const unsigned short short short unsigned short * | oZ |
int HWND | parent |
unsigned char unsigned char unsigned char | percentOverPos |
short short unsigned short int | pitchX |
short short unsigned short int int | pitchY |
short short unsigned short int int int | pitchZ |
unsigned char | reg |
unsigned int | serialNumber |
unsigned short | val |
short * | x |
short short * | y |
short short unsigned short * | z |
#define CM_CAM_SELECT 0x0030 |
#define for SR_FuncCB
Definition at line 240 of file definesSR.h.
#define CM_CHANGED 0x0011 |
#define for SR_FuncCB
Definition at line 224 of file definesSR.h.
#define CM_CHANGING 0x0010 |
#define for SR_FuncCB
Definition at line 223 of file definesSR.h.
#define CM_MSG_DISPLAY 0x0001 |
#define for SR_FuncCB
Definition at line 216 of file definesSR.h.
#define CM_PROGRESS 0x0020 |
#define for SR_FuncCB
Definition at line 228 of file definesSR.h.
#define CM_SRS_FILE 0x0002 |
#define for SR_FuncCB
Definition at line 218 of file definesSR.h.
#define CP_AFFECTS_BUFFER 0x0001 |
#define for SR_FuncCB
Definition at line 226 of file definesSR.h.
#define CP_CAM_REBOOT 0x0005 |
#define for SR_FuncCB
Definition at line 235 of file definesSR.h.
#define CP_CONNECT 0x0004 |
#define for SR_FuncCB
Definition at line 246 of file definesSR.h.
#define CP_CS_CLOSEDLG 0x0005 |
#define for SR_FuncCB
Definition at line 247 of file definesSR.h.
#define CP_CS_OPENDLG 0x0000 |
#define for SR_FuncCB
Definition at line 242 of file definesSR.h.
#define CP_DONE 0x0006 |
#define for SR_FuncCB
Definition at line 236 of file definesSR.h.
#define CP_FIND_DONE 0x0003 |
#define for SR_FuncCB
Definition at line 245 of file definesSR.h.
#define CP_FLASH_ERASE 0x0001 |
#define for SR_FuncCB
Definition at line 231 of file definesSR.h.
#define CP_FLASH_READ 0x0003 |
#define for SR_FuncCB
Definition at line 233 of file definesSR.h.
#define CP_FLASH_WRITE 0x0002 |
#define for SR_FuncCB
Definition at line 232 of file definesSR.h.
#define CP_FOUND_CAM 0x0002 |
#define for SR_FuncCB
Definition at line 244 of file definesSR.h.
#define CP_FPGA_BOOT 0x0004 |
#define for SR_FuncCB
Definition at line 234 of file definesSR.h.
#define CP_GET_FILENAME 0x0006 |
#define for SR_FuncCB
Definition at line 248 of file definesSR.h.
#define CP_SCAN_CAM 0x0001 |
#define for SR_FuncCB
Definition at line 243 of file definesSR.h.
#define CP_SRS_EOF 0x0001 |
#define for SR_FuncCB
Definition at line 220 of file definesSR.h.
#define CP_SRS_FRAMEPOS 0x0002 |
#define for SR_FuncCB
Definition at line 221 of file definesSR.h.
#define CP_UNKNOWN 0x0000 |
#define for SR_FuncCB
Definition at line 230 of file definesSR.h.
typedef struct _ParamVal
Enum and struct used in the function SR_SetParam() {structure}
function type used in SR_SetCallback()
funcData | is the user data pointer that was set with SR_SetCallback. | |
msg | is the received message of type CM_XXX as listed below | |
param | is a message specific parameter as listed below | |
data | is a message specific pointer as listed below |
defines used for the callback function SR_SetCallback() are:
Definition at line 213 of file definesSR.h.
typedef struct _CMesaDevice* SRCAM |
handle to camera
Definition at line 170 of file definesSR.h.
enum AcquireMode |
Enum used in the function SR_SetMode() The suggested default settings are:
Definition at line 47 of file definesSR.h.
enum FSCmd |
Switches to jump/setup the reading of srs streams.
Definition at line 110 of file definesSR.h.
enum IPBArg |
Argument for image processing block.
samples:
SR_SetImgProcBlk(dev,IPB_HISTOGRAM,1); SR_SetImgProcBlk(dev,IPB_IN_THRESHOLD_MIN,12000); char kernel[25]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24}; SR_SetImgProcBlk(dev,IPB_CONV0,kernel);
IPB_SETUP_GUI |
Opens a GUI for configuration (Only Windows). |
IPB_SETUP_CONV |
convolution switches. See also: IPConvSetup |
IPB_SETUP_BINARIZE |
Binatize switches. See also: IPBinatizeSetup. |
IPB_HISTOGRAM |
histrogram in last line (on/off). Followed by a uchar with value 0 or 1 |
IPB_CONV0 |
Convolution kernel 0. Followed by a char[25] with the kernel values. |
IPB_CONV1 |
Convolution kernel 1. Followed by a char[25] with the kernel values. |
IPB_IN_THRESHOLD_MIN |
Input minimal threshold value. followed by a ushort value. |
IPB_IN_THRESHOLD_MAX |
Input minimal threshold value. followed by a ushort value. |
IPB_OUT_THRESHOLD_MIN |
Input minimal threshold value. followed by a ushort value. |
IPB_OUT_THRESHOLD_MAX |
Input minimal threshold value. followed by a ushort value. |
Definition at line 73 of file definesSR.h.
enum IPBinatizeSetup |
Switches for binarization blocks. Uned in combination with IPB_SETUP_BINARIZE sample: SR_SetImgProcBlk(dev,IPB_SETUP_BINARIZE,IPBS_BINARIZE_IN|IPBS_BINARIZE_OUT); SR_SetImgProcBlk(dev,IPB_SETUP_BINARIZE,0); value is: Ored IPBinatizeSetup.
IPBS_BINARIZE_IN |
input binarization (ON/OFF) |
IPBS_BINARIZE_OUT |
output binarization (ON/OFF) |
Definition at line 104 of file definesSR.h.
enum IPConvSetup |
Switches for convolution block. Uned in combination with IPB_SETUP_CONV sample: SR_SetImgProcBlk(dev,IPB_SETUP_CONV,(IPCS_SRC_DIST|IPCS_OPP_ADD|IPCS_OPP_ABS)+sensitivity); value is: (Ored IPConvSetup) + sensitivity. sensitivity may have a value from 0 to 16
IPCS_SRC_DIST |
source selector distance or amplitude |
IPCS_SRC_AMPL |
" |
IPCS_OPP_ADD |
kernel combination operation |
IPCS_OPP_SUB |
" |
IPCS_OPP_ABS |
absolute value (on/off) |
Definition at line 91 of file definesSR.h.
enum ModulationFrq |
Modulation frequency for function SR_SetModulationFrequency()
Definition at line 27 of file definesSR.h.
enum SRMsgCategory |
Message Category: enum for function SR_FuncCB with message type CM_MSG_DISPLAY.
Definition at line 285 of file definesSR.h.
enum SRMsgKind |
Message Kind: enum for function SR_FuncCB with message type CM_MSG_DISPLAY.
MK_DEBUG_STRING |
OutputDebugString. |
MK_BOX_INFO |
MessageBox ASTERISK. |
MK_BOX_WARN |
MessageBox WARNING. |
MK_BOX_ERR |
MessageBox HAND. |
Definition at line 276 of file definesSR.h.
SR_API | ( | enum | ModulationFrq | ) |
Gets the modulation frequency of the LEDs. This determins the measurement range.
SR_API | ( | void * | ) |
Returns the pointer to the idx-th image. The idx has a value from 0 to SR_GetImageList()-1. Details about which image contains what kind of data can be extracted with SR_GetImageList() Usually index is 0 for distance image and 1 for amplitude image
SR_API | ( | unsigned | int | ) |
returns the number of rows the camera will deliver
Returns the serial number (if existing) of the camera.
returns the number of columns the camera will deliver
Gets the Integration time of the camera The intTime is a value from 0 to 255. The integration time in ms depends on the camera
Gets the Amplitude Threshold of the camera
Gets the Distance Offset. This function should only be used on SR2 cameras. On newer cameras the distance offset correction is handeled with a camera specific calibration file.
Returns a desired register value of the camera.
SR_API | ( | void | ) |
sets the timeout in ms. This timeout is used at reading and writing on USB or Ethernet port. Any function which communicates with the camera will fail if it exeeds the timeout.
SR_API | ( | SR_FuncCB * | ) |
SR_SetCallback() can set a user callback function of type SR_FuncCB that is called on special events. Such special events can be:
SR_API | ( | int | ) |
returns the version of this libMesaSR library.
Generic Open for any kind of camera. This opens a dialog box and lists all available USB and Ethernet swissranger Cameras. One of them can be selected and opened. A reference of the most recently connected camera is stored in the registry. The mode is used to select how the dialog is handled.
the mode
is used to select how the dialog is handled
the mode bits are:
so following modes make sense:
The parent is a HWND window handle.
Seeks for all visible devices and opens them all. the caller gives a srCam array with size num.
{function}
Opens the Swissranger USB device and returns a device ID. The serial number is only used, if more than one camera is connected to the computer.
Setting the serialNumber to 0 opens the first found camera To open a specific camera, serialNumber is set to the last 8 digits of the printed serial number, as a hexadecimal value, e.g. 0x4000002f for the camera SN: 00-00-40-00-00-2F.
Opens the Swissranger Ethernet device and returns a device ID. The addr is the ip address of the camera. e.g. "192.168.2.14"
Opens a dialog which allows control of important camera settings. The parent is an HWND. The parent is a HWND. The Window is Non Modal and will be destroyed if it is closed or if the camera is closed.
Closes the swissranger device, first releasing the claimed interface.
srCam | a valid device returned by the SR_Open() function. |
The mode controls a number of characteristics of the image acquisition process, as described in the enumeration AcquireMode. The mode is an ored value of the enumerator AcquireMode. The recommended mode is described in AcquireMode.
Returns the current mode setting. It is an ored value of the enumerator AcquireMode.
SR_Acquire() triggers image acquisition on the camera and transfers the data from the camera to the PC. The acquired images can be retrieved with SR_GetImage(). After this function normally the spherical coordinates are transformed to cartesian coordinates. for that purpose use one of the following functions:
SR_CoordTrfUint16(), SR_CoordTrfFlt(),SR_CoordTrfDbl()
The AcquisitionMode can be set with the function SR_SetMode().
Transforms spherical coordinates to cartesian coordinates. The pointers x,y,z are unsigned short arrays of the length SR_GetRows() * SR_GetCols(). The result values are in mm. The pitches is the distance in byte from one value to the next. Default value is sizeof(unsigned short)=2
Transforms spherical coordinates to cartesian coordinates. The pointers x,y,z are float arrays of the length SR_GetRows() * SR_GetCols(). The result values are in m. The pitches is the distance in byte from one value to the next. Default value is sizeof(float)=4
Transforms spherical coordinates to cartesian coordinates. The pointers x,y,z are double arrays of the length SR_GetRows() * SR_GetCols(). The result values are in m. The pitches is the distance in byte from one value to the next. Default value is sizeof(double)=8 This function is not more precise than SR_CoordTrfFlt(), but can be useful, if double values are used.
Transforms spherical coordinates to cartesian coordinates. All pointers are arrays with the length num. The pointers iX,iY,iDst are input pixel coordinates and distance value. The pointers oX,oY,oZ are output cartesian coordinates.
Returns a identification string of the device: The string is formated as:
"VendorID:0x%04x, ProductID:0x%04x, Manufacturer:'%s', Product:'%s'" e.g.: VendorID:0x0852, ProductID:0x0071, Manufacturer:'CSEM SA', Product:'3D-SR2 16Bit'
Returns the number of images available and a pointer to an imgEntryArray. Images may be accessed directly by the data member of the ImEntry elements, or using SR_GetImage() with the corresponding array index.
Sets the Integration time of the camera The intTime is a value from 0 to 255. The integration time in ms depends on the camera:
SR2A | intTime*0.256 ms |
SR2B,SR3k | (intTime+1)*0.200 ms |
SR4k | 0.300ms+(intTime)*0.100 ms |
Sets the Amplitude Threshold of the camera. The default amplitude threshold is 0. Setting this value will set all distance values to 0 if their amplitude is lower than the amplitude threshold
Sets the modulation frequency of the LEDs. This also changes the full-scale (0xFFFF) measurement range of the raw distance.
The supported frequencies depend on the camera.
A table of the supported frequency is listed in ModulationFrq .
SR_SetModulationFrequency allows simultaneous operation of multiple cameras without interference by using different frequencies, e.g. using 29, 30 and 31MHz.
Sets the Distance Offset. This function should only be used on SR2 cameras. On newer cameras the distance offset correction is handeled with a camera specific calibration file.
Turns the AutoExposure on/off and set the desired parameters. if minIntTime=0xff
the AutoExposure is turned off.
good values are:
minIntTime
and maxIntTime
.percentOverPos
.percentOverPos
(values 0-100) is the x-position of the histogram where percentOverPos
percent of the points are above. The integration time is adapted slowly to move this position to the desiredPos
(value 0-255)intensity value. In case of background light saturation saturation the histogram is not a linear function. This can lead to an instable, swinging system, if there are strong background light in the image.Sets a desired register value of the camera. The register values are given to the customer only for special usages.
srCam | a valid device id returned by the SR_Open() function. | |
reg | the register of the descriptor to write to. | |
val | the value to send to the given descriptor. |
Setup the image processing block.
Same as SR_SetImgProcBlk with variable arguments pointer.
const char* addr |
Definition at line 132 of file libMesaSR.h.
char* buf |
Definition at line 233 of file libMesaSR.h.
char int buflen |
Definition at line 233 of file libMesaSR.h.
unsigned char unsigned char unsigned char unsigned char desiredPos |
Definition at line 325 of file libMesaSR.h.
unsigned short distOfs |
Definition at line 306 of file libMesaSR.h.
const unsigned char const unsigned char const unsigned short * iDst |
Definition at line 201 of file libMesaSR.h.
unsigned char idx |
Definition at line 249 of file libMesaSR.h.
Definition at line 254 of file libMesaSR.h.
Definition at line 119 of file libMesaSR.h.
Definition at line 119 of file libMesaSR.h.
unsigned char intTime |
Definition at line 267 of file libMesaSR.h.
Definition at line 351 of file libMesaSR.h.
const unsigned char * iX |
Definition at line 201 of file libMesaSR.h.
const unsigned char const unsigned char * iY |
Definition at line 201 of file libMesaSR.h.
unsigned char unsigned char maxIntTime |
Definition at line 325 of file libMesaSR.h.
unsigned char minIntTime |
Definition at line 325 of file libMesaSR.h.
int mode |
Definition at line 113 of file libMesaSR.h.
enum ModulationFrq modFrq |
Definition at line 297 of file libMesaSR.h.
int ms |
Definition at line 237 of file libMesaSR.h.
const unsigned char const unsigned char const unsigned short float float float int num |
Definition at line 201 of file libMesaSR.h.
unsigned int numSrCam |
Definition at line 119 of file libMesaSR.h.
const unsigned char const unsigned char const unsigned short float * oX |
Definition at line 201 of file libMesaSR.h.
const unsigned char const unsigned char const unsigned short float float * oY |
Definition at line 201 of file libMesaSR.h.
const unsigned char const unsigned char const unsigned short float float float * oZ |
Definition at line 201 of file libMesaSR.h.
Definition at line 113 of file libMesaSR.h.
unsigned char unsigned char unsigned char percentOverPos |
Definition at line 325 of file libMesaSR.h.
double double double int pitchX |
Definition at line 179 of file libMesaSR.h.
double double double int int pitchY |
Definition at line 179 of file libMesaSR.h.
double double double int int int pitchZ |
Definition at line 179 of file libMesaSR.h.
unsigned char reg |
Definition at line 339 of file libMesaSR.h.
unsigned int serialNumber |
Definition at line 127 of file libMesaSR.h.
unsigned char unsigned char val |
Definition at line 279 of file libMesaSR.h.
double * x |
Definition at line 179 of file libMesaSR.h.
double double * y |
Definition at line 179 of file libMesaSR.h.
double double double * z |
Definition at line 179 of file libMesaSR.h.