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
505e8e09
Commit
505e8e09
authored
Sep 07, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor refactoring of stitching
parent
c9a41c68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
39 deletions
+27
-39
stitching.cpp
samples/cpp/stitching.cpp
+27
-31
stitching_detailed.cpp
samples/cpp/stitching_detailed.cpp
+0
-8
No files found.
samples/cpp/stitching.cpp
View file @
505e8e09
...
...
@@ -40,14 +40,6 @@
//
//M*/
// We follow to these papers:
// 1) Construction of panoramic mosaics with global and local alignment.
// Heung-Yeung Shum and Richard Szeliski. 2000.
// 2) Eliminating Ghosting and Exposure Artifacts in Image Mosaics.
// Matthew Uyttendaele, Ashley Eden and Richard Szeliski. 2001.
// 3) Automatic Panoramic Image Stitching using Invariant Features.
// Matthew Brown and David G. Lowe. 2007.
#include <iostream>
#include <fstream>
#include "opencv2/highgui/highgui.hpp"
...
...
@@ -56,6 +48,33 @@
using
namespace
std
;
using
namespace
cv
;
bool
try_use_gpu
=
false
;
vector
<
Mat
>
imgs
;
string
result_name
=
"result.jpg"
;
void
printUsage
();
int
parseCmdArgs
(
int
argc
,
char
**
argv
);
int
main
(
int
argc
,
char
*
argv
[])
{
int
retval
=
parseCmdArgs
(
argc
,
argv
);
if
(
retval
)
return
-
1
;
Mat
pano
;
Stitcher
stitcher
=
Stitcher
::
createDefault
(
try_use_gpu
);
Stitcher
::
Status
status
=
stitcher
.
stitch
(
imgs
,
pano
);
if
(
status
!=
Stitcher
::
OK
)
{
cout
<<
"Can't stitch images, error code = "
<<
status
<<
endl
;
return
-
1
;
}
imwrite
(
result_name
,
pano
);
return
0
;
}
void
printUsage
()
{
cout
<<
...
...
@@ -69,9 +88,6 @@ void printUsage()
" The default is 'result.jpg'.
\n
"
;
}
bool
try_use_gpu
=
false
;
vector
<
Mat
>
imgs
;
string
result_name
=
"result.jpg"
;
int
parseCmdArgs
(
int
argc
,
char
**
argv
)
{
...
...
@@ -120,23 +136,3 @@ int parseCmdArgs(int argc, char** argv)
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
retval
=
parseCmdArgs
(
argc
,
argv
);
if
(
retval
)
return
-
1
;
Mat
pano
;
Stitcher
stitcher
=
Stitcher
::
createDefault
(
try_use_gpu
);
Stitcher
::
Status
status
=
stitcher
.
stitch
(
imgs
,
pano
);
if
(
status
!=
Stitcher
::
OK
)
{
cout
<<
"Can't stitch images, error code = "
<<
status
<<
endl
;
return
-
1
;
}
imwrite
(
result_name
,
pano
);
return
0
;
}
samples/cpp/stitching_detailed.cpp
View file @
505e8e09
...
...
@@ -40,14 +40,6 @@
//
//M*/
// We follow to these papers:
// 1) Construction of panoramic mosaics with global and local alignment.
// Heung-Yeung Shum and Richard Szeliski. 2000.
// 2) Eliminating Ghosting and Exposure Artifacts in Image Mosaics.
// Matthew Uyttendaele, Ashley Eden and Richard Szeliski. 2001.
// 3) Automatic Panoramic Image Stitching using Invariant Features.
// Matthew Brown and David G. Lowe. 2007.
#include <fstream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/stitching/detail/autocalib.hpp"
...
...
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