官方API地址为: https://console.faceplusplus.com.cn/documents/5671706
首先创建自己的账号 生成api_key api_secret
face++ 行驶证OCR识别

face++ 行驶证OCR识别
具体代码如下

public String ocrVehicleLicenseOrMergeFace(@RequestParam("imageUrl") String imageUrl,@RequestParam("group") String group,@RequestParam("type") Integer type) throws IOException {
		String image_url=FILE_INNER_URL+group+"/"+imageUrl;
		CloseableHttpClient httpClient = HttpClients.createDefault();
		HttpPost uploadFile = new HttpPost(LICENSE_URL);
		MultipartEntityBuilder builder = MultipartEntityBuilder.create();
		builder.addTextBody("api_key", API_KEY, ContentType.TEXT_PLAIN);
		builder.addTextBody("api_secret", API_SECRET, ContentType.TEXT_PLAIN);
		builder.addTextBody("image_url", image_url, ContentType.TEXT_PLAIN);
		// 把文件加到HTTP的post请求中
		HttpEntity multipart = builder.build();
		uploadFile.setEntity(multipart);
		CloseableHttpResponse  response = httpClient.execute(uploadFile);
		HttpEntity responseEntity = response.getEntity();
		//转换值
		String sResponse = EntityUtils.toString(responseEntity, "UTF-8");
		LicenseResult licenseResult = JSONObject.parseObject(sResponse, LicenseResult.class);
		return	JSONUtil.toJsonStringSUSSESS("查询成功", licenseResult);
	}
	```

相关文章:

  • 2021-04-12
  • 2021-11-09
  • 2021-07-22
  • 2021-07-25
  • 2022-12-23
  • 2021-05-23
  • 2021-09-21
  • 2021-08-11
猜你喜欢
  • 2021-11-14
  • 2021-04-19
  • 2022-12-23
  • 2021-05-27
  • 2021-08-29
  • 2021-07-14
  • 2021-07-02
相关资源
相似解决方案