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
08cba33f
Commit
08cba33f
authored
Jul 17, 2010
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some more MSVC2010 warnings
parent
ad66d33e
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
43 additions
and
24 deletions
+43
-24
compat_c.h
modules/calib3d/include/opencv2/calib3d/compat_c.h
+8
-0
compat_c.h
modules/imgproc/include/opencv2/imgproc/compat_c.h
+9
-0
fback.cpp
samples/c/fback.cpp
+2
-2
find_obj_calonder.cpp
samples/c/find_obj_calonder.cpp
+6
-2
grabcut.cpp
samples/c/grabcut.cpp
+1
-1
watershed.cpp
samples/c/watershed.cpp
+1
-1
calibration.cpp
samples/cpp/calibration.cpp
+2
-3
contours2.cpp
samples/cpp/contours2.cpp
+2
-2
generic_descriptor_match.cpp
samples/cpp/generic_descriptor_match.cpp
+1
-1
segment_objects.cpp
samples/cpp/segment_objects.cpp
+1
-1
select3dobj.cpp
samples/cpp/select3dobj.cpp
+3
-3
adetectordescriptor_evaluation.cpp
tests/cv/src/adetectordescriptor_evaluation.cpp
+1
-3
astereomatching.cpp
tests/cv/src/astereomatching.cpp
+6
-5
No files found.
modules/calib3d/include/opencv2/calib3d/compat_c.h
View file @
08cba33f
...
@@ -49,6 +49,11 @@
...
@@ -49,6 +49,11 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#if !defined __cplusplus && defined _MSC_VER && _MSC_VER >= 1400
#pragma warning(push)
#pragma warning(disable: 4100)
#endif
/* Find fundamental matrix */
/* Find fundamental matrix */
CV_INLINE
void
cvFindFundamentalMatrix
(
int
*
points1
,
int
*
points2
,
CV_INLINE
void
cvFindFundamentalMatrix
(
int
*
points1
,
int
*
points2
,
int
numpoints
,
int
CV_UNREFERENCED
(
method
),
float
*
matrix
)
int
numpoints
,
int
CV_UNREFERENCED
(
method
),
float
*
matrix
)
...
@@ -270,6 +275,9 @@ CV_INLINE void cvProjectPointsSimple( int point_count, CvPoint3D64f* _object_po
...
@@ -270,6 +275,9 @@ CV_INLINE void cvProjectPointsSimple( int point_count, CvPoint3D64f* _object_po
#define cvConvertPointsHomogenious cvConvertPointsHomogeneous
#define cvConvertPointsHomogenious cvConvertPointsHomogeneous
#if !defined __cplusplus && defined _MSC_VER && _MSC_VER >= 1400
#pragma warning(pop)
#endif
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
modules/imgproc/include/opencv2/imgproc/compat_c.h
View file @
08cba33f
...
@@ -63,6 +63,11 @@ extern "C" {
...
@@ -63,6 +63,11 @@ extern "C" {
#define CV_UNREFERENCED(arg) arg
#define CV_UNREFERENCED(arg) arg
#endif
#endif
#if !defined __cplusplus && defined _MSC_VER && _MSC_VER >= 1400
#pragma warning(push)
#pragma warning(disable: 4100)
#endif
typedef
int
CvMatType
;
typedef
int
CvMatType
;
typedef
int
CvDisMaskType
;
typedef
int
CvDisMaskType
;
typedef
CvMat
CvMatArray
;
typedef
CvMat
CvMatArray
;
...
@@ -871,6 +876,10 @@ CV_INLINE void cvUnDistort( const CvArr* src, CvArr* dst,
...
@@ -871,6 +876,10 @@ CV_INLINE void cvUnDistort( const CvArr* src, CvArr* dst,
cvUnDistortOnce
(
src
,
dst
,
a
,
data
.
fl
+
4
,
1
);
cvUnDistortOnce
(
src
,
dst
,
a
,
data
.
fl
+
4
,
1
);
}
}
#if !defined __cplusplus && defined _MSC_VER && _MSC_VER >= 1400
#pragma warning(pop)
#endif
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
samples/c/fback.cpp
View file @
08cba33f
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
using
namespace
cv
;
using
namespace
cv
;
void
drawOptFlowMap
(
const
Mat
&
flow
,
Mat
&
cflowmap
,
int
step
,
void
drawOptFlowMap
(
const
Mat
&
flow
,
Mat
&
cflowmap
,
int
step
,
double
scale
,
const
Scalar
&
color
)
double
,
const
Scalar
&
color
)
{
{
for
(
int
y
=
0
;
y
<
cflowmap
.
rows
;
y
+=
step
)
for
(
int
y
=
0
;
y
<
cflowmap
.
rows
;
y
+=
step
)
for
(
int
x
=
0
;
x
<
cflowmap
.
cols
;
x
+=
step
)
for
(
int
x
=
0
;
x
<
cflowmap
.
cols
;
x
+=
step
)
...
@@ -18,7 +18,7 @@ void drawOptFlowMap(const Mat& flow, Mat& cflowmap, int step,
...
@@ -18,7 +18,7 @@ void drawOptFlowMap(const Mat& flow, Mat& cflowmap, int step,
}
}
}
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
,
char
**
)
{
{
VideoCapture
cap
(
0
);
VideoCapture
cap
(
0
);
...
...
samples/c/find_obj_calonder.cpp
View file @
08cba33f
//Calonder descriptor sample
//Calonder descriptor sample
#include <stdio.h>
#if 0
#include <cxcore.h>
#include <cxcore.h>
#include <cv.h>
#include <cv.h>
#include <cvaux.h>
#include <cvaux.h>
...
@@ -84,13 +86,14 @@ float CalcAffineReprojectionError(const vector<CvPoint>& p1, const vector<CvPoin
...
@@ -84,13 +86,14 @@ float CalcAffineReprojectionError(const vector<CvPoint>& p1, const vector<CvPoin
return error;
return error;
}
}
#endif
int
main
(
int
,
char
**
)
int
main
(
int
argc
,
char
**
argv
)
{
{
printf
(
"calonder_sample is under construction
\n
"
);
printf
(
"calonder_sample is under construction
\n
"
);
return
0
;
return
0
;
#if 0
IplImage* test_image;
IplImage* test_image;
IplImage* train_image;
IplImage* train_image;
if (argc < 3)
if (argc < 3)
...
@@ -302,4 +305,5 @@ int main( int argc, char** argv )
...
@@ -302,4 +305,5 @@ int main( int argc, char** argv )
cvReleaseImage(&test_image);
cvReleaseImage(&test_image);
return 0;
return 0;
#endif
}
}
samples/c/grabcut.cpp
View file @
08cba33f
...
@@ -149,7 +149,7 @@ void GCApplication::setLblsInMask( int flags, Point p, bool isPr )
...
@@ -149,7 +149,7 @@ void GCApplication::setLblsInMask( int flags, Point p, bool isPr )
}
}
}
}
void
GCApplication
::
mouseClick
(
int
event
,
int
x
,
int
y
,
int
flags
,
void
*
param
)
void
GCApplication
::
mouseClick
(
int
event
,
int
x
,
int
y
,
int
flags
,
void
*
)
{
{
// TODO add bad args check
// TODO add bad args check
switch
(
event
)
switch
(
event
)
...
...
samples/c/watershed.cpp
View file @
08cba33f
...
@@ -14,7 +14,7 @@ IplImage* markers = 0;
...
@@ -14,7 +14,7 @@ IplImage* markers = 0;
IplImage
*
img0
=
0
,
*
img
=
0
,
*
img_gray
=
0
,
*
wshed
=
0
;
IplImage
*
img0
=
0
,
*
img
=
0
,
*
img_gray
=
0
,
*
wshed
=
0
;
CvPoint
prev_pt
=
{
-
1
,
-
1
};
CvPoint
prev_pt
=
{
-
1
,
-
1
};
void
on_mouse
(
int
event
,
int
x
,
int
y
,
int
flags
,
void
*
param
)
void
on_mouse
(
int
event
,
int
x
,
int
y
,
int
flags
,
void
*
)
{
{
if
(
!
img
)
if
(
!
img
)
return
;
return
;
...
...
samples/cpp/calibration.cpp
View file @
08cba33f
...
@@ -54,7 +54,7 @@ static double computeReprojectionErrors(
...
@@ -54,7 +54,7 @@ static double computeReprojectionErrors(
cameraMatrix
,
distCoeffs
,
imagePoints2
);
cameraMatrix
,
distCoeffs
,
imagePoints2
);
err
=
norm
(
Mat
(
imagePoints
[
i
]),
Mat
(
imagePoints2
),
CV_L1
);
err
=
norm
(
Mat
(
imagePoints
[
i
]),
Mat
(
imagePoints2
),
CV_L1
);
int
n
=
(
int
)
objectPoints
[
i
].
size
();
int
n
=
(
int
)
objectPoints
[
i
].
size
();
perViewErrors
[
i
]
=
err
/
n
;
perViewErrors
[
i
]
=
(
float
)(
err
/
n
)
;
totalErr
+=
err
;
totalErr
+=
err
;
totalPoints
+=
n
;
totalPoints
+=
n
;
}
}
...
@@ -94,8 +94,7 @@ static bool runCalibration( vector<vector<Point2f> > imagePoints,
...
@@ -94,8 +94,7 @@ static bool runCalibration( vector<vector<Point2f> > imagePoints,
calibrateCamera
(
objectPoints
,
imagePoints
,
imageSize
,
cameraMatrix
,
calibrateCamera
(
objectPoints
,
imagePoints
,
imageSize
,
cameraMatrix
,
distCoeffs
,
rvecs
,
tvecs
,
flags
);
distCoeffs
,
rvecs
,
tvecs
,
flags
);
bool
ok
=
checkRange
(
cameraMatrix
,
CV_CHECK_QUIET
)
&&
bool
ok
=
checkRange
(
cameraMatrix
)
&&
checkRange
(
distCoeffs
);
checkRange
(
distCoeffs
,
CV_CHECK_QUIET
);
totalAvgErr
=
computeReprojectionErrors
(
objectPoints
,
imagePoints
,
totalAvgErr
=
computeReprojectionErrors
(
objectPoints
,
imagePoints
,
rvecs
,
tvecs
,
cameraMatrix
,
distCoeffs
,
reprojErrs
);
rvecs
,
tvecs
,
cameraMatrix
,
distCoeffs
,
reprojErrs
);
...
...
samples/cpp/contours2.cpp
View file @
08cba33f
...
@@ -10,7 +10,7 @@ int levels = 3;
...
@@ -10,7 +10,7 @@ int levels = 3;
vector
<
vector
<
Point
>
>
contours
;
vector
<
vector
<
Point
>
>
contours
;
vector
<
Vec4i
>
hierarchy
;
vector
<
Vec4i
>
hierarchy
;
void
on_trackbar
(
int
pos
,
void
*
)
void
on_trackbar
(
int
,
void
*
)
{
{
Mat
cnt_img
=
Mat
::
zeros
(
w
,
w
,
CV_8UC3
);
Mat
cnt_img
=
Mat
::
zeros
(
w
,
w
,
CV_8UC3
);
int
_levels
=
levels
-
3
;
int
_levels
=
levels
-
3
;
...
@@ -20,7 +20,7 @@ void on_trackbar(int pos, void*)
...
@@ -20,7 +20,7 @@ void on_trackbar(int pos, void*)
imshow
(
"contours"
,
cnt_img
);
imshow
(
"contours"
,
cnt_img
);
}
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
,
char
**
)
{
{
Mat
img
=
Mat
::
zeros
(
w
,
w
,
CV_8UC1
);
Mat
img
=
Mat
::
zeros
(
w
,
w
,
CV_8UC1
);
...
...
samples/cpp/generic_descriptor_match.cpp
View file @
08cba33f
...
@@ -86,7 +86,7 @@ IplImage* DrawCorrespondences(IplImage* img1, const vector<KeyPoint>& features1,
...
@@ -86,7 +86,7 @@ IplImage* DrawCorrespondences(IplImage* img1, const vector<KeyPoint>& features1,
for
(
size_t
i
=
0
;
i
<
features2
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
features2
.
size
();
i
++
)
{
{
CvPoint
pt
=
cvPoint
(
features2
[
i
].
pt
.
x
+
img1
->
width
,
features2
[
i
].
pt
.
y
);
CvPoint
pt
=
cvPoint
(
cvRound
(
features2
[
i
].
pt
.
x
+
img1
->
width
),
cvRound
(
features2
[
i
].
pt
.
y
)
);
cvCircle
(
img_corr
,
pt
,
3
,
CV_RGB
(
255
,
0
,
0
));
cvCircle
(
img_corr
,
pt
,
3
,
CV_RGB
(
255
,
0
,
0
));
cvLine
(
img_corr
,
features1
[
desc_idx
[
i
]].
pt
,
pt
,
CV_RGB
(
0
,
255
,
0
));
cvLine
(
img_corr
,
features1
[
desc_idx
[
i
]].
pt
,
pt
,
CV_RGB
(
0
,
255
,
0
));
}
}
...
...
samples/cpp/segment_objects.cpp
View file @
08cba33f
...
@@ -88,7 +88,7 @@ int main(int argc, char** argv)
...
@@ -88,7 +88,7 @@ int main(int argc, char** argv)
refineSegments
(
tmp_frame
,
bgmask
,
out_frame
);
refineSegments
(
tmp_frame
,
bgmask
,
out_frame
);
imshow
(
"video"
,
tmp_frame
);
imshow
(
"video"
,
tmp_frame
);
imshow
(
"segmented"
,
out_frame
);
imshow
(
"segmented"
,
out_frame
);
char
keycode
=
waitKey
(
30
);
int
keycode
=
waitKey
(
30
);
if
(
keycode
==
27
)
if
(
keycode
==
27
)
break
;
break
;
if
(
keycode
==
' '
)
if
(
keycode
==
' '
)
...
...
samples/cpp/select3dobj.cpp
View file @
08cba33f
...
@@ -61,7 +61,7 @@ static Point3f image2plane(Point2f imgpt, const Mat& R, const Mat& tvec,
...
@@ -61,7 +61,7 @@ static Point3f image2plane(Point2f imgpt, const Mat& R, const Mat& tvec,
R1
.
col
(
2
)
=
R1
.
col
(
2
)
*
Z
+
tvec
;
R1
.
col
(
2
)
=
R1
.
col
(
2
)
*
Z
+
tvec
;
Mat_
<
double
>
v
=
(
cameraMatrix
*
R1
).
inv
()
*
(
Mat_
<
double
>
(
3
,
1
)
<<
imgpt
.
x
,
imgpt
.
y
,
1
);
Mat_
<
double
>
v
=
(
cameraMatrix
*
R1
).
inv
()
*
(
Mat_
<
double
>
(
3
,
1
)
<<
imgpt
.
x
,
imgpt
.
y
,
1
);
double
iw
=
fabs
(
v
(
2
,
0
))
>
DBL_EPSILON
?
1.
/
v
(
2
,
0
)
:
0
;
double
iw
=
fabs
(
v
(
2
,
0
))
>
DBL_EPSILON
?
1.
/
v
(
2
,
0
)
:
0
;
return
Point3f
(
v
(
0
,
0
)
*
iw
,
v
(
1
,
0
)
*
iw
,
Z
);
return
Point3f
(
(
float
)(
v
(
0
,
0
)
*
iw
),
(
float
)(
v
(
1
,
0
)
*
iw
),
(
float
)
Z
);
}
}
...
@@ -192,7 +192,7 @@ static int select3DBox(const string& windowname, const string& selWinName, const
...
@@ -192,7 +192,7 @@ static int select3DBox(const string& windowname, const string& selWinName, const
projectPoints
(
Mat
(
tempobj
),
rvec
,
tvec
,
cameraMatrix
,
Mat
(),
tempimg
);
projectPoints
(
Mat
(
tempobj
),
rvec
,
tvec
,
cameraMatrix
,
Mat
(),
tempimg
);
Point2f
a
=
imgpt
[
nearestIdx
],
b
=
tempimg
[
0
],
d1
=
b
-
a
,
d2
=
m
-
a
;
Point2f
a
=
imgpt
[
nearestIdx
],
b
=
tempimg
[
0
],
d1
=
b
-
a
,
d2
=
m
-
a
;
float
n1
=
norm
(
d1
),
n2
=
norm
(
d2
);
float
n1
=
(
float
)
norm
(
d1
),
n2
=
(
float
)
norm
(
d2
);
if
(
n1
*
n2
<
eps
)
if
(
n1
*
n2
<
eps
)
imgpt
[
npt
]
=
a
;
imgpt
[
npt
]
=
a
;
else
else
...
@@ -458,7 +458,7 @@ int main(int argc, char** argv)
...
@@ -458,7 +458,7 @@ int main(int argc, char** argv)
vector
<
Point3f
>
box
,
boardPoints
;
vector
<
Point3f
>
box
,
boardPoints
;
readModelViews
(
indexFilename
,
box
,
capturedImgList
,
roiList
,
poseList
);
readModelViews
(
indexFilename
,
box
,
capturedImgList
,
roiList
,
poseList
);
calcChessboardCorners
(
boardSize
,
squareSize
,
boardPoints
);
calcChessboardCorners
(
boardSize
,
(
float
)
squareSize
,
boardPoints
);
int
frameIdx
=
0
;
int
frameIdx
=
0
;
bool
grabNext
=
!
imageList
.
empty
();
bool
grabNext
=
!
imageList
.
empty
();
...
...
tests/cv/src/adetectordescriptor_evaluation.cpp
View file @
08cba33f
...
@@ -1500,10 +1500,8 @@ void OneWayDescriptorQualityTest::processRunParamsFile ()
...
@@ -1500,10 +1500,8 @@ void OneWayDescriptorQualityTest::processRunParamsFile ()
int
poseCount
=
fn
[
"poseCount"
];
int
poseCount
=
fn
[
"poseCount"
];
if
(
trainImagesList
.
length
()
==
0
)
if
(
trainImagesList
.
length
()
==
0
)
{
return
;
return
;
fs
.
release
();
}
fs
.
release
();
fs
.
release
();
readAllDatasetsRunParams
();
readAllDatasetsRunParams
();
...
...
tests/cv/src/astereomatching.cpp
View file @
08cba33f
...
@@ -285,8 +285,9 @@ float dispRMS( const Mat& computedDisp, const Mat& groundTruthDisp, const Mat& m
...
@@ -285,8 +285,9 @@ float dispRMS( const Mat& computedDisp, const Mat& groundTruthDisp, const Mat& m
Calculate fraction of bad matching pixels.
Calculate fraction of bad matching pixels.
*/
*/
float
badMatchPxlsFraction
(
const
Mat
&
computedDisp
,
const
Mat
&
groundTruthDisp
,
const
Mat
&
mask
,
float
badMatchPxlsFraction
(
const
Mat
&
computedDisp
,
const
Mat
&
groundTruthDisp
,
const
Mat
&
mask
,
int
badThresh
=
EVAL_BAD_THRESH
)
float
_
badThresh
=
EVAL_BAD_THRESH
)
{
{
int
badThresh
=
cvRound
(
_badThresh
);
checkTypeAndSizeOfDisp
(
groundTruthDisp
,
0
);
checkTypeAndSizeOfDisp
(
groundTruthDisp
,
0
);
Size
sz
=
groundTruthDisp
.
size
();
Size
sz
=
groundTruthDisp
.
size
();
checkTypeAndSizeOfDisp
(
computedDisp
,
&
sz
);
checkTypeAndSizeOfDisp
(
computedDisp
,
&
sz
);
...
@@ -477,10 +478,10 @@ void CV_StereoMatchingTest::run(int)
...
@@ -477,10 +478,10 @@ void CV_StereoMatchingTest::run(int)
ts
->
set_failed_test_info
(
code
);
ts
->
set_failed_test_info
(
code
);
}
}
void
calcErrors
(
const
Mat
&
leftImg
,
const
Mat
&
rightImg
,
void
calcErrors
(
const
Mat
&
leftImg
,
const
Mat
&
/*rightImg*/
,
const
Mat
&
trueLeftDisp
,
const
Mat
&
trueRightDisp
,
const
Mat
&
trueLeftDisp
,
const
Mat
&
trueRightDisp
,
const
Mat
&
trueLeftUnknDispMask
,
const
Mat
&
trueRightUnknDispMask
,
const
Mat
&
trueLeftUnknDispMask
,
const
Mat
&
trueRightUnknDispMask
,
const
Mat
&
calcLeftDisp
,
const
Mat
&
calcRightDisp
,
const
Mat
&
calcLeftDisp
,
const
Mat
&
/*calcRightDisp*/
,
vector
<
float
>&
rms
,
vector
<
float
>&
badPxlsFractions
,
vector
<
float
>&
rms
,
vector
<
float
>&
badPxlsFractions
,
const
QualityEvalParams
&
qualityEvalParams
)
const
QualityEvalParams
&
qualityEvalParams
)
{
{
...
@@ -686,7 +687,7 @@ protected:
...
@@ -686,7 +687,7 @@ protected:
}
}
virtual
int
runStereoMatchingAlgorithm
(
const
Mat
&
_leftImg
,
const
Mat
&
_rightImg
,
virtual
int
runStereoMatchingAlgorithm
(
const
Mat
&
_leftImg
,
const
Mat
&
_rightImg
,
Mat
&
leftDisp
,
Mat
&
rightDisp
,
int
caseIdx
)
Mat
&
leftDisp
,
Mat
&
/*rightDisp*/
,
int
caseIdx
)
{
{
RunParams
params
=
caseRunParams
[
caseIdx
];
RunParams
params
=
caseRunParams
[
caseIdx
];
assert
(
params
.
ndisp
%
16
==
0
);
assert
(
params
.
ndisp
%
16
==
0
);
...
@@ -805,7 +806,7 @@ protected:
...
@@ -805,7 +806,7 @@ protected:
}
}
virtual
int
runStereoMatchingAlgorithm
(
const
Mat
&
leftImg
,
const
Mat
&
rightImg
,
virtual
int
runStereoMatchingAlgorithm
(
const
Mat
&
leftImg
,
const
Mat
&
rightImg
,
Mat
&
leftDisp
,
Mat
&
rightDisp
,
int
caseIdx
)
Mat
&
leftDisp
,
Mat
&
/*rightDisp*/
,
int
caseIdx
)
{
{
RunParams
params
=
caseRunParams
[
caseIdx
];
RunParams
params
=
caseRunParams
[
caseIdx
];
assert
(
params
.
ndisp
%
16
==
0
);
assert
(
params
.
ndisp
%
16
==
0
);
...
...
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