bug-ocrad
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-ocrad] improving discrimination between i and j


From: lode leroy
Subject: [Bug-ocrad] improving discrimination between i and j
Date: Fri, 29 Jul 2005 12:51:57 +0200

Hello,

I wonder if you are taking patches to ocrad...
This rule improves the detection of "j"
Maybe it would be better to have features "has_descenders" and "has_ascenders"
and test add_guess(f2.has_descenders()?'j':'i',0)
where has_descenders is related to the number of pixels below the baseline of the character.

-- lode


~/pkg/ocrad-0.12 $ diff -Nurpw orig/ocrad-0.12/character_r12.cc .
--- orig/ocrad-0.12/character_r12.cc    2005-05-24 13:24:43.000000000 +0200
+++ ./character_r12.cc  2005-07-29 12:52:40.660388800 +0200
@@ -160,7 +160,7 @@ void Character::recognize12( const Chars
                if( !f2.lp.isctip() && f2.wp.max() >= f1.wp.max() &&
                    3 * f2.wp[f2.wp.pos(10)] < 2 * f1.wp.max() )
                  { add_guess( UCS::IEXCLAM, 0 ); return; }
-              add_guess( 'i', 0 ); return;
+ add_guess((b2.vpos(80) > charbox.bottom())?'j':'i', 0 ); return;

              }
            if( 3 * f2.wp.max() > 4 * f1.wp.max() &&
b2.seek_bottom( b2.vcenter(), b2.hpos( 10 ) ) < b2.bottom() &&
@@ -170,7 +170,7 @@ void Character::recognize12( const Chars
              { add_guess( 'j', 0 ); return; }
            if( charset.enabled( Charset::iso_8859_9 ) && f2.rp.istip() )
              { add_guess( UCS::CIDOT, 0 ); return; }
-            add_guess( 'i', 0 ); return;
+ add_guess((b2.vpos(80) > charbox.bottom())?'j':'i', 0 ); return;
            }
          }
        }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]