Beispiel #1
0
        //图像对比度增强 -- 调整过暗或者过亮图像的对比度,使图像更加鲜明。 None
        public static void ContrastEnhanceDemo(string pic)
        {
            client.Timeout = 60000;  // 修改超时时间
            var image = File.ReadAllBytes(pic);
            // 调用图像对比度增强,可能会抛出网络等异常,请使用try/catch捕获
            var      result      = client.ContrastEnhance(image);
            FileInfo fileInfo    = new FileInfo(pic);
            string   newfilename = fileInfo.DirectoryName + @"\" + fileInfo.Name.Substring(0, fileInfo.Name.Length - fileInfo.Extension.Length) + "_CEH" + fileInfo.Extension;

            SaveBase64Image(result["image"].ToString(), newfilename);
        }