Hikvision industrial camera MV-CE060-10UC use North pointing

Hikvision industrial camera MV-CE060-10UC use North pointing

Hikvision industrial array camera MV-CE060-10UC is a non UVC device. If you want to use this industrial camera for secondary development, you need to use MVS machine vision industrial camera client. Taking Linux system under x86 architecture as an example, and the specific operating system is Ubuntu 20.04, this paper introduces the use method of the industrial camera.

Introduction to equipment parameters

The specific performance parameters of Hikvision industrial area array camera MV-CE060-10UC are as follows:

entryvalue
Sensor typeCMOS, roller shutter
Sensor modelIMX178
pixel size 2.4 µm×2.4 µm
Target size1/1.8"
resolving power3072×2048
Maximum frame rate42.7 fps@3072×2048
dynamic range 71.3 dB
Signal to noise ratio41.3 dB
gain0 dB ~20 dB
time of exposure24 μs ~ 1 sec
Shutter type Support automatic exposure, manual exposure, one touch exposure and Global Reset
Black and white / colorcolour
Pixel formatMono 8/10/12 Bayer RG 8/10/10p/12/12p YUV422Packed,YUV422_YUYV_Packed RGB 8,BGR 8
BinningSupport 1 × 1,2 × two
Down samplingI won't support it
imageSupport horizontal mirroring

Data download

Download of technical data

MVS download of industrial camera (this article uses MVS V2.1.1 Linux as an example)

MVS installation

Transfer MVs_ STD_ GML_ V2. 1.1_ Download 211224.zip to this computer, and decompress it to get aarch64, armhf, i386, x86_64 and other installation packages under different architectures, x86 is selected in this paper_ 64 DEB package, installed with dpkg. If the aarch environment is used, mvs-2.1.1 is used_ aarch64_ 20211224.deb this package

$ unzip MVS_STD_GML_V2.1.1_211224.zip
$ sudo dpkg -i MVS-2.1.1_x86_64_20211224.deb

Wait until the installation is completed. By default, the software is installed to / opt/MVS/

Open the MVS application with the following command

$ /opt/MVS/bin/MVS.sh
# If there is a problem that cannot be opened, try switching to / opt/MVS/bin / directory and try again
$ cd /opt/MVS/bin/
$ ./MVS.sh

Usually, MVS application is used to debug camera parameters when using the camera for the first time, such as exposure time, gain parameters, etc., so that there is no need to reset parameters during secondary development. However, please note that the set parameters will not be saved after the camera is powered off, so the user settings should be saved in time. If you need to automatically select the previous parameters after the next power on, you should set them in the MVS application.

[the external chain image transfer fails. The source station may have an anti-theft chain mechanism. It is recommended to save the image and upload it directly (img-zk92g304-1646493730753) (/ home / hoyin /. Config / typora / typora user images / image-202202212107338. PNG)]

Code North

This paper introduces how to collect images from MV industrial camera and convert them to opencv (this paper takes 3.4.5 as an example) cv::Mat image format for further development.

Before programming, the following should be added to the Compilation Rules (take CMake as an example):

include_directories(/opt/MVS/include/)
link_directories(/opt/MVS/lib/64/)
# If it is used under the aarch architecture, please use link_directories(/opt/MVS/lib/aarch64/)
target_link_libraries(${PROJECT_NAME} 
MvCameraControl)
# Due to the use of OpenCV, the following should also be added:
find_package(OpenCV 3 REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
The use of MV industrial camera follows the following process:

Enumerate devices = > select devices and create handles = > open devices = > register snapshot callback = > start stream fetching = > (callback function logic) = > stop stream fetching = > Close devices = > Destroy handles

After the MVS is installed, it will be able to call the API related to the camera. The common APIs are as follows:

// Header file
#include "MvCameraControl.h"
#include "opencv2/core.hpp"

int deviceIndex = 0;
void *handle = nullptr;
MV_CC_DEVICE_INFO_LIST stDeviceList;
MVCC_INTVALUE stParam;
unsigned char *pData;
cv::Mat curFrame;

// Callback function
void __stdcall ImageCallBackExForBGR8(unsigned char *pData, MV_FRAME_OUT_INFO_EX *pFrameInfo, void *pUser) {
	curCamera->curFrame = cv::Mat(pFrameInfo->nHeight, pFrameInfo->nWidth, CV_8UC3, pData);
}

// Enumerate devices
memset(&stDeviceList, 0, sizeof(MV_CC_DEVICE_INFO_LIST));
MV_CC_EnumDevices(MV_GIGE_DEVICE | MV_USB_DEVICE, &stDeviceList);

if (stDeviceList.nDeviceNum > 0) {
		for (int i = 0; i < stDeviceList.nDeviceNum; ++i) {
			printf("[device %d]:\n", i);
			MV_CC_DEVICE_INFO *pDeviceInfo = stDeviceList.pDeviceInfo[i];
		}
	} else {
		printf("Find No Devices!\n");
	}

// Select the device and create a handle
MV_CC_CreateHandle(&handle, stDeviceList.pDeviceInfo[deviceIndex]);

// open device
MV_CC_OpenDevice(handle);

// Register snapshot callback
MV_CC_RegisterImageCallBackForBGR(handle, ImageCallBackExForBGR8, handle);

// Start taking flow
MV_CC_StartGrabbing(handle);
MV_FRAME_OUT_INFO_EX stImageInfo = {0};
memset(&stImageInfo, 0, sizeof(MV_FRAME_OUT_INFO_EX));
pData = (unsigned char *)malloc(sizeof(unsigned char) * stParam.nCurValue);

// Stop taking flow
MV_CC_StopGrabbing(handle);

// Turn off the device
MV_CC_CloseDevice(handle);

// Destroy handle
MV_CC_DestroyHandle(handle);

The detailed usage method has been uploaded to Gitee and encapsulated. See https://gitee.com/shenhaoyuan/hikrobot-mvcamera

Author: Hoyin

Last edited on: February 21, 2022

Contact author: work_hoyin@163.com

Added by Goose on Sat, 05 Mar 2022 17:38:20 +0200