예제 #1
0
        public int recallNetworkGuess(OCRCharacter character)
        {
            // Insert the 64 bit OCR data for the image as inputs.
            double[] imgData = character.getPoints();
            for (int i = 0; i < imgData.Length; i++)
            {
                inputNeuronsArr[i] = (float)imgData[i];
            }

            // Calculate the network
            calculateNetwork();

            float winner = -1;
            int   index  = 0;

            // Find the best fitting output
            for (int i = 0; i < outputs; i++)
            {
                if (outputNeuronsArr[i] > winner)
                {
                    winner = outputNeuronsArr[i];
                    index  = i;
                }
            }

            return(index);
        }
예제 #2
0
        public double getDistance(IDistance distCalculator, OCRCharacter otherCharacter)
        {
            double dist = distCalculator.getDistance(this.pointsArr, otherCharacter.getPoints());

            distance = dist;
            return(dist);
        }