Skip to content

Commit eaf72ac

Browse files
committed
Prefer result from inverted image if the mean confidence is better
Signed-off-by: Stefan Weil <[email protected]>
1 parent cfb1fb2 commit eaf72ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lstm/lstmrecognizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ bool LSTMRecognizer::RecognizeLine(const ImageData& image_data, bool invert,
302302
&inv_outputs);
303303
float inv_min, inv_mean, inv_sd;
304304
OutputStats(inv_outputs, &inv_min, &inv_mean, &inv_sd);
305-
if (inv_min > pos_min && inv_mean > pos_mean && inv_sd < pos_sd) {
305+
if (inv_mean > pos_mean) {
306306
// Inverted did better. Use inverted data.
307307
if (debug) {
308308
tprintf("Inverting image: old min=%g, mean=%g, sd=%g, inv %g,%g,%g\n",

0 commit comments

Comments
 (0)