예제 #1
0
        public async Task <List <KeyValuePair <string, decimal> > > AnalyzeTakenPhotoAsync(byte[] imageByteArray)
        {
            string imageContent = await PostImageContentAsync(imageByteArray);

            ImageAnalysisResultObject result = ParseImageContent(imageContent);

            if (!result.Status.Equals("Succeeded"))
            {
                throw new JsonException("De-serialization Failed");
            }

            List <Lines> itemsAndPrices = result.RecognitionResults[0].Lines;

            return(PurifyImageContent(itemsAndPrices));
        }
예제 #2
0
        public async void AnalyzeTakenPhoto(byte[] imageByteArray)
        {
            string imageContent = await PostImageContentAsync(imageByteArray);

            ImageAnalysisResultObject result = ParseImageContent(imageContent);

            if (!result.Status.Equals("Succeeded"))
            {
                throw new Exception("Not successful");
            }

            List <Lines> itemsAndPrices = result.RecognitionResults[0].Lines;

            itemPricePairs = PurifyImageContent(itemsAndPrices);
        }