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
6e5e5d87
Commit
6e5e5d87
authored
Apr 25, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6448 from alalek:merge-2.4
parents
5ed4e1b8
67a734ce
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
78 additions
and
67 deletions
+78
-67
CMakeLists.txt
apps/annotation/CMakeLists.txt
+0
-1
CMakeLists.txt
apps/createsamples/CMakeLists.txt
+0
-1
CMakeLists.txt
apps/traincascade/CMakeLists.txt
+0
-1
OpenCVModule.cmake
cmake/OpenCVModule.cmake
+0
-1
window_gtk.cpp
modules/highgui/src/window_gtk.cpp
+25
-5
grfmt_png.cpp
modules/imgcodecs/src/grfmt_png.cpp
+1
-3
pyramids.cpp
modules/imgproc/src/pyramids.cpp
+17
-1
CMakeLists.txt
modules/java/CMakeLists.txt
+0
-1
cap_ffmpeg_impl.hpp
modules/videoio/src/cap_ffmpeg_impl.hpp
+35
-53
tree.avi
samples/data/tree.avi
+0
-0
No files found.
apps/annotation/CMakeLists.txt
View file @
6e5e5d87
...
@@ -21,7 +21,6 @@ set_target_properties(${the_target} PROPERTIES
...
@@ -21,7 +21,6 @@ set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
INSTALL_NAME_DIR lib
OUTPUT_NAME
"opencv_annotation"
)
OUTPUT_NAME
"opencv_annotation"
)
if
(
ENABLE_SOLUTION_FOLDERS
)
if
(
ENABLE_SOLUTION_FOLDERS
)
...
...
apps/createsamples/CMakeLists.txt
View file @
6e5e5d87
...
@@ -23,7 +23,6 @@ set_target_properties(${the_target} PROPERTIES
...
@@ -23,7 +23,6 @@ set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
INSTALL_NAME_DIR lib
OUTPUT_NAME
"opencv_createsamples"
)
OUTPUT_NAME
"opencv_createsamples"
)
if
(
ENABLE_SOLUTION_FOLDERS
)
if
(
ENABLE_SOLUTION_FOLDERS
)
...
...
apps/traincascade/CMakeLists.txt
View file @
6e5e5d87
...
@@ -23,7 +23,6 @@ set_target_properties(${the_target} PROPERTIES
...
@@ -23,7 +23,6 @@ set_target_properties(${the_target} PROPERTIES
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
DEBUG_POSTFIX
"
${
OPENCV_DEBUG_POSTFIX
}
"
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
INSTALL_NAME_DIR lib
OUTPUT_NAME
"opencv_traincascade"
)
OUTPUT_NAME
"opencv_traincascade"
)
if
(
ENABLE_SOLUTION_FOLDERS
)
if
(
ENABLE_SOLUTION_FOLDERS
)
...
...
cmake/OpenCVModule.cmake
View file @
6e5e5d87
...
@@ -833,7 +833,6 @@ macro(_ocv_create_module)
...
@@ -833,7 +833,6 @@ macro(_ocv_create_module)
COMPILE_PDB_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
COMPILE_PDB_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
LIBRARY_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
LIBRARY_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
INSTALL_NAME_DIR lib
)
)
# For dynamic link numbering convenions
# For dynamic link numbering convenions
...
...
modules/highgui/src/window_gtk.cpp
View file @
6e5e5d87
...
@@ -1216,13 +1216,33 @@ static void icvDeleteWindow( CvWindow* window )
...
@@ -1216,13 +1216,33 @@ static void icvDeleteWindow( CvWindow* window )
}
}
cvFree
(
&
window
);
cvFree
(
&
window
);
// if last window...
if
(
hg_windows
==
0
)
{
#ifdef HAVE_GTHREAD
#ifdef HAVE_GTHREAD
// if last window, send key press signal
if
(
thread_started
)
// to jump out of any waiting cvWaitKey's
{
if
(
hg_windows
==
0
&&
thread_started
){
// send key press signal to jump out of any waiting cvWaitKey's
g_cond_broadcast
(
cond_have_key
);
g_cond_broadcast
(
cond_have_key
);
}
}
else
{
#endif
// Some GTK+ modules (like the Unity module) use GDBusConnection,
// which has a habit of postponing cleanup by performing it via
// idle sources added to the main loop. Since this was the last window,
// we can assume that no event processing is going to happen in the
// nearest future, so we should force that cleanup (by handling all pending
// events) while we still have the chance.
// This is not needed if thread_started is true, because the background
// thread will process events continuously.
while
(
gtk_events_pending
()
)
gtk_main_iteration
();
#ifdef HAVE_GTHREAD
}
#endif
#endif
}
}
}
...
...
modules/imgcodecs/src/grfmt_png.cpp
View file @
6e5e5d87
...
@@ -228,8 +228,6 @@ bool PngDecoder::readData( Mat& img )
...
@@ -228,8 +228,6 @@ bool PngDecoder::readData( Mat& img )
AutoBuffer
<
uchar
*>
_buffer
(
m_height
);
AutoBuffer
<
uchar
*>
_buffer
(
m_height
);
uchar
**
buffer
=
_buffer
;
uchar
**
buffer
=
_buffer
;
int
color
=
img
.
channels
()
>
1
;
int
color
=
img
.
channels
()
>
1
;
uchar
*
data
=
img
.
ptr
();
int
step
=
(
int
)
img
.
step
;
if
(
m_png_ptr
&&
m_info_ptr
&&
m_end_info
&&
m_width
&&
m_height
)
if
(
m_png_ptr
&&
m_info_ptr
&&
m_end_info
&&
m_width
&&
m_height
)
{
{
...
@@ -281,7 +279,7 @@ bool PngDecoder::readData( Mat& img )
...
@@ -281,7 +279,7 @@ bool PngDecoder::readData( Mat& img )
png_read_update_info
(
png_ptr
,
info_ptr
);
png_read_update_info
(
png_ptr
,
info_ptr
);
for
(
y
=
0
;
y
<
m_height
;
y
++
)
for
(
y
=
0
;
y
<
m_height
;
y
++
)
buffer
[
y
]
=
data
+
y
*
step
;
buffer
[
y
]
=
img
.
data
+
y
*
img
.
step
;
png_read_image
(
png_ptr
,
buffer
);
png_read_image
(
png_ptr
,
buffer
);
png_read_end
(
png_ptr
,
end_info
);
png_read_end
(
png_ptr
,
end_info
);
...
...
modules/imgproc/src/pyramids.cpp
View file @
6e5e5d87
...
@@ -1010,7 +1010,7 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
...
@@ -1010,7 +1010,7 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
for
(
;
sy
<=
y
+
1
;
sy
++
)
for
(
;
sy
<=
y
+
1
;
sy
++
)
{
{
WT
*
row
=
buf
+
((
sy
-
sy0
)
%
PU_SZ
)
*
bufstep
;
WT
*
row
=
buf
+
((
sy
-
sy0
)
%
PU_SZ
)
*
bufstep
;
int
_sy
=
borderInterpolate
(
sy
*
2
,
dsize
.
height
,
BORDER_REFLECT_101
)
/
2
;
int
_sy
=
borderInterpolate
(
sy
*
2
,
ssize
.
height
*
2
,
BORDER_REFLECT_101
)
/
2
;
const
T
*
src
=
_src
.
ptr
<
T
>
(
_sy
);
const
T
*
src
=
_src
.
ptr
<
T
>
(
_sy
);
if
(
ssize
.
width
==
cn
)
if
(
ssize
.
width
==
cn
)
...
@@ -1031,6 +1031,11 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
...
@@ -1031,6 +1031,11 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
t0
=
src
[
sx
-
cn
]
+
src
[
sx
]
*
7
;
t0
=
src
[
sx
-
cn
]
+
src
[
sx
]
*
7
;
t1
=
src
[
sx
]
*
8
;
t1
=
src
[
sx
]
*
8
;
row
[
dx
]
=
t0
;
row
[
dx
+
cn
]
=
t1
;
row
[
dx
]
=
t0
;
row
[
dx
+
cn
]
=
t1
;
if
(
dsize
.
width
>
ssize
.
width
*
2
)
{
row
[(
_dst
.
cols
-
1
)
+
x
]
=
row
[
dx
+
cn
];
}
}
}
for
(
x
=
cn
;
x
<
ssize
.
width
-
cn
;
x
++
)
for
(
x
=
cn
;
x
<
ssize
.
width
-
cn
;
x
++
)
...
@@ -1057,6 +1062,17 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
...
@@ -1057,6 +1062,17 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
dst1
[
x
]
=
t1
;
dst0
[
x
]
=
t0
;
dst1
[
x
]
=
t1
;
dst0
[
x
]
=
t0
;
}
}
}
}
if
(
dsize
.
height
>
ssize
.
height
*
2
)
{
T
*
dst0
=
_dst
.
ptr
<
T
>
(
ssize
.
height
*
2
-
2
);
T
*
dst2
=
_dst
.
ptr
<
T
>
(
ssize
.
height
*
2
);
for
(
x
=
0
;
x
<
dsize
.
width
;
x
++
)
{
dst2
[
x
]
=
dst0
[
x
];
}
}
}
}
typedef
void
(
*
PyrFunc
)(
const
Mat
&
,
Mat
&
,
int
);
typedef
void
(
*
PyrFunc
)(
const
Mat
&
,
Mat
&
,
int
);
...
...
modules/java/CMakeLists.txt
View file @
6e5e5d87
...
@@ -386,7 +386,6 @@ set_target_properties(${the_module} PROPERTIES
...
@@ -386,7 +386,6 @@ set_target_properties(${the_module} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
LIBRARY_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
LIBRARY_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
INSTALL_NAME_DIR
${
OPENCV_LIB_INSTALL_PATH
}
LINK_INTERFACE_LIBRARIES ""
LINK_INTERFACE_LIBRARIES ""
)
)
...
...
modules/videoio/src/cap_ffmpeg_impl.hpp
View file @
6e5e5d87
...
@@ -1319,7 +1319,7 @@ struct CvVideoWriter_FFMPEG
...
@@ -1319,7 +1319,7 @@ struct CvVideoWriter_FFMPEG
uint8_t
*
picbuf
;
uint8_t
*
picbuf
;
AVStream
*
video_st
;
AVStream
*
video_st
;
int
input_pix_fmt
;
int
input_pix_fmt
;
Image_FFMPEG
temp_image
;
unsigned
char
*
aligned_input
;
int
frame_width
,
frame_height
;
int
frame_width
,
frame_height
;
int
frame_idx
;
int
frame_idx
;
bool
ok
;
bool
ok
;
...
@@ -1396,7 +1396,7 @@ void CvVideoWriter_FFMPEG::init()
...
@@ -1396,7 +1396,7 @@ void CvVideoWriter_FFMPEG::init()
picbuf
=
0
;
picbuf
=
0
;
video_st
=
0
;
video_st
=
0
;
input_pix_fmt
=
0
;
input_pix_fmt
=
0
;
memset
(
&
temp_image
,
0
,
sizeof
(
temp_image
))
;
aligned_input
=
NULL
;
img_convert_ctx
=
0
;
img_convert_ctx
=
0
;
frame_width
=
frame_height
=
0
;
frame_width
=
frame_height
=
0
;
frame_idx
=
0
;
frame_idx
=
0
;
...
@@ -1665,7 +1665,20 @@ static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st,
...
@@ -1665,7 +1665,20 @@ static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st,
/// write a frame with FFMPEG
/// write a frame with FFMPEG
bool
CvVideoWriter_FFMPEG
::
writeFrame
(
const
unsigned
char
*
data
,
int
step
,
int
width
,
int
height
,
int
cn
,
int
origin
)
bool
CvVideoWriter_FFMPEG
::
writeFrame
(
const
unsigned
char
*
data
,
int
step
,
int
width
,
int
height
,
int
cn
,
int
origin
)
{
{
bool
ret
=
false
;
// check parameters
if
(
input_pix_fmt
==
AV_PIX_FMT_BGR24
)
{
if
(
cn
!=
3
)
{
return
false
;
}
}
else
if
(
input_pix_fmt
==
AV_PIX_FMT_GRAY8
)
{
if
(
cn
!=
1
)
{
return
false
;
}
}
else
{
assert
(
false
);
}
if
(
(
width
&
-
2
)
!=
frame_width
||
(
height
&
-
2
)
!=
frame_height
||
!
data
)
if
(
(
width
&
-
2
)
!=
frame_width
||
(
height
&
-
2
)
!=
frame_height
||
!
data
)
return
false
;
return
false
;
...
@@ -1679,58 +1692,29 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
...
@@ -1679,58 +1692,29 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
AVCodecContext
*
c
=
&
(
video_st
->
codec
);
AVCodecContext
*
c
=
&
(
video_st
->
codec
);
#endif
#endif
#if LIBAVFORMAT_BUILD < 5231
// FFmpeg contains SIMD optimizations which can sometimes read data past
// It is not needed in the latest versions of the ffmpeg
// the supplied input buffer. To ensure that doesn't happen, we pad the
if
(
c
->
codec_id
==
CV_CODEC
(
CODEC_ID_RAWVIDEO
)
&&
origin
!=
1
)
// step to a multiple of 32 (that's the minimal alignment for which Valgrind
{
// doesn't raise any warnings).
if
(
!
temp_image
.
data
)
const
int
STEP_ALIGNMENT
=
32
;
{
if
(
step
%
STEP_ALIGNMENT
!=
0
)
temp_image
.
step
=
(
width
*
cn
+
3
)
&
-
4
;
temp_image
.
width
=
width
;
temp_image
.
height
=
height
;
temp_image
.
cn
=
cn
;
temp_image
.
data
=
(
unsigned
char
*
)
malloc
(
temp_image
.
step
*
temp_image
.
height
);
}
for
(
int
y
=
0
;
y
<
height
;
y
++
)
memcpy
(
temp_image
.
data
+
y
*
temp_image
.
step
,
data
+
(
height
-
1
-
y
)
*
step
,
width
*
cn
);
data
=
temp_image
.
data
;
step
=
temp_image
.
step
;
}
#else
if
(
width
*
cn
!=
step
)
{
{
if
(
!
temp_image
.
data
)
int
aligned_step
=
(
step
+
STEP_ALIGNMENT
-
1
)
&
-
STEP_ALIGNMENT
;
if
(
!
aligned_input
)
{
{
temp_image
.
step
=
width
*
cn
;
aligned_input
=
(
unsigned
char
*
)
av_mallocz
(
aligned_step
*
height
);
temp_image
.
width
=
width
;
temp_image
.
height
=
height
;
temp_image
.
cn
=
cn
;
temp_image
.
data
=
(
unsigned
char
*
)
malloc
(
temp_image
.
step
*
temp_image
.
height
);
}
}
if
(
origin
==
1
)
if
(
origin
==
1
)
for
(
int
y
=
0
;
y
<
height
;
y
++
)
for
(
int
y
=
0
;
y
<
height
;
y
++
)
memcpy
(
temp_image
.
data
+
y
*
temp_image
.
step
,
data
+
(
height
-
1
-
y
)
*
step
,
temp_image
.
step
);
memcpy
(
aligned_input
+
y
*
aligned_step
,
data
+
(
height
-
1
-
y
)
*
step
,
step
);
else
else
for
(
int
y
=
0
;
y
<
height
;
y
++
)
for
(
int
y
=
0
;
y
<
height
;
y
++
)
memcpy
(
temp_image
.
data
+
y
*
temp_image
.
step
,
data
+
y
*
step
,
temp_image
.
step
);
memcpy
(
aligned_input
+
y
*
aligned_step
,
data
+
y
*
step
,
step
);
data
=
temp_image
.
data
;
step
=
temp_image
.
step
;
}
#endif
// check parameters
data
=
aligned_input
;
if
(
input_pix_fmt
==
AV_PIX_FMT_BGR24
)
{
step
=
aligned_step
;
if
(
cn
!=
3
)
{
return
false
;
}
}
else
if
(
input_pix_fmt
==
AV_PIX_FMT_GRAY8
)
{
if
(
cn
!=
1
)
{
return
false
;
}
}
else
{
assert
(
false
);
}
}
if
(
c
->
pix_fmt
!=
input_pix_fmt
)
{
if
(
c
->
pix_fmt
!=
input_pix_fmt
)
{
...
@@ -1738,6 +1722,7 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
...
@@ -1738,6 +1722,7 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
// let input_picture point to the raw data buffer of 'image'
// let input_picture point to the raw data buffer of 'image'
_opencv_ffmpeg_av_image_fill_arrays
(
input_picture
,
(
uint8_t
*
)
data
,
_opencv_ffmpeg_av_image_fill_arrays
(
input_picture
,
(
uint8_t
*
)
data
,
(
AVPixelFormat
)
input_pix_fmt
,
width
,
height
);
(
AVPixelFormat
)
input_pix_fmt
,
width
,
height
);
input_picture
->
linesize
[
0
]
=
step
;
if
(
!
img_convert_ctx
)
if
(
!
img_convert_ctx
)
{
{
...
@@ -1762,10 +1747,11 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
...
@@ -1762,10 +1747,11 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
else
{
else
{
_opencv_ffmpeg_av_image_fill_arrays
(
picture
,
(
uint8_t
*
)
data
,
_opencv_ffmpeg_av_image_fill_arrays
(
picture
,
(
uint8_t
*
)
data
,
(
AVPixelFormat
)
input_pix_fmt
,
width
,
height
);
(
AVPixelFormat
)
input_pix_fmt
,
width
,
height
);
picture
->
linesize
[
0
]
=
step
;
}
}
picture
->
pts
=
frame_idx
;
picture
->
pts
=
frame_idx
;
ret
=
icv_av_write_frame_FFMPEG
(
oc
,
video_st
,
outbuf
,
outbuf_size
,
picture
)
>=
0
;
bool
ret
=
icv_av_write_frame_FFMPEG
(
oc
,
video_st
,
outbuf
,
outbuf_size
,
picture
)
>=
0
;
frame_idx
++
;
frame_idx
++
;
return
ret
;
return
ret
;
...
@@ -1848,11 +1834,7 @@ void CvVideoWriter_FFMPEG::close()
...
@@ -1848,11 +1834,7 @@ void CvVideoWriter_FFMPEG::close()
/* free the stream */
/* free the stream */
avformat_free_context
(
oc
);
avformat_free_context
(
oc
);
if
(
temp_image
.
data
)
av_freep
(
&
aligned_input
);
{
free
(
temp_image
.
data
);
temp_image
.
data
=
0
;
}
init
();
init
();
}
}
...
...
samples/data/tree.avi
View file @
6e5e5d87
No preview for this file type
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