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
5d067883
Commit
5d067883
authored
Jun 15, 2012
by
Marina Kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed more "shadow" warnings
parent
cd81a13d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
43 deletions
+43
-43
brute_force_matcher.cpp
modules/gpu/src/brute_force_matcher.cpp
+4
-4
hog.cpp
modules/gpu/src/hog.cpp
+22
-22
mssegmentation.cpp
modules/gpu/src/mssegmentation.cpp
+7
-7
stereocsbp.cpp
modules/gpu/src/stereocsbp.cpp
+6
-6
video_reader.cpp
modules/gpu/src/video_reader.cpp
+4
-4
No files found.
modules/gpu/src/brute_force_matcher.cpp
View file @
5d067883
...
...
@@ -1024,11 +1024,11 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
for
(
int
i
=
0
;
i
<
nMatches
;
++
i
,
++
trainIdx_ptr
,
++
imgIdx_ptr
,
++
distance_ptr
)
{
int
trainIdx
=
*
trainIdx_ptr
;
int
imgIdx
=
*
imgIdx_ptr
;
float
distance
=
*
distance_ptr
;
int
_
trainIdx
=
*
trainIdx_ptr
;
int
_
imgIdx
=
*
imgIdx_ptr
;
float
_
distance
=
*
distance_ptr
;
DMatch
m
(
queryIdx
,
trainIdx
,
imgIdx
,
distance
);
DMatch
m
(
queryIdx
,
_trainIdx
,
_imgIdx
,
_
distance
);
curMatches
.
push_back
(
m
);
}
...
...
modules/gpu/src/hog.cpp
View file @
5d067883
...
...
@@ -98,17 +98,17 @@ namespace cv { namespace gpu { namespace device
using
namespace
::
cv
::
gpu
::
device
;
cv
::
gpu
::
HOGDescriptor
::
HOGDescriptor
(
Size
win_size
,
Size
block_size
,
Size
block_stride
,
Size
cell_size
,
int
nbins
,
double
win_sigma
,
double
threshold_L2hys
,
bool
gamma_correction
,
int
nlevels
)
:
win_size
(
win_size
),
block_size
(
block_size
),
block_stride
(
block_stride
),
cell_size
(
cell_size
),
nbins
(
nbins
),
win_sigma
(
win_sigma
),
threshold_L2hys
(
threshold_L2hys
),
gamma_correction
(
gamma_correction
),
nlevels
(
nlevels
)
cv
::
gpu
::
HOGDescriptor
::
HOGDescriptor
(
Size
win_size
_
,
Size
block_size_
,
Size
block_stride_
,
Size
cell_size_
,
int
nbins_
,
double
win_sigma_
,
double
threshold_L2hys_
,
bool
gamma_correction_
,
int
nlevels_
)
:
win_size
(
win_size
_
),
block_size
(
block_size
_
),
block_stride
(
block_stride
_
),
cell_size
(
cell_size
_
),
nbins
(
nbins
_
),
win_sigma
(
win_sigma
_
),
threshold_L2hys
(
threshold_L2hys
_
),
gamma_correction
(
gamma_correction
_
),
nlevels
(
nlevels
_
)
{
CV_Assert
((
win_size
.
width
-
block_size
.
width
)
%
block_stride
.
width
==
0
&&
(
win_size
.
height
-
block_size
.
height
)
%
block_stride
.
height
==
0
);
...
...
@@ -149,9 +149,9 @@ bool cv::gpu::HOGDescriptor::checkDetectorSize() const
return
detector_size
==
0
||
detector_size
==
descriptor_size
||
detector_size
==
descriptor_size
+
1
;
}
void
cv
::
gpu
::
HOGDescriptor
::
setSVMDetector
(
const
vector
<
float
>&
detector
)
void
cv
::
gpu
::
HOGDescriptor
::
setSVMDetector
(
const
vector
<
float
>&
_
detector
)
{
std
::
vector
<
float
>
detector_reordered
(
detector
.
size
());
std
::
vector
<
float
>
detector_reordered
(
_
detector
.
size
());
size_t
block_hist_size
=
getBlockHistogramSize
();
cv
::
Size
blocks_per_img
=
numPartsWithin
(
win_size
,
block_size
,
block_stride
);
...
...
@@ -159,7 +159,7 @@ void cv::gpu::HOGDescriptor::setSVMDetector(const vector<float>& detector)
for
(
int
i
=
0
;
i
<
blocks_per_img
.
height
;
++
i
)
for
(
int
j
=
0
;
j
<
blocks_per_img
.
width
;
++
j
)
{
const
float
*
src
=
&
detector
[
0
]
+
(
j
*
blocks_per_img
.
height
+
i
)
*
block_hist_size
;
const
float
*
src
=
&
_
detector
[
0
]
+
(
j
*
blocks_per_img
.
height
+
i
)
*
block_hist_size
;
float
*
dst
=
&
detector_reordered
[
0
]
+
(
i
*
blocks_per_img
.
width
+
j
)
*
block_hist_size
;
for
(
size_t
k
=
0
;
k
<
block_hist_size
;
++
k
)
dst
[
k
]
=
src
[
k
];
...
...
@@ -168,7 +168,7 @@ void cv::gpu::HOGDescriptor::setSVMDetector(const vector<float>& detector)
this
->
detector
.
upload
(
Mat
(
detector_reordered
).
reshape
(
1
,
1
));
size_t
descriptor_size
=
getDescriptorSize
();
free_coef
=
detector
.
size
()
>
descriptor_size
?
detector
[
descriptor_size
]
:
0
;
free_coef
=
_detector
.
size
()
>
descriptor_size
?
_
detector
[
descriptor_size
]
:
0
;
CV_Assert
(
checkDetectorSize
());
}
...
...
@@ -190,24 +190,24 @@ cv::gpu::GpuMat cv::gpu::HOGDescriptor::getBuffer(int rows, int cols, int type,
}
void
cv
::
gpu
::
HOGDescriptor
::
computeGradient
(
const
GpuMat
&
img
,
GpuMat
&
grad
,
GpuMat
&
qangle
)
void
cv
::
gpu
::
HOGDescriptor
::
computeGradient
(
const
GpuMat
&
img
,
GpuMat
&
_grad
,
GpuMat
&
_
qangle
)
{
CV_Assert
(
img
.
type
()
==
CV_8UC1
||
img
.
type
()
==
CV_8UC4
);
// grad.create(img.size(), CV_32FC2);
grad
=
getBuffer
(
img
.
size
(),
CV_32FC2
,
grad_buf
);
_grad
=
getBuffer
(
img
.
size
(),
CV_32FC2
,
grad_buf
);
// qangle.create(img.size(), CV_8UC2);
qangle
=
getBuffer
(
img
.
size
(),
CV_8UC2
,
qangle_buf
);
_qangle
=
getBuffer
(
img
.
size
(),
CV_8UC2
,
qangle_buf
);
float
angleScale
=
(
float
)(
nbins
/
CV_PI
);
switch
(
img
.
type
())
{
case
CV_8UC1
:
hog
::
compute_gradients_8UC1
(
nbins
,
img
.
rows
,
img
.
cols
,
img
,
angleScale
,
grad
,
qangle
,
gamma_correction
);
hog
::
compute_gradients_8UC1
(
nbins
,
img
.
rows
,
img
.
cols
,
img
,
angleScale
,
_grad
,
_
qangle
,
gamma_correction
);
break
;
case
CV_8UC4
:
hog
::
compute_gradients_8UC4
(
nbins
,
img
.
rows
,
img
.
cols
,
img
,
angleScale
,
grad
,
qangle
,
gamma_correction
);
hog
::
compute_gradients_8UC4
(
nbins
,
img
.
rows
,
img
.
cols
,
img
,
angleScale
,
_grad
,
_
qangle
,
gamma_correction
);
break
;
}
}
...
...
@@ -323,8 +323,8 @@ void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, vector<Rect>& f
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/mssegmentation.cpp
View file @
5d067883
...
...
@@ -78,7 +78,7 @@ template <typename T>
struct
GraphEdge
{
GraphEdge
()
{}
GraphEdge
(
int
to
,
int
next
,
const
T
&
val
)
:
to
(
to
),
next
(
next
),
val
(
val
)
{}
GraphEdge
(
int
to
_
,
int
next_
,
const
T
&
val_
)
:
to
(
to_
),
next
(
next_
),
val
(
val_
)
{}
int
to
;
int
next
;
T
val
;
...
...
@@ -110,7 +110,7 @@ private:
struct
SegmLinkVal
{
SegmLinkVal
()
{}
SegmLinkVal
(
int
dr
,
int
dsp
)
:
dr
(
dr
),
dsp
(
dsp
)
{}
SegmLinkVal
(
int
dr
_
,
int
dsp_
)
:
dr
(
dr_
),
dsp
(
dsp_
)
{}
bool
operator
<
(
const
SegmLinkVal
&
other
)
const
{
return
dr
+
dsp
<
other
.
dr
+
other
.
dsp
;
...
...
@@ -123,8 +123,8 @@ struct SegmLinkVal
struct
SegmLink
{
SegmLink
()
{}
SegmLink
(
int
from
,
int
to
,
const
SegmLinkVal
&
val
)
:
from
(
from
),
to
(
to
),
val
(
val
)
{}
SegmLink
(
int
from
_
,
int
to_
,
const
SegmLinkVal
&
val_
)
:
from
(
from
_
),
to
(
to_
),
val
(
val_
)
{}
bool
operator
<
(
const
SegmLink
&
other
)
const
{
return
val
<
other
.
val
;
...
...
@@ -182,10 +182,10 @@ inline int DjSets::merge(int set1, int set2)
template
<
typename
T
>
Graph
<
T
>::
Graph
(
int
numv
,
int
nume_max
)
:
start
(
numv
,
-
1
),
edges
(
nume_max
)
Graph
<
T
>::
Graph
(
int
numv
_
,
int
nume_max_
)
:
start
(
numv_
,
-
1
),
edges
(
nume_max_
)
{
this
->
numv
=
numv
;
this
->
nume_max
=
nume_max
;
this
->
numv
=
numv
_
;
this
->
nume_max
=
nume_max
_
;
nume
=
0
;
}
...
...
modules/gpu/src/stereocsbp.cpp
View file @
5d067883
...
...
@@ -171,8 +171,8 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat& mbuf, GpuMat& te
{
cols_pyr
[
i
]
=
cols_pyr
[
i
-
1
]
/
2
;
rows_pyr
[
i
]
=
rows_pyr
[
i
-
1
]
/
2
;
nr_plane_pyr
[
i
]
=
nr_plane_pyr
[
i
-
1
]
*
2
;
}
nr_plane_pyr
[
i
]
=
nr_plane_pyr
[
i
-
1
]
*
2
;
}
GpuMat
u
[
2
],
d
[
2
],
l
[
2
],
r
[
2
],
disp_selected_pyr
[
2
],
data_cost
,
data_cost_selected
;
...
...
@@ -193,14 +193,14 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat& mbuf, GpuMat& te
GpuMat
sub2
=
sub1
.
rowRange
((
k
+
0
)
*
sub1
.
rows
/
2
,
(
k
+
1
)
*
sub1
.
rows
/
2
);
GpuMat
*
buf_ptrs
[]
=
{
&
u
[
k
],
&
d
[
k
],
&
l
[
k
],
&
r
[
k
],
&
disp_selected_pyr
[
k
]
};
for
(
int
r
=
0
;
r
<
5
;
++
r
)
for
(
int
_r
=
0
;
_r
<
5
;
++
_r
)
{
*
buf_ptrs
[
r
]
=
sub2
.
rowRange
(
r
*
sub2
.
rows
/
5
,
(
r
+
1
)
*
sub2
.
rows
/
5
);
assert
(
buf_ptrs
[
r
]
->
cols
==
cols
&&
buf_ptrs
[
r
]
->
rows
==
rows
*
rthis
.
nr_plane
);
*
buf_ptrs
[
_r
]
=
sub2
.
rowRange
(
_r
*
sub2
.
rows
/
5
,
(
_
r
+
1
)
*
sub2
.
rows
/
5
);
assert
(
buf_ptrs
[
_r
]
->
cols
==
cols
&&
buf_ptrs
[
_
r
]
->
rows
==
rows
*
rthis
.
nr_plane
);
}
};
size_t
elem_step
=
mbuf
.
step
/
sizeof
(
T
);
size_t
elem_step
=
mbuf
.
step
/
sizeof
(
T
);
Size
temp_size
=
data_cost
.
size
();
if
((
size_t
)
temp_size
.
area
()
<
elem_step
*
rows_pyr
[
levels
-
1
]
*
rthis
.
ndisp
)
...
...
modules/gpu/src/video_reader.cpp
View file @
5d067883
...
...
@@ -391,11 +391,11 @@ void cv::gpu::VideoReader_GPU::dumpFormat(std::ostream& st)
"YUV444"
};
FormatInfo
format
=
this
->
format
();
FormatInfo
_
format
=
this
->
format
();
st
<<
"Frame Size : "
<<
format
.
width
<<
"x"
<<
format
.
height
<<
std
::
endl
;
st
<<
"Codec : "
<<
(
format
.
codec
<=
H264_MVC
?
codecs
[
format
.
codec
]
:
"Uncompressed YUV"
)
<<
std
::
endl
;
st
<<
"Chroma Format : "
<<
chromas
[
format
.
chromaFormat
]
<<
std
::
endl
;
st
<<
"Frame Size : "
<<
_format
.
width
<<
"x"
<<
_
format
.
height
<<
std
::
endl
;
st
<<
"Codec : "
<<
(
_format
.
codec
<=
H264_MVC
?
codecs
[
_
format
.
codec
]
:
"Uncompressed YUV"
)
<<
std
::
endl
;
st
<<
"Chroma Format : "
<<
chromas
[
_
format
.
chromaFormat
]
<<
std
::
endl
;
}
#endif // HAVE_CUDA
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