javascript 在 PHP Web 应用程序中从网络摄像头读取条码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9058973/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 05:28:18  来源:igfitidea点击:

Reading barcode from webcam in PHP web application

phpjavascriptflashwebcambarcode

提问by Tural Ali

Want to add following feature to my web application: To decode barcodes generated by this script. with webcam and use values in PHP web application.

想要向我的 Web 应用程序添加以下功能:解码由此脚本生成的条形码。使用网络摄像头并在 PHP Web 应用程序中使用值。

Is that possible? if yes how?

那可能吗?如果是,如何?

采纳答案by elimirks

Not with PHP, seeing as it is server side. But, you could accomplish this with java, javascript, or some other client side languages.

不是 PHP,因为它是服务器端。但是,您可以使用 java、javascript 或其他一些客户端语言来完成此操作。

javascript (jQuery) webcam plugin

javascript (jQuery) 网络摄像头插件

http://www.xarg.org/project/jquery-webcam-plugin/

http://www.xarg.org/project/jquery-webcam-plugin/

EDIT -- how this would be done is to take the picture with javascript, and then send it back to the server to decode by PHP.

编辑 - 如何做到这一点是用 javascript 拍摄图片,然后将其发送回服务器以通过 PHP 进行解码。

http://www.inliteresearch.com/homepage/support/kb_programming.html

http://www.inliteresearch.com/homepage/support/kb_programming.html

回答by Schuyler Cumbie

I happened to come across a project where someone actually accomplished this in a pretty nice way using Javascript:

我碰巧遇到一个项目,其中有人实际上使用 Javascript 以一种非常好的方式完成了这项工作:

https://serratus.github.io/quaggaJS/

https://serratus.github.io/quaggaJS/

It only handles a few types of barcodes, but it may be a good starting point if you need the others. You can most likely have Javascript post these back to PHP using AJAX or have them update a form field to be submitted.

它只处理几种类型的条形码,但如果您需要其他条形码,它可能是一个很好的起点。您很可能可以让 Javascript 使用 AJAX 将这些发回 PHP,或者让它们更新要提交的表单字段。