Beispiel #1
0
        public int RecognizePerson(Bitmap facePicture)
        {
            Bitmap tmpReshapedImage            = new Bitmap(facePicture, new Size(reshapeImageSize, reshapeImageSize));
            IsaksImageProcessor imageProcessor = new IsaksImageProcessor(tmpReshapedImage);

            double[] imageArray = imageProcessor.AsGrayVector();
            return(RecognizePerson(imageArray));
        }
Beispiel #2
0
        public double[] LoadNewPersonTest(int personID, int imageID)
        {
            string tmpPicturePath   = ChoosePersonPicturePath(personID, imageID);
            Bitmap tmpOriginalImage = new Bitmap(tmpPicturePath);
            Bitmap tmpReshapedImage = new Bitmap(tmpOriginalImage, new Size(reshapeImageSize, reshapeImageSize));

            IsaksImageProcessor imageProcessor = new IsaksImageProcessor(tmpReshapedImage);

            double[] imageArray = imageProcessor.AsGrayVector();
            return(imageArray);
        }
Beispiel #3
0
        public void AddPerson(List <Bitmap> listOfBitmaps)
        {
            Bitmap tmpReshapedImage;
            IsaksImageProcessor imageProcessor;
            List <double[]>     listOfRawImageArrays = new List <double[]>();

            foreach (Bitmap faceBitmap in listOfBitmaps)
            {
                tmpReshapedImage = new Bitmap(faceBitmap, new Size(reshapeImageSize, reshapeImageSize));
                imageProcessor   = new IsaksImageProcessor(tmpReshapedImage);
                double[] imageArray = imageProcessor.AsGrayVector();
                listOfRawImageArrays.Add(imageArray);
            }
            AddPerson(listOfRawImageArrays);
        }
Beispiel #4
0
        public List <double[]> LoadNewPerson(int personID) // from default images (test method)
        {
            List <double[]> listOfRawImageArrays = new List <double[]>();

            string tmpPicturePath;
            Bitmap tmpOriginalImage;
            Bitmap tmpReshapedImage;
            IsaksImageProcessor imageProcessor;

            double[] tmpImageArray;
            for (int iImage = nbrDataBasePicturesPerPerson + 1; iImage <= 14; iImage++)
            {
                tmpPicturePath   = ChoosePersonPicturePath(personID, iImage);
                tmpOriginalImage = new Bitmap(tmpPicturePath);
                tmpReshapedImage = new Bitmap(tmpOriginalImage, new Size(reshapeImageSize, reshapeImageSize));

                imageProcessor = new IsaksImageProcessor(tmpReshapedImage);
                tmpImageArray  = imageProcessor.AsGrayVector();
                listOfRawImageArrays.Add(tmpImageArray);
            }
            return(listOfRawImageArrays);
        }
Beispiel #5
0
        public void LoadDefaultImages()
        {
            listOfDataBaseImages = new List <double[]>();

            string tmpPicturePath;
            Bitmap tmpOriginalImage;
            Bitmap tmpReshapedImage;
            IsaksImageProcessor imageProcessor;

            double[] tmpImageArray;
            for (int iPerson = 1; iPerson <= nbrDataBasePersons; iPerson++)
            {
                for (int iImage = 1; iImage <= nbrDataBasePicturesPerPerson; iImage++)
                {
                    tmpPicturePath   = ChoosePersonPicturePath(iPerson, iImage);
                    tmpOriginalImage = new Bitmap(tmpPicturePath);
                    tmpReshapedImage = new Bitmap(tmpOriginalImage, new Size(reshapeImageSize, reshapeImageSize));

                    imageProcessor = new IsaksImageProcessor(tmpReshapedImage);
                    tmpImageArray  = imageProcessor.AsGrayVector();
                    listOfDataBaseImages.Add(tmpImageArray);
                }
            }
        }