简介
本文档提供关于 Logo 识别的相关 API 概览以及 SDK 示例代码。
API | 操作描述 |
腾讯云数据万象通过 RecognizeLogo 接口实现对图片内电商 Logo 的识别,返回图片中 Logo 的名称、坐标、置信度分值。返回图片中 Logo 的名称、坐标、置信度分值。图片 Logo 识别请求包属于 GET 请求,请求时需要携带签名。 |
Logo 识别
腾讯云数据万象通过 RecognizeLogo 接口实现对图片内电商 Logo 的识别,返回图片中 Logo 的名称、坐标、置信度分值。返回图片中 Logo 的名称、坐标、置信度分值。图片 Logo 识别请求包属于 GET 请求,请求时需要携带签名。
方法原型
func (s *CIService) GetRecognizeLogo(ctx context.Context, name string, opt *RecognizeLogoOptions) (*RecognizeLogoResults, *Response, error)
请求示例
// 将 examplebucket-1250000000 和 COS_REGION 修改为真实的信息bu, _ := url.Parse("https://examplebucket-1250000000.cos.COS_REGION.myqcloud.com")b := &cos.BaseURL{BucketURL: bu}c := cos.NewClient(b, &http.Client{Transport: &cos.AuthorizationTransport{SecretID: os.Getenv("SECRETID"),SecretKey: os.Getenv("SECRETKEY"),}})opt := &cos.RecognizeLogoOptions{}obj := "pic/logo.jpeg"res, _, err := c.CI.GetRecognizeLogo(context.Background(), obj, opt)log_status(err)fmt.Printf("%+v\\n", res)
参数说明
type RecognizeLogoOptions struct {DetectUrl string `url:"detect-url,omitempty"`}
参数名称 | 参数描述 | 类型 | 是否必填 |
DetectUrl | 您可以通过填写 detect-url 处理任意公网可访问的图片链接。不填写 detect-url 时,后台会默认处理 name ,填写了 detect-url 时,后台会处理 detect-url 链接,无需再填写 name。 | string | 否 |
结果说明