tencent cloud

Image QR Code
Last updated:2024-02-29 16:52:32
Image QR Code
Last updated: 2024-02-29 16:52:32

Overview

This document provides an overview of APIs and SDK code samples for image QR codes.
API
Description
QR code recognition
Recognizes the location and content of valid QR codes in an image, outputs the text information (URL or text) contained in the QR codes, and pixelates the recognized QR codes.

QR Code Recognition

The QR code recognition feature recognizes the location and content of valid QR codes in an image, outputs the text information (URL or text) contained in the QR codes, and pixelates the recognized QR codes.

Recognizing QR code during upload

Feature description

The QR code recognition feature can recognize QR codes when files are uploaded.

Sample code

PutObjectRequest request = new PutObjectRequest(bucket, key, srcPath);

JObject o = new JObject();
// Do not return the input image
o["is_pic_info"] = 1;
JArray rules = new JArray();
JObject rule = new JObject();
rule["bucket"] = bucket;
rule["fileid"] = "qrcode.jpg";
// Processing parameters. For rules, visit https://www.tencentcloud.com/document/product/436/54070?from_cn_redirect=1.
rule["rule"] = "QRcode/cover/<mode>";
rules.Add(rule);
o["rules"] = rules;

string ruleString = o.ToString(Formatting.None);
request.SetRequestHeader("Pic-Operations", ruleString);
// Execute the request
PutObjectResult result = cosXml.PutObject(request);
Note:
For more complete samples, visit GitHub.

Recognizing QR code during download

Feature description

The QR code recognition feature can recognize QR codes when files are downloaded.

Sample code

// Pixelate the recognized QR code. Valid values: 0 (no), 1 (yes). Default value: 0.
QRCodeRecognitionRequest request = new QRCodeRecognitionRequest(bucket, key, 0);

QRCodeRecognitionResult result = cosXml.QRCodeRecognition(request);
Note:
For more complete samples, visit GitHub.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback