Functions
Image Processing

Display images, save images, and convert pixel format. More...

Functions

MV_CAMCTRL_API int __stdcall MV_CC_SaveImageEx3 (IN void *handle, IN OUT MV_SAVE_IMAGE_PARAM_EX3 *pstSaveParam)
 Convert the original image data to picture and save the images to specific memory. Support setting BMP and JPEG encoding quality. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFileEx (IN void *handle, IN OUT MV_SAVE_IMAGE_TO_FILE_PARAM_EX *pstSaveFileParam)
 Save image to file (extended API 1). More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFileEx2 (IN void *handle, IN MV_CC_IMAGE *pstImage, IN MV_CC_SAVE_IMAGE_PARAM *pSaveImageParam, IN const char *pcImagePath)
 Save image to file (extended API 2). More...
 
MV_CAMCTRL_API int __stdcall MV_CC_RotateImage (IN void *handle, IN OUT MV_CC_ROTATE_IMAGE_PARAM *pstRotateParam)
 Rotate images in MONO8/RGB24/BGR24 format. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_FlipImage (IN void *handle, IN OUT MV_CC_FLIP_IMAGE_PARAM *pstFlipParam)
 Flip images in MONO8/RGB24/BGR24 format. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_ConvertPixelTypeEx (IN void *handle, IN OUT MV_CC_PIXEL_CONVERT_PARAM_EX *pstCvtParam)
 Convert pixel format. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCvtQuality (IN void *handle, IN unsigned int nBayerCvtQuality)
 Set the interpolation method of Bayer format. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SetBayerFilterEnable (IN void *handle, IN bool bFilterEnable)
 Enable or disable the smoothing function of interpolation algorithm. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaValue (IN void *handle, IN float fBayerGammaValue)
 Set the Gamma value after Bayer interpolation. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SetGammaValue (IN void *handle, IN enum MvGvspPixelType enSrcPixelType, IN float fGammaValue)
 Set gamma value of Mono8 / Bayer8/10/12/16 pattern. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaParam (IN void *handle, IN MV_CC_GAMMA_PARAM *pstGammaParam)
 Set Gamma information of Bayer pattern. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParam (IN void *handle, IN MV_CC_CCM_PARAM *pstCCMParam)
 Color correction after Bayer interpolation. The default quantitative scale is 1024. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParamEx (IN void *handle, IN MV_CC_CCM_PARAM_EX *pstCCMParam)
 Enable/disable CCM and set CCM parameters of Bayer pattern. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_ImageContrast (IN void *handle, IN OUT MV_CC_CONTRAST_PARAM *pstContrastParam)
 Adjust image contrast. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_PurpleFringing (IN void *handle, IN MV_CC_PURPLE_FRINGING_PARAM *pstPurpleFringingParam)
 Correct purple fringing of the image. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_HB_Decode (IN void *handle, IN OUT MV_CC_HB_DECODE_PARAM *pstDecodeParam)
 Decode lossless compression stream into raw data. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_DrawRect (IN void *handle, IN MVCC_RECT_INFO *pRectInfo)
 Draw auxiliary rectangle frames on the image. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_StartRecord (IN void *handle, IN MV_CC_RECORD_PARAM *pstRecordParam)
 Start recording. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_InputOneFrame (IN void *handle, IN MV_CC_INPUT_FRAME_INFO *pstInputFrameInfo)
 Input raw data for recording. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_StopRecord (IN void *handle)
 Stop recording. More...
 
MV_CAMCTRL_API int __stdcall MV_CC_ReconstructImage (IN void *handle, IN OUT MV_RECONSTRUCT_IMAGE_PARAM *pstReconstructParam)
 Reconstruct the image (for time-division exposure). More...
 

Detailed Description

Display images, save images, and convert pixel format.

Function Documentation

◆ MV_CC_SaveImageEx3()

MV_CAMCTRL_API int __stdcall MV_CC_SaveImageEx3 ( IN void *  handle,
IN OUT MV_SAVE_IMAGE_PARAM_EX3 pstSaveParam 
)

Convert the original image data to picture and save the images to specific memory. Support setting BMP and JPEG encoding quality.

Parameters
handle[IN] Device handle.
pstSaveParam[IN][OUT] Input and output parameters of image data.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
Once there is image data, you can call this API to convert the data. You can also call MV_CC_GetOneFrameTimeout() or MV_CC_RegisterImageCallBackEx() to get one image frame and set the callback function, and then call this API to convert the format. This API supports setting the length*width parameter to UINT_MAX: for MV_CC_SaveImageEx2(), supports setting the length*width parameter maximum to USHRT_MAX; for JPEG format, the maximum supported width and height parameter is 65500.

