=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的src包
共107个文件
java:81个
h:6个
xml:6个
4星 · 超过85%的资源 需积分: 13 168 下载量 7 浏览量
2012-07-10
11:01:16
上传
评论
收藏 486KB ZIP 举报
温馨提示
官网下载的javacv的src源代码,与本人发的javacv的bin包结合使用,可以帮助大家理解javacv包的类
资源推荐
资源详情
资源评论
收起资源包目录
javacv的src包 (107个子文件)
ImageTransformer.cl 11KB
JavaCV.cl 5KB
ProCamTransformer.cl 3KB
ProjectiveColorTransformer.cl 2KB
ProjectiveTransformer.cl 2KB
cvkernels.h 18KB
inttypes.h 8KB
stdint.h 8KB
opencv_adapters.h 8KB
avutil.h 744B
avformat.h 735B
FaceApplet.html 677B
opencv_core.java 223KB
opencv_legacy.java 186KB
PGRFlyCapture.java 171KB
avcodec.java 124KB
opencv_ml.java 85KB
opencv_imgproc.java 68KB
opencv_contrib.java 67KB
dc1394.java 66KB
avformat.java 65KB
opencv_stitching.java 65KB
opencv_features2d.java 64KB
opencv_objdetect.java 51KB
JavaCV.java 37KB
ProjectiveDevice.java 36KB
opencv_videostab.java 34KB
opencv_calib3d.java 29KB
GNImageAligner.java 29KB
JavaCVCL.java 29KB
avutil.java 28KB
FaceRecognition.java 27KB
DC1394FrameGrabber.java 26KB
CameraDevice.java 24KB
freenect.java 24KB
opencv_highgui.java 24KB
ProCamGeometricCalibrator.java 24KB
ProCamTransformer.java 23KB
avfilter.java 21KB
GeometricCalibrator.java 20KB
ProjectiveTransformer.java 20KB
FlyCaptureFrameGrabber.java 19KB
opencv_video.java 18KB
GNImageAlignerCL.java 17KB
FrameGrabber.java 17KB
FFmpegFrameGrabber.java 16KB
ObjectFinder.java 16KB
ProjectorDevice.java 16KB
videoInputLib.java 16KB
CanvasFrame.java 15KB
FFmpegFrameRecorder.java 15KB
ARToolKitPlus.java 14KB
HandMouse.java 14KB
GLCanvasFrame.java 14KB
PS3EyeFrameGrabber.java 14KB
opencv_flann.java 13KB
MarkerDetector.java 13KB
ProjectiveColorTransformer.java 13KB
swscale.java 13KB
ProCamColorCalibrator.java 13KB
FacePreview.java 11KB
ProCamTransformerCL.java 10KB
Marker.java 10KB
opencv_nonfree.java 10KB
OpenCVFrameGrabber.java 9KB
MarkedPlane.java 9KB
OpenKinectFrameGrabber.java 9KB
cvkernels.java 9KB
ReflectanceInitializer.java 8KB
VideoInputFrameGrabber.java 7KB
ProjectiveColorTransformerCL.java 7KB
ProjectiveTransformerCL.java 6KB
FrameRecorder.java 6KB
postproc.java 5KB
HoughLines.java 5KB
FaceApplet.java 5KB
MotionDetector.java 4KB
ImageTransformerCL.java 4KB
opencv_photo.java 4KB
ColorCalibrator.java 4KB
avdevice.java 4KB
ImageAligner.java 3KB
OpticalFlowTracker.java 3KB
Parallel.java 3KB
OpenCVFrameRecorder.java 3KB
ImageTransformer.java 3KB
JavaCvErrorCallback.java 3KB
CameraSettings.java 3KB
BaseSettings.java 2KB
BaseChildSettings.java 2KB
ProjectorSettings.java 2KB
BufferRing.java 2KB
ImageAlignerCL.java 1KB
FaceApplet.jnlp 478B
pic1.png 13KB
image0.png 341B
image1.png 340B
project.properties 2KB
genfiles.properties 467B
README.txt 41KB
共 107 条
- 1
- 2
rainwithvoice
- 粉丝: 2
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页