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
ebe97909
Commit
ebe97909
authored
Apr 28, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3963 from Dikay900:2_4_diff_to_master
parents
26e3bcb9
6decc259
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
73 additions
and
53 deletions
+73
-53
CMakeLists.txt
CMakeLists.txt
+5
-0
reading_and_writing_images_and_video.rst
modules/highgui/doc/reading_and_writing_images_and_video.rst
+2
-2
grfmt_tiff.cpp
modules/highgui/src/grfmt_tiff.cpp
+6
-1
android+AsyncServiceHelper.java
...s/java/generator/src/java/android+AsyncServiceHelper.java
+3
-2
delaunay2.cpp
samples/cpp/delaunay2.cpp
+1
-1
grabcut.cpp
samples/cpp/grabcut.cpp
+2
-2
houghcircles.cpp
samples/cpp/houghcircles.cpp
+1
-1
kalman.cpp
samples/cpp/kalman.cpp
+1
-1
lkdemo.cpp
samples/cpp/lkdemo.cpp
+1
-2
openni_capture.cpp
samples/cpp/openni_capture.cpp
+7
-7
starter_video.cpp
samples/cpp/starter_video.cpp
+35
-30
stereo_calib.cpp
samples/cpp/stereo_calib.cpp
+1
-1
MatchTemplate_Demo.cpp
.../tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp
+1
-1
findContours_demo.cpp
.../cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp
+7
-2
No files found.
CMakeLists.txt
View file @
ebe97909
...
...
@@ -52,6 +52,11 @@ if(POLICY CMP0026)
cmake_policy
(
SET CMP0026 OLD
)
endif
()
if
(
POLICY CMP0042
)
# silence cmake 3.0+ warnings about MACOSX_RPATH
cmake_policy
(
SET CMP0042 OLD
)
endif
()
# must go before the project command
set
(
CMAKE_CONFIGURATION_TYPES
"Debug;Release"
CACHE STRING
"Configs"
FORCE
)
if
(
DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER
"2.8"
)
...
...
modules/highgui/doc/reading_and_writing_images_and_video.rst
View file @
ebe97909
...
...
@@ -193,8 +193,8 @@ VideoCapture
------------
.. ocv:class:: VideoCapture
Class for video capturing from video files or cameras.
The class provides C++ API for capturing video from cameras or for reading video files. Here is how the class can be used: ::
Class for video capturing from video files
, image sequences
or cameras.
The class provides C++ API for capturing video from cameras or for reading video files
and image sequences
. Here is how the class can be used: ::
#include "opencv2/opencv.hpp"
...
...
modules/highgui/src/grfmt_tiff.cpp
View file @
ebe97909
...
...
@@ -491,13 +491,18 @@ bool TiffEncoder::writeLibTiff( const Mat& img, const vector<int>& params)
||
!
TIFFSetField
(
pTiffHandle
,
TIFFTAG_SAMPLESPERPIXEL
,
channels
)
||
!
TIFFSetField
(
pTiffHandle
,
TIFFTAG_PLANARCONFIG
,
PLANARCONFIG_CONTIG
)
||
!
TIFFSetField
(
pTiffHandle
,
TIFFTAG_ROWSPERSTRIP
,
rowsPerStrip
)
||
!
TIFFSetField
(
pTiffHandle
,
TIFFTAG_PREDICTOR
,
predictor
)
)
{
TIFFClose
(
pTiffHandle
);
return
false
;
}
if
(
compression
!=
COMPRESSION_NONE
&&
!
TIFFSetField
(
pTiffHandle
,
TIFFTAG_PREDICTOR
,
predictor
)
)
{
TIFFClose
(
pTiffHandle
);
return
false
;
}
// row buffer, because TIFFWriteScanline modifies the original data!
size_t
scanlineSize
=
TIFFScanlineSize
(
pTiffHandle
);
AutoBuffer
<
uchar
>
_buffer
(
scanlineSize
+
32
);
...
...
modules/java/generator/src/java/android+AsyncServiceHelper.java
View file @
ebe97909
...
...
@@ -21,8 +21,9 @@ class AsyncServiceHelper
final
LoaderCallbackInterface
Callback
)
{
AsyncServiceHelper
helper
=
new
AsyncServiceHelper
(
Version
,
AppContext
,
Callback
);
if
(
AppContext
.
bindService
(
new
Intent
(
"org.opencv.engine.BIND"
),
helper
.
mServiceConnection
,
Context
.
BIND_AUTO_CREATE
))
Intent
intent
=
new
Intent
(
"org.opencv.engine.BIND"
);
intent
.
setPackage
(
"org.opencv.engine"
);
if
(
AppContext
.
bindService
(
intent
,
helper
.
mServiceConnection
,
Context
.
BIND_AUTO_CREATE
))
{
return
true
;
}
...
...
samples/cpp/delaunay2.cpp
View file @
ebe97909
...
...
@@ -98,7 +98,7 @@ static void paint_voronoi( Mat& img, Subdiv2D& subdiv )
ifacets
[
0
]
=
ifacet
;
polylines
(
img
,
ifacets
,
true
,
Scalar
(),
1
,
CV_AA
,
0
);
circle
(
img
,
centers
[
i
],
3
,
Scalar
(),
-
1
,
CV_AA
,
0
);
circle
(
img
,
centers
[
i
],
3
,
Scalar
(),
CV_FILLED
,
CV_AA
,
0
);
}
}
...
...
samples/cpp/grabcut.cpp
View file @
ebe97909
...
...
@@ -21,10 +21,10 @@ static void help()
"
\t
left mouse button - set rectangle
\n
"
"
\n
"
"
\t
CTRL+left mouse button - set GC_BGD pixels
\n
"
"
\t
SHIFT+left mouse button - set
CG
_FGD pixels
\n
"
"
\t
SHIFT+left mouse button - set
GC
_FGD pixels
\n
"
"
\n
"
"
\t
CTRL+right mouse button - set GC_PR_BGD pixels
\n
"
"
\t
SHIFT+right mouse button - set
CG
_PR_FGD pixels
\n
"
<<
endl
;
"
\t
SHIFT+right mouse button - set
GC
_PR_FGD pixels
\n
"
<<
endl
;
}
const
Scalar
RED
=
Scalar
(
0
,
0
,
255
);
...
...
samples/cpp/houghcircles.cpp
View file @
ebe97909
...
...
@@ -10,7 +10,7 @@ static void help()
{
cout
<<
"
\n
This program demonstrates circle finding with the Hough transform.
\n
"
"Usage:
\n
"
"./houghcircles <image_name>, Default is
pic1.pn
g
\n
"
<<
endl
;
"./houghcircles <image_name>, Default is
board.jp
g
\n
"
<<
endl
;
}
int
main
(
int
argc
,
char
**
argv
)
...
...
samples/cpp/kalman.cpp
View file @
ebe97909
...
...
@@ -12,7 +12,7 @@ static inline Point calcPoint(Point2f center, double R, double angle)
static
void
help
()
{
printf
(
"
\n
Examle of c calls to OpenCV's Kalman filter.
\n
"
printf
(
"
\n
Exam
p
le of c calls to OpenCV's Kalman filter.
\n
"
" Tracking of rotating point.
\n
"
" Rotation speed is constant.
\n
"
" Both state and measurements vectors are 1D (a point angle),
\n
"
...
...
samples/cpp/lkdemo.cpp
View file @
ebe97909
...
...
@@ -60,12 +60,11 @@ int main( int argc, char** argv )
namedWindow
(
"LK Demo"
,
1
);
setMouseCallback
(
"LK Demo"
,
onMouse
,
0
);
Mat
gray
,
prevGray
,
image
;
Mat
gray
,
prevGray
,
image
,
frame
;
vector
<
Point2f
>
points
[
2
];
for
(;;)
{
Mat
frame
;
cap
>>
frame
;
if
(
frame
.
empty
()
)
break
;
...
...
samples/cpp/openni_capture.cpp
View file @
ebe97909
...
...
@@ -12,14 +12,14 @@ static void help()
"The user gets some of the supported output images.
\n
"
"
\n
All supported output map types:
\n
"
"1.) Data given from depth generator
\n
"
" OPENNI_DEPTH_MAP - depth values in mm (CV_16UC1)
\n
"
" OPENNI_POINT_CLOUD_MAP - XYZ in meters (CV_32FC3)
\n
"
" OPENNI_DISPARITY_MAP - disparity in pixels (CV_8UC1)
\n
"
" OPENNI_DISPARITY_MAP_32F - disparity in pixels (CV_32FC1)
\n
"
" OPENNI_VALID_DEPTH_MASK - mask of valid pixels (not ocluded, not shaded etc.) (CV_8UC1)
\n
"
"
CV_CAP_
OPENNI_DEPTH_MAP - depth values in mm (CV_16UC1)
\n
"
"
CV_CAP_
OPENNI_POINT_CLOUD_MAP - XYZ in meters (CV_32FC3)
\n
"
"
CV_CAP_
OPENNI_DISPARITY_MAP - disparity in pixels (CV_8UC1)
\n
"
"
CV_CAP_
OPENNI_DISPARITY_MAP_32F - disparity in pixels (CV_32FC1)
\n
"
"
CV_CAP_
OPENNI_VALID_DEPTH_MASK - mask of valid pixels (not ocluded, not shaded etc.) (CV_8UC1)
\n
"
"2.) Data given from RGB image generator
\n
"
" OPENNI_BGR_IMAGE - color image (CV_8UC3)
\n
"
" OPENNI_GRAY_IMAGE - gray image (CV_8UC1)
\n
"
"
CV_CAP_
OPENNI_BGR_IMAGE - color image (CV_8UC3)
\n
"
"
CV_CAP_
OPENNI_GRAY_IMAGE - gray image (CV_8UC1)
\n
"
<<
endl
;
}
...
...
samples/cpp/starter_video.cpp
View file @
ebe97909
...
...
@@ -4,31 +4,34 @@
* Created on: Nov 23, 2010
* Author: Ethan Rublee
*
* A starter sample for using opencv, get a video stream and display the images
* Modified on: April 17, 2013
* Author: Kevin Hughes
*
* A starter sample for using OpenCV VideoCapture with capture devices, video files or image sequences
* easy as CV_PI right?
*/
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <vector>
#include <stdio.h>
using
namespace
cv
;
using
namespace
std
;
//hide the local functions in an anon namespace
namespace
{
void
help
(
char
**
av
)
{
cout
<<
"
\n
This program justs gets you started reading images from video
\n
"
"Usage:
\n
./"
<<
av
[
0
]
<<
" <video device number>
\n
"
<<
"q,Q,esc -- quit
\n
"
<<
"space -- save frame
\n\n
"
<<
"
\t
This is a starter sample, to get you up and going in a copy pasta fashion
\n
"
<<
"
\t
The program captures frames from a camera connected to your computer.
\n
"
<<
"
\t
To find the video device number, try ls /dev/video*
\n
"
<<
"
\t
You may also pass a video file, like my_vide.avi instead of a device number"
<<
endl
;
cout
<<
"The program captures frames from a video file, image sequence (01.jpg, 02.jpg ... 10.jpg) or camera connected to your computer."
<<
endl
<<
"Usage:
\n
"
<<
av
[
0
]
<<
" <video file, image sequence or device number>"
<<
endl
<<
"q,Q,esc -- quit"
<<
endl
<<
"space -- save frame"
<<
endl
<<
endl
<<
"
\t
To capture from a camera pass the device number. To find the device number, try ls /dev/video*"
<<
endl
<<
"
\t
example: "
<<
av
[
0
]
<<
" 0"
<<
endl
<<
"
\t
You may also pass a video file instead of a device number"
<<
endl
<<
"
\t
example: "
<<
av
[
0
]
<<
" video.avi"
<<
endl
<<
"
\t
You can also pass the path to an image sequence and OpenCV will treat the sequence just like a video."
<<
endl
<<
"
\t
example: "
<<
av
[
0
]
<<
" right%%02d.jpg"
<<
endl
;
}
int
process
(
VideoCapture
&
capture
)
{
...
...
@@ -36,31 +39,33 @@ namespace {
char
filename
[
200
];
string
window_name
=
"video | q or esc to quit"
;
cout
<<
"press space to save a picture. q or esc to quit"
<<
endl
;
namedWindow
(
window_name
,
CV_WINDOW_KEEPRATIO
);
//resizable window;
namedWindow
(
window_name
,
WINDOW_NORMAL
);
//resizable window;
Mat
frame
;
for
(;;)
{
capture
>>
frame
;
if
(
frame
.
empty
())
break
;
imshow
(
window_name
,
frame
);
char
key
=
(
char
)
waitKey
(
5
);
//delay N millis, usually long enough to display and capture input
char
key
=
(
char
)
waitKey
(
30
);
//delay N millis, usually long enough to display and capture input
switch
(
key
)
{
case
'q'
:
case
'Q'
:
case
27
:
//escape key
return
0
;
case
' '
:
//Save an image
sprintf
(
filename
,
"filename%.3d.jpg"
,
n
++
);
imwrite
(
filename
,
frame
);
cout
<<
"Saved "
<<
filename
<<
endl
;
break
;
default
:
break
;
case
'q'
:
case
'Q'
:
case
27
:
//escape key
return
0
;
case
' '
:
//Save an image
sprintf
(
filename
,
"filename%.3d.jpg"
,
n
++
);
imwrite
(
filename
,
frame
);
cout
<<
"Saved "
<<
filename
<<
endl
;
break
;
default
:
break
;
}
}
return
0
;
}
}
int
main
(
int
ac
,
char
**
av
)
{
...
...
@@ -70,11 +75,11 @@ int main(int ac, char** av) {
return
1
;
}
std
::
string
arg
=
av
[
1
];
VideoCapture
capture
(
arg
);
//try to open string, this will attempt to open it as a video file
VideoCapture
capture
(
arg
);
//try to open string, this will attempt to open it as a video file
or image sequence
if
(
!
capture
.
isOpened
())
//if this fails, try to open as a video camera, through the use of an integer param
capture
.
open
(
atoi
(
arg
.
c_str
()));
if
(
!
capture
.
isOpened
())
{
cerr
<<
"Failed to open
a video device or video fil
e!
\n
"
<<
endl
;
cerr
<<
"Failed to open
the video device, video file or image sequenc
e!
\n
"
<<
endl
;
help
(
av
);
return
1
;
}
...
...
samples/cpp/stereo_calib.cpp
View file @
ebe97909
...
...
@@ -236,7 +236,7 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
fs
.
release
();
}
else
cout
<<
"Error: can not save the
in
trinsic parameters
\n
"
;
cout
<<
"Error: can not save the
ex
trinsic parameters
\n
"
;
// OpenCV can handle left-right
// or up-down camera arrangements
...
...
samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp
View file @
ebe97909
...
...
@@ -60,7 +60,7 @@ void MatchingMethod( int, void* )
int
result_cols
=
img
.
cols
-
templ
.
cols
+
1
;
int
result_rows
=
img
.
rows
-
templ
.
rows
+
1
;
result
.
create
(
result_
cols
,
result_row
s
,
CV_32FC1
);
result
.
create
(
result_
rows
,
result_col
s
,
CV_32FC1
);
/// Do the Matching and Normalize
matchTemplate
(
img
,
templ
,
result
,
match_method
);
...
...
samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp
View file @
ebe97909
...
...
@@ -26,8 +26,13 @@ void thresh_callback(int, void* );
*/
int
main
(
int
,
char
**
argv
)
{
/// Load source image and convert it to gray
src
=
imread
(
argv
[
1
],
1
);
/// Load source image
src
=
imread
(
argv
[
1
]);
if
(
src
.
empty
())
{
cerr
<<
"No image supplied ..."
<<
endl
;
return
-
1
;
}
/// Convert image to gray and blur it
cvtColor
(
src
,
src_gray
,
COLOR_BGR2GRAY
);
...
...
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