Can HTML5 be used for QR code scanning and identification? -

Source: Internet
Author: User
0 reply content: the answer is yes.
Basic steps:
  1. Operate the camera to get the image.
    Technical Points: MediaStream, GetUserMedia, and File api.
  2. Canvas is used to analyze the image recognition results using related algorithms.
    Technical Points: getImageData

* Browsers (including mobile terminals) support different technical points. It is not realistic to develop and put them into production at this stage. For example, MediaStream support: http://caniuse.com/#feat=stream
* Recognition algorithms are difficult, but thanks to github. Thanks to the open-source community. @ Shou Jiesong's answer contains the phonegap plug-in address, which supports various codes. If you are using phonegap, you can use the barcode plugin https://github.com/phonegap/phonegap-plugins/tree/master/iOS/BarcodeScanner HTML5 is markup language and cannot process any data. To read the barcode, use javascript or PHP.
Add the barcode repository for javascript.
Http://badassjs.com/post/654334959/barcode-scanning-in-javascript Html5 does not provide the image decoding Extension function. You may need to implement decode qrcode image in the background.
However, there is a project named LazarSoft/jsqrcode GitHub.
You can use javascript to decode the image. You can use webcam to scan the QR code:
Https://webqr.com/
Https://www.the-qrcode-generator.com/scan If you want to perform static scanning, you have already replied a lot.

In addition, real-time scanning is not supported by all iOS browsers because iOS currently forces browsers to use Apple's own webKit kernel. Therefore, real-time web-based scanning cannot be achieved, it depends on when Apple has an alternative solution.

Https://developer.apple.com/app-store/review/guidelines/
2.17 Apps that browse the web must use the iOS WebKit framework and WebKit Javascript

Is WebRTC ready yet? It can be identified online. You can refer to the QR code Online Scanner and the QR code online decoding security detection. It is parsed using JS and html, but it can only be used in browsers that support html5.
Some technologies that need to be used are also mentioned upstairs
1. fileread reads the image information of the local QR code and constructs an input [type = file]
2. canvas drawing calculation, getImageData information, and then process the information
3. canvas screen removal technology.

The most important thing is the qrdecode algorithm, which is referenced by github's open-source project. LazarSoft/jsqrcode · GitHub

Merge the JS files and use it with canvas. For more information, see the case above! Identifiable. Take a look at the specific tool: the online QR code content recognition code is js, so you can use the console to see it, no confusion ~

The latest modification is made into the chrome browser plug-in. The name is 'simple QR code '. You can search the plug-in market to try it... You can try the above API module: http://www.jingshiba.com/BarcodeGenerator/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.