Skip to content

Commit b69561c

Browse files
author
jm
committed
fixed #390 by introducing new rotate_image flag
1 parent 5610738 commit b69561c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

training/text2image.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ BOOL_PARAM_FLAG(degrade_image, true,
7070
"Degrade rendered image with speckle noise, dilation/erosion "
7171
"and rotation");
7272

73+
// Rotate the rendered image to have more realistic glyph borders
74+
BOOL_PARAM_FLAG(rotate_image, true, "Rotate the image in a random way.");
75+
7376
// Degradation to apply to the image.
7477
INT_PARAM_FLAG(exposure, 0, "Exposure level in photocopier");
7578

@@ -598,7 +601,7 @@ int main(int argc, char** argv) {
598601
rotation = -1 * page_rotation[page_num];
599602
}
600603
if (FLAGS_degrade_image) {
601-
pix = DegradeImage(pix, FLAGS_exposure, &randomizer, &rotation);
604+
pix = DegradeImage(pix, FLAGS_exposure, &randomizer, FLAGS_rotate_image ? &rotation : NULL);
602605
}
603606
render.RotatePageBoxes(rotation);
604607

0 commit comments

Comments
 (0)