Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
88e6ae4c
Commit
88e6ae4c
authored
Nov 24, 2010
by
Ethan Rublee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding a check for if the first arg is an image - annoying if it overwrites
your files if you put in the wrong params.
parent
0a2881ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
imagelist_creator.cpp
samples/cpp/imagelist_creator.cpp
+8
-0
No files found.
samples/cpp/imagelist_creator.cpp
View file @
88e6ae4c
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
*/
*/
#include "opencv2/core/core.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <string>
#include <string>
#include <iostream>
#include <iostream>
...
@@ -28,6 +29,13 @@ int main(int ac, char** av)
...
@@ -28,6 +29,13 @@ int main(int ac, char** av)
string
outputname
=
av
[
1
];
string
outputname
=
av
[
1
];
Mat
m
=
imread
(
outputname
);
//check if the output is an image - prevent overwrites!
if
(
!
m
.
empty
()){
std
::
cerr
<<
"fail! Please specify an output file, don't want to overwrite you images!"
<<
endl
;
help
(
av
);
return
1
;
}
FileStorage
fs
(
outputname
,
FileStorage
::
WRITE
);
FileStorage
fs
(
outputname
,
FileStorage
::
WRITE
);
fs
<<
"images"
<<
"["
;
fs
<<
"images"
<<
"["
;
for
(
int
i
=
2
;
i
<
ac
;
i
++
){
for
(
int
i
=
2
;
i
<
ac
;
i
++
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment