Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camtron
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kr69sugu
camtron
Commits
4df630d6
Commit
4df630d6
authored
3 years ago
by
am0ebe
Browse files
Options
Downloads
Patches
Plain Diff
files check stuff
parent
9597760d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
camtron.sublime-project-snippet
+2
-2
2 additions, 2 deletions
camtron.sublime-project-snippet
examples/Demo.cpp
+9
-19
9 additions, 19 deletions
examples/Demo.cpp
src/algorithms/tools.cpp
+23
-33
23 additions, 33 deletions
src/algorithms/tools.cpp
src/algorithms/tools.h
+2
-2
2 additions, 2 deletions
src/algorithms/tools.h
with
36 additions
and
56 deletions
camtron.sublime-project-snippet
+
2
−
2
View file @
4df630d6
{
"name": "run",
"shell_cmd": "bgs_demo -i ../../dataset/video.tar -a 100 -o ../../output -c ../../config/centerConfigFile.xml -p ../../config/camParam.xml",
"shell_cmd": "bgs_demo -i ../../dataset/video.tar -a 100 -o ../../output -c ../../config/centerConfigFile.xml -p ../../config/camParam.xml
| c++filt -t
",
},
{
"name": "clean",
...
...
@@ -8,7 +8,7 @@
},
{
"name": "run: single",
"shell_cmd": "echo 'run...' && $file_base_name",
"shell_cmd": "echo 'run...' && $file_base_name
| c++filt -t
",
},
{
"name": "opencv: single",
...
...
This diff is collapsed.
Click to expand it.
examples/Demo.cpp
+
9
−
19
View file @
4df630d6
...
...
@@ -171,29 +171,19 @@ void parse(int argc, char** argv)
cout
<<
"amountFiles: "
<<
amountFiles
<<
endl
;
cout
<<
boolalpha
<<
"testMode: "
<<
testMode
<<
endl
;
bool
check
=
Tools
::
checkFile
(
camParamFile
,
"camParamFile"
)
&&
\
Tools
::
checkFile
(
centerFile
,
"centerFile"
)
&&
\
Tools
::
checkFile
(
inputFile
,
"inputFile"
)
&&
\
Tools
::
checkDir
(
outputDir
,
"outputDir"
);
list
<
tuple
<
string
,
string
,
bool
>>
tuplelist
;
tuple
<
string
,
string
,
bool
>
filedir
=
make_tuple
(
"camParamFile"
,
camParamFile
,
false
);
tuple
<
string
,
string
,
bool
>
filedir
=
make_tuple
(
"centerFile"
,
centerFile
,
false
);
tuple
<
string
,
string
,
bool
>
filedir
=
make_tuple
(
"inputFile"
,
inputFile
,
false
);
tuple
<
string
,
string
,
bool
>
filedir
=
make_tuple
(
"outputDir"
,
outputDir
,
true
);
if
(
checkFileDir
(
\
"camParamFile"
,
camParamFile
,
\
"centerFile"
,
centerFile
,
\
"inputFile"
,
inputFile
,
\
"outputDir"
,
outputDir
)
)
vector
<
String
>
x
=
{
"camParamFile"
,
camParamFile
,
"centerFile"
,
centerFile
,
"inputFile"
,
inputFile
,
"outputDir"
,
outputDir
};
if
(
!
Tools
::
check
(
x
))
exit
(
error
::
config_filedir
);
if
(
check
)
exit
(
error
::
config_filedir
);
Tools
::
maybeAppendSepToDir
(
outputDir
);
Tools
::
print_ruler
();
exit
(
1
232
);
exit
(
-
1
);
}
void
read_camParamFile
()
...
...
This diff is collapsed.
Click to expand it.
src/algorithms/tools.cpp
+
23
−
33
View file @
4df630d6
...
...
@@ -12,43 +12,33 @@ void Tools::print_ruler()
std
::
cout
<<
"######################################"
<<
std
::
endl
;
}
bool
Tools
::
checkFile
(
std
::
string
path
,
std
::
string
name
=
"path"
)
bool
Tools
::
maybeAppendSepToDir
(
String
&
d
)
{
bool
check
=
std
::
filesystem
::
exists
(
path
);
if
(
!
check
)
std
::
cerr
<<
name
<<
": "
<<
path
<<
" [not found!] "
<<
std
::
endl
;
else
std
::
cout
<<
name
<<
": "
<<
path
<<
std
::
endl
;
return
check
;
const
char
SEP
=
std
::
filesystem
::
path
::
preferred_separator
;
if
(
d
.
back
()
!=
SEP
)
d
+=
SEP
;
}
bool
Tools
::
check
Dir
(
std
::
string
&
path
,
std
::
string
name
=
"path"
)
auto
Tools
::
check
(
vector
<
String
>&
x
)
{
const
char
SEP
=
std
::
filesystem
::
path
::
preferred_separator
;
if
(
!
path
.
ends_with
(
SEP
)
)
path
+=
SEP
;
bool
check
=
std
::
filesystem
::
exists
(
path
);
if
(
!
check
)
{
try
{
std
::
filesystem
::
create_directories
(
path
);
std
::
cout
<<
name
<<
": "
<<
path
<<
" [created!] "
<<
std
::
endl
;
check
=
true
;
}
catch
(
std
::
filesystem
::
filesystem_error
&
e
)
{
std
::
cerr
<<
name
<<
": "
<<
path
<<
" [not found + cant create it!] "
<<
std
::
endl
;
check
=
false
;
}
}
else
{
std
::
cout
<<
name
<<
": "
<<
path
<<
std
::
endl
;
}
return
check
;
bool
checkAll
=
true
;
String
name
,
path
;
for
(
int
i
{
0
};
i
<
x
.
size
()
-
1
;
i
++
)
{
name
=
x
[
i
];
path
=
x
[
++
i
];
bool
check
=
std
::
filesystem
::
exists
(
path
);
if
(
!
check
)
std
::
cerr
<<
name
<<
": "
<<
path
<<
" [not found!] "
<<
std
::
endl
;
else
std
::
cout
<<
name
<<
": "
<<
path
<<
std
::
endl
;
checkAll
&=
check
;
}
return
checkAll
;
}
std
::
string
Tools
::
mNzero
(
int
i
)
...
...
This diff is collapsed.
Click to expand it.
src/algorithms/tools.h
+
2
−
2
View file @
4df630d6
...
...
@@ -26,8 +26,8 @@ class Tools
{
public:
static
bool
check
Dir
(
std
::
s
tring
&
path
,
std
::
string
name
);
static
bool
check
File
(
std
::
string
path
,
std
::
s
tring
name
);
static
void
maybeAppendSepTo
Dir
(
std
::
S
tring
&
d
)
static
bool
check
(
std
::
vector
<
std
::
S
tring
>&
x
)
//! print ruler
static
void
print_ruler
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment