Windows7-VisualStudioExpressEdition2012-x64
DownloadVisualStudio2012ExpressEditionforWindowsDesktopandinstall.
ConsiderthefreeopensourceprogramWinCDEmuifyouneedaprogramtomountISOimages.
YouwillhavetoregisterwithMicrosoftafterinstallation,butit'sfree.
GrabanyavailableVisualStudioUpdates.
DownloadandinstallWindows8SDK.
DownloadandInstallCMake2.8.11.2
Duringinstallationsetupselect"addCMaketoPATH".
DownloadOpenCV2.4.6.1
Considerthefreeopensourceprogram7-Zipifyouneedaprogramtounarchivetarballs.
Movethe"opencv-2.4.6.1"folderto"C:\".
Open"VS2012x64CrossToolsCommandPrompt"(fromtheStartMenu,select"AllPrograms"->"MicrosoftVisualStudio2012"->"VisualStudioTools"->"VS2012x64CrossToolsCommandPrompt")andenter:
$cdC:\opencv-2.4.6.1
$mkdirbuild-msvc2012
$cdbuild-msvc2012
$cmake-G"NMakeMakefiles"-DBUILD_PERF_TESTS=OFF-DBUILD_TESTS=OFF-DWITH_FFMPEG=OFF-DCMAKE_BUILD_TYPE=Debug..
$nmake
$nmakeinstall
$cmake-DCMAKE_BUILD_TYPE=Release..
$nmake
$nmakeinstall
$nmakeclean
DownloadandInstallQt5.1.1
CreateaGitHubaccountandfollowtheirinstructionsforsettingupGit.
Launch"GitBash"fromtheDesktopandcloneOpenBR:
$cd/c
$gitclonehttps://github.com/biometrics/openbr.git
$cdopenbr
$gitsubmoduleinit
$gitsubmoduleupdate
BuildOpenBR!
FromtheVS2012x64CrossToolsCommandPrompt:
$cdC:\openbr
$mkdirbuild-msvc2012
$cdbuild-msvc2012
$cmake-G"CodeBlocks-NMakeMakefiles"-DCMAKE_PREFIX_PATH="C:/opencv-2.4.6.1/build-msvc2012/install;C:/Qt/Qt5.1.1/5.1.1/msvc2012_64"-DCMAKE_INSTALL_PREFIX="./install"-DBR_INSTALL_DEPENDENCIES=ON-DCMAKE_BUILD_TYPE=Release..
$nmake
$nmakeinstall
Checkoutthe"install"folder.
HackOpenBR!
FromtheVS2012x64CrossToolsCommandPrompt:
$C:\Qt\Qt5.1.1\Tools\QtCreator\bin\qtcreator.exe
FromtheQtCreator"Tools"menuselect"Options..."
Under"Kits"select"Desktop(default)"
For"Compiler:"select"MicrosoftVisualC++Compiler11.0(x86_amd64)"andclick"OK"
FromtheQtCreator"File"menuselect"OpenFileorProject...".
Select"C:\openbr\CMakeLists.txt"then"Open".
IfpromptedforthelocationofCMake,enter"C:\ProgramFiles(x86)\CMake2.8\bin\cmake.exe".
Browsetoyourpre-existingbuilddirectory"C:\openbr\build-msvc2012"thenselect"Next".
Select"RunCMake"then"Finish".
You'reallset!YoucanfindmoreinformationonQtCreatorhereifyouneed.
(Optional)PackageOpenBR!
FromtheVS2012x64CrossToolsCommandPrompt:
$cdC:\openbr\build-msvc2012
$cpack-GZIP
--------------------------------------------------------------------------------
遇到的问题
安装完成之后,在测试程序中
#include
staticvoidprintTemplate(constbr::Template&t)
{
constQPointfirstEye=t.file.get("Affine_0");
constQPointsecondEye=t.file.get("Affine_1");
printf("%seyes:(%d,%d)(%d,%d)\n",qPrintable(t.file.fileName()),firstEye.x(),firstEye.y(),secondEye.x(),secondEye.y());
}
intmain(intargc,char*argv[])
{
br::Context::initialize(argc,argv);
//RetrieveclassesforenrollingandcomparingtemplatesusingtheFaceRecognitionalgorithm
QSharedPointer
transform=br::Transform::fromAlgorithm("FaceRecognition");
QSharedPointer
distance=br::Distance::fromAlgorithm("FaceRecognition");
//Initializetemplates
br::TemplatequeryA("../data/MEDS/img/S354-01-t10_01.jpg");
br::TemplatequeryB("../data/MEDS/img/S382-08-t10_01.jpg");
br::Templatetarget("../data/MEDS/img/S354-02-t10_01.jpg");
//Enrolltemplates
queryA>>*transform;
queryB>>*transform;
target>>*transform;
printTemplate(queryA);
printTemplate(queryB);
printTemplate(target);
//Comparetemplates
floatcomparisonA=distance->compare(target,queryA);
floatcomparisonB=distance->compare(target,queryB);
//Scoresrangefrom0to1andrepresentmatchprobability
printf("Genuinematchscore:%.3f\n",comparisonA);
printf("Impostormatchscore:%.3f\n",comparisonB);
br::Context::finalize();
return0;
}
在运行到
br::Context::initialize(argc,argv);
时不知道为什么程序就没法往下走了,不知道哪位朋友做过openbr,能否给些提示呢?
分 -->
|