=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是对各种常用计算机视觉库的封装后的一组jar包,其中封装了OpenCV、libdc1394、OpenKinect、videoInput和ARToolKitPlus等计算机视觉编程人员常用库的接口,可以通过其中的utility类方便的在包括Android在内的Java平台上调用这些接口。 另外JavaCV还带有硬件加速的全屏幕图像显示(CanvasFrame),易于在多个内核中执行并行代码(并行),用户友好的几何和色彩的相机和投影仪校准(GeometricCalibrator,ProCamGeometricCalibrator,ProCamColorCalibrator ),检测和特征点(ObjectFinder),一类是实现投影,摄像系统(直接图像对齐设置匹配主要GNImageAligner,ProjectiveTransformer,ProjectiveGainBiasTransformer,ProCamTransformer和ReflectanceInitializer),以及在JavaCV类杂项功能。
资源推荐
资源详情
资源评论
收起资源包目录
javacv-0.1-bin.zip (21个子文件)
javacv-bin
javacv-linux-x86.jar 1.44MB
README.txt 41KB
javacv.jar 1.04MB
javacpp.jar 96KB
javacv-macosx-x86_64.jar 1.42MB
javacv-linux-x86_64.jar 1.52MB
samples
HoughLines.java 5KB
FaceApplet.java 5KB
FaceApplet.html 677B
pic1.png 13KB
FacePreview.java 11KB
image1.png 340B
FaceApplet.jnlp 478B
OpticalFlowTracker.java 3KB
FaceRecognition.java 27KB
image0.png 341B
MotionDetector.java 4KB
javacv-windows-x86.jar 1.06MB
javacv-android-arm.jar 1.91MB
LICENSE.txt 19KB
javacv-windows-x86_64.jar 1.39MB
共 21 条
- 1
sdh567
- 粉丝: 1
- 资源: 26
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页