public void PostTestC()
        {
            BraileImages  bmpl = new BraileImages();
            List <Bitmap> bmp  = bmpl.BitmapList;


            Bitmap bmps = new Bitmap(bmp[2]);

            ImageCoversionClass normalPicture = new ImageCoversionClass(bmps);



            List <Bitmap> croppedPhotos = normalPicture.cropImageIntoSegments(normalPicture.edgedetection(bmps));

            CircleDetectionClass circlesDection = new CircleDetectionClass(croppedPhotos);

            List <bool> circleThereList = circlesDection.GetBoolList();

            LetterDector dectoring = new LetterDector(circleThereList);



            String Letter = dectoring.checkLetter();

            Assert.AreEqual("C", Letter);
        }
Beispiel #2
0
        public async Task <HttpResponseMessage> Post()
        {
            Image imageSentFromApi;


            using (var stream = await Request.Content.ReadAsStreamAsync())
            {
                imageSentFromApi = Image.FromStream(stream);
            }
            Bitmap bmp = new Bitmap(imageSentFromApi);

            ImageCoversionClass normalPicture = new ImageCoversionClass(bmp);



            List <Bitmap> croppedPhotos = normalPicture.cropImageIntoSegments(normalPicture.edgedetection(bmp));

            CircleDetectionClass circlesDection = new CircleDetectionClass(croppedPhotos);

            List <bool> circleThereList = circlesDection.GetBoolList();

            LetterDector dectoring = new LetterDector(circleThereList);

            BraileConverted letter = new BraileConverted();

            letter.CovertedBrailleLetter = dectoring.checkLetter();



            Debug.WriteLine("The Letter is " + letter.CovertedBrailleLetter);
            HttpRequestMessage request = new HttpRequestMessage();

            //Returns the string to the in the
            string url = "https://brailleconversionapi20190131031437.azurewebsites.net/api/GetLetter/" + letter.CovertedBrailleLetter;
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created);

            response.Headers.Location = new Uri(url);

            return(response);
        }