javaflann的简单介绍
本篇文章给大家谈谈javaflann,以及对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
- 1、opencv2.4.5中cvStereoGCState在哪个模块
- 2、opencv中未定义标识符 CvRandState
- 3、在使用opencv2.4.10配置Qt5.3时,出现 LNK1104: cannot open file 'opencv_core2410d.lib',求大神解答
- 4、opencv3.0新增了什么功能
opencv2.4.5中cvStereoGCState在哪个模块
一、模块:
①core. 该模块定义了OpenCV的基本数据结构,包括多维数组(Multi-dimensional Array)和用于其它模块的基本函数;
②imgproc. 该模块用于图像处理(Image Processing)。它包括线性和非线性的图像滤波(Linear and Non-Linear Image Filtering)、几何图像变换(Geometrical image Transformations),包括缩放(Resize), affine and perspective warping, generic table-based remapping、颜色空间变换(Color Space Conversion)、直方图(Histograms)等;
③video. 这是一个视频分析模块,包含运动估计(Motion Estimation)、背景消除/背景差分(Background Subtraction)和物体跟踪(Object Tracking)算法;
④calib3d. 该模块包括基本的多视图集合算法(Multiple-View Geometry Algorithms)、单体和立体相机的标定(Single and Stereo Camera Calibration)、对象姿态估计(Object Pose Estimation)、双目立体匹配(Stereo Correspondence)算法和元素的三维重建(Elements of 3D Reconstruction);
⑤features2d. 包括显著特征检测器(Salient Feature Detectors)、描述符(Descriptors)和描述符匹配器(Descriptor Matchers);
⑥objdetect. 包括预定义的目标和实例的检测,如脸、眼、杯子、人以及汽车等; ⑦highgui. 该模块拥有一个简单易用的视频捕捉(Video Capturing)、图像及视频译码(Image and Video Codecs)以及简单的UI接口;
⑧gpu. 包含不同模块的GPU加速算法。
另外还有其它的辅助模块,比如FLANN以及Google的测试包、Python bindings等。
二、简介:
OpenCV(Open Source Computer Vision)是一个用于实时处理的计算机视觉函数库,它基于BSD许可证授权并且可免费用于学术研究和商业应用。它拥有C/C++、Python、和Java(仅用于Android)接口,并可在Windows、Linux、Mac和Android平台上运行。OpenCV库包含大于2500个优化算法,拥有5M的下载量和47K+的用户群体。
opencv中未定义标识符 CvRandState
可以加上万能头文件模板
#include stdio.h
#include tchar.h
#include iostream
#include fstream
#include opencv2/opencv.hpp
#define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION)
#ifdef _DEBUG
#define cvLIB(name) "opencv_" name CV_VERSION_ID "d"
#else
#define cvLIB(name) "opencv_" name CV_VERSION_ID
#endif
#pragma comment( lib, cvLIB("core") )
#pragma comment( lib, cvLIB("imgproc") )
#pragma comment( lib, cvLIB("highgui") )
#pragma comment( lib, cvLIB("flann") )
#pragma comment( lib, cvLIB("features2d") )
#pragma comment( lib, cvLIB("calib3d") )
#pragma comment( lib, cvLIB("gpu") )
#pragma comment( lib, cvLIB("legacy") )
#pragma comment( lib, cvLIB("ml") )
#pragma comment( lib, cvLIB("objdetect") )
#pragma comment( lib, cvLIB("ts") )
#pragma comment( lib, cvLIB("video") )
#pragma comment( lib, cvLIB("contrib") )
#pragma comment( lib, cvLIB("nonfree") )
拿走吧,应该能都解决opencv各个版本的问题
在使用opencv2.4.10配置Qt5.3时,出现 LNK1104: cannot open file 'opencv_core2410d.lib',求大神解答
OpenCV
整个项目的结构图:
编写DetectFaceDemo.java,代码如下:
[java] view
plaincopyprint?
package com.njupt.zhb.test;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objdetect.CascadeClassifier;
//
// Detects faces in an image, draws boxes around them, and writes the results
// to "faceDetection.png".
//
public class DetectFaceDemo {
public void run() {
System.out.println("\nRunning DetectFaceDemo");
System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
// Create a face detector from the cascade file in the resources
// directory.
//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//Mat image = Highgui.imread(getClass().getResource("lena.png").getPath());
//注意:源程序的路径会多打印一个‘/’,因此总是出现如下错误
/*
* Detected 0 faces Writing faceDetection.png libpng warning: Image
* width is zero in IHDR libpng warning: Image height is zero in IHDR
* libpng error: Invalid IHDR data
*/
//因此,我们将第一个字符去掉
String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);
Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
MatOfRect faceDetections = new MatOfRect();
faceDetector.detectMultiScale(image, faceDetections);
System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));
// Draw a bounding box around each face.
for (Rect rect : faceDetections.toArray()) {
Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));
}
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
package com.njupt.zhb.test;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objdetect.CascadeClassifier;
//
// Detects faces in an image, draws boxes around them, and writes the results
// to "faceDetection.png".
//
public class DetectFaceDemo {
public void run() {
System.out.println("\nRunning DetectFaceDemo");
System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
// Create a face detector from the cascade file in the resources
// directory.
//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//Mat image = Highgui.imread(getClass().getResource("lena.png").getPath());
//注意:源程序的路径会多打印一个‘/’,因此总是出现如下错误
/*
* Detected 0 faces Writing faceDetection.png libpng warning: Image
* width is zero in IHDR libpng warning: Image height is zero in IHDR
* libpng error: Invalid IHDR data
*/
//因此,我们将第一个字符去掉
String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);
Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
MatOfRect faceDetections = new MatOfRect();
faceDetector.detectMultiScale(image, faceDetections);
System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));
// Draw a bounding box around each face.
for (Rect rect : faceDetections.toArray()) {
Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));
}
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
3.编写测试类:
[java] view
plaincopyprint?
package com.njupt.zhb.test;
public class TestMain {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
// Load the native library.
System.loadLibrary("opencv_java246");
new DetectFaceDemo().run();
}
}
//运行结果:
//Hello, OpenCV
//
//Running DetectFaceDemo
///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//Detected 8 faces
//Writing faceDetection.png
package com.njupt.zhb.test;
public class TestMain {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
// Load the native library.
System.loadLibrary("opencv_java246");
new DetectFaceDemo().run();
}
}
//运行结果:
//Hello, OpenCV
//
//Running DetectFaceDemo
///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//Detected 8 faces
//Writing faceDetection.png
opencv3.0新增了什么功能
OpenCV 2.0已经发布5年了,它带来了全新的C++接口,标志着这个项目的开始。在2.0的整个生命周期中,我们增加了新的平台支持,包括iOS和Andriod,通过CUDA和OpenCL实现了GPU加速,为Python和java用户提供了接口,基于github和buildbot构建了充满艺术感的持续集成系统,所以才有了稳定的OpenCV 2.4.x,它被全世界的很多公司和学校所采用。
现在,我们很高兴地宣布3.0时代的开始(OpenCV 3.0 release 预计会在今年圣诞节左右发布)。在3.0时代不会有像2.0时代一样激进的尝试,它有足够稳定的改进,这为我们,也为你们以及伟大的OpenCV社区带来了许多全新的机会。请查看更新日志,我们简要说几点。
1. 项目架构的改变。
最初的时候,OpenCV是一个相对整体的项目,都是以整体的形式构建和装配,在很多年的时间里,这都是一个很好的策略。然而,随着功能的增加,包括bleeding-edge算法发布前的几分钟,一个pull请求提交到我们的仓库,越来越多的贡献者(非常感谢你们),我们决定像其他大项目一样,抛弃整体架构,使用内核+插件的架构形式。
除了我们的主仓库和增加的”test data“仓库,我们还有了,这里有很多让人兴奋的功能,包括你们已经知道的面部识别和文本探测,还包括文本识别、新的边缘检测器、充满艺术感的修复、深度地图处理、新的光线流和追踪算法等。
opencv与opencv_contrib之间的区别是:
他们都由我们的持续集成系统维护,尽管opencv_contrib的单元测试并不常规运行。
全部或者一些额外的模块可以用我们的构建系统构建,把OPENCV_EXTRA_MODULES_PATH=/modules传递给CMake。
contrib的文档是自动生成的,可以在docs.opencv.org/master获得,它会在OpenCV 3.0 beta版本的时候更加完善、并发布。
主OpenCV是Itseez支持的代码,有非常稳定的API以及一点点创新。
opencv_contrib是大多数实验性代码放置的地方,一些API可能会改变,我们欢迎贡献者贡献你们新的精彩算法。
2. 感谢Intel和AMD公司的支持,我们让很多视觉算法实现的GPU加速,并且对于用户来说,都是十分易得的。这个技术可以称之为T-API (“transparent API”),关于这个话题的单独指南在准备当中,仍然非常欢迎你来看一下,试一下我们的T-API的例子,研究一下它如何工作。
3. Intel公司还给了我们另一份大礼。IPP的一个子集默认接入OpenCV,用户可以轻松得到。其中包含了可以将使用IPP加速的OpenCV再次分发的许可。如下图所示,在IPP的帮助下,很多函数都实现了显著的加速。
4. 最后,OpenCV 3.0带来了很新的功能,这是其中的一部分:
Text detection and recognition by Lluis Gomez
HDR by Fedor Morozov and Alexander Shishkov
KAZE/A-KAZE by Eugene Khvedchenya, the algorithm author Pablo Alcantarilla and some improvements by F. Morozov.
Smart segmentation and edge-aware filters by Vitaly Lyudvichenko, Yuri Gitman, Alexander Shishkov and Alexander Mordvintsev
Car detection using Waldboost, ACF by Vlad Shakhuro and Nikita Manovich
TLD tracker and several common-use optimization algorithms by Alex Leontiev
Matlab bindings by Hilton Bristow, with support from Mathworks.
Greatly extended Python bindings, including Python 3 support, and several OpenCV+Python tutorials by Alexander Mordvintsev, Abid Rahman and others.
3D Visualization using VTK by Ozan Tonkal and Anatoly Baksheev.
RGBD module by Vincent Rabaud
Line Segment Detector by Daniel Angelov
Many useful Computational Photography algorithms by Siddharth Kherada
Shape descriptors, matching and morphing shapes (shape module) by Juan Manuel Perez Rua and Ilya Lysenkov
Long-term tracking + saliency-based improvements (tracking module) by Antonella Cascitelli and Francesco Puja
Another good pose estimation algorithm and the tutorial on pose estimation by Edgar Riba and Alexander Shishkov
Line descriptors and matchers by Biagio Montesano and Manuele Tambourin
Myriads of improvements in various parts of the library by Steven Puttemans; thank you a lot, Steven!
Several NEON optimizations by Adrian Stratulat, Cody Rigney, Alexander Petrikov, Yury Gorbachev and others.
Fast foreach loop over cv::Mat by Kazuki Matsuda
Image alignment (ECC algorithm) by Georgios Evangelidis
GDAL image support by Marvin Smith
RGBD module by Vincent Rabaud
Fisheye camera model by Ilya Krylov
OSX framework build script by Eugene Khvedchenya
Multiple FLANN improvements by Pierre-Emmanuel Viel
Improved WinRT support by Gregory Morse
Latent SVM Cascade by Evgeniy Kozhinov and NNSU team (awaiting integration)
Logistic regression by Rahul Kavi
Five-point pose estimation algorithm by Bo Li
javaflann的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于、javaflann的信息别忘了在本站进行查找喔。
发布于:2022-12-19,除非注明,否则均为
原创文章,转载请注明出处。