Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LMS
FishUI
Commits
bffc89f2
Commit
bffc89f2
authored
Jun 18, 2020
by
Andy Regensky
Browse files
Adapt fisheye fov 180 boundary dynamically to current projection
parent
eac6761c
Changes
2
Hide whitespace changes
Inline
Side-by-side
fishui/MainViewModel.py
View file @
bffc89f2
...
...
@@ -29,6 +29,7 @@ class MainViewModel(QObject):
self
.
samples_per_edge
=
100
self
.
projection
=
None
self
.
perspective
=
None
self
.
fov_180_radius
=
None
self
.
block_xf
=
None
self
.
block_yf
=
None
self
.
block_xp
=
None
...
...
@@ -90,6 +91,7 @@ class MainViewModel(QObject):
focal_length_px
=
projections
.
Projection
.
to_focal_length_px
(
self
.
focal_length_mm
,
self
.
sensor_size_mm
,
self
.
sensor_size_px
)
self
.
projection
=
self
.
projection_cls
(
focal_length_px
)
self
.
perspective
=
projections
.
PerspectiveProjection
(
focal_length_px
)
self
.
fov_180_radius
=
self
.
projection
.
radius
(
np
.
deg2rad
(
90
))
self
.
blockSignals
(
True
)
self
.
updateFisheyeBlockpoints
()
self
.
updatePerspectiveBlockpoints
()
...
...
fishui/widgets/FisheyeBlockWidget.py
View file @
bffc89f2
...
...
@@ -52,7 +52,14 @@ class FisheyeBlockWidget(QWidget):
pen
.
setColor
(
QColor
(
0
,
0
,
0
))
pen
.
setWidth
(
painter
.
window
().
width
()
/
200
)
painter
.
setPen
(
pen
)
painter
.
drawEllipse
(
painter
.
window
())
painter
.
drawEllipse
(
QRect
(
(
self
.
viewModel
.
sensor_size_px
[
1
]
-
1
)
/
2
-
self
.
viewModel
.
fov_180_radius
,
(
self
.
viewModel
.
sensor_size_px
[
0
]
-
1
)
/
2
-
self
.
viewModel
.
fov_180_radius
,
2
*
self
.
viewModel
.
fov_180_radius
,
2
*
self
.
viewModel
.
fov_180_radius
)
)
def
drawPolygons
(
self
,
event
,
painter
):
color
=
QColor
(
255
,
127
,
14
)
...
...
Write
Preview
Supports
Markdown
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