We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
The community reviewed whether to reopen this question 2 years ago and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
使用brew,可以轻松安装二维码阅读器zbar。
然后可以通过调用读取二维码:
另外@jm666,brew可以用来安装opencv。
Using brew, it is easy to install zbar, a QR code reader.
Then a QR code can be read by calling:
Also @jm666, brew can be used to install opencv.
不幸的是,最常用的库 libdecodeqr 依赖于 OpenCV (gtk2),并且编译起来太困难它在 OS X 上。(尝试编译它,因为
Image::DecodeQR
perl 模块需要它 - 但不成功)。幸运的是,找到了这个链接:http://macscripter.net/viewtopic.php?id=37404 引用下一条:
./configure --disable-video --without-python --without-gtk --without-qt
来配置构建过程,限制对 ImageMagick 的依赖。您将需要
ImageMagick
可以从 macports 安装。安装 ZBar 后,您可以使用
在 OS X Mavericks 10.9.2(和 Lion/10.7.5)上测试的命令很好地解码 qrcode - 并且运行良好。 因为它只依赖于 ImageMagick(存在于 macports 中)——应该也可以在其他 OS X 版本上轻松“编译”。
Unfortunately, the most used library libdecodeqr is depends on OpenCV (gtk2) and it is too hard to compile it on OS X. (Tried to compile it because it is needed by
Image::DecodeQR
perl module - but unsuccessful).Fortunately, found this link: http://macscripter.net/viewtopic.php?id=37404 from citing the next:
./configure --disable-video --without-python --without-gtk --without-qt
to configure the build process, limiting dependencies to ImageMagick.You will need
ImageMagick
what can be installed from macports.After installing the ZBar, you can nicely decode qrcode with a command
Tested on OS X Mavericks 10.9.2 (and Lion/10.7.5)- and works nicely. Becasue it only depends on ImageMagick (exists in macports)- should be easily "compilable" on other OS X versions too.
有一个名为 ZBar 的开源命令行工具。 它将照片作为参数,并从图像中检测到的任何 QRCode 中提取信息。
开源项目 QR-Reader-Mac 提供了一个充当包装器的 Applescript 脚本到
zbar
。 您可以创建用于处理 QRCode 的脚本的快捷方式或创建服务,如下所述。 该脚本将自动在您的默认浏览器中打开 QRCode 中包含的 URL。用法
一步步
使用Homebrew 可以轻松安装 ZBar :
要安装 QR-Reader-Mac:
打开 QR-Reader-Mac GitHub 项目页面< /a>,选择
代码
,并将项目下载为 ZIP 文件:双击 ZIP 文件将其解压。
双击您要安装的工作流程。 应出现以下弹出窗口:
按
安装
确认。打开“系统偏好设置”,然后在“键盘”>“键盘”下添加 open_QRCode 服务的快捷方式。 快捷方式> 服务> 一般的:
(重要:注意QR-Reader-Mac 期望在
/usr/local/bin/zbarimg
中找到可执行文件“zbarimg”,这是 Homebrew 将安装它的标准路径。)复制到剪贴板
QRCode2Clipboard .workflow
可用于将 QR 码的内容提取到剪贴板中。 它的安装方式与open_QRCode.workflow
相同。There is an open-source command line tool named ZBar. It takes a photo as an argument and extracts the information out of any QRCode that it detects in the image.
The open-source project QR-Reader-Mac provides an Applescript script that acts as a wrapper to
zbar
. You can create a shortcut to the script for processing QRCodes or create a service, as explained below. The script will automatically open the URL contained within the QRCode in your default browser.Usage
Step by step
ZBar can be easily installed with Homebrew:
To install QR-Reader-Mac:
Open the QR-Reader-Mac GitHub project page, select
Code
, and download the project as a ZIP file:Double click the ZIP file to extract it.
Double click the workflow you want to install. The following Pop-UP should appear:
Confirm by pressing
install
.Open System Preferences and add a shortcut to the open_QRCode service under Keyboard > Shortcuts > Services > General:
(Important: Note that QR-Reader-Mac expects to find the executable 'zbarimg' in
/usr/local/bin/zbarimg
, which is the standard path Homebrew will install it.)Copy to Clipboard
The
QRCode2Clipboard.workflow
can be used to extract the content of the QR-Codes into the Clipboard. It can be installed in the same way as theopen_QRCode.workflow
.