Beispiel #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
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #5
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)
Beispiel #6
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)