Esempio n. 1
0
def _simpleDestripe(image, condition=_segmentCondition):
    destriped = cropped = tools.simplify(image, 8)
    while not condition(destriped):
        newBorderColors = _borderColors(cropped)
        destriped = tools.filterColors(destriped, newBorderColors)
        cropped = tools.deborder(cropped)

    return destriped
Esempio n. 2
0
    def _captchaTest(self, image, solution):
        debordered = tools.deborder(image)
        simplified = tools.simplify(debordered)
        self.assertEqual(len(tools.getColors(simplified)), 4)

        destriped = destripe.destripe(simplified)
        destripedColors = tools.getColors(destriped)
        self.assertEqual(len(destripedColors), 2)
Esempio n. 3
0
    def _captchaTest(self, image, solution):
        debordered = tools.deborder(image)
        simplified = tools.simplify(debordered)
        self.assertEqual(len(tools.getColors(simplified)), 4)

        destriped = destripe.destripe(simplified)
        destripedColors = tools.getColors(destriped)
        self.assertEqual(len(destripedColors), 2)
Esempio n. 4
0
def _simpleDestripe(image, condition=_segmentCondition):
    destriped = cropped = tools.simplify(image, 8)
    while not condition(destriped):
        newBorderColors = _borderColors(cropped)
        destriped = tools.filterColors(destriped, newBorderColors)
        cropped = tools.deborder(cropped)

    return destriped
Esempio n. 5
0
def destripe(image):
    destriped = tools.filterColors(image, _borderColors(image))

    cropped = destriped
    while len(tools.getColors(destriped)) > 2:
        cropped = tools.deborder(cropped)
        newBorderColors = _borderColors(cropped)
        destriped = tools.filterColors(destriped, newBorderColors)

    return destriped
Esempio n. 6
0
 def _captchaTest(self, image, solution):
     debordered = tools.deborder(image)
     destriped = destripe.destripe(debordered)
     segments = segment.segment(destriped)
     self.assertEqual(len(segments), 3)
Esempio n. 7
0
 def _captchaTest(self, image, solution):
     debordered = tools.deborder(image)
     simplified = tools.simplify(debordered)
     destriped = destripe.destripe(simplified)
     segments = segment.segment(destriped)
     self.assertEqual(len(segments), 3)