예제 #1
0
        public CLEyeCamera(CLEyeCameraColorMode colorMode, CLEyeCameraResolution resolution)
        {
            int cameraImageWidth  = 0;
            int cameraImageHeight = 0;

            hwCameraIntPtr = CLEyeCreateCamera(CameraUUID(0), colorMode, resolution, 30);
            if (hwCameraIntPtr == IntPtr.Zero)
            {
                return;
            }

            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_VFLIP, 1);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_EXPOSURE, 0);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_GAIN, 0);

            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_WHITEBALANCE, 0);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_GREEN, 128);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_BLUE, 128);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_RED, 128);

            CLEyeCameraGetFrameDimensions(hwCameraIntPtr, ref cameraImageWidth, ref cameraImageHeight);
            currentImage           = new ImageBuffer(cameraImageWidth, cameraImageHeight, 32, new BlenderBGRA());
            cameraCopyBufferIntPtr = Marshal.AllocHGlobal(cameraImageWidth * cameraImageHeight * 4);
            // create thread exit event
            _exitEvent = new ManualResetEvent(false);
            // start capture here
            ThreadPool.QueueUserWorkItem(Capture);
        }
예제 #2
0
 public CLEyeCameraDevice(CLEyeCameraResolution resolution,
                          CLEyeCameraColorMode colorMode, int fps)
 {
     // set default values
     Framerate  = fps;
     ColorMode  = colorMode;
     Resolution = resolution;
 }
예제 #3
0
        private TColorFormat GetColor(CLEyeCameraColorMode color)
        {
            switch (color)
            {
            case CLEyeCameraColorMode.CLEYE_BAYER_RAW:
                return(TColorFormat.L8);

            case CLEyeCameraColorMode.CLEYE_COLOR_PROCESSED:
                return(TColorFormat.RGBA8);

            case CLEyeCameraColorMode.CLEYE_COLOR_RAW:
                return(TColorFormat.RGBA8);

            case CLEyeCameraColorMode.CLEYE_MONO_PROCESSED:
                return(TColorFormat.L8);

            case CLEyeCameraColorMode.CLEYE_MONO_RAW:
                return(TColorFormat.L8);

            default:
                throw (new Exception("Color mode unsupported"));
            }
        }
예제 #4
0
 public static extern IntPtr CLEyeCreateCamera(Guid camUUID, CLEyeCameraColorMode mode, CLEyeCameraResolution res, float frameRate);
예제 #5
0
 public static extern IntPtr CLEyeCreateCamera(Guid camUUID, CLEyeCameraColorMode mode, CLEyeCameraResolution res, float frameRate);
예제 #6
0
		public CLEyeCameraDevice(CLEyeCameraResolution resolution,
			CLEyeCameraColorMode colorMode, int fps)
		{
			// set default values
			Framerate = fps;
			ColorMode = colorMode;
			Resolution = resolution;
		}
예제 #7
0
        public CLEyeCamera(CLEyeCameraColorMode colorMode, CLEyeCameraResolution resolution)
        {
            int cameraImageWidth = 0;
            int cameraImageHeight = 0;
            
            hwCameraIntPtr = CLEyeCreateCamera(CameraUUID(0), colorMode, resolution, 30);
            if (hwCameraIntPtr == IntPtr.Zero)
            {
                return;
            }

            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_VFLIP, 1);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_EXPOSURE, 0);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_GAIN, 0);

            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_AUTO_WHITEBALANCE, 0);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_GREEN, 128);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_BLUE, 128);
            CLEyeSetCameraParameter(hwCameraIntPtr, CLEyeCameraParameter.CLEYE_WHITEBALANCE_RED, 128);

            CLEyeCameraGetFrameDimensions(hwCameraIntPtr, ref cameraImageWidth, ref cameraImageHeight);
            currentImage = new ImageBuffer(cameraImageWidth, cameraImageHeight, 32, new BlenderBGRA());
            cameraCopyBufferIntPtr = Marshal.AllocHGlobal(cameraImageWidth * cameraImageHeight * 4);
            // create thread exit event
            _exitEvent = new ManualResetEvent(false);
            // start capture here
            ThreadPool.QueueUserWorkItem(Capture);
        }