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
3bb685a7
Commit
3bb685a7
authored
May 23, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes in opencv_stitching
parent
47443d98
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
blenders.cpp
modules/stitching/blenders.cpp
+18
-11
main.cpp
modules/stitching/main.cpp
+1
-1
No files found.
modules/stitching/blenders.cpp
View file @
3bb685a7
...
...
@@ -185,13 +185,16 @@ void MultiBandBlender::feed(const Mat &img, const Mat &mask, Point tl)
CV_Assert
(
img
.
type
()
==
CV_16SC3
);
CV_Assert
(
mask
.
type
()
==
CV_8U
);
int
top
=
tl
.
y
-
dst_roi_
.
y
;
int
left
=
tl
.
x
-
dst_roi_
.
x
;
int
bottom
=
dst_roi_
.
br
().
y
-
tl
.
y
-
img
.
rows
;
int
right
=
dst_roi_
.
br
().
x
-
tl
.
x
-
img
.
cols
;
Point
tl_new
(
dst_roi_
.
tl
());
Point
br_new
(
dst_roi_
.
br
());
int
top
=
tl
.
y
-
tl_new
.
y
;
int
left
=
tl
.
x
-
tl_new
.
x
;
int
bottom
=
br_new
.
y
-
tl
.
y
-
img
.
rows
;
int
right
=
br_new
.
x
-
tl
.
x
-
img
.
cols
;
// Create the source image Laplacian pyramid
vector
<
Mat
>
src_pyr_gauss
(
num_bands_
+
1
);
src_pyr_gauss
[
0
]
=
img
;
copyMakeBorder
(
img
,
src_pyr_gauss
[
0
],
top
,
bottom
,
left
,
right
,
BORDER_REFLECT
);
for
(
int
i
=
0
;
i
<
num_bands_
;
++
i
)
...
...
@@ -212,21 +215,25 @@ void MultiBandBlender::feed(const Mat &img, const Mat &mask, Point tl)
// Add weighted layer of the source image to the final Laplacian pyramid layer
for
(
int
i
=
0
;
i
<=
num_bands_
;
++
i
)
{
for
(
int
y
=
0
;
y
<
dst_pyr_laplace_
[
i
].
rows
;
++
y
)
int
dx
=
0
;
//(tl_new.x >> i) - (dst_roi_.x >> i);
int
dy
=
0
;
//(tl_new.y >> i) - (dst_roi_.y >> i);
for
(
int
y
=
0
;
y
<
src_pyr_laplace
[
i
].
rows
;
++
y
)
{
const
Point3_
<
short
>*
src_row
=
src_pyr_laplace
[
i
].
ptr
<
Point3_
<
short
>
>
(
y
);
Point3_
<
short
>*
dst_row
=
dst_pyr_laplace_
[
i
].
ptr
<
Point3_
<
short
>
>
(
y
);
Point3_
<
short
>*
dst_row
=
dst_pyr_laplace_
[
i
].
ptr
<
Point3_
<
short
>
>
(
y
+
dy
);
const
float
*
weight_row
=
weight_pyr_gauss
[
i
].
ptr
<
float
>
(
y
);
float
*
dst_weight_row
=
dst_band_weights_
[
i
].
ptr
<
float
>
(
y
+
dy
);
for
(
int
x
=
0
;
x
<
dst_pyr_laplace_
[
i
].
cols
;
++
x
)
for
(
int
x
=
0
;
x
<
src_pyr_laplace
[
i
].
cols
;
++
x
)
{
dst_row
[
x
].
x
+=
static_cast
<
short
>
(
src_row
[
x
].
x
*
weight_row
[
x
]);
dst_row
[
x
].
y
+=
static_cast
<
short
>
(
src_row
[
x
].
y
*
weight_row
[
x
]);
dst_row
[
x
].
z
+=
static_cast
<
short
>
(
src_row
[
x
].
z
*
weight_row
[
x
]);
dst_row
[
x
+
dx
].
x
+=
static_cast
<
short
>
(
src_row
[
x
].
x
*
weight_row
[
x
]);
dst_row
[
x
+
dx
].
y
+=
static_cast
<
short
>
(
src_row
[
x
].
y
*
weight_row
[
x
]);
dst_row
[
x
+
dx
].
z
+=
static_cast
<
short
>
(
src_row
[
x
].
z
*
weight_row
[
x
]);
dst_weight_row
[
x
+
dx
]
+=
weight_row
[
x
];
}
}
dst_band_weights_
[
i
]
+=
weight_pyr_gauss
[
i
];
}
}
...
...
modules/stitching/main.cpp
View file @
3bb685a7
...
...
@@ -78,7 +78,7 @@ vector<string> img_names;
bool
trygpu
=
false
;
double
work_megapix
=
0.3
;
double
seam_megapix
=
0.1
;
double
compose_megapix
=
6
;
double
compose_megapix
=
1
;
int
ba_space
=
BundleAdjuster
::
FOCAL_RAY_SPACE
;
float
conf_thresh
=
1.
f
;
bool
wave_correct
=
true
;
...
...
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