Baidu

win下安装tesserocr问题




适用于pip3 install tesserocr pillow 的同命相连的弟兄们

参考http://www.mamicode.com/info-detail-2353336.html
参考https://blog.csdn.net/qq_42172820/article/details/80674283
whl文件下载https://github.com/simonflueckiger/tesserocr-windows_build/releases


获取经纬度for微信小程序


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>行政区域工具</title>
<script type="text/javascript" src="http://map.qq.com/api/js?v=2.exp"></script>
</head>
<body>
<div style="width:520px;height:340px;border:1px solid gray" id="container"></div>
<p><input id="startBtn" type="button" onclick="startTool();" value="开启取点工具" /><input type="button" onclick="document.getElementById('info').innerHTML = '';points=[];" value="清除" /></p>
<div id="info"></div>
</body>
</html>
<script type="text/javascript">
var map = new qq.maps.Map("container");                        // 创建Map实例
//map.centerAndZoom("北京", 11);     // 初始化地图,设置中心点坐标和地图级别

var key = 1;    //开关
var newpoint;   //一个经纬度
var points = [];    //数组,放经纬度信息
var polyline = new qq.maps.Polyline(); //折线覆盖物

function startTool(){   //开关函数
if(key==1){
        document.getElementById("startBtn").style.background = "green";
        document.getElementById("startBtn").style.color = "white";
        document.getElementById("startBtn").value = "开启状态";
        key=0;
    }
    else{
        document.getElementById("startBtn").style.background = "red";
        document.getElementById("startBtn").value = "关闭状态";
        key=1;
    }
}
qq.maps.event.addListener(map,'click',function(e){   //单击地图,形成折线覆盖物
    newpoint = new qq.maps.Point(e.latLng.getLng(),e.latLng.getLat());
    if(key==0){
    //    if(points[points.length].lng==points[points.length-1].lng){alert(111);}
        points.push(newpoint);  //将新增的点放到数组中
        polyline.setPath(points);   //设置折线的点数组
        //map.addOverlay(polyline);   //将折线添加到地图上
           // polyline.setMap(polyline);
        document.getElementById("info").innerHTML += "{longitude:" + e.latLng.getLng() + ",latitude:" + e.latLng.getLat()+ "},</br>";    //输出数组里的经纬度
    }
});
qq.maps.event.addListener(map,"dblclick",function(e){   //双击地图,形成多边形覆盖物
if(key==0){
        map.disableDoubleClickZoom();   //关闭双击放大
var polygon = new qq.maps.Polygon(points);
        //map.addOverlay(polygon);   //将折线添加到地图上
    }
});
</script>

计科1602&电信1602团日活动java代码


package com.zing2;

import java.io.File;
import java.nio.file.Path;
import java.util.HashMap;

import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.datamatrix.encoder.ErrorCorrection;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;

//生成二维码
public class CreateQRcode {

    public static void main(String[] args) {
        
    int width=300;
    int height=300;
    String format="png";
    double i=100*Math.random();
    String str_j = Double.toString(i);
    String content="优惠券码"+str_j+"        计科1602&电信1602团日活动";
    
    //定义二维码的参数
    HashMap hints= new HashMap();
    hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
    hints.put(EncodeHintType.ERROR_CORRECTION,ErrorCorrectionLevel.M);
    hints.put(EncodeHintType.MARGIN, 2);
    
    try {
        BitMatrix bitMatrix  ; 
        bitMatrix=new MultiFormatWriter().encode(content,BarcodeFormat.QR_CODE,width,height,hints);
        Path file = new File("D:/code/1.png").toPath();
        MatrixToImageWriter.writeToPath(bitMatrix, format, file);
        System.out.println(i);
    
    } catch (Exception e) {
        
        e.printStackTrace();
    }
    }

}