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
4a299acd
Commit
4a299acd
authored
Feb 24, 2012
by
Leonid Beynenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added PlanePortraitWarper class.
parent
216d75cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
warpers.hpp
...es/stitching/include/opencv2/stitching/detail/warpers.hpp
+18
-0
warpers_inl.hpp
...titching/include/opencv2/stitching/detail/warpers_inl.hpp
+42
-0
No files found.
modules/stitching/include/opencv2/stitching/detail/warpers.hpp
View file @
4a299acd
...
...
@@ -342,6 +342,24 @@ protected:
}
};
struct
PlanePortraitProjector
:
ProjectorBase
{
void
mapForward
(
float
x
,
float
y
,
float
&
u
,
float
&
v
);
void
mapBackward
(
float
u
,
float
v
,
float
&
x
,
float
&
y
);
};
class
PlanePortraitWarper
:
public
RotationWarperBase
<
PlanePortraitProjector
>
{
public
:
PlanePortraitWarper
(
float
scale
)
{
projector_
.
scale
=
scale
;
}
protected
:
void
detectResultRoi
(
Size
src_size
,
Point
&
dst_tl
,
Point
&
dst_br
)
{
RotationWarperBase
<
PlanePortraitProjector
>::
detectResultRoiByBorder
(
src_size
,
dst_tl
,
dst_br
);
}
};
}
// namespace detail
}
// namespace cv
...
...
modules/stitching/include/opencv2/stitching/detail/warpers_inl.hpp
View file @
4a299acd
...
...
@@ -389,6 +389,48 @@ void CylindricalPortraitProjector::mapBackward(float u0, float v0, float &x, flo
else
x
=
y
=
-
1
;
}
inline
void
PlanePortraitProjector
::
mapForward
(
float
x
,
float
y
,
float
&
u0
,
float
&
v0
)
{
float
x0_
=
r_kinv
[
0
]
*
x
+
r_kinv
[
1
]
*
y
+
r_kinv
[
2
];
float
y0_
=
r_kinv
[
3
]
*
x
+
r_kinv
[
4
]
*
y
+
r_kinv
[
5
];
float
z_
=
r_kinv
[
6
]
*
x
+
r_kinv
[
7
]
*
y
+
r_kinv
[
8
];
float
x_
=
y0_
;
float
y_
=
x0_
;
x_
=
t
[
0
]
+
x_
/
z_
*
(
1
-
t
[
2
]);
y_
=
t
[
1
]
+
y_
/
z_
*
(
1
-
t
[
2
]);
float
u
,
v
;
u
=
scale
*
x_
;
v
=
scale
*
y_
;
u0
=
-
u
;
v0
=
v
;
}
inline
void
PlanePortraitProjector
::
mapBackward
(
float
u0
,
float
v0
,
float
&
x
,
float
&
y
)
{
float
u
,
v
;
u
=
-
u0
;
v
=
v0
;
u
=
u
/
scale
-
t
[
0
];
v
=
v
/
scale
-
t
[
1
];
float
z
;
x
=
k_rinv
[
0
]
*
v
+
k_rinv
[
1
]
*
u
+
k_rinv
[
2
]
*
(
1
-
t
[
2
]);
y
=
k_rinv
[
3
]
*
v
+
k_rinv
[
4
]
*
u
+
k_rinv
[
5
]
*
(
1
-
t
[
2
]);
z
=
k_rinv
[
6
]
*
v
+
k_rinv
[
7
]
*
u
+
k_rinv
[
8
]
*
(
1
-
t
[
2
]);
x
/=
z
;
y
/=
z
;
}
}
// namespace detail
}
// namespace cv
...
...
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