Skip to content

Commit

Permalink
Merge pull request #391 from vidiecan/issue_390
Browse files Browse the repository at this point in the history
fixed #390 by introducing new rotate_image flag
  • Loading branch information
zdenop committed Aug 15, 2016
2 parents f06314c + b69561c commit 939023f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion training/text2image.cpp
Expand Up @@ -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");

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 939023f

Please sign in to comment.