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
b5b3a047
Commit
b5b3a047
authored
Dec 01, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7761 from UnaNancyOwen:add_props
parents
46a333ed
e547bbbc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
videoio.hpp
modules/videoio/include/opencv2/videoio.hpp
+14
-0
cap_images.cpp
modules/videoio/src/cap_images.cpp
+20
-1
No files found.
modules/videoio/include/opencv2/videoio.hpp
View file @
b5b3a047
...
...
@@ -556,6 +556,20 @@ enum { CAP_PROP_GPHOTO2_PREVIEW = 17001, //!< Capture only preview fro
//! @} gPhoto2
/** @name Images backend
@{
*/
/** @brief Images backend properties
*/
enum
{
CAP_PROP_IMAGES_BASE
=
18000
,
CAP_PROP_IMAGES_LAST
=
19000
// excluding
};
//! @} Images
//! @} videoio_flags_others
...
...
modules/videoio/src/cap_images.cpp
View file @
b5b3a047
...
...
@@ -332,18 +332,23 @@ public:
virtual
bool
open
(
const
char
*
_filename
);
virtual
void
close
();
virtual
bool
setProperty
(
int
,
double
);
virtual
bool
writeFrame
(
const
IplImage
*
);
protected
:
char
*
filename
;
unsigned
currentframe
;
std
::
vector
<
int
>
params
;
};
bool
CvVideoWriter_Images
::
writeFrame
(
const
IplImage
*
image
)
{
char
str
[
_MAX_PATH
];
sprintf
(
str
,
filename
,
currentframe
);
int
ret
=
cvSaveImage
(
str
,
image
);
std
::
vector
<
int
>
image_params
=
params
;
image_params
.
push_back
(
0
);
// append parameters 'stop' mark
image_params
.
push_back
(
0
);
int
ret
=
cvSaveImage
(
str
,
image
,
&
image_params
[
0
]);
currentframe
++
;
...
...
@@ -358,6 +363,7 @@ void CvVideoWriter_Images::close()
filename
=
0
;
}
currentframe
=
0
;
params
.
clear
();
}
...
...
@@ -380,10 +386,23 @@ bool CvVideoWriter_Images::open( const char* _filename )
}
currentframe
=
offset
;
params
.
clear
();
return
true
;
}
bool
CvVideoWriter_Images
::
setProperty
(
int
id
,
double
value
)
{
if
(
id
>=
cv
::
CAP_PROP_IMAGES_BASE
&&
id
<
cv
::
CAP_PROP_IMAGES_LAST
)
{
params
.
push_back
(
id
-
cv
::
CAP_PROP_IMAGES_BASE
);
params
.
push_back
(
static_cast
<
int
>
(
value
)
);
return
true
;
}
return
false
;
// not supported
}
CvVideoWriter
*
cvCreateVideoWriter_Images
(
const
char
*
filename
)
{
CvVideoWriter_Images
*
writer
=
new
CvVideoWriter_Images
;
...
...
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