Esempio n. 1
0
        public void Setup()
        {
            Task.Run(async() =>
            {
                await recProc.ExtractReceipt(imageFilePath);
            }).GetAwaiter().GetResult();

            rM = recProc.Receipt;
        }
Esempio n. 2
0
        public static async void DisplayPictureInfo(string imageFilePath)
        {
            if (File.Exists(imageFilePath))
            {
                ReceiptProcessor proc = new ReceiptProcessor();
                await proc.ExtractReceipt(imageFilePath);

                DisplayModelRegions(proc.Receipt);
                foreach (var region in proc.Receipt.Regions)
                {
                    Helpers.GetTextFromRegion(region);
                }
            }
            else
            {
                Console.WriteLine("\nInvalid file path");
            }
        }
Esempio n. 3
0
        static async Task Main()
        {
            string imageFilePath = @"C:\Users\hrust\Downloads\receipts\IMG_1306.jpg";

            Helpers.DisplayJSONResponse(await Helpers.MakeOCRRequest(imageFilePath));

            ReceiptProcessor recProc = new ReceiptProcessor();
            await recProc.ExtractReceipt(imageFilePath);


            //recProc.MergeLineText();
            //foreach (var line in recProc.MergedLines)
            //{
            //    Console.WriteLine(line);
            //}

            //TODO: improve the mapping of the Total/Sum/At betale field to the sum

            Console.WriteLine("\nPress Enter to exit...");
            Console.ReadLine();
        }