=JavaCV=
==Introduction==
JavaCV first provides wrappers to commonly used libraries by researchers in the field of computer vision: [http://opencv.org/ OpenCV], [http://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`), a blob analysis package (`Blobs`), 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` or starting with `GL`, i.e.: `JavaCVCL`, `GLCanvasFrame`, etc.
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 [http://code.google.com/p/javacv/source/browse/samples/ sample programs], including two for Android (`FacePreview.java` and `RecordActivity.java`), also 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?repo=procamcalib ProCamCalib] and [http://code.google.com/p/javacv/source/browse?repo=procamtracker ProCamTracker] as well as [http://code.google.com/p/javacv/source/browse?repo=examples Examples ported from OpenCV2 Cookbook] and the associated [http://code.google.com/p/javacv/wiki/OpenCV2_Cookbook_Examples Wiki pages].
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...
==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.8 http://sourceforge.net/projects/opencvlibrary/files/
* Precompiled and prepackaged CPPJARs for Linux, Mac OS X, Windows, and Android:
* 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 2.1.x http://ffmpeg.org/download.html
* Precompiled and prepackaged CPPJARs for Linux, Mac OS X, Windows, and Android:
* 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 or newer (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/
* ARToolKitPlus 2.3.0 https://launchpad.net/artoolkitplus
Finally, because we are dealing with native code, bugs can easily crash the virtual machine. Luckily, Java provides some tools to help us debug under those circumstances:
* Troubleshooting Guide for HotSpot VM http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/
==Build Instructions==
To rebuild the source code, please note that the project files were created for:
* Maven 2 or 3 http://maven.apache.org/download.html
* JavaCPP 0.7 http://code.google.com/p/javacpp/
Once installed, simply call the usual `mvn install` command for both JavaCPP and JavaCV. By default, all the dependencies listed above are NOT required, except for OpenCV and a C++ compiler for JavaCPP, whose command line options can be passed via the `javacpp.options` Maven property, such as [http://code.google.com/p/javacpp/#Instructions_for_Android those required for Android]. Please refer to the comments inside the `pom.xml` file for further details.
==Quick Start for OpenCV and FFmpeg==
First, put all the JAR files of JavaCV (`javacpp.jar`, `javacv.jar`, and `javacv-*.jar`), of OpenCV (`opencv-*.jar`), and of FFmpeg (`ffmpeg-*.jar`) somewhere in your CLASSPATH. Or point your `pom.xml` file to the Maven repository 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 library 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/training/basics/firstapp/
# 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` into the newly created "libs" folder.
# Extract all the `*.so` files from `javacv-android-arm.jar`, `opencv-2.4.8-android-arm.jar`, and `ffmpeg-2.1.1-android-arm.jar` directly into the newly created "libs/armeabi" folder, without creating any of the subdirectories found in the JAR files.
# 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:
* [http://docs.opencv.org/ OpenCV documentation]
* [http://ffmpeg.org/doxygen/ FFmpeg documentation]
The class definitions are basically ports to Java of the original header 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);
没有合适的资源?快使用搜索试试~ 我知道了~
javacv0.7+opencv2.4.8调用本地摄像头详细
共32个文件
jar:8个
java:8个
jpg:7个
4星 · 超过85%的资源 需积分: 50 93 下载量 6 浏览量
2015-08-12
10:49:15
上传
评论 4
收藏 12.51MB ZIP 举报
温馨提示
javacv0.7+opencv2.4.8调用本地摄像头详细操作及测试代码,因为opencv2.4.8文件较大,本人无法上传还请见谅,给个百度云的下载地址http://pan.baidu.com/s/1o6imnUU,请各位自行下载
资源推荐
资源详情
资源评论
收起资源包目录
javacv+opencv调用本地摄像头详细.zip (32个子文件)
测试代码.txt 2KB
使用方法.doc 20KB
javacv-0.7-bin
javacv-bin
javacv-linux-x86.jar 1.69MB
README.txt 50KB
javacv.jar 1.1MB
javacpp.jar 157KB
javacv-macosx-x86_64.jar 1.74MB
javacv-linux-x86_64.jar 1.81MB
samples
Shapes1.jpg 26KB
HoughLines.java 5KB
FaceApplet.java 5KB
BlobDemo.java 11KB
Rice.jpg 73KB
FaceApplet.html 677B
BlackBalls.jpg 9KB
pic1.png 13KB
FacePreview.java 11KB
image1.png 340B
Blob2.jpg 9KB
Shapes2.jpg 18KB
FaceApplet.jnlp 478B
Blob1.jpg 5KB
OpticalFlowTracker.java 3KB
FaceRecognition.java 27KB
image0.png 341B
Blob3.jpg 14KB
MotionDetector.java 4KB
RecordActivity.java 16KB
javacv-windows-x86.jar 1.29MB
javacv-android-arm.jar 3MB
LICENSE.txt 19KB
javacv-windows-x86_64.jar 1.73MB
共 32 条
- 1
资源评论
- 麦田里的守望者FTL2017-06-26里面根本没代码,骗分的!!!
- L_ch2016-04-21毕设要做视频编码。应该用得着
- lzhandtd2017-11-03没啥用的东东
- jbcaep22017-12-03没有下载到代码
- gaowei782018-12-24不错的参考文件, 谢谢
cyf211
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功