Пример #1
0
        /// <summary>
        /// The pipeline for recognizing on the fly
        /// </summary>
        /// <returns></returns>
        public static RecognitionPipeline GetOnFlyPipeline()
        {
            Recognizer recognizer = createDefaultRecognizer();

            RecognitionPipeline result = new RecognitionPipeline();

            result.addStep(createDefaultClassifier());
            result.addStep(createDefaultGrouper());
            result.addStep(recognizer);
            return(result);
        }
Пример #2
0
        /// <summary>
        /// Create a default recognition pipeline with the following steps:
        ///   1: Classify Single Strokes
        ///   2: Group Strokes into Shapes
        ///   3: Recognize Shapes
        ///   4: Connect Shapes
        ///   5: Refine Recognition
        /// </summary>
        public static RecognitionPipeline createDefaultPipeline(Dictionary <string, string> settings)
        {
            RecognitionPipeline result = new RecognitionPipeline();

            result.addStep(new WaitForFeatureSketch());
            result.addStep(createDefaultClassifier());
            result.addStep(createDefaultGrouper());
            result.addStep(createDefaultRecognizer());
            result.addStep(createDefaultConnector());
            result.append(createDefaultRefiner());
            return(result);
        }
        /// <summary>
        /// Create a default recognition pipeline with the following steps:
        ///   1: Classify Single Strokes
        ///   2: Group Strokes into Shapes
        ///   3: Recognize Shapes
        ///   4: Connect Shapes
        ///   5: Refine Recognition
        /// </summary>
        public static RecognitionPipeline createDefaultPipeline(Dictionary <string, string> settings)
        {
            Recognizer recognizer = createDefaultRecognizer();
            Connector  connector  = createDefaultConnector();

            RecognitionPipeline result = new RecognitionPipeline();

            result.addStep(createDefaultClassifier());
            result.addStep(createDefaultGrouper());
            result.addStep(recognizer);
            result.addStep(connector);
            result.addStep(createDefaultRefiner(connector, recognizer));
            return(result);
        }
Пример #4
0
        /// <summary>
        /// Create a Recognition Manager for the given sketch panel with default settings.
        /// Settings are loaded from "settings.txt".
        /// </summary>
        /// <param name="p">a sketch panel to manage</param>
        public RecognitionManager()
        {
            // Load settings from text file
            string directory        = AppDomain.CurrentDomain.BaseDirectory;
            string SettingsFilename = directory + "//settings.txt";

            _filenames = Files.SettingsReader.readSettings(SettingsFilename);

            // Initialize the recognition machines
            _domain           = ContextDomain.CircuitDomain.GetInstance();
            _strokeClassifier = RecognitionPipeline.createDefaultClassifier();
            _strokeGrouper    = RecognitionPipeline.createDefaultGrouper();
            _sketchRecognizer = RecognitionPipeline.createDefaultRecognizer();
            _connector        = RecognitionPipeline.createDefaultConnector();
            _refinement       = RecognitionPipeline.createDefaultRefiner();
        }
Пример #5
0
 /// <summary>
 /// Append all the steps from another pipeline to this one.
 /// </summary>
 /// <param name="other"></param>
 public virtual void append(RecognitionPipeline other)
 {
     _steps.AddRange(other._steps);
 }