◆ MV_CC_SaveImageToFileEx()

MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFileEx ( IN void *  handle,
IN OUT MV_SAVE_IMAGE_TO_FILE_PARAM_EX pstSaveFileParam 
)

Save image to file (extended API 1).

Parameters
handle[IN] Device handle.
pstSaveFileParam[IN][OUT] Structure of image saving parameters.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
 • Supported image format: BMP, JPEG, PNG, and TIFF.
 • This API supports setting the length*width parameter of saved image to UINT_MAX: for MV_CC_SaveImageToFile(), supports setting the length*width parameter maximum to USHRT_MAX; for JPEG format, the maximum supported width and height parameter is 65500.
 • This API is an extension API of MV_CC_SaveImageToFile().

◆ MV_CC_SaveImageToFileEx2()

MV_CAMCTRL_API int __stdcall MV_CC_SaveImageToFileEx2 ( IN void *  handle,
IN MV_CC_IMAGE pstImage,
IN MV_CC_SAVE_IMAGE_PARAM pSaveImageParam,
IN const char *  pcImagePath 
)

Save image to file (extended API 2).

Parameters
handle[IN] Device handle.
pstImage[IN] Image information.
pSaveImageParam[IN] Image saving parameter.
pcImagePath[IN] Image saving path.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
 • Supported image format for saving image no less than 4 GB: BMP, JPEG, PNG, and TIFF.
 • Supported image format for saving image above 4 GB: PNG and TIFF.
 • Maximum supported width and height parameter for JPEG is 65500.
Examples
ImageSave.cpp, and MultiLightCtrl_ImageStitching.cpp.

◆ MV_CC_RotateImage()

MV_CAMCTRL_API int __stdcall MV_CC_RotateImage ( IN void *  handle,
IN OUT MV_CC_ROTATE_IMAGE_PARAM pstRotateParam 
)

Rotate images in MONO8/RGB24/BGR24 format.

Parameters
handle[IN] Device handle.
pstRotateParam[IN][OUT] Structure of image rotation parameters.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
This API only support 90/180/270 rotation of data in the MONO8/RGB24/BGR24 format.

◆ MV_CC_FlipImage()

MV_CAMCTRL_API int __stdcall MV_CC_FlipImage ( IN void *  handle,
IN OUT MV_CC_FLIP_IMAGE_PARAM pstFlipParam 
)

Flip images in MONO8/RGB24/BGR24 format.

Parameters
handle[IN] Device handle.
pstFlipParam[IN][OUT] Image flipping structure.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
This API only support vertical and horizontal flipping.

◆ MV_CC_ConvertPixelTypeEx()

MV_CAMCTRL_API int __stdcall MV_CC_ConvertPixelTypeEx ( IN void *  handle,
IN OUT MV_CC_PIXEL_CONVERT_PARAM_EX pstCvtParam 
)

Convert pixel format.

Parameters
handle[IN] Device handle.
pstCvtParam[IN][OUT] Structure of pixel format conversion parameters.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
  • This API is used to convert the collected original image data to required pixel format and save the converted format to specified memory.
  • There is no calling sequence requirement, and the transformation will be executed when there is any image data. You can first call MV_CC_GetOneFrameTimeout() or MV_CC_RegisterImageCallBackEx() to acquire the image and set callback function, then call this API to convert the format.
  • This API supports setting the length*width parameter of converted image to UINT_MAX.
  • Supported conversion of pixel formats are as the table shown below. The colum 1 is the input pixel formats and the row 1 is the output pixel formats. "√" in the table means the pixel format can be converted, and "×" means the pixel format cannot be converted.
    Input Format \ Output Format Mono8 RGB24 BGR24 YUV422 YV12 YUV422 YUYV
    Mono8 × ×
    Mono10 ×
    Mono10P ×
    Mono12 ×
    Mono12P ×
    BayerGR8 ×
    BayerRG8 ×
    BayerGB8 ×
    BayerBG8 ×
    BayerRBGG8 × × × ×
    BayerGR10 ×
    BayerRG10 ×
    BayerGB10 ×
    BayerBG10 ×
    BayerGR12 ×
    BayerRG12 ×
    BayerGB12 ×
    BayerBG12 ×
    BayerGR10P ×
    BayerRG10P ×
    BayerGB10P ×
    BayerBG10P ×
    BayerGR12P ×
    BayerRG12P ×
    BayerGB12P ×
    BayerBG12P ×
    RGB8P × ×
    BGR8P × ×
    YUV422P × ×
    YUV422 YUYV ×

◆ MV_CC_SetBayerCvtQuality()

MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCvtQuality ( IN void *  handle,
IN unsigned int  nBayerCvtQuality 
)

Set the interpolation method of Bayer format.

Parameters
handle[IN] Device handle.
BayerCvtQuality[IN] Interpolation mode: 0-fast, 1-equilibrated, 2-optimal (default for other values), 3-optimal plus.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
Call this API to set the Bayer interpolation algorithm type parameter for the APIs MV_CC_ConvertPixelTypeEx() , MV_CC_GetImageForRGB() , and MV_CC_GetImageForBGR() .
Examples
ImageProcess.cpp.

◆ MV_CC_SetBayerFilterEnable()

MV_CAMCTRL_API int __stdcall MV_CC_SetBayerFilterEnable ( IN void *  handle,
IN bool  bFilterEnable 
)

Enable or disable the smoothing function of interpolation algorithm.

Parameters
handle[IN] Device handle.
bFilterEnable[IN] Whether to enable the smoothing function of interpolation algorithm (disabled by default).
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
This API is used to enable or disable the smoothing function of Bayer interpolation, which is used in the APIs of MV_CC_ConvertPixelTypeEx() and MV_CC_SaveImageEx3() .

◆ MV_CC_SetBayerGammaValue()

MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaValue ( IN void *  handle,
IN float  fBayerGammaValue 
)

Set the Gamma value after Bayer interpolation.

Parameters
handle[IN] Device handle.
fBayerGammaValue[IN] Gamma value: [0.1,4.0].
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
After setting Gamma value by calling this API, you can call MV_CC_ConvertPixelTypeEx() , MV_CC_SaveImageEx3() , or MV_CC_SaveImageToFile() to convert Bayer 8/10/12/16 format to RGB24/48, BGR24/48, RGBA32/64, or BGRA32/64.

◆ MV_CC_SetGammaValue()

MV_CAMCTRL_API int __stdcall MV_CC_SetGammaValue ( IN void *  handle,
IN enum MvGvspPixelType  enSrcPixelType,
IN float  fGammaValue 
)

Set gamma value of Mono8 / Bayer8/10/12/16 pattern.

Parameters
handle[IN] Device handle.
MvGvspPixelTypeenSrcPixelType [IN] Pixel type. Supports PixelType_Gvsp_Mono8 and Bayer 8/10/12/16.
fGammaValue[IN] Gamma value, range: [0.1,4.0].
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
After setting gamma value of Mono8, the value will take effect after calling MV_CC_ConvertPixelType() to convert Mono8 to Mono8.
After setting gamma value of Bayer8/10/12/16, the value will take effect after calling MV_CC_ConvertPixelType() , MV_CC_SaveImageToFile() , MV_CC_SaveImageEx3() to convert Bayer8/10/12/16 to RGB24/48, RGBA32/64, BGR24/48,BGRA32/64
This API is compatible with MV_CC_SetBayerGammaValue() .

◆ MV_CC_SetBayerGammaParam()

MV_CAMCTRL_API int __stdcall MV_CC_SetBayerGammaParam ( IN void *  handle,
IN MV_CC_GAMMA_PARAM pstGammaParam 
)

Set Gamma information of Bayer pattern.

Parameters
handle[IN] Device handle.
pstGammaParam[IN] Gamma parameters structure.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
The configured gamma parameters take effect when you call API MV_CC_ConvertPixelTypeEx() or MV_CC_SaveImageEx3() to convert the format of Bayer8/10/12/16 into RGB24/48, RGBA32/64, BGR24/48, or BGRA32/64.

◆ MV_CC_SetBayerCCMParam()

MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParam ( IN void *  handle,
IN MV_CC_CCM_PARAM pstCCMParam 
)

Color correction after Bayer interpolation. The default quantitative scale is 1024.

Parameters
handle[IN] Device handle.
pstCCMParam[IN] Color correction parameter structure.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
After calling this API, you can call MV_CC_ConvertPixelTypeEx() or MV_CC_SaveImageEx3() to convert Bayer format to RGB24/BGR24/RGBA32/BGRA32.

◆ MV_CC_SetBayerCCMParamEx()

MV_CAMCTRL_API int __stdcall MV_CC_SetBayerCCMParamEx ( IN void *  handle,
IN MV_CC_CCM_PARAM_EX pstCCMParam 
)

Enable/disable CCM and set CCM parameters of Bayer pattern.

Parameters
handle[IN] Device handle.
pstCCMParam[IN] CCM parameter structure.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
After enabling color correction and setting color correction matrix, the CCM parameters take effect when you call API MV_CC_ConvertPixelTypeEx() or MV_CC_SaveImageEx3() to convert the format of Bayer8/10/12/16 into RGB24/48, RGBA32/64, BGR24/48, or BGRA32/64.

◆ MV_CC_ImageContrast()

MV_CAMCTRL_API int __stdcall MV_CC_ImageContrast ( IN void *  handle,
IN OUT MV_CC_CONTRAST_PARAM pstContrastParam 
)

Adjust image contrast.

Parameters
handle[IN] Device handle.
pstContrastParam[IN][OUT] Contrast parameter structure.
Returns
Return MV_OK for success, and return corresponding error code for failure.

◆ MV_CC_PurpleFringing()

MV_CAMCTRL_API int __stdcall MV_CC_PurpleFringing ( IN void *  handle,
IN MV_CC_PURPLE_FRINGING_PARAM pstPurpleFringingParam 
)

Correct purple fringing of the image.

Parameters
handle[IN] Device handle.
pstPurpleFringingParam[IN][OUT] Purple fringing correction parameter.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Note
This API only supports processing images in RGB and BGR formats.

◆ MV_CC_HB_Decode()

MV_CAMCTRL_API int __stdcall MV_CC_HB_Decode ( IN void *  handle,
IN OUT MV_CC_HB_DECODE_PARAM pstDecodeParam 
)

Decode lossless compression stream into raw data.

Parameters
handle[IN] Device handle.
pstDecodeParam[IN][OUT] Lossless decoding parameter structure.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
 • This API supports decoding the lossless stream of camera to raw data and parsing the watermark of real-time images for the current camera. If the input lossless stream is not real-time or does not belong to the current camera, an exception may occur during watermark parsing;
 • If the decoding failed, check if it is one of the following circumstances:
  1. CPU does not support SSE AVX instructioon set.
  2. Exception occurs on the current frame (e.g., request timeout).
  3. Exception occurs on image generating from camera, even without request timeout.
Examples
HighBandwidthDecode.cpp, ImageSave.cpp, and MultiLightCtrl_ImageStitching.cpp.

◆ MV_CC_DrawRect()

MV_CAMCTRL_API int __stdcall MV_CC_DrawRect ( IN void *  handle,
IN MVCC_RECT_INFO pRectInfo 
)

Draw auxiliary rectangle frames on the image.

Parameters
handle[IN] Device handle.
pRectInfo[IN] Information of auxiliary rectangle frame.
Returns
Return MV_OK for success, and return corresponding error code for failure.

◆ MV_CC_StartRecord()

MV_CAMCTRL_API int __stdcall MV_CC_StartRecord ( IN void *  handle,
IN MV_CC_RECORD_PARAM pstRecordParam 
)

Start recording.

Parameters
handle[IN] Device handle.
pstRecordParam[IN] Recording parameter structure.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
The max. supported width*height range is 8000*8000. If the range is exceeded, the error will occur during API calling of MV_CC_InputOneFrame().

◆ MV_CC_InputOneFrame()

MV_CAMCTRL_API int __stdcall MV_CC_InputOneFrame ( IN void *  handle,
IN MV_CC_INPUT_FRAME_INFO pstInputFrameInfo 
)

Input raw data for recording.

Parameters
handle[IN] Device handle.
pstInputFrameInfo[IN] Record data structure.
Returns
Return MV_OK for success, and return corresponding error code for failure.

◆ MV_CC_StopRecord()

MV_CAMCTRL_API int __stdcall MV_CC_StopRecord ( IN void *  handle)

Stop recording.

Parameters
handle[IN] Device handle.
Returns
Return MV_OK for success, and return corresponding error code for failure.

◆ MV_CC_ReconstructImage()

MV_CAMCTRL_API int __stdcall MV_CC_ReconstructImage ( IN void *  handle,
IN OUT MV_RECONSTRUCT_IMAGE_PARAM pstReconstructParam 
)

Reconstruct the image (for time-division exposure).

Parameters
handle[IN] Device handle.
pstRestruParam[IN][OUT] Image reconstruction parameters.
Returns
Return MV_OK for success, and return corresponding error code for failure.
Remarks
It supports reconstructuring images with different exposure values to one image, used with “MultiLightControl” node of line scan camera..
If MultiLightControl node value is 2, it means 2 images with different exposure values will be reconstructured to one image (with height as the sum of two images).
In the meantime, if this API is called and nExposureNum value is set as 2, the above reconstructured image will be later divided to 2 images with two specified exposure values.
If line scan camera is not used or MultiLightControl node of line scan camera is disabled, and nExposureNum value is ser as n, the image reconstructring does not meet your demand and what you acquired are only n images with 1/n height for each.
Examples
MultiLightCtrl_ImageStitching.cpp.