Ejemplo n.º 1
0
        public void OpenPicture(string file)
        {
            if (!File.Exists(file))
            {
                MessageService.ShowError(null, string.Format("Cannot open file : File {0} doesn't exist", file));
                return;
            }

            Original = new BitmapImage(new Uri(file));

            VerticalProjection = new Projection(Original)
            {
                Type = ProjectionType.Vertical
            };
            VerticalProjection.Compute();

            HorizontalProjection = new Projection(Original)
            {
                Type = ProjectionType.Horizontal
            };
            HorizontalProjection.Compute();

            CharacterIsolation   = new CharacterIsolation(Original);
            CharacterRecognition = new CharacterRecognition(Original);

            Correction = new Correction(Original, new WordTree(new HammingDistance(false),
                                                               new HammingDistance('?', false), new FrequencyResolver()));
        }
Ejemplo n.º 2
0
        private void OnApplyCharacterIsolation(object parameter)
        {
            if (!CanApplyCharacterIsolation(parameter))
            {
                return;
            }

            CharacterIsolation.Compute();
        }