summaryrefslogtreecommitdiffstats
path: root/module/plugins/captcha/LinksaveIn.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/captcha/LinksaveIn.py')
-rw-r--r--module/plugins/captcha/LinksaveIn.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py
index e8487c387..6535dd11f 100644
--- a/module/plugins/captcha/LinksaveIn.py
+++ b/module/plugins/captcha/LinksaveIn.py
@@ -26,6 +26,7 @@ class LinksaveIn(OCR):
OCR.__init__(self)
self.data_dir = dirname(abspath(__file__)) + sep + "LinksaveIn" + sep
+
def load_image(self, image):
im = Image.open(image)
frame_nr = 0
@@ -53,6 +54,7 @@ class LinksaveIn(OCR):
self.pixels = self.image.load()
self.result_captcha = ''
+
def get_bg(self):
stat = {}
cstat = {}
@@ -89,6 +91,7 @@ class LinksaveIn(OCR):
max_p = value
return bg
+
def substract_bg(self, bgpath):
bg = Image.open(bgpath)
img = self.image.convert("P")
@@ -111,6 +114,7 @@ class LinksaveIn(OCR):
if rgb_c == rgb_bg:
orgpix[x, y] = (255,255,255)
+
def eval_black_white(self):
new = Image.new("RGB", (140, 75))
pix = new.load()
@@ -132,6 +136,7 @@ class LinksaveIn(OCR):
self.image = new
self.pixels = self.image.load()
+
def get_captcha(self, image):
self.load_image(image)
bg = self.get_bg()