コード例 #1
0
        public async Task GetGlassInformation(Bitmap bitmap)
        {
            GooglePlacesApiData     googleApiData = new GooglePlacesApiData();
            GooglePlacesApiResponse responseData  = await googleApiData.GetApiResponseData("food");

            SimpleImageAnalysis imageInformation = new SimpleImageAnalysis(bitmap);
            int percentageOfLiquid = imageInformation.CalculatePercentageOfLiquid();

            Date       = DateTime.Today;
            Name       = responseData.results[0].name;
            Address    = responseData.results[0].vicinity;
            Percentage = percentageOfLiquid;
        }
コード例 #2
0
        public async Task GetRestaurantInformation(String path, PictureBox imageBox2, string username) //todo perkelt imagebox settinima i kita vieta
        {
            GooglePlacesApiData googleApiData = new GooglePlacesApiData();

            ICalculateLiquidPercentage rpa = new RealPhotoAnalysis(new Image <Emgu.CV.Structure.Bgr, byte>(path));
            //ICalculateLiquidPercentage rpa = new SimpleImageAnalysis(new System.Drawing.Bitmap(path));
            RealPhotoAnalysis rpa1 = (RealPhotoAnalysis)rpa;

            imageBox2.Image = rpa1.VisualRepresentation.Bitmap;
            // GooglePlacesApiResponse responseData = await googleApiData.GetApiResponseData("food");
            int percentageOfLiquid = rpa.CalculatePercentageOfLiquid();

            Username = username;
            Date     = DateTime.Today;
            // Name = responseData.results[0].name;
            //     Address = responseData.results[0].vicinity;
            Percentage = percentageOfLiquid;
        }