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
0a4ed2bc
Commit
0a4ed2bc
authored
Nov 07, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Windows build warnings
parent
4d059e9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
test_mat.cpp
modules/core/test/test_mat.cpp
+4
-4
test_math.cpp
modules/core/test/test_math.cpp
+1
-1
tvl1_optical_flow.cpp
samples/cpp/tvl1_optical_flow.cpp
+5
-5
No files found.
modules/core/test/test_mat.cpp
View file @
0a4ed2bc
...
...
@@ -863,17 +863,17 @@ template <class ElemType>
int
calcDiffElemCountImpl
(
const
vector
<
Mat
>&
mv
,
const
Mat
&
m
)
{
int
diffElemCount
=
0
;
const
size_
t
mChannels
=
m
.
channels
();
const
in
t
mChannels
=
m
.
channels
();
for
(
int
y
=
0
;
y
<
m
.
rows
;
y
++
)
{
for
(
int
x
=
0
;
x
<
m
.
cols
;
x
++
)
{
const
ElemType
*
mElem
=
&
m
.
at
<
ElemType
>
(
y
,
x
*
mChannels
);
size_
t
loc
=
0
;
in
t
loc
=
0
;
for
(
size_t
i
=
0
;
i
<
mv
.
size
();
i
++
)
{
const
size_t
mvChannel
=
mv
[
i
].
channels
();
const
ElemType
*
mvElem
=
&
mv
[
i
].
at
<
ElemType
>
(
y
,
x
*
mvChannel
);
const
ElemType
*
mvElem
=
&
mv
[
i
].
at
<
ElemType
>
(
y
,
x
*
(
int
)
mvChannel
);
for
(
size_t
li
=
0
;
li
<
mvChannel
;
li
++
)
if
(
mElem
[
loc
+
li
]
!=
mvElem
[
li
])
diffElemCount
++
;
...
...
@@ -1020,7 +1020,7 @@ public:
protected
:
virtual
int
run_case
(
int
depth
,
size_t
channels
,
const
Size
&
size
,
RNG
&
rng
)
{
Mat
src
(
size
,
CV_MAKETYPE
(
depth
,
channels
));
Mat
src
(
size
,
CV_MAKETYPE
(
depth
,
(
int
)
channels
));
rng
.
fill
(
src
,
RNG
::
UNIFORM
,
0
,
100
,
true
);
vector
<
Mat
>
dst
;
...
...
modules/core/test/test_math.cpp
View file @
0a4ed2bc
...
...
@@ -2421,7 +2421,7 @@ protected:
}
Mat
diff
=
abs
(
anglesInDegrees
-
resInDeg
);
in
t
errDegCount
=
diff
.
total
()
-
countNonZero
((
diff
<
maxAngleDiff
)
|
((
360
-
diff
)
<
maxAngleDiff
));
size_
t
errDegCount
=
diff
.
total
()
-
countNonZero
((
diff
<
maxAngleDiff
)
|
((
360
-
diff
)
<
maxAngleDiff
));
if
(
errDegCount
>
0
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"There are incorrect result angles (in degrees) (part of them is %f)
\n
"
,
...
...
samples/cpp/tvl1_optical_flow.cpp
View file @
0a4ed2bc
...
...
@@ -55,7 +55,7 @@ static Vec3b computeColor(float fx, float fy)
}
const
float
rad
=
sqrt
(
fx
*
fx
+
fy
*
fy
);
const
float
a
=
atan2
(
-
fy
,
-
fx
)
/
CV_PI
;
const
float
a
=
atan2
(
-
fy
,
-
fx
)
/
(
float
)
CV_PI
;
const
float
fk
=
(
a
+
1.0
f
)
/
2.0
f
*
(
NCOLS
-
1
);
const
int
k0
=
static_cast
<
int
>
(
fk
);
...
...
@@ -66,8 +66,8 @@ static Vec3b computeColor(float fx, float fy)
for
(
int
b
=
0
;
b
<
3
;
b
++
)
{
const
float
col0
=
colorWheel
[
k0
][
b
]
/
255.
0
;
const
float
col1
=
colorWheel
[
k1
][
b
]
/
255.
0
;
const
float
col0
=
colorWheel
[
k0
][
b
]
/
255.
f
;
const
float
col1
=
colorWheel
[
k1
][
b
]
/
255.
f
;
float
col
=
(
1
-
f
)
*
col0
+
f
*
col1
;
...
...
@@ -76,7 +76,7 @@ static Vec3b computeColor(float fx, float fy)
else
col
*=
.75
;
// out of range
pix
[
2
-
b
]
=
static_cast
<
int
>
(
255.0
*
col
);
pix
[
2
-
b
]
=
static_cast
<
uchar
>
(
255.
f
*
col
);
}
return
pix
;
...
...
@@ -175,7 +175,7 @@ int main(int argc, const char* argv[])
Mat_
<
Point2f
>
flow
;
OpticalFlowDual_TVL1
tvl1
;
const
double
start
=
getTickCount
();
const
double
start
=
(
double
)
getTickCount
();
tvl1
(
frame0
,
frame1
,
flow
);
const
double
timeSec
=
(
getTickCount
()
-
start
)
/
getTickFrequency
();
cout
<<
"calcOpticalFlowDual_TVL1 : "
<<
timeSec
<<
" sec"
<<
endl
;
...
...
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