예제 #1
0
    def calcCuadroArrayChar(self, arg):
        if self.singleParser == self.letterPredictor:
            charArray_timer = UtilDebug.ArrayLetterTimer()
        else:
            charArray_timer = UtilDebug.ArrayDigitTimer()

        charArray_timer.startTimer(1)  #self.count
        img = arg

        TL = self.position[0]
        BR = self.position[1]
        count = self.countItems
        UtilFunctionsExtraction.predictCuadros(img, TL, BR, count)
        charArray_timer.endTimer()
예제 #2
0
 def parserCategoricLabelsSiNo(self, arg):
     img = arg
     TL = self.position[0]
     BR = self.position[1]
     labels = self.position[2]
     self.countItems = len(labels)
     self.arrayOfImages = UtilFunctionsExtraction.extractCategory_extractColumnLabelsTipoSiNo(
         img, TL, BR, len(labels))
     results = UtilFunctionsExtraction.predictValuesCategory_labelsSingleButtons(
         self.arrayOfImages, labels)
     self.predictedValue = []
     for r in results:
         self.predictedValue.append(r)
     return self.predictedValue
예제 #3
0
    def parserImage2ArrayChar(self, arg):
        if self.singleParser == self.letterPredictor:
            charArray_timer = UtilDebug.ArrayLetterTimer()
        else:
            charArray_timer = UtilDebug.ArrayDigitTimer()

        charArray_timer.startTimer(1)  #self.count
        img = arg

        TL = self.position[0]
        BR = self.position[1]
        count = self.countItems
        arrayOfImages = UtilFunctionsExtraction.extractCharacters(
            img, TL, BR, count)
        arrayResult = []
        for singleImage in arrayOfImages:
            if singleImage is None:
                predicted = None
            else:
                predicted = self.singleParser(singleImage)

            arrayResult.append(predicted)
        #UtilFunctionsExtraction.plotImagesWithPrediction(arrayResult,arrayOfImages)
        self.predictedValue = arrayResult
        self.arrayOfImages = arrayOfImages
        charArray_timer.endTimer()
        return self.predictedValue