public static CharOcrData[] GetAsChars(WordOcrData sourceWord, bool autoSelectSource) #endif { try { if (autoSelectSource && sourceWord.Chars != null && sourceWord.Chars.Length > 0) { return(sourceWord.Chars); } List <CharOcrData> res = new List <CharOcrData>(); int pos = 0; foreach (Char ch in sourceWord.Value) { pos++; res.Add(new CharOcrData()); res[res.Count - 1].Confidence = sourceWord.Confidence; res[res.Count - 1].Rect = new Rectangle(sourceWord.Rect.X + (pos * (sourceWord.Rect.Width / sourceWord.Value.Length)), sourceWord.Rect.Y, sourceWord.Rect.Width / sourceWord.Value.Length, sourceWord.Rect.Height); res[res.Count - 1].Value = ch; } return(res.ToArray()); } catch (Exception ex) { ILog.LogError(ex); } return(null); }
public static CharOcrData[] GetAsChars(WordOcrData sourceWord) #endif { return(GetAsChars(sourceWord, true)); }
/// <summary> /// Get the chars a word is consisted of. /// </summary> /// <param name="sourceWord">The <see cref="WordOcrData"/> to get it's chars.</param> /// <param name="autoSelectSource">when true will use TChar class extracted from the TWord data, /// when false will get the data by calculating the word rectangle and String and breaking it to the chars it is made of</param> /// <returns>A CharOcrData array of the characters the word is consisted of.</returns> #if INTERNAL internal static CharOcrData[] GetAsChars(WordOcrData sourceWord, bool autoSelectSource)
/// <summary> /// Get the chars a word is consisted of. /// </summary> /// <param name="sourceWord">The <see cref="WordOcrData"/> to get it's chars.</param> /// <returns>A CharOcrData array of the characters the word is consisted of.</returns> #if INTERNAL internal static CharOcrData[] GetAsChars(WordOcrData sourceWord)