- 浏览: 361845 次
- 性别:
- 来自: 四川
文章分类
- 全部博客 (247)
- 数据库以及sql (11)
- java (48)
- 爬虫学习 (20)
- java编程 (28)
- python编程以及安装和配置 (27)
- oracle数据库 (32)
- mongodb基本操作 (4)
- linux学习 (7)
- easyUI (2)
- nodeJs (8)
- python学习 (16)
- 其他 (13)
- hadoop (1)
- svn (1)
- 汉字 (1)
- windows (2)
- jsp (5)
- fiddler (1)
- ETL (1)
- teamviewer (1)
- maven (4)
- GIT (2)
- datagrip (1)
- ocr (1)
- redis (3)
- mysql (3)
- linux (1)
- 数据服务 (0)
最新评论
图片识别平台:https://www.juhe.cn/
调用平台提供的接口进行图片识别
注:将本地图片进行Base64位编码
本类只用到这两个方法:encodeImgageToBase64(),readContentFromPost()。
代码:
package com.teamdev.jxbrowser.chromium.demoJD.yyzz;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import javax.imageio.ImageIO;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import com.teamdev.jxbrowser.chromium.demoJD.yyzz.ImageUtils;
import sun.misc.BASE64Encoder;
public class ImageUtils {
/**
* 将本地图片进行Base64位编码
*
* @param imgUrl
* 图片的url路径,如xxx.jpg
* @return
*/
@SuppressWarnings("deprecation")
public static String encodeImgageToBase64(File imageFile) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
ByteArrayOutputStream outputStream = null;
try {
BufferedImage bufferedImage = ImageIO.read(imageFile);
outputStream = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "jpg", outputStream);
} catch (MalformedURLException e1) {
e1.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// 对字节数组Base64编码
BASE64Encoder encoder = new BASE64Encoder();
return java.net.URLEncoder.encode( encoder.encode(outputStream.toByteArray()));// 返回Base64编码过的字节数组字符串
}
/**
* 删除会话文件
* */
public static void DeleteSession() {
String path="F:\\yzm\\yzm.jpg";
File file =new File(path);
if (file.exists()) {
try {
file.delete();
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("faile delete session.txt ");
}
}
}
/**
* 下载图片
* */
public static void runDownLoad(String fileurl) {
// 构造URL
URL url;
try {
url = new URL(fileurl);
// 打开URL连接
URLConnection con = (URLConnection) url.openConnection();
// 得到URL的输入流
InputStream input = con.getInputStream();
// 设置数据缓冲
byte[] bs = new byte[1024 * 2];
// 读取到的数据长度
int len;
// 输出的文件流保存图片至本地
String path1 = "F:\\yzm\\yzm.jpg";
File f = new File(path1);
// f.mkdirs();
OutputStream os = new FileOutputStream(path1);
while ((len = input.read(bs)) != -1) {
os.write(bs, 0, len);
}
os.close();
input.close();
} catch (MalformedURLException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url
* 发送请求的 URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
/**
* 解析验证码
* @throws Exception
* */
public static String readContentFromPost(String imgPath) throws IOException {
String str = ImageUtils.encodeImgageToBase64(new File(imgPath));
URL postUrl = new URL("http://op.juhe.cn/vercode/index");
HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestMethod("POST");
connection.setUseCaches(false);
connection.setInstanceFollowRedirects(true);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.connect();
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
String content = "codeType=8003&&image=&base64Str=" + str + "&dtype=&key=bdb9286128139fa1a61d8b7ca84ab171";
out.writeBytes(content);
out.flush();
out.close();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
StringBuilder sb=new StringBuilder();
while ((line = reader.readLine()) != null) {
System.out.println(line);
sb.append(line);
}
//{"reason":"成功的返回","result":"rahu","error_code":0}
String result=sb.toString().split("result\":\"")[1].split("\",")[0];
reader.close();
connection.disconnect();
return result;
}
//测试
public static void main(String[] args) throws IOException{
System.out.println(readContentFromPost("F:\\yzm\\yzm.jpg"));
}
}
==================================================================自己的代码
package com.teamdev.jxbrowser.chromium.demoJD.yyzz;
/**
* 抓取京东营业执照信息
* */
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserPreferences;
import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.LoggerProvider;
import com.teamdev.jxbrowser.chromium.events.FinishLoadingEvent;
import com.teamdev.jxbrowser.chromium.events.LoadAdapter;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;
public class jd_yyzz {
private static final Color White = null;
/**
*======== 主方法
* */
public static void main(String[] args) throws Exception {
//获取url,解析验证码
String shop_url =Get_Shop_url();
String html=saveImage(shop_url);
System.out.println(html);
}
/**
* ========获取url
* */
public static String Get_Shop_url(){
//此处连接数据库,查询出所有url
String shop_url="https://mall.jd.com/showLicence-652046.html";
return shop_url;
}
/**
* 模拟器截图(只是截取验证码), 调用接口,解析验证码,填入输入框并点击验证,返回验证成功后的html数据
* */
public static String saveImage(String url){
LoggerProvider.getBrowserLogger().setLevel(Level.SEVERE);
LoggerProvider.getIPCLogger().setLevel(Level.SEVERE);
LoggerProvider.getChromiumProcessLogger().setLevel(Level.SEVERE);
Browser browser = new Browser();
BrowserView view = new BrowserView(browser);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.add(view, BorderLayout.CENTER);
frame.setSize(700, 500);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
BrowserPreferences preferences = browser.getPreferences();
preferences.setImagesEnabled(false);
int viewWidth = 1280;
int viewHeight = 1000;
// Resize view to the required size
view.setBounds(new Rectangle(viewWidth, viewHeight));
// Wait until web page is loaded completely
invokeAndWaitReady(browser,new jd_yyzz().new ViewThread(browser, url));
JSValue bodyHeight = null;
int firstHeight = 400;
int nowHeight = 400;
while (firstHeight != nowHeight) {
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
firstHeight = nowHeight;
bodyHeight = browser.executeJavaScriptAndReturnValue("document.body.scrollHeight");
//nowHeight = 900;
for (int i = firstHeight; i < nowHeight; i = i + 300) {
browser.executeJavaScriptAndReturnValue("window.scrollTo(0,"+ i + ")");
try {
Thread.sleep(500);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
System.out.println(firstHeight + ":" + nowHeight);
}
viewHeight = nowHeight + 50;
view.setBounds(new Rectangle(viewWidth, viewHeight));
System.out.println("11111------------------:" + viewHeight);
try {
Thread.sleep(1000 * 1);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
bodyHeight = browser.executeJavaScriptAndReturnValue("document.body.scrollHeight");
System.out.println("222222------------------:" + bodyHeight);
int viewHeight_new = ((Number) bodyHeight.getNumber()).intValue() + 50;
if (viewHeight_new > viewHeight) {
System.out.println("33333------------------:" + viewHeight_new);
}
Image image = view.getImage();
BufferedImage bufferedImage = new BufferedImage(100, 50,BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D graphics = (Graphics2D) bufferedImage.getGraphics();
Double scale = 1.0 / view.getDeviceScaleFactor();
graphics.scale(scale, scale);
graphics.drawImage(image,-585, -355, image.getWidth(view), image.getHeight(view),White, null);
try {
String path = "f://shopdetails.jpg";
ImageIO.write(bufferedImage, "JPG", new File(path));
bufferedImage = null;
} catch (IOException e) {
e.printStackTrace();
}
//验证码图片保存之后获取验证码
try {
String result=ImageUtils.readContentFromPost("f://shopdetails.jpg");
browser.executeJavaScriptAndReturnValue("document.getElementById('verifyCode').value = \""+ result + "\";");
Thread.sleep(1000 * 1);
browser.executeJavaScriptAndReturnValue("document.getElementsByClassName('btn')[0].click();");
Thread.sleep(1000 * 1);
return browser.getHTML();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
/**
* 线程
* */
class ViewThread extends Thread {
Browser browser;
String openUrl;
public ViewThread(Browser browser, String openUrl) {
this.browser = browser;
this.openUrl = openUrl;
}
public void run() {
browser.loadURL(openUrl);
}
}
/**
* 模拟器加载url
* */
public static void invokeAndWaitReady(Browser browser, Runnable runnable) {
final CountDownLatch latch = new CountDownLatch(1);
LoadAdapter listener = new LoadAdapter() {
@Override
public void onFinishLoadingFrame(FinishLoadingEvent event) {
if (event.isMainFrame()) {
latch.countDown();
}
}
};
browser.addLoadListener(listener);
try {
runnable.run();
try {
if (!latch.await(60, TimeUnit.SECONDS)) {
// throw new RuntimeException(new TimeoutException());
}
} catch (InterruptedException ignore) {
ignore.printStackTrace();
Thread.currentThread().interrupt();
}
} finally {
browser.removeLoadListener(listener);
}
}
}
调用平台提供的接口进行图片识别
注:将本地图片进行Base64位编码
本类只用到这两个方法:encodeImgageToBase64(),readContentFromPost()。
代码:
package com.teamdev.jxbrowser.chromium.demoJD.yyzz;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import javax.imageio.ImageIO;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import com.teamdev.jxbrowser.chromium.demoJD.yyzz.ImageUtils;
import sun.misc.BASE64Encoder;
public class ImageUtils {
/**
* 将本地图片进行Base64位编码
*
* @param imgUrl
* 图片的url路径,如xxx.jpg
* @return
*/
@SuppressWarnings("deprecation")
public static String encodeImgageToBase64(File imageFile) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
ByteArrayOutputStream outputStream = null;
try {
BufferedImage bufferedImage = ImageIO.read(imageFile);
outputStream = new ByteArrayOutputStream();
ImageIO.write(bufferedImage, "jpg", outputStream);
} catch (MalformedURLException e1) {
e1.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// 对字节数组Base64编码
BASE64Encoder encoder = new BASE64Encoder();
return java.net.URLEncoder.encode( encoder.encode(outputStream.toByteArray()));// 返回Base64编码过的字节数组字符串
}
/**
* 删除会话文件
* */
public static void DeleteSession() {
String path="F:\\yzm\\yzm.jpg";
File file =new File(path);
if (file.exists()) {
try {
file.delete();
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("faile delete session.txt ");
}
}
}
/**
* 下载图片
* */
public static void runDownLoad(String fileurl) {
// 构造URL
URL url;
try {
url = new URL(fileurl);
// 打开URL连接
URLConnection con = (URLConnection) url.openConnection();
// 得到URL的输入流
InputStream input = con.getInputStream();
// 设置数据缓冲
byte[] bs = new byte[1024 * 2];
// 读取到的数据长度
int len;
// 输出的文件流保存图片至本地
String path1 = "F:\\yzm\\yzm.jpg";
File f = new File(path1);
// f.mkdirs();
OutputStream os = new FileOutputStream(path1);
while ((len = input.read(bs)) != -1) {
os.write(bs, 0, len);
}
os.close();
input.close();
} catch (MalformedURLException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url
* 发送请求的 URL
* @param param
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
/**
* 解析验证码
* @throws Exception
* */
public static String readContentFromPost(String imgPath) throws IOException {
String str = ImageUtils.encodeImgageToBase64(new File(imgPath));
URL postUrl = new URL("http://op.juhe.cn/vercode/index");
HttpURLConnection connection = (HttpURLConnection) postUrl.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestMethod("POST");
connection.setUseCaches(false);
connection.setInstanceFollowRedirects(true);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.connect();
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
String content = "codeType=8003&&image=&base64Str=" + str + "&dtype=&key=bdb9286128139fa1a61d8b7ca84ab171";
out.writeBytes(content);
out.flush();
out.close();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
StringBuilder sb=new StringBuilder();
while ((line = reader.readLine()) != null) {
System.out.println(line);
sb.append(line);
}
//{"reason":"成功的返回","result":"rahu","error_code":0}
String result=sb.toString().split("result\":\"")[1].split("\",")[0];
reader.close();
connection.disconnect();
return result;
}
//测试
public static void main(String[] args) throws IOException{
System.out.println(readContentFromPost("F:\\yzm\\yzm.jpg"));
}
}
==================================================================自己的代码
package com.teamdev.jxbrowser.chromium.demoJD.yyzz;
/**
* 抓取京东营业执照信息
* */
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserPreferences;
import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.LoggerProvider;
import com.teamdev.jxbrowser.chromium.events.FinishLoadingEvent;
import com.teamdev.jxbrowser.chromium.events.LoadAdapter;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;
public class jd_yyzz {
private static final Color White = null;
/**
*======== 主方法
* */
public static void main(String[] args) throws Exception {
//获取url,解析验证码
String shop_url =Get_Shop_url();
String html=saveImage(shop_url);
System.out.println(html);
}
/**
* ========获取url
* */
public static String Get_Shop_url(){
//此处连接数据库,查询出所有url
String shop_url="https://mall.jd.com/showLicence-652046.html";
return shop_url;
}
/**
* 模拟器截图(只是截取验证码), 调用接口,解析验证码,填入输入框并点击验证,返回验证成功后的html数据
* */
public static String saveImage(String url){
LoggerProvider.getBrowserLogger().setLevel(Level.SEVERE);
LoggerProvider.getIPCLogger().setLevel(Level.SEVERE);
LoggerProvider.getChromiumProcessLogger().setLevel(Level.SEVERE);
Browser browser = new Browser();
BrowserView view = new BrowserView(browser);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.add(view, BorderLayout.CENTER);
frame.setSize(700, 500);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
BrowserPreferences preferences = browser.getPreferences();
preferences.setImagesEnabled(false);
int viewWidth = 1280;
int viewHeight = 1000;
// Resize view to the required size
view.setBounds(new Rectangle(viewWidth, viewHeight));
// Wait until web page is loaded completely
invokeAndWaitReady(browser,new jd_yyzz().new ViewThread(browser, url));
JSValue bodyHeight = null;
int firstHeight = 400;
int nowHeight = 400;
while (firstHeight != nowHeight) {
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
firstHeight = nowHeight;
bodyHeight = browser.executeJavaScriptAndReturnValue("document.body.scrollHeight");
//nowHeight = 900;
for (int i = firstHeight; i < nowHeight; i = i + 300) {
browser.executeJavaScriptAndReturnValue("window.scrollTo(0,"+ i + ")");
try {
Thread.sleep(500);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
System.out.println(firstHeight + ":" + nowHeight);
}
viewHeight = nowHeight + 50;
view.setBounds(new Rectangle(viewWidth, viewHeight));
System.out.println("11111------------------:" + viewHeight);
try {
Thread.sleep(1000 * 1);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
bodyHeight = browser.executeJavaScriptAndReturnValue("document.body.scrollHeight");
System.out.println("222222------------------:" + bodyHeight);
int viewHeight_new = ((Number) bodyHeight.getNumber()).intValue() + 50;
if (viewHeight_new > viewHeight) {
System.out.println("33333------------------:" + viewHeight_new);
}
Image image = view.getImage();
BufferedImage bufferedImage = new BufferedImage(100, 50,BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D graphics = (Graphics2D) bufferedImage.getGraphics();
Double scale = 1.0 / view.getDeviceScaleFactor();
graphics.scale(scale, scale);
graphics.drawImage(image,-585, -355, image.getWidth(view), image.getHeight(view),White, null);
try {
String path = "f://shopdetails.jpg";
ImageIO.write(bufferedImage, "JPG", new File(path));
bufferedImage = null;
} catch (IOException e) {
e.printStackTrace();
}
//验证码图片保存之后获取验证码
try {
String result=ImageUtils.readContentFromPost("f://shopdetails.jpg");
browser.executeJavaScriptAndReturnValue("document.getElementById('verifyCode').value = \""+ result + "\";");
Thread.sleep(1000 * 1);
browser.executeJavaScriptAndReturnValue("document.getElementsByClassName('btn')[0].click();");
Thread.sleep(1000 * 1);
return browser.getHTML();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
/**
* 线程
* */
class ViewThread extends Thread {
Browser browser;
String openUrl;
public ViewThread(Browser browser, String openUrl) {
this.browser = browser;
this.openUrl = openUrl;
}
public void run() {
browser.loadURL(openUrl);
}
}
/**
* 模拟器加载url
* */
public static void invokeAndWaitReady(Browser browser, Runnable runnable) {
final CountDownLatch latch = new CountDownLatch(1);
LoadAdapter listener = new LoadAdapter() {
@Override
public void onFinishLoadingFrame(FinishLoadingEvent event) {
if (event.isMainFrame()) {
latch.countDown();
}
}
};
browser.addLoadListener(listener);
try {
runnable.run();
try {
if (!latch.await(60, TimeUnit.SECONDS)) {
// throw new RuntimeException(new TimeoutException());
}
} catch (InterruptedException ignore) {
ignore.printStackTrace();
Thread.currentThread().interrupt();
}
} finally {
browser.removeLoadListener(listener);
}
}
}
发表评论
-
是什么java多态
2018-11-14 13:43 591Java多态 例1.1+1=2 例2."1&quo ... -
经纬度转换
2018-09-25 13:57 0package com.teamdev.jxbrowser.c ... -
java连接池技术
2018-09-04 14:26 320转:https://www.cnblogs.com/xdp-g ... -
java 提取url字符串中的域名
2018-08-30 15:24 7280package com.teamdev.jxbrowser.c ... -
java多线程中锁(lock)、wait、notify()的使用
2018-07-13 11:31 5628package com.kai.多线程间的通信; impor ... -
java多线程间的通信实例
2018-07-13 11:00 1329----线程间的通信 public class ListAd ... -
volatile关键字
2018-07-12 11:20 581volatile:使变量在多个线程间可见 public c ... -
java根据百度url获取真正的网页地址
2018-07-09 11:26 918/** * 根据百度url,获取原本url * @th ... -
java中的base64字符流与图片的相互转换
2018-06-29 13:27 1177//base64字符串转化成图片 public sta ... -
java去除图片水印的解决办法
2018-06-28 10:54 3181原文地址:http://www.oicqzone.com/pc ... -
java中的中文字符转URLEncode
2018-06-26 11:26 733String urlTypeName =java.net.UR ... -
java下载图片到本地实例
2018-06-25 15:34 1295public static void main(String[ ... -
Myeclipse中如何更改jsp默认的打开方式
2018-05-04 17:44 5611.打开myeclipse 2.点击上方的 window-&g ... -
java三大范式
2018-05-02 09:50 678参考地址:https://www.cnblogs.com/ja ... -
请求中设置代理IP
2018-04-18 16:24 887(不能直接JVM设置代理 System.getProperti ... -
java获取当前时间的时间戳
2018-04-08 09:25 1412package com.teamdev.jxbrowser.c ... -
java四种线程池实例 (kaigege)
2018-03-28 11:03 640Java通过Executors提供四种线程池: 1.newCa ... -
java获取IP地址(windos,linux)皆可
2018-03-28 09:44 726package com.teamdev.jxbrowser.c ... -
post 请求
2018-02-05 16:32 470public static void trustEveryo ... -
java robot控制鼠标和键盘(笔记本中打印 i love you)(滑动)
2018-01-25 16:57 2024package robot_java; import jav ...
相关推荐
前三步和人脸检测几乎一样 人脸检测地址 ...唯一不同的,就是我们需要创建一个通用物体和场景识别,重新...识别图片 PictureRecognition类 import java.net.URLEncoder; /** * 通用物体和场景识别 */ public class Pictu
本源码适合正在学习人脸识别的学员,java调用人脸识别接口实现。
主要介绍了Java编程调用微信接口实现图文信息等推送功能,涉及java微信图文信息推送接口调用及相关文件、字符串编码转换相关操作技巧,需要的朋友可以参考下
上传图片格式的发票,调用百度接口识别发票信息。文字识别提供多种场景下精准的图像文字识别技术服务让您的应用看图识字,提升输入效率,优化用户体验
博文配套的源码,初稿,用java调用科大讯飞的离线语音识别dll实现离线识别,只要路径对了,就绝对能运行,跟机型无关,操作系统windows
对图片进行水印处理,利用TESS4J识别图片并提取信息生成excel表格。里面有字库文件所以占用空间较大。 说明:https://blog.csdn.net/xlantian/article/details/80789115
Java EE调用百度API,进行人脸注册,注册后可以登陆,会调用百度API人脸搜索,搜索成功即可登陆,填写自己申请的百度API密钥即可使用
敏感人脸识别:用户的头像、文章图片、用户上传图片等进行相关检测 注意事项 此处微信出于自己安全考虑对频率进行了限制 单个appid被限制调用频率如下:2000次/分钟,200000次/天 单个文件大小不能超过10M
阿里云表格识别500次 0元,请自己购买 全网独家,手写程序并测试,完美... ②默认表格图片识别后,excle文件输出到桌面test文件夹,跟图片名一样 IdCardOCR(身份证识别)中直接右键run 身份证识别没有充足时间调试
java实现人脸识别登录验证,通过调用百度云提供的人脸识别接口,实现登录验证功能
java 调用百度人脸对比api接口(csdn)————程序
使用JAVA语言(Servlet)开发的微信语音识别功能,当用户输入语音可以智能的进行识别。 提供源码下载,想研究微信语音的可以下载学习。想要更多源码可以关注私信我。
比如说讯飞的语音识别,我们调用它的识别方法之后不是马上就可以得到识别的结果,需要经过一段时间(网络传输耗时),但是我们不会让程序傻逼地等待它的返回结果,而是让classA实现它定义的接口IntefaceC,当讯飞的...
使用java封装的百度身份证识别接口,可以直接使用,并整合到自己的项目中。
JAVA中医舌诊接口使用示例代码,JAVA舌象图特征人工智能识别代码。检测图像中的舌象,并提取出舌体区域,识别舌象特征属性描述,基于舌象特征辨识体质健康状态、按性别和年龄健康指导。先舌诊辨识体质,按年龄、性别...
通过java代码使用yolov3的示例代码,yolov3是先进的图片内物品识别的神经网络。由于目前通过jvm运行神经网络效率较低,项目的示例意义大于实用意义。 此项目参考了yolov2的java项目:...
通过调用百度AI的接口实现提取图片文字的java项目,可用于图片文字识别,身份证信息获取验证,证书内容获取
图像识别TAipImageClassify( 物体场景、图片标签、花草/车辆、看图说话、模糊图片检测、美食图片识别 )接口调用服务。人脸识别TAipFace( 人脸检测与分析、多人脸检测、人脸对比、跨年龄人脸识别、五官定位、人脸搜索...
这个问题是无法找到头像,目前我遇到的原因是因为用IPHONE拍照导致的,因为IPHONE拍照后存储时,IPHONE进行了拉伸导致无法识别头像,对于IPHONE拍照的问题,可以用ImageResizerPortable工具批量缩放50%,再 进行...
主要为大家详细介绍了java实现腾讯ocr图片识别接口调用,拍车牌识别车牌号功能,具有一定的参考价值,感兴趣的小伙伴们可以参考一下