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
7a5c1bab
Commit
7a5c1bab
authored
Feb 27, 2014
by
Alexander Alekhin
Committed by
Andrey Pavlenko
Apr 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TAPI: stitching: optimize exposure
parent
2737e3c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
exposure_compensate.hpp
.../include/opencv2/stitching/detail/exposure_compensate.hpp
+1
-1
exposure_compensate.cpp
modules/stitching/src/exposure_compensate.cpp
+14
-11
No files found.
modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp
View file @
7a5c1bab
...
...
@@ -97,7 +97,7 @@ public:
private
:
int
bl_width_
,
bl_height_
;
std
::
vector
<
Mat_
<
float
>
>
gain_maps_
;
std
::
vector
<
UMat
>
gain_maps_
;
};
}
// namespace detail
...
...
modules/stitching/src/exposure_compensate.cpp
View file @
7a5c1bab
...
...
@@ -208,11 +208,14 @@ void BlocksGainCompensator::feed(const std::vector<Point> &corners, const std::v
for
(
int
img_idx
=
0
;
img_idx
<
num_images
;
++
img_idx
)
{
Size
bl_per_img
=
bl_per_imgs
[
img_idx
];
gain_maps_
[
img_idx
].
create
(
bl_per_img
);
gain_maps_
[
img_idx
].
create
(
bl_per_img
,
CV_32F
);
for
(
int
by
=
0
;
by
<
bl_per_img
.
height
;
++
by
)
for
(
int
bx
=
0
;
bx
<
bl_per_img
.
width
;
++
bx
,
++
bl_idx
)
gain_maps_
[
img_idx
](
by
,
bx
)
=
static_cast
<
float
>
(
gains
[
bl_idx
]);
{
Mat_
<
float
>
gain_map
=
gain_maps_
[
img_idx
].
getMat
(
ACCESS_WRITE
);
for
(
int
by
=
0
;
by
<
bl_per_img
.
height
;
++
by
)
for
(
int
bx
=
0
;
bx
<
bl_per_img
.
width
;
++
bx
,
++
bl_idx
)
gain_map
(
by
,
bx
)
=
static_cast
<
float
>
(
gains
[
bl_idx
]);
}
sepFilter2D
(
gain_maps_
[
img_idx
],
gain_maps_
[
img_idx
],
CV_32F
,
ker
,
ker
);
sepFilter2D
(
gain_maps_
[
img_idx
],
gain_maps_
[
img_idx
],
CV_32F
,
ker
,
ker
);
...
...
@@ -222,16 +225,16 @@ void BlocksGainCompensator::feed(const std::vector<Point> &corners, const std::v
void
BlocksGainCompensator
::
apply
(
int
index
,
Point
/*corner*/
,
InputOutputArray
_image
,
InputArray
/*mask*/
)
{
Mat
image
=
_image
.
getMat
();
CV_Assert
(
image
.
type
()
==
CV_8UC3
);
CV_Assert
(
_image
.
type
()
==
CV_8UC3
);
Mat_
<
float
>
gain_map
;
if
(
gain_maps_
[
index
].
size
()
==
image
.
size
())
gain_map
=
gain_maps_
[
index
];
UMat
u_
gain_map
;
if
(
gain_maps_
[
index
].
size
()
==
_
image
.
size
())
u_
gain_map
=
gain_maps_
[
index
];
else
resize
(
gain_maps_
[
index
],
gain_map
,
image
.
size
(),
0
,
0
,
INTER_LINEAR
);
resize
(
gain_maps_
[
index
],
u_gain_map
,
_
image
.
size
(),
0
,
0
,
INTER_LINEAR
);
Mat_
<
float
>
gain_map
=
u_gain_map
.
getMat
(
ACCESS_READ
);
Mat
image
=
_image
.
getMat
();
for
(
int
y
=
0
;
y
<
image
.
rows
;
++
y
)
{
const
float
*
gain_row
=
gain_map
.
ptr
<
float
>
(
y
);
...
...
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