MVSDK
MVSDK
Version 2.4
CONTENTS
SUMMARY.................................................................................... 1
STATEMENT .............................................................................. 2
1 OUTLINE ............................................................................................................................... 1
5.5 ADJUST THE CAMERA IMAGE BRIGHTNESS(SET THE EXPOSURE TIME) ............................. 170
5.6 SWITCH TO A DIFFERENT RESOLUTION AND A CUSTOM RESOLUTION (ROI FUNCTION) ......... 171
5.7 SET THE CAMERA'S CONTRAST, GAMMA, SATURATION, SHARPNESS AND OTHER PARAMETERS
ISP 171
5.8 COLOR CAMERAS SWITCH TO BLACK AND WHITE CAMERA ................................................... 172
5.9 MULTIPLE CAMERAS SIMULTANEOUSLY, AND ESTABLISH A CORRESPONDENCE BETWEEN
THE CAMERA .................................................................................................................................... 173
5.10 FLIP AND MIRROR IMAGE ROTATION ............................................................................. 174
5.11 TEXT OVERLAY FEATURE ON THE IMAGE ...................................................................... 175
5.12 SAVE PICTURES AND VIDEO FEATURES ......................................................................... 175
5.13 SETTING THE CAMERA IMAGE OUTPUT BIT DEPTH ........................................................ 176
5.14 SET THE PIXEL FORMAT OF THE IMAGE(8-BIT GRAYSCALE, 24,32,48-BIT COLOR) ... 176
2
6 GIGE VISION AND USB3 VISION INTERPRETATION OF THE DEFINITION OF
XML DOCUMENTS .......................................................................................................................... 181
10TECHNICAL SUPPORT
..................................................................................................... 200
3
Summary
This document provides for the use of our industrial cameras for secondary
development of the user, to use the system for the development of a dynamic link
library function is described in detail, and provides a quick programming guide,
so that in a short time be able to be integrated into the camera the user's system.
Statement
The software copyright, copyright and intellectual property rights to all of the
Company, and by the "People's Republic of China Copyright Law", "Computer
Software Protection organized", "Intellectual Property Protection Ordinance" and
related international copyright treaties, laws, regulations, and other knowledge
protection of property rights laws and treaties. Any unit or individual can not be
used without our authorization, modify or republish any part of the Software, or will
be deemed illegal infringement, the company claimed prosecuted under the law are
reserved. This provision also applies to the company have full rights of text, pictures,
tables and other content.
This article documents the information and the like is provided only for your
convenience and may be superseded by the updated information, the Company
without notice. Ensure that your application meets with your specifications is your
own responsibility. The company of such information does not make any express or
implied, written or oral, statutory or other representations or warranties, including
without limitation for its use, the applicability of representations or warranties of
quality, performance, merchantability or fitness for a particular purpose.
1
1 Outline
2
Currently, we offer based on VC ++ 6.0, VS2010, VB6.0, VB.net, Delphi6, C #,
Labview (8.6 9.0 2010 2011 2012), Halcon (9,10,11,12), OpenCV (2.4) routines.
For more than VC6 version of the development tools such as VS2003 -
VS2013 and so on, you can turn on VC ++ 6.0 DEMO project DSP or DSW file
directly, then follow the prompts to convert engineering.
3
Plane array camera, the camera side is the use of image sensors, CMOS and
CCD camera has a planar array, plane array camera resolution compared to the width
of a line linear array camera will be much smaller, but the whole picture-frame sensor,
an imaging pixel height will be much larger than the linear array camera. And the
program developed relatively simple, once you can get a whole sub-picture without
stitching each row of data.
Currently, most of the applications, or the use of the line camera-based. Prices,
line scan cameras are expensive, often plane array camera several times to several
times.
4
1.4.4 Sensor size (Target surface)
The optical size refers to the size of the camera's sensor area. Common sizes 1/4
", 1/3" 1 / 2.5 "1 / 2.3" 1/2 ", 2/3," and so on, you need to select the size of the lens, in
order to achieve the effect of the matching .
5
2 Quick Development Guide
We recommend that you follow the following procedures to operate the camera
(some of which step is optional, it has been indicated):
1) the method of loading the SDK dynamic link library MVCAMSDK.DLL.
You can use dynamic or static load in two ways.
header file (located in the installation directory of the SDK / DEMO / VC ++ /
include), and MVCAMSDK.lib library files (located in the installation directory
of the SDK folder), and then when you can reference the SDK interface function
directly in the project, but MVCAMSDK.DLL and your application must be
placed in the same directory system32 directory or the system, placed in another
directory, you must set the system environment variables (PATH).
6
Enumerates devices. Call CameraEnumerateDevice function
enumerates the device, obtain a list of currently connected PC to the
camera on the device, including the list of device names (can modify
their own), version number, a unique serial number, camera model and
other information.
2) initialize the device. Depending on the camera device enumeration
information obtained in the third step, calling CameraInit function initializes
the specified camera, get the camera handle. If you need to open multiple
cameras, the use of multiple camera device name CameraInit multiple calls to
get more cameras handle the follow-up to the operation of the camera, the
camera will need this time to get a handle of the object to specify camera
operation.
3) Let SDK into the image acquisition mode. Camera Play function calls, let the
camera into the working mode, and the SDK starts receiving the image from
the camera.
4) capture images. SDK provides two ways to obtain image data, efficiency of
these two methods are the same, the underlying use of zero-copy mechanisms
to improve efficiency, you can develop your habits to select one of them.
ge data. This function is
used to get an SDK internal address buffer receives the image data, and
header information. At the same time, this function can set the timeout, the
image is not acquired within the specified time (thread is suspended), it
returns a timeout.
capture.
custom resolution (ROI).
continuous output mode, Software means the software trigger mode.
ions, while demonstrating
how scheduled automatic camera.
11
-related control functions,
including mirroring, sharpening, noise reduction and other functions.
color control functions,
including white balance, RGB three-channel digital gain, saturation control lights.
function, SDK supports three look-up table conversion method, which are
generated by adjusting the parameters of the LUT, the LUT using the camera
preset and custom LUT table.
12
2.2.6 ImageFormat&Saving of demo (Gray、RGB24、RGB32 Formatting)
The routine is located in the installation directory Demo / VC ++ / ImageFormat
& Saving folder, SDK demonstrates how to set the output format of image processing
and image files save operation.
Currently, our SDK support 8bit, 24bit, 32bit image formats, to meet the vast
majority of applications; providing RAW format, BMP 8,24 bit depth format, PNG,
JPG image format to save a total of five kinds of image files. RAW format is the
format in which the camera raw output may be 8,10,12 and 16bit raw data; BMP8 bit
depth of the image files you need to configure the output format is 8bit mode SDK;
save BMP24 bit depth, JPG, PNG format needs SDK output format is 24bit mode.
Typical applications: 8-bit grayscale and monochrome output format, will increase
the speed of image processing; color camera output RGB32 format, 4-byte address
aligned to facilitate visual library with assembly instructions for hardware
acceleration.
The DEMO run after the interface is shown below.
13
2.2.7 TriggerAndStrobe of demo (Control trigger signal and the flash)
The routine is located in the installation directory Demo / VC ++ /
TriggerAndStrobe folder that demonstrates how to set up the camera and flash trigger
signal, it is noted that the example of a model does not support external trigger
invalid.
Currently, our camera supports four trigger signals, respectively, rising edge,
falling edge, high level trigger, low level trigger, if you are using a mechanical switch,
it is recommended that the level triggered mode, and set to shake time to filter out the
interference signal mechanical switch transition, if it is an electronic switch, there is
no limit; support for automatic and semi-automatic flash signal in two ways, which is
automatically generated automatic signal waveform when the camera exposure;
semi-automatic mode the flash converter is to control the level of the signal level of
the terminal with the program interface.
Typical applications: flash sync output, camera flash is activated only at the
moment of exposure; pin level programming manual control flash lights output to
control the infrared light switch (lit or normally closed); the use of multiple cameras
simultaneously trigger photographs; use triggers to take pictures at a specified time,
such as when the button is pressed.
Run the routine interface as shown below.
14
2.2.8 UserDataTest of demo (To customize the camera to read and write
data)
The routine is located in the installation directory Demo / VC ++ / UserDataTest
folder, the camera shows how to write custom data and to read and modify the device
name of the camera function.
Modify camera name, it will directly affect the enumerated list of the camera,
after the name changes, while interface to access Directshow, Twain, Halcon,
Labview and other cameras, you name will be modified, cured in the camera,
permanent. The main function is to facilitate the distinction simultaneously when
connected to multiple cameras, modify the name of the camera after each good, do not
worry about the interface on which the camera is connected, even if the replacement
of the host computer will not affect the name of the camera.
Since the definition of reading and writing data, it is in order to facilitate the
development of secondary, program data stored in the camera; or write data to achieve
some special programs and camera bindings.
Typical applications: camera calibration data read and write; read and write data
to achieve specific binding associated software and hardware.
The interface as shown in the program runs as follows:
15
2.2.9 SnapshotOnPreview of demo (Small resolution preview high-speed,
high-resolution camera)
The routine is located in the installation directory Demo / VC ++ /
SnapshotOnPreview folder, play
Shows how the preview in continuous use capture function to fetch a specified
resolution of the image and save it as a BMP file (capture channel captured images in
memory, can be treated additionally displayed, in this case, captured image file and
then be saved).
Resolution capture, preview resolution settings and capture images preview image
acquisition and acquisition, has a separate interface function, independently of each
other; the other parameters, such as image brightness, color, etc., preview and capture
channels share. After setting the resolution to capture images in continuous capture
preview, interior SDK automatically switching operation, after a successful capture,
automatically switch back to preview resolution.
Typical applications: small resolution, high-speed preview, for example BIN or
SKIP preview resolution, frame rate can be increased by four times, smooth video is
good; large capture resolution, obtained full picture, high-precision processing .
The routine operating results in the following figure, the preview resolution can be
set in the "Camera Settings":
16
2.2.10 RawTransTest of test (Offline RAW files into BMP, JPG file)
The demo is located in the installation directory Demo / VC ++ / RawTransTest
folder, play
It shows how to use the SDK to save the good camera RAW photo files, convert BMP
or JPG file.
RAW file conversion, you need to provide a corresponding camera profiles
(camera configuration files in the installation directory Camera / Configs folder, the
file is saved the camera parameter information at runtime). Through different camera
configuration file, the RAW photo files can be different camera accurately reduced to
BMP, JPG files.
Typical applications: single or multi-camera high-speed camera to save RAW files
to the SSD solid state drive, the latter will be converted into RAW BMP, JPG
processing, such as Panorama and other applications.
17
2.2.12 ROI of demo (How to customize Region of interest)
18
As shown above, GPIO routine demonstrates how to operate the camera comes
with the GPIO port. When the input type IO status is changed, it will automatically
update the interface; when operating in IO-output interface, the camera output IO
level will be appropriate to change.
As shown above, SaveFile routine demonstrates how to save the image of the
high-speed operation, through the routine, you can directly preview of each frame
image is saved to disk, used for short-speed, continuous shooting. Use this routine
should be noted that the hard drive performance of the system must be good enough
hard disk write bandwidth must be greater than the output bandwidth of the preview
image. In MV-GE130GM camera, for example, the camera can output 1280X960
images per second (1.2 million pixels, 1.2M) 60 frames increases bandwidth is 60 X
1.2 = 72MB / s, if you choose to save the image as RAW format, the disk write
bandwidth of 72MB bytes will be able to meet the requirements of each frame output
from the camera can be saved, if the image is selected as BMP format, the disk write
bandwidth requires 72MB X 3 = 216 MB / s, all images can be saved . When
bandwidth is less than the required disk write, part of the image file can not be
preserved phenomenon occurs. Also, do not recommend saving at high speed, select a
format other than RAW and BMP images jpg, png format, compression encoding
requires a lot of time, can cause congestion resulting in dropped frames, RAW format
completely without any treatment, it is necessary to convert time is minimal, BMP
format conversion compared to RAW format, slightly more complex, but the
processing time is usually shorter than, without compromising performance. Choose
19
Save RAW format, and then with RawTransTest routine, you can convert the RAW
data offline BMP, jpg or png format.
2.3.1 How to set the exposure time (anti-flicker, no smear, dynamic range
boost)
The camera exposure time is a very important parameter in many applications,
set methods have to pay attention, not according to the application, exposure time
settings are divided into the following areas:
-strobe effect. When the visual system, when a light source is not a
direct way of lighting, when you preview the video, if the camera is rolling shutter
mode, it is possible to see the light and dark stripes; if the camera is a global shutter
mode, it is possible before and after the emergence of two very different image
brightness changes, looks like a flashing feeling. To resolve this problem, you first
need to know the frequency of the light source, in general, the exchange of the
illumination source is 50 Hz or 60 Hz. If the light source is 50 Hertz, you will need
the exposure time is set to an integer multiple of 10 ms (10 ms minimum); if it is 60
Hz source, you need to set the exposure time to an integer multiple of 8.3333
milliseconds. In addition, you can use the automatic exposure mode that we provide,
and the anti-strobe function enabled.
-free pictures. In the water-line visual detection often require dynamic
camera, namely the detection of objects in motion capture is unreasonable if the
exposure time is set, it is possible to cause obvious smear, resulting in blurred images.
To resolve this problem, you need the exposure time is set to a small value, typically
requires less than 2 milliseconds, specifically to see the speed of the movement of
objects, continue to reduce the exposure time to match. Due to reduced exposure time,
the image brightness will drop, need to provide a stronger external fill light, and
because of the rolling shutter mode the camera will produce distortion deformation in
the vertical direction, therefore, the need to use a global shutter mode the camera will
be no smear capture.
-called dynamic range of the image is
included in the "darkest" to "brightest" range. Dynamic range, the more rich layers
can be represented. In the actual imaging, often appear when looking at the clear, dark
dark has been unable to identify; time to see the dark, raising has been exposed, is not
recognized. There are currently two ways to solve this problem, first select the
hardware to enhance the wide dynamic range of the camera; the second is to use
manually set the exposure time, and then with a gamma value and contrast adjustment
to achieve the purpose of this method is the case of software to enhance the dynamic
range , the specific operation method is to first manually set the exposure time, to be
able to see the brightest place, and then, slowly adjust the gamma value to low, high
contrast to slow the adjustment, the process of change of the observed image, until
better results.
20
-exposure algorithm reference area is the
image in the middle 1/2 of the secondary development or can call the relevant
function in the SDK software interface to modify the AE reference area, after
modification, other than when the reference area when the image portion changes,
auto exposure algorithm does not update the camera exposure.
divided into two kinds of manual and automatic mode. Manual white balance,
also known as disposable or one-click white balance refers to the user when the
need for color correction, manually click the button on the software, once white
balance correction, obtain the correction coefficients, without for the next White
at equilibrium, always use the same color correction coefficients; automatic white
balance is analyzed according to the camera images in real time, dynamic
modification of the correction coefficient. In general, industrial applications
mainly manual white balance mainly to ensure that each correction coefficient
imaged exactly the same.
operation has completed the manual white balance, the white area is reduced to
think on your computer's white, that white areas of R, G, B component
completely equal, but that does not mean the current color makes it look very
comfortable, According to the survey, Europeans prefer warm colors of the image
(yellow), while Asians prefer the image of cool colors (bluish), this time, you can
then modify the R, G, B three channel gain manually to improve the image
colors .
the same degree, can be improved by adjusting saturation, like the bright colors,
increase the saturation setpoint; like pale hue, saturation is reduced setpoint.
21
2.3.3 How to improve image clarity
In general, the optical clarity of the image by the pointer of the lens, the focusing,
the decision algorithm software aspects. If the optical pointer below the camera lens
focus or unclear requirements, the choice of how high pixel camera will not help.
size of the camera's optics, for example, 1 / 2.5 "target surface, 2.2 X 2.2 um
pixel size, based on these parameters to select the appropriate lens, put to
achieve the best results, select a specific manner not described here, please
refer to the network of the relevant text file.
software interfaces to improve the clarity of the image. Note: while
improving sharpness, clarity will be significantly increased, but image noise
will also be highlighted.
22
parameter is a binary file is saved on disk, save path is under software installation
directory / Camera / Configs, is .Config file extension.
three different parameter loading method
Access camera parameters can be divided by type, by nickname, by serial
number in three ways, according to the default model is loaded, as shown below:
23
so this parameter loading, the parameters of each camera are separate, independently
of each other.
In practice, you can according to different needs to choose a different way to load,
according to model loading to ensure that all of the same model camera using the
same parameters; press nickname loading, you can have the same parameters of the
same type of camera, also you can specify a single station uses independent
parameters; by ordinal loaded, each camera uses a separate argument.
When the user interface to the software configuration click on the "Restore default
parameters" button, the camera will reset the parameters, the parameter is reset to a
default state to prevent a user without knowing the camera parameters, the modified
parameters appear a variety of "abnormal" situation.
Be restored when the default parameters, the parameters will be restored to factory
condition, but the parameter if you do secondary development, it may be desirable
when a customer clicks on the button, you return to the default parameter settings, not
the factory, here, we also provide a way to modify the default parameters, so that end
customers during the recovery preset parameters (after the first installation of the
camera or the program, the first turn on the camera) can be your set parameters. The
method is simple: use our demo software, after the camera parameter set, saved as a
separate file, the file name is the model name + "- Default.Config", to MV-UB130M
(130 Wan black and white frame memory camera) to example, save it to file
arguments "MV-UB130M-Default.Config", you can simply existing Config file,
renamed "MV-UB130M-Default.Config", then the file in the installation directory /
Camera / Configs directory. Thus, the end-user recovery during the preset parameters
will be restored to the "MV-UB130M-Default.Config" parameters in the file.
24
3 SDK data type definition
tSdkCameraDevInfo
prototype:
typedef struct
{
UINT uVendorID; // Manufacturer ID
UINT uProductID; // product ID
char acVendorName[32]; // Manufacturer Names
char acProductSeries[32]; // Products
char acProductName[32]; //Product name
char acFriendlyName[64]; //Initialize the device a nickname used by
the interface
char acDevFileName[32]; // Driver Name
char acFirmwareVersion[32]; // Version
char acSensorType[32]; // Sensor type
char acPortType[32]; // Interface Type
} tSdkCameraDevInfo;
Description: Camera Equipment Information
tSdkImageResolution
prototype:
typedef struct
{
INT iIndex; // Index number, [0, N] indicates the default
resolution (N is the default maximum number of resolution, generally not more
than 20), OXFF represents a custom resolution (ROI)
char acDescription[32]; // The resolution description. When only the
default resolution of the information is valid. Custom resolution can ignore the
message
UINT uBinSumMode; // BIN (summation) mode, can not exceed
the scope of uBinSumModeMask tSdkResolutionRange
25
UINT uBinAverageMode; // BIN (averaging) mode, can not exceed
the scope of uBinAverageModeMask tSdkResolutionRange
UINT uSkipMode; // SKIP whether the size of 0 disables
SKIP mode, can not exceed the scope of uSkipModeMask tSdkResolutionRange
UINT uResampleMask; // Hardware resampling shield
INT iHOffsetFOV; // Field of view with respect to the
acquisition and the vertical offset of the upper left corner of the maximum field of
view Sensor
INT iVOffsetFOV; // Field of view with respect to the
acquisition field of view Sensor maximum horizontal offset of the upper left
corner
INT iWidthFOV; // The width of the acquisition field of view
INT iHeightFOV; // Acquisition height field of view
INT iWidth; // The width of the final output of the camera
image
INT iHeight; // The final height of the camera images
output
INT iWidthZoomHd; // Hardware scaling width, does not require
the resolution of this action, this variable is set to 0.
INT iHeightZoomHd; // Hardware scaling heights, does not
require the resolution of this action, this variable is set to 0.
INT iWidthZoomSw; // Swscaler width, does not require the
resolution of this action, this variable is set to 0.
INT iHeightZoomSw; // Swscaler height, does not require the
resolution of this action, this variable is set to 0.
} tSdkImageResolution;
Description: The camera's resolution is described
tSdkMediaType
prototype:
typedef struct
{
INT iIndex; // Format Type No
char acDescription[32]; // Description
26
UINT iMediaType; // Corresponding to the image coding
format
} tSdkMediaType;
Description: The camera output image data format
tSdkIspCapacity
prototype:
typedef struct
{
BOOL bMonoSensor; // The model indicates that the camera is a
black and white camera, if the camera is in black and white, the color-related
functions can not be adjusted
BOOL bWbOnce; // The model indicates whether the
camera supports manual white balance function
BOOL bAutoWb; // The model indicates whether the
camera supports auto white balance function
BOOL bAutoExposure; // The model indicates whether the
camera supports auto-exposure function
BOOL bManualExposure; // The model indicates whether the
camera supports manual exposure
BOOL bAntiFlick; // The model indicates that the camera is
supported by anti-strobe function
BOOL bDeviceIsp; // The model indicates the camera support
function hardware ISP
BOOL bForceUseDeviceIsp;// bDeviceIsp and bForceUseDeviceIsp
TRUE simultaneously, it indicates mandatory only hardware ISP, can not be
canceled.
BOOL bZoomHD; // Is the camera hardware support for
image scaling output (only shrink).
} tSdkIspCapacity;
Description: Enable the information ISP module.
、
tSdkCameraCapbility
prototype:
27
typedef struct
{
tSdkTrigger *pTriggerDesc; // Trigger Mode
INT iTriggerDesc; // The number of trigger
mode, the size of the array Trigger Desc
tSdkImageResolution *pImageSizeDesc;// Select the default resolution
INT iImageSizeDesc; // The number of default
resolution, the size of the array pImageSizeDesc
tSdkColorTemperatureDes *pClrTempDesc;// The default color
temperature mode for white balance
INT iClrTempDesc;
28
BOOL bParamInDevice; // It indicates that the
device supports read and write from the device parameter set. 1 support 0 not
supported.
tSdkAeAlgorithm *pAeAlmSwDesc; // AE software algorithm
description
int iAeAlmSwDesc; // The number of software
AE algorithm
29
tGammaRange sGammaRange; // Gamma Range
Description
tContrastRange sContrastRange; // Contrast Range
Description
tSharpnessRange sSharpnessRange; // Sharpen Range
Description
tSdkIspCapacity sIspCapacity; // ISP capability description
} tSdkCameraCapbility;
Description: Device Description information defined integration, this information
can be used to dynamically build UI.
tSdkFrameHead
prototype:
typedef struct
{
UINT uiMediaType; //Image Format
UINT uBytes; // Total bytes
UINT iHeight; // Image width
UINT iWidth; // Image height
BOOL bIsTrigger; // is trigger
UINT uiTimeStamp; // The frame acquisition time, 0.1 ms units
UINT uiExpTime; // Current exposure value of the image, in
microseconds us
float fAnalogGain; // Multiple analog gain of the current image
INT iGamma; // The frame image gamma setting value
is valid only when the LUT mode dynamic parameters generated at rest mode -1
INT iContrast; // Set the contrast value of the image frame,
and only when the LUT mode dynamic parameter to generate valid, at rest mode
-1
INT iSaturation; // Saturation setpoint of the frame image for
the black and white camera meaningless as 0
float fRgain; // Red digital gain multiples of the frame
image processing, for black and white camera meaningless, 1 float fGgain;
// Green gain multiple digital image processing of the frame, for black and white
30
camera meaningless, 1 float fBgain; // Blue digital gain
multiples of the frame image processing, for black and white camera meaningless,
1
}tSdkFrameHead;
Note: the image header information
tSdkFrame
prototype:
typedef struct sCameraFrame
{
tSdkFrameHead head; // Header
BYTE * pBuffer; // Data Area
}tSdkFrame;
Description: description of image frames
emSdkLutMode
prototype:
typedef enum
{
LUTMODE_PARAM_GEN=0, // Dynamically generated LUT table
by adjusting parameters
LUTMODE_PRESET, // Use default LUT table
LUTMODE_USER_DEF, // User-defined LUT table
}emSdkLutMode;
Description: Transform the way the image look-up table
emSdkParamTarget
prototype:
typedef enum
31
{
PARAM_ON_PC = 0, // Save to your PC
PARAM_ON_DEVICE = 1, // Stored in the camera
}emSdkParamTarget;
Explanation: The camera parameters stored objects
emSdkRunMode
prototype:
typedef enum
{
RUNMODE_PLAY=0, // Normal preview, the captured image is
displayed。
RUNMODE_PAUSE, // pause
RUNMODE_STOP, // The camera stops working。
}emSdkRunMode;
Description: Control the camera's video stream
emSdkDisplayMode
prototype:
typedef enum
{
DISPLAYMODE_SCALE=0, // Zoom display mode
DISPLAYMODE_REAL //1:1 Display Mode
}emSdkDisplayMode;
Explanation: An internal SDK interface display mode
emSdkRecordMode
Prototype:
typedef enum
{
RECORD_STOP = 0, // Stop
RECORD_START, // Recording
RECORD_PAUSE, // Pause
}emSdkRecordMode;
32
Description: Recording status
emSdkMirrorDirection
Prototype:
typedef enum
{
MIRROR_DIRECTION_HORIZONTAL = 0, // Mirror horizontally
MIRROR_DIRECTION_VERTICAL , // Vertical Mirror
}emSdkMirrorDirection;
Description: Mirror image operation
emSdkFrameSpeed
Prototype:
typedef enum
{
FRAME_SPEED_LOW = 0, // Slow Mode
FRAME_SPEED_NORMAL, // Normal mode
FRAME_SPEED_HIGH, // High-speed mode
FRAME_SPEED_SUPER, // Ultra-high-speed mode
}emSdkFrameSpeed;
Note: The camera video frame rate
emSdkFileType
Prototype:
typedef enum
{
FILE_JPG = 1, //JPG
FILE_BMP = 2, //BMP
FILE_RAW = 4, //RAW:Bayer camera output file format
FILE_PNG = 8 //PNG
}emSdkFileType;
Description: Save the file format type
emSdkLightFrequency
33
prototype:
typedef enum
{
LIGHT_FREQUENCY_50HZ = 0, //50HZ
LIGHT_FREQUENCY_60HZ , //60HZ
}emSdkLightFrequency;
Description: Anti-strobe flash's automatic exposure
emSdkParameterMode
Prototype:
typedef enum
{
PARAM_MODE_BY_MODEL = 0, // Loading parameters from the profile
according to the camera model name, such as MV-U300
PARAM_MODE_BY_NAME, // The apparatus nickname
(tSdkCameraDevInfo.acFriendlyName) Loading parameters from the profile,
such as MV-U300, the nickname can be customized
PARAM_MODE_BY_SN, // Loading device according to a unique
serial number from the profile parameters, serial number at the factory has been
written to the device, each camera has a different serial number.
PARAM_MODE_IN_DEVICE // Loading parameters from the
solid-state memory devices. Not all models support reading and writing from the
camera parameter set is determined by tSdkCameraCapbility.bParamInDevice
}emSdkParameterMode;
Description: PARAM_MODE_BY_MODEL: all the same type of camera
parameters file sharing ABCD four groups. modify
A camera parameter file, it will affect the whole of the same model
Loading camera parameters.
34
To let the load parameters specified file.
You can use according to their environment, the flexibility to use more than a few
ways to load parameters. For example,
MV-U300, for example, you want more than one of the model of camera
parameters in group 4 are shared on your computer, then
Use PARAM_MODE_BY_MODEL way; if you want a table or where a few
MV-U300 can
Use your own parameter file and the rest of the MV-U300 again using the same
parameters file, then use
PARAM_MODE_BY_NAME way; if you want each MV-U300 uses a different
parameter file, then
Use PARAM_MODE_BY_SN way.
Parameter file exists installation directory under \ Camera \ Configs directory in
config file name suffix.
emSdkParameterTeam
prototype:
typedef enum
{
PARAMETER_TEAM_DEFAULT = 0xff,
PARAMETER_TEAM_A = 0,
PARAMETER_TEAM_B = 1,
PARAMETER_TEAM_C = 2,
PARAMETER_TEAM_D = 3
}emSdkParameterTeam;
Explanation: The configuration parameters of the camera, is divided into A, B, C,
D 4 group to be saved.
35
emSdkPropSheetMsg
prototype:
typedef enum
{
SHEET_MSG_LOAD_PARAM_DEFAULT = 0, // After the
parameters are reset to the default, triggering the message
SHEET_MSG_LOAD_PARAM_GROUP, // Loads the
specified parameter set, triggering the message
SHEET_MSG_LOAD_PARAM_FROMFILE, // After loading
parameters from the specified file, the message is triggered
SHEET_MSG_SAVE_PARAM_GROUP // The current
parameter set is saved, the message is triggered
}emSdkPropSheetMsg;
Description: Type SDK callback messages generated by the camera's
configuration page
tSdkWhiteBalanceDes
prototype:
typedef struct
{
INT iIndex; // Mode index number
char acDescription[32]; // Description
} tSdkWhiteBalanceDes;
Description: The camera white balance mode description
tSdkFrameSpeed
prototype:
typedef struct
{
INT iIndex; // Frame rate index number
char acDescription[32]; // Description information
} tSdkFrameSpeed;
Description: The Description information the camera frame rate
36
tSdkExpose
prototype:
typedef struct
{
UINT uiTargetMin; // AE target minimum brightness
UINT uiTargetMax; // AE target maximum brightness
UINT uiAnalogGainMin; // Minimum analog gain,
UINT uiAnalogGainMax; // The maximum analog gain
float fAnalogGainStep; // Analog gain steps.
UINT uiExposeTimeMin; // In manual mode, the minimum number
of line exposure
UINT uiExposeTimeMax; // In manual mode, the maximum number of
rows impressions
} tSdkExpose;
Note: The camera exposure function scope definition
tSdkTrigger
Prototype:
typedef struct
{
INT iIndex; // Mode index number
char acDescription[32]; // This mode of Description information}
tSdkTrigger;
Explanation: The trigger mode Description
tSdkPackLength
Prototype:
typedef struct
{
INT iIndex; // Subcontracting size of the index
number
char acDescription[32]; // Subcontracting size of the index
number
} tSdkPackLength;
说明:传输分包大小描述
37
tSdkHardwareIO
Prototype:
typedef struct
{
INT iIndex; // IO number
BOOL bOutPut; // IO properties, input or output
} tSdkHardwareIO;
Description: The camera programming IO description
tSdkPresetLut
Prototype:
typedef struct
{
INT iIndex; // Numbering
char acDescription[32]; // Description information
} tSdkPresetLut;
Explanation: The table describes the default LUT
tSdkFrameStatistic
Prototyp:
typedef struct
{
INT iTotal; // The current total number of frames acquired
(including error frames)
INT iCapture; // The number of valid frames of the current
collection
INT iLost; // The current number of dropped frames
} tSdkFrameStatistic;
Description: Frame rate statistics
tGammaRange
Prototyp:
38
typedef struct
{
INT iMin; // Min
INT iMax; // Max
} tGammaRange;
Description: The gamma setting range
tContrastRange
Prototype:
typedef struct
{
INT iMin; // Min
INT iMax; // Max
} tContrastRange;
Description: The contrast setting range
tRgbGainRange
Prototyp:
typedef struct
{
INT iRGainMin; // The minimum red gain
INT iRGainMax; // Red maximum gain
INT iGGainMin; // Minimum gain Green
INT iGGainMax; // Green gain maximum
INT iBGainMin; // Blue minimum gain
INT iBGainMax; // Blue Max gain
} tRgbGainRange;
Description: RGB three-channel digital gain setting range
tSaturationRange
Prototyp:
typedef struct
{
INT iMin; // Min
39
INT iMax; // Max
} tSaturationRange;
Description: The saturation limits set
tSdkResolutionRange
Prototyp:
typedef struct
{
INT iHeightMax; // The maximum height of the image
INT iHeightMin; // The minimum height of the image
INT iWidthMax; // The maximum width of the image
INT iWidthMin; // The minimum width of the image
UINT uSkipModeMask; // SKIP mode shield, is 0, that does not
support SKIP. bit0 1, expressed support for the SKIP 2x2; bit1 1, expressed
support for the SKIP 3x3 ....
UINT uBinSumModeMask; // BIN (Sum) mode shield is 0, that is not
supported by BIN. bit0 1, expressed support for BIN 2x2; bit1 1, expressed
support for BIN 3x3 ....
UINT uBinAverageModeMask; // BIN (averaging) mode shield is 0, that is
not supported by BIN. bit0 1, expressed support for BIN 2x2; bit1 1, expressed
support for BIN 3x3 ....
UINT uResampleMask; // Hardware resampling shield}
tSdkResolutionRange;
Description: The camera's resolution setting range
emSdkRefWinType
Prototyp:
typedef enum
{
REF_WIN_AUTO_EXPOSURE = 0,
REF_WIN_WHITE_BALANCE,
}emSdkRefWinType;
Description: Visual Reference window type
40
tSharpnessRange
Prototyp:
typedef struct
{
INT iMin; // Min
INT iMax; //Max
} tSharpnessRange;
#define CAMERA_MEDIA_TYPE_MONO2P
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY2BIT | 0x0038)
#define CAMERA_MEDIA_TYPE_MONO4P
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY4BIT | 0x0039)
#define CAMERA_MEDIA_TYPE_MONO8
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0001)
42
#define CAMERA_MEDIA_TYPE_MONO8S
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0002)
#define CAMERA_MEDIA_TYPE_MONO10
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0003)
#define CAMERA_MEDIA_TYPE_MONO10_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0004)
#define CAMERA_MEDIA_TYPE_MONO12
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0005)
#define CAMERA_MEDIA_TYPE_MONO12_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0006)
#define CAMERA_MEDIA_TYPE_MONO14
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0025)
#define CAMERA_MEDIA_TYPE_MONO16
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0007)
Description: Image Format Definition
43
#define CAMERA_MEDIA_TYPE_BAYRG8
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0009)
#define CAMERA_MEDIA_TYPE_BAYGB8
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x000A)
#define CAMERA_MEDIA_TYPE_BAYBG8
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x000B)
#define CAMERA_MEDIA_TYPE_BAYGR10_MIPI
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0026)
#define CAMERA_MEDIA_TYPE_BAYRG10_MIPI
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0027)
#define CAMERA_MEDIA_TYPE_BAYGB10_MIPI
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0028)
#define CAMERA_MEDIA_TYPE_BAYBG10_MIPI
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0029)
#define CAMERA_MEDIA_TYPE_BAYGR10
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000C)
44
#define CAMERA_MEDIA_TYPE_BAYRG10
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000D)
#define CAMERA_MEDIA_TYPE_BAYGB10
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000E)
#define CAMERA_MEDIA_TYPE_BAYBG10
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000F)
#define CAMERA_MEDIA_TYPE_BAYGR12
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0010)
#define CAMERA_MEDIA_TYPE_BAYRG12
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0011)
#define CAMERA_MEDIA_TYPE_BAYGB12
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0012)
#define CAMERA_MEDIA_TYPE_BAYBG12
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0013)
#define CAMERA_MEDIA_TYPE_BAYGR10_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0026)
45
#define CAMERA_MEDIA_TYPE_BAYRG10_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0027)
#define CAMERA_MEDIA_TYPE_BAYGB10_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0028)
#define CAMERA_MEDIA_TYPE_BAYBG10_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0029)
#define CAMERA_MEDIA_TYPE_BAYGR12_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002A)
#define CAMERA_MEDIA_TYPE_BAYRG12_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002B)
#define CAMERA_MEDIA_TYPE_BAYGB12_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002C)
#define CAMERA_MEDIA_TYPE_BAYBG12_PACKED
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002D)
#define CAMERA_MEDIA_TYPE_BAYGR16
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x002E)
46
#define CAMERA_MEDIA_TYPE_BAYRG16
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x002F)
#define CAMERA_MEDIA_TYPE_BAYGB16
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0030)
#define CAMERA_MEDIA_TYPE_BAYBG16
(CAMERA_MEDIA_TYPE_MONO |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0031)
Description: Bayer format code definitions
#define CAMERA_MEDIA_TYPE_BGR8
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0015)
#define CAMERA_MEDIA_TYPE_RGBA8
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x0016)
#define CAMERA_MEDIA_TYPE_BGRA8
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x0017)
#define CAMERA_MEDIA_TYPE_RGB10
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0018)
47
#define CAMERA_MEDIA_TYPE_BGR10
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0019)
#define CAMERA_MEDIA_TYPE_RGB12
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x001A)
#define CAMERA_MEDIA_TYPE_BGR12
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x001B)
#define CAMERA_MEDIA_TYPE_RGB16
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0033)
#define CAMERA_MEDIA_TYPE_RGB10V1_PACKED
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x001C)
#define CAMERA_MEDIA_TYPE_RGB10P32
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x001D)
#define CAMERA_MEDIA_TYPE_RGB12V1_PACKED
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY36BIT | 0X0034)
#define CAMERA_MEDIA_TYPE_RGB565P
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0035)
48
#define CAMERA_MEDIA_TYPE_BGR565P
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0X0036)
Description: RGB format code definitions
#define CAMERA_MEDIA_TYPE_YUV422_8_UYVY
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x001F)
#define CAMERA_MEDIA_TYPE_YUV422_8
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0032)
#define CAMERA_MEDIA_TYPE_YUV8_UYV
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0020)
#define CAMERA_MEDIA_TYPE_YCBCR8_CBYCR
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x003A)
#define CAMERA_MEDIA_TYPE_YCBCR422_8
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x003B)
#define CAMERA_MEDIA_TYPE_YCBCR422_8_CBYCRY
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0043)
49
#define CAMERA_MEDIA_TYPE_YCBCR411_8_CBYYCRYY
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x003C)
#define CAMERA_MEDIA_TYPE_YCBCR601_8_CBYCR
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x003D)
#define CAMERA_MEDIA_TYPE_YCBCR601_422_8
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x003E)
#define CAMERA_MEDIA_TYPE_YCBCR601_422_8_CBYCRY
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0044)
#define CAMERA_MEDIA_TYPE_YCBCR601_411_8_CBYYCRYY
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x003F)
#define CAMERA_MEDIA_TYPE_YCBCR709_8_CBYCR
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0040)
#define CAMERA_MEDIA_TYPE_YCBCR709_422_8
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0041)
#define CAMERA_MEDIA_TYPE_YCBCR709_422_8_CBYCRY
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0045)
50
#define CAMERA_MEDIA_TYPE_YCBCR709_411_8_CBYYCRYY
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0042)
Description: YUV format code definitions.
#define CAMERA_MEDIA_TYPE_RGB10_PLANAR
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0022)
#define CAMERA_MEDIA_TYPE_RGB12_PLANAR
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0023)
#define CAMERA_MEDIA_TYPE_RGB16_PLANAR
(CAMERA_MEDIA_TYPE_COLOR |
CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0024)
Description: RGB planar format code definitions.
#define CAMERA_STATUS_SUCCESS 0
// Successful operation
#define CAMERA_STATUS_FAILED -1
// Operation failed
#define CAMERA_STATUS_INTERNAL_ERROR -2
// Internal error
#define CAMERA_STATUS_UNKNOW -3
51
// Unknown mistake
#define CAMERA_STATUS_NOT_SUPPORTED -4
// This feature is not supported
#define CAMERA_STATUS_NOT_INITIALIZED -5
// Initialization is not completed
#define CAMERA_STATUS_PARAMETER_INVALID -6
// Invalid argument
#define CAMERA_STATUS_PARAMETER_OUT_OF_BOUND -7
// Parameter out of range
#define CAMERA_STATUS_UNENABLED -8
// Not enabled
#define CAMERA_STATUS_USER_CANCEL -9
// User manually canceled, such as roi panel click Cancel to return
#define CAMERA_STATUS_PATH_NOT_FOUND -10
// The registry is not found in the corresponding path
#define CAMERA_STATUS_SIZE_DISMATCH -11
// Obtain image data length and defined size mismatch
#define CAMERA_STATUS_TIME_OUT -12
// Time-out error
#define CAMERA_STATUS_IO_ERROR -13
// Hardware IO error
#define CAMERA_STATUS_COMM_ERROR -14
// Communication error
#define CAMERA_STATUS_BUS_ERROR -15
// Bus Error
#define CAMERA_STATUS_NO_DEVICE_FOUND -16
// Total found no equipment
#define CAMERA_STATUS_NO_LOGIC_DEVICE_FOUND -17
// Logic devices found
#define CAMERA_STATUS_DEVICE_IS_OPENED -18
// The device has been opened
#define CAMERA_STATUS_DEVICE_IS_CLOSED -19
// Equipment has been closed
#define CAMERA_STATUS_DEVICE_VEDIO_CLOSED -20
52
// Without opening the device video, call recording related function, if the video
camera is not open, then return back to the error.
#define CAMERA_STATUS_NO_MEMORY -21
// There is not enough system memory
#define CAMERA_STATUS_FILE_CREATE_FAILED -22
// Create a file failed
#define CAMERA_STATUS_FILE_INVALID -23
// Invalid file format
#define CAMERA_STATUS_WRITE_PROTECTED -24
// Write protection, can not be written
#define CAMERA_STATUS_GRAB_FAILED -25
// Data acquisition failure
#define CAMERA_STATUS_LOST_DATA -26
// Data is lost, incomplete
#define CAMERA_STATUS_EOF_ERROR -27
// No frame is received terminator
#define CAMERA_STATUS_BUSY -28
// Busy (the previous operation is still in progress), the operation can not be
performed
#define CAMERA_STATUS_WAIT -29
// Wait (operating condition is not satisfied), you can try again
#define CAMERA_STATUS_IN_PROCESS -30
// Progress has been operated
#define CAMERA_STATUS_IIC_ERROR -31
// IIC transmission errors
#define CAMERA_STATUS_SPI_ERROR -32
// SPI transmission errors
#define CAMERA_STATUS_USB_CONTROL_ERROR -33
// USB control transmission errors
#define CAMERA_STATUS_USB_BULK_ERROR -34
// USB BULK transfer error
#define CAMERA_STATUS_SOCKET_INIT_ERROR -35
// Network transmission kit failed to initialize
#define CAMERA_STATUS_GIGE_FILTER_INIT_ERROR -36
53
// Network Camera kernel filter driver initialization fails, check whether the
correct driver installed or reinstalled.
#define CAMERA_STATUS_NET_SEND_ERROR -37
// Network data transmission error
#define CAMERA_STATUS_DEVICE_LOST -38
// Lost connection with the network camera, the heartbeat detection timeout.
#define CAMERA_STATUS_DATA_RECV_LESS -39
// The number of bytes received less than requested.
#define CAMERA_STATUS_FUNCTION_LOAD_FAILED -40
// Loading from a file fails
#define CAMERA_STATUS_CRITICAL_FILE_LOST -41
// Necessary to run the program file is missing.
#define CAMERA_STATUS_SENSOR_ID_DISMATCH -42
// Firmware, and it does not match, because downloaded the wrong firmware.
#define CAMERA_STATUS_OUT_OF_RANGE -43
// Parameter is out of range.
#define CAMERA_STATUS_REGISTRY_ERROR -44
// Setup Registration error. Please install the application or run the installation
directory
Setup/Installer.exe
#define CAMERA_STATUS_ACCESS_DENY -45
// No Access. When you specify the camera is already in use by another program,
and then apply for access to the camera, it will return to the state. (A camera can
not be multiple programs simultaneously access)
#define CAMERA_STATUS_CAMERA_NEED_RESET -46
// Indicates that the camera needs to reset to normal use, then let the camera
power restart or reboot the operating system, it can be used normally.
#define CAMERA_STATUS_ISP_MOUDLE_NOT_INITIALIZED -47
// ISP module is not initialized
#define CAMERA_STATUS_ISP_DATA_CRC_ERROR -48
// Data validation errors
#define CAMERA_STATUS_MV_TEST_FAILED -49
// Data test failed
#define CAMERA_AIA_PACKET_RESEND 0x0100
54
// The frame needs to be retransmitted
55
#define CAMERA_AIA_PACKET_NOT_YET_AVAILABLE 0x8010
// Subcontracting image data is not ready, multi-shot mode for application access
timeout
#define
CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY
0x8011
// You need access to subcontracting does not exist. Used for the retransmission
data not already in the buffer
56
4 SDK interface function description (C / C ++ VB
Delphi C # General)
4.1 This section describes the SDK prototype and description of each interface
functions for C / C ++, VB, Delphi, this manual can be used directly in the
name of the function call, C # is used in packaged adapter class
MVSDK.MvApi call. For example, MVSDK.MvApi.CameraSdkInit (1) is
initialized, call the function of the other interface, only you need to add a prefix
to MVSDK.MvApi.
4.2 CameraSdkInit
Prototype:
MVSDK_API CameraSdkStatus
CameraSdkInit
(
int iLanguageSel
);
Example:
/* Initialize the SDK for the Chinese Interface*/
CameraSdkInit(1);
57
4.3 CameraInit
Prototype:
MVSDK_API CameraSdkStatus
CameraInit
(
tSdkCameraDevInfo* pCameraInfo,
int emParamLoadMode,
int emTeam,
CameraHandle* pCameraHandle
);
Example:
/* Initialize the camera, load parameter set last exit */
tSdkCameraDevInfo sCameraList[10];
58
INT iCameraNums = 10;
INT status;
if (CameraEnumerateDevice(sCameraList,&iCameraNums) ==
CAMERA_STATUS_SUCCESS && iCameraNums > 0)
{
status = CameraInit(&sCameraList[0],-1,-1,&m_hCamera);
if (status == CAMERA_STATUS_SUCCESS)
{
// Camera successful initialization
}
}
4.4 CameraInitEx
Prototype:
MVSDK_API CameraSdkStatus
CameraInitEx
(
int iDeviceIndex,
int iParamLoadMode,
int emTeam,
CameraHandle* pCameraHandle
);
Example:
/* Initialize the camera, load parameter set last exit*/
tSdkCameraDevInfo sCameraList[10];
INT iCameraNums = 10;
INT status;
if ((iCameraNums =
CameraEnumerateDeviceEx(sCameraList,&iCameraNums) )> 0)
{
status = CameraInitEx(0,-1,-1,&m_hCamera);
if (status == CAMERA_STATUS_SUCCESS)
{
// Camera successful initialization
}
}
4.5 CameraInitEx2
Prototype:
60
MVSDK_API CameraSdkStatus
CameraInitEx2
(
char* CameraName,
CameraHandle* pCameraHandle
);
Example:
/* Initialization named Camera1 camera requires prior use our software to
initialize the camera name to Camera1 success*/
tSdkCameraDevInfo sCameraList[10];
INT iCameraNums = 10;
INT status;
if ((iCameraNums =
CameraEnumerateDeviceEx(sCameraList,&iCameraNums) )> 0)
{
status = CameraInitEx2("Camera1",-1,-1,&m_hCamera);
if (status == CAMERA_STATUS_SUCCESS)
{
61
// Camera successful initialization
}
}
4.6 CameraDisplayInit
Prototype:
MVSDK_API CameraSdkStatus
CameraDisplayInit
(
CameraHandle hCamera,
HWND hWndDisplay
);
Example:
/* Initialize the display interface, display interface encapsulated using the SDK */
CameraDisplayInit(m_hCamera,m_cPreview.GetSafeHwnd())
4.7 CameraSetDisplayMode
Prototype:
MVSDK_API CameraSdkStatus
62
CameraSetDisplayMode
(
CameraHandle hCamera,
int mode
);
4.8 CameraSetDisplayOffset
Prototype:
MVSDK_API CameraSdkStatus
CameraSetDisplayOffset
(
CameraHandle hCamera,
int iOffsetX,
int iOffsetY
);
63
iOffsetX: Offset of X coordinate.
iOffsetY: offset Y coordinates.
Return value: on success, returns CAMERA_STATUS_SUCCESS (0); otherwise
it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Note: when DISPLAYMODE_REAL valid only when the display mode. Such as
the display size of the control is 320X240, and the size of the image is
640X480, then when iOffsetX = 160, iOffsetY = 120 is displayed when
the area is the center of the image 320X240 position. You have been
called CameraDisplayInit initialized before calling this function.
Example:
4.9 CameraSetCallbackFunction
Prototype:
MVSDK_API CameraSdkStatus
CameraSetCallbackFunction
(
CameraHandle hCamera,
CAMERA_SNAP_PROC pCallbackFunction,
PVOID pContext,
CAMERA_SNAP_PROC *pCallbackOld
);
note:
Example:
/* */
CameraSetCallbackFunction(m_hCamera,GrabImageCallback,(PVOID)this,NUL
L)
4.10 CameraUnInit
Prototype:
MVSDK_API CameraSdkStatus
CameraUnInit
(
CameraHandle hCamera
);
Example:
/* Anti-initialize the camera */
CameraUnInit(m_hCamera)
65
4.11 CameraPlay
Prototype:
MVSDK_API CameraSdkStatus
CameraPlay
(
CameraHandle hCamera
);
Function: Let the SDK in work mode, begin to receive images from the camera to
send.
Parameter Description: hCamera: camera handle, obtained by the CameraInit
function.
Return value: on success, returns CAMERA_STATUS_SUCCESS (0); otherwise
it returns a non-zero value of the error codes, refer to the error code
definitions CameraStatus.h.
Note: If the current mode of the camera is triggered, you need a trigger
frame is received later will be updated image.
Example:
/* The camera began collecting images */
Cameraplay(m_hCamera);
4.12 CameraPause
Prototype:
MVSDK_API CameraSdkStatus
CameraPause
(
CameraHandle hCamera
);
66
Function: Let SDK into suspend mode, does not receive image data from the
camera, but the camera will send a command to make the output
pause, release of transmission bandwidth.
Parameter Description: hCamera: camera handle, obtained by the CameraInit
function.
Return value: on success, returns CAMERA_STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
error code definitions CameraStatus.h.
Note: Pause mode, you can configure the parameters of the camera, with
immediate effect.
Example:
/* The camera began collecting images */
CameraPause (m_hCamera);
4.13 CameraStop
Prototype:
MVSDK_API CameraSdkStatus
CameraStop
(
CameraHandle hCamera
);
Example:
67
/* The camera began collecting images */
CameraStop (m_hCamera);
4.14 CameraCreateSettingPage
Prototype:
MVSDK_API CameraSdkStatus
CameraCreateSettingPage
(
CameraHandle hCamera,
HWND hParent,
Char *pWinText,
CAMERA_PAGE_MSG_PROC pCallbackFunc,
PVOID pCallbackCtx,
UINT uReserved
);
68
pCallbackFunc, as one of the parameters passed. You
can use this parameter to do some flexible judgment.
uReserved:Set aside. It must be set to 0.
Return value: on success, returns CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to
the definition CameraStatus.h error codes.
Note: this function is called, the internal SDK will help you create a good
camera configuration window, eliminating the need for you to
re-develop the interface of camera time. It is strongly
recommended that you use this function to let the SDK created
the configuration window for you.
Example:
4.15 CameraCustomizeResolution
Prototype:
MVSDK_API CameraSdkStatus
CameraCustomizeResolution
(
CameraHandle hCamera,
tSdkImageResolution *pImageCustom
);
69
Return value: on success, returns CAMERA_STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to
the definition CameraStatus.h error codes.
Example:
/* User-defined resolution */
CameraCustomizeResolution(m_hCamera,&sImageSize)
4.16 CameraShowSettingPage
Prototype:
MVSDK_API CameraSdkStatus
CameraShowSettingPage
(
CameraHandle hCamera,
BOOL bShow
);
Example:
70
4.17 CameraSetActiveSettingSubPage
Prototype:
MVSDK_API CameraSdkStatus
CameraSetActiveSettingSubPage
(
CameraHandle hCamera,
INT index
);
Example:
4.18 CameraGetInformation
Prototype:
MVSDK_API CameraSdkStatus
CameraGetInformation
(
CameraHandle hCamera,
char **pbuffer
);
71
Function Description:Get the description of the camera
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
**pbuffer:Pointing the camera Description information pointer to a
pointer.
return value: When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.19 CameraImageProcess
Prototype:
MVSDK_API CameraSdkStatus
CameraImageProcess
(
CameraHandle hCamera,
BYTE *pbyIn,
BYTE *pbyOut,
tSdkFrameHead *pFrInfo
);
72
*pbyOut:After processing the image output buffer address, and can
not be NULL.
*pFrInfo:After the header information of the input image processing
is complete, the header information in the image format
uiMediaType will change.
return value: When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
/* */
CameraImageProcess(m_hCamera, pbyBuffer,m_pbImgBuffer,&tFrameHead);
4.20 CameraImageProcessEx
Prototype:
MVSDK_API CameraSdkStatus
CameraImageProcessEx
(
CameraHandle hCamera,
BYTE* pbyIn,
BYTE* pbyOut,
tSdkFrameHead* pFrInfo,
UINT uOutFormat,
UINT uReserved
);
73
pbyOut The input image data buffer address and can not be NULL.
pFrInfo After entering header information of the image processing is
complete, the header information
uOutFormat After processing the image output format, which can be
CAMERA_MEDIA_TYPE_MONO8 、 CAMERA_MEDIA_TYPE_RGB 、
CAMERA_MEDIA_TYPE_BGR 、 CAMERA_MEDIA_TYPE_RGBA8
CAMERA_MEDIA_TYPE_RGBA8 one of them.
pbyIn Corresponding buffer size must match the specified format and
OutFormat phase.
uReserved Reserved parameter must be set to 0
4.21 CameraDisplayRGB24
Prototype:
MVSDK_API CameraSdkStatus
CameraDisplayRGB24
(
CameraHandle hCamera,
BYTE *pbyRGB24,
tSdkFrameHead *pFrInfo
);
74
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note: You must initialize CameraDisplayInit been called before calling this
function.
Example:
/* Calling the display function displays the image */
CameraDisplayRGB24(pThis->m_hCamera, pThis->m_pFrameBuffer,
pFrameHead);
4.22 CameraSetDisplaySize
Prototype:
MVSDK_API CameraSdkStatus
CameraSetDisplaySize
(
CameraHandle hCamera,
INT iWidth,
INT iHeight
);
Example:
75
/* */
CameraSetDisplaySize(m_hCamera,rect.right - rect.left,rect.bottom - rect.top)
4.23 CameraGetImageBuffer
Prototype:
MVSDK_API CameraSdkStatus
CameraGetImageBuffer
(
CameraHandle hCamera,
tSdkFrameHead* pFrameInfo,
BYTE** pbyBuffer,
UINT wTimes
);
76
Example:
/* */
CameraGetImageBuffer(pThis->m_hCamera,&sFrameInfo,&pbyBuffer,1000);
4.24 CameraGetImageBufferEx
Prototype:
MVSDK_API CameraSdkStatus
CameraGetImageBufferEx
(
CameraHandle hCamera,
INT* piWidth,
INT* piHeight,
UINT wTimes
);
Function: get an image data. Image data is different from the Camera Get Image
Buffer function, which obtained the RGB format. Subsequent need to call Camera
Image Process function and function Camera Release ImageBuffer.
Parameter Description:
hCamera Camera handle, obtained by the CameraInit function.
piWidth Int pointers, return width of the image.
piHeight Int pointers, returning the image height Times: capture images
timeout. Milliseconds.
wTimes Not yet been obtained within the image, the function returns a
timeout message.
return value: When successful, the image data buffer returns the first address
fails, the return NULL or 0.
4.25 CameraReleaseImageBuffer
Prototype:
MVSDK_API CameraSdkStatus
77
CameraReleaseImageBuffer
(
CameraHandle hCamera,
BYTE *pbyBuffer
);
Example:
/* */
CameraReleaseImageBuffer(pThis->m_hCamera,pbyBuffer);
4.26 CameraGetFrameStatistic
Prototype:
MVSDK_API CameraSdkStatus
CameraGetFrameStatistic
(
CameraHandle hCamera,
tSdkFrameStatistic *psFrameStatistic
);
78
*psFrameStatistic:Pointer to return statistics.
return value: When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.27 CameraSetNoiseFilter
Prototype:
MVSDK_API CameraSdkStatus
CameraSetNoiseFilter
(
CameraHandle hCamera,
BOOL bEnable
);
Example:
4.28 CameraGetNoiseFilterState
Prototype:
79
MVSDK_API CameraSdkStatus
CameraGetNoiseFilterState
(
CameraHandle hCamera,
BOOL *pEnable
);
Example:
4.29 CameraInitRecord
Prototype:
MVSDK_API CameraSdkStatus
CameraInitRecord
(
CameraHandle hCamera,
int iFormat,
char *pcSavePath,
BOOL b2GLimit,
DWORD dwQuality,
int iFrameRate
);
80
Function Description:Initiate a video.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
iFormat:Video format, currently supports only compression and
MSCV two ways. 0: no compression; 1: MSCV
compresses.
*pcSavePath:Video file path.
b2GLimit:If the automatic segmentation is TRUE, files larger than
2G.
dwQuality:Video quality factor, the bigger, the better the quality.
Range 1-100.
iFrameRate:Video frame rate. Recommended settings than the
actual frame rate capture large, so it will not leak
frames.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.30 CameraStopRecord
Prototype.:
MVSDK_API CameraSdkStatus
CameraStopRecord
(
CameraHandle hCamera
);
81
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.31 CameraPushFrame
Prototype:
MVSDK_API CameraSdkStatus
CameraPushFrame
(
CameraHandle hCamera,
BYTE *pbyImageBuffer,
tSdkFrameHead *pFrInfo
);
82
Example:
4.32 CameraSaveImage
Prototype:
MVSDK_API CameraSdkStatus
CameraSaveImage
(
CameraHandle hCamera,
LPCTSTR lpszFileName,
BYTE *pbyImageBuffer,
tSdkFrameHead *pFrInfo,
BYTE byFileType,
BYTE byQuality
);
83
RGB format CameraImageProcess process. Specific
usage can refer to the Advanced routines.
byQuality:Quality factor to save the image only when saved as JPG
format This parameter is valid, the range of 1-100. The
rest can be written 0 format.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:
Example:
4.33 CameraSetMirror
Prototype:
MVSDK_API CameraSdkStatus
CameraSetMirror
(
CameraHandle hCamera,
INT iDir,
BOOL bEnable
);
84
return value: When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.34 CameraGetMirror
Prototype:
MVSDK_API CameraSdkStatus
CameraGetMirror
(
CameraHandle hCamera,
INT iDir,
BOOL *pbEnable
);
85
4.35 CameraSetMonochrome
Prototype:
MVSDK_API CameraSdkStatus
CameraSetMonochrome
(
CameraHandle hCamera,
BOOL bEnable
);
Example:
4.36 CameraGetMonochrome
prototype:
MVSDK_API CameraSdkStatus
CameraGetMonochrome
(
CameraHandle hCamera,
BOOL *pbEnable
);
86
Function Description:Get black and white color conversion function is enabled
status.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
*pbEnable : pointer. Returns TRUE opens the color image is
converted to black and white images.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.37 CameraSetInverse
Prototype:
MVSDK_API CameraSdkStatus
CameraSetInverse
(
CameraHandle hCamera,
BOOL bEnable
);
87
Example:
4.38 CameraGetInverse
prototype:
MVSDK_API CameraSdkStatus
CameraGetInverse
(
CameraHandle hCamera,
BOOL *pbEnable
);
Example:
4.39 CameraSetImageResolution
Prototype:
MVSDK_API CameraSdkStatus
CameraSetImageResolution
(
88
CameraHandle hCamera,
tSdkImageResolution *pImageResolution
);
Example:
4.40 CameraGetImageResolution
Prototype:
MVSDK_API CameraSdkStatus
CameraGetImageResolution
(
CameraHandle hCamera,
tSdkImageResolution *psCurImageResolution
);
89
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.41 CameraGetMediaType
Prototype:
MVSDK_API CameraSdkStatus
CameraGetMediaType
(
CameraHandle hCamera,
INT *piMediaType
);
Function Description: Get the current camera output format index numbers for
the original data.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
*piMediaType:Pointer used to return the current format type index.
Property obtained by the camera
CameraGetCapability, in tSdkCameraCapbility
structure in pMediaTypeDesc members, holds an
array of formats supported by the camera,
piMediaType points to the index number, that is,
the array index number. pMediaTypeDesc [*
piMediaType] .iMediaType said current encoding
format. The coding see CameraDefine.h the [image
format definition] section.
90
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.42 CameraSetMediaType
Prototype:
MVSDK_API CameraSdkStatus
CameraSetMediaType
(
CameraHandle hCamera,
INT iMediaType
);
91
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.43 CameraSetAeState
Prototype:
MVSDK_API CameraSdkStatus
CameraSetAeState
(
CameraHandle hCamera,
BOOL bState
);
Example:
92
4.44 CameraGetAeState
prototype:
MVSDK_API CameraSdkStatus
CameraGetAeState
(
CameraHandle hCamera,
BOOL *pbAeState
);
Example:
4.45 CameraSetAeTarget
Prototype:
MVSDK_API CameraSdkStatus
CameraSetAeTarget
(
CameraHandle hCamera,
INT iAeTarget
);
93
Parameter Description:
hCamera:Camera handle, the function obtained by the CameraInit
iAeTarget:Brightness target value.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note: The setting range by the Camera GetCapability function to obtain.
Example:
4.46 CameraGetAeTarget
prototype:
MVSDK_API CameraSdkStatus
CameraGetAeTarget
(
CameraHandle hCamera,
INT *piAeTarget
);
Example:
94
4.47 CameraSetExposureTime
prototype:
MVSDK_API CameraSdkStatus
CameraSetExposureTime
(
CameraHandle hCamera,
double fExposureTime
);
4.48 CameraGetExposureTime
Prototype:
MVSDK_API CameraSdkStatus
CameraGetExposureTime
(
CameraHandle hCamera,
double *pfExposureTime
95
);
4.49 CameraGetExposureLineTime
Prototype:
MVSDK_API CameraSdkStatus
CameraGetExposureLineTime
(
CameraHandle hCamera,
double *pfLineTime
);
Example:
96
4.50 CameraSetAnalogGain
Prototype:
MVSDK_API CameraSdkStatus
CameraSetAnalogGain
(
CameraHandle hCamera,
INT usAnalogGain
);
Example:
4.51 CameraGetAnalogGain
Prototype:
MVSDK_API CameraSdkStatus
CameraGetAnalogGain
(
CameraHandle hCamera,
INT *pusAnalogGain
);
97
Function Description:To obtain an analog gain value of the image signal.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
*pusAnalogGai:Pointer, returns the current value of the analog gain.
return value: On success, returns CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:
Example:
4.52 CameraSetAeWindow
Prototype:
MVSDK_API CameraSdkStatus
CameraSetAEWindow
(
CameraHandle hCamera,
int iHOff,
int iVOff,
int iWidth,
int iHeight
);
98
return value: When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:1/2 the size of the window is set to the middle of each resolution. It can
change the resolution and follow along with the change; if iHOff,
iVOff, iWidth, window position range iHeight determined
beyond the current scope of the resolution, the size of the window
automatically centered 1/2
Example:
4.53 CameraGetAEWindow
Prototype:
MVSDK_API CameraSdkStatus
CameraGetAEWindow
(
CameraHandle hCamera,
INT* piHOff,
INT* piVOff,
INT* piWidth,
INT* piHeight
);
Function Description:获得自动曝光参考窗口的位置。
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
piHOff:Pointer return to the window location of the upper left
corner abscissa value.
piVOff:Pointer return to the window position the upper left corner
ordinate values.
99
piWidth:Index, returns the width of the window.
piHeight:Index return to the window height。
return value: When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:
Example:
4.54 CameraSetSharpness
Prototype:
MVSDK_API CameraSdkStatus
CameraSetSharpness
(
CameraHandle hCamera,
INT iSharpness
);
Example:
100
4.55 CameraGetSharpness
Prototype:
MVSDK_API CameraSdkStatus
CameraGetSharpness
(
CameraHandle hCamera,
INT *piSharpness
);
Example:
4.56 CameraSetOnceWB
Prototype:
MVSDK_API CameraSdkStatus
CameraSetOnceWB
(
CameraHandle hCamera
);
101
Function Description:In the manual white balance mode, call the function once
the white balance. Time is in effect upon receipt of the next frame of
image data.
Parameter Description: Camera: The camera handle, obtained by the Camera
Init function.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.57 CameraSetOnceBB
Prototype:
MVSDK_API CameraSdkStatus
CameraSetOnceBB
(
CameraHandle hCamera
);
102
4.58 CameraSetLutMode
Prototype:
MVSDK_API CameraSdkStatus
CameraSetLutMode
(
CameraHandle hCamera,
INT emLutMode
);
Example:
4.59 CameraGetLutMode
Prototype:
103
MVSDK_API CameraSdkStatus
CameraGetLutMode
(
CameraHandle hCamera,
INT *pemLutMode
);
Example:
4.60 CameraSelectLutPreset
Prototype:
MVSDK_API CameraSdkStatus
CameraSelectLutPreset
(
CameraHandle hCamera,
int iSel
);
Function Description:Select the default LUT table LUT mode. You must use
CameraSetLutMode
104
The LUT mode as the default mode.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
iSel:Table index number. Number of tables from the Camera
GetCapability obtained.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.61 CameraGetLutPresetSel
Prototype:
MVSDK_API CameraSdkStatus
CameraGetLutPresetSel
(
CameraHandle hCamera,
int* piSel
);
Example:
105
4.62 CameraSetCustomLut
Prototype:
MVSDK_API CameraSdkStatus
CameraSetCustomLut
(
CameraHandle hCamera,
BYTE* pLut
);
Example:
4.63 CameraGetCustomLut
Prototype:
MVSDK_API CameraSdkStatus
CameraGetCustomLut
(
CameraHandle hCamera,
BYTE* pLut
);
106
Function Description:Get a custom LUT tables currently in use.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
pLut:Pointer used to return a custom LUT tables currently in use.
LUT table size is 256 bytes, respectively, the code color
channel from 0 to 256 corresponding map value. Custom
LUT table mode values are 0-255. It represents 1: 1 linear
image without changing the original value.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:
Example:
4.64 CameraGetCurrentLut
Prototype:
MVSDK_API CameraSdkStatus
CameraGetCurrentLut
(
CameraHandle hCamera,
BYTE* pLut
);
Function Description:Get the camera's current LUT table can be invoked in any
LUT mode,
Get the camera's current LUT table can be invoked in any LUT mode,
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
107
pLut:Pointer, used to return the camera's current LUT table.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.65 CameraSetWbMode
Prototype:
MVSDK_API CameraSdkStatus
CameraSetWbMode
(
CameraHandle hCamera,
BOOL bAuto
);
Function Description:Set the camera white balance mode. Divided into manual
and automatic mode.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
bAuto:TRUE, the command enables the automatic mode. FALSE, it
means using the manual mode, by calling
CameraSetOnceWB to a white balance.
return value : When successful, the return CAMERA
STATUS_SUCCESS (0); otherwise it returns a non-zero
value of the error codes, refer to the error code definitions
CameraStatus.h
Example:
108
4.66 CameraGetWbMode
Prototype:
MVSDK_API CameraSdkStatus
CameraGetWbMode
(
CameraHandle hCamera,
BOOL *pbAuto
);
Example:
4.67 CameraIsWbWinVisible
Prototype:
MVSDK_API CameraSdkStatus
CameraIsWbWinVisible
(
CameraHandle hCamera,
BOOL *pbShow
);
109
Function Description:Get the white balance display state of the window.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
*pbShow:Pointer, returns TRUE, it indicates that the window is
visible.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.68 CameraGetWbWindow
Prototype:
MVSDK_API CameraSdkStatus
CameraGetWbWindow
(
CameraHandle hCamera,
INT* PiHOff,
INT* PiVOff,
INT* PiWidth,
INT* PiHeight
);
110
PiHeight:Index Returns the height of the reference window.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.69 CameraSetWbWindow
Prototype:
MVSDK_API CameraSdkStatus
CameraSetWbWindow
(
CameraHandle hCamera,
INT iHOff,
INT iVOff,
INT iWidth,
INT iHeight
);
111
Example:
4.70 CameraImageOverlay
Prototype:
MVSDK_API CameraSdkStatus
CameraImageOverlay
(
CameraHandle hCamera,
BYTE *pRgbBuffer,
tSdkFrameHead *pFrInfo
);
Example:
112
4.71 CameraSetCrossLine
Prototype:
MVSDK_API CameraSdkStatus
CameraSetCrossLine
(
CameraHandle hCamera,
int iLine,
INT x,
INT y,
UINT color,
BOOL bVisible
);
113
4.72 CameraGetCrossLine
Prototype:
MVSDK_API CameraSdkStatus
CameraGetCrossLine
(
CameraHandle hCamera,
int iLine,
INT *px,
INT *py,
UINT *pcolor,
BOOL *pbVisible
);
Example:
114
4.73 CameraSetGain
Prototype:
MVSDK_API CameraSdkStatus
CameraSetGain
(
CameraHandle hCamera,
int iRGain,
int iGGain,
int iBGain
);
Example:
4.74 CameraGetGain
Prototype:
MVSDK_API CameraSdkStatus
CameraGetGain
115
(
CameraHandle hCamera,
int *piRGain,
int *piGGain,
int *piBGain
);
Example:
4.75 CameraSetGamma
Prototype:
MVSDK_API CameraSdkStatus
CameraSetGamma
(
CameraHandle hCamera,
int iGamma
);
116
iGamma:To set the Gamma value.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:Set value will be immediately stored in the internal SDK, but only
when the camera is dynamic parameters generated LUT mode to
take effect. Refer CameraSetLutMode function description
section.
Example:
4.76 CameraGetGamma
Prototype:
MVSDK_API CameraSdkStatus
CameraGetGamma
(
CameraHandle hCamera,
int *piGamma
);
Example:
117
4.77 CameraSetSaturation
Prototype:
MVSDK_API CameraSdkStatus
CameraSetSaturation
(
CameraHandle hCamera,
INT iSaturation
);
4.78 CameraGetSaturation
Prototype:
MVSDK_API CameraSdkStatus
CameraGetSaturation
(
CameraHandle hCamera,
INT *piSaturation
);
118
Function Description:Get saturation image processing.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
*piSaturation:Pointer, returns the current saturation value of image
processing.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.79 CameraSetContrast
Prototype:
MVSDK_API CameraSdkStatus
CameraSetContrast
(
CameraHandle hCamera,
INT iContrast
);
119
Example:
4.80 CameraGetContrast
Prototype:
MVSDK_API CameraSdkStatus
CameraGetContrast
(
CameraHandle hCamera,
INT *piContrast
);
Example:
4.81 CameraSetFrameSpeed
Prototype:
MVSDK_API CameraSdkStatus
CameraSetFrameSpeed
(
120
CameraHandle hCamera,
INT iFrameSpeedSel
);
Example:
4.82 CameraGetFrameSpeed
Prototype:
MVSDK_API CameraSdkStatus
CameraGetFrameSpeed
(
CameraHandle hCamera,
INT *piFrameSpeedSel
);
Function Description:Get the camera frame rate of the output image selection
index.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
121
*piFrameSpeedSel:Pointer back to select the frame rate mode
index.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:
Example:
4.83 CameraSetAntiFlick
Prototype:
MVSDK_API CameraSdkStatus
CameraSetAntiFlick
(
CameraHandle hCamera,
BOOL bEnable
);
Example:
122
4.84 CameraGetAntiFlick
Prototype:
MVSDK_API CameraSdkStatus
CameraGetAntiFlick
(
CameraHandle hCamera,
BOOL *pbEnable
);
Example:
4.85 CameraGetLightFrequency
Prototype:
MVSDK_API CameraSdkStatus
CameraGetLightFrequency
(
CameraHandle hCamera,
int *piFrequencySel
);
4.86 CameraSetLightFrequency
Prototype:
MVSDK_API CameraSdkStatus
CameraSetLightFrequency
(
CameraHandle hCamera,
int iFrequencySel
);
Example:
124
4.87 CameraSetTransPackLen
Prototype:
MVSDK_API CameraSdkStatus
CameraSetTransPackLen
(
CameraHandle hCamera,
INT iPackSel
);
Example:
4.88 CameraGetTransPackLen
Prototype:
MVSDK_API CameraSdkStatus
125
CameraGetTransPackLen
(
CameraHandle hCamera,
INT *piPackSel
);
Example:
4.89 CameraWriteSN
Prototype:
MVSDK_API CameraSdkStatus
CameraWriteSN
(
CameraHandle hCamera,
BYTE *pcSN,
INT iLevel
);
126
grade 1 and grade 2 left secondary development. Each level numbers
are 32 bytes.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
*pcSN: Buffer number.
iLevel:To set the number of levels, only 1 or 2.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:
Example:
4.90 CameraReadSN
Prototype:
MVSDK_API CameraSdkStatus
CameraReadSN
(
CameraHandle hCamera,
BYTE *pcSN,
INT iLevel
);
127
Example:
4.91 CameraSaveParameter
Prototype:
MVSDK_API CameraSdkStatus
CameraSaveParameter
(
CameraHandle hCamera,
INT iTeam
);
Example:
4.92 CameraLoadParameter
Prototype:
128
MVSDK_API CameraSdkStatus
CameraLoadParameter
(
CameraHandle hCamera,
INT iTeam
);
Example:
4.93 CameraReadParameterFromFile
Prototype:
MVSDK_API CameraSdkStatus
CameraReadParameterFromFile
(
CameraHandle hCamera,
char *sFileName
);
129
Function Description:Loading parameters from the parameters specified on the
PC profile. Our camera parameters, stored on the PC for the .config
suffix file, located in the installation under Camera \ Configs folder.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
*sFileName:The full path of the parameter file.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.94 CameraGetCurrentParameterGroup
Prototype:
MVSDK_API CameraSdkStatus
CameraGetCurrentParameterGroup
(
CameraHandle hCamera,
INT *piTeam
);
Example:
130
4.95 CameraEnumerateDevice
Prototype:
MVSDK_API CameraSdkStatus
CameraEnumerateDevice
(
tSdkCameraDevInfo *pDSCameraList,
INT *piNums
);
Example:
4.96 CameraGetCapability
Prototype:
131
MVSDK_API CameraSdkStatus
CameraGetCapability
(
CameraHandle hCamera,
tSdkCameraCapbility *pCameraInfo
);
Example:
4.97 CameraSetTriggerCount
Prototype:
MVSDK_API CameraSdkStatus
CameraSetTriggerCount
(
CameraHandle hCamera,
INT iCount
);
132
iCount:A trigger acquisition frames。
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
error code definitions CameraStatus.h.
Note:Software trigger and hardware trigger mode are valid. The default is 1, ie, a
trigger signal acquisition an image.
Example:
4.98 CameraGetTriggerCount
Prototype:
MVSDK_API CameraSdkStatus
CameraGetTriggerCount
(
CameraHandle hCamera,
INT *piCount
);
Example:
133
4.99 CameraGetTriggerDelayTime
Prototype:
MVSDK_API CameraSdkStatus
CameraGetTriggerDelayTime
(
CameraHandle hCamera,
UINT *puDelayTimeUs
);
Example:
4.100 CameraSetTriggerDelayTime
Prototype:
MVSDK_API CameraSdkStatus
CameraSetTriggerDelayTime
(
CameraHandle hCamera,
UINT uDelayTimeUs
);
134
Function Description:Trigger delay time setting hardware trigger mode, in
microseconds.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
uDelayTimeUs:Trigger delay. In microseconds.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Note:仅部分型号的相机支持该功能。
Example:
4.101 CameraSoftTrigger
Prototype:
MVSDK_API CameraSdkStatus
CameraSoftTrigger
(
CameraHandle hCamera
);
Example:
135
4.102 CameraSetTriggerMode
Prototype:
MVSDK_API CameraSdkStatus
CameraSetTriggerMode
(
CameraHandle hCamera,
INT iTriggerModeSel
);
Example:
4.103 CameraGetTriggerMode
Prototype:
MVSDK_API CameraSdkStatus
CameraGetTriggerMode
(
136
CameraHandle hCamera,
INT *piTriggerMode
);
Example:
4.104 CameraSnapToBuffer
Prototype:
MVSDK_API CameraSdkStatus
CameraSnapToBuffer
(
CameraHandle hCamera,
tSdkFrameHead *pFrameInfo,
BYTE **pbyBuffer,
UINT uWaitTimeMs
);
137
**pbyBuffer:A pointer to a pointer to the return address the image
buffer.
uWaitTimeMs:Timeout, in milliseconds.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.105 CameraGetResolutionForSnap
Prototype:
MVSDK_API CameraSdkStatus
CameraGetResolutionForSnap
(
CameraHandle hCamera,
tSdkImageResolution *pImageResolution
);
Example:
138
4.106 CameraSetResolutionForSnap
Prototype:
MVSDK_API CameraSdkStatus
CameraSetResolutionForSnap
(
CameraHandle hCamera,
tSdkImageResolution *pImageResolution
);
Example:
4.107 CameraSetParameterTarget
Prototype:
MVSDK_API CameraSdkStatus
CameraSetParameterTarget
(
139
CameraHandle hCamera,
int iTarget
);
Example:
4.108 CameraGetParameterTarget
Prototype:
MVSDK_API CameraSdkStatus
CameraGetParameterTarget
(
CameraHandle hCamera,
int *piTarget
);
140
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Note:
Example:
4.109 CameraSetParameterMask
Prototype:
MVSDK_API CameraSdkStatus
CameraSetParameterMask
(
CameraHandle hCamera,
UINT uMask
);
Function Description:Set the mask parameter access. When loading and saving
parameters will be determined based on the shield of each module
parameters is loaded or saved.
Parameter Description:
hCamera:Camera handle, obtained by the CameraInit function.
uMask:shield. Reference Camera Define.h in emSdkPropSheetMask
type definition.return value : When successful, the return CAMERA
STATUS_SUCCESS (0); otherwise it returns a non-zero value of the error codes,
refer to the definition CameraStatus.h error codes.
Example:
141
4.110 CameraRstTimeStamp
Prototype:
MVSDK_API CameraSdkStatus
CameraRstTimeStamp
(
CameraHandle hCamera
);
Example:
4.111 CameraSaveUserData
Prototype:
MVSDK_API CameraSdkStatus
CameraSaveUserData
(
CameraHandle hCamera,
UINT uStartAddr,
BYTE *pbData,
int ilen
);
Function Description:Save the user-defined data to the camera's non-volatile
memory. The maximum length of the user data area of each camera
models may not support the same. The length information can be
obtained from the characterization of the device.
142
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
uStartAddr Starting address, starting with 0.Note,Address must be
64-byte aligned.
pbData Data buffer pointer to return the read data.
ilen Read data length, len + StartAddr area must be less than
the maximum length of the user
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.112 CameraLoadUserData
Prototype:
MVSDK_API CameraSdkStatus
CameraLoadUserData
(
CameraHandle hCamera,
UINT uStartAddr,
BYTE *pbData,
int ilen
);
Function Description : Read user-defined data from the camera's non-volatile
memory. The maximum length of the user data area of each camera
models may not support the same. The length information can be
obtained from the characterization of the device.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
uStartAddr Starting address, starting with 0 Note,Address must be
64-byte aligned.
pbData Data buffer pointer to return the read data.
143
ilen Data buffer pointer to return the read data.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes,
refer to the definition CameraStatus.h error codes.
Example:
4.113 CameraGetFriendlyName
Prototype:
MVSDK_API CameraSdkStatus
CameraGetFriendlyName
(
CameraHandle hCamera,
char * pName
);
Function Description:Read the camera's nickname, nickname default camera is
automatically generated in the model name + # 0,1,2 means, such as
Camera MV-U500 # 0 and Camera MV-U500 # 1, represents a computer
connected on the same 2 500-megapixel camera, a camera for a separate
set of nicknames, you can call CameraSetFriendlyName function, for
example, where the first camera to My camera 1, then the two names on
the MV-U500 are My camera 1 and camera MV-U500 # 1.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
pName Back camera nickname first string buffer address, buffer size
requires more than 32 bytes
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
144
4.114 CameraSetFriendlyName
Prototype:
MVSDK_API CameraSdkStatus
CameraSetFriendlyName
(
CameraHandle hCamera,
char* pName
);
Function Description:Setting a camera nickname, after setting success nickname
cured within the camera, this function can easily distinguish between
multiple cameras.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
pName Nickname pointing the camera to set the string buffer first
address, nickname
Must be less than 31 characters, the string is set to "auto", or "
Automatic generation "indicates the default nickname.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.115 CameraSdkGetVersionString
Prototype:
MVSDK_API CameraSdkStatus
CameraSdkGetVersionString
(
char* pVersionString
);
145
Function Description : Read user-defined data from the camera's non-volatile
memory. The maximum length of the user data area of each camera
models may not support the same. The length information can be
obtained from the characterization of the device.
Parameter Description:pVersionString Back SDK version string buffer length is
greater than the required 32 words.
return value:Back SDK version description string.
Example:
4.116 CameraGetEnumInfo
Prototype:
MVSDK_API CameraSdkStatus
CameraGetEnumInfo
(
CameraHandle hCamera,
tSdkCameraDevInfo* pCameraInfo
);
Function Description:Get a specified device enumeration information.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
pCameraInfo Pointer, enumerations return information about the device.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.117 CameraSetIOState
Prototype:
MVSDK_API CameraSdkStatus
146
CameraSetIOState
(
CameraHandle hCamera,
INT iOutputIOIndex,
UINT uState
);
Function Description:IO setting specifies the level of the state, IO output type IO,
IO cameras reserve programmable output is determined by the number of
tSdkCameraCapbility iOutputIoCounts.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
iOutputIOIndex IO index number, starting from 0.
uState To set status 1 is high, 0 low
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.118 CameraGetIOState
Prototype:
MVSDK_API CameraSdkStatus
CameraGetIOState
(
CameraHandle hCamera,
INT iInputIOIndex,
UINT* puState
);
Function Description:IO setting specifies the level of the state, IO is imported IO,
IO cameras reserve programmable output is determined by the number of
tSdkCameraCapbility iInputIoCounts.
147
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
iInputIOIndex IO index number, starting from 0.
puState Pointer, returns IO status, 1 is high, 0 low.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.119 CameraSetIspOutFormat
Prototype:
MVSDK_API CameraSdkStatus
CameraSetIspOutFormat
(
CameraHandle hCamera,
UINT uFormat
);
Function Description:Set output format CameraImageProcess image processing
functions, support
CAMERA_MEDIA_TYPE_MONO8 and CAMERA_MEDIA_TYPE_RGB8,
CAMERA_MEDIA_TYPE_RGBA8,
CAMERA_MEDIA_TYPE_BGR8, CAMERA_MEDIA_TYPE_BGRA8
(defined in CameraDefine.h in) five kinds, corresponding to 8-bit
grayscale images and 24-bit RGB, 32 the RGBA Wei, 24 BGR, 32 Wei
BGRA format, the secondary development may be required visual library
Select the output format, such as the need BGR format under OPENCV,
but with QT development, you need to RGB format.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
uFormat To set the format provided, which can be
CAMERA_MEDIA_TYPE_MONO8 和
148
CAMERA_MEDIA_TYPE_RGB8、
CAMERA_MEDIA_TYPE_RGBA8、
CAMERA_MEDIA_TYPE_BGR8、
CAMERA_MEDIA_TYPE_BGRA8 其中之一。
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.120 CameraGetIspOutFormat
Prototype:
MVSDK_API CameraSdkStatus
CameraGetIspOutFormat
(
CameraHandle hCamera,
UINT* puFormat
);
Function Description:Obtain Camera Get Image Buffer function image processing
output format, which can be CameraSetIspOutFormat set.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
puFormat It returns the currently set format, and its value is
CAMERA_MEDIA_TYPE_MONO8 and
CAMERA_MEDIA_TYPE_RGB8、
CAMERA_MEDIA_TYPE_RGBA8、
CAMERA_MEDIA_TYPE_BGR8、
CAMERA_MEDIA_TYPE_BGRA8 one of them.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
149
Example:
4.121 CameraGetErrorString
Prototype:
MVSDK_API char*
CameraGetErrorString
(
CameraSdkStatus iStatusCode
);
Function Description:Get the error code corresponding to the description string.
Parameter Description:iStatusCode error code. (As defined in the Camera
Status.h)
return value:When successful, enter the error code corresponding to the first string
address.
Example:
4.122 CameraReConnect
Prototype:
MVSDK_API CameraSdkStatus
CameraReConnect
(
CameraHandle hCamera,
);
Function Description:Reconnect the device for USB, reconnect the device after
GIGE unexpectedly dropped.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
150
Example:
4.123 CameraConnectTest
Prototype:
MVSDK_API CameraSdkStatus
CameraConnectTest
(
CameraHandle hCamera,
);
Function Description:Test the connection of the camera, for detecting whether the
camera dropped.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
return value:成功时,返回 CAMERA_STATUS_SUCCESS (0),It represents not
dropped; otherwise it returns a non-zero value of the error codes, refer to
the definition CameraStatus.h error codes.
Example:
4.124 CameraSetTriggerDelayTime
Prototype:
MVSDK_API CameraSdkStatus
CameraSetTriggerDelayTime
(
CameraHandle hCamera,
UINT uDelayTimeUs
);
Function Description : Trigger delay time setting hardware trigger mode, in
microseconds. When the trigger signal is coming hard after a specified
151
delay, then start collecting images. Only part of the model of camera
support this function. For details, please view product specifications.
Example:
4.125 CameraGetTriggerDelayTime
Prototype:
MVSDK_API CameraSdkStatus
CameraGetTriggerDelayTime
(
CameraHandle hCamera,
UINT* puDelayTimeUs
);
Function Description:Get the current setting of a hard trigger delay time.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
puDelayTimeUs Pointer, returns the delay time in microseconds.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
152
4.126 CameraSetStrobeMode
Prototype:
MVSDK_API CameraSdkStatus
CameraSetStrobeMode
(
CameraHandle hCamera,
INT iMode
);
Function Description:Setting STROBE signal IO pin terminals. The flash control
signal can be done, you can also do an external mechanical shutter
control.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
iMode When the STROBE_SYNC_WITH_TRIG_AUTO
And trigger signal synchronization, triggered when the camera
exposure automatically generate STROBE signal. In this case, the effective polarity
can be set (CameraSetStrobePolarity).
When is STROBE_SYNC_WITH_TRIG_MANUAL, the
synchronization and the trigger signal, trigger, STROBE delay specified time
(CameraSetStrobeDelayTime), then for a specified time
Pulse (CameraSetStrobePulseWidth), effective polarity can be set
(CameraSetStrobePolarity).
When is STROBE_ALWAYS_HIGH time, STROBE signal constant
is high, ignoring other settings
When is STROBE_ALWAYS_LOW time, STROBE signal constant
is low, ignoring other settings
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
153
4.127 CameraGetStrobeMode
Prototype:
MVSDK_API CameraSdkStatus
CameraGetStrobeMode
(
CameraHandle hCamera,
INT* piMode
);
Function Description:Or STROBE signal setting mode current.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
piMode Pointer to return
STROBE_SYNC_WITH_TRIG_AUTO,
STROBE_SYNC_WITH_TRIG_MANUAL、
STROBE_ALWAYS_HIGH or
STROBE_ALWAYS_LOW。
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.128 CameraSetStrobeDelayTime
Prototype:
MVSDK_API CameraSdkStatus
CameraSetStrobeDelayTime
(
CameraHandle hCamera,
UINT uDelayTimeUs
);
154
Function Description:When STROBE signal is STROBE_SYNC_WITH_TRIG,
through the function sets the relative trigger delay time.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
uDelayTimeUs Relative trigger delay time of the signal, the unit is us.
It can be 0, but can not be negative.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.129 CameraGetStrobeDelayTime
Prototype:
MVSDK_API CameraSdkStatus
CameraGetStrobeDelayTime
(
CameraHandle hCamera,
UINT* upDelayTimeUs
);
Function Description:When STROBE signal is STROBE_SYNC_WITH_TRIG,
obtained by the function of its relative trigger delay time.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
upDelayTimeUs Pointer, returns the delay time in us.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
155
4.130 CameraSetStrobePulseWidth
Prototype:
MVSDK_API CameraSdkStatus
CameraSetStrobePulseWidth
(
CameraHandle hCamera,
UINT uTimeUs
);
Function Description:When STROBE signal is STROBE SYNC WITH TRIG, set
its pulse width by the function.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
uTimeUs Pulse width in time us.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.131 CameraGetStrobePulseWidth
Prototype:
MVSDK_API CameraSdkStatus
CameraGetStrobePulseWidth
(
CameraHandle hCamera,
UINT* upTimeUs
);
Function Description:When STROBE signal is STROBE SYNC WITH TRIG,
obtained by the pulse width function.
Parameter Description:hCamera Camera handle, obtained by the CameraInit
function.
156
upTimeUs Pointer, return the pulse width. Units of time us.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.132 CameraSetStrobePolarity
Prototype:
MVSDK_API CameraSdkStatus
CameraSetStrobePolarity
(
CameraHandle hCamera,
INT uPolarity
);
Function Description:When STROBE signal is STROBE_SYNC_WITH_TRIG, set
the active level through the polar function. The default is active high,
when the trigger signal arrives, STROBE signal is pulled high.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
iPolarity STROBE signal polarity is active-low 0, 1 is high
Ping valid. The default is active high.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.133 CameraGetStrobePolarity
Prototype:
157
MVSDK_API CameraSdkStatus
CameraGetStrobePolarity
(
CameraHandle hCamera,
INT* upPolarity
);
Function Description:Effective polarity current camera STROBE signal. The default
is active high.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
ipPolarity Pointer, returns the currently active STROBE signal
polarity.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.134 CameraSetExtTrigSignalType
Prototype:
MVSDK_API CameraSdkStatus
CameraSetExtTrigSignalType
(
CameraHandle hCamera,
INT iType
);
Function Description:Set the camera external trigger signal type. The upper edge,
lower edge, or high and low mode.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
158
iType External trigger signal type, return value: Reference
Camera Define.h in emExtTrigSignal type definition.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.135 CameraGetExtTrigSignalType
Prototype:
MVSDK_API CameraSdkStatus
CameraGetExtTrigSignalType
(
CameraHandle hCamera,
INT* ipType
);
Function Description:Get the camera's current external trigger signal type.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
ipType Pointer, return external trigger signal type, return value:
Reference Camera Define.h in emExtTrigSignal type definition.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
159
4.136 CameraSetExtTrigDelayTime
Prototype:
MVSDK_API CameraSdkStatus
CameraSetExtTrigDelayTime
(
CameraHandle hCamera,
UINT uDelayTimeUs
);
Function Description:Setting the external trigger signal delay time, the default is 0
microseconds. When the value is not 0 uDelayTimeUs set, the camera
after receiving external trigger signal, the delay uDelayTimeUs
microseconds after the image capture.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
uDelayTimeUs Delay time in microseconds. The default is 0.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
4.137 CameraGetExtTrigDelayTime
Prototype:
MVSDK_API CameraSdkStatus
CameraGetExtTrigDelayTime
(
CameraHandle hCamera,
UINT* upDelayTimeUs
);
160
Function Description:Get set external trigger signal delay time, the default is 0
microseconds.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
upDelayTimeUs Pointer, return delay time.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.138 CameraSetExtTrigJitterTime
Prototype:
MVSDK_API CameraSdkStatus
CameraSetExtTrigJitterTime
(
CameraHandle hCamera,
UINT uTimeUs
);
Function Description:Set the camera's external trigger signal debounce time, only
when the external trigger mode select high or low trigger debounce time
to take effect. The default is 0, in microseconds, maximum 150
milliseconds.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
uTimeUs Microseconds.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the
definition CameraStatus.h error codes.
Example:
161
4.139 CameraGetExtTrigJitterTime
Prototype:
MVSDK_API CameraSdkStatus
CameraGetExtTrigJitterTime
(
CameraHandle hCamera,
UINT* upTimeUs
);
Function Description:Get the camera set up outside the trigger debounce time, the
default is 0. microseconds.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
upTimeUs Pointer to return debounce time setting.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
Example:
4.140 CameraGetExtTrigCapability
Prototype:
MVSDK_API CameraSdkStatus
CameraGetExtTrigCapability
(
CameraHandle hCamera,
UINT* puCapabilityMask
);
162
Function Description:Camera Properties mask obtain external trigger.
Parameter Description:hCamera Camera handle, obtained by the
CameraInit function.
puCapabilityMask Pointer, returns the camera external trigger
characteristic mask, mask macro reference CameraDefine.h in EXT_TRIG_MASK_
open header definition.
return value:When successful, the return CAMERA STATUS_SUCCESS (0);
otherwise it returns a non-zero value of the error codes, refer to the definition
CameraStatus.h error codes.
4.141 CameraAlignMalloc
Prototype:
MVSDK_API BYTE*
CameraAlignMalloc
(
int size,
int align
);
Function Description : Application address aligned memory block. With
hardware acceleration for algorithms required aligned block of
memory.
Parameter Description:size memory size
align aligned address, if you need 16-byte aligned, it is set to 16
return value:When successful, return the application to the first memory address.
On failure, returns NULL.
4.142 CameraAlignFree
Prototype:
MVSDK_API VOID
CameraAlignFree
163
(
BYTE* membuffer
);
Function Description:Released by the Camera Align Malloc application address
aligned memory block.
Parameter Description: membuffer CameraAlignMalloc returned by the
memory address.
return value:
164
5 SDKInterface function by function explanation
In order to facilitate the user to quickly find a way to develop a feature, we have
some of the common methods are summarized.
165
if (CameraEnumerateDevice (sCameraList, & iCameraNums)! = CAMERA_STATUS_SUCCESS ||
iCameraNums == 0)
{
return FALSE;
}
// If only one camera, iCameraNums will be modified CameraEnumerateDevice internal one.
if ((status = CameraInit (& sCameraList [0], - 1, -1, & m_hCamera)) =
CAMERA_STATUS_SUCCESS!)
{
return FALSE;
}
int iCameraNums;
iCameraNums = CameraEnumerateDeviceEx();
if (iCameraNums == 0) return FALSE;
int iCameraNums;
iCameraNums = CameraEnumerateDeviceEx();
if (iCameraNums == 0) return FALSE;
//This routine, use the "Camera 1" name initialization, the camera must first tool was renamed
"Camera1"
if ((status = CameraInitEx2("Camera1",&m_hCamera)) != CAMERA_STATUS_SUCCESS)
{
return FALSE;
}
166
//Before calling the program exits
CameraUnInit(m_hCamera);
5.3 The camera takes images (Fig initiative taken or callback mode)
After initialization is complete, you can begin to take the camera diagram work.
Taken in accordance with FIG manner, our SDK is divided into active and passive
(callback) two.
active in image mode:
After completing the camera initialization, you can use the active
CameraGetImageBuffer or CameraGetImageBufferEx3 function reads the image, the
difference between the two is,
CameraGetImageBuffer function obtained is the original RAW data buffer, use
CameraImageProcess function RAW data is converted to the specified data format,
After using the buffer pointer was finished, to call CameraReleaseImageBuffer
release buffer usage rights, need to explain here is CameraReleaseImageBuffer just
released by the CameraGetImageBuffer obtained the right to use the data buffer and
does not apply and release the memory repeatedly, without worrying about efficiency
question; CameraGetImageBufferEx3 functions are directly specified image data
format, the specific format is determined by the input parameters, it can be 8-bit,
16-bit grayscale, or 24-bit, 32-bit color data format, and function calls
CameraGetImageBufferEx3 after not need to call CameraReleaseImageBuffer. Two
functions is common in image timeout can be set, for example, set 1000 ms timeout,
then in 1000 ms, if no valid image, the function will be blocked, the thread is
suspended until more than 1000 msec or reading a valid image, so the software
architecture design, the user can create a thread dedicated image acquisition, image
acquisition and has only need to set a reasonable time-out can be, or need to capture
the image when calling a function, to obtain an image.
Here is CameraGetImageBuffer sample code:
tSdkFrameHead sFrameInfo;
BYTE* pbyBuffer;
168
CameraSdkStatus status;
/* pbyBuffer Automatically apply to a good memory, to store the original RAW data from the
internal SDK/if(CameraGetImageBuffer(m_hCamera,&sFrameInfo,&pbyBuffer,1000) ==
CAMERA_STATUS_SUCCESS)
{
/* m_pFrameBufferYou need to apply good memory pb Buffer converted image data stored in the
m_pFrameBuffer, the default will be the image data BRG24bit*/
CameraImageProcess(m_hCamera, pbyBuffer, m_pFrameBuffer,&sFrameInfo);
CameraReleaseImageBuffer(m_hCamera,pbyBuffer);
169
CameraSdkStatus status;
//Converts RAW data into image data for the specified format. The default into image data
BGR24 format.
status = CameraImageProcess(hCamera, pFrameBuffer, m_pFrameBuffer,pFrameHead);
//After the conversion is successful, the use of data m_pFrame Buffer in subsequent
processing.
}
170
CameraSetAeState,set the camera exposure mode is divided into manual and
automatic modes.
CameraSetExposureTime ,set the camera's exposure time in microseconds. Note
that the exposure time, the lower the camera's frame rate, for example, the
exposure time is set to 500 ms, then one second imaging camera up to 2 times,
the image looks will be more Caton. Therefore, in order to reduce the time taken
diagram, the exposure time should be as low as possible, of course, low exposure
time, you need an external light source to increase the light, otherwise the image
will be very dark.
CameraSetAnalogGain,set the analog gain value of the camera, the size of this
value will only affect the image brightness, but will not affect the image frame
rate, because only a circuit amplification factor, but will enhance the image of the
background noise after the value increases, the pursuit of quality applications,
analog gain should be set to a minimum.
function)
ROI explain the step value
CameraSetGamma,Set the gamma value of the camera, the smaller the value of
gamma, brightness will increase the value of smaller pixels, making the overall
brightness of the CP; the larger the gamma value, will reduce the value gray
pixels of high brightness, making the overall brightness becomes smaller. The
default gamma value of 1.0.
CameraSetContrast,set the camera's contrast value, the greater the contrast, the
darker the area make the picture black and white more white areas, so that the
image looks black and white is very clear, in a number of visual processing can
effectively capture the outline; the other hand, if the contrast small, will be grays,
it looks hazy. Contrast The default is 100, the minimum can be 1, up to 200.
171
CameraSetSaturation,set saturation. The more concentrated the greater color
saturation; whereas the more light, saturation If set to 0, the image is completely
without color, and is equivalent to the black and white camera. The default value
is 100. The adjustment range is 0-200.
CameraSetGain,gain setting value R, G, B three color channels.
172
5.9 multiple cameras simultaneously, how to establish a
173
the inside of the camera.
Custom name modify the camera
Modify the name of the camera after a good, fast initialization may be performed by
CameraInitEx2 function. Suppose the two cameras was renamed "Camera1" and
"Camera2" code is as follows:
//Scan camera, if there are two,iCameraCounts = 2
int iCameraCouts = CameraEnumerateDeviceEx();
//Initialization custom name "Camera1" camera, if not find the corresponding name of
the camera, the initialization fails.
CameraInitEx2 ("Camera1",&hCamera1);
//Initialization custom name as "Camera2" camera, if not find the corresponding name
of the camera, the initialization fails.
CameraInitEx2 ("Camera2",&hCamera2);
Note that after image rotation, image width and height dimensions will swap, for
example, it turned out to be after 800X600, rotated 90 degrees, that is, the size of
600X800, when the process should pay attention to, otherwise it will cause an error,
the image looks very confusing.
2,Use Camera Image Process RAW function will be converted into BGR24 or
8-bit grayscale format. If you want to save the RAW data format, skip this step.
3,Camera Release ImageBuffer, released CameraGetImageBuffer to the RAW
data buffer usage rights.
4,CameraSaveImage function to image data obtained CameraImageProcess
function to save as JPG, BMP or PNG one of them. If RAW data is saved using
CameraGetImageBuffer obtained RAW data buffer.
Examples of the image saved located \ Demo \ VC ++ \ ImageFormat Saving
Recording function. CameraInit Record function initializes the first video.
CameraPushFrame a coded image. CameraStopRecord stop recording, the end of
the write file operation.
Examples of video located \ Demo \ VC ++ \ Record.
175
5.13 Setting the camera image output bit depth
By default, the camera industry is generally transmitted raw data 8bit format, in
some applications a wide dynamic uplink, the user can change the camera functions
CameraSetMediaType output of raw data bit depth. Currently we support the bit depth
of 12, 16 bits have three options.
For example Camera SetMediaType (Camera, 0); selects the first seed, 8bit format
Camera SetMediaType (Camera, 1); selecting the second species is 12bit,
Camera SetMediaType (Camera, 2); third choice is 16bit.
Note: Not all models support 12 and 16 bit output mode. If CameraSetMediaType
returns non-zero, it means the setting failure.
color)
Unlike 5.13, said here pixel format, the final image obtained by the pixel format
CameraImageProcess function, rather than the camera pixel format of the output of
the original RAW.
Most types of industrial cameras can output 12bit or 16bit original RAW image,
the color camera, if a color component with 8bit image detail is lost out of the low, so
we provide RBG48bit color image format to meet the users to do high dynamic,
high-precision visual analysis. Red, green, and blue color channels, each channel
using 16bit to represent a pixel requires six bytes. When the camera supports 12bit or
16bit original RAW format, you can use 48bit color image format. 12bit RAW data
format, the image is converted to 48bit color when low 4bit each channel will be filled
with 0.
After the camera is initialized by calling CameraSetIspOutFormat to set up.
camera set ISP out format (H camera, camera_Media_type_mono8);
//Once set, the output image is Camera Image Process 8bit grayscale image, and a
pixel occupies one byte, in order of priority.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_MONO16);
//Once set, the output image is Camera Image Process 16bit grayscale image, and a
pixel occupies two bytes, in order of priority.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_BGR8);
//Once set, the output image CameraImageProcess is 24bit BGR color image, and a
pixel occupies 3 bytes, followed by blue, green, red this arrangement.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_BGR16);
//Once set, the image is a color image 48bit BGR CameraImageProcess output a pixel
occupies 6 bytes, followed by blue 16bit, 16bit green, red 16bit this arrangement.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_BGRA8);
//Once set, the output image CameraImageProcess is 32bit BGRA color image, and a
pixel occupies 3 bytes, followed by blue, green, red, Alpha this arrangement.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_BGRA16);
176
//Once set, the output image CameraImageProcess is 64bit BGRA color image, and a
pixel occupies 8 bytes, followed by blue 16bit, green 16bit, red 16bit, Alpha16bit this
arrangement.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_RGB8);
//Once set, the output image CameraImageProcess is 24bit RBG color image, and a
pixel occupies 3 bytes, followed by red, green and blue so arranged.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_RGB16);
//Once set, the output image CameraImageProcess is 48bit RBG color image, and a
pixel occupies 6 bytes, followed by red 16bit, 16bit green, blue 16bit this
arrangement.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_RGBA8);
//Once set, the output image CameraImageProcess is 32bit RBGA color image, and a
pixel occupies four bytes, followed by red 8bit, green 8bit, blue 8bit, Alpha8bit this
arrangement.
CameraSetIspOutFormat(hCamera, CAMERA_MEDIA_TYPE_RGBA16);
//Once set, the output image CameraImageProcess is 64bit RBGA color image, and a
pixel occupies 8 bytes, followed by red 16bit, green 16bit, blue 16bit, Alpha16bit this
arrangement.
For 16 bit (1 channel 2 bytes) of data, we use the little-endian mode memory, 1 byte is
low 8bit, byte 2 is a high 8bit.
For 16 bit (1 channel 2 bytes) of data, we use the little-endian mode memory, 1 byte is
low 8bit, byte 2 is a high 8bit.
Usage of this function, you can refer to the routine: \ Demo \ VC ++ \ ImageFormat &
Saving
5.16 camera network interface using the API to dynamically set IP,
Mode (hCamera, 1); switch to take the soft trigger mode Fig. After entering this
mode, the camera image capture and stop transmitting. Only when the user
invokes CameraSoftTrigger (hCamera) once, the camera will capture the image
once sent up. After finished entering the camera will wait until the next time the
user calls
this mode, the camera image capture and stop transmitting. Only when the user
invokes CameraSoftTrigger (hCamera) once, the camera will capture the image
once sent up. After finished entering the camera will wait until the next time the
user invokes CameraSoftTrigger (hCamera).
178
Set the camera to take a hard trigger mode Fig. By CameraSetTriggerMode
(hCamera, 2); switches to take a hard trigger mode Fig. After entering this mode,
the camera image capture and stop transmitting. Only when the user inputs a
pulse on the trigger terminal on the camera housing, the camera will capture the
image once sent up. After finished the camera will enter a waiting state until the
next trigger pulse is received.
If you need a trigger multiple images, you can CameraSetTriggerCount function
set, the default is a trigger to get a picture. If you need a trigger to get N images,
you can call CameraSetTriggerCount (hCamera, N) is set.
179
5.22 to read and write the serial number of the camera
The camera comes with three serial number, a serial number which is read-only,
can not be modified, the factory had already fixed up. Secondary and tertiary serial
number can be read freely. The serial number of each level is 32 bytes.
CameraReadSN,Read the serial number.
information
CameraGetErrorString
180
6 GigE Vision and USB3 Vision’S XMLXML file
defines interpretation
For a standard protocol interface development Vision customer, device
enumeration phase, the camera needs to resolve the corresponding XML
configuration file, this section we offer a special file for explanation, please refer to
the installation directory under the Document folder "USB3, GigE Vision interface
development and XML parsing .pdf "
181
7 Halcon Development Guidance
Halcon is the world’s most versatile machine vision software 。Halcon users
around the world from a flexible framework for rapid development of image analysis
and machine vision benefit program。Halcon has provided more than 1,100 kinds of
libraries with outstanding
Performance of the controller, such as fuzzy analysis, morphology, pattern matching,
3D correction. Halcon supports multiple operating systems.
Our camera interface has been optimized specifically for Halcon settings can be
well supported Halcon. Halcon has been installed in the system, then we run the
camera software installation package MindVision Platform Setup (x.x.x.x) .exe
installer, the installer will automatically detect the installation path Halcon, and its
corresponding settings. At present, our camera development kits support Halcon8,
Halcon9, Halcon10, Halcon11, Halcon12 32-bit and 64-bit versions.
After using the USB cable to connect the camera to a PC, you can begin to
develop, and the following instructions for MV-U300 camera models as an example,
when the development of other types of cameras, only need to modify the model
name.
7.1.
Figure7.1 Halcon Image acquisition interface
1. Click "image acquisition interfaces (IP)", in the drop-down list, locate
MindVision. As shown in Figure 7.2.In Figure 7.2 1. Click "Connect" tab,
the window in Figure 7.3. In Figure 7.3, we can see that our MV-U300
camera. If both multiple MindVision camera, select the camera you want to
access the device list.
182
Figure7.2 在 Halcon Image acquisition interface list found Mindvision
185
saturation,et the camera color saturation. Valid only for color cameras,
ranging from 0 to 200, is set to 0, the image completely lose color and
become black and white images, set to 200, the most beautiful color,
the default is 100.
gain, set the camera's analog gain, the parameters and shutter
parameters together, determines the brightness of the image. Only when
exposure_mode set to 0, gain shutter manually and parameters to
adjust.
color_space,et the output image format. Select Gray, the output will be
8 grayscale images, select RGB24, the output 24-bit color images.
Black and white camera can also choose RGB24 format, but R = G = B;
color camera can also choose 8-bit grayscale image output.
color_space,format image output. Select Gray, the output will be 8
grayscale images, select RGB24, the output 24-bit color images. Black
and white camera can also choose RGB24 format, but R = G = B; color
camera can also choose 8-bit grayscale image output.
GPO0,GPO1,GPO2,GPO3 This corresponds to 4 4 output type IO
status on the camera control, set_framegrabber_param (AcqHandle,
'GPO0', 1) is set to OUTPUT IO state number 0 is high,
set_framegrabber_param (AcqHandle, 'GPO0', 0) set number 0.
OUTPUT IO status is low; set_framegrabber_param (AcqHandle,
'GPO1', 1) is set to OUTPUT IO No. 1 status is high,
set_framegrabber_param (AcqHandle, 'GPO1', 0) is set numbered 1 the
OUTPUT IO status is low; the other numbered IO and so on.
186
Figure7.5 HalconThe camera parameter settings page
he image acquisition. Halcon image acquisition into a single acquisition and real-time
acquisition in two ways. Figure 7.4 Click the "collection (S)" button to conduct a
single acquisition, within the post-acquisition image now Halcon window, as shown
in Figure 7.7; Figure 7.4 Click the "Live (v)" button for continuous acquisition,
Halcon It will continuously display the image was captured.
187
Figure7.6 Halcon Displayed in the camera settings
window
188
7.8:
189
Figure 7.9 Code is automatically generated HDevelop
Next, the code is shown in Figure 7.9 is converted to C / C ++, VB, Delphi, C #
project. Click "File" menu, select "Export", as shown in Figure 7.10.
And then in the Export dialog box pops up, set up, as shown in Figure 7.11, the
drop-down list, select the type of language that you want to export, then "Export"
button. After the export is complete, you can set up in your path, find the project file
corresponding to the language, the compiler can directly open the run.
191
Figure 7.12 Modify camera name
192
8 The LABVIEW Development Guidance
In Labview by NI MAX can we provide the tools and routines based DLL calls
two ways for development.
1. First, connect the camera and then run after NI MAX. Can under "Devices
and Interfaces" of NI-IMAQdx Devices, find our camera, as shown in
Figure8.1. Double-click, you can get a preview of the camera as shown in
Figure8.2 (after Figure8.2 need to click the Grab button above to preview).
2. In Figure 8.2, the resolution can be switched.
3. 3. Click the Camera Attributers Figure8.2 label, the camera can be set other
parameters. As shown in Figure8.3. Under this interface, due to the
agreement that only allows you to set some parameters of the camera, set
other parameters, you can through our demo software, adjusted, preserved
(camera parameters can be saved into a file, no matter which you use ways
to develop the parameter file can be loaded automatically valid), then NI
MAX open, the same effect.
193
Figure 8.2 Preview Interface
194
Parameters Figure 8.3 NI MAX configuration in the camera
195
4. The parameters of the camera supports saving and loading (file mode).
Modify good camera parameter file, this routine can also be loaded by
other software, enter the code to reduce the manual workload.
196
Figure 8.4 Modify camera nickname
197
9 When integrated the camera installation files
released
When you integrate our camera, the camera when you need to be packaged and
released the SDK documentation, you can follow the following ways:
2, release mode. You can choose to publish the following three ways.
ctly,
MindVision Platform setup (version number) .exe, but the package
will contain company information.
use the tools we provide. In the Setup folder, we offer a program
called "Installer.exe" program, whose role is all the files SDK and
Drivers directory for installation. The SDK, Drivers, Setup folder
copied to the target machine, and then run the Setup folder in the
"Installer.exe" to automatically complete the installation, as shown
in Figure (MVDCP.exe and Measure.exe we provide presentation
software and measurement software, you can not publish, after
running Installer.exe, MVDCP and measure software can properly
run):
198
manually or write your own installer. First, copy the Drivers
directory to the target machine and then manually install the kernel
device driver (USB camera when the camera into the computer, you
will be prompted to install the driver, select the appropriate INF file
directory under Drivers can, Gige cameras need to manually run
Drivers \ Gige under MvDriverInstall.exe program can complete the
installation of the kernel driver); and the SDK (if it is X64 systems,
copy the SDK / X64) folder of all files (Note: the folder of files, not
folders) to any directory of the target machine (assuming C: \ TEST
directory), then you are a good secondary development of
executable files into the C: \ TEST directory, you can run directly,
without having to enter another installation.
199
10 Technical Support
You have any questions about the use and development process, please contact
our technical support as soon as possible. We recommend that you try to
communicate with us by e-mail, fax and other written form, and attach a detailed
description of the issue, the cross-sectional Figure and other information, which will
help us to quickly resolve your problem.
Your success is our success, your satisfaction is our satisfaction. Any
suggestions that you are back on our recognition and encouragement. We look
forward to your feedback, we will strive to do better!
200