=JavaCV=
==Introduction==
JavaCV first provides wrappers to commonly used libraries by researchers in the field of computer vision: [http://opencv.willowgarage.com/ OpenCV], [http://www.ffmpeg.org/ FFmpeg], [http://damien.douxchamps.net/ieee1394/libdc1394/ libdc1394], [http://www.ptgrey.com/products/pgrflycapture/ PGR FlyCapture], [http://openkinect.org/ OpenKinect], [http://muonics.net/school/spring05/videoInput/ videoInput], and [http://studierstube.icg.tugraz.at/handheld_ar/artoolkitplus.php ARToolKitPlus]. The classes found under the `com.googlecode.javacv.cpp` package namespace expose their complete APIs. Moreover, utility classes make their functionality easier to use on the Java platform, including Android.
JavaCV also comes with hardware accelerated full-screen image display (`CanvasFrame` and `GLCanvasFrame`), easy-to-use methods to execute code in parallel on multiple cores (`Parallel`), user-friendly geometric and color calibration of cameras and projectors (`GeometricCalibrator`, `ProCamGeometricCalibrator`, `ProCamColorCalibrator`), detection and matching of feature points (`ObjectFinder`), a set of classes that implement direct image alignment of projector-camera systems (mainly `GNImageAligner`, `ProjectiveTransformer`, `ProjectiveColorTransformer`, `ProCamTransformer`, and `ReflectanceInitializer`), as well as miscellaneous functionality in the `JavaCV` class. Some of these classes also have an OpenCL and OpenGL counterpart, their names ending with `CL`, i.e.: `JavaCVCL`, etc. except for `GLCanvasFrame`.
To learn how to use the API, since documentation currently lacks, please refer to the [#Quick_Start_for_OpenCV_and_FFmpeg] section below as well as the sample programs, including one for Android, found in the `samples` directory. You may also find it useful to refer to the source code of [http://code.google.com/p/javacv/source/browse/procamcalib/ ProCamCalib] and [http://code.google.com/p/javacv/source/browse/procamtracker/ ProCamTracker] as well as [http://code.google.com/p/javacv/source/browse/javacv-examples/ Examples ported from OpenCV2 Cookbook] and the associated [http://code.google.com/p/javacv/wiki/OpenCV2_Cookbook_Examples Wiki pages].
==Required Software==
To use JavaCV, you will need to download and install the following software:
* An implementation of Java SE 6 or 7
* OpenJDK http://openjdk.java.net/install/ or
* Sun JDK http://www.oracle.com/technetwork/java/javase/downloads/ or
* IBM JDK http://www.ibm.com/developerworks/java/jdk/ or
* Java SE for Mac OS X http://developer.apple.com/java/ etc.
* OpenCV 2.4.0 http://sourceforge.net/projects/opencvlibrary/files/
* Precompiled for Android 2.2 http://code.google.com/p/javacv/downloads/list
And please make sure your Java and OpenCV have the same bitness: *32-bit and 64-bit modules do not mix under any circumstances*. Further, although not always required, some functionality of JavaCV also relies on:
* FFmpeg 0.6.x or 0.7.x http://ffmpeg.org/download.html
* Precompiled for Windows http://ffmpeg.zeranoe.com/builds/ Known compatible builds:
* http://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-0.7.1-win32-shared.7z
* http://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-0.7.1-win64-shared.7z
* Precompiled for Android 2.2 http://code.google.com/p/javacv/downloads/list
* libdc1394 2.1.x or 2.2.x http://sourceforge.net/projects/libdc1394/files/
* PGR FlyCapture 1.7~2.2 (Windows only) http://www.ptgrey.com/products/pgrflycapture/
* OpenKinect http://openkinect.org/
* CL Eye Platform SDK (Windows only) http://codelaboratories.com/downloads/
* Android SDK API 8 or newer http://developer.android.com/sdk/
* JOCL and JOGL from JogAmp http://jogamp.org/
To modify the source code, please note that the project files were created for:
* NetBeans 6.9 http://netbeans.org/downloads/ or
* Maven 2 or 3 http://maven.apache.org/download.html
* JavaCPP http://code.google.com/p/javacpp/
* ARToolKitPlus 2.1.1t http://code.google.com/p/javacv/downloads/list
To recompile, simply call the usual `ant` or `mvn` command. By default, all the dependencies listed above are required, but we may simply remove any source files that do not contain any desired features, before attempting to build.
Please keep me informed of any updates or fixes you make to the code so that I may integrate them into the next release. Thank you!
And feel free to ask questions on [http://groups.google.com/group/javacv the mailing list] if you encounter any problems with the software! I am sure it is far from perfect...
==Quick Start for OpenCV and FFmpeg==
First, put all the JAR files of JavaCV (`javacpp.jar`, `javacv.jar`, and `javacv-*.jar`) somewhere in your classpath, or point your `pom.xml` file to the Maven repositories http://maven2.javacpp.googlecode.com/git/ and http://maven2.javacv.googlecode.com/git/, and make sure that the library files of OpenCV and FFmpeg (`*.so`, `*.dylib`, or `*.dll`) can be found either in their default installation directories or in the system PATH, which under Windows includes the current working directory. (For answers to problems frequently encountered with OpenCV on the Windows platform, please refer to [http://code.google.com/p/javacv/wiki/Windows7AndOpenCV Common issues with OpenCV under Windows 7].) Here are some more specific instructions for common cases:
NetBeans (Java SE 6 or 7):
* In the Projects window, right-click the Libraries node of your project, and select "Add JAR/Folder...".
* Locate the JAR files, select them, and click OK.
Eclipse (Java SE 6 or 7):
* Navigate to Project > Properties > Java Build Path > Libraries and click "Add External JARs..."
* Locate the JAR files, select them, and click OK.
Eclipse (Android 2.2 or newer):
* Follow the instructions on this page: http://developer.android.com/resources/tutorials/hello-world.html
* Go to File > New > Folder, select your project as parent folder, type "libs/armeabi" as Folder name, and click Finish.
* Copy `javacpp.jar` and `javacv.jar` in the newly created "libs" folder.
* Extract directly all the `*.so` files from `javacv-android-arm.jar` *as well as* the ones from `OpenCV-2.4.0-android-arm.zip` and `ffmpeg-0.7.11-android-arm.zip` in the newly created "libs/armeabi" folder, without creating any new subdirectories.
* Navigate to Project > Properties > Java Build Path > Libraries and click "Add JARs..."
* Select both `javacpp.jar` and `javacv.jar` from the newly created "libs" folder.
After that, the wrapper classes for OpenCV and FFmpeg can automatically access all of their C/C++ APIs. The class definitions are basically ports to Java of the original include files in C, plus the missing functionality exposed only by the C++ API of OpenCV, and I deliberately decided to keep as much of the original syntax as possible. For example, here is a method that tries to load an image file, smooth it, and save it back to disk:
{{{
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
public class Smoother {
public static void smooth(String filename) {
IplImage image = cvLoadImage(filename);
if (image != null) {
cvSmooth(image, image, CV_GAUSSIAN, 3);
cvSaveImage(filename, image);
cvReleaseImage(image);
}
}
}
}}}
JavaCV also comes with helper classes and methods on top of OpenCV and FFmpeg to facilitate their integration to the Java platform. Here is a small demo program demonstrating the most frequently useful parts:
{{{
import com.googlecode.javacpp.Loader;
import com.googlecode.javacv.*;
import com.googlecode.javacv.cpp.*;
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.open
javacv的bin包
5星 · 超过95%的资源 需积分: 50 26 浏览量
2012-07-10
11:36:06
上传
评论 6
收藏 9.75MB ZIP 举报
rainwithvoice
- 粉丝: 2
- 资源: 18
最新资源
- NetOps-py通过sftp替换网络设备启动文件
- STM32单片机FPGA毕设电路原理论文报告任务驱动教学法在单片机课程教学中的应用
- STM32单片机FPGA毕设电路原理论文报告任务驱动法在单片机教学中的应用
- STM32单片机FPGA毕设电路原理论文报告人造金刚石压机智能化压力测控系统设计
- 以某列为依据匹配多项(Excel版)
- STM32单片机FPGA毕设电路原理论文报告人体短臂离心机实验台的显示控制系统
- STM32单片机FPGA毕设电路原理论文报告人工气候室监控系统的环境控制器研究
- STM32单片机FPGA毕设电路原理论文报告染整自动线张力控制系统的设计
- 数据挖掘与机器学习-实验
- 基于Linux系统Nginx的动态网站的LNMP环境源码包
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
- 4
- 5
- 6
前往页