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
998fab0e
Commit
998fab0e
authored
Dec 21, 2010
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
warningx fixed under vs2008
parent
0545e780
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
61 additions
and
61 deletions
+61
-61
chamfermatching.cpp
modules/contrib/src/chamfermatching.cpp
+1
-1
brief_match_test.cpp
samples/cpp/brief_match_test.cpp
+2
-2
fitellipse.cpp
samples/cpp/fitellipse.cpp
+1
-1
kmeans.cpp
samples/cpp/kmeans.cpp
+1
-1
lkdemo.cpp
samples/cpp/lkdemo.cpp
+1
-1
minarea.cpp
samples/cpp/minarea.cpp
+1
-1
starter_video.cpp
samples/cpp/starter_video.cpp
+53
-53
video_homography.cpp
samples/cpp/video_homography.cpp
+0
-0
achesscorners.cpp
tests/cv/src/achesscorners.cpp
+1
-1
No files found.
modules/contrib/src/chamfermatching.cpp
View file @
998fab0e
...
@@ -1155,7 +1155,7 @@ ChamferMatcher::Matches* ChamferMatcher::Matching::matchTemplates(Mat& dist_img,
...
@@ -1155,7 +1155,7 @@ ChamferMatcher::Matches* ChamferMatcher::Matching::matchTemplates(Mat& dist_img,
* @param edge_img Edge image
* @param edge_img Edge image
* @return a match object
* @return a match object
*/
*/
ChamferMatcher
::
Matches
*
ChamferMatcher
::
Matching
::
matchEdgeImage
(
Mat
&
edge_img
,
const
ImageRange
&
range
,
float
orientation_weight
,
int
max_matches
,
float
min_match_distance
)
ChamferMatcher
::
Matches
*
ChamferMatcher
::
Matching
::
matchEdgeImage
(
Mat
&
edge_img
,
const
ImageRange
&
range
,
float
orientation_weight
,
int
/*max_matches*/
,
float
/*min_match_distance*/
)
{
{
CV_Assert
(
edge_img
.
channels
()
==
1
);
CV_Assert
(
edge_img
.
channels
()
==
1
);
...
...
samples/cpp/brief_match_test.cpp
View file @
998fab0e
...
@@ -44,7 +44,7 @@ void matches2points(const vector<DMatch>& matches, const vector<KeyPoint>& kpts_
...
@@ -44,7 +44,7 @@ void matches2points(const vector<DMatch>& matches, const vector<KeyPoint>& kpts_
}
}
double
match
(
const
vector
<
KeyPoint
>&
kpts_train
,
const
vector
<
KeyPoint
>&
kpts_query
,
DescriptorMatcher
&
matcher
,
double
match
(
const
vector
<
KeyPoint
>&
/*kpts_train*/
,
const
vector
<
KeyPoint
>&
/*kpts_query*/
,
DescriptorMatcher
&
matcher
,
const
Mat
&
train
,
const
Mat
&
query
,
vector
<
DMatch
>&
matches
)
const
Mat
&
train
,
const
Mat
&
query
,
vector
<
DMatch
>&
matches
)
{
{
...
@@ -106,7 +106,7 @@ int main(int ac, char ** av)
...
@@ -106,7 +106,7 @@ int main(int ac, char ** av)
cout
<<
"matching with BruteForceMatcher<HammingLUT>"
<<
endl
;
cout
<<
"matching with BruteForceMatcher<HammingLUT>"
<<
endl
;
BruteForceMatcher
<
HammingLUT
>
matcher
;
BruteForceMatcher
<
HammingLUT
>
matcher
;
vector
<
DMatch
>
matches_lut
;
vector
<
DMatch
>
matches_lut
;
float
lut_time
=
match
(
kpts_1
,
kpts_2
,
matcher
,
desc_1
,
desc_2
,
matches_lut
);
float
lut_time
=
(
float
)
match
(
kpts_1
,
kpts_2
,
matcher
,
desc_1
,
desc_2
,
matches_lut
);
cout
<<
"done BruteForceMatcher<HammingLUT> matching. took "
<<
lut_time
<<
" seconds"
<<
endl
;
cout
<<
"done BruteForceMatcher<HammingLUT> matching. took "
<<
lut_time
<<
" seconds"
<<
endl
;
cout
<<
"matching with BruteForceMatcher<Hamming>"
<<
endl
;
cout
<<
"matching with BruteForceMatcher<Hamming>"
<<
endl
;
...
...
samples/cpp/fitellipse.cpp
View file @
998fab0e
...
@@ -59,7 +59,7 @@ int main( int argc, char** argv )
...
@@ -59,7 +59,7 @@ int main( int argc, char** argv )
// Define trackbar callback functon. This function find contours,
// Define trackbar callback functon. This function find contours,
// draw it and approximate it by ellipses.
// draw it and approximate it by ellipses.
void
processImage
(
int
h
,
void
*
)
void
processImage
(
int
/*h*/
,
void
*
)
{
{
vector
<
vector
<
Point
>
>
contours
;
vector
<
vector
<
Point
>
>
contours
;
Mat
bimage
=
image
>=
sliderPos
;
Mat
bimage
=
image
>=
sliderPos
;
...
...
samples/cpp/kmeans.cpp
View file @
998fab0e
...
@@ -14,7 +14,7 @@ void help()
...
@@ -14,7 +14,7 @@ void help()
"./kmeans
\n
"
<<
endl
;
"./kmeans
\n
"
<<
endl
;
}
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
/*argc*/
,
char
**
/*argv*/
)
{
{
const
int
MAX_CLUSTERS
=
5
;
const
int
MAX_CLUSTERS
=
5
;
Scalar
colorTab
[]
=
Scalar
colorTab
[]
=
...
...
samples/cpp/lkdemo.cpp
View file @
998fab0e
...
@@ -26,7 +26,7 @@ void help()
...
@@ -26,7 +26,7 @@ void help()
Point2f
pt
;
Point2f
pt
;
bool
addRemovePt
=
false
;
bool
addRemovePt
=
false
;
void
onMouse
(
int
event
,
int
x
,
int
y
,
int
flags
,
void
*
param
)
void
onMouse
(
int
event
,
int
x
,
int
y
,
int
/*flags*/
,
void
*
/*param*/
)
{
{
if
(
event
==
CV_EVENT_LBUTTONDOWN
)
if
(
event
==
CV_EVENT_LBUTTONDOWN
)
{
{
...
...
samples/cpp/minarea.cpp
View file @
998fab0e
...
@@ -16,7 +16,7 @@ void help()
...
@@ -16,7 +16,7 @@ void help()
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
/*argc*/
,
char
**
/*argv*/
)
{
{
Mat
img
(
500
,
500
,
CV_8UC3
);
Mat
img
(
500
,
500
,
CV_8UC3
);
RNG
&
rng
=
theRNG
();
RNG
&
rng
=
theRNG
();
...
...
samples/cpp/starter_video.cpp
View file @
998fab0e
/*
/*
* starter_video.cpp
* starter_video.cpp
*
*
* Created on: Nov 23, 2010
* Created on: Nov 23, 2010
* Author: Ethan Rublee
* Author: Ethan Rublee
*
*
* A starter sample for using opencv, get a video stream and display the images
* A starter sample for using opencv, get a video stream and display the images
* easy as CV_PI right?
* easy as CV_PI right?
*/
*/
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
...
@@ -16,55 +16,55 @@ using namespace std;
...
@@ -16,55 +16,55 @@ using namespace std;
//hide the local functions in an anon namespace
//hide the local functions in an anon namespace
namespace
{
namespace
{
void
help
(
char
**
av
)
{
void
help
(
char
**
av
)
{
cout
<<
"
\n
This program justs gets you started reading images from video
\n
"
cout
<<
"
\n
This program justs gets you started reading images from video
\n
"
"Usage:
\n
./"
<<
av
[
0
]
<<
" <video device number>
\n
"
"Usage:
\n
./"
<<
av
[
0
]
<<
" <video device number>
\n
"
<<
"
\t
This is a starter sample, to get you up and going in a copy pasta fashion
\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
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
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"
<<
"
\t
You may also pass a video file, like my_vide.avi instead of a device number"
<<
endl
;
<<
endl
;
}
}
int
process
(
VideoCapture
&
capture
)
{
int
process
(
VideoCapture
&
capture
)
{
string
window_name
=
"video | q or esc to quit"
;
string
window_name
=
"video | q or esc to quit"
;
cout
<<
"press q or esc to quit"
<<
endl
;
cout
<<
"press q or esc to quit"
<<
endl
;
namedWindow
(
window_name
,
CV_WINDOW_KEEPRATIO
);
//resizable window;
namedWindow
(
window_name
,
CV_WINDOW_KEEPRATIO
);
//resizable window;
Mat
frame
;
Mat
frame
;
for
(;;)
{
for
(;;)
{
capture
>>
frame
;
capture
>>
frame
;
if
(
frame
.
empty
())
if
(
frame
.
empty
())
continue
;
continue
;
imshow
(
window_name
,
frame
);
imshow
(
window_name
,
frame
);
char
key
=
(
char
)
waitKey
(
5
);
//delay N millis, usually long enough to display and capture input
char
key
=
(
char
)
waitKey
(
5
);
//delay N millis, usually long enough to display and capture input
switch
(
key
)
{
switch
(
key
)
{
case
'q'
:
case
'q'
:
case
'Q'
:
case
'Q'
:
case
27
:
//escape key
case
27
:
//escape key
return
0
;
return
0
;
default
:
default
:
break
;
break
;
}
}
}
}
return
0
;
return
0
;
}
}
}
}
int
main
(
int
ac
,
char
**
av
)
{
int
main
(
int
ac
,
char
**
av
)
{
if
(
ac
!=
2
)
{
if
(
ac
!=
2
)
{
help
(
av
);
help
(
av
);
return
1
;
return
1
;
}
}
std
::
string
arg
=
av
[
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
if
(
!
capture
.
isOpened
())
//if this fails, try to open as a video camera, through the use of an integer param
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
()));
capture
.
open
(
atoi
(
arg
.
c_str
()));
if
(
!
capture
.
isOpened
())
{
if
(
!
capture
.
isOpened
())
{
cerr
<<
"Failed to open a video device or video file!
\n
"
<<
endl
;
cerr
<<
"Failed to open a video device or video file!
\n
"
<<
endl
;
help
(
av
);
help
(
av
);
return
1
;
return
1
;
}
}
return
process
(
capture
);
return
process
(
capture
);
}
}
samples/cpp/video_homography.cpp
View file @
998fab0e
This diff is collapsed.
Click to expand it.
tests/cv/src/achesscorners.cpp
View file @
998fab0e
...
@@ -222,7 +222,7 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename )
...
@@ -222,7 +222,7 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename )
Size
pattern_size
=
expected
.
size
();
Size
pattern_size
=
expected
.
size
();
vector
<
Point2f
>
v
;
vector
<
Point2f
>
v
;
bool
result
;
bool
result
=
false
;
switch
(
pattern
)
switch
(
pattern
)
{
{
case
CHESSBOARD
:
case
CHESSBOARD
:
...
...
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