pil2cv: allow (and drop) alpha channels on input imgs - #168
Conversation
|
@bertsky @kba @cneud Even without any changes, including this PR, Eynollah (which I tested using my latest PR ) works correctly on this image with an alpha channel |
|
If we decide to move ahead with this, we should backport that to OCR-D/core whence I took it originally. |
|
Ok, so to revisit this... The image @vahidrezanezhad used, which is
But depending on the base layer (gray or palette or rgb), the OCR-D interface (i.e. Hence my latest commit on #222 as a stripped down version of this PR. The standalone CLI uses I am not so sure anymore what my original example was, but will close for now. |


The error I got by calling
cvtColoras it was:Removing the alpha channel in advance avoids the problem.
But perhaps we should not naively drop the channel, but use it (somehow) to mask the image? (I.e. for segmentation: no layout analysis in fully transparent zones, for binarization: pure background)