import sys
import threading
import msvcrt
import cv2
import numpy as np
from ctypes import *
import cv2
import numpy as np
import cv2 as cv
import numpy as np
sys.path.append("../MvImport")
from CameraParams_const import *
from CameraParams_header import *
from MvCameraControl_header import *
from MvCameraControl_class import *
from MvErrorDefine_const import *
from PixelType_const import *
from PixelType_header import *
class AccessToImages():
def FindDevices(self):
device_list = MV_CC_DEVICE_INFO_LIST()
find_device_ret = MvCamera.MV_CC_EnumDevices(MV_USB_DEVICE, device_list)
if find_device_ret == 0:
return device_list
else:
return False
def GetImages(self, show_device_num, device_list):
i = 0
if show_device_num <= device_list.nDeviceNum:
device_info = cast(device_list.pDeviceInfo[int(show_device_num)], POINTER(MV_CC_DEVICE_INFO)).contents
opencv调用海康工业相机
于 2020-09-28 01:14:44 首次发布
本文详细介绍了如何通过OpenCV库在Python环境下连接并控制海康威视的工业相机,包括相机参数设置、图像捕获与显示等关键步骤,为计算机视觉项目提供稳定的数据源。
摘要由CSDN通过智能技术生成