zbar

Qt_JNI_DLL_配置手册

独自空忆成欢 提交于 2020-03-09 13:56:40
上篇文章实现了Qt+MinGW+Opencv+Zbar的配置。接下来,由于项目需求,需要用Java调用,因此需要将之前二维码识别的代码编译成Dll,供java调用。 1 Java调用Dll的方法 1.1 利用Java自带的JNI JNI是Java Native Interface的缩写,通过使用 Java本地接口书写程序,可以确保代码在不同的平台上方便移植。它允许Java代码和其他语言写的(本地已编译的)代码进行交,这样做通常会丧失平台可移植性。但是,有些情况下这样做是可以接受的,甚至是必须的。 基本流程是首先在java环境下,建立一个java的接口,然后利用Java自带的工具javah,将这个接口转换成C或C++类型的接口,然后,在VC或中Qt的环境下借助编译器,实现这个接口的功能,并编译成Dll。 在Java环境下通过调用这个Dll,就可以访问本地代码或已编译的库的功能, 这个方法的效率是最高的,缺点是由于对应于某一平台的 JNI 本地代码调用通常不能移植到其他平台上。 这种方法适用于核心代码大部分已经在本地完成,将代码重新写成Java的工作量复杂或者根本无法完成的情况,我们需要在本地用C++或C把这些代码封装起来供Java 使用,这个封装的Dll可以由我们指定实现某种功能,也就是说可以在保证Java代码不更改的情况下,改变程序的功能。 1.2 利用Java自带的JNA JNA

Compile zbar for Python 3.x

痴心易碎 提交于 2020-02-29 05:38:39
问题 A few years ago I spent some time finding a way to make zbar work with Python 2.7 + Windows x64, and I posted this working solution: How to decode a QR-code image in (preferably pure) Python? Now I notice pip install zbar still does not work out-of-the-box with Python 3.7, so I'm trying to compile it from source. Here is what I did: Install "Microsoft Visual C++ Build Tools 2015" (see here) Get the zbar source from: https://github.com/NaturalHistoryMuseum/ZBarWin64 msbuild zbar64.sln /p

Ubuntu 16.04 (python2.7) 安装openCV3.2.0

跟風遠走 提交于 2020-02-27 13:13:37
1、更新相关的package $ sudo apt-get update 2、安装相关的依赖包 $ sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev 3、下载openCV3.2.0的源码并解压 $ wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.2.0.zip $ unzip opencv.zip 4、编译安装 $ cd opencv-3.2.0 $ mkdir build $ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. $ make -4j $ sudo make install 5、安装zbar $ brew install zbar $ sudo apt-get install libzbar0 $ python2 -m pip install pyzbar --user 6、验证安装 输入 $ python 在>>>后依次输入 >>> import cv2 >>> cv2.__version__ >>> import

Run 32 bit library on iPhone 5s 64 bit

不羁的心 提交于 2020-01-20 08:07:08
问题 I'am using zbar in my application. If I want to run it on my iPhone 5s with an 64 bit processor, I get the following errors: Is it possible to use the 32 bit library on a 64 bit device, because I don't think, the library is going to be updated. 回答1: To summarize the comments above. A 64bit iPhone application requires all constituent libraries and frameworks to be 64bit. You can't mix and match. Leaving an application 32bit is non-optimal long term since iOS has to keep two versions of the

What image formats other than “Y800” does zbar::Image::Image() accept?

有些话、适合烂在心里 提交于 2020-01-14 13:17:08
问题 The documentation for zbar::Image::Image() doesn't say anything about the accepted image formats: zbar::Image::Image ( unsigned width = 0, unsigned height = 0, const std::string & format = "", const void * data = NULL, unsigned long length = 0 ) [inline] constructor. create a new Image with the specified parameters Since format is a string, not an enum, I can't know the possible values. The only value I know is Y800 from the scan_image.cpp sample that comes with zbar: Image image(width,

How to import Zbar Framework in Swift Project

三世轮回 提交于 2020-01-02 07:09:10
问题 I have a project and currently trying to convert to Swift project but I couldn't figure out how to present a Zbar barcode reader that scans from the camera feed. On my current project I called like this - (IBAction)scanButton:(id)sender { // ADD: present a barcode reader that scans from the camera feed ZBarReaderViewController *reader = [ZBarReaderViewController new]; reader.readerDelegate = self; reader.supportedOrientationsMask = ZBarOrientationMaskAll; ZBarImageScanner *scanner = reader

With Zxing retiring for iOS, which barcode-scanner to switch to?

喜欢而已 提交于 2019-12-30 03:03:59
问题 I have implemented ZXing to my iOS-app, however I am questioning it's maintainability as not long ago it was announced that ZXing to iOS is retiring: Retiring C++, Objective C code I've also read that there might be compatibility issues with the newer phones iPhone 5S.. Also running Xcode's static code analysis on the Zxing-library reveals memory errors, I'm not sure if these errors are false positive or not, but they make me doubt Zxing even more. Further, the performance of Zxing compared

With Zxing retiring for iOS, which barcode-scanner to switch to?

限于喜欢 提交于 2019-12-30 03:03:27
问题 I have implemented ZXing to my iOS-app, however I am questioning it's maintainability as not long ago it was announced that ZXing to iOS is retiring: Retiring C++, Objective C code I've also read that there might be compatibility issues with the newer phones iPhone 5S.. Also running Xcode's static code analysis on the Zxing-library reveals memory errors, I'm not sure if these errors are false positive or not, but they make me doubt Zxing even more. Further, the performance of Zxing compared

Importing zbar causes python to exit with exit code 139 - what could cause this on a mac running 10.9?

情到浓时终转凉″ 提交于 2019-12-29 06:33:47
问题 I am trying to get QR code recognition going in my opencv workflow but the program immediately exits with code 139. import zbar causes the problem because when i delete it my subsequent opencv code executes. How do I go about diagnosing this? It appears to be finding zbar python package in /Library/Python/2.7/site-packages/ (i.e. doesn't claim the package doesn't exist), but then it exits with code 139. Any idea what code 139 is? Is the problem likely in the python bindings, zlib.h, or

Heroku Zbar Didn't find libzbar on your system (LoadError)

笑着哭i 提交于 2019-12-25 03:55:16
问题 I have a rails application which uses zbar for barcode recognition. It works fine on my developer machine, but when i tried to deploy it to Heroku my commit was rejected with the following message: app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/zbar-0.2.2/lib/zbar/lib.rb:12:in `rescue in <module:ZBar>': Didn't find libzbar on your system (LoadError) app/web.1: Please install zbar (http://zbar.sourceforge.net/) or set ZBAR_LIB if it's in a weird place app/web.1: FFI::Library::ffi_lib() failed