/// <summary> /// Constructs a new eyes object. /// </summary> /// <param name="visionPreview">A capture element that is placed on a canvas used for capturing what Robbie sees.</param> /// <param name="previewCanvas">A canvas element used for rendering the image preview showing what Robbie sees.</param> public Eyes(CaptureElement visionPreview, Canvas previewCanvas) { Camera.Instance.Initialize(visionPreview); this.previewCanvas = previewCanvas; faceTracking = new FaceTracking(); faceDetection = new FaceDetection(); computerVision = new ComputerVision(); identityInterpolation = new IdentityInterpolation(); visualization = new Vision(); panTilt = new PanTilt(); eyesDisplay = new EyesDisplay(); identityInterpolation.LargestFaceChanged += IdentityInterpolation_LargestFaceChanged; // fire up the continuous tasks of processing video and controlling the servos ThreadPoolTimer.CreatePeriodicTimer(ProcessCurrentVideoFrame_Delegate, TimeSpan.FromMilliseconds(125)); // 8 fps ThreadPoolTimer.CreatePeriodicTimer(UpdatePanTiltPosition_Delegate, TimeSpan.FromMilliseconds(25)); // 40 fps ThreadPoolTimer.CreatePeriodicTimer(Blink_Delegate, TimeSpan.FromMilliseconds(5000)); // 12 fpm }
public PanTiltAdapter(PanTilt target) { _target = target; }