Skip to content

Commit 8c14764

Browse files
committed
batchprocess
增加了批处理
1 parent 5f6d97d commit 8c14764

20 files changed

+188
-698
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
reconstruction/x64/
55
CloudOptimization/x64/
66
Kinect2Cloud/x64/
7-
background_subtraction/x64/
7+
BatchProcess/x64/
88
dlls/
99
.svn/
1010

background_subtraction/background_subtraction.vcxproj renamed to BatchProcess/BatchProcess.vcxproj

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
</ProjectConfiguration>
1212
</ItemGroup>
1313
<PropertyGroup Label="Globals">
14-
<ProjectGuid>{44EE9EF8-0206-47DE-AB96-4623215BCC78}</ProjectGuid>
14+
<ProjectGuid>{594E107D-DE5E-4E1B-A753-EF333751E6E2}</ProjectGuid>
1515
<Keyword>Win32Proj</Keyword>
16-
<RootNamespace>background_subtraction</RootNamespace>
16+
<RootNamespace>BatchProcess</RootNamespace>
1717
</PropertyGroup>
1818
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1919
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -43,7 +43,6 @@
4343
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
4444
<LinkIncremental>false</LinkIncremental>
4545
<OutDir>$(SolutionDir)dlls\$(Configuration)\</OutDir>
46-
<IncludePath>$(IncludePath)</IncludePath>
4746
</PropertyGroup>
4847
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
4948
<ClCompile>
@@ -52,8 +51,6 @@
5251
<WarningLevel>Level3</WarningLevel>
5352
<Optimization>Disabled</Optimization>
5453
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
55-
<AdditionalIncludeDirectories>..\include</AdditionalIncludeDirectories>
56-
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
5754
</ClCompile>
5855
<Link>
5956
<SubSystem>Console</SubSystem>
@@ -71,18 +68,16 @@
7168
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
7269
<AdditionalIncludeDirectories>..\include</AdditionalIncludeDirectories>
7370
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
74-
<OpenMPSupport>true</OpenMPSupport>
7571
</ClCompile>
7672
<Link>
7773
<SubSystem>Console</SubSystem>
7874
<GenerateDebugInformation>true</GenerateDebugInformation>
7975
<EnableCOMDATFolding>true</EnableCOMDATFolding>
8076
<OptimizeReferences>true</OptimizeReferences>
81-
<AdditionalDependencies>comctl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
8277
</Link>
8378
</ItemDefinitionGroup>
8479
<ItemGroup>
85-
<ClCompile Include="bk_subtraction.cpp" />
80+
<ClCompile Include="main.cpp" />
8681
</ItemGroup>
8782
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
8883
<ImportGroup Label="ExtensionTargets">

background_subtraction/background_subtraction.vcxproj.filters renamed to BatchProcess/BatchProcess.vcxproj.filters

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</Filter>
1616
</ItemGroup>
1717
<ItemGroup>
18-
<ClCompile Include="bk_subtraction.cpp">
18+
<ClCompile Include="main.cpp">
1919
<Filter>源文件</Filter>
2020
</ClCompile>
2121
</ItemGroup>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
4+
<LocalDebuggerWorkingDirectory>$(SolutionDir)dlls\$(Configuration)</LocalDebuggerWorkingDirectory>
5+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
6+
<LocalDebuggerCommandArguments>&gt;&gt;log.txt</LocalDebuggerCommandArguments>
7+
</PropertyGroup>
8+
</Project>

BatchProcess/main.cpp

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#include <stdio.h>
2+
//#include <string>
3+
#include <opencv/core.hpp>
4+
5+
#ifdef _DEBUG
6+
#pragma comment (lib,"../lib/opencv/opencv_core245d.lib")
7+
#pragma comment (lib,"../lib/opencv/zlibd.lib")
8+
#else
9+
#pragma comment (lib,"../lib/opencv/opencv_core245.lib")
10+
#pragma comment (lib,"../lib/opencv/zlib.lib")
11+
#endif
12+
13+
using namespace std;
14+
int sn[] = {13293115, 13293116, 13502663, 13502667, 13502670, 13502673, 13502680, 13502683, 13502686, 13502693};
15+
#define EXPRESSION_NUM 24
16+
#define CAMERA_NUM 10
17+
18+
int main(int Argc, char ** Argv)
19+
{
20+
char config_file[100];
21+
if (Argc == 1)
22+
strcpy(config_file, "path.txt");
23+
else strcpy(config_file, Argv[1]);
24+
FILE *fp = fopen(config_file, "r");
25+
if (fp == NULL)
26+
{
27+
printf("unable to open file %s\n", config_file);
28+
return -1;
29+
}
30+
while (!feof(fp))
31+
{
32+
char input_path[512], output_path[512];
33+
fscanf(fp, "%s %s\n", input_path, output_path);
34+
char cmd[512];
35+
sprintf(cmd, "mkdir %s", output_path);
36+
system(cmd);
37+
for (int i=0; i<EXPRESSION_NUM; i++)
38+
{
39+
printf("%d %s %s\n", i, input_path, output_path);
40+
cv::FileStorage fs("config.yml", cv::FileStorage::WRITE);
41+
if (fs.isOpened()==false)
42+
{
43+
printf("%d open file config.yml failed\n", i);
44+
continue;
45+
}
46+
fs<<"filepath"<<input_path;
47+
char buffer[512];
48+
sprintf(buffer, "%s%d.ply", output_path, i+1);
49+
fs<<"outfilename"<<buffer;
50+
fs<<"isoutput"<<0;
51+
fs<<"camera_calib_name"<<"calib_camera.yml";
52+
fs<<"PyrmNum"<<4;
53+
fs<<"LowestLevelWidth"<<90;
54+
fs<<"LowestLevelHeight"<<120;
55+
vector<string> imagelist(CAMERA_NUM),masklist(CAMERA_NUM);
56+
for (int j=0; j<CAMERA_NUM; j++)
57+
{
58+
char buffer1[512];
59+
sprintf(buffer1, "%d_%d_0.jpg", i+1, sn[j]);
60+
imagelist[j] = buffer1;
61+
masklist[j] = "mask\\" + imagelist[j];
62+
}
63+
fs<<"imagelist"<<imagelist;
64+
fs<<"masklist"<<masklist;
65+
fs<<"camID"<<"14,93,68,25,70";
66+
fs.release();
67+
sprintf(cmd, "reconstruction config.yml");
68+
system(cmd);
69+
}
70+
}
71+
fclose(fp);
72+
}

0 commit comments

Comments
 (0)