Belval / TextRecognitionDataGenerator

A synthetic data generator for text recognition
MIT License
3.24k stars 966 forks source link

how to generate with text and background different color #207

Closed cuongngm closed 3 years ago

cuongngm commented 3 years ago

I added approximately 100 single color image and generated text in them. But 20% of them will generate the text and background with the same color, it makes the text invisible to eye. Is there a way to exactly how the text and the background have a different color?

gachiemchiep commented 3 years ago

@cuongngm

Inside data_generator.py line 154, there is the code to generate text image and background image. Then those 2 images are merged to form the final output image. You could add a piece of code to skip image that has too similar text image and background image color. A simple approach like mean pixel value comparing should work.

cuongngm commented 3 years ago

Wow, tks a