Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二维码解析失败 #87

Open
qwe0099001 opened this issue Feb 24, 2021 · 1 comment
Open

二维码解析失败 #87

qwe0099001 opened this issue Feb 24, 2021 · 1 comment

Comments

@qwe0099001
Copy link

qwe0099001 commented Feb 24, 2021

用的使用手册里的二维码
image

代码
public Map qr(MultipartFile img) throws IOException, FormatException, ChecksumException, NotFoundException { Map<String,String> hashMap = new HashMap<>(); log.info(img.getOriginalFilename()); BufferedImage qrImg = ImageIO.read(img.getInputStream()); LuminanceSource source = new BufferedImageLuminanceSource(qrImg); BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); QRCodeReader qrCodeReader = new QRCodeReader(); Result result = qrCodeReader.decode(bitmap); hashMap.put("res",result.getText()); return hashMap; }

报错如下
{ "timestamp": "2021-02-24T14:24:38.823+00:00", "status": 500, "error": "Internal Server Error", "trace": "com.google.zxing.NotFoundException\r\n", "message": "No message available", "path": "/qrdecode" }

普通的二维码没事。

@liuyueyi
Copy link
Owner

因为改变了探测图形,zxing原生库识别率低,暂无解决办法(话说微信的二维码识别挺牛逼的,不知道怎么做的)
就看有没有大佬开源出识别率搞的识别库

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants