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
633a8bfa
Commit
633a8bfa
authored
Aug 28, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed many warnings (modified pull request 13)
parent
aa2524f4
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
84 additions
and
74 deletions
+84
-74
tif_stream.cxx
3rdparty/libtiff/tif_stream.cxx
+1
-0
HOGfeatures.h
apps/traincascade/HOGfeatures.h
+4
-4
lbpfeatures.h
apps/traincascade/lbpfeatures.h
+11
-11
chamfermatching.cpp
modules/contrib/src/chamfermatching.cpp
+26
-25
features2d.hpp
modules/features2d/include/opencv2/features2d/features2d.hpp
+4
-1
fast.cpp
modules/features2d/src/fast.cpp
+5
-0
perf_imgproc.cpp
modules/gpu/perf/perf_imgproc.cpp
+4
-4
perf_labeling.cpp
modules/gpu/perf/perf_labeling.cpp
+1
-1
cap_ffmpeg_impl.hpp
modules/highgui/src/cap_ffmpeg_impl.hpp
+1
-1
tree.cpp
modules/ml/src/tree.cpp
+1
-1
cascadedetect.hpp
modules/objdetect/src/cascadedetect.hpp
+23
-23
seam_finders.cpp
modules/stitching/src/seam_finders.cpp
+2
-2
bgfg_gmg.cpp
modules/video/src/bgfg_gmg.cpp
+1
-1
No files found.
3rdparty/libtiff/tif_stream.cxx
View file @
633a8bfa
...
...
@@ -28,6 +28,7 @@
* TIFF Library UNIX-specific Routines.
*/
#include "tiffiop.h"
#include "tiffio.hxx"
#include <iostream>
#ifndef __VMS
...
...
apps/traincascade/HOGfeatures.h
View file @
633a8bfa
...
...
@@ -65,11 +65,11 @@ inline float CvHOGEvaluator::Feature::calc( const vector<Mat>& _hists, const Mat
int
binIdx
=
featComponent
%
N_BINS
;
int
cellIdx
=
featComponent
/
N_BINS
;
const
float
*
hist
=
_hists
[
binIdx
].
ptr
<
float
>
((
int
)
y
);
res
=
hist
[
fastRect
[
cellIdx
].
p0
]
-
hist
[
fastRect
[
cellIdx
].
p1
]
-
hist
[
fastRect
[
cellIdx
].
p2
]
+
hist
[
fastRect
[
cellIdx
].
p3
];
const
float
*
p
hist
=
_hists
[
binIdx
].
ptr
<
float
>
((
int
)
y
);
res
=
phist
[
fastRect
[
cellIdx
].
p0
]
-
phist
[
fastRect
[
cellIdx
].
p1
]
-
phist
[
fastRect
[
cellIdx
].
p2
]
+
p
hist
[
fastRect
[
cellIdx
].
p3
];
const
float
*
normSum
=
_normSum
.
ptr
<
float
>
((
int
)
y
);
normFactor
=
(
float
)(
normSum
[
fastRect
[
0
].
p0
]
-
normSum
[
fastRect
[
1
].
p1
]
-
normSum
[
fastRect
[
2
].
p2
]
+
normSum
[
fastRect
[
3
].
p3
]);
const
float
*
p
normSum
=
_normSum
.
ptr
<
float
>
((
int
)
y
);
normFactor
=
(
float
)(
pnormSum
[
fastRect
[
0
].
p0
]
-
pnormSum
[
fastRect
[
1
].
p1
]
-
pnormSum
[
fastRect
[
2
].
p2
]
+
p
normSum
[
fastRect
[
3
].
p3
]);
res
=
(
res
>
0
.
001
f
)
?
(
res
/
(
normFactor
+
0
.
001
f
)
)
:
0
.
f
;
//for cutting negative values, which apper due to floating precision
return
res
;
...
...
apps/traincascade/lbpfeatures.h
View file @
633a8bfa
...
...
@@ -41,17 +41,17 @@ protected:
inline
uchar
CvLBPEvaluator
::
Feature
::
calc
(
const
Mat
&
_sum
,
size_t
y
)
const
{
const
int
*
sum
=
_sum
.
ptr
<
int
>
((
int
)
y
);
int
cval
=
sum
[
p
[
5
]]
-
sum
[
p
[
6
]]
-
sum
[
p
[
9
]]
+
sum
[
p
[
10
]];
return
(
uchar
)((
sum
[
p
[
0
]]
-
sum
[
p
[
1
]]
-
sum
[
p
[
4
]]
+
sum
[
p
[
5
]]
>=
cval
?
128
:
0
)
|
// 0
(
sum
[
p
[
1
]]
-
sum
[
p
[
2
]]
-
sum
[
p
[
5
]]
+
sum
[
p
[
6
]]
>=
cval
?
64
:
0
)
|
// 1
(
sum
[
p
[
2
]]
-
sum
[
p
[
3
]]
-
sum
[
p
[
6
]]
+
sum
[
p
[
7
]]
>=
cval
?
32
:
0
)
|
// 2
(
sum
[
p
[
6
]]
-
sum
[
p
[
7
]]
-
sum
[
p
[
10
]]
+
sum
[
p
[
11
]]
>=
cval
?
16
:
0
)
|
// 5
(
sum
[
p
[
10
]]
-
sum
[
p
[
11
]]
-
sum
[
p
[
14
]]
+
sum
[
p
[
15
]]
>=
cval
?
8
:
0
)
|
// 8
(
sum
[
p
[
9
]]
-
sum
[
p
[
10
]]
-
sum
[
p
[
13
]]
+
sum
[
p
[
14
]]
>=
cval
?
4
:
0
)
|
// 7
(
sum
[
p
[
8
]]
-
sum
[
p
[
9
]]
-
sum
[
p
[
12
]]
+
sum
[
p
[
13
]]
>=
cval
?
2
:
0
)
|
// 6
(
sum
[
p
[
4
]]
-
sum
[
p
[
5
]]
-
sum
[
p
[
8
]]
+
sum
[
p
[
9
]]
>=
cval
?
1
:
0
));
// 3
const
int
*
p
sum
=
_sum
.
ptr
<
int
>
((
int
)
y
);
int
cval
=
psum
[
p
[
5
]]
-
psum
[
p
[
6
]]
-
psum
[
p
[
9
]]
+
p
sum
[
p
[
10
]];
return
(
uchar
)((
psum
[
p
[
0
]]
-
psum
[
p
[
1
]]
-
psum
[
p
[
4
]]
+
p
sum
[
p
[
5
]]
>=
cval
?
128
:
0
)
|
// 0
(
psum
[
p
[
1
]]
-
psum
[
p
[
2
]]
-
psum
[
p
[
5
]]
+
p
sum
[
p
[
6
]]
>=
cval
?
64
:
0
)
|
// 1
(
psum
[
p
[
2
]]
-
psum
[
p
[
3
]]
-
psum
[
p
[
6
]]
+
p
sum
[
p
[
7
]]
>=
cval
?
32
:
0
)
|
// 2
(
psum
[
p
[
6
]]
-
psum
[
p
[
7
]]
-
psum
[
p
[
10
]]
+
p
sum
[
p
[
11
]]
>=
cval
?
16
:
0
)
|
// 5
(
psum
[
p
[
10
]]
-
psum
[
p
[
11
]]
-
psum
[
p
[
14
]]
+
p
sum
[
p
[
15
]]
>=
cval
?
8
:
0
)
|
// 8
(
psum
[
p
[
9
]]
-
psum
[
p
[
10
]]
-
psum
[
p
[
13
]]
+
p
sum
[
p
[
14
]]
>=
cval
?
4
:
0
)
|
// 7
(
psum
[
p
[
8
]]
-
psum
[
p
[
9
]]
-
psum
[
p
[
12
]]
+
p
sum
[
p
[
13
]]
>=
cval
?
2
:
0
)
|
// 6
(
psum
[
p
[
4
]]
-
psum
[
p
[
5
]]
-
psum
[
p
[
8
]]
+
p
sum
[
p
[
9
]]
>=
cval
?
1
:
0
));
// 3
}
#endif
modules/contrib/src/chamfermatching.cpp
View file @
633a8bfa
...
...
@@ -100,8 +100,8 @@ private:
float
max_scale_
;
public
:
SlidingWindowImageRange
(
int
width
,
int
height
,
int
x_step
=
3
,
int
y_step
=
3
,
int
scales
=
5
,
float
min_scale
=
0.6
,
float
max_scale
=
1.6
)
:
width_
(
width
),
height_
(
height
),
x_step_
(
x_step
),
y_step_
(
y_step
),
scales_
(
scales
),
min_scale_
(
min_scale
),
max_scale_
(
max_scale
)
SlidingWindowImageRange
(
int
width
,
int
height
,
int
x_step
=
3
,
int
y_step
=
3
,
int
_
scales
=
5
,
float
min_scale
=
0.6
,
float
max_scale
=
1.6
)
:
width_
(
width
),
height_
(
height
),
x_step_
(
x_step
),
y_step_
(
y_step
),
scales_
(
_
scales
),
min_scale_
(
min_scale
),
max_scale_
(
max_scale
)
{
}
...
...
@@ -121,8 +121,8 @@ private:
LocationImageRange
&
operator
=
(
const
LocationImageRange
&
);
public
:
LocationImageRange
(
const
std
::
vector
<
Point
>&
locations
,
int
scales
=
5
,
float
min_scale
=
0.6
,
float
max_scale
=
1.6
)
:
locations_
(
locations
),
scales_
(
scales
),
min_scale_
(
min_scale
),
max_scale_
(
max_scale
)
LocationImageRange
(
const
std
::
vector
<
Point
>&
locations
,
int
_
scales
=
5
,
float
min_scale
=
0.6
,
float
max_scale
=
1.6
)
:
locations_
(
locations
),
scales_
(
_
scales
),
min_scale_
(
min_scale
),
max_scale_
(
max_scale
)
{
}
...
...
@@ -141,10 +141,10 @@ private:
LocationScaleImageRange
(
const
LocationScaleImageRange
&
);
LocationScaleImageRange
&
operator
=
(
const
LocationScaleImageRange
&
);
public
:
LocationScaleImageRange
(
const
std
::
vector
<
Point
>&
locations
,
const
std
::
vector
<
float
>&
scales
)
:
locations_
(
locations
),
scales_
(
scales
)
LocationScaleImageRange
(
const
std
::
vector
<
Point
>&
locations
,
const
std
::
vector
<
float
>&
_
scales
)
:
locations_
(
locations
),
scales_
(
_
scales
)
{
assert
(
locations
.
size
()
==
scales
.
size
());
assert
(
locations
.
size
()
==
_
scales
.
size
());
}
ImageIterator
*
iterator
()
const
...
...
@@ -237,7 +237,7 @@ private:
std
::
vector
<
Template
*>
templates
;
public
:
Matching
(
bool
use_orientation
=
true
,
float
truncate
=
10
)
:
truncate_
(
truncate
),
use_orientation_
(
use_orientation
)
Matching
(
bool
use_orientation
=
true
,
float
_truncate
=
10
)
:
truncate_
(
_
truncate
),
use_orientation_
(
use_orientation
)
{
}
...
...
@@ -370,7 +370,7 @@ private:
LocationImageIterator
&
operator
=
(
const
LocationImageIterator
&
);
public
:
LocationImageIterator
(
const
std
::
vector
<
Point
>&
locations
,
int
scales
,
float
min_scale
,
float
max_scale
);
LocationImageIterator
(
const
std
::
vector
<
Point
>&
locations
,
int
_
scales
,
float
min_scale
,
float
max_scale
);
bool
hasNext
()
const
{
return
has_next_
;
...
...
@@ -392,10 +392,10 @@ private:
LocationScaleImageIterator
&
operator
=
(
const
LocationScaleImageIterator
&
);
public
:
LocationScaleImageIterator
(
const
std
::
vector
<
Point
>&
locations
,
const
std
::
vector
<
float
>&
scales
)
:
locations_
(
locations
),
scales_
(
scales
)
LocationScaleImageIterator
(
const
std
::
vector
<
Point
>&
locations
,
const
std
::
vector
<
float
>&
_
scales
)
:
locations_
(
locations
),
scales_
(
_
scales
)
{
assert
(
locations
.
size
()
==
scales
.
size
());
assert
(
locations
.
size
()
==
_
scales
.
size
());
reset
();
}
...
...
@@ -494,7 +494,7 @@ ChamferMatcher::SlidingWindowImageIterator::SlidingWindowImageIterator( int widt
int
height
,
int
x_step
=
3
,
int
y_step
=
3
,
int
scales
=
5
,
int
_
scales
=
5
,
float
min_scale
=
0.6
,
float
max_scale
=
1.6
)
:
...
...
@@ -502,7 +502,7 @@ ChamferMatcher::SlidingWindowImageIterator::SlidingWindowImageIterator( int widt
height_
(
height
),
x_step_
(
x_step
),
y_step_
(
y_step
),
scales_
(
scales
),
scales_
(
_
scales
),
min_scale_
(
min_scale
),
max_scale_
(
max_scale
)
{
...
...
@@ -550,11 +550,11 @@ ChamferMatcher::ImageIterator* ChamferMatcher::SlidingWindowImageRange::iterator
ChamferMatcher
::
LocationImageIterator
::
LocationImageIterator
(
const
std
::
vector
<
Point
>&
locations
,
int
scales
=
5
,
int
_
scales
=
5
,
float
min_scale
=
0.6
,
float
max_scale
=
1.6
)
:
locations_
(
locations
),
scales_
(
scales
),
scales_
(
_
scales
),
min_scale_
(
min_scale
),
max_scale_
(
max_scale
)
{
...
...
@@ -1138,10 +1138,10 @@ ChamferMatcher::Match* ChamferMatcher::Matching::localChamferDistance(Point offs
}
ChamferMatcher
::
Matches
*
ChamferMatcher
::
Matching
::
matchTemplates
(
Mat
&
dist_img
,
Mat
&
orientation_img
,
const
ImageRange
&
range
,
float
orientation_weight
)
ChamferMatcher
::
Matches
*
ChamferMatcher
::
Matching
::
matchTemplates
(
Mat
&
dist_img
,
Mat
&
orientation_img
,
const
ImageRange
&
range
,
float
_
orientation_weight
)
{
ChamferMatcher
::
Matches
*
matches
(
new
Matches
());
ChamferMatcher
::
Matches
*
p
matches
(
new
Matches
());
// try each template
for
(
size_t
i
=
0
;
i
<
templates
.
size
();
i
++
)
{
ImageIterator
*
it
=
range
.
iterator
();
...
...
@@ -1156,17 +1156,17 @@ ChamferMatcher::Matches* ChamferMatcher::Matching::matchTemplates(Mat& dist_img,
if
(
loc
.
x
-
tpl
->
center
.
x
<
0
||
loc
.
x
+
tpl
->
size
.
width
/
2
>=
dist_img
.
cols
)
continue
;
if
(
loc
.
y
-
tpl
->
center
.
y
<
0
||
loc
.
y
+
tpl
->
size
.
height
/
2
>=
dist_img
.
rows
)
continue
;
ChamferMatcher
::
Match
*
is
=
localChamferDistance
(
loc
,
dist_img
,
orientation_img
,
tpl
,
orientation_weight
);
ChamferMatcher
::
Match
*
is
=
localChamferDistance
(
loc
,
dist_img
,
orientation_img
,
tpl
,
_
orientation_weight
);
if
(
is
)
{
matches
->
push_back
(
*
is
);
p
matches
->
push_back
(
*
is
);
delete
is
;
}
}
delete
it
;
}
return
matches
;
return
p
matches
;
}
...
...
@@ -1176,7 +1176,8 @@ ChamferMatcher::Matches* ChamferMatcher::Matching::matchTemplates(Mat& dist_img,
* @param edge_img Edge image
* @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
);
...
...
@@ -1203,10 +1204,10 @@ ChamferMatcher::Matches* ChamferMatcher::Matching::matchEdgeImage(Mat& edge_img,
// Template matching
ChamferMatcher
::
Matches
*
matches
=
matchTemplates
(
dist_img
,
ChamferMatcher
::
Matches
*
p
matches
=
matchTemplates
(
dist_img
,
orientation_img
,
range
,
orientation_weight
);
_
orientation_weight
);
if
(
use_orientation_
)
{
...
...
@@ -1215,7 +1216,7 @@ ChamferMatcher::Matches* ChamferMatcher::Matching::matchEdgeImage(Mat& edge_img,
dist_img
.
release
();
annotated_img
.
release
();
return
matches
;
return
p
matches
;
}
...
...
modules/features2d/include/opencv2/features2d/features2d.hpp
View file @
633a8bfa
...
...
@@ -473,7 +473,10 @@ protected:
//! detects corners using FAST algorithm by E. Rosten
CV_EXPORTS
void
FAST
(
InputArray
image
,
CV_OUT
vector
<
KeyPoint
>&
keypoints
,
int
threshold
,
bool
nonmaxSupression
=
true
,
int
type
=
2
);
int
threshold
,
bool
nonmaxSupression
=
true
);
CV_EXPORTS
void
FAST
(
InputArray
image
,
CV_OUT
vector
<
KeyPoint
>&
keypoints
,
int
threshold
,
bool
nonmaxSupression
,
int
type
);
class
CV_EXPORTS_W
FastFeatureDetector
:
public
FeatureDetector
{
...
...
modules/features2d/src/fast.cpp
View file @
633a8bfa
...
...
@@ -578,6 +578,11 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
break
;
}
}
void
FAST
(
InputArray
_img
,
std
::
vector
<
KeyPoint
>&
keypoints
,
int
threshold
,
bool
nonmax_suppression
)
{
FAST
(
_img
,
keypoints
,
threshold
,
nonmax_suppression
,
FastFeatureDetector
::
TYPE_9_16
);
}
/*
* FastFeatureDetector
*/
...
...
modules/gpu/perf/perf_imgproc.cpp
View file @
633a8bfa
...
...
@@ -23,13 +23,13 @@ void generateMap(cv::Mat& map_x, cv::Mat& map_y, int remapMode)
case
HALF_SIZE
:
if
(
i
>
map_x
.
cols
*
0.25
&&
i
<
map_x
.
cols
*
0.75
&&
j
>
map_x
.
rows
*
0.25
&&
j
<
map_x
.
rows
*
0.75
)
{
map_x
.
at
<
float
>
(
j
,
i
)
=
2
*
(
i
-
map_x
.
cols
*
0.25
f
)
+
0.5
f
;
map_y
.
at
<
float
>
(
j
,
i
)
=
2
*
(
j
-
map_x
.
rows
*
0.25
f
)
+
0.5
f
;
map_x
.
at
<
float
>
(
j
,
i
)
=
2
.
f
*
(
i
-
map_x
.
cols
*
0.25
f
)
+
0.5
f
;
map_y
.
at
<
float
>
(
j
,
i
)
=
2
.
f
*
(
j
-
map_x
.
rows
*
0.25
f
)
+
0.5
f
;
}
else
{
map_x
.
at
<
float
>
(
j
,
i
)
=
0
;
map_y
.
at
<
float
>
(
j
,
i
)
=
0
;
map_x
.
at
<
float
>
(
j
,
i
)
=
0
.
f
;
map_y
.
at
<
float
>
(
j
,
i
)
=
0
.
f
;
}
break
;
case
UPSIDE_DOWN
:
...
...
modules/gpu/perf/perf_labeling.cpp
View file @
633a8bfa
...
...
@@ -23,7 +23,7 @@ struct GreedyLabeling
struct
InInterval
{
InInterval
(
const
int
&
_lo
,
const
int
&
_hi
)
:
lo
(
-
_lo
),
hi
(
_hi
)
{}
;
InInterval
(
const
int
&
_lo
,
const
int
&
_hi
)
:
lo
(
-
_lo
),
hi
(
_hi
)
{}
const
int
lo
,
hi
;
bool
operator
()
(
const
unsigned
char
a
,
const
unsigned
char
b
)
const
...
...
modules/highgui/src/cap_ffmpeg_impl.hpp
View file @
633a8bfa
...
...
@@ -2050,7 +2050,7 @@ bool InputMediaStream_FFMPEG::read(unsigned char** data, int* size, int* endOfFi
if
(
ret
<
0
)
{
if
(
ret
==
(
int64_t
)
AVERROR_EOF
)
if
(
(
int64_t
)
ret
==
(
int64_t
)
AVERROR_EOF
)
*
endOfFile
=
true
;
return
false
;
}
...
...
modules/ml/src/tree.cpp
View file @
633a8bfa
...
...
@@ -2069,7 +2069,7 @@ void CvDTree::cluster_categories( const int* vectors, int n, int m,
{
int
sum
=
0
;
const
int
*
v
=
vectors
+
i
*
m
;
labels
[
i
]
=
i
<
k
?
i
:
(
*
r
)(
k
);
labels
[
i
]
=
i
<
k
?
i
:
r
->
uniform
(
0
,
k
);
// compute weight of each vector
for
(
j
=
0
;
j
<
m
;
j
++
)
...
...
modules/objdetect/src/cascadedetect.hpp
View file @
633a8bfa
...
...
@@ -128,20 +128,20 @@ inline HaarEvaluator::Feature :: Feature()
p
[
2
][
0
]
=
p
[
2
][
1
]
=
p
[
2
][
2
]
=
p
[
2
][
3
]
=
0
;
}
inline
float
HaarEvaluator
::
Feature
::
calc
(
int
offset
)
const
inline
float
HaarEvaluator
::
Feature
::
calc
(
int
_
offset
)
const
{
float
ret
=
rect
[
0
].
weight
*
CALC_SUM
(
p
[
0
],
offset
)
+
rect
[
1
].
weight
*
CALC_SUM
(
p
[
1
],
offset
);
float
ret
=
rect
[
0
].
weight
*
CALC_SUM
(
p
[
0
],
_offset
)
+
rect
[
1
].
weight
*
CALC_SUM
(
p
[
1
],
_
offset
);
if
(
rect
[
2
].
weight
!=
0.0
f
)
ret
+=
rect
[
2
].
weight
*
CALC_SUM
(
p
[
2
],
offset
);
ret
+=
rect
[
2
].
weight
*
CALC_SUM
(
p
[
2
],
_
offset
);
return
ret
;
}
inline
void
HaarEvaluator
::
Feature
::
updatePtrs
(
const
Mat
&
sum
)
inline
void
HaarEvaluator
::
Feature
::
updatePtrs
(
const
Mat
&
_
sum
)
{
const
int
*
ptr
=
(
const
int
*
)
sum
.
data
;
size_t
step
=
sum
.
step
/
sizeof
(
ptr
[
0
]);
const
int
*
ptr
=
(
const
int
*
)
_
sum
.
data
;
size_t
step
=
_
sum
.
step
/
sizeof
(
ptr
[
0
]);
if
(
tilted
)
{
CV_TILTED_PTRS
(
p
[
0
][
0
],
p
[
0
][
1
],
p
[
0
][
2
],
p
[
0
][
3
],
ptr
,
rect
[
0
].
r
,
step
);
...
...
@@ -210,24 +210,24 @@ inline LBPEvaluator::Feature :: Feature()
p
[
i
]
=
0
;
}
inline
int
LBPEvaluator
::
Feature
::
calc
(
int
offset
)
const
inline
int
LBPEvaluator
::
Feature
::
calc
(
int
_
offset
)
const
{
int
cval
=
CALC_SUM_
(
p
[
5
],
p
[
6
],
p
[
9
],
p
[
10
],
offset
);
return
(
CALC_SUM_
(
p
[
0
],
p
[
1
],
p
[
4
],
p
[
5
],
offset
)
>=
cval
?
128
:
0
)
|
// 0
(
CALC_SUM_
(
p
[
1
],
p
[
2
],
p
[
5
],
p
[
6
],
offset
)
>=
cval
?
64
:
0
)
|
// 1
(
CALC_SUM_
(
p
[
2
],
p
[
3
],
p
[
6
],
p
[
7
],
offset
)
>=
cval
?
32
:
0
)
|
// 2
(
CALC_SUM_
(
p
[
6
],
p
[
7
],
p
[
10
],
p
[
11
],
offset
)
>=
cval
?
16
:
0
)
|
// 5
(
CALC_SUM_
(
p
[
10
],
p
[
11
],
p
[
14
],
p
[
15
],
offset
)
>=
cval
?
8
:
0
)
|
// 8
(
CALC_SUM_
(
p
[
9
],
p
[
10
],
p
[
13
],
p
[
14
],
offset
)
>=
cval
?
4
:
0
)
|
// 7
(
CALC_SUM_
(
p
[
8
],
p
[
9
],
p
[
12
],
p
[
13
],
offset
)
>=
cval
?
2
:
0
)
|
// 6
(
CALC_SUM_
(
p
[
4
],
p
[
5
],
p
[
8
],
p
[
9
],
offset
)
>=
cval
?
1
:
0
);
int
cval
=
CALC_SUM_
(
p
[
5
],
p
[
6
],
p
[
9
],
p
[
10
],
_
offset
);
return
(
CALC_SUM_
(
p
[
0
],
p
[
1
],
p
[
4
],
p
[
5
],
_
offset
)
>=
cval
?
128
:
0
)
|
// 0
(
CALC_SUM_
(
p
[
1
],
p
[
2
],
p
[
5
],
p
[
6
],
_
offset
)
>=
cval
?
64
:
0
)
|
// 1
(
CALC_SUM_
(
p
[
2
],
p
[
3
],
p
[
6
],
p
[
7
],
_
offset
)
>=
cval
?
32
:
0
)
|
// 2
(
CALC_SUM_
(
p
[
6
],
p
[
7
],
p
[
10
],
p
[
11
],
_
offset
)
>=
cval
?
16
:
0
)
|
// 5
(
CALC_SUM_
(
p
[
10
],
p
[
11
],
p
[
14
],
p
[
15
],
_
offset
)
>=
cval
?
8
:
0
)
|
// 8
(
CALC_SUM_
(
p
[
9
],
p
[
10
],
p
[
13
],
p
[
14
],
_
offset
)
>=
cval
?
4
:
0
)
|
// 7
(
CALC_SUM_
(
p
[
8
],
p
[
9
],
p
[
12
],
p
[
13
],
_
offset
)
>=
cval
?
2
:
0
)
|
// 6
(
CALC_SUM_
(
p
[
4
],
p
[
5
],
p
[
8
],
p
[
9
],
_
offset
)
>=
cval
?
1
:
0
);
}
inline
void
LBPEvaluator
::
Feature
::
updatePtrs
(
const
Mat
&
sum
)
inline
void
LBPEvaluator
::
Feature
::
updatePtrs
(
const
Mat
&
_
sum
)
{
const
int
*
ptr
=
(
const
int
*
)
sum
.
data
;
size_t
step
=
sum
.
step
/
sizeof
(
ptr
[
0
]);
const
int
*
ptr
=
(
const
int
*
)
_
sum
.
data
;
size_t
step
=
_
sum
.
step
/
sizeof
(
ptr
[
0
]);
Rect
tr
=
rect
;
CV_SUM_PTRS
(
p
[
0
],
p
[
1
],
p
[
4
],
p
[
5
],
ptr
,
tr
,
step
);
tr
.
x
+=
2
*
rect
.
width
;
...
...
@@ -292,10 +292,10 @@ inline HOGEvaluator::Feature :: Feature()
featComponent
=
0
;
}
inline
float
HOGEvaluator
::
Feature
::
calc
(
int
offset
)
const
inline
float
HOGEvaluator
::
Feature
::
calc
(
int
_
offset
)
const
{
float
res
=
CALC_SUM
(
pF
,
offset
);
float
normFactor
=
CALC_SUM
(
pN
,
offset
);
float
res
=
CALC_SUM
(
pF
,
_
offset
);
float
normFactor
=
CALC_SUM
(
pN
,
_
offset
);
res
=
(
res
>
0.001
f
)
?
(
res
/
(
normFactor
+
0.001
f
)
)
:
0.
f
;
return
res
;
}
...
...
modules/stitching/src/seam_finders.cpp
View file @
633a8bfa
...
...
@@ -817,7 +817,7 @@ bool DpSeamFinder::estimateSeam(
{
pair
<
float
,
int
>
opt
=
*
min_element
(
steps
,
steps
+
nsteps
);
cost
(
y
,
x
)
=
opt
.
first
;
control
(
y
,
x
)
=
opt
.
second
;
control
(
y
,
x
)
=
(
uchar
)
opt
.
second
;
reachable
(
y
,
x
)
=
255
;
}
}
...
...
@@ -847,7 +847,7 @@ bool DpSeamFinder::estimateSeam(
{
pair
<
float
,
int
>
opt
=
*
min_element
(
steps
,
steps
+
nsteps
);
cost
(
y
,
x
)
=
opt
.
first
;
control
(
y
,
x
)
=
opt
.
second
;
control
(
y
,
x
)
=
(
uchar
)
opt
.
second
;
reachable
(
y
,
x
)
=
255
;
}
}
...
...
modules/video/src/bgfg_gmg.cpp
View file @
633a8bfa
...
...
@@ -269,7 +269,7 @@ namespace
if
(
updateBackgroundModel_
)
{
for
(
int
i
=
0
;
i
<
nfeatures
;
++
i
)
weights
[
i
]
*=
1.0
f
-
learningRate_
;
weights
[
i
]
*=
(
float
)(
1.0
f
-
learningRate_
)
;
bool
inserted
=
insertFeature
(
newFeatureColor
,
(
float
)
learningRate_
,
colors
,
weights
,
nfeatures
,
maxFeatures_
);
...
...
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