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
f17f4bda
Commit
f17f4bda
authored
Aug 19, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more warning fixes for GCC
parent
15213401
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
49 deletions
+49
-49
brute_force_matcher.cpp
modules/gpu/src/brute_force_matcher.cpp
+25
-25
hog.cpp
modules/gpu/src/hog.cpp
+3
-3
video_decoder.cpp
modules/gpu/src/video_decoder.cpp
+21
-21
No files found.
modules/gpu/src/brute_force_matcher.cpp
View file @
f17f4bda
...
...
@@ -420,16 +420,16 @@ void cv::gpu::BFMatcher_GPU::matchConvert(const Mat& trainIdx, const Mat& imgIdx
const
float
*
distance_ptr
=
distance
.
ptr
<
float
>
();
for
(
int
queryIdx
=
0
;
queryIdx
<
nQuery
;
++
queryIdx
,
++
trainIdx_ptr
,
++
imgIdx_ptr
,
++
distance_ptr
)
{
int
trainIdx
=
*
trainIdx_ptr
;
int
_
trainIdx
=
*
trainIdx_ptr
;
if
(
trainIdx
==
-
1
)
if
(
_
trainIdx
==
-
1
)
continue
;
int
imgIdx
=
*
imgIdx_ptr
;
int
_
imgIdx
=
*
imgIdx_ptr
;
float
distance
=
*
distance_ptr
;
float
_
distance
=
*
distance_ptr
;
DMatch
m
(
queryIdx
,
trainIdx
,
imgIdx
,
distance
);
DMatch
m
(
queryIdx
,
_trainIdx
,
_imgIdx
,
_
distance
);
matches
.
push_back
(
m
);
}
...
...
@@ -558,13 +558,13 @@ void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat& trainIdx, const Mat& dis
for
(
int
i
=
0
;
i
<
k
;
++
i
,
++
trainIdx_ptr
,
++
distance_ptr
)
{
int
trainIdx
=
*
trainIdx_ptr
;
int
_
trainIdx
=
*
trainIdx_ptr
;
if
(
trainIdx
!=
-
1
)
if
(
_
trainIdx
!=
-
1
)
{
float
distance
=
*
distance_ptr
;
float
_
distance
=
*
distance_ptr
;
DMatch
m
(
queryIdx
,
trainIdx
,
0
,
distance
);
DMatch
m
(
queryIdx
,
_trainIdx
,
0
,
_
distance
);
curMatches
.
push_back
(
m
);
}
...
...
@@ -680,15 +680,15 @@ void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat& trainIdx, const Mat& im
for
(
int
i
=
0
;
i
<
2
;
++
i
,
++
trainIdx_ptr
,
++
imgIdx_ptr
,
++
distance_ptr
)
{
int
trainIdx
=
*
trainIdx_ptr
;
int
_
trainIdx
=
*
trainIdx_ptr
;
if
(
trainIdx
!=
-
1
)
if
(
_
trainIdx
!=
-
1
)
{
int
imgIdx
=
*
imgIdx_ptr
;
int
_
imgIdx
=
*
imgIdx_ptr
;
float
distance
=
*
distance_ptr
;
float
_
distance
=
*
distance_ptr
;
DMatch
m
(
queryIdx
,
trainIdx
,
imgIdx
,
distance
);
DMatch
m
(
queryIdx
,
_trainIdx
,
_imgIdx
,
_
distance
);
curMatches
.
push_back
(
m
);
}
...
...
@@ -868,25 +868,25 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
const
int
*
trainIdx_ptr
=
trainIdx
.
ptr
<
int
>
(
queryIdx
);
const
float
*
distance_ptr
=
distance
.
ptr
<
float
>
(
queryIdx
);
const
int
nMatche
s
=
std
::
min
(
nMatches_ptr
[
queryIdx
],
trainIdx
.
cols
);
const
int
nMatche
d
=
std
::
min
(
nMatches_ptr
[
queryIdx
],
trainIdx
.
cols
);
if
(
nMatche
s
==
0
)
if
(
nMatche
d
==
0
)
{
if
(
!
compactResult
)
matches
.
push_back
(
vector
<
DMatch
>
());
continue
;
}
matches
.
push_back
(
vector
<
DMatch
>
(
nMatche
s
));
matches
.
push_back
(
vector
<
DMatch
>
(
nMatche
d
));
vector
<
DMatch
>&
curMatches
=
matches
.
back
();
for
(
int
i
=
0
;
i
<
nMatche
s
;
++
i
,
++
trainIdx_ptr
,
++
distance_ptr
)
for
(
int
i
=
0
;
i
<
nMatche
d
;
++
i
,
++
trainIdx_ptr
,
++
distance_ptr
)
{
int
trainIdx
=
*
trainIdx_ptr
;
int
_
trainIdx
=
*
trainIdx_ptr
;
float
distance
=
*
distance_ptr
;
float
_
distance
=
*
distance_ptr
;
DMatch
m
(
queryIdx
,
trainIdx
,
0
,
distance
);
DMatch
m
(
queryIdx
,
_trainIdx
,
0
,
_
distance
);
curMatches
[
i
]
=
m
;
}
...
...
@@ -1009,9 +1009,9 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
const
int
*
imgIdx_ptr
=
imgIdx
.
ptr
<
int
>
(
queryIdx
);
const
float
*
distance_ptr
=
distance
.
ptr
<
float
>
(
queryIdx
);
const
int
nMatche
s
=
std
::
min
(
nMatches_ptr
[
queryIdx
],
trainIdx
.
cols
);
const
int
nMatche
d
=
std
::
min
(
nMatches_ptr
[
queryIdx
],
trainIdx
.
cols
);
if
(
nMatche
s
==
0
)
if
(
nMatche
d
==
0
)
{
if
(
!
compactResult
)
matches
.
push_back
(
vector
<
DMatch
>
());
...
...
@@ -1020,9 +1020,9 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
matches
.
push_back
(
vector
<
DMatch
>
());
vector
<
DMatch
>&
curMatches
=
matches
.
back
();
curMatches
.
reserve
(
nMatche
s
);
curMatches
.
reserve
(
nMatche
d
);
for
(
int
i
=
0
;
i
<
nMatche
s
;
++
i
,
++
trainIdx_ptr
,
++
imgIdx_ptr
,
++
distance_ptr
)
for
(
int
i
=
0
;
i
<
nMatche
d
;
++
i
,
++
trainIdx_ptr
,
++
imgIdx_ptr
,
++
distance_ptr
)
{
int
_trainIdx
=
*
trainIdx_ptr
;
int
_imgIdx
=
*
imgIdx_ptr
;
...
...
modules/gpu/src/hog.cpp
View file @
f17f4bda
...
...
@@ -315,7 +315,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
double
scale
=
1.
;
int
levels
=
0
;
for
(
levels
=
0
;
levels
<
conf_out
.
size
();
levels
++
)
for
(
levels
=
0
;
levels
<
(
int
)
conf_out
.
size
();
levels
++
)
{
scale
=
conf_out
[
levels
].
scale
;
level_scale
.
push_back
(
scale
);
...
...
@@ -332,8 +332,8 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
for
(
size_t
i
=
0
;
i
<
level_scale
.
size
();
i
++
)
{
double
scale
=
level_scale
[
i
];
Size
sz
(
cvRound
(
img
.
cols
/
scale
),
cvRound
(
img
.
rows
/
scale
));
double
_
scale
=
level_scale
[
i
];
Size
sz
(
cvRound
(
img
.
cols
/
_scale
),
cvRound
(
img
.
rows
/
_
scale
));
GpuMat
smaller_img
;
if
(
sz
==
img
.
size
())
...
...
modules/gpu/src/video_decoder.cpp
View file @
f17f4bda
...
...
@@ -49,36 +49,36 @@ void cv::gpu::detail::VideoDecoder::create(const VideoReader_GPU::FormatInfo& vi
{
release
();
cudaVideoCodec
codec
=
static_cast
<
cudaVideoCodec
>
(
videoFormat
.
codec
);
cudaVideoChromaFormat
chromaFormat
=
static_cast
<
cudaVideoChromaFormat
>
(
videoFormat
.
chromaFormat
);
cudaVideoCodec
_
codec
=
static_cast
<
cudaVideoCodec
>
(
videoFormat
.
codec
);
cudaVideoChromaFormat
_
chromaFormat
=
static_cast
<
cudaVideoChromaFormat
>
(
videoFormat
.
chromaFormat
);
cudaVideoCreateFlags
videoCreateFlags
=
(
codec
==
cudaVideoCodec_JPEG
||
codec
==
cudaVideoCodec_MPEG2
)
?
cudaVideoCreateFlags
videoCreateFlags
=
(
_codec
==
cudaVideoCodec_JPEG
||
_
codec
==
cudaVideoCodec_MPEG2
)
?
cudaVideoCreate_PreferCUDA
:
cudaVideoCreate_PreferCUVID
;
// Validate video format. These are the currently supported formats via NVCUVID
CV_Assert
(
cudaVideoCodec_MPEG1
==
codec
||
cudaVideoCodec_MPEG2
==
codec
||
cudaVideoCodec_MPEG4
==
codec
||
cudaVideoCodec_VC1
==
codec
||
cudaVideoCodec_H264
==
codec
||
cudaVideoCodec_JPEG
==
codec
||
cudaVideoCodec_YUV420
==
codec
||
cudaVideoCodec_YV12
==
codec
||
cudaVideoCodec_NV12
==
codec
||
cudaVideoCodec_YUYV
==
codec
||
cudaVideoCodec_UYVY
==
codec
);
CV_Assert
(
cudaVideoChromaFormat_Monochrome
==
chromaFormat
||
cudaVideoChromaFormat_420
==
chromaFormat
||
cudaVideoChromaFormat_422
==
chromaFormat
||
cudaVideoChromaFormat_444
==
chromaFormat
);
CV_Assert
(
cudaVideoCodec_MPEG1
==
_
codec
||
cudaVideoCodec_MPEG2
==
_
codec
||
cudaVideoCodec_MPEG4
==
_
codec
||
cudaVideoCodec_VC1
==
_
codec
||
cudaVideoCodec_H264
==
_
codec
||
cudaVideoCodec_JPEG
==
_
codec
||
cudaVideoCodec_YUV420
==
_
codec
||
cudaVideoCodec_YV12
==
_
codec
||
cudaVideoCodec_NV12
==
_
codec
||
cudaVideoCodec_YUYV
==
_
codec
||
cudaVideoCodec_UYVY
==
_
codec
);
CV_Assert
(
cudaVideoChromaFormat_Monochrome
==
_
chromaFormat
||
cudaVideoChromaFormat_420
==
_
chromaFormat
||
cudaVideoChromaFormat_422
==
_
chromaFormat
||
cudaVideoChromaFormat_444
==
_
chromaFormat
);
// Fill the decoder-create-info struct from the given video-format struct.
std
::
memset
(
&
createInfo_
,
0
,
sizeof
(
CUVIDDECODECREATEINFO
));
// Create video decoder
createInfo_
.
CodecType
=
codec
;
createInfo_
.
CodecType
=
_
codec
;
createInfo_
.
ulWidth
=
videoFormat
.
width
;
createInfo_
.
ulHeight
=
videoFormat
.
height
;
createInfo_
.
ulNumDecodeSurfaces
=
FrameQueue
::
MaximumSize
;
...
...
@@ -87,7 +87,7 @@ void cv::gpu::detail::VideoDecoder::create(const VideoReader_GPU::FormatInfo& vi
while
(
createInfo_
.
ulNumDecodeSurfaces
*
videoFormat
.
width
*
videoFormat
.
height
>
16
*
1024
*
1024
)
createInfo_
.
ulNumDecodeSurfaces
--
;
createInfo_
.
ChromaFormat
=
chromaFormat
;
createInfo_
.
ChromaFormat
=
_
chromaFormat
;
createInfo_
.
OutputFormat
=
cudaVideoSurfaceFormat_NV12
;
createInfo_
.
DeinterlaceMode
=
cudaVideoDeinterlaceMode_Adaptive
;
...
...
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