Ejemplo n.º 1
0
 private void populateMap()
 {
     foreach (int?row in linePositions)
     {
         map[row] = OCRUtilities.wordsPositions(image, row, letterInfo.LetterSize, letterInfo.SpaceGap);
     }
 }
Ejemplo n.º 2
0
 public Text(BufferedImage image, Letter letterInformation)
 {
     this.letterInfo = letterInformation;
     this.image      = image;
     linePositions   = OCRUtilities.rowPositions(image, letterInformation.SmallestSizeLetter);
     createMap();
     populateMap();
 }
Ejemplo n.º 3
0
        //    public Letter(int scanQuality, int fontSize) {
        //        this.scanQuality = scanQuality;
        //        this.fontSize = fontSize;
        //
        //        calculateDimensions();
        //        calculateSmallestSizeLetter();
        //        calculateLetterSize();
        //        calculateTrashsize();
        //        calculateSpaceGap();
        //    }

        public Letter(int scanQuality, BufferedImage image)
        {
            this.scanQuality = scanQuality;
            this.image       = image;
            heightHistogram  = Histogram.heightHistogram(image);
            gradient         = Histogram.gradient(heightHistogram);
            calculateSmallestSizeLetter();
            List <int?> rowHeights = OCRUtilities.rowHeights(gradient, smallestSizeLetter);
            int         meanHeight = (int)caluclateMean(rowHeights);

            calculateDimensions(meanHeight);
            calculateLetterSize(meanHeight);
            calculateSpaceGap(meanHeight);
        }