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
7222f272
Commit
7222f272
authored
Aug 06, 2012
by
alexey.spizhevoy
Committed by
Alexey Spizhevoy
Aug 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug
parent
85d1c463
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
seam_finders.hpp
...itching/include/opencv2/stitching/detail/seam_finders.hpp
+3
-3
seam_finders.cpp
modules/stitching/src/seam_finders.cpp
+5
-2
No files found.
modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp
View file @
7222f272
...
@@ -103,6 +103,9 @@ public:
...
@@ -103,6 +103,9 @@ public:
CostFunction
costFunction
()
const
{
return
costFunc_
;
}
CostFunction
costFunction
()
const
{
return
costFunc_
;
}
void
setCostFunction
(
CostFunction
val
)
{
costFunc_
=
val
;
}
void
setCostFunction
(
CostFunction
val
)
{
costFunc_
=
val
;
}
virtual
void
find
(
const
std
::
vector
<
Mat
>
&
src
,
const
std
::
vector
<
Point
>
&
corners
,
std
::
vector
<
Mat
>
&
masks
);
private
:
private
:
enum
ComponentState
enum
ComponentState
{
{
...
@@ -150,9 +153,6 @@ private:
...
@@ -150,9 +153,6 @@ private:
int
minDist_
;
int
minDist_
;
};
};
virtual
void
find
(
const
std
::
vector
<
Mat
>
&
src
,
const
std
::
vector
<
Point
>
&
corners
,
std
::
vector
<
Mat
>
&
masks
);
void
process
(
const
Mat
&
image1
,
const
Mat
&
image2
,
Point
tl1
,
Point
tl2
,
void
process
(
const
Mat
&
image1
,
const
Mat
&
image2
,
Point
tl1
,
Point
tl2
,
Mat
&
mask1
,
Mat
&
mask2
);
Mat
&
mask1
,
Mat
&
mask2
);
...
...
modules/stitching/src/seam_finders.cpp
View file @
7222f272
...
@@ -189,6 +189,9 @@ void DpSeamFinder::process(
...
@@ -189,6 +189,9 @@ void DpSeamFinder::process(
const
Mat
&
image1
,
const
Mat
&
image2
,
Point
tl1
,
Point
tl2
,
const
Mat
&
image1
,
const
Mat
&
image2
,
Point
tl1
,
Point
tl2
,
Mat
&
mask1
,
Mat
&
mask2
)
Mat
&
mask1
,
Mat
&
mask2
)
{
{
CV_Assert
(
image1
.
size
()
==
mask1
.
size
());
CV_Assert
(
image2
.
size
()
==
mask2
.
size
());
Point
intersectTl
(
std
::
max
(
tl1
.
x
,
tl2
.
x
),
std
::
max
(
tl1
.
y
,
tl2
.
y
));
Point
intersectTl
(
std
::
max
(
tl1
.
x
,
tl2
.
x
),
std
::
max
(
tl1
.
y
,
tl2
.
y
));
Point
intersectBr
(
std
::
min
(
tl1
.
x
+
image1
.
cols
,
tl2
.
x
+
image2
.
cols
),
Point
intersectBr
(
std
::
min
(
tl1
.
x
+
image1
.
cols
,
tl2
.
x
+
image2
.
cols
),
...
@@ -489,7 +492,7 @@ void DpSeamFinder::resolveConflicts(const Mat &image1, const Mat &image2,
...
@@ -489,7 +492,7 @@ void DpSeamFinder::resolveConflicts(const Mat &image1, const Mat &image2,
for
(
int
x
=
0
;
x
<
mask2
.
cols
;
++
x
)
for
(
int
x
=
0
;
x
<
mask2
.
cols
;
++
x
)
{
{
int
l
=
labels_
(
y
-
dy2
,
x
-
dx2
);
int
l
=
labels_
(
y
-
dy2
,
x
-
dx2
);
if
((
states_
[
l
-
1
]
&
FIRST
)
&&
mask1
.
at
<
uchar
>
(
y
-
dy2
+
dy1
,
x
-
dx2
+
dx1
))
if
(
l
>
0
&&
(
states_
[
l
-
1
]
&
FIRST
)
&&
mask1
.
at
<
uchar
>
(
y
-
dy2
+
dy1
,
x
-
dx2
+
dx1
))
mask2
.
at
<
uchar
>
(
y
,
x
)
=
0
;
mask2
.
at
<
uchar
>
(
y
,
x
)
=
0
;
}
}
}
}
...
@@ -499,7 +502,7 @@ void DpSeamFinder::resolveConflicts(const Mat &image1, const Mat &image2,
...
@@ -499,7 +502,7 @@ void DpSeamFinder::resolveConflicts(const Mat &image1, const Mat &image2,
for
(
int
x
=
0
;
x
<
mask1
.
cols
;
++
x
)
for
(
int
x
=
0
;
x
<
mask1
.
cols
;
++
x
)
{
{
int
l
=
labels_
(
y
-
dy1
,
x
-
dx1
);
int
l
=
labels_
(
y
-
dy1
,
x
-
dx1
);
if
((
states_
[
l
-
1
]
&
SECOND
)
&&
mask2
.
at
<
uchar
>
(
y
-
dy1
+
dy2
,
x
-
dx1
+
dx2
))
if
(
l
>
0
&&
(
states_
[
l
-
1
]
&
SECOND
)
&&
mask2
.
at
<
uchar
>
(
y
-
dy1
+
dy2
,
x
-
dx1
+
dx2
))
mask1
.
at
<
uchar
>
(
y
,
x
)
=
0
;
mask1
.
at
<
uchar
>
(
y
,
x
)
=
0
;
}
}
}
}
...
...
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