Beispiel #1
0
    def analyse(self):

        self.detectedNumber.clear()

        #return analyse.analyseNumber(self.cropped[0])

        for abc in self.cropped:
            self.detectedNumber.append(analyse.analyseNumber(abc))

        #print(self.detectedNumber)

        for abc in self.detectedNumber:

            if (abc == 1):
                return 1
            if (abc == 2):
                return 2
            if (abc == 3):
                return 3
            if (abc == 4):
                return 4
            if (abc == 5):
                return 5

        return 0
Beispiel #2
0
    def analyse(self):

        self.detectedNumber.clear()
        '''
        return analyse.analyseNumber(self.cropped[0])

        '''
        for abc in self.cropped:
            self.detectedNumber.append(analyse.analyseNumber(abc))

        #print(self.detectedNumber)

        count = [0] * 5

        for abc in self.detectedNumber:

            if (abc == 1):
                count[0] = count[0] + 1
            if (abc == 2):
                count[1] = count[1] + 1
            if (abc == 3):
                count[2] = count[2] + 1
            if (abc == 4):
                count[3] = count[3] + 1
            if (abc == 5):
                count[4] = count[4] + 1

        c = 5

        while (c > 0):
            if (count[0] == c):
                return 1
            if (count[1] == c):
                return 2
            if (count[2] == c):
                return 3
            if (count[3] == c):
                return 4
            if (count[4] == c):
                return 5
            c = c - 1

        return 0

        cv2.waitKey(0)
Beispiel #3
0
    colorFilter = crop.ColorFilter(img)
    colorFilter.filterRed()
    colorFilter.closing(colorFilter.mask)
    # colorFilter.showImg('closing',colorFilter.closing)
    shapeD = crop.ShapeDetecter(img, colorFilter.closing)
    cropped.append(shapeD.analyse())

############################################
# analyse Pictures
############################################

detectedNumber = []

for abc in cropped:
    detectedNumber.append(analyse.analyseNumber(abc))

print(detectedNumber)

count = [0] * 5

for abc in detectedNumber:

    if (abc == 1):
        count[0] = count[0] + 1
    if (abc == 2):
        count[1] = count[1] + 1
    if (abc == 3):
        count[2] = count[2] + 1
    if (abc == 4):
        count[3] = count[3] + 1