Algorithmix.Forensics.OCR.Cost C# (CSharp) Method

Cost() public static method

Calculates the cost by summing the unique cost of each word
public static Cost ( Emgu.CV.OCR.Tesseract chars ) : long
chars Emgu.CV.OCR.Tesseract Tesseract OCR Charactor results
return long
        public static long Cost(Tesseract.Charactor[] chars)
        {
            if (chars.Length < 1)
            {
                return 0;
            }
            long total = 0;
            double current = -1;
            foreach (Tesseract.Charactor charactor in chars)
            {
                if (Math.Abs(current - charactor.Cost) > 0.0001)
                {
                    current = charactor.Cost;
                    total += (long)current;
                }
            }
            return total;
        }