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
b661d722
Commit
b661d722
authored
Jul 25, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CameraPositionWidget: a workaround for setting frustum color in the presence of an image
parent
ec756afe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+1
-1
shape_widgets.cpp
modules/viz/src/shape_widgets.cpp
+6
-1
No files found.
modules/viz/include/opencv2/viz/widgets.hpp
View file @
b661d722
...
@@ -173,7 +173,7 @@ namespace cv
...
@@ -173,7 +173,7 @@ namespace cv
CameraPositionWidget
(
const
Vec3f
&
position
,
const
Vec3f
&
look_at
,
const
Vec3f
&
up_vector
,
double
scale
=
1.0
);
CameraPositionWidget
(
const
Vec3f
&
position
,
const
Vec3f
&
look_at
,
const
Vec3f
&
up_vector
,
double
scale
=
1.0
);
CameraPositionWidget
(
const
Matx33f
&
K
,
double
scale
=
1.0
,
const
Color
&
color
=
Color
::
white
());
CameraPositionWidget
(
const
Matx33f
&
K
,
double
scale
=
1.0
,
const
Color
&
color
=
Color
::
white
());
CameraPositionWidget
(
const
Vec2f
&
fov
,
double
scale
=
1.0
,
const
Color
&
color
=
Color
::
white
());
CameraPositionWidget
(
const
Vec2f
&
fov
,
double
scale
=
1.0
,
const
Color
&
color
=
Color
::
white
());
CameraPositionWidget
(
const
Matx33f
&
K
,
const
Mat
&
img
,
double
scale
=
1.0
);
CameraPositionWidget
(
const
Matx33f
&
K
,
const
Mat
&
img
,
double
scale
=
1.0
,
const
Color
&
color
=
Color
::
white
()
);
};
};
...
...
modules/viz/src/shape_widgets.cpp
View file @
b661d722
...
@@ -1031,7 +1031,7 @@ cv::viz::CameraPositionWidget::CameraPositionWidget(const Vec2f &fov, double sca
...
@@ -1031,7 +1031,7 @@ cv::viz::CameraPositionWidget::CameraPositionWidget(const Vec2f &fov, double sca
setColor
(
color
);
setColor
(
color
);
}
}
cv
::
viz
::
CameraPositionWidget
::
CameraPositionWidget
(
const
Matx33f
&
K
,
const
Mat
&
image
,
double
scale
)
cv
::
viz
::
CameraPositionWidget
::
CameraPositionWidget
(
const
Matx33f
&
K
,
const
Mat
&
image
,
double
scale
,
const
Color
&
color
)
{
{
CV_Assert
(
!
image
.
empty
()
&&
image
.
depth
()
==
CV_8U
);
CV_Assert
(
!
image
.
empty
()
&&
image
.
depth
()
==
CV_8U
);
...
@@ -1049,6 +1049,11 @@ cv::viz::CameraPositionWidget::CameraPositionWidget(const Matx33f &K, const Mat
...
@@ -1049,6 +1049,11 @@ cv::viz::CameraPositionWidget::CameraPositionWidget(const Matx33f &K, const Mat
vtkSmartPointer
<
vtkImageData
>
vtk_image
=
vtkSmartPointer
<
vtkImageData
>::
New
();
vtkSmartPointer
<
vtkImageData
>
vtk_image
=
vtkSmartPointer
<
vtkImageData
>::
New
();
ConvertToVtkImage
::
convert
(
image
,
vtk_image
);
ConvertToVtkImage
::
convert
(
image
,
vtk_image
);
// Adjust a pixel of the vtk_image
vtk_image
->
SetScalarComponentFromDouble
(
0
,
image
.
rows
-
1
,
0
,
0
,
color
[
2
]);
vtk_image
->
SetScalarComponentFromDouble
(
0
,
image
.
rows
-
1
,
0
,
1
,
color
[
1
]);
vtk_image
->
SetScalarComponentFromDouble
(
0
,
image
.
rows
-
1
,
0
,
2
,
color
[
0
]);
// Need to flip the image as the coordinates are different in OpenCV and VTK
// Need to flip the image as the coordinates are different in OpenCV and VTK
vtkSmartPointer
<
vtkImageFlip
>
flipFilter
=
vtkSmartPointer
<
vtkImageFlip
>::
New
();
vtkSmartPointer
<
vtkImageFlip
>
flipFilter
=
vtkSmartPointer
<
vtkImageFlip
>::
New
();
flipFilter
->
SetFilteredAxis
(
1
);
// Vertical flip
flipFilter
->
SetFilteredAxis
(
1
);
// Vertical flip
...
...
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