当前位置:Gxlcms > mysql > opencv(2.3.1)、VTK5.8.0、ITK和VS2010的配置

opencv(2.3.1)、VTK5.8.0、ITK和VS2010的配置

时间:2021-07-01 10:21:17 帮助过:37人阅读

1.配置(opencv版本2.3.1 opencv安装在D:\opencv) (1) project-***properties-VC Directaries-Include Directaries 包含:D:\OpenCV\opencv\build\include D:\OpenCV\opencv\build\include\opencv D:\OpenCV\opencv\build\include\opencv2 (2) project-***

1.配置(opencv版本2.3.1 opencv安装在D:\opencv)

(1) project->***properties->VC++ Directaries->Include Directaries

包含:D:\OpenCV\opencv\build\include
D:\OpenCV\opencv\build\include\opencv
D:\OpenCV\opencv\build\include\opencv2


(2) project->***properties->VC++ Directaries->library Directaries

包含:D:\OpenCV\opencv\build\x86\vc10\lib

(3)Linker->input->Additional Dependencies

包含:

opencv_core231.lib
opencv_highgui231.lib
opencv_objdetect231.lib


opencv配置完成,但是这个版本中没有CvvImage类,opencv中单个函数可以使用,怎样在MFC中使用这个类还在摸索


2.配置VTK5.8.0


(1) project->***properties->C/C++->General->Additonal Include Library包含下列文件:

D:\VTK-5.8.0\vtk-5.8.0\Common

D:\VTK-5.8.0\vtk-5.8.0\GenericFiltering

D:\VTK-5.8.0\vtk-5.8.0\Filtering

D:\VTK-5.8.0\vtk-5.8.0\VolumeRendering

D:\VTK-5.8.0\vtk-5.8.0\IO

D:\VTK-5.8.0\vtk-5.8.0\Rendering

D:\VTK-5.8.0\vtk-5.8.0\Graphics

D:\VTK-5.8.0\vtk-5.8.0\Hybrid

D:\VTK-5.8.0\bin

D:\VTK-5.8.0-Bin

D:\VTK-5.8.0\vtk-5.8.0\Imaging


(2) project->***properties->Linker->General->Additonal Include Library包含下列文件:

D:\VTK-5.8.0-Bin\bin\Debug


(3)project->***properties->Linker->Input->Additional Dependencies包含下列文件:


kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
uuid.lib
ole32.lib
oleaut32.lib
comdlg32.lib
advapi32.lib
vtkMFC.lib
vtkRendering.lib
vtkGraphics.lib
vtkverdict.lib
vtkImaging.lib
vtkIO.lib
vtkFiltering.lib
vtkCommon.lib
vtkDICOMParser.lib
vtkNetCDF.lib
vtkmetaio.lib
comctl32.lib
wsock32.lib
vtksqlite.lib
vtkpng.lib
vtktiff.lib
vtkzlib.lib
vtkjpeg.lib
vtkexpat.lib
vtksys.lib
ws2_32.lib
vfw32.lib
vtkftgl.lib
vtkfreetype.lib
opengl32.lib
vtkWidgets.lib
vtkVolumeRendering.lib
vtkViews.lib
vtkproj4.lib
vtklibxml2.lib
vtkInfovis.lib
vtkHybrid.lib
vtkGeovis.lib
vtkGenericFiltering.lib
vtkexoIIc.lib
vtkCharts.lib
vtkalglib.lib


运行控制台测试程序:


#include "vtkConeSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderWindow.h"
#include "vtkCamera.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkProperty.h"

#include "windows.h"

int main()
{
vtkConeSource *cone = vtkConeSource::New();
cone->SetHeight( 3.0 );
cone->SetRadius( 1.0 );
cone->SetResolution( 10 );

vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
coneMapper->SetInputConnection( cone->GetOutputPort() );

vtkActor *coneActor = vtkActor::New();
coneActor->SetMapper( coneMapper );

vtkRenderer *ren1= vtkRenderer::New();
ren1->AddActor( coneActor );
ren1->SetBackground( 0.1, 0.2, 0.4 );

vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer( ren1 );
renWin->SetSize( 300, 300 );

int i;
for (i = 0; i < 360; ++i)
{
renWin->Render();
ren1->GetActiveCamera()->Azimuth( i );
Sleep(200);
}

cone->Delete();
coneMapper->Delete();
coneActor->Delete();
ren1->Delete();
renWin->Delete();

return 0;
}

还要将vtkMFC.dll放置在C:\Windows\System32下

VTK配置成功!


3.ITK的配置

ITK不需要设置环境变量

直接利用CMake运行测设程序


遇到一个错误:


这是因为没有将运行的项目设置为活动工程

设置为活动工程即可





人气教程排行