Exemplo n.º 1
0
        public Bitmap Process(Bitmap sourceToProcess)
        {
            Bitmap copiedSource = (Bitmap)sourceToProcess.Clone();

            LockableBitmap outBitmap = new LockableBitmap(copiedSource);

            outBitmap.LockBits();

            LockableBitmap lockableBitmap = new LockableBitmap(sourceToProcess);

            lockableBitmap.LockBits();

            try
            {
                IPattern <double> pattern          = RetrievePatternValue(lockableBitmap);
                double[]          processedPattern = hopfieldNeuralNetwork.Determine(pattern);

                ApplyPatternValues(processedPattern, outBitmap);
            }
            finally
            {
                lockableBitmap.UnlockBits();
                outBitmap.UnlockBits();
            }

            return(copiedSource);
        }