tencentcloud-sdk-ocr 3.0.974 → 3.0.975
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/VERSION +1 -1
- data/lib/v20181119/client.rb +26 -0
- data/lib/v20181119/models.rb +108 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d665c7c0991ba91851db12a378b8907ed7d7fd1f
|
4
|
+
data.tar.gz: bb439947d612d66f170f2e1f0bd80033128dc4d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23dec99a090ba1487706ee89b99f512494dfedb3c0f43d2737c6c21e94724abc7d2c8342aab014c9d5052fe3332245c48e806ca77ffcd6c75b3ddcc108f8a90f
|
7
|
+
data.tar.gz: a892bed7865938f1874be4d3485906a9375888403e2ad44323a2cfbe15c13f28a468c0ea4922f632641c33dee8d90954168e5981827f2694c5a097f9ecbc58c7
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.975
|
data/lib/v20181119/client.rb
CHANGED
@@ -83,6 +83,32 @@ module TencentCloud
|
|
83
83
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
84
84
|
end
|
85
85
|
|
86
|
+
# 本接口支持对中国大陆主流银行卡正反面关键字段的检测与识别,包括卡号、卡类型、卡名字、银行信息、有效期。支持竖排异形卡识别、多角度旋转图片识别。支持对复印件、翻拍件、边框遮挡的银行卡进行告警,可应用于各种银行卡信息有效性校验场景,如金融行业身份认证、第三方支付绑卡等场景。
|
87
|
+
|
88
|
+
# 默认接口请求频率限制:10次/秒。
|
89
|
+
|
90
|
+
# @param request: Request instance for BankCardOCR.
|
91
|
+
# @type request: :class:`Tencentcloud::ocr::V20181119::BankCardOCRRequest`
|
92
|
+
# @rtype: :class:`Tencentcloud::ocr::V20181119::BankCardOCRResponse`
|
93
|
+
def BankCardOCR(request)
|
94
|
+
body = send_request('BankCardOCR', request.serialize)
|
95
|
+
response = JSON.parse(body)
|
96
|
+
if response['Response'].key?('Error') == false
|
97
|
+
model = BankCardOCRResponse.new
|
98
|
+
model.deserialize(response['Response'])
|
99
|
+
model
|
100
|
+
else
|
101
|
+
code = response['Response']['Error']['Code']
|
102
|
+
message = response['Response']['Error']['Message']
|
103
|
+
reqid = response['Response']['RequestId']
|
104
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
105
|
+
end
|
106
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
107
|
+
raise e
|
108
|
+
rescue StandardError => e
|
109
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
110
|
+
end
|
111
|
+
|
86
112
|
# 本接口支持银行回单全字段的识别,包括付款开户行、收款开户行、付款账号、收款账号、回单类型、回单编号、币种、流水号、凭证号码、交易机构、交易金额、手续费、日期等字段信息。
|
87
113
|
|
88
114
|
# 默认接口请求频率限制:10次/秒。
|
data/lib/v20181119/models.rb
CHANGED
@@ -455,6 +455,114 @@ module TencentCloud
|
|
455
455
|
end
|
456
456
|
end
|
457
457
|
|
458
|
+
# BankCardOCR请求参数结构体
|
459
|
+
class BankCardOCRRequest < TencentCloud::Common::AbstractModel
|
460
|
+
# @param ImageBase64: 图片的 Base64 值。要求图片经Base64编码后不超过 7M,分辨率建议500*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。
|
461
|
+
# 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。
|
462
|
+
# @type ImageBase64: String
|
463
|
+
# @param ImageUrl: 图片的 Url 地址。要求图片经Base64编码后不超过 7M,分辨率建议500*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。
|
464
|
+
# 建议图片存储于腾讯云,可保障更高的下载速度和稳定性。
|
465
|
+
# @type ImageUrl: String
|
466
|
+
# @param RetBorderCutImage: 是否返回预处理(精确剪裁对齐)后的银行卡图片数据,默认false。
|
467
|
+
# @type RetBorderCutImage: Boolean
|
468
|
+
# @param RetCardNoImage: 是否返回卡号的切图图片数据,默认false。
|
469
|
+
# @type RetCardNoImage: Boolean
|
470
|
+
# @param EnableCopyCheck: 复印件检测开关,如果输入的图片是银行卡复印件图片则返回告警,默认false。
|
471
|
+
# @type EnableCopyCheck: Boolean
|
472
|
+
# @param EnableReshootCheck: 翻拍检测开关,如果输入的图片是银行卡翻拍图片则返回告警,默认false。
|
473
|
+
# @type EnableReshootCheck: Boolean
|
474
|
+
# @param EnableBorderCheck: 边框遮挡检测开关,如果输入的图片是银行卡边框被遮挡则返回告警,默认false。
|
475
|
+
# @type EnableBorderCheck: Boolean
|
476
|
+
# @param EnableQualityValue: 是否返回图片质量分数(图片质量分数是评价一个图片的模糊程度的标准),默认false。
|
477
|
+
# @type EnableQualityValue: Boolean
|
478
|
+
|
479
|
+
attr_accessor :ImageBase64, :ImageUrl, :RetBorderCutImage, :RetCardNoImage, :EnableCopyCheck, :EnableReshootCheck, :EnableBorderCheck, :EnableQualityValue
|
480
|
+
|
481
|
+
def initialize(imagebase64=nil, imageurl=nil, retbordercutimage=nil, retcardnoimage=nil, enablecopycheck=nil, enablereshootcheck=nil, enablebordercheck=nil, enablequalityvalue=nil)
|
482
|
+
@ImageBase64 = imagebase64
|
483
|
+
@ImageUrl = imageurl
|
484
|
+
@RetBorderCutImage = retbordercutimage
|
485
|
+
@RetCardNoImage = retcardnoimage
|
486
|
+
@EnableCopyCheck = enablecopycheck
|
487
|
+
@EnableReshootCheck = enablereshootcheck
|
488
|
+
@EnableBorderCheck = enablebordercheck
|
489
|
+
@EnableQualityValue = enablequalityvalue
|
490
|
+
end
|
491
|
+
|
492
|
+
def deserialize(params)
|
493
|
+
@ImageBase64 = params['ImageBase64']
|
494
|
+
@ImageUrl = params['ImageUrl']
|
495
|
+
@RetBorderCutImage = params['RetBorderCutImage']
|
496
|
+
@RetCardNoImage = params['RetCardNoImage']
|
497
|
+
@EnableCopyCheck = params['EnableCopyCheck']
|
498
|
+
@EnableReshootCheck = params['EnableReshootCheck']
|
499
|
+
@EnableBorderCheck = params['EnableBorderCheck']
|
500
|
+
@EnableQualityValue = params['EnableQualityValue']
|
501
|
+
end
|
502
|
+
end
|
503
|
+
|
504
|
+
# BankCardOCR返回参数结构体
|
505
|
+
class BankCardOCRResponse < TencentCloud::Common::AbstractModel
|
506
|
+
# @param CardNo: 卡号
|
507
|
+
# @type CardNo: String
|
508
|
+
# @param BankInfo: 银行信息
|
509
|
+
# @type BankInfo: String
|
510
|
+
# @param ValidDate: 有效期,格式如:07/2023
|
511
|
+
# @type ValidDate: String
|
512
|
+
# @param CardType: 卡类型
|
513
|
+
# @type CardType: String
|
514
|
+
# @param CardName: 卡名字
|
515
|
+
# @type CardName: String
|
516
|
+
# @param BorderCutImage: 切片图片数据
|
517
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
518
|
+
# @type BorderCutImage: String
|
519
|
+
# @param CardNoImage: 卡号图片数据
|
520
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
521
|
+
# @type CardNoImage: String
|
522
|
+
# @param WarningCode: WarningCode 告警码列表和释义:
|
523
|
+
# -9110:银行卡日期无效;
|
524
|
+
# -9111:银行卡边框不完整;
|
525
|
+
# -9112:银行卡图片反光;
|
526
|
+
# -9113:银行卡复印件;
|
527
|
+
# -9114:银行卡翻拍件
|
528
|
+
# (告警码可以同时存在多个)
|
529
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
530
|
+
# @type WarningCode: Array
|
531
|
+
# @param QualityValue: 图片质量分数,请求EnableQualityValue时返回(取值范围:0-100,分数越低越模糊,建议阈值≥50)。
|
532
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
533
|
+
# @type QualityValue: Integer
|
534
|
+
# @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
535
|
+
# @type RequestId: String
|
536
|
+
|
537
|
+
attr_accessor :CardNo, :BankInfo, :ValidDate, :CardType, :CardName, :BorderCutImage, :CardNoImage, :WarningCode, :QualityValue, :RequestId
|
538
|
+
|
539
|
+
def initialize(cardno=nil, bankinfo=nil, validdate=nil, cardtype=nil, cardname=nil, bordercutimage=nil, cardnoimage=nil, warningcode=nil, qualityvalue=nil, requestid=nil)
|
540
|
+
@CardNo = cardno
|
541
|
+
@BankInfo = bankinfo
|
542
|
+
@ValidDate = validdate
|
543
|
+
@CardType = cardtype
|
544
|
+
@CardName = cardname
|
545
|
+
@BorderCutImage = bordercutimage
|
546
|
+
@CardNoImage = cardnoimage
|
547
|
+
@WarningCode = warningcode
|
548
|
+
@QualityValue = qualityvalue
|
549
|
+
@RequestId = requestid
|
550
|
+
end
|
551
|
+
|
552
|
+
def deserialize(params)
|
553
|
+
@CardNo = params['CardNo']
|
554
|
+
@BankInfo = params['BankInfo']
|
555
|
+
@ValidDate = params['ValidDate']
|
556
|
+
@CardType = params['CardType']
|
557
|
+
@CardName = params['CardName']
|
558
|
+
@BorderCutImage = params['BorderCutImage']
|
559
|
+
@CardNoImage = params['CardNoImage']
|
560
|
+
@WarningCode = params['WarningCode']
|
561
|
+
@QualityValue = params['QualityValue']
|
562
|
+
@RequestId = params['RequestId']
|
563
|
+
end
|
564
|
+
end
|
565
|
+
|
458
566
|
# 银行回单识别出的字段
|
459
567
|
class BankSlipInfo < TencentCloud::Common::AbstractModel
|
460
568
|
# @param Name: 识别出的字段名称(关键字),支持以下字段:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tencentcloud-sdk-ocr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.975
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tencent Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tencentcloud-sdk-common
|