成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建

只想说一句话,太不容易了。

废话不多说,废话都在另一篇文章,直接上教程。

电脑环境是Windows 10 64位,Visual Studio 2013。

一:下载所需要的包

下载包,链接在这。
点我下载!

下载完安装好,建议PCL和OpenCV安装在磁盘根目录,我就安装在了G盘,方便添加路径。

当然,你也可以复制好路径,也可以很快,具体怎么操作自己领悟。

安装VS时,blend不选,像SQL、Web一些组件用不到取消就可以。

我好像只选了C++一项。

二:配置环境变量。(请细心丝毫不能错)

打开电脑的环境变量,编辑用户变量中的PATH。在PATH中添加以下路径,如图所示。
成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第1张图片
OpenNI2是在安装pcl时弹出的,建议安装在同一磁盘根目录下

环境变量重启后才能生效!

当然你可以先做完下面的再重启

三:配置项目属性表

打开Visual Studio 2013,32位控制台程序。
在Debug模式下,这样操作
成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第2张图片

这里分别有3个部分

包含目录、库目录、附加依赖项

成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第3张图片

包含目录:

成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第4张图片

库目录:

成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第5张图片

附加依赖项:

成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第6张图片

复制即可!

opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_core2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib
opencv_ocl2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_videostab2410d.lib
opencv_calib3d2410.lib
opencv_contrib2410.lib
opencv_core2410.lib
opencv_features2d2410.lib
opencv_flann2410.lib
opencv_gpu2410.lib
opencv_highgui2410.lib
opencv_imgproc2410.lib
opencv_legacy2410.lib
opencv_ml2410.lib
opencv_nonfree2410.lib
opencv_objdetect2410.lib
opencv_ocl2410.lib
opencv_photo2410.lib
opencv_stitching2410.lib
opencv_superres2410.lib
opencv_ts2410.lib
opencv_video2410.lib
opencv_videostab2410.lib
pcl_common_debug.lib
pcl_features_debug.lib
pcl_filters_debug.lib
pcl_io_debug.lib
pcl_io_ply_debug.lib
pcl_kdtree_debug.lib
pcl_keypoints_debug.lib
pcl_ml_debug.lib
pcl_octree_debug.lib
pcl_outofcore_debug.lib
pcl_people_debug.lib
pcl_recognition_debug.lib
pcl_registration_debug.lib
pcl_sample_consensus_debug.lib
pcl_search_debug.lib
pcl_segmentation_debug.lib
pcl_stereo_debug.lib
pcl_surface_debug.lib
pcl_tracking_debug.lib
pcl_visualization_debug.lib
vtkalglib-7.0-gd.lib
vtkChartsCore-7.0-gd.lib
vtkCommonColor-7.0-gd.lib
vtkCommonComputationalGeometry-7.0-gd.lib
vtkCommonCore-7.0-gd.lib
vtkCommonDataModel-7.0-gd.lib
vtkCommonExecutionModel-7.0-gd.lib
vtkCommonMath-7.0-gd.lib
vtkCommonMisc-7.0-gd.lib
vtkCommonSystem-7.0-gd.lib
vtkCommonTransforms-7.0-gd.lib
vtkDICOMParser-7.0-gd.lib
vtkDomainsChemistry-7.0-gd.lib
vtkDomainsChemistryOpenGL2-7.0-gd.lib
vtkexoIIc-7.0-gd.lib
vtkexpat-7.0-gd.lib
vtkFiltersAMR-7.0-gd.lib
vtkFiltersCore-7.0-gd.lib
vtkFiltersExtraction-7.0-gd.lib
vtkFiltersFlowPaths-7.0-gd.lib
vtkFiltersGeneral-7.0-gd.lib
vtkFiltersGeneric-7.0-gd.lib
vtkFiltersGeometry-7.0-gd.lib
vtkFiltersHybrid-7.0-gd.lib
vtkFiltersHyperTree-7.0-gd.lib
vtkFiltersImaging-7.0-gd.lib
vtkFiltersModeling-7.0-gd.lib
vtkFiltersParallel-7.0-gd.lib
vtkFiltersParallelImaging-7.0-gd.lib
vtkFiltersProgrammable-7.0-gd.lib
vtkFiltersSelection-7.0-gd.lib
vtkFiltersSMP-7.0-gd.lib
vtkFiltersSources-7.0-gd.lib
vtkFiltersStatistics-7.0-gd.lib
vtkFiltersTexture-7.0-gd.lib
vtkFiltersVerdict-7.0-gd.lib
vtkfreetype-7.0-gd.lib
vtkGeovisCore-7.0-gd.lib
vtkglew-7.0-gd.lib
vtkGUISupportQt-7.0-gd.lib
vtkGUISupportQtSQL-7.0-gd.lib
vtkhdf5-7.0-gd.lib
vtkhdf5_hl-7.0-gd.lib
vtkImagingColor-7.0-gd.lib
vtkImagingCore-7.0-gd.lib
vtkImagingFourier-7.0-gd.lib
vtkImagingGeneral-7.0-gd.lib
vtkImagingHybrid-7.0-gd.lib
vtkImagingMath-7.0-gd.lib
vtkImagingMorphological-7.0-gd.lib
vtkImagingSources-7.0-gd.lib
vtkImagingStatistics-7.0-gd.lib
vtkImagingStencil-7.0-gd.lib
vtkInfovisCore-7.0-gd.lib
vtkInfovisLayout-7.0-gd.lib
vtkInteractionImage-7.0-gd.lib
vtkInteractionStyle-7.0-gd.lib
vtkInteractionWidgets-7.0-gd.lib
vtkIOAMR-7.0-gd.lib
vtkIOCore-7.0-gd.lib
vtkIOEnSight-7.0-gd.lib
vtkIOExodus-7.0-gd.lib
vtkIOExport-7.0-gd.lib
vtkIOGeometry-7.0-gd.lib
vtkIOImage-7.0-gd.lib
vtkIOImport-7.0-gd.lib
vtkIOInfovis-7.0-gd.lib
vtkIOLegacy-7.0-gd.lib
vtkIOLSDyna-7.0-gd.lib
vtkIOMINC-7.0-gd.lib
vtkIOMovie-7.0-gd.lib
vtkIONetCDF-7.0-gd.lib
vtkIOParallel-7.0-gd.lib
vtkIOParallelXML-7.0-gd.lib
vtkIOPLY-7.0-gd.lib
vtkIOSQL-7.0-gd.lib
vtkIOVideo-7.0-gd.lib
vtkIOXML-7.0-gd.lib
vtkIOXMLParser-7.0-gd.lib
vtkjpeg-7.0-gd.lib
vtkjsoncpp-7.0-gd.lib
vtklibxml2-7.0-gd.lib
vtkmetaio-7.0-gd.lib
vtkNetCDF-7.0-gd.lib
vtkNetCDF_cxx-7.0-gd.lib
vtkoggtheora-7.0-gd.lib
vtkParallelCore-7.0-gd.lib
vtkpng-7.0-gd.lib
vtkproj4-7.0-gd.lib
vtkRenderingAnnotation-7.0-gd.lib
vtkRenderingContext2D-7.0-gd.lib
vtkRenderingContextOpenGL2-7.0-gd.lib
vtkRenderingCore-7.0-gd.lib
vtkRenderingFreeType-7.0-gd.lib
vtkRenderingImage-7.0-gd.lib
vtkRenderingLabel-7.0-gd.lib
vtkRenderingLOD-7.0-gd.lib
vtkRenderingOpenGL2-7.0-gd.lib
vtkRenderingQt-7.0-gd.lib
vtkRenderingVolume-7.0-gd.lib
vtkRenderingVolumeOpenGL2-7.0-gd.lib
vtksqlite-7.0-gd.lib
vtksys-7.0-gd.lib
vtktiff-7.0-gd.lib
vtkverdict-7.0-gd.lib
vtkViewsContext2D-7.0-gd.lib
vtkViewsCore-7.0-gd.lib
vtkViewsInfovis-7.0-gd.lib
vtkViewsQt-7.0-gd.lib
vtkzlib-7.0-gd.lib

四、避免出现某些错误(原因不详细说明了)

成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第7张图片

复制即可!

_SCL_SECURE_NO_WARNINGS
_CRT_SECURE_NO_WARNINGS

成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第8张图片

大功告成!

不给例程的配置教程都是耍流氓。

分别测试一下OpenCV和pcl吧!

opencv:

记得在工程的目录下(与.vcxproj文件同目录),放上你自己的图片,更改图片名称代码。不然报错很难关闭。

#include 
#include 

using namespace cv;
using namespace std;

int main()
{
     
	cout << "Built with OpenCV " << CV_VERSION << endl;
	Mat image = imread("404detecitve.jpg");
	imshow("原始图像", image);

	cvtColor(image, image, CV_RGB2GRAY);
	imshow("灰度图像", image);

	resize(image, image, Size(360, 360));
	imwrite("404detecitve_gray.jpg", image);
	imshow("缩小图像", image);

	waitKey(0);//见注6

}

效果如下:

pcl:

#include 
#include 
#include 
#include 
using namespace std;

typedef pcl::PointXYZ PointType;

int
main()
{
     
	/* start view */
	pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
	pcl::PCDReader reader;
	pcl::visualization::CloudViewer viewer("my viewer");
	viewer.showCloud(cloud);
	/* view  end */


	system("pause");
	return 0;
}

效果如下:
成功配置环境完美运行Visual Studio2013+PCL1.8.0+Opencv2.4.10のKinect三维重建_第9张图片
现在,可以开启你的开发之路了。

如有疑惑或是有纰漏可以私信我。

你可能感兴趣的:(少走弯路,opencv,kinect,visual,c++)