faustomorales / keras-ocr

A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
https://keras-ocr.readthedocs.io/
MIT License
1.37k stars 349 forks source link

Any angle greater than zero for rotation on the X and Y axis raises an error while the images are generated #186

Open LFBJC opened 2 years ago

LFBJC commented 2 years ago

Anytime I try to generate training data with any interval the parameters rotationX or rotationY of the function keras_ocr.data_generation.get_image_generator() it raises an error in the compute_transformed_contour function, when I debugged I found out that this has to do with a "slots" array inside the function that gets empty after this step: slots_filtered = slots_pretransform[(areas > minarea * spacing * spacing) & inside] because slots_filtered = slots_pretransform[inside] is empty. The image generator only works if I set rotationX and rotationY to 0