Add lineart transformation.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
===============
|
||||
- Add view to download a document's OCR text. GitLab #215
|
||||
- Add user configurable mailer. GitLab #286.
|
||||
- Use Toasts library for screen messages.
|
||||
- Reduce verbosity of some debug messages.
|
||||
- Add new lineart transformation.
|
||||
|
||||
2.4 (2017-06-23)
|
||||
================
|
||||
|
||||
@@ -24,6 +24,10 @@ Other Changes
|
||||
- Make the task manager translatable.
|
||||
- Add Turkish to the list of processes languages.
|
||||
- Add user configurable mailer support. GitLab issue #286.
|
||||
- Use Toastr libary for screen messages.
|
||||
- Reduce verbosity of some debug messages.
|
||||
- New lineart transformation. Useful to increase the OCR accuracy on some kind
|
||||
of documents.
|
||||
|
||||
Removals
|
||||
--------
|
||||
|
||||
@@ -324,6 +324,16 @@ class TransformationGaussianBlur(BaseTransformation):
|
||||
return self.image.filter(ImageFilter.GaussianBlur(radius=self.radius))
|
||||
|
||||
|
||||
class TransformationLineArt(BaseTransformation):
|
||||
label = _('Line art')
|
||||
name = 'lineart'
|
||||
|
||||
def execute_on(self, *args, **kwargs):
|
||||
super(TransformationLineArt, self).execute_on(*args, **kwargs)
|
||||
|
||||
return self.image.convert('L').point(lambda x: 0 if x < 128 else 255, '1')
|
||||
|
||||
|
||||
class TransformationMirror(BaseTransformation):
|
||||
arguments = ()
|
||||
label = _('Mirror')
|
||||
@@ -452,6 +462,7 @@ class TransformationZoom(BaseTransformation):
|
||||
BaseTransformation.register(TransformationCrop)
|
||||
BaseTransformation.register(TransformationFlip)
|
||||
BaseTransformation.register(TransformationGaussianBlur)
|
||||
BaseTransformation.register(TransformationLineArt)
|
||||
BaseTransformation.register(TransformationMirror)
|
||||
BaseTransformation.register(TransformationResize)
|
||||
BaseTransformation.register(TransformationRotate)
|
||||
@@ -460,3 +471,7 @@ BaseTransformation.register(TransformationRotate180)
|
||||
BaseTransformation.register(TransformationRotate270)
|
||||
BaseTransformation.register(TransformationUnsharpMask)
|
||||
BaseTransformation.register(TransformationZoom)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user