diff --git a/.gitignore b/.gitignore
index 9cc0607c2..10b56954f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -85,3 +85,7 @@ locai/*
conda/*
conda-out/*
imswitch/ImSwitch/ImSwitch/recordings/*
+pip-wheel-metadata/ImSwitch-1.2.1.dist-info/entry_points.txt
+pip-wheel-metadata/ImSwitch-1.2.1.dist-info/LICENSE
+pip-wheel-metadata/ImSwitch-1.2.1.dist-info/METADATA
+pip-wheel-metadata/ImSwitch-1.2.1.dist-info/top_level.txt
diff --git a/imswitch/imcontrol/controller/controllers/HyphaController.py b/imswitch/imcontrol/controller/controllers/HyphaController.py
index febee379f..bc6e63b6d 100644
--- a/imswitch/imcontrol/controller/controllers/HyphaController.py
+++ b/imswitch/imcontrol/controller/controllers/HyphaController.py
@@ -5,7 +5,7 @@
isNIP = True
except:
isNIP = False
-
+
import argparse
import asyncio
import logging
@@ -70,7 +70,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__logger = initLogger(self)
self.frame = np.zeros((150, 300, 3)).astype('uint8')
-
+
self.asyncio_thread = None
# rtc-related
@@ -79,28 +79,29 @@ def __init__(self, *args, **kwargs):
port = 8080
self.ssl_context = None
-
- # TODO: Create ID based on user input
+
+ # TODO: Create ID based on user input
service_id = "UC2ImSwitch"
server_url = "http://localhost:9000"
server_url = "https://ai.imjoy.io/"
-
+
# grab all necessary hardware elements
self.stages = self._master.positionersManager[self._master.positionersManager.getAllDeviceNames()[0]]
self.lasers = self._master.lasersManager[self._master.lasersManager.getAllDeviceNames()[0]]
- self.ledMatrix = None #self._master.LEDMatrixManager[self._master.ledMatricesManager.getAllDeviceNames()[0]]
-
+ try: self.ledMatrix = self._master.LEDMatrixsManager[self._master.LEDMatrixsManager.getAllDeviceNames()[0]]
+ except: self.ledMatrix = None
+
# get the first detector to stream data
self.detector_names = self._master.detectorsManager.getAllDeviceNames()
self.detector = self._master.detectorsManager[self.detector_names[0]]
-
+
# start the service
self.start_asyncio_thread(server_url, service_id)
-
+
def update(self, detectorName, im, init, isCurrentDetector):
""" Update with new detector frame. """
pass
-
+
def start_asyncio_thread(self, server_url, service_id):
loop = asyncio.get_event_loop()
self.asyncio_thread = AsyncioThread(loop)
@@ -145,7 +146,7 @@ def setLaserActive(self, laserId=0, value=0):
Explanation:
This function allows you to activate or deactivate a laser for fluorescence imaging by setting its enabled state.
- The laser to be controlled is specified by its laserId. By default, if no laserId is provided,
+ The laser to be controlled is specified by its laserId. By default, if no laserId is provided,
the function operates on the laser with ID 0.
The enabled state of the laser is determined by the value parameter. If value is set to 1, the laser is activated,
@@ -154,7 +155,7 @@ def setLaserActive(self, laserId=0, value=0):
Please note that this function does not return any value.
"""
self.lasers[laserId].setEnabled(value)
-
+
def setLaserValue(self, laserId=0, value=0):
"""
Sets the value of a laser.
@@ -175,9 +176,9 @@ def setLaserValue(self, laserId=0, value=0):
the laser system and should be consulted in the system's documentation.
Please note that this function does not return any value.
- """
+ """
self.lasers[laserId].setValue(value)
-
+
def setLEDValue(self, ledId=0, value=0):
"""
Sets the value of an LED in an LED matrix.
@@ -199,7 +200,7 @@ def setLEDValue(self, ledId=0, value=0):
Please note that this function does not return any value.
"""
self.ledMatrix[ledId].setValue(value)
-
+
def getImage(self, path="Default.tif"):
"""
Captures a single microscopic image and saves it to a specified path.
@@ -233,7 +234,7 @@ def getImage(self, path="Default.tif"):
mImage = self.detector.getLatestFrame()
tif.imsave(path,mImage)
return mImage
-
+
def setPosition(self, value, axis, is_absolute=True, is_blocking=True):
"""
Moves the microscope stage in the specified axis by a certain distance.
@@ -250,7 +251,7 @@ def setPosition(self, value, axis, is_absolute=True, is_blocking=True):
Example Use:
# Move the stage 10000 µm in the positive X direction in absolute coordinates and wait for the stage to arrive.
self.setPosition(value=10000, axis="X", is_absolute=True, is_blocking=True)
-
+
# move the stage 10000 µm in the negative Y direction in relative coordinates and return immediately.
self.setPosition(value=-10000, axis="Y", is_absolute=False, is_blocking=False)
@@ -267,7 +268,7 @@ def setPosition(self, value, axis, is_absolute=True, is_blocking=True):
"""
print(f"Moving stage to {value} along {axis}")
self.stages.move(value=value, axis=axis, is_absolute=is_absolute, is_blocking=is_blocking)
-
+
def start_service(self, service_id, server_url="https://ai.imjoy.io/", workspace=None, token=None):
client_id = service_id + "-client"
print(f"Starting service...")
@@ -282,17 +283,12 @@ def start_service(self, service_id, server_url="https://ai.imjoy.io/", workspace
server.register_service(
{
"id": "microscope-control",
- "name": "openUC2 Microscope",
- "description": "The OpenUC2 Microscope Digital Interface grants precise control over an openuc2 microscope,"\
- "featuring essential components like a monochrome camera, laser, LED matrix, focusing stage, and XY stage. "\
- "Standout features include easy manipulation of transparent samples with the XY stage, autofocus for accurate "\
- "long-distance movements, and fluorescence microscopy capabilities with the laser. The LED matrix enhances phase "\
- "contrast, while the monochrome camera captures high-quality grayscale images, facilitating diverse research"\
- "applications. Researchers enjoy unparalleled precision and control over their experiments with this powerful tool.",
+ "name": "openUC2 Microscope",
+ "description": "OpenUC2 Microscope Interface: Precise control over openuc2 microscope.",# Monochrome camera, laser, LED matrix, focusing stage, XY stage. Easy sample manipulation, accurate autofocus, fluorescence microscopy. LED matrix enhances phase contrast. High-quality grayscale imaging. Unparalleled precision.",
"config":{
"visibility": "protected",
"run_in_executor": True,
- "require_context": True,
+ "require_context": True,
},
"type": "microscope",
"move": self.setPosition,
@@ -341,6 +337,9 @@ async def recv(self):
if len(img.shape)<3:
img = np.array((img,img,img))
img = np.transpose(img, (1,2,0))
+ img = img/np.max(img)
+ img = img*255
+ img = np.uint8(img)
#img = np.random.randint(0, 155, (150, 300, 3)).astype('uint8')
else:
img = np.random.randint(0, 155, (150, 300, 3)).astype('uint8')
@@ -366,4 +365,4 @@ async def recv(self):
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
\ No newline at end of file
+# along with this program. If not, see .
diff --git a/imswitch/imcontrol/model/interfaces/hikcamera.py b/imswitch/imcontrol/model/interfaces/hikcamera.py
index a7aa77e6a..bdef17381 100644
--- a/imswitch/imcontrol/model/interfaces/hikcamera.py
+++ b/imswitch/imcontrol/model/interfaces/hikcamera.py
@@ -90,9 +90,9 @@ def _init_cam(self, cameraNo=1, callback_fct=None):
self.camera = MvCamera()
# Select device and create handle
- stDeviceList = cast(deviceList.pDeviceInfo[int(cameraNo)], POINTER(MV_CC_DEVICE_INFO)).contents
-
- ret = self.camera.MV_CC_CreateHandle(stDeviceList)
+ self.stDeviceList = cast(deviceList.pDeviceInfo[int(cameraNo)], POINTER(MV_CC_DEVICE_INFO)).contents
+
+ ret = self.camera.MV_CC_CreateHandle(self.stDeviceList)
if ret != 0:
raise Exception("create handle fail! ret[0x%x]", ret)
@@ -341,30 +341,82 @@ def openPropertiesGUI(self):
def work_thread(self, cam=0, pData=0, nDataSize=0):
if platform == "win32":
- stOutFrame = MV_FRAME_OUT()
- memset(byref(stOutFrame), 0, sizeof(stOutFrame))
- while True:
- ret = cam.MV_CC_GetImageBuffer(stOutFrame, 1000)
- if None != stOutFrame.pBufAddr and 0 == ret:
- #print ("get one frame: Width[%d], Height[%d], nFrameNum[%d]" % (stOutFrame.stFrameInfo.nWidth, stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nFrameNum))
- nRet = cam.MV_CC_FreeImageBuffer(stOutFrame)
-
- pData = (c_ubyte * stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight)()
- cdll.msvcrt.memcpy(byref(pData), stOutFrame.pBufAddr,
- stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight)
- data = np.frombuffer(pData, count=int(stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight),
- dtype=np.uint8)
- self.frame = data.reshape((stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nWidth))
-
- self.SensorHeight, self.SensorWidth = stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nWidth
- self.frame_id = stOutFrame.stFrameInfo.nFrameNum
- self.timestamp = time.time()
- self.frame_buffer.append(self.frame)
- self.frameid_buffer.append(self.frame_id)
- else:
- pass
- if self.g_bExit == True:
- break
+
+ if self.isRGB:
+ stOutFrame = MV_FRAME_OUT()
+ memset(byref(stOutFrame), 0, sizeof(stOutFrame))
+ memset(byref(self.stDeviceList), 0, sizeof(self.stDeviceList))
+
+
+ while True:
+ if self.g_bExit == True:
+ break
+
+ ret = cam.MV_CC_GetImageBuffer(stOutFrame, 1000)
+ if None != stOutFrame.pBufAddr and 0 == ret :
+
+ nRGBSize = stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight * 3
+ stConvertParam = MV_CC_PIXEL_CONVERT_PARAM_EX()
+ memset(byref(stConvertParam), 0, sizeof(stConvertParam))
+ stConvertParam.nWidth = stOutFrame.stFrameInfo.nWidth
+ stConvertParam.nHeight = stOutFrame.stFrameInfo.nHeight
+ stConvertParam.pSrcData = stOutFrame.pBufAddr
+ stConvertParam.nSrcDataLen = stOutFrame.stFrameInfo.nFrameLen
+ stConvertParam.enSrcPixelType = stOutFrame.stFrameInfo.enPixelType
+ stConvertParam.enDstPixelType = PixelType_Gvsp_RGB8_Packed
+ stConvertParam.pDstBuffer = (c_ubyte * nRGBSize)()
+ stConvertParam.nDstBufferSize = nRGBSize
+
+ ret = cam.MV_CC_ConvertPixelTypeEx(stConvertParam)
+ if ret != 0:
+ print ("convert pixel fail! ret[0x%x]" % ret)
+ sys.exit()
+
+ cam.MV_CC_FreeImageBuffer(stOutFrame)
+
+ try:
+ img_buff = (c_ubyte * stConvertParam.nDstLen)()
+ cdll.msvcrt.memcpy(byref(img_buff), stConvertParam.pDstBuffer, stConvertParam.nDstLen)
+
+ data = np.frombuffer(img_buff, count=int(nRGBSize),dtype=np.uint8)
+ self.frame = data.reshape((stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nWidth, -1))
+ self.SensorHeight, self.SensorWidth = stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nWidth
+ self.frame_id = stOutFrame.stFrameInfo.nFrameNum
+ self.timestamp = time.time()
+ self.frame_buffer.append(self.frame)
+ self.frameid_buffer.append(self.frame_id)
+
+ except Exception as e:
+ raise Exception("save file executed failed:%s" % e.message)
+ finally:
+ pass
+
+
+ else:
+ stOutFrame = MV_FRAME_OUT()
+ memset(byref(stOutFrame), 0, sizeof(stOutFrame))
+ while True:
+ ret = cam.MV_CC_GetImageBuffer(stOutFrame, 1000)
+ if None != stOutFrame.pBufAddr and 0 == ret:
+ nRet = cam.MV_CC_FreeImageBuffer(stOutFrame)
+
+ pData = (c_ubyte * stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight)()
+ cdll.msvcrt.memcpy(byref(pData), stOutFrame.pBufAddr,
+ stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight)
+ data = np.frombuffer(pData, count=int(stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight),
+ dtype=np.uint8)
+ self.frame = data.reshape((stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nWidth))
+
+ self.SensorHeight, self.SensorWidth = stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nWidth
+ self.frame_id = stOutFrame.stFrameInfo.nFrameNum
+ self.timestamp = time.time()
+ self.frame_buffer.append(self.frame)
+ self.frameid_buffer.append(self.frame_id)
+ else:
+ pass
+ if self.g_bExit == True:
+ break
+
if platform in ("darwin", "linux2", "linux"):
# en:Get payload size
@@ -424,7 +476,6 @@ def work_thread(self, cam=0, pData=0, nDataSize=0):
else:
img_buff = (c_ubyte * nPayloadSize)()
ret = cam.MV_CC_GetOneFrameTimeout(byref(data_buf), nPayloadSize, stDeviceList, 1000)
- #print("get one frame: Width[%d], Height[%d], nFrameNum[%d]" % (stDeviceList.nWidth, stDeviceList.nHeight, stDeviceList.nFrameNum))
data = np.frombuffer(data_buf, count=int(stDeviceList.nWidth * stDeviceList.nHeight), dtype=np.uint8)
self.frame = data.reshape((stDeviceList.nHeight, stDeviceList.nWidth))
diff --git a/imswitch/imcontrol/model/interfaces/hikrobotWin/CameraParams_const.py b/imswitch/imcontrol/model/interfaces/hikrobotWin/CameraParams_const.py
index c10c9693b..10f3484e4 100644
--- a/imswitch/imcontrol/model/interfaces/hikrobotWin/CameraParams_const.py
+++ b/imswitch/imcontrol/model/interfaces/hikrobotWin/CameraParams_const.py
@@ -61,3 +61,6 @@
MAX_EVENT_NAME_SIZE = 128 # < \~chinese 设备Event事件名称最大长度 \~english Max length of event name
MV_MAX_XML_SYMBOLIC_NUM = 64 # \~chinese 最大XML符号数 \~english Max XML Symbolic Number
+MV_MAX_SYMBOLIC_LEN = 64 # \~chinese 最大枚举条目对应的符号长度 \~english Max Enum Entry Symbolic Number
+
+MV_MAX_SPLIT_NUM = 8 # \~chinese 分时曝光时最多将源图像拆分的个数 \~english The maximum number of source image to be split in time-division exposure
diff --git a/imswitch/imcontrol/model/interfaces/hikrobotWin/CameraParams_header.py b/imswitch/imcontrol/model/interfaces/hikrobotWin/CameraParams_header.py
index df254a698..4648f827c 100644
--- a/imswitch/imcontrol/model/interfaces/hikrobotWin/CameraParams_header.py
+++ b/imswitch/imcontrol/model/interfaces/hikrobotWin/CameraParams_header.py
@@ -2,9 +2,11 @@
# flags '-c -d -v C:\test_h\CameraParams.xml -o CameraParams_header.py'
from ctypes import *
from enum import Enum
+
from imswitch.imcontrol.model.interfaces.hikrobotWin.CameraParams_const import *
from imswitch.imcontrol.model.interfaces.hikrobotWin.PixelType_header import *
+
STRING = c_char_p
MV_PointCloudFile_Undefined = 0 # < \~chinese 未定义的点云格式 \~english Undefined point cloud format
@@ -74,6 +76,27 @@
MV_TRIGGER_SOURCE_LINE2 = 2 # < \~chinese LINE2 触发源 \~english Trigger source line2
MV_TRIGGER_SOURCE_LINE1 = 1 # < \~chinese LINE1 触发源 \~english Trigger source line1
MV_TRIGGER_SOURCE_LINE0 = 0 # < \~chinese LINE0 触发源 \~english Trigger source line0
+SortMethod_SerialNumber = 0 # < \~chinese 按序列号排序 \~english Sorting by SerialNumber
+SortMethod_UserID = 1 # < \~chinese 按用户自定义名字排序 \~english Sorting by UserID
+SortMethod_CurrentIP_ASC = 2 # < \~chinese 按当前IP地址排序(升序) \~english Sorting by current IP(Ascending)
+SortMethod_CurrentIP_DESC = 3 # < \~chinese 按当前IP地址排序(降序) \~english Sorting by current IP(Descending)
+MV_IMAGE_ROTATE_90 = 1 # < \~chinese 旋转90度 \~english Rotate 90 degrees
+MV_IMAGE_ROTATE_180 = 2 # < \~chinese 旋转180度 \~english Rotate 180 degrees
+MV_IMAGE_ROTATE_270 = 3 # < \~chinese 旋转270度 \~english Rotate 270 degrees
+MV_FLIP_VERTICAL = 1 # < \~chinese 垂直翻转 \~english flip vertical
+MV_FLIP_HORIZONTAL = 2 # < \~chinese 旋水平翻转 \~english flip horizontal
+MV_CC_GAMMA_TYPE_NONE = 0 # < \~chinese 不启用 \~english Disable
+MV_CC_GAMMA_TYPE_VALUE = 1 # < \~chinese Gamma值 \~english Gamma value
+MV_CC_GAMMA_TYPE_USER_CURVE = 2 # < \~chinese Gamma曲线 \~english Gamma curve
+MV_CC_GAMMA_TYPE_LRGB2SRGB = 3 # < \~chinese linear RGB to sRGB \~english linear RGB to sRGB
+MV_CC_GAMMA_TYPE_SRGB2LRGB = 4 # < \~chinese sRGB to linear RGB(仅色彩插值时支持,色彩校正时无效) \~english sRGB to linear RGB
+MV_CC_STREAM_EXCEPTION_ABNORMAL_IMAGE = 0x4001 # < \~chinese 异常的图像,该帧被丢弃 \~english abnormal image,the frame is discarded
+MV_CC_STREAM_EXCEPTION_LIST_OVERFLOW = 0x4002 # < \~chinese 缓存列表溢出,清除最旧的一帧 \~english Cache list overflow, clear the oldest frame
+MV_CC_STREAM_EXCEPTION_LIST_EMPTY = 0x4003 # < \~chinese 缓存列表为空,该帧被丢弃 \~english Cache list is empty,the frame is discarded
+MV_CC_STREAM_EXCEPTION_RECONNECTION = 0x4004 # < \~chinese 断流恢复 \~english reconnect
+MV_CC_STREAM_EXCEPTION_DISCONNECTED = 0x4005 # < \~chinese 断流,恢复失败,取流被中止 \~english reconnect fail, stream is terminated
+MV_CC_STREAM_EXCEPTION_DEVICE = 0x4006 # < \~chinese 设备异常,取流被中止 \~english device exception
+MV_SPLIT_BY_LINE = 1 #< \~chinese 源图像按行拆分成多张图像 \~english Source image split into multiple images by line
int8_t = c_int8
int16_t = c_int16
int32_t = c_int32
@@ -267,8 +290,10 @@ class N22_MV_FRAME_OUT_INFO_EX_3DOT_1E(Union):
('nAligning', int64_t), # < \~chinese 校准字段 \~english Aligning
]
_MV_FRAME_OUT_INFO_EX_._fields_ = [
- ('nWidth', c_ushort), # < \~chinese 图像宽 \~english Image Width
- ('nHeight', c_ushort), # < \~chinese 图像高 \~english Image Height
+ ('nWidth', c_ushort),
+ # < \~chinese 图像宽(最大65535,超出请用nExtendWidth) \~english Image Width (over 65535, use nExtendWidth)
+ ('nHeight', c_ushort),
+ # < \~chinese 图像高(最大65535,超出请用nExtendHeight) \~english Image Height(over 65535, use nExtendHeight)
('enPixelType', MvGvspPixelType), # < \~chinese 像素格式 \~english Pixel Type
('nFrameNum', c_uint), # < \~chinese 帧号 \~english Frame Number
('nDevTimeStampHigh', c_uint), # < \~chinese 时间戳高32位 \~english Timestamp high 32 bits
@@ -301,10 +326,25 @@ class N22_MV_FRAME_OUT_INFO_EX_3DOT_1E(Union):
('nLostPacket', c_uint), # < \~chinese 本帧丢包数 \~english Lost Pacekt Number In This Frame
('nUnparsedChunkNum', c_uint), # < \~chinese 未解析的Chunkdata个数 \~english Unparsed chunk number
('UnparsedChunkList', N22_MV_FRAME_OUT_INFO_EX_3DOT_1E), # < \~chinese 数据库链表 \~english Unparsed chunk list
- ('nReserved', c_uint * 36), # < \~chinese 保留字节 \~english Reserved bytes
+ ('nExtendWidth', c_uint), # < \~chinese 图像宽(扩展变量) \~english Image Width
+ ('nExtendHeight', c_uint), # < \~chinese 图像高(扩展变量) \~english Image Height
+ ('nReserved', c_uint * 34), # < \~chinese 保留字节 \~english Reserved bytes
]
MV_FRAME_OUT_INFO_EX = _MV_FRAME_OUT_INFO_EX_
+# \~chinese 显示帧信息 \~english Display frame information
+class _MV_DISPLAY_FRAME_INFO_EX_(Structure):
+ pass
+_MV_DISPLAY_FRAME_INFO_EX_._fields_ = [
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('enPixelType', MvGvspPixelType), # < \~chinese 像素格式 \~english Pixel Type
+ ('pImageBuf', POINTER(c_ubyte)), # < \~chinese 输入图像缓存 \~english Input image buffer
+ ('nImageBufLen', c_uint), # < \~chinese 输入图像长度 \~english Input image length
+ ('nRes', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_DISPLAY_FRAME_INFO_EX = _MV_DISPLAY_FRAME_INFO_EX_
+
# 图像结构体,输出图像指针地址及图像信息 \~english Image Struct, output the pointer of Image and the information of the specific image
class _MV_FRAME_OUT_(Structure):
pass
@@ -423,6 +463,26 @@ class _MV_SAVE_IMAGE_PARAM_T_EX_(Structure):
]
MV_SAVE_IMAGE_PARAM_EX = _MV_SAVE_IMAGE_PARAM_T_EX_
+class _MV_SAVE_IMAGE_PARAM_EX3_(Structure):
+ pass
+_MV_SAVE_IMAGE_PARAM_EX3_._fields_ = [
+ ('pData', POINTER(c_ubyte)), # < \~chinese 输入数据缓存 \~english Input Data Buffer
+ ('nDataLen', c_uint), # < \~chinese 输入数据大小 \~english Input Data Size
+ ('enPixelType', MvGvspPixelType), # < \~chinese 输入数据的像素格式 \~english Input Data Pixel Format
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('pImageBuffer', POINTER(c_ubyte)), # < \~chinese 输出图片缓存 \~english Output Image Buffer
+ ('nImageLen', c_uint), # < \~chinese 输出图片大小 \~english Output Image Size
+ ('nBufferSize', c_uint), # < \~chinese 提供的输出缓冲区大小 \~english Output buffer size provided
+ ('enImageType', MV_SAVE_IAMGE_TYPE), # < \~chinese 输出图片格式 \~english Output Image Format
+ ('nJpgQuality', c_uint), # < \~chinese 编码质量, (50-99] \~english Encoding quality, (50-99]
+ # < \~chinese Bayer格式转为RGB24的插值方法 0-最近邻 1-双线性 2-Hamilton (如果传入其它值则默认为最近邻)
+ # < \~english Interpolation method of convert Bayer to RGB24 0-nearest neighbour 1-bilinearity 2-Hamilton
+ ('iMethodValue', c_uint),
+ ('nReserved', c_uint * 3), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_SAVE_IMAGE_PARAM_EX3 = _MV_SAVE_IMAGE_PARAM_EX3_
+
# \~chinese 保存BMP、JPEG、PNG、TIFF图片文件的参数 \~english Save BMP、JPEG、PNG、TIFF image file parameters
class _MV_SAVE_IMG_TO_FILE_PARAM_(Structure):
pass
@@ -442,10 +502,32 @@ class _MV_SAVE_IMG_TO_FILE_PARAM_(Structure):
]
MV_SAVE_IMG_TO_FILE_PARAM = _MV_SAVE_IMG_TO_FILE_PARAM_
+class _MV_SAVE_IMAGE_TO_FILE_PARAM_EX_(Structure):
+ pass
+_MV_SAVE_IMAGE_TO_FILE_PARAM_EX_._fields_ = [
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('enPixelType', MvGvspPixelType),
+ # < \~chinese 输入数据的像素格式 \~english The pixel format of the input data
+ ('pData', POINTER(c_ubyte)), # < \~chinese 输入数据缓存 \~english Input Data Buffer
+ ('nDataLen', c_uint), # < \~chinese 输入数据大小 \~english Input Data Size
+
+ ('enImageType', MV_SAVE_IAMGE_TYPE),
+ # < \~chinese 输入图片格式 \~english Input Image Format
+ ('pcImagePath', POINTER(c_char)), # < \~chinese 输入文件路径 \~english Input file path
+ ('nQuality', c_uint),
+ # < \~chinese JPG编码质量(50-99],PNG编码质量[0-9] \~english JPG Encoding quality(50-99],PNG Encoding quality[0-9]
+ # < \~chinese ch:Bayer格式转为RGB24的插值方法 0-最近邻 1-双线性 2-Hamilton
+ # < \~english en:Interpolation method of convert Bayer to RGB24 0-nearest neighbour 1-bilinearity 2-Hamilton
+ ('iMethodValue', c_int),
+ ('nReserved', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_SAVE_IMAGE_TO_FILE_PARAM_EX = _MV_SAVE_IMAGE_TO_FILE_PARAM_EX_
+
# \~chinese 图像转换结构体 \~english Pixel convert structure
-class _MV_PIXEL_CONVERT_PARAM_T_(Structure):
+class _MV_CC_PIXEL_CONVERT_PARAM_T_(Structure):
pass
-_MV_PIXEL_CONVERT_PARAM_T_._fields_ = [
+_MV_CC_PIXEL_CONVERT_PARAM_T_._fields_ = [
('nWidth', c_ushort), # < \~chinese 图像宽 \~english Image Width
('nHeight', c_ushort), # < \~chinese 图像高 \~english Image Height
('enSrcPixelType', MvGvspPixelType), # < \~chinese 源像素格式 \~english Source pixel format
@@ -457,7 +539,23 @@ class _MV_PIXEL_CONVERT_PARAM_T_(Structure):
('nDstBufferSize', c_uint), # < \~chinese 提供的输出缓冲区大小 \~english Provided outbut buffer size
('nRes', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
]
-MV_CC_PIXEL_CONVERT_PARAM = _MV_PIXEL_CONVERT_PARAM_T_
+MV_CC_PIXEL_CONVERT_PARAM = _MV_CC_PIXEL_CONVERT_PARAM_T_
+
+class _MV_PIXEL_CONVERT_PARAM_EX_T_(Structure):
+ pass
+_MV_PIXEL_CONVERT_PARAM_EX_T_._fields_ = [
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('enSrcPixelType', MvGvspPixelType), # < \~chinese 源像素格式 \~english Source pixel format
+ ('pSrcData', POINTER(c_ubyte)), # < \~chinese 输入数据缓存 \~english Input data buffer
+ ('nSrcDataLen', c_uint), # < \~chinese 输入数据大小 \~english Input data size
+ ('enDstPixelType', MvGvspPixelType), # < \~chinese 目标像素格式 \~english Destination pixel format
+ ('pDstBuffer', POINTER(c_ubyte)), # < \~chinese 输出数据缓存 \~english Output data buffer
+ ('nDstLen', c_uint), # < \~chinese 输出数据大小 \~english Output data size
+ ('nDstBufferSize', c_uint), # < \~chinese 提供的输出缓冲区大小 \~english Provided outbut buffer size
+ ('nRes', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_PIXEL_CONVERT_PARAM_EX = _MV_PIXEL_CONVERT_PARAM_EX_T_
# values for enumeration '_MV_RECORD_FORMAT_TYPE_'
_MV_RECORD_FORMAT_TYPE_ = c_int # enum
@@ -673,6 +771,286 @@ class _MVCC_STRINGVALUE_T(Structure):
]
MVCC_STRINGVALUE = _MVCC_STRINGVALUE_T
+# \~chinese 水印信息 \~english Frame-specific information
+class _MV_CC_FRAME_SPEC_INFO_(Structure):
+ pass
+_MV_CC_FRAME_SPEC_INFO_._fields_ = [
+ # < \~chinese 设备水印时标 \~english Device frame-specific time scale
+ ('nSecondCount', c_uint), # < \~chinese 秒数 \~english The Seconds
+ ('nCycleCount', c_uint), # < \~chinese 周期数 \~english The Count of Cycle
+ ('nCycleOffset', c_uint), # < \~chinese 周期偏移量 \~english The Offset of Cycle
+ ('fGain', c_float), # < \~chinese 增益 \~english Gain
+ ('fExposureTime', c_float), # < \~chinese 曝光时间 \~english Exposure Time
+ ('nAverageBrightness', c_uint), # < \~chinese 平均亮度 \~english Average brightness
+ # < \~chinese 白平衡相关 \~english White balance
+ ('nRed', c_uint), # < \~chinese 红色 \~english Red
+ ('nGreen', c_uint), # < \~chinese 绿色 \~english Green
+ ('nBlue', c_uint), # < \~chinese 蓝色 \~english Blue
+ ('nFrameCounter', c_uint), # < \~chinese 总帧数 \~english Frame Counter
+ ('nTriggerIndex', c_uint), # < \~chinese 触发计数 \~english Trigger Counting
+ ('nInput', c_uint), # < \~chinese 输入 \~english Input
+ ('nOutput', c_uint), # < \~chinese 输出 \~english Output
+ # < \~chinese ROI区域 \~english ROI Region
+ ('nOffsetX', c_ushort), # < \~chinese 水平偏移量 \~english OffsetX
+ ('nOffsetY', c_ushort), # < \~chinese 垂直偏移量 \~english OffsetY
+ ('nFrameWidth', c_ushort), # < \~chinese 水印宽 \~english The Width of Chunk
+ ('nFrameHeight', c_ushort), # < \~chinese 水印高 \~english The Height of Chunk
+ ('nReserved', c_uint * 16), # < \~chinese 预留 \~english Reserved bytes
+]
+MV_CC_FRAME_SPEC_INFO = _MV_CC_FRAME_SPEC_INFO_
+
+# \~chinese 无损解码参数 \~english High Bandwidth decode structure
+class _MV_CC_HB_DECODE_PARAM_T_(Structure):
+ pass
+_MV_CC_HB_DECODE_PARAM_T_._fields_ = [
+ ('pSrcBuf', POINTER(c_ubyte)), # < \~chinese 输入数据缓存 \~english Input data buffer
+ ('nSrcLen', c_uint), # < \~chinese 输入数据大小 \~english Input data size
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('pDstBuf', POINTER(c_ubyte)), # < \~chinese 输出数据缓存 \~english Output data buffer
+ ('nDstBufSize', c_uint), # < \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size
+ ('nDstBufLen', c_uint), # < \~chinese 输出数据大小 \~english Output data size
+ ('enDstPixelType', MvGvspPixelType), # < \~chinese 输出的像素格式 \~english Output pixel format
+ ('stFrameInfo', MV_CC_FRAME_SPEC_INFO), # < \~chinese 水印信息 \~english Frame Spec Info
+ ('nRes', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_HB_DECODE_PARAM = _MV_CC_HB_DECODE_PARAM_T_
+
+# values for enumeration '_MV_SORT_METHOD_'
+_MV_SORT_METHOD_ = c_int # enum
+MV_SORT_METHOD = _MV_SORT_METHOD_
+
+# values for enumeration '_MV_IMG_ROTATION_ANGLE_'
+_MV_IMG_ROTATION_ANGLE_ = c_int # enum
+MV_IMG_ROTATION_ANGLE = _MV_IMG_ROTATION_ANGLE_
+
+# values for enumeration '_MV_IMG_FLIP_TYPE_'
+_MV_IMG_FLIP_TYPE_ = c_int # enum
+MV_IMG_FLIP_TYPE = _MV_IMG_FLIP_TYPE_
+
+# values for enumeration '_MV_CC_GAMMA_TYPE_'
+_MV_CC_GAMMA_TYPE_ = c_int # enum
+MV_CC_GAMMA_TYPE = _MV_CC_GAMMA_TYPE_
+
+# values for enumeration '_MV_CC_STREAM_EXCEPTION_TYPE_'
+_MV_CC_STREAM_EXCEPTION_TYPE_ = c_int # enum
+MV_CC_STREAM_EXCEPTION_TYPE = _MV_CC_STREAM_EXCEPTION_TYPE_
+
+# values for enumeration '_MV_IMAGE_RECONSTRUCTION_METHOD_'
+_MV_IMAGE_RECONSTRUCTION_METHOD_ = c_int # enum
+MV_IMAGE_RECONSTRUCTION_METHOD = _MV_IMAGE_RECONSTRUCTION_METHOD_
+
+# \~chinese 图像旋转结构体 \~english Rotate image structure
+class _MV_CC_ROTATE_IMAGE_PARAM_T_(Structure):
+ pass
+_MV_CC_ROTATE_IMAGE_PARAM_T_._fields_ = [
+ ('enPixelType', MvGvspPixelType), # < \~chinese 像素格式 \~english pixel format
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('pSrcData', POINTER(c_ubyte)), # < \~chinese 输入数据缓存 \~english Input data buffer
+ ('nSrcDataLen', c_uint), # < \~chinese 输入数据大小 \~english Input data length
+ ('pDstBuf', POINTER(c_ubyte)), # < \~chinese 输出数据缓存 \~english Output data buffer
+ ('nDstBufLen', c_uint), # < \~chinese输出数据长度 \~english Output data length
+ ('nDstBufSize', c_uint), # < \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size
+ ('enRotationAngle', MV_IMG_ROTATION_ANGLE), # < \~chinese 旋转角度 \~english Rotation angle
+ ('nRes', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_ROTATE_IMAGE_PARAM = _MV_CC_ROTATE_IMAGE_PARAM_T_
+
+# \~chinese 图像翻转结构体 \~english Flip image structure
+class _MV_CC_FLIP_IMAGE_PARAM_T_(Structure):
+ pass
+_MV_CC_FLIP_IMAGE_PARAM_T_._fields_ = [
+ ('enPixelType', MvGvspPixelType), # < \~chinese 像素格式 \~english pixel format
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('pSrcData', POINTER(c_ubyte)), # < \~chinese 输入数据缓存 \~english Input data buffer
+ ('nSrcDataLen', c_uint), # < \~chinese 输入数据大小 \~english Input data length
+ ('pDstBuf', POINTER(c_ubyte)), # < \~chinese 输出数据缓存 \~english Output data buffer
+ ('nDstBufLen', c_uint), # < \~chinese输出数据长度 \~english Output data length
+ ('nDstBufSize', c_uint), # < \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size
+ ('enFlipType', MV_IMG_FLIP_TYPE), # < \~chinese 翻转类型 \~english Flip type
+ ('nRes', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_FLIP_IMAGE_PARAM = _MV_CC_FLIP_IMAGE_PARAM_T_
+
+# \~chinese Gamma信息结构体 \~english Gamma info structure
+class _MV_CC_GAMMA_PARAM_T_(Structure):
+ pass
+_MV_CC_GAMMA_PARAM_T_._fields_ = [
+ ('enGammaType', MV_CC_GAMMA_TYPE), # < \~chinese Gamma类型 \~english Gamma type
+ ('fGammaValue', c_float), # < \~chinese Gamma值[0.1,4.0] \~english Gamma value[0.1,4.0]
+ ('pGammaCurveBuf', POINTER(c_ubyte)), # < \~chinese Gamma曲线缓存 \~english Gamma curve buffer
+ ('nGammaCurveBufLen', c_uint), # < \~chinese Gamma曲线长度 \~english Gamma curve buffer size
+ ('nRes', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_GAMMA_PARAM = _MV_CC_GAMMA_PARAM_T_
+
+# \~chinese CCM参数 \~english CCM param
+class _MV_CC_CCM_PARAM_T_(Structure):
+ pass
+_MV_CC_CCM_PARAM_T_._fields_ = [
+ ('bCCMEnable', c_bool), # < \~chinese 是否启用CCM \~english CCM enable
+ ('nCCMat', c_int * 9), # < \~chinese CCM矩阵(-8192~8192) \~english Color correction matrix(-8192~8192)
+ ('nRes', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_CCM_PARAM = _MV_CC_CCM_PARAM_T_
+
+# \~chinese CCM参数 \~english CCM param
+class _MV_CC_CCM_PARAM_EX_T_(Structure):
+ pass
+_MV_CC_CCM_PARAM_EX_T_._fields_ = [
+ ('bCCMEnable', c_bool), # < \~chinese 是否启用CCM \~english CCM enable
+ ('nCCMat', c_int * 9), # < \~chinese CCM矩阵(-65536~65536) \~english Color correction matrix(-65536~65536)
+ ('nCCMScale', c_uint),
+ # < \~chinese 量化系数(2的整数幂,最大65536) \~english Quantitative scale(Integer power of 2, <= 65536)
+ ('nRes', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_CCM_PARAM_EX = _MV_CC_CCM_PARAM_EX_T_
+
+# \~chinese 对比度调节结构体 \~english Contrast structure
+class _MV_CC_CONTRAST_PARAM_T_(Structure):
+ pass
+_MV_CC_CONTRAST_PARAM_T_._fields_ = [
+ ('nWidth', c_uint), # < \~chinese 图像宽(最小8) \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高(最小8) \~english Image Height
+ ('pSrcBuf', POINTER(c_ubyte)), # < \~chinese 输入数据缓存 \~english Input data buffer
+ ('nSrcBufLen', c_uint), # < \~chinese 输入数据大小 \~english Input data length
+ ('enPixelType', MvGvspPixelType), # < \~chinese 像素格式 \~english pixel format
+ ('pDstBuf', POINTER(c_ubyte)), # < \~chinese 输出数据缓存 \~english Output data buffer
+ ('nDstBufSize', c_uint), # < \~chinese提供的输出缓冲区大小 \~english Provided output buffer size
+ ('nDstBufLen', c_uint), # < \~chinese 输出数据长度 \~english Output data length
+ ('nContrastFactor', c_uint), # < \~chinese 对比度值,[1,10000] \~english Contrast factor,[1,10000]
+ ('nRes', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_CONTRAST_PARAM_T = _MV_CC_CONTRAST_PARAM_T_
+
+# \~chinese 枚举类型条目 \~english Enumeration Entry
+class _MVCC_ENUMENTRY_T(Structure):
+ pass
+_MVCC_ENUMENTRY_T._fields_ = [
+ ('nValue', c_uint), # < \~chinese 指定值 \~english Value
+ ('chSymbolic', c_char * MV_MAX_SYMBOLIC_LEN), # < \~chinese 指定值对应的符号 \~english Symbolic
+
+ ('nReserved', c_uint * 4), # < \~chinese 预留 \~english Reserved bytes
+]
+MVCC_ENUMENTRY = _MVCC_ENUMENTRY_T
+
+# \~chinese 辅助线颜色 \~english Color of Auxiliary Line
+class _MVCC_COLORF(Structure):
+ pass
+_MVCC_COLORF._fields_ = [
+ ('fR', c_float),
+ # < \~chinese 红色,根据像素颜色的相对深度,范围为[0.0 , 1.0],代表着[0, 255]的颜色深度 \~english Red,Range[0.0, 1.0]
+ ('fG', c_float),
+ # < \~chinese 绿色,根据像素颜色的相对深度,范围为[0.0 , 1.0],代表着[0, 255]的颜色深度 \~english Green,Range[0.0, 1.0]
+ ('fB', c_float),
+ # < \~chinese 蓝色,根据像素颜色的相对深度,范围为[0.0 , 1.0],代表着[0, 255]的颜色深度 \~english Blue,Range[0.0, 1.0]
+ ('fAlpha', c_float),
+ # < \~chinese 透明度,根据像素颜色的相对透明度,范围为[0.0 , 1.0] (此参数功能暂不支持) \~english Alpha,Range[0.0, 1.0](Not Support)
+ ('nReserved', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MVCC_COLORF = _MVCC_COLORF
+
+# \~chinese 自定义点 \~english Point defined
+class _MVCC_POINTF(Structure):
+ pass
+_MVCC_POINTF._fields_ = [
+ ('fX', c_float),
+ # < \~chinese 该点距离图像左边缘距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Left,Range[0.0, 1.0]
+ ('fY', c_float),
+ # < \~chinese 该点距离图像上边缘距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Top,Range[0.0, 1.0]
+ ('nReserved', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MVCC_POINTF = _MVCC_POINTF
+
+# \~chinese 矩形框区域信息 \~english Rect Area Info
+class _MVCC_RECT_INFO(Structure):
+ pass
+_MVCC_RECT_INFO._fields_ = [
+ ('fTop', c_float),
+ # < \~chinese 矩形上边缘距离图像上边缘的距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Top,Range[0, 1.0]
+ ('fBottom', c_float),
+ # < \~chinese 矩形下边缘距离图像下边缘的距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Bottom,Range[0, 1.0]
+ ('fLeft', c_float),
+ # < \~chinese 矩形左边缘距离图像左边缘的距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Left,Range[0, 1.0]
+ ('fRight', c_float),
+ # < \~chinese 矩形右边缘距离图像右边缘的距离,根据图像的相对位置,范围为[0.0 , 1.0] \~english Distance From Right,Range[0, 1.0]
+ ('stColor', MVCC_COLORF), # < \~chinese 辅助线颜色信息 \~english Color of Auxiliary Line
+ ('nLineWidth', c_uint), # < \~chinese 辅助线宽度,宽度只能是1或2 \~english Width of Auxiliary Line, width is 1 or 2
+ ('nReserved', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MVCC_RECT_INFO = _MVCC_RECT_INFO
+
+# \~chinese 圆形框区域信息 \~english Circle Area Info
+class _MVCC_CIRCLE_INFO(Structure):
+ pass
+_MVCC_CIRCLE_INFO._fields_ = [
+ ('stCenterPoint', MVCC_POINTF), # < \~chinese 圆心信息 \~english Circle Point Info
+ ('fR1', c_float),
+ # < \~chinese 宽向半径,根据图像的相对位置[0, 1.0],半径与圆心的位置有关,需保证画出的圆在显示框范围之内,否则报错 \~english Width Radius, Range[0, 1.0]
+ ('fR2', c_float),
+ # < \~chinese高向半径,根据图像的相对位置[0, 1.0],半径与圆心的位置有关,需保证画出的圆在显示框范围之内,否则报错 \~english Height Radius, Range[0, 1.0]
+ ('stColor', MVCC_COLORF), # < \~chinese 辅助线颜色信息 \~english Color of Auxiliary Line
+ ('nLineWidth', c_uint), # < \~chinese 辅助线宽度,宽度只能是1或2 \~english Width of Auxiliary Line, width is 1 or 2
+ ('nReserved', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MVCC_CIRCLE_INFO = _MVCC_CIRCLE_INFO
+
+# \~chinese 线条辅助线信息 \~english Linear Auxiliary Line Info
+class _MVCC_LINES_INFO(Structure):
+ pass
+_MVCC_LINES_INFO._fields_ = [
+ ('stStartPoint', MVCC_POINTF), # < \~chinese 线条辅助线的起始点坐标 \~english The Start Point of Auxiliary Line
+ ('stEndPoint', MVCC_POINTF), # < \~chinese线条辅助线的终点坐标 \~english The End Point of Auxiliary Line
+ ('stColor', MVCC_COLORF), # < \~chinese 辅助线颜色信息 \~english Color of Auxiliary Line
+ ('nLineWidth', c_uint), # < \~chinese 辅助线宽度,宽度只能是1或2 \~english Width of Auxiliary Line, width is 1 or 2
+ ('nReserved', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MVCC_LINES_INFO = _MVCC_LINES_INFO
+
+# \~chinese 图像重构后的图像列表 \~english List of images after image reconstruction
+class _MV_OUTPUT_IMAGE_INFO_(Structure):
+ pass
+_MV_OUTPUT_IMAGE_INFO_._fields_ = [
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('enPixelType', MvGvspPixelType), # < \~chinese 像素格式 \~english pixel format
+ ('pBuf', POINTER(c_ubyte)), # < \~chinese 输出数据缓存 \~english Output data buffer
+ ('nBufLen', c_uint), # < \~chinese 输出数据长度 \~english Output data length
+ ('nBufSize', c_uint), # < \~chinese 提供的输出缓冲区大小 \~english Provided output buffer size
+ ('nRes', c_uint * 8), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_OUTPUT_IMAGE_INFO = _MV_OUTPUT_IMAGE_INFO_
+
+# \~chinese 重构图像参数信息 \~english Restructure image parameters
+class _MV_RECONSTRUCT_IMAGE_PARAM_(Structure):
+ pass
+_MV_RECONSTRUCT_IMAGE_PARAM_._fields_ = [
+ ('nWidth', c_uint), # < \~chinese 图像宽 \~english Image Width
+ ('nHeight', c_uint), # < \~chinese 图像高 \~english Image Height
+ ('enPixelType', MvGvspPixelType), # < \~chinese 像素格式 \~english pixel format
+ ('pSrcData', POINTER(c_ubyte)), # < \~chinese 输入数据缓存 \~english input data buffer
+ ('nSrcDataLen', c_uint), # < \~chinese 输入数据大小 \~english input data size
+ ('nExposureNum', c_uint), # < \~chinese 曝光个数(1-8] \~english Exposure number
+ ('enReconstructMethod', MV_IMAGE_RECONSTRUCTION_METHOD), # < \~chinese 图像重构方式 \~english Image restructuring method
+ ('stDstBufList', MV_OUTPUT_IMAGE_INFO * MV_MAX_SPLIT_NUM), # < \~chinese 输出数据缓存信息 \~english Output data info
+ ('nRes', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_RECONSTRUCT_IMAGE_PARAM = _MV_RECONSTRUCT_IMAGE_PARAM_
+
+# \~chinese 文件存取 \~english File Access
+class _MV_CC_FILE_ACCESS_E(Structure):
+ pass
+_MV_CC_FILE_ACCESS_E._fields_ = [
+ ('pUserFileBuf', POINTER(c_char)), # < \~chinese 用户文件数据 \~english User file data
+ ('pFileBufSize', c_uint), # < \~chinese 用户数据缓存大小 \~english data buffer size
+ ('pFileBufLen', c_uint), # < \~chinese 用户数据缓存长度 \~english data buffer len
+ ('pDevFileName', STRING), # < \~chinese 设备文件名 \~english Device file name
+ ('nReserved', c_uint * 32), # < \~chinese 保留字节 \~english Reserved bytes
+]
+MV_CC_FILE_ACCESS_EX = _MV_CC_FILE_ACCESS_E
+
__all__ = ['_MV_ALL_MATCH_INFO_', 'MV_CC_FILE_ACCESS_PROGRESS',
'N19_MV_CC_DEVICE_INFO_3DOT_0E', 'MV_FRAME_OUT',
'MV_CAM_GAIN_MODE',
@@ -688,7 +1066,7 @@ class _MVCC_STRINGVALUE_T(Structure):
'_MV_ACTION_CMD_RESULT_T',
'AM_RO', 'IFT_IPort', 'uint_least16_t',
'_MV_FRAME_OUT_INFO_EX_', '_MV_TRANSMISSION_TYPE_T',
- 'MV_SAVE_IMAGE_PARAM_EX', 'AM_RW', 'MV_XML_InterfaceType',
+ 'MV_SAVE_IMAGE_PARAM_EX', 'MV_SAVE_IMAGE_PARAM_EX3', 'AM_RW', 'MV_XML_InterfaceType',
'int32_t', '_MV_ACTION_CMD_INFO_T', 'intptr_t',
'uint_least64_t', '_MV_NETTRANS_INFO_',
'_MV_CAM_TRIGGER_MODE_', 'int_least32_t',
@@ -697,7 +1075,7 @@ class _MVCC_STRINGVALUE_T(Structure):
'MV_ACTION_CMD_RESULT_LIST',
'MV_BALANCEWHITE_AUTO_CONTINUOUS',
'_MV_CHUNK_DATA_CONTENT_', 'MV_FormatType_AVI',
- '_MV_PIXEL_CONVERT_PARAM_T_',
+ '_MV_CC_PIXEL_CONVERT_PARAM_T_','_MV_PIXEL_CONVERT_PARAM_EX_T_',
'MV_GENTL_IF_INFO',
'MV_ACQ_MODE_SINGLE',
'MV_TRIGGER_MODE_ON',
@@ -715,7 +1093,7 @@ class _MVCC_STRINGVALUE_T(Structure):
'_MV_GENTL_IF_INFO_', 'MV_EXPOSURE_MODE_TIMED', 'intmax_t',
'int16_t',
'MV_DISPLAY_FRAME_INFO', '_MV_CC_FILE_ACCESS_PROGRESS_T',
- '_MV_GRAB_STRATEGY_', '_MV_SAVE_IMG_TO_FILE_PARAM_',
+ '_MV_GRAB_STRATEGY_', '_MV_SAVE_IMG_TO_FILE_PARAM_', '_MV_SAVE_IMAGE_TO_FILE_PARAM_EX_',
'int_fast64_t',
'MV_XML_AccessMode',
'MV_GAIN_MODE_ONCE', 'IFT_IInteger',
@@ -747,9 +1125,9 @@ class _MVCC_STRINGVALUE_T(Structure):
'MV_TRIGGER_SOURCE_FrequencyConverter',
'MV_TRIGGER_SOURCE_COUNTER0',
'MV_GAIN_MODE_OFF', '_MV_CC_DEVICE_INFO_LIST_',
- 'MV_GIGE_DEVICE_INFO', '_MV_SAVE_IMAGE_PARAM_T_EX_',
+ 'MV_GIGE_DEVICE_INFO', '_MV_SAVE_IMAGE_PARAM_T_EX_', '_MV_SAVE_IMAGE_PARAM_EX3_',
'AM_NA', 'uint_least32_t',
- 'MV_CC_PIXEL_CONVERT_PARAM','AM_NI',
+ 'MV_CC_PIXEL_CONVERT_PARAM', 'MV_CC_PIXEL_CONVERT_PARAM_EX','AM_NI',
'_MVCC_INTVALUE_EX_T', 'uintptr_t', 'MV_Image_Tif',
'MVCC_FLOATVALUE', 'MV_GIGE_TRANSTYPE_CAMERADEFINED',
'_MV_GENTL_IF_INFO_LIST_', 'MV_NETTRANS_INFO',
@@ -788,7 +1166,27 @@ class _MVCC_STRINGVALUE_T(Structure):
'MV_TRIGGER_SOURCE_LINE1',
'uint_fast64_t','_MVCC_INTVALUE_T',
'IFT_ICategory',
- 'MV_SAVE_IMG_TO_FILE_PARAM', '_MV_FRAME_OUT_',
+ 'MV_SAVE_IMG_TO_FILE_PARAM', 'MV_SAVE_IMAGE_TO_FILE_PARAM_EX', '_MV_FRAME_OUT_',
'MV_GAMMA_SELECTOR_USER',
'uint32_t', '_MV_CAM_GAMMA_SELECTOR_', 'MV_ACQ_MODE_MUTLI',
- 'MV_USB3_DEVICE_INFO', '_MV_EVENT_OUT_INFO_']
+ 'MV_USB3_DEVICE_INFO', '_MV_EVENT_OUT_INFO_', 'MV_CC_FRAME_SPEC_INFO', 'MV_CC_HB_DECODE_PARAM',
+ 'MV_SORT_METHOD', '_MV_SORT_METHOD_',
+ 'SortMethod_SerialNumber', 'SortMethod_UserID', 'SortMethod_CurrentIP_ASC', 'SortMethod_CurrentIP_DESC',
+ '_MV_IMG_ROTATION_ANGLE_', 'MV_IMG_ROTATION_ANGLE',
+ 'MV_IMAGE_ROTATE_90', 'MV_IMAGE_ROTATE_180', 'MV_IMAGE_ROTATE_270',
+ '_MV_IMG_FLIP_TYPE_', 'MV_IMG_FLIP_TYPE', 'MV_FLIP_VERTICAL', 'MV_FLIP_HORIZONTAL',
+ '_MV_CC_GAMMA_TYPE_', 'MV_CC_GAMMA_TYPE', 'MV_CC_GAMMA_TYPE_NONE', 'MV_CC_GAMMA_TYPE_VALUE',
+ 'MV_CC_GAMMA_TYPE_USER_CURVE', 'MV_CC_GAMMA_TYPE_LRGB2SRGB', 'MV_CC_GAMMA_TYPE_SRGB2LRGB',
+ 'MV_CC_STREAM_EXCEPTION_TYPE', '_MV_CC_STREAM_EXCEPTION_TYPE_',
+ 'MV_CC_STREAM_EXCEPTION_ABNORMAL_IMAGE', 'MV_CC_STREAM_EXCEPTION_LIST_OVERFLOW',
+ 'MV_CC_STREAM_EXCEPTION_LIST_EMPTY', 'MV_CC_STREAM_EXCEPTION_RECONNECTION',
+ 'MV_CC_STREAM_EXCEPTION_DISCONNECTED', 'MV_CC_STREAM_EXCEPTION_DEVICE',
+ '_MV_IMAGE_RECONSTRUCTION_METHOD_', 'MV_IMAGE_RECONSTRUCTION_METHOD', 'MV_SPLIT_BY_LINE',
+ 'MVCC_COLORF', '_MVCC_COLORF', '_MVCC_POINTF', 'MVCC_POINTF', '_MVCC_RECT_INFO', 'MVCC_RECT_INFO',
+ '_MVCC_CIRCLE_INFO', 'MVCC_CIRCLE_INFO', '_MVCC_LINES_INFO', 'MVCC_LINES_INFO', '_MV_OUTPUT_IMAGE_INFO_',
+ 'MV_OUTPUT_IMAGE_INFO', 'MV_RECONSTRUCT_IMAGE_PARAM', '_MV_RECONSTRUCT_IMAGE_PARAM_',
+ '_MVCC_ENUMENTRY_T', 'MVCC_ENUMENTRY','_MV_CC_CONTRAST_PARAM_T_', 'MV_CC_CONTRAST_PARAM_T',
+ '_MV_CC_CCM_PARAM_EX_T_', 'MV_CC_CCM_PARAM_EX', 'MV_CC_CCM_PARAM', '_MV_CC_CCM_PARAM_T_',
+ 'MV_CC_GAMMA_PARAM', '_MV_CC_GAMMA_PARAM_T_', 'MV_CC_FLIP_IMAGE_PARAM', '_MV_CC_FLIP_IMAGE_PARAM_T_',
+ '_MV_CC_ROTATE_IMAGE_PARAM_T_', 'MV_CC_ROTATE_IMAGE_PARAM', 'MV_CC_FILE_ACCESS_EX', '_MV_CC_FILE_ACCESS_E',
+ '_MV_DISPLAY_FRAME_INFO_EX_', 'MV_DISPLAY_FRAME_INFO_EX']
diff --git a/imswitch/imcontrol/model/interfaces/hikrobotWin/MvCameraControl_class.py b/imswitch/imcontrol/model/interfaces/hikrobotWin/MvCameraControl_class.py
index cf803bfb5..dfa230525 100644
--- a/imswitch/imcontrol/model/interfaces/hikrobotWin/MvCameraControl_class.py
+++ b/imswitch/imcontrol/model/interfaces/hikrobotWin/MvCameraControl_class.py
@@ -10,7 +10,6 @@
from imswitch.imcontrol.model.interfaces.hikrobotWin.CameraParams_const import *
from imswitch.imcontrol.model.interfaces.hikrobotWin.CameraParams_header import *
from imswitch.imcontrol.model.interfaces.hikrobotWin.MvErrorDefine_const import *
-
from sys import platform
if platform == "linux" or platform == "linux2":
# linux
@@ -22,6 +21,8 @@
# Windows...
MvCamCtrldll = WinDLL("C:\Program Files (x86)\Common Files\MVS\Runtime\Win64_x64\MvCameraControl.dll")
+MvCamCtrldll = WinDLL("C:\Program Files (x86)\Common Files\MVS\Runtime\Win64_x64\MvCameraControl.dll")
+
# 用于回调函数传入相机实例
class _MV_PY_OBJECT_(Structure):
pass
@@ -66,7 +67,15 @@ def MV_CC_EnumDevicesEx(nTLayerType, stDevList, strManufacturerName):
MvCamCtrldll.MV_CC_EnumDevicesEx.restype = c_uint
# C原型:int __stdcall MV_CC_EnumDevicesEx(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList, IN const char* strManufacturerName);
return MvCamCtrldll.MV_CC_EnumDevicesEx(c_uint(nTLayerType), byref(stDevList), strManufacturerName.encode('ascii'))
-
+
+ # ch:枚举设备扩展(可指定排序方式枚举、根据厂商名字过滤) | en: Enumerate device according to the specified ordering
+ @staticmethod
+ def MV_CC_EnumDevicesEx2(nTLayerType, stDevList, strManufacturerName, enSortMethod):
+ MvCamCtrldll.MV_CC_EnumDevicesEx2.argtype = (c_uint, c_void_p, c_void_p, c_uint)
+ MvCamCtrldll.MV_CC_EnumDevicesEx2.restype = c_uint
+ # C原型:int __stdcall MV_CC_EnumDevicesEx2(IN unsigned int nTLayerType, IN OUT MV_CC_DEVICE_INFO_LIST* pstDevList, IN const char* strManufacturerName, IN MV_SORT_METHOD enSortMethod);
+ return MvCamCtrldll.MV_CC_EnumDevicesEx2(c_uint(nTLayerType), byref(stDevList), strManufacturerName.encode('ascii'), c_uint(enSortMethod))
+
# ch:设备是否可达 | en:Is the device accessible
@staticmethod
def MV_CC_IsDeviceAccessible(stDevInfo, nAccessMode):
@@ -75,6 +84,13 @@ def MV_CC_IsDeviceAccessible(stDevInfo, nAccessMode):
# C原型:bool __stdcall MV_CC_IsDeviceAccessible(IN MV_CC_DEVICE_INFO* pstDevInfo, IN unsigned int nAccessMode);
return MvCamCtrldll.MV_CC_IsDeviceAccessible(byref(stDevInfo), nAccessMode)
+ #ch: 设置SDK日志路径 | en: Set SDK log path
+ def MV_CC_SetSDKLogPath(self, SDKLogPath):
+ MvCamCtrldll.MV_CC_SetSDKLogPath.argtype = (c_void_p)
+ MvCamCtrldll.MV_CC_SetSDKLogPath.restype = c_uint
+ # C原型:int MV_CC_SetSDKLogPath(IN const char * strSDKLogPath);
+ return MvCamCtrldll.MV_CC_SetSDKLogPath(byref(SDKLogPath))
+
# ch:创建设备句柄 | en:Create Device Handle
def MV_CC_CreateHandle(self, stDevInfo):
MvCamCtrldll.MV_CC_DestroyHandle.argtype = c_void_p
@@ -198,6 +214,13 @@ def MV_CC_ClearImageBuffer(self):
# C原型:int MV_CC_ClearImageBuffer(IN void* handle);
return MvCamCtrldll.MV_CC_ClearImageBuffer(self.handle)
+ #ch:获取当前图像缓存区的有效图像个数 | en: Get the number of valid images in the current image buffer
+ def MV_CC_GetValidImageNum(self, nValidImageNum):
+ MvCamCtrldll.MV_CC_GetValidImageNum.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_GetValidImageNum.restype = c_uint
+ # C原型:int MV_CC_GetValidImageNum(IN void* handle, OUT unsigned int *pnValidImageNum);
+ return MvCamCtrldll.MV_CC_GetValidImageNum(self.handle,c_uint(nValidImageNum))
+
# ch:显示一帧图像 | en:Get a frame of an image using an internal cache(Cannot be used together with the interface of MV_CC_Display)
def MV_CC_DisplayOneFrame(self, stDisplayInfo):
MvCamCtrldll.MV_CC_DisplayOneFrame.argtype = (c_void_p, c_void_p)
@@ -205,6 +228,13 @@ def MV_CC_DisplayOneFrame(self, stDisplayInfo):
# C原型:int MV_CC_DisplayOneFrame(IN void* handle, IN MV_DISPLAY_FRAME_INFO* pstDisplayInfo);
return MvCamCtrldll.MV_CC_DisplayOneFrame(self.handle, byref(stDisplayInfo))
+ # ch:显示一帧图像 | en:Get a frame of an image using an internal cache(Cannot be used together with the interface of MV_CC_Display)
+ def MV_CC_DisplayOneFrameEx(self, hWnd, stDisplayInfo):
+ MvCamCtrldll.MV_CC_DisplayOneFrameEx.argtype = (c_void_p, c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_DisplayOneFrameEx.restype = c_uint
+ # C原型:int MV_CC_DisplayOneFrameEx(IN void* handle, IN void* hWnd, IN MV_DISPLAY_FRAME_INFO_EX* pstDisplayInfo);
+ return MvCamCtrldll.MV_CC_DisplayOneFrameEx(self.handle, hWnd, byref(stDisplayInfo))
+
# ch:设置SDK内部图像缓存节点个数,大于等于1,在抓图前调用 | en:Set the number of the internal image cache nodes in SDK, Greater than or equal to 1, to be called before the capture
def MV_CC_SetImageNodeNum(self, nNum):
MvCamCtrldll.MV_CC_SetImageNodeNum.argtype = (c_void_p, c_uint)
@@ -282,7 +312,14 @@ def MV_CC_SetEnumValue(self, strKey, nValue):
MvCamCtrldll.MV_CC_SetEnumValue.restype = c_uint
# C原型:int MV_CC_SetEnumValue(void* handle,char* strKey,unsigned int nValue)
return MvCamCtrldll.MV_CC_SetEnumValue(self.handle, strKey.encode('ascii'), c_uint32(nValue))
-
+
+ #ch:获取Enum型节点指定值的符号 | en: Get the symbolic of the specified value of the Enum type node
+ def MV_CC_GetEnumEntrySymbolic(self, strKey, stEnumEntry):
+ MvCamCtrldll.MV_CC_GetEnumEntrySymbolic.argtype = (c_void_p, c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_GetEnumEntrySymbolic.restype = c_uint
+ # C原型:int MV_CC_GetEnumEntrySymbolic(IN void* handle,IN const char* strKey,IN OUT MVCC_ENUMENTRY* pstEnumEntry);
+ return MvCamCtrldll.MV_CC_GetEnumEntrySymbolic(self.handle, strKey.encode('ascii'), byref(stEnumEntry))
+
# ch:设置Enum型属性值 | en:Set Enum value
def MV_CC_SetEnumValueByString(self, strKey, sValue):
MvCamCtrldll.MV_CC_SetEnumValueByString.argtype = (c_void_p, c_void_p, c_void_p)
@@ -345,6 +382,20 @@ def MV_CC_InvalidateNodes(self):
MvCamCtrldll.MV_CC_InvalidateNodes.restype = c_uint
# C原型:int MV_CC_InvalidateNodes(IN void* handle);
return MvCamCtrldll.MV_CC_InvalidateNodes(self.handle)
+
+ #ch:设备本地升级 | en: Device Local Upgrade
+ def MV_CC_LocalUpgrade(self, strFilePathName):
+ MvCamCtrldll.MV_CC_LocalUpgrade.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_LocalUpgrade.restype = c_uint
+ # C原型:int MV_CC_LocalUpgrade(IN void* handle, const void* strFilePathName);
+ return MvCamCtrldll.MV_CC_LocalUpgrade(self.handle, byref(strFilePathName))
+
+ #ch:获取升级进度 | en: Get Upgrade Progress
+ def MV_CC_GetUpgradeProcess(self, nProcess):
+ MvCamCtrldll.MV_CC_GetUpgradeProcess.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_GetUpgradeProcess.restype = c_uint
+ # C原型:int MV_CC_GetUpgradeProcess(IN void* handle, unsigned int* pnProcess);
+ return MvCamCtrldll.MV_CC_GetUpgradeProcess(self.handle, byref(nProcess))
#####寄存器读写 和异常、事件回调#####
# ch:读内存 | en:Read Memory
@@ -382,6 +433,15 @@ def MV_CC_RegisterEventCallBackEx(self, pEventName, EventCallBackFun, pUser):
# C原型:int MV_CC_RegisterEventCallBackEx(void* handle, char* pEventName,void(* cbEvent)(MV_EVENT_OUT_INFO * pEventInfo, void* pUser),void* pUser)
return MvCamCtrldll.MV_CC_RegisterEventCallBackEx(self.handle, pEventName.encode('ascii'), EventCallBackFun, pUser)
+ # ch:设置枚举超时时间,仅支持GigE协议,范围 0-UINT_MAX | en:Set enumerate device timeout,only GigE support
+ # 在调用MV_CC_EnumDevices等枚举接口前使用该接口,可设置枚举GIGE设备的网卡最大超时时间(默认100ms),可以减少最大超时时间,来加快枚举GIGE设备的速度
+ # Before calling enum device interfaces,call MV_GIGE_SetEnumDevTimeout to set max timeout,can reduce the maximum timeout to speed up the enumeration of GigE devices
+ def MV_GIGE_SetEnumDevTimeout(self, nMilTimeout):
+ MvCamCtrldll.MV_GIGE_SetEnumDevTimeout.argtype = (c_uint)
+ MvCamCtrldll.MV_GIGE_SetEnumDevTimeout.restype = c_uint
+ # C原型:int MV_GIGE_SetEnumDevTimeout(IN unsigned int nMilTimeout)
+ return MvCamCtrldll.MV_GIGE_SetEnumDevTimeout(c_uint(nMilTimeout))
+
#####GigEVision 设备独有的接口#####
# ch:强制修改IP | en:Force IP
def MV_GIGE_ForceIpEx(self, nIP, nSubNetMask, nDefaultGateWay):
@@ -411,6 +471,27 @@ def MV_GIGE_GetNetTransInfo(self, pstInfo):
# C原型:int MV_GIGE_GetNetTransInfo(IN void* handle, MV_NETTRANS_INFO* pstInfo);
return MvCamCtrldll.MV_GIGE_GetNetTransInfo(self.handle, byref(pstInfo))
+ #ch:设置枚举命令的回复包类型 | en: Setting the ACK mode of devices Discovery
+ def MV_GIGE_SetDiscoveryMode(self, nMode):
+ MvCamCtrldll.MV_GIGE_SetDiscoveryMode.argtype = (c_uint)
+ MvCamCtrldll.MV_GIGE_SetDiscoveryMode.restype = c_uint
+ # C原型:int MV_GIGE_SetDiscoveryMode(unsigned int nMode);
+ return MvCamCtrldll.MV_GIGE_SetDiscoveryMode(c_uint(nMode))
+
+ # ch:设置GVSP取流超时时间| en: Set GVSP streaming timeout
+ def MV_GIGE_SetGvspTimeout(self, nMillisec):
+ MvCamCtrldll.MV_GIGE_SetGvspTimeout.argtype = (c_void_p, c_uint)
+ MvCamCtrldll.MV_GIGE_SetGvspTimeout.restype = c_uint
+ # C原型:int MV_GIGE_SetGvspTimeout(void* handle, unsigned int nMillisec);
+ return MvCamCtrldll.MV_GIGE_SetGvspTimeout(self.handle, c_uint(nMillisec))
+
+ # ch:获取GVSP取流超时时间 | en: Get GVSP streaming timeout
+ def MV_GIGE_GetGvspTimeout(self, pnMillisec):
+ MvCamCtrldll.MV_GIGE_GetGvspTimeout.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_GIGE_GetGvspTimeout.restype = c_uint
+ # C原型:int MV_GIGE_GetGvspTimeout(IN void* handle, unsigned int* pnMillisec);
+ return MvCamCtrldll.MV_GIGE_GetGvspTimeout(self.handle, byref(pnMillisec))
+
# ch:设置GVCP命令超时时间| en: Set GVCP cammand timeout
def MV_GIGE_SetGvcpTimeout(self, nMillisec):
MvCamCtrldll.MV_GIGE_SetGvcpTimeout.argtype = (c_void_p, c_uint)
@@ -452,7 +533,35 @@ def MV_GIGE_SetResend(self, bEnable,nMaxResendPercent=10,nResendTimeout=50):
MvCamCtrldll.MV_GIGE_SetResend.restype = c_uint
# C原型:int MV_GIGE_SetResend(void* handle, unsigned int bEnable, unsigned int nMaxResendPercent = 10, unsigned int nResendTimeout = 50);
return MvCamCtrldll.MV_GIGE_SetResend(self.handle, c_uint(bEnable), c_uint(nMaxResendPercent),c_uint(nResendTimeout))
-
+
+ #ch:设置重传命令最大尝试次数 | en: set the max resend retry times
+ def MV_GIGE_SetResendMaxRetryTimes(self, nRetryTimes):
+ MvCamCtrldll.MV_GIGE_SetResendMaxRetryTimes.argtype = (c_void_p, c_uint)
+ MvCamCtrldll.MV_GIGE_SetResendMaxRetryTimes.restype = c_uint
+ # C原型:int MV_GIGE_SetResendMaxRetryTimes(void* handle, unsigned int nRetryTimes);
+ return MvCamCtrldll.MV_GIGE_SetResendMaxRetryTimes(self.handle, c_uint(nRetryTimes))
+
+ #ch:获取重传命令最大尝试次数 | en: get the max resend retry times
+ def MV_GIGE_GetResendMaxRetryTimes(self, nRetryTimes):
+ MvCamCtrldll.MV_GIGE_GetResendMaxRetryTimes.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_GIGE_GetResendMaxRetryTimes.restype = c_uint
+ # C原型:int MV_GIGE_GetResendMaxRetryTimes(void* handle, unsigned int* pnRetryTimes);
+ return MvCamCtrldll.MV_GIGE_GetResendMaxRetryTimes(self.handle, byref(nRetryTimes))
+
+ #ch:设置同一重传包多次请求之间的时间间隔 | en: set time interval between same resend requests
+ def MV_GIGE_SetResendTimeInterval(self, nMillisec):
+ MvCamCtrldll.MV_GIGE_SetResendTimeInterval.argtype = (c_void_p, c_uint)
+ MvCamCtrldll.MV_GIGE_SetResendTimeInterval.restype = c_uint
+ # C原型:int MV_GIGE_SetResendTimeInterval(void* handle, unsigned int nMillisec)
+ return MvCamCtrldll.MV_GIGE_SetResendTimeInterval(self.handle, c_uint(nMillisec))
+
+ #ch:获取同一重传包多次请求之间的时间间隔 | en: get time interval between same resend requests
+ def MV_GIGE_GetResendTimeInterval(self, nMillisec):
+ MvCamCtrldll.MV_GIGE_GetResendTimeInterval.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_GIGE_GetResendTimeInterval.restype = c_uint
+ # C原型:int MV_GIGE_GetResendTimeInterval(void* handle, unsigned int* pnMillisec)
+ return MvCamCtrldll.MV_GIGE_GetResendTimeInterval(self.handle, byref(nMillisec))
+
# ch:设置传输模式,可以为单播模式、组播模式等 |en:Set transmission type,Unicast or Multicast
def MV_GIGE_SetTransmissionType(self, stTransmissionType):
MvCamCtrldll.MV_GIGE_SetTransmissionType.argtype = (c_void_p, c_void_p)
@@ -465,14 +574,14 @@ def MV_GIGE_IssueActionCommand(self, pstActionCmdInfo, pstActionCmdResults):
MvCamCtrldll.MV_GIGE_IssueActionCommand.argtype = (c_void_p, c_void_p, c_void_p)
MvCamCtrldll.MV_GIGE_IssueActionCommand.restype = c_uint
# C原型:int MV_GIGE_IssueActionCommand(IN MV_ACTION_CMD_INFO* pstActionCmdInfo, OUT MV_ACTION_CMD_RESULT_LIST* pstActionCmdResults);
- return MvCamCtrldll.MV_GIGE_IssueActionCommand(byref(pstActionCmdInfo, byref(pstActionCmdResults)))
+ return MvCamCtrldll.MV_GIGE_IssueActionCommand(byref(pstActionCmdInfo), byref(pstActionCmdResults))
# ch:获取组播状态 | en:Get Multicast Status
def MV_GIGE_GetMulticastStatus(self, pstDevInfo, pbStatus):
MvCamCtrldll.MV_GIGE_GetMulticastStatus.argtype = (c_void_p, c_void_p, c_void_p)
MvCamCtrldll.MV_GIGE_GetMulticastStatus.restype = c_uint
# C原型:int MV_GIGE_GetMulticastStatus(IN MV_CC_DEVICE_INFO* pstDevInfo, OUT bool* pbStatus);
- return MvCamCtrldll.MV_GIGE_GetMulticastStatus(byref(pstDevInfo, byref(pbStatus)))
+ return MvCamCtrldll.MV_GIGE_GetMulticastStatus(byref(pstDevInfo), byref(pbStatus))
#####CameraLink 设备独有的接口#####
# ch:设置设备波特率| en: Set device bauderate using one of the CL_BAUDRATE_XXXX value
@@ -532,6 +641,34 @@ def MV_USB_GetTransferWays(self, pnTransferWays):
# C原型:int MV_USB_GetTransferWays(IN void* handle, unsigned int* pnTransferWays);
return MvCamCtrldll.MV_USB_GetTransferWays(self.handle, byref(pnTransferWays))
+ #ch:注册流异常消息回调,在打开设备之后调用(只支持U3V相机) | en: Register the stream exception callback, which is called after the device is opened. Only the U3V camera is supported
+ def MV_USB_RegisterStreamExceptionCallBack(self, CallBackFun, pUser):
+ MvCamCtrldll.MV_USB_RegisterStreamExceptionCallBack.argtype = (c_void_p, c_void_p, c_void_p)
+ MvCamCtrldll.MV_USB_RegisterStreamExceptionCallBack.restype = c_uint
+ # C原型:int MV_USB_RegisterStreamExceptionCallBack(void* handle, void(__stdcall* cbException)(MV_CC_STREAM_EXCEPTION_TYPE enExceptionType, void* pUser),void* pUser);
+ return MvCamCtrldll.MV_USB_RegisterStreamExceptionCallBack(self.handle, CallBackFun, pUser)
+
+ #ch:设置U3V的事件缓存节点个数 | en: Set the number of U3V device event cache nodes
+ def MV_USB_SetEventNodeNum(self, nEventNodeNum):
+ MvCamCtrldll.MV_USB_SetEventNodeNum.argtype = (c_void_p, c_uint)
+ MvCamCtrldll.MV_USB_SetEventNodeNum.restype = c_uint
+ # C原型:int MV_USB_SetEventNodeNum(IN void* handle, unsigned int nEventNodeNum)
+ return MvCamCtrldll.MV_USB_SetEventNodeNum(self.handle, c_uint(nEventNodeNum))
+
+ #ch:设置U3V的同步读写超时时间,范围为0 ~ UINT_MAX(最小值包含0,最大值根据操作系统位数决定) | en: Set Sync timeout
+ def MV_USB_SetSyncTimeOut(self, nMills):
+ MvCamCtrldll.MV_USB_SetSyncTimeOut.argtype = (c_void_p, c_uint)
+ MvCamCtrldll.MV_USB_SetSyncTimeOut.restype = c_uint
+ # C原型:int MV_USB_SetSyncTimeOut(IN void* handle, unsigned int nMills);
+ return MvCamCtrldll.MV_USB_SetSyncTimeOut(self.handle, c_uint(nMills))
+
+ #ch:获取U3V相机同步读写超时时间 | en: Get Sync timeout
+ def MV_USB_GetSyncTimeOut(self, nMills):
+ MvCamCtrldll.MV_USB_GetSyncTimeOut.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_USB_GetSyncTimeOut.restype = c_uint
+ # C原型:int MV_USB_GetSyncTimeOut(IN void* handle, unsigned int* pnMills);
+ return MvCamCtrldll.MV_USB_GetSyncTimeOut(self.handle, byref(nMills))
+
#####GenTL相关接口,其它接口可以复用(部分接口不支持)#####
# ch:通过GenTL枚举Interfaces | en:Enumerate Interfaces with GenTL
def MV_CC_EnumInterfacesByGenTL(stIFList, strGenTLPath):
@@ -545,7 +682,14 @@ def MV_CC_EnumDevicesByGenTL(stIFInfo, stDevList):
MvCamCtrldll.MV_CC_EnumDevicesByGenTL.argtype = (c_void_p, c_void_p)
MvCamCtrldll.MV_CC_EnumDevicesByGenTL.restype = c_uint
# C原型:int MV_CC_EnumDevicesByGenTL(IN MV_GENTL_IF_INFO* pstIFInfo, IN OUT MV_GENTL_DEV_INFO_LIST* pstDevList);
- return MvCamCtrldll.MV_CC_EnumDevicesByGenTL((stIFInfo), byref(stDevList))
+ return MvCamCtrldll.MV_CC_EnumDevicesByGenTL(stIFInfo, byref(stDevList))
+
+ #ch:卸载cti库 | en: Unload cti library
+ def MV_CC_UnloadGenTLLibrary(self, GenTLPath):
+ MvCamCtrldll.MV_CC_UnloadGenTLLibrary.argtype = (c_void_p)
+ MvCamCtrldll.MV_CC_UnloadGenTLLibrary.restype = c_uint
+ # C原型:int MV_CC_UnloadGenTLLibrary(IN const char * pGenTLPath);
+ return MvCamCtrldll.MV_CC_UnloadGenTLLibrary(byref(GenTLPath))
# ch:通过GenTL设备信息创建设备句柄 | en:Create Device Handle with GenTL Device Info
def MV_CC_CreateHandleByGenTL(self, stDevInfo):
@@ -587,6 +731,14 @@ def MV_CC_SaveImageEx2(self, stSaveParam):
MvCamCtrldll.MV_CC_SaveImageEx2.restype = c_uint
# C原型:int MV_CC_SaveImageEx2(void* handle, MV_SAVE_IMAGE_PARAM_EX* pSaveParam)
return MvCamCtrldll.MV_CC_SaveImageEx2(self.handle, byref(stSaveParam))
+
+ # ch:保存图片,支持Bmp和Jpeg MV_CC_SaveImageEx3比MV_CC_SaveImageEx2 支持图像大小到Int
+ # en:Save image, support Bmp and Jpeg.this API support the parameter nWidth nHeight to unsigned int.
+ def MV_CC_SaveImageEx3(self, stSaveParam):
+ MvCamCtrldll.MV_CC_SaveImageEx3.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_SaveImageEx3.restype = c_uint
+ # C原型:int MV_CC_SaveImageEx3(IN void* handle, MV_SAVE_IMAGE_PARAM_EX3* pstSaveParam)
+ return MvCamCtrldll.MV_CC_SaveImageEx3(self.handle, byref(stSaveParam))
# ch:保存图像到文件 | en:Save the image file
def MV_CC_SaveImageToFile(self, stSaveFileParam):
@@ -595,19 +747,49 @@ def MV_CC_SaveImageToFile(self, stSaveFileParam):
# C原型:int MV_CC_SaveImageToFile(IN void* handle, MV_SAVE_IMG_TO_FILE_PARAM* pstSaveFileParam);
return MvCamCtrldll.MV_CC_SaveImageToFile(self.handle, byref(stSaveFileParam))
+ # ch:保存图像到文件,支持保存的图像长乘宽乘像素大小至UINT_MAX, 其中MV_CC_SaveImageToFile支持最大至USHRT_MAX
+ # en:Save the image file,Comparing with the API MV_CC_SaveImageToFile, this API support the parameter nWidth * nHeight * pixelsize to UINT_MAX.
+ def MV_CC_SaveImageToFileEx(self, stSaveFileParam):
+ MvCamCtrldll.MV_CC_SaveImageToFileEx.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_SaveImageToFileEx.restype = c_uint
+ # C原型:int MV_CC_SaveImageToFileEx(IN void* handle, MV_SAVE_IMAGE_TO_FILE_PARAM_EX* pstSaveFileParam);
+ return MvCamCtrldll.MV_CC_SaveImageToFileEx(self.handle, byref(stSaveFileParam))
+
# ch:保存3D点云数据,支持PLY、CSV和OBJ三种格式 | en:Save 3D point data, support PLY、CSV and OBJ
def MV_CC_SavePointCloudData(self, stPointDataParam):
MvCamCtrldll.MV_CC_SavePointCloudData.argtype = (c_void_p, c_void_p)
MvCamCtrldll.MV_CC_SavePointCloudData.restype = c_uint
# C原型:int MV_CC_SavePointCloudData(IN void* handle, MV_SAVE_POINT_CLOUD_PARAM* pstPointDataParam);
return MvCamCtrldll.MV_CC_SavePointCloudData(self.handle, byref(stPointDataParam))
-
+
+ #ch:图像旋转 | en: Rotate image
+ def MV_CC_RotateImage(self, stRotateParam):
+ MvCamCtrldll.MV_CC_RotateImage.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_RotateImage.restype = c_uint
+ # C原型:int MV_CC_RotateImage(IN void* handle, IN OUT MV_CC_ROTATE_IMAGE_PARAM* pstRotateParam);
+ return MvCamCtrldll.MV_CC_RotateImage(self.handle, byref(stRotateParam))
+
+ #ch:图像翻转 | en:Flip image
+ def MV_CC_FlipImage(self, stFlipParam):
+ MvCamCtrldll.MV_CC_FlipImage.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_FlipImage.restype = c_uint
+ # C原型:int MV_CC_FlipImage(IN void* handle, IN OUT MV_CC_FLIP_IMAGE_PARAM* pstFlipParam);
+ return MvCamCtrldll.MV_CC_FlipImage(self.handle, byref(stFlipParam))
+
# ch:像素格式转换 | en:Pixel format conversion
def MV_CC_ConvertPixelType(self, stConvertParam):
MvCamCtrldll.MV_CC_ConvertPixelType.argtype = (c_void_p, c_void_p)
MvCamCtrldll.MV_CC_ConvertPixelType.restype = c_uint
# C原型:int MV_CC_ConvertPixelType(void* handle, MV_CC_PIXEL_CONVERT_PARAM* pstCvtParam)
return MvCamCtrldll.MV_CC_ConvertPixelType(self.handle, byref(stConvertParam))
+
+ # ch:像素格式转换,接口支持转换的图像长乘宽乘像素大小至UINT_MAX
+ # en:Pixel format conversion,Comparing with the API MV_CC_ConvertPixelType, this API support the parameter nWidth * nHeight * pixelsize to UINT_MAX.
+ def MV_CC_ConvertPixelTypeEx(self, stConvertParam):
+ MvCamCtrldll.MV_CC_ConvertPixelTypeEx.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_ConvertPixelTypeEx.restype = c_uint
+ # C原型:int MV_CC_ConvertPixelTypeEx(IN void* handle, IN OUT MV_CC_PIXEL_CONVERT_PARAM_EX* pstCvtParam);
+ return MvCamCtrldll.MV_CC_ConvertPixelTypeEx(self.handle, byref(stConvertParam))
# ch:插值算法类型设置 | en:Interpolation algorithm type setting
def MV_CC_SetBayerCvtQuality(self, nBayerCvtQuality):
@@ -615,7 +797,84 @@ def MV_CC_SetBayerCvtQuality(self, nBayerCvtQuality):
MvCamCtrldll.MV_CC_SetBayerCvtQuality.restype = c_uint
# C原型:int MV_CC_SetBayerCvtQuality(IN void* handle, IN unsigned int nBayerCvtQuality);
return MvCamCtrldll.MV_CC_SetBayerCvtQuality(self.handle, c_uint(nBayerCvtQuality))
-
+
+ # ch:插值算法平滑使能设置 | en: Filter type of the bell interpolation quality algorithm setting
+ def MV_CC_SetBayerFilterEnable(self, bFilterEnable):
+ MvCamCtrldll.MV_CC_SetBayerFilterEnable.argtype = (c_void_p, c_bool)
+ MvCamCtrldll.MV_CC_SetBayerFilterEnable.restype = c_uint
+ # C原型:int __stdcall MV_CC_SetBayerFilterEnable(IN void* handle, IN bool bFilterEnable);
+ return MvCamCtrldll.MV_CC_SetBayerFilterEnable(self.handle, c_bool(bFilterEnable))
+
+ #ch:设置Bayer格式的Gamma值 | en: Set Gamma value
+ def MV_CC_SetBayerGammaValue(self, fBayerGammaValue):
+ MvCamCtrldll.MV_CC_SetBayerGammaValue.argtype = (c_void_p, c_float)
+ MvCamCtrldll.MV_CC_SetBayerGammaValue.restype = c_uint
+ # C原型:int __stdcall MV_CC_SetBayerGammaValue(IN void* handle, IN float fBayerGammaValue);
+ return MvCamCtrldll.MV_CC_SetBayerGammaValue(self.handle, c_float(fBayerGammaValue))
+
+ #ch:设置Mono8/bayer格式的Gamma值 | en:Set Gamma value
+ def MV_CC_SetGammaValue(self, enSrcPixelType, fGammaValue):
+ MvCamCtrldll.MV_CC_SetGammaValue.argtype = (c_void_p, c_int, c_float)
+ MvCamCtrldll.MV_CC_SetGammaValue.restype = c_uint
+ # C原型:int MV_CC_SetGammaValue(IN void* handle, enum MvGvspPixelType enSrcPixelType, IN float fGammaValue);
+ return MvCamCtrldll.MV_CC_SetGammaValue(self.handle, c_int(enSrcPixelType), c_float(fGammaValue))
+
+ #ch:设置Bayer格式的Gamma信息 | en: Set Gamma param
+ def MV_CC_SetBayerGammaParam(self, stGammaParam):
+ MvCamCtrldll.MV_CC_SetBayerGammaParam.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_SetBayerGammaParam.restype = c_uint
+ # C原型:int __stdcall MV_CC_SetBayerGammaParam(IN void* handle, IN MV_CC_GAMMA_PARAM* pstGammaParam);
+ return MvCamCtrldll.MV_CC_SetBayerGammaParam(self.handle, byref(stGammaParam))
+
+ #ch:设置Bayer格式的CCM使能和矩阵,量化系数默认1024 | en:Set CCM param,Scale default 1024
+ def MV_CC_SetBayerCCMParam(self, stCCMParam):
+ MvCamCtrldll.MV_CC_SetBayerCCMParam.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_SetBayerCCMParam.restype = c_uint
+ # C原型:int __stdcall MV_CC_SetBayerCCMParam(IN void* handle, IN MV_CC_CCM_PARAM* pstCCMParam);
+ return MvCamCtrldll.MV_CC_SetBayerCCMParam(self.handle, byref(stCCMParam))
+
+ #ch:设置Bayer格式的CCM使能和矩阵 | en:Set CCM param
+ def MV_CC_SetBayerCCMParamEx(self, stCCMParam):
+ MvCamCtrldll.MV_CC_SetBayerCCMParamEx.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_SetBayerCCMParamEx.restype = c_uint
+ # C原型:int __stdcall MV_CC_SetBayerCCMParamEx(IN void* handle, IN MV_CC_CCM_PARAM_EX* pstCCMParam);
+ return MvCamCtrldll.MV_CC_SetBayerCCMParamEx(self.handle, byref(stCCMParam))
+
+ #ch:图像对比度调节 | en:Adjust image contrast
+ def MV_CC_ImageContrast(self, stConstrastParam):
+ MvCamCtrldll.MV_CC_ImageContrast.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_ImageContrast.restype = c_uint
+ # C原型:int __stdcall MV_CC_ImageContrast(IN void* handle, IN OUT MV_CC_CONTRAST_PARAM* pstContrastParam);
+ return MvCamCtrldll.MV_CC_ImageContrast(self.handle, byref(stConstrastParam))
+
+ # ch:无损解码 | en:High Bandwidth Decode
+ def MV_CC_HBDecode(self, stDecodeParam):
+ MvCamCtrldll.MV_CC_HB_Decode.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_HB_Decode.restype = c_uint
+ # C原型:int __stdcall MV_CC_HB_Decode(IN void* handle, IN OUT MV_CC_HB_DECODE_PARAM* pstDecodeParam);
+ return MvCamCtrldll.MV_CC_HB_Decode(self.handle, byref(stDecodeParam))
+
+ # ch:在图像上绘制矩形框辅助线 | en:Draw Rect Auxiliary Line
+ def MV_CC_DrawRect(self, stRectInfo):
+ MvCamCtrldll.MV_CC_DrawRect.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_DrawRect.restype = c_uint
+ # C原型: int __stdcall MV_CC_DrawRect(IN void* handle, IN MVCC_RECT_INFO* pRectInfo);
+ return MvCamCtrldll.MV_CC_DrawRect(self.handle, byref(stRectInfo))
+
+ #ch:在图像上绘制圆形辅助线 | en:Draw Circle Auxiliary Line
+ def MV_CC_DrawCircle(self, stCircleInfo):
+ MvCamCtrldll.MV_CC_DrawCircle.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_DrawCircle.restype = c_uint
+ # C原型: int __stdcall MV_CC_DrawCircle(IN void* handle, IN MVCC_CIRCLE_INFO* pCircleInfo);
+ return MvCamCtrldll.MV_CC_DrawCircle(self.handle, byref(stCircleInfo))
+
+ # ch:在图像上绘制线条 | en:Draw Line Auxiliary Line
+ def MV_CC_DrawLines(self, stLineInfo):
+ MvCamCtrldll.MV_CC_DrawLines.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_DrawLines.restype = c_uint
+ # C原型: int __stdcall MV_CC_DrawLines(IN void* handle, IN MVCC_LINES_INFO* pLinesInfo);
+ return MvCamCtrldll.MV_CC_DrawLines(self.handle, byref(stLineInfo))
+
# ch:保存设备属性 | en:Save camera feature
def MV_CC_FeatureSave(self, strFileName):
MvCamCtrldll.MV_CC_FeatureSave.argtype = (c_void_p, c_void_p)
@@ -637,6 +896,13 @@ def MV_CC_FileAccessRead(self, stFileAccess):
# C原型:int MV_CC_FileAccessRead(void* handle, MV_CC_FILE_ACCESS * pstFileAccess)
return MvCamCtrldll.MV_CC_FileAccessRead(self.handle, byref(stFileAccess))
+ # ch:从设备读取文件,文件是Data数据 | en:Read the file from the camera
+ def MV_CC_FileAccessReadEx(self, stFileAccessEx):
+ MvCamCtrldll.MV_CC_FileAccessReadEx.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_FileAccessReadEx.restype = c_uint
+ # C原型:int MV_CC_FileAccessReadEx(IN void* handle, IN OUT MV_CC_FILE_ACCESS_EX * pstFileAccessEx)
+ return MvCamCtrldll.MV_CC_FileAccessReadEx(self.handle, byref(stFileAccessEx))
+
# ch:将文件写入设备 | en:Write the file to camera
def MV_CC_FileAccessWrite(self, stFileAccess):
MvCamCtrldll.MV_CC_FileAccessWrite.argtype = (c_void_p, c_void_p)
@@ -644,6 +910,13 @@ def MV_CC_FileAccessWrite(self, stFileAccess):
# C原型:int MV_CC_FileAccessWrite(void* handle, MV_CC_FILE_ACCESS * pstFileAccess)
return MvCamCtrldll.MV_CC_FileAccessWrite(self.handle, byref(stFileAccess))
+ # ch:将文件写入设备,参数是文件data | en:Write the file to camera
+ def MV_CC_FileAccessWriteEx(self, stFileAccessEx):
+ MvCamCtrldll.MV_CC_FileAccessWriteEx.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_FileAccessWriteEx.restype = c_uint
+ # C原型:int MV_CC_FileAccessWriteEx(IN void* handle, IN MV_CC_FILE_ACCESS_EX * pstFileAccessEx)
+ return MvCamCtrldll.MV_CC_FileAccessWriteEx(self.handle, byref(stFileAccessEx))
+
# ch:获取文件存取进度 | en:Get File Access Progress
def MV_CC_GetFileAccessProgress(self, stFileAccessProgress):
MvCamCtrldll.MV_CC_GetFileAccessProgress.argtype = (c_void_p, c_void_p)
@@ -671,3 +944,17 @@ def MV_CC_StopRecord(self):
MvCamCtrldll.MV_CC_StopRecord.restype = c_uint
# C原型:int __stdcall MV_CC_StopRecord(IN void* handle);
return MvCamCtrldll.MV_CC_StopRecord(self.handle)
+
+ # ch:打开获取或设置相机参数的GUI界面 | en:Open the GUI interface for getting or setting camera parameters
+ def MV_CC_OpenParamsGUI(self):
+ MvCamCtrldll.MV_CC_OpenParamsGUI.argtype = (c_void_p)
+ MvCamCtrldll.MV_CC_OpenParamsGUI.restype = c_uint
+ # C原型: __stdcall MV_CC_OpenParamsGUI(IN void* handle);
+ return MvCamCtrldll.MV_CC_OpenParamsGUI(self.handle)
+
+ # ch:重构图像(用于分时曝光功能) | en:Reconstruct Image(For time-division exposure function)
+ def MV_CC_ReconstructImage(self, stReconstructParam):
+ MvCamCtrldll.MV_CC_ReconstructImage.argtype = (c_void_p, c_void_p)
+ MvCamCtrldll.MV_CC_ReconstructImage.restype = c_uint
+ # C原型:int __stdcall MV_CC_ReconstructImage(IN void* handle, IN OUT MV_RECONSTRUCT_IMAGE_PARAM* pstReconstructParam);
+ return MvCamCtrldll.MV_CC_ReconstructImage(self.handle, byref(stReconstructParam))
diff --git a/imswitch/imcontrol/model/interfaces/hikrobotWin/PixelType_header.py b/imswitch/imcontrol/model/interfaces/hikrobotWin/PixelType_header.py
index 2ae6011cb..8b1956558 100644
--- a/imswitch/imcontrol/model/interfaces/hikrobotWin/PixelType_header.py
+++ b/imswitch/imcontrol/model/interfaces/hikrobotWin/PixelType_header.py
@@ -86,6 +86,46 @@
PixelType_Gvsp_Coord3D_A32 = -2128596987
PixelType_Gvsp_Mono10 = 17825795
PixelType_Gvsp_BayerRG10_Packed = 17563687
+PixelType_Gvsp_YUV420SP_NV12 = 34373633
+PixelType_Gvsp_YUV420SP_NV21 = 34373634
+PixelType_Gvsp_Coord3D_C16 = 17825976
+PixelType_Gvsp_HB_Mono8 = -2130182143
+PixelType_Gvsp_HB_Mono10 = -2129657853
+PixelType_Gvsp_HB_Mono10_Packed = -2129919996
+PixelType_Gvsp_HB_Mono12 = -2129657851
+PixelType_Gvsp_HB_Mono12_Packed = -2129919994
+PixelType_Gvsp_HB_Mono16 = -2129657849
+PixelType_Gvsp_HB_BayerGR8 = -2130182136
+PixelType_Gvsp_HB_BayerRG8 = -2130182135
+PixelType_Gvsp_HB_BayerGB8 = -2130182134
+PixelType_Gvsp_HB_BayerBG8 = -2130182133
+PixelType_Gvsp_HB_BayerRBGG8 = -2130182074
+PixelType_Gvsp_HB_BayerGR10 = -2129657844
+PixelType_Gvsp_HB_BayerRG10 = -2129657843
+PixelType_Gvsp_HB_BayerGB10 = -2129657842
+PixelType_Gvsp_HB_BayerBG10 = -2129657841
+PixelType_Gvsp_HB_BayerGR12 = -2129657840
+PixelType_Gvsp_HB_BayerRG12 = -2129657839
+PixelType_Gvsp_HB_BayerGB12 = -2129657838
+PixelType_Gvsp_HB_BayerBG12 = -2129657837
+PixelType_Gvsp_HB_BayerGR10_Packed = -2129919962
+PixelType_Gvsp_HB_BayerRG10_Packed = -2129919961
+PixelType_Gvsp_HB_BayerGB10_Packed = -2129919960
+PixelType_Gvsp_HB_BayerBG10_Packed = -2129919959
+PixelType_Gvsp_HB_BayerGR12_Packed = -2129919958
+PixelType_Gvsp_HB_BayerRG12_Packed = -2129919957
+PixelType_Gvsp_HB_BayerGB12_Packed = -2129919956
+PixelType_Gvsp_HB_BayerBG12_Packed = -2129919955
+PixelType_Gvsp_HB_YUV422_Packed = -2112880609
+PixelType_Gvsp_HB_YUV422_YUYV_Packed = -2112880590
+PixelType_Gvsp_HB_RGB8_Packed = -2112356332
+PixelType_Gvsp_HB_BGR8_Packed = -2112356331
+PixelType_Gvsp_HB_RGBA8_Packed = -2111832042
+PixelType_Gvsp_HB_BGRA8_Packed = -2111832041
+PixelType_Gvsp_HB_RGB16_Packed = -2110783437
+PixelType_Gvsp_HB_BGR16_Packed = -2110783413
+PixelType_Gvsp_HB_RGBA16_Packed = -2109734812
+PixelType_Gvsp_HB_BGRA16_Packed = -2109734831
__all__ = ['PixelType_Gvsp_BayerRG8',
'PixelType_Gvsp_YCBCR422_8',
@@ -172,4 +212,44 @@
'PixelType_Gvsp_BayerGB8',
'PixelType_Gvsp_YCBCR8_CBYCR',
'PixelType_Gvsp_RGB565_Packed',
- 'PixelType_Gvsp_YCBCR601_422_8_CBYCRY']
+ 'PixelType_Gvsp_YCBCR601_422_8_CBYCRY',
+ 'PixelType_Gvsp_YUV420SP_NV12',
+ 'PixelType_Gvsp_YUV420SP_NV21',
+ 'PixelType_Gvsp_Coord3D_C16',
+ 'PixelType_Gvsp_HB_Mono8',
+ 'PixelType_Gvsp_HB_Mono10',
+ 'PixelType_Gvsp_HB_Mono10_Packed',
+ 'PixelType_Gvsp_HB_Mono12',
+ 'PixelType_Gvsp_HB_Mono12_Packed',
+ 'PixelType_Gvsp_HB_Mono16',
+ 'PixelType_Gvsp_HB_BayerGR8',
+ 'PixelType_Gvsp_HB_BayerRG8',
+ 'PixelType_Gvsp_HB_BayerGB8',
+ 'PixelType_Gvsp_HB_BayerBG8',
+ 'PixelType_Gvsp_HB_BayerRBGG8',
+ 'PixelType_Gvsp_HB_BayerGR10',
+ 'PixelType_Gvsp_HB_BayerRG10',
+ 'PixelType_Gvsp_HB_BayerGB10',
+ 'PixelType_Gvsp_HB_BayerBG10',
+ 'PixelType_Gvsp_HB_BayerGR12',
+ 'PixelType_Gvsp_HB_BayerRG12',
+ 'PixelType_Gvsp_HB_BayerGB12',
+ 'PixelType_Gvsp_HB_BayerBG12',
+ 'PixelType_Gvsp_HB_BayerGR10_Packed',
+ 'PixelType_Gvsp_HB_BayerRG10_Packed',
+ 'PixelType_Gvsp_HB_BayerGB10_Packed',
+ 'PixelType_Gvsp_HB_BayerBG10_Packed',
+ 'PixelType_Gvsp_HB_BayerGR12_Packed',
+ 'PixelType_Gvsp_HB_BayerRG12_Packed',
+ 'PixelType_Gvsp_HB_BayerGB12_Packed',
+ 'PixelType_Gvsp_HB_BayerBG12_Packed',
+ 'PixelType_Gvsp_HB_YUV422_Packed',
+ 'PixelType_Gvsp_HB_YUV422_YUYV_Packed',
+ 'PixelType_Gvsp_HB_RGB8_Packed',
+ 'PixelType_Gvsp_HB_BGR8_Packed',
+ 'PixelType_Gvsp_HB_RGBA8_Packed',
+ 'PixelType_Gvsp_HB_BGRA8_Packed',
+ 'PixelType_Gvsp_HB_RGB16_Packed',
+ 'PixelType_Gvsp_HB_BGR16_Packed',
+ 'PixelType_Gvsp_HB_RGBA16_Packed',
+ 'PixelType_Gvsp_HB_BGRA16_Packed']