From b69561c80245828696817e046a7f69f03f3e69bd Mon Sep 17 00:00:00 2001 From: jm Date: Mon, 15 Aug 2016 18:16:35 +0200 Subject: [PATCH] fixed #390 by introducing new rotate_image flag --- training/text2image.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/training/text2image.cpp b/training/text2image.cpp index a8bb21ab42..5286ad8dfa 100644 --- a/training/text2image.cpp +++ b/training/text2image.cpp @@ -70,6 +70,9 @@ BOOL_PARAM_FLAG(degrade_image, true, "Degrade rendered image with speckle noise, dilation/erosion " "and rotation"); +// Rotate the rendered image to have more realistic glyph borders +BOOL_PARAM_FLAG(rotate_image, true, "Rotate the image in a random way."); + // Degradation to apply to the image. INT_PARAM_FLAG(exposure, 0, "Exposure level in photocopier"); @@ -598,7 +601,7 @@ int main(int argc, char** argv) { rotation = -1 * page_rotation[page_num]; } if (FLAGS_degrade_image) { - pix = DegradeImage(pix, FLAGS_exposure, &randomizer, &rotation); + pix = DegradeImage(pix, FLAGS_exposure, &randomizer, FLAGS_rotate_image ? &rotation : NULL); } render.RotatePageBoxes(rotation);