summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/OCR.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-06-17 18:59:20 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-06-24 22:42:40 +0200
commit20b6a2ec022202b0efb6cb69415239fb8f4d1445 (patch)
treefdbb3ad42854144b1cace0221145a472b36ef84d /module/plugins/internal/OCR.py
parentSpare code cosmetics (diff)
downloadpyload-20b6a2ec022202b0efb6cb69415239fb8f4d1445.tar.xz
Spare code cosmetics (2)
Diffstat (limited to 'module/plugins/internal/OCR.py')
-rw-r--r--module/plugins/internal/OCR.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py
index 5fe6f2532..0191a4938 100644
--- a/module/plugins/internal/OCR.py
+++ b/module/plugins/internal/OCR.py
@@ -61,12 +61,12 @@ class OCR(Plugin):
def run_tesser(self, subset=False, digits=True, lowercase=True, uppercase=True, pagesegmode=None):
- # tmpTif = tempfile.NamedTemporaryFile(suffix=".tif")
+ #: tmpTif = tempfile.NamedTemporaryFile(suffix=".tif")
try:
tmpTif = open(fs_join("tmp", "tmpTif_%s.tif" % self.__name__), "wb")
tmpTif.close()
- # tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt")
+ #: tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt")
tmpTxt = open(fs_join("tmp", "tmpTxt_%s.txt" % self.__name__), "wb")
tmpTxt.close()
@@ -88,7 +88,7 @@ class OCR(Plugin):
tessparams.extend(["-psm", str(pagesegmode)])
if subset and (digits or lowercase or uppercase):
- # tmpSub = tempfile.NamedTemporaryFile(suffix=".subset")
+ #: tmpSub = tempfile.NamedTemporaryFile(suffix=".subset")
with open(fs_join("tmp", "tmpSub_%s.subset" % self.__name__), "wb") as tmpSub:
tmpSub.write("tessedit_char_whitelist ")
@@ -154,7 +154,7 @@ class OCR(Plugin):
for y in xrange(h):
if pixels[x, y] == 255:
continue
- # No point in processing white pixels since we only want to remove black pixel
+ #: No point in processing white pixels since we only want to remove black pixel
count = 0
try:
@@ -177,12 +177,12 @@ class OCR(Plugin):
except Exception:
pass
- # not enough neighbors are dark pixels so mark this pixel
- # to be changed to white
+ #: not enough neighbors are dark pixels so mark this pixel
+ #: to be changed to white
if count < allowed:
pixels[x, y] = 1
- # second pass: this time set all 1's to 255 (white)
+ #: second pass: this time set all 1's to 255 (white)
for x in xrange(w):
for y in xrange(h):
if pixels[x, y] == 1: