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
797143d5
Commit
797143d5
authored
Aug 20, 2014
by
abidrahmank
Committed by
Alexander Smorkalov
Sep 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extending stitching module for Java and Python bindings
parent
f187fd99
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
16 deletions
+67
-16
cv2.cpp
modules/python/src2/cv2.cpp
+7
-0
stitching.hpp
modules/stitching/include/opencv2/stitching.hpp
+19
-16
stitcher.cpp
modules/stitching/src/stitcher.cpp
+41
-0
No files found.
modules/python/src2/cv2.cpp
View file @
797143d5
...
...
@@ -114,6 +114,7 @@ typedef SimpleBlobDetector::Params SimpleBlobDetector_Params;
typedef
cvflann
::
flann_distance_t
cvflann_flann_distance_t
;
typedef
cvflann
::
flann_algorithm_t
cvflann_flann_algorithm_t
;
typedef
Stitcher
::
Status
Status
;
static
PyObject
*
failmsgp
(
const
char
*
fmt
,
...)
{
...
...
@@ -444,6 +445,12 @@ PyObject* pyopencv_from(const bool& value)
return
PyBool_FromLong
(
value
);
}
template
<>
PyObject
*
pyopencv_from
(
const
Status
&
value
)
{
return
PyInt_FromLong
(
value
);
}
template
<>
bool
pyopencv_to
(
PyObject
*
obj
,
bool
&
value
,
const
char
*
name
)
{
...
...
modules/stitching/include/opencv2/stitching.hpp
View file @
797143d5
...
...
@@ -55,7 +55,7 @@
namespace
cv
{
class
CV_EXPORTS
Stitcher
class
CV_EXPORTS
_W
Stitcher
{
public
:
enum
{
ORIG_RESOL
=
-
1
};
...
...
@@ -67,23 +67,24 @@ public:
ERR_CAMERA_PARAMS_ADJUST_FAIL
=
3
};
// Stitcher() {}
// Creates stitcher with default parameters
static
Stitcher
createDefault
(
bool
try_use_gpu
=
false
);
double
registrationResol
()
const
{
return
registr_resol_
;
}
void
setRegistrationResol
(
double
resol_mpx
)
{
registr_resol_
=
resol_mpx
;
}
CV_WRAP
double
registrationResol
()
const
{
return
registr_resol_
;
}
CV_WRAP
void
setRegistrationResol
(
double
resol_mpx
)
{
registr_resol_
=
resol_mpx
;
}
double
seamEstimationResol
()
const
{
return
seam_est_resol_
;
}
void
setSeamEstimationResol
(
double
resol_mpx
)
{
seam_est_resol_
=
resol_mpx
;
}
CV_WRAP
double
seamEstimationResol
()
const
{
return
seam_est_resol_
;
}
CV_WRAP
void
setSeamEstimationResol
(
double
resol_mpx
)
{
seam_est_resol_
=
resol_mpx
;
}
double
compositingResol
()
const
{
return
compose_resol_
;
}
void
setCompositingResol
(
double
resol_mpx
)
{
compose_resol_
=
resol_mpx
;
}
CV_WRAP
double
compositingResol
()
const
{
return
compose_resol_
;
}
CV_WRAP
void
setCompositingResol
(
double
resol_mpx
)
{
compose_resol_
=
resol_mpx
;
}
double
panoConfidenceThresh
()
const
{
return
conf_thresh_
;
}
void
setPanoConfidenceThresh
(
double
conf_thresh
)
{
conf_thresh_
=
conf_thresh
;
}
CV_WRAP
double
panoConfidenceThresh
()
const
{
return
conf_thresh_
;
}
CV_WRAP
void
setPanoConfidenceThresh
(
double
conf_thresh
)
{
conf_thresh_
=
conf_thresh
;
}
bool
waveCorrection
()
const
{
return
do_wave_correct_
;
}
void
setWaveCorrection
(
bool
flag
)
{
do_wave_correct_
=
flag
;
}
CV_WRAP
bool
waveCorrection
()
const
{
return
do_wave_correct_
;
}
CV_WRAP
void
setWaveCorrection
(
bool
flag
)
{
do_wave_correct_
=
flag
;
}
detail
::
WaveCorrectKind
waveCorrectKind
()
const
{
return
wave_correct_kind_
;
}
void
setWaveCorrectKind
(
detail
::
WaveCorrectKind
kind
)
{
wave_correct_kind_
=
kind
;
}
...
...
@@ -127,21 +128,21 @@ public:
const
Ptr
<
detail
::
Blender
>
blender
()
const
{
return
blender_
;
}
void
setBlender
(
Ptr
<
detail
::
Blender
>
b
)
{
blender_
=
b
;
}
Status
estimateTransform
(
InputArrayOfArrays
images
);
CV_WRAP
Status
estimateTransform
(
InputArrayOfArrays
images
);
Status
estimateTransform
(
InputArrayOfArrays
images
,
const
std
::
vector
<
std
::
vector
<
Rect
>
>
&
rois
);
Status
composePanorama
(
OutputArray
pano
);
CV_WRAP
Status
composePanorama
(
OutputArray
pano
);
Status
composePanorama
(
InputArrayOfArrays
images
,
OutputArray
pano
);
Status
stitch
(
InputArrayOfArrays
images
,
OutputArray
pano
);
CV_WRAP
Status
stitch
(
InputArrayOfArrays
images
,
OutputArray
pano
);
Status
stitch
(
InputArrayOfArrays
images
,
const
std
::
vector
<
std
::
vector
<
Rect
>
>
&
rois
,
OutputArray
pano
);
std
::
vector
<
int
>
component
()
const
{
return
indices_
;
}
std
::
vector
<
detail
::
CameraParams
>
cameras
()
const
{
return
cameras_
;
}
double
workScale
()
const
{
return
work_scale_
;
}
CV_WRAP
double
workScale
()
const
{
return
work_scale_
;
}
private
:
Stitcher
()
{}
//
Stitcher() {}
Status
matchImages
();
Status
estimateCameraParams
();
...
...
@@ -175,6 +176,8 @@ private:
double
warped_image_scale_
;
};
CV_EXPORTS_W
Ptr
<
Stitcher
>
createStitcher
(
bool
try_use_gpu
=
false
);
}
// namespace cv
#endif // __OPENCV_STITCHING_STITCHER_HPP__
modules/stitching/src/stitcher.cpp
View file @
797143d5
...
...
@@ -531,4 +531,45 @@ Stitcher::Status Stitcher::estimateCameraParams()
return
OK
;
}
Ptr
<
Stitcher
>
createStitcher
(
bool
try_use_gpu
)
{
Ptr
<
Stitcher
>
stitcher
=
makePtr
<
Stitcher
>
();
stitcher
->
setRegistrationResol
(
0.6
);
stitcher
->
setSeamEstimationResol
(
0.1
);
stitcher
->
setCompositingResol
(
Stitcher
::
ORIG_RESOL
);
stitcher
->
setPanoConfidenceThresh
(
1
);
stitcher
->
setWaveCorrection
(
true
);
stitcher
->
setWaveCorrectKind
(
detail
::
WAVE_CORRECT_HORIZ
);
stitcher
->
setFeaturesMatcher
(
makePtr
<
detail
::
BestOf2NearestMatcher
>
(
try_use_gpu
));
stitcher
->
setBundleAdjuster
(
makePtr
<
detail
::
BundleAdjusterRay
>
());
#ifdef HAVE_OPENCV_CUDA
if
(
try_use_gpu
&&
cuda
::
getCudaEnabledDeviceCount
()
>
0
)
{
#ifdef HAVE_OPENCV_NONFREE
stitcher
->
setFeaturesFinder
(
makePtr
<
detail
::
SurfFeaturesFinderGpu
>
());
#else
stitcher
->
setFeaturesFinder
(
makePtr
<
detail
::
OrbFeaturesFinder
>
());
#endif
stitcher
->
setWarper
(
makePtr
<
SphericalWarperGpu
>
());
stitcher
->
setSeamFinder
(
makePtr
<
detail
::
GraphCutSeamFinderGpu
>
());
}
else
#endif
{
#ifdef HAVE_OPENCV_NONFREE
stitcher
->
setFeaturesFinder
(
makePtr
<
detail
::
SurfFeaturesFinder
>
());
#else
stitcher
->
setFeaturesFinder
(
makePtr
<
detail
::
OrbFeaturesFinder
>
());
#endif
stitcher
->
setWarper
(
makePtr
<
SphericalWarper
>
());
stitcher
->
setSeamFinder
(
makePtr
<
detail
::
GraphCutSeamFinder
>
(
detail
::
GraphCutSeamFinderBase
::
COST_COLOR
));
}
stitcher
->
setExposureCompensator
(
makePtr
<
detail
::
BlocksGainCompensator
>
());
stitcher
->
setBlender
(
makePtr
<
detail
::
MultiBandBlender
>
(
try_use_gpu
));
return
stitcher
;
}
}
// 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