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
c4fe9897
Commit
c4fe9897
authored
Jun 10, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implementation of * operator for Affine3f and point3d, initial implementation of isNaN
parent
c622ebf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
types.hpp
modules/viz/include/opencv2/viz/types.hpp
+16
-0
types.cpp
modules/viz/src/types.cpp
+10
-0
No files found.
modules/viz/include/opencv2/viz/types.hpp
View file @
c4fe9897
#pragma once
#include <vector>
#include <boost/concept_check.hpp>
#include <opencv2/core/cvdef.h>
#include <opencv2/core.hpp>
#include <opencv2/core/affine.hpp>
...
...
@@ -84,4 +85,19 @@ namespace temp_viz
inline
Vec3d
vtkpoint
(
const
Point3f
&
point
)
{
return
Vec3d
(
point
.
x
,
point
.
y
,
point
.
z
);
}
template
<
typename
_Tp
>
inline
_Tp
normalized
(
const
_Tp
&
v
)
{
return
v
*
1
/
cv
::
norm
(
v
);
}
Point3d
operator
*
(
const
Affine3f
&
affine
,
const
Point3d
&
point
);
inline
bool
isNaN
(
float
x
)
{
union
{
float
f
;
unsigned
int
u
;
}
v
=
{
x
};
return
((
v
.
u
&
0x7f800000
)
==
0x7f800000
)
&&
(
v
.
u
&
0x007fffff
);
}
inline
bool
isNaN
(
double
x
)
{
union
{
double
d
;
unsigned
int
u
[
2
];
}
v
=
{
x
};
return
(
v
.
u
[
1
]
&
0x7ff00000
)
==
0x7ff00000
&&
(
v
.
u
[
0
]
!=
0
||
(
v
.
u
[
1
]
&
0x000fffff
)
!=
0
);
}
}
modules/viz/src/types.cpp
View file @
c4fe9897
...
...
@@ -22,3 +22,12 @@ temp_viz::Color temp_viz::Color::white() { return Color(255, 255, 255); }
temp_viz
::
Color
temp_viz
::
Color
::
gray
()
{
return
Color
(
128
,
128
,
128
);
}
temp_viz
::
Point3d
temp_viz
::
operator
*
(
const
temp_viz
::
Affine3f
&
affine
,
const
temp_viz
::
Point3d
&
point
)
{
const
temp_viz
::
Matx44f
&
m
=
affine
.
matrix
;
temp_viz
::
Point3d
result
;
result
.
x
=
m
.
val
[
0
]
*
point
.
x
+
m
.
val
[
1
]
*
point
.
y
+
m
.
val
[
2
]
*
point
.
z
+
m
.
val
[
3
];
result
.
y
=
m
.
val
[
4
]
*
point
.
x
+
m
.
val
[
5
]
*
point
.
y
+
m
.
val
[
6
]
*
point
.
z
+
m
.
val
[
7
];
result
.
z
=
m
.
val
[
8
]
*
point
.
x
+
m
.
val
[
9
]
*
point
.
y
+
m
.
val
[
10
]
*
point
.
z
+
m
.
val
[
11
];
return
result
;
}
\ No newline at end of file
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