使用自定义搜索API(REST JSON)搜索方形图像 [英] Using the Custom Search API (REST JSON) to search for square images

查看:149
本文介绍了使用自定义搜索API(REST JSON)搜索方形图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用谷歌的 JSON的自定义搜索API 了解,涉及项目创造了职业足球/足球运动员的配置文件。如果我用谷歌图片定期搜索任何球员,并在搜索玩家名,目前球队设置为固定 - 搜索工具格式>面部和高级搜索设置为比 - 纵横>广场,然后我通常得到完美的配置文件爆头作为第一个结果。这将是理想的项目,因为每个形象都有是正方形。

I'm using Google's JSON Custom Search API for a project that involves creating profiles for professional football/soccer players. If I search any player with Google Images regularly and search in a "Player name, Current team" format with the Search Tools set to Type->Face and Advanced Search set to aspect ratio->Square, then I typically get a perfect "profile" headshot as the first result. This would be ideal for the project, as every image has to be square.

使用上述API,我可以做到这一切除了方形限制。我可以使用参数来搜索人脸图像的,显然我可以设置查询。但我无法找到任何参数,让我到指定的纵横比,甚至自定义尺寸。有方形的图像效果时,我只是一个浏览器搜索参数,但使用的API时也不会产生相同的结果。

Using the aforementioned API, I can do all of this except for the square restriction. I can use a parameter to search for face images and obviously I can set the query. But I cannot find any kind of parameter that would allow me to specify an aspect ratio or even custom sizes. There is a parameter for square image results when I just search with a browser, but it does not produce the same result when using the API.

有搜索只是方形图像任何可能的方式?也许一些其他类型的图像搜索API会更适用在这里,它只是必须足够大到有1992从present体育相关的图像,但是从2000+大多是东西,无论如何,这样应该不会太太大的问题。

Is there any possible way to search for just square images? Maybe some other kind of image search API would be more applicable here, it just has to be large enough to have sports-related images from 1992-present, but mostly stuff from 2000+ anyway, so that shouldn't be too much of a problem.

推荐答案

有关谷歌图片搜索长宽比参数是 IAR

Aspect Ratio parameter for google image search is iar

tbs=iar:xw (panaromic)
tbs=iar:s  (square)
tbs=iar:t  (Tall)

这篇关于使用自定义搜索API(REST JSON)搜索方形图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