private void InitializeAR(int captureWidth, int captureHeight)
        {
            arDetector = new GrayBufferMarkerDetector();

            // Load the marker pattern. It has 16x16 segments and a width of 80 millimeters
            var markers = new List<Marker>();
            string[] markerNames = config.GetStringArray("MarkerNames", "Names");
            foreach (string markerName in markerNames)
            {
                string markerPatternPath = config.GetString("MarkerPatternPaths", markerName);
                markers.Add(Marker.LoadFromResource(markerPatternPath, 16, 16, 80, markerName));
            }

            // The perspective projection has the near plane at 1 and the far plane at 4000
            arDetector.Initialize(captureWidth, captureHeight, 1, 4000, markers);

            arDetector.Threshold = 150;

            isInitialized = true;
        }
      void PhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
      {
         //  Initialize the Detector
         arDetector = new GrayBufferMarkerDetector();
         // Load the marker pattern. It has 16x16 segments and a width of 80 millimeters
         var marker = Marker.LoadFromResource("data/Marker_SLAR_16x16segments_80width.pat", 16, 16, 80);
         // The perspective projection has the near plane at 1 and the far plane at 4000
         arDetector.Initialize((int)photoCamera.PreviewResolution.Width, (int)photoCamera.PreviewResolution.Height, 1, 4000, marker);

         isInitialized = true;
      }
Beispiel #3
0
        void photoCamera_Initialized(object sender, CameraOperationCompletedEventArgs e)
        {
            // Initialize the Detector
            //This need to be done AFTER the camera is initialized
            arDetector = new GrayBufferMarkerDetector();

            // Setup both markers
            Marker[] markers = GameState.getInstance().getMarkers();

            arDetector.Initialize(System.Convert.ToInt32(photoCamera.PreviewResolution.Width), System.Convert.ToInt32(photoCamera.PreviewResolution.Height), 1, 4000, markers);
            isInitialized = true;
        }