Example #1
0
        /// <summary>
        /// Construct a new SymbolStage
        /// </summary>
        public SymbolStage()
        {
            name           = "Symbol Recognition";
            shortname      = "sym";
            inputFiletype  = ".xml";
            outputFiletype = ".csv"; // comma-separated values; readable by Excel

            _typesSeen       = new HashSet <ShapeType>();
            _confusionMatrix = new Dictionary <ShapeType, Dictionary <ShapeType, int> >();
            _results         = new List <int[]>();
            _pipeline        = new RecognitionPipeline();

            _useRefinement = false;
            _isPure        = true;
            _useLearning   = false;
            _args          = null;

            _recognizer = RecognitionPipeline.createDefaultRecognizer();
        }
Example #2
0
        /// <summary>
        /// Initializes the pipeline after arguments have been processed.
        /// </summary>
        public override void start()
        {
            //_recognizer = Recognizers.AdaptiveImageRecognizer.Load("SubRecognizers\\ImageRecognizer\\AdaptiveImage.air");
            _recognizer = RecognitionPipeline.createDefaultRecognizer();

            if (_isPure)
            {
                Console.WriteLine("Symbol recognition test will be pure");
            }
            else
            {
                Console.WriteLine("Symbol recognition test will be impure");
                _pipeline.addStep(RecognitionPipeline.createDefaultClassifier());
                _pipeline.addStep(RecognitionPipeline.createDefaultGrouper());
            }

            _pipeline.addStep(_recognizer);

            if (_useRefinement)
            {
                Console.WriteLine("Symbol recognition test will use the refiner");
                Connector connector = RecognitionPipeline.createDefaultConnector();
                RecognitionInterfaces.IRecognitionStep refiner = RecognitionPipeline.createDefaultRefiner(connector, _recognizer);
                _pipeline.addStep(connector);
                _pipeline.addStep(refiner);
            }
            else
            {
                Console.WriteLine("Symbol recognition test will NOT use the refiner");
            }

            if (_useLearning)
            {
                Console.WriteLine("Symbol recognition test will train the recognizer as it runs");
            }
            else
            {
                Console.WriteLine("Symbol recognition test will NOT train the recognizer as it runs");
            }
        }