package com.*.controller;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baidu.aip.ocr.AipOcr;
@Controller
public class OcrController {
public net.sf.json.JSONObject OcrCheck()throws Exception {
ResponseResult result = new ResponseResult();
HashMap<String, String> options = new HashMap<String, String>();
Map<String, Object> resultMap=new HashMap<String, Object>();
net.sf.json.JSONObject jsonObj = new net.sf.json.JSONObject();
try {
//初始化客户端
AipOcr client=authService.Ocrinit();
//参数为图片外链
String image ="c:\\Users\\admin\\Desktop\\图片
java调用百度的文字识别接口
最新推荐文章于 2024-12-16 08:16:10 发布