API | 操作描述 |
二维码识别 | 二维码识别功能可识别图片中有效二维码的位置及内容,输出图像中二维码包含的文本信息(每个二维码对应的 URL 或文本),并可对识别出的二维码添加马赛克 |
PutObjectRequest request = new PutObjectRequest(bucket, key, srcPath);JObject o = new JObject();// 不返回原图o["is_pic_info"] = 1;JArray rules = new JArray();JObject rule = new JObject();rule["bucket"] = bucket;rule["fileid"] = "qrcode.jpg";//处理参数,规则参见:https://www.tencentcloud.com/document/product/436/54070?from_cn_redirect=1rule["rule"] = "QRcode/cover/<mode>";rules.Add(rule);o["rules"] = rules;string ruleString = o.ToString(Formatting.None);request.SetRequestHeader("Pic-Operations", ruleString);//执行请求PutObjectResult result = cosXml.PutObject(request);
//二维码覆盖功能,将对识别出的二维码覆盖上马赛克。取值为0或1。0表示不开启二维码覆盖,1表示开启二维码覆盖,默认值0QRCodeRecognitionRequest request = new QRCodeRecognitionRequest(bucket, key, 0);QRCodeRecognitionResult result = cosXml.QRCodeRecognition(request);
本页内容是否解决了您的问题?