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
dd74a851
Commit
dd74a851
authored
Apr 08, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build errors
parent
befd6967
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
36 additions
and
36 deletions
+36
-36
cap_ffmpeg.cpp
modules/highgui/src/cap_ffmpeg.cpp
+1
-1
ffmpeg_codecs.hpp
modules/highgui/src/ffmpeg_codecs.hpp
+4
-2
utils.cpp
modules/java/generator/src/cpp/utils.cpp
+6
-6
sift.cpp
modules/nonfree/src/sift.cpp
+2
-2
surf.cpp
modules/nonfree/src/surf.cpp
+8
-10
test_detectors.cpp
modules/nonfree/test/test_detectors.cpp
+3
-3
test_rotation_and_scale_invariance.cpp
modules/nonfree/test/test_rotation_and_scale_invariance.cpp
+6
-6
motion_estimators.hpp
...ng/include/opencv2/stitching/detail/motion_estimators.hpp
+4
-4
main.cpp
samples/android/hello-android/main.cpp
+2
-2
No files found.
modules/highgui/src/cap_ffmpeg.cpp
View file @
dd74a851
...
...
@@ -41,7 +41,7 @@
#include "precomp.hpp"
#if
ndef
WIN32
#if
defined HAVE_FFMPEG && !defined
WIN32
#include "cap_ffmpeg_impl.hpp"
#else
#include "cap_ffmpeg_api.hpp"
...
...
modules/highgui/src/ffmpeg_codecs.hpp
View file @
dd74a851
...
...
@@ -61,8 +61,10 @@ extern "C" {
#endif
#ifdef WIN32
# define AVUTIL_COMMON_H
# define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
# ifdef __OPENCV_BUILD
# define AVUTIL_COMMON_H
# define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
# endif
# include <libavformat/avformat.h>
#else
...
...
modules/java/generator/src/cpp/utils.cpp
View file @
dd74a851
...
...
@@ -44,7 +44,7 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat2
// info.format == ANDROID_BITMAP_FORMAT_RGB_565
LOGD
(
"nBitmapToMat: RGB_565 -> CV_8UC4"
);
Mat
tmp
(
info
.
height
,
info
.
width
,
CV_8UC2
,
pixels
);
cvtColor
(
tmp
,
dst
,
C
V
_BGR5652RGBA
);
cvtColor
(
tmp
,
dst
,
C
OLOR
_BGR5652RGBA
);
}
AndroidBitmap_unlockPixels
(
env
,
bitmap
);
return
;
...
...
@@ -104,10 +104,10 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap2
if
(
src
.
type
()
==
CV_8UC1
)
{
LOGD
(
"nMatToBitmap: CV_8UC1 -> RGBA_8888"
);
cvtColor
(
src
,
tmp
,
C
V
_GRAY2RGBA
);
cvtColor
(
src
,
tmp
,
C
OLOR
_GRAY2RGBA
);
}
else
if
(
src
.
type
()
==
CV_8UC3
){
LOGD
(
"nMatToBitmap: CV_8UC3 -> RGBA_8888"
);
cvtColor
(
src
,
tmp
,
C
V
_RGB2RGBA
);
cvtColor
(
src
,
tmp
,
C
OLOR
_RGB2RGBA
);
}
else
if
(
src
.
type
()
==
CV_8UC4
){
LOGD
(
"nMatToBitmap: CV_8UC4 -> RGBA_8888"
);
if
(
needPremultiplyAlpha
)
cvtColor
(
src
,
tmp
,
COLOR_RGBA2mRGBA
);
...
...
@@ -119,13 +119,13 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap2
if
(
src
.
type
()
==
CV_8UC1
)
{
LOGD
(
"nMatToBitmap: CV_8UC1 -> RGB_565"
);
cvtColor
(
src
,
tmp
,
C
V
_GRAY2BGR565
);
cvtColor
(
src
,
tmp
,
C
OLOR
_GRAY2BGR565
);
}
else
if
(
src
.
type
()
==
CV_8UC3
){
LOGD
(
"nMatToBitmap: CV_8UC3 -> RGB_565"
);
cvtColor
(
src
,
tmp
,
C
V
_RGB2BGR565
);
cvtColor
(
src
,
tmp
,
C
OLOR
_RGB2BGR565
);
}
else
if
(
src
.
type
()
==
CV_8UC4
){
LOGD
(
"nMatToBitmap: CV_8UC4 -> RGB_565"
);
cvtColor
(
src
,
tmp
,
C
V
_RGBA2BGR565
);
cvtColor
(
src
,
tmp
,
C
OLOR
_RGBA2BGR565
);
}
}
AndroidBitmap_unlockPixels
(
env
,
bitmap
);
...
...
modules/nonfree/src/sift.cpp
View file @
dd74a851
...
...
@@ -732,10 +732,10 @@ void SIFT::operator()(InputArray _image, InputArray _mask,
Mat
image
=
_image
.
getMat
(),
mask
=
_mask
.
getMat
();
if
(
image
.
empty
()
||
image
.
depth
()
!=
CV_8U
)
CV_Error
(
CV_
StsBadArg
,
"image is empty or has incorrect depth (!=CV_8U)"
);
CV_Error
(
Error
::
StsBadArg
,
"image is empty or has incorrect depth (!=CV_8U)"
);
if
(
!
mask
.
empty
()
&&
mask
.
type
()
!=
CV_8UC1
)
CV_Error
(
CV_
StsBadArg
,
"mask has incorrect type (!=CV_8UC1)"
);
CV_Error
(
Error
::
StsBadArg
,
"mask has incorrect type (!=CV_8UC1)"
);
if
(
useProvidedKeypoints
)
{
...
...
modules/nonfree/src/surf.cpp
View file @
dd74a851
...
...
@@ -427,7 +427,7 @@ void SURFFindInvoker::findMaximaInLayer( const Mat& sum, const Mat& mask_sum,
float
center_j
=
sum_j
+
(
size
-
1
)
*
0.5
f
;
KeyPoint
kpt
(
center_j
,
center_i
,
(
float
)
sizes
[
layer
],
-
1
,
val0
,
octave
,
CV_SIGN
(
trace_ptr
[
j
]
)
);
-
1
,
val0
,
octave
,
(
trace_ptr
[
j
]
>
0
)
-
(
trace_ptr
[
j
]
<
0
)
);
/* Interpolate maxima location within the 3x3x3 neighbourhood */
int
ds
=
size
-
sizes
[
layer
-
1
];
...
...
@@ -550,7 +550,7 @@ struct SURFInvoker
{
if
(
i
*
i
+
j
*
j
<=
ORI_RADIUS
*
ORI_RADIUS
)
{
apt
[
nOriSamples
]
=
cv
Point
(
i
,
j
);
apt
[
nOriSamples
]
=
Point
(
i
,
j
);
aptw
[
nOriSamples
++
]
=
G_ori
.
at
<
float
>
(
i
+
ORI_RADIUS
,
0
)
*
G_ori
.
at
<
float
>
(
j
+
ORI_RADIUS
,
0
);
}
}
...
...
@@ -580,9 +580,6 @@ struct SURFInvoker
float
X
[
nOriSampleBound
],
Y
[
nOriSampleBound
],
angle
[
nOriSampleBound
];
uchar
PATCH
[
PATCH_SZ
+
1
][
PATCH_SZ
+
1
];
float
DX
[
PATCH_SZ
][
PATCH_SZ
],
DY
[
PATCH_SZ
][
PATCH_SZ
];
CvMat
matX
=
cvMat
(
1
,
nOriSampleBound
,
CV_32F
,
X
);
CvMat
matY
=
cvMat
(
1
,
nOriSampleBound
,
CV_32F
,
Y
);
CvMat
_angle
=
cvMat
(
1
,
nOriSampleBound
,
CV_32F
,
angle
);
Mat
_patch
(
PATCH_SZ
+
1
,
PATCH_SZ
+
1
,
CV_8U
,
PATCH
);
int
dsize
=
extended
?
128
:
64
;
...
...
@@ -594,7 +591,8 @@ struct SURFInvoker
maxSize
=
std
::
max
(
maxSize
,
(
*
keypoints
)[
k
].
size
);
}
int
imaxSize
=
std
::
max
(
cvCeil
((
PATCH_SZ
+
1
)
*
maxSize
*
1.2
f
/
9.0
f
),
1
);
Ptr
<
CvMat
>
winbuf
=
cvCreateMat
(
1
,
imaxSize
*
imaxSize
,
CV_8U
);
cv
::
AutoBuffer
<
uchar
>
winbuf
(
imaxSize
*
imaxSize
);
for
(
k
=
k1
;
k
<
k2
;
k
++
)
{
int
i
,
j
,
kk
,
nangle
;
...
...
@@ -648,8 +646,8 @@ struct SURFInvoker
kp
.
size
=
-
1
;
continue
;
}
matX
.
cols
=
matY
.
cols
=
_angle
.
cols
=
nangle
;
cvCartToPolar
(
&
matX
,
&
matY
,
0
,
&
_angle
,
1
);
phase
(
Mat
(
1
,
nangle
,
CV_32F
,
X
),
Mat
(
1
,
nangle
,
CV_32F
,
Y
),
Mat
(
1
,
nangle
,
CV_32F
,
angle
),
true
);
float
bestx
=
0
,
besty
=
0
,
descriptor_mod
=
0
;
for
(
i
=
0
;
i
<
360
;
i
+=
SURF_ORI_SEARCH_INC
)
...
...
@@ -680,8 +678,8 @@ struct SURFInvoker
/* Extract a window of pixels around the keypoint of size 20s */
int
win_size
=
(
int
)((
PATCH_SZ
+
1
)
*
s
);
CV_Assert
(
winbuf
->
cols
>=
win_size
*
win_size
);
Mat
win
(
win_size
,
win_size
,
CV_8U
,
winbuf
->
data
.
ptr
);
CV_Assert
(
imaxSize
>=
win_size
);
Mat
win
(
win_size
,
win_size
,
CV_8U
,
winbuf
);
if
(
!
upright
)
{
...
...
modules/nonfree/test/test_detectors.cpp
View file @
dd74a851
...
...
@@ -116,7 +116,7 @@ void showOrig(const Mat& img, const vector<KeyPoint>& orig_pts)
cvtColor
(
img
,
img_color
,
COLOR_GRAY2BGR
);
for
(
size_t
i
=
0
;
i
<
orig_pts
.
size
();
++
i
)
circle
(
img_color
,
orig_pts
[
i
].
pt
,
(
int
)
orig_pts
[
i
].
size
/
2
,
CV_RGB
(
0
,
255
,
0
));
circle
(
img_color
,
orig_pts
[
i
].
pt
,
(
int
)
orig_pts
[
i
].
size
/
2
,
Scalar
(
0
,
255
,
0
));
namedWindow
(
"O"
);
imshow
(
"O"
,
img_color
);
}
...
...
@@ -128,10 +128,10 @@ void show(const string& name, const Mat& new_img, const vector<KeyPoint>& new_pt
cvtColor
(
new_img
,
new_img_color
,
COLOR_GRAY2BGR
);
for
(
size_t
i
=
0
;
i
<
transf_pts
.
size
();
++
i
)
circle
(
new_img_color
,
transf_pts
[
i
].
pt
,
(
int
)
transf_pts
[
i
].
size
/
2
,
CV_RGB
(
255
,
0
,
0
));
circle
(
new_img_color
,
transf_pts
[
i
].
pt
,
(
int
)
transf_pts
[
i
].
size
/
2
,
Scalar
(
255
,
0
,
0
));
for
(
size_t
i
=
0
;
i
<
new_pts
.
size
();
++
i
)
circle
(
new_img_color
,
new_pts
[
i
].
pt
,
(
int
)
new_pts
[
i
].
size
/
2
,
CV_RGB
(
0
,
0
,
255
));
circle
(
new_img_color
,
new_pts
[
i
].
pt
,
(
int
)
new_pts
[
i
].
size
/
2
,
Scalar
(
0
,
0
,
255
));
namedWindow
(
name
+
"_T"
);
imshow
(
name
+
"_T"
,
new_img_color
);
}
...
...
modules/nonfree/test/test_rotation_and_scale_invariance.cpp
View file @
dd74a851
...
...
@@ -232,7 +232,7 @@ protected:
featureDetector
->
detect
(
image0
,
keypoints0
);
removeVerySmallKeypoints
(
keypoints0
);
if
(
keypoints0
.
size
()
<
15
)
CV_Error
(
CV_
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
CV_Error
(
Error
::
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
const
int
maxAngle
=
360
,
angleStep
=
15
;
for
(
int
angle
=
0
;
angle
<
maxAngle
;
angle
+=
angleStep
)
...
...
@@ -262,7 +262,7 @@ protected:
float
angle0
=
keypoints0
[
matches
[
m
].
queryIdx
].
angle
;
float
angle1
=
keypoints1
[
matches
[
m
].
trainIdx
].
angle
;
if
(
angle0
==
-
1
||
angle1
==
-
1
)
CV_Error
(
CV_
StsBadArg
,
"Given FeatureDetector is not rotation invariant, it can not be tested here.
\n
"
);
CV_Error
(
Error
::
StsBadArg
,
"Given FeatureDetector is not rotation invariant, it can not be tested here.
\n
"
);
CV_Assert
(
angle0
>=
0.
f
&&
angle0
<
360.
f
);
CV_Assert
(
angle1
>=
0.
f
&&
angle1
<
360.
f
);
...
...
@@ -347,7 +347,7 @@ protected:
featureDetector
->
detect
(
image0
,
keypoints0
);
removeVerySmallKeypoints
(
keypoints0
);
if
(
keypoints0
.
size
()
<
15
)
CV_Error
(
CV_
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
CV_Error
(
Error
::
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
descriptorExtractor
->
compute
(
image0
,
keypoints0
,
descriptors0
);
BFMatcher
bfmatcher
(
normType
);
...
...
@@ -432,7 +432,7 @@ protected:
featureDetector
->
detect
(
image0
,
keypoints0
);
removeVerySmallKeypoints
(
keypoints0
);
if
(
keypoints0
.
size
()
<
15
)
CV_Error
(
CV_
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
CV_Error
(
Error
::
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
for
(
int
scaleIdx
=
1
;
scaleIdx
<=
3
;
scaleIdx
++
)
{
...
...
@@ -444,7 +444,7 @@ protected:
featureDetector
->
detect
(
image1
,
keypoints1
);
removeVerySmallKeypoints
(
keypoints1
);
if
(
keypoints1
.
size
()
<
15
)
CV_Error
(
CV_
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
CV_Error
(
Error
::
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
if
(
keypoints1
.
size
()
>
keypoints0
.
size
())
{
...
...
@@ -553,7 +553,7 @@ protected:
featureDetector
->
detect
(
image0
,
keypoints0
);
removeVerySmallKeypoints
(
keypoints0
);
if
(
keypoints0
.
size
()
<
15
)
CV_Error
(
CV_
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
CV_Error
(
Error
::
StsAssert
,
"Detector gives too few points in a test image
\n
"
);
Mat
descriptors0
;
descriptorExtractor
->
compute
(
image0
,
keypoints0
,
descriptors0
);
...
...
modules/stitching/include/opencv2/stitching/detail/motion_estimators.hpp
View file @
dd74a851
...
...
@@ -93,8 +93,8 @@ public:
double
confThresh
()
const
{
return
conf_thresh_
;
}
void
setConfThresh
(
double
conf_thresh
)
{
conf_thresh_
=
conf_thresh
;
}
Cv
TermCriteria
termCriteria
()
{
return
term_criteria_
;
}
void
setTermCriteria
(
const
Cv
TermCriteria
&
term_criteria
)
{
term_criteria_
=
term_criteria
;
}
TermCriteria
termCriteria
()
{
return
term_criteria_
;
}
void
setTermCriteria
(
const
TermCriteria
&
term_criteria
)
{
term_criteria_
=
term_criteria
;
}
protected
:
BundleAdjusterBase
(
int
num_params_per_cam
,
int
num_errs_per_measurement
)
...
...
@@ -103,7 +103,7 @@ protected:
{
setRefinementMask
(
Mat
::
ones
(
3
,
3
,
CV_8U
));
setConfThresh
(
1.
);
setTermCriteria
(
cvTermCriteria
(
CV_TERMCRIT_EPS
+
CV_TERMCRIT_ITER
,
1000
,
DBL_EPSILON
));
setTermCriteria
(
TermCriteria
(
TermCriteria
::
EPS
+
TermCriteria
::
COUNT
,
1000
,
DBL_EPSILON
));
}
// Runs bundle adjustment
...
...
@@ -132,7 +132,7 @@ protected:
double
conf_thresh_
;
//Levenberg–Marquardt algorithm termination criteria
Cv
TermCriteria
term_criteria_
;
TermCriteria
term_criteria_
;
// Camera parameters matrix (CV_64F)
Mat
cam_params_
;
...
...
samples/android/hello-android/main.cpp
View file @
dd74a851
...
...
@@ -11,9 +11,9 @@ int main(int argc, char* argv[])
printf
(
"%s
\n
"
,
message
);
// put message to simple image
Size
textsize
=
getTextSize
(
message
,
CV_
FONT_HERSHEY_COMPLEX
,
3
,
5
,
0
);
Size
textsize
=
getTextSize
(
message
,
FONT_HERSHEY_COMPLEX
,
3
,
5
,
0
);
Mat
img
(
textsize
.
height
+
20
,
textsize
.
width
+
20
,
CV_32FC1
,
Scalar
(
230
,
230
,
230
));
putText
(
img
,
message
,
Point
(
10
,
img
.
rows
-
10
),
CV_
FONT_HERSHEY_COMPLEX
,
3
,
Scalar
(
0
,
0
,
0
),
5
);
putText
(
img
,
message
,
Point
(
10
,
img
.
rows
-
10
),
FONT_HERSHEY_COMPLEX
,
3
,
Scalar
(
0
,
0
,
0
),
5
);
// save\show resulting image
#if ANDROID
...
...
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