Example #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
Example #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)
Example #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)
Example #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
Example #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
Example #6
0
 def _captchaTest(self, image, solution):
     debordered = tools.deborder(image)
     destriped = destripe.destripe(debordered)
     segments = segment.segment(destriped)
     self.assertEqual(len(segments), 3)
Example #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)