<br><font color="#0000C6"><font size="5"><strong>Linux条形码APIs</font></strong></br>
在 Linux 上有读取链接库如<a href="https://github.com/zxing/zxing" target="_blank" rel="nofollow">zxing</a>可用的全功能性开放源码函式库(Apache 2),或是<a href="https://github.com/zxing/zxing" target="_blank" rel="nofollow">ZBar</a> (LGPL 2.1)。而zxing着重于Java程序,ZBar能应用在C语言,因此不需要透过Java来执行。在下列描述中,我们将使用ZBar API。
<font color="#0000C6"><font size="5"><strong>与INTEL® EDISON搭配的USB网络摄影机</font></strong>
关于最近与Intel® Edison搭配的Yocto映射档, 已包含<a href="https://en.wikipedia.org/wiki/USB_video_device_class" target="_blank" rel="nofollow">UVC USB cameras</a>驱动程序,所以您可以直接使用这些网络摄影机。而其他如<a href="https://en.wikipedia.org/wiki/USB_video_device_class" rel="nofollow">gspca</a>的网络摄影机,您可能在使用前需要先建立驱动程序。
<font color="#0000C6"><font size="5"><strong>安装ZBar</font></strong>
若我们想要利用zbar做实时视讯与静态影像功能。若想要使用静态影像功能,需要从<a href="http://repo.opkg.net/edison/repo/core2-32/" rel="nofollow">repo.opkg.net</a>依照其安装步骤来安装<a href="http://www.imagemagick.org/" target="_blank" rel="nofollow">ImageMagick</a>链接库。
# opkg install imagemagick_dev
# wget http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10.tar.bz2
# cd zbar-0.10
# ./configure --without-qt --without-gtk --without-xv --without-xshm --with-imagemagick --with-x=no --prefix="/usr"
[...]
which should end after some time with
[...]
please verify that the detected configuration matches your expectations:
------------------------------------------------------------------------
[...]
X --with-x=disabled
pthreads --enable-pthread=yes
v4l --enable-video=yes
jpeg --with-jpeg=yes
Magick++ --with-imagemagick=yes
Python --with-python=yes
GTK+ --with-gtk=no
=> the GTK+ widget will *NOT* be built
Qt4 --with-qt=no
=> the Qt4 widget will *NOT* be built
遗憾的是libtool设定无法完全100%执行。为了能完成编译与安装流程,我会利用以下的其他替代方案:
# rm libtool
# ln -s /usr/bin/libtool libtool
# make
# make install
若是您没有安装"/usr/bin/libtool",可以从<a href="http://repo.opkg.net/edison/repo/core2-32/" target="_blank" rel="nofollow">repo.opkg.net</a>寻找相关套件。
在成功安装完成后,您应该会在"/usr/bin/zbarimg"与"/usr/bin/zbarcam"相关文件找到2进制。而"/usr/bin/zbarimg"为读取静态影像的二进制条形码范例。/usr/bin/zbarcam则是透过
# zbarcam --nodisplay
来直接读取实时影像。
假设您已经在Intel® Edison安装了OpenCV,可结合zbar与OpenCV在检测前来执行图像处理(<a href="http://blog.ayoungprogrammer.com/2014/04/real-time-qr-code-bar-code-det…; target="_blank" rel="nofollow">OpenCV与ZBar為范例</a>)。
文章来源:<a href="https://software.intel.com/zh-cn/blogs/2016/06/19/intel-edison?utm_sour…;英特尔来发人员专区