tencent cloud

Cloud Infinite

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Product Overview
Product Strengths
Use Cases
Feature Overview
Regions and Domains
Specifications and Limits
Billing
Billing Overview
Billing Mode
Billable Items
Free Tier
Payment Overdue
Viewing Bill Details
FAQs
Getting Started
Registering and Logging In
Bind Bucket
Uploading and Processing File
Downloading and Deleting Images
Unbinding Buckets
Using CI via COS
Features
Image Processing
Media Processing
Content Moderation
AI Content Recognition
File Processing
Smart Voice
File processing
User Guide
Overview
Bucket Management
Smart Toolbox
Job and Workflow
Data Monitoring
Usage statistics
Use Cases
Copyright Protection Solutions
Image Processing Practices
Working with API Authorization Policies
Workflow Practices
API Documentation
API Overview
Structure
Common Request Headers
Common Response Headers
Activate Vast Service
Image Processing
AI-Based Content Recognition
Smart Audio
Media Processing
Content Moderation
Document Processing
File Processing
Job and Workflow
Cloud Virus Detection
Error Codes
Request Signature
SDK Documentation
SDK Overview
Android SDK
iOS SDK
COS Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Go SDK
COS iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
Mini Program SDK
Personal Information Protection Policy for SDK
Security and Compliance
Permission ‍Management
FAQs
Basic Settings
Document Processing
Media Processing
Content Recognition
Smart Audio
Agreements
Service Level Agreement
Contact Us
Glossary

Image QR Code

PDF
Focus Mode
Font Size
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.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback