mdbloice / Augmentor

Image augmentation library in Python for machine learning.
https://augmentor.readthedocs.io/en/stable
MIT License
5.07k stars 866 forks source link

How to simulate a photo image of a white paper with black chars printed ? #166

Open oohurbert opened 5 years ago

oohurbert commented 5 years ago

I've found noise/blur......filters can't simulate the effect image taken by photo, because of the reflect of the camera lighting. We can easily find many white dots around the character's edge. How can we simulate this effect? issue

mdbloice commented 5 years ago

Hi @oohurbert I think that kind of noise you show in your example image are just compression artefacts, are they not? If you saved an image as JPEG with high compression you might get images like the one above perhaps?

oohurbert commented 5 years ago

@mdbloice, Thanks for your reply. No, that effect showed above is because of the camera lighting. If the image is scanned, there no white dots around the black edge. Anyway, we are talking about how to simulate the effect by some image processing method.

mdbloice commented 5 years ago

@oohurbert some kind of random noising operation might be useful. I will mark this issue as an enhancement and perhaps include in an upcoming release.

By the way, it is quite easy to add custom operations to a pipeline in Augmentor. Check the docs for more details: https://augmentor.readthedocs.io/en/master/userguide/extend.html