Beispiel #1
0
 public Pipeline()
 {
     // TODO: Inject index
     CameraReader    = new CameraReader(2);
     MarkerDetector  = new MarkerDetector();
     QRCodeFinder    = new QRCodeFinder();
     QRCodeReader    = new QRCodeReader();
     CardManager     = new CardManager();
     AugmentedDrawer = new AugmentedDrawer();
 }
Beispiel #2
0
        public Bitmap Step()
        {
            if (original == null)
            {
                return(null);
            }

            sw.Restart();

            var markers     = MarkerDetector.FindMarkers(original);
            var qrPositions = QRCodeFinder.FindQRCodes(markers);
            var qrCodes     = QRCodeReader.ReadQRCodes(original, qrPositions);
            var cards       = CardManager.AddOrMoveCards(qrCodes);
            var processed   = AugmentedDrawer.DrawCardInfos(original, cards);

            sw.Stop();

            if (sw.ElapsedMilliseconds > 0)
            {
                RunsPerSecond = 1000 / sw.ElapsedMilliseconds;
            }

            return(processed);
        }