|Visual Basic (Declaration)|
|Visual Basic (Usage)||Copy Code|
- ImImage to scan to see if text is upside down.
Return ValueReturns True if the text on this page is upside down.
This function will scan text characters on this page to see if this image was scanned in upside down. It will work with English documents using standard fonts of medium to high resolution. 100 dpi images or less may not all be detected with the default values, especially if there is little text in the image, but if you use the default values you should not get false positives either.
This function counts straight Ascenders "h" "b" "d" "k" (higher frequency letters in English, 12.6% total) and compares to straight descenders "p" "q" (lower frequency letters in English, 2.024% total). This function may work with other languages and Fonts, but should be tested extensively first, as the high frequency letters may differ, and diacritic marks may throw off the calculation.
There are optional parameters for this function allowing for adjustments for non standard documents, we encourage you to use the default or larger more stringent values, if you lower any of these values false positives are likely:
- minAscenderCount - the minimum number of Ascenders needed to make the calculation, The higher this number the less likely you will get a false positive. But also the more text will need to be present on the page. The default for this value is 70.
- minConfidence- The minimum confidence for determining both vertical ascenders and descenders. In other words how closely does the character glyph need to look like a filled in "b" or "d" or "p" or "q". The default value is 7.0.
- minConfidenceRatio - The minimum confidence ratio when comparing ascenders to descenders. The default value is 2.5. In other words there should be at least 2.5 times more ascenders than descenders.
This function is not designed to work with landscape oriented text. Results will vary.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2