def switch_capturing(self):

        if self.capturing:
            ueye.is_StopLiveVideo(self.hCam, Wait=True)
            self.capturing = False
        else:
            ueye.is_CaptureVideo(self.hCam, Wait=True)
            self.capturing = True
            self.display_image()
示例#2
0
 def stop_video(self):
     return ueye.is_StopLiveVideo(self.h_cam, ueye.IS_FORCE_VIDEO_STOP)
示例#3
0
    #Calibrate camera
    tmp = calib()
    while(count < 5):
        cv2.waitKey(100)
        count+=1
    
    display()
    cv2.waitKey(0)

    (blue_xiyi, blue_angle, green_xiyi, green_angle) = markers_cycle_horizontal()

    if blue_xiyi is None or green_xiyi:
        #Clean-up
        cv2.destroyAllWindows()
        ueye.is_FreeImageMem(hcam, mem_ptr, mem_id)
        ueye.is_StopLiveVideo(hcam, ueye.IS_FORCE_VIDEO_STOP)
        ueye.is_ExitCamera(hcam)
        cmd.event('go_init')
        exit()


    # (..........)
    # (..........)
    # (..........)
    # (..........)
    # (..........)

    #Clean-up
    cv2.destroyAllWindows()
    ueye.is_FreeImageMem(hcam, mem_ptr, mem_id)
    ueye.is_StopLiveVideo(hcam, ueye.IS_FORCE_VIDEO_STOP)
示例#4
0
 def stop_video(self):
     """
     Stop capturing the video.
     """
     return ueye.is_StopLiveVideo(self.h_cam, ueye.IS_FORCE_VIDEO_STOP)
示例#5
0
def ueye_stop_live_video(hcam):
    err = ueye.is_StopLiveVideo(hcam, ueye.IS_WAIT)
    _throw_if_err(hcam, err)
示例#6
0
文件: ids.py 项目: jsalort/pymanip
    async def acquisition_async(
        self,
        num=np.inf,
        timeout=1000,
        raw=False,
        initialising_cams=None,
        raise_on_timeout=True,
    ):
        """Concrete implementation
        """
        loop = asyncio.get_event_loop()

        nRet = ueye.is_CaptureVideo(self.hCam, ueye.IS_DONT_WAIT)
        if nRet != ueye.IS_SUCCESS:
            raise RuntimeError("is_CaptureVideo ERROR")

        try:
            nRet = ueye.is_InquireImageMem(
                self.hCam,
                self.pcImageMemory,
                self.MemID,
                self.width,
                self.height,
                self.nBitsPerPixel,
                self.pitch,
            )
            image_info = ueye.UEYEIMAGEINFO()
            if nRet != ueye.IS_SUCCESS:
                raise RuntimeError("is_InquireImageMem ERROR")

            count = 0
            while count < num:
                nRet = ueye.is_EnableEvent(self.hCam, ueye.IS_SET_EVENT_FRAME)
                if nRet != ueye.IS_SUCCESS:
                    raise RuntimeError("is_EnableEvent ERROR")
                nRet = await loop.run_in_executor(None, ueye.is_WaitEvent,
                                                  self.hCam,
                                                  ueye.IS_SET_EVENT_FRAME,
                                                  timeout)
                if nRet == ueye.IS_TIMED_OUT:
                    if raise_on_timeout:
                        raise RuntimeError("Timeout")
                    else:
                        stop_signal = yield None
                        if stop_signal:
                            break
                        else:
                            continue
                elif nRet != ueye.IS_SUCCESS:
                    raise RuntimeError("is_WaitEvent ERROR")
                array = ueye.get_data(
                    self.pcImageMemory,
                    self.width,
                    self.height,
                    self.nBitsPerPixel,
                    self.pitch,
                    copy=False,
                )

                nRet = ueye.is_GetImageInfo(self.hCam, self.MemID, image_info,
                                            ctypes.sizeof(image_info))
                if nRet != ueye.IS_SUCCESS:
                    raise RuntimeError("is_GetImageInfo ERROR")

                count = count + 1
                ts = datetime(
                    image_info.TimestampSystem.wYear.value,
                    image_info.TimestampSystem.wMonth.value,
                    image_info.TimestampSystem.wDay.value,
                    image_info.TimestampSystem.wHour.value,
                    image_info.TimestampSystem.wMinute.value,
                    image_info.TimestampSystem.wSecond.value,
                    image_info.TimestampSystem.wMilliseconds * 1000,
                )
                stop_signal = yield MetadataArray(
                    array.reshape((self.height.value, self.width.value)),
                    metadata={
                        "counter": count,
                        "timestamp": ts.timestamp()
                    },
                )
                if stop_signal:
                    break

        finally:
            nRet = ueye.is_StopLiveVideo(self.hCam, ueye.IS_DONT_WAIT)
            if nRet != ueye.IS_SUCCESS:
                raise RuntimeError("is_StopLiveVideo ERROR")
            nRet = ueye.is_DisableEvent(self.hCam, ueye.IS_SET_EVENT_FRAME)
            if nRet != ueye.IS_SUCCESS:
                raise RuntimeError("is_DisableEvent ERROR")
        if stop_signal:
            yield True
示例#7
0
 def stopacquire(self):
     ueye.is_StopLiveVideo(self.hcam, ueye.IS_FORCE_VIDEO_STOP)
 def close(self):
     ueye.is_StopLiveVideo(self.vc, ueye.IS_FORCE_VIDEO_STOP)
     ueye.is_ExitCamera(self.vc)
示例#9
0
文件: cueye.py 项目: attokdz/ueye_ioc
	def stopAcq(self):
		if ueye.is_StopLiveVideo(self.hcam, ueye.IS_DONT_WAIT):
			return True
		self.acq=False
		return False
 def closeEvent(self, event):
     self.capturing = False
     ueye.is_DisableEvent(self.hCam, self.frame_event_id)
     ueye.is_ExitEvent(self.hCam, self.frame_event_id)
     if ueye.is_CaptureVideo(self.hCam, ueye.IS_GET_LIVE):
         ueye.is_StopLiveVideo(self.hCam, Wait=True)
示例#11
0
def close_all(hcam):
    ueye.is_StopLiveVideo(hcam, ueye.IS_FORCE_VIDEO_STOP)
    ueye.is_ExitCamera(hcam)
    print('stop video.. exit camera.. close all windows')
示例#12
0
 def StopAq(self):
     self.check_success(ueye.is_StopLiveVideo(self.h, ueye.IS_WAIT))
     self.DestroyBuffers()