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
27eb5d07
Commit
27eb5d07
authored
Aug 13, 2012
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added getScale/setScale for image warpers (stitching module)
parent
87737c20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
23 deletions
+32
-23
warpers.hpp
...es/stitching/include/opencv2/stitching/detail/warpers.hpp
+15
-12
stitcher.hpp
modules/stitching/include/opencv2/stitching/stitcher.hpp
+13
-9
CMakeLists.txt
samples/cpp/CMakeLists.txt
+4
-2
No files found.
modules/stitching/include/opencv2/stitching/detail/warpers.hpp
View file @
27eb5d07
...
...
@@ -65,11 +65,13 @@ public:
virtual
Point
warp
(
const
Mat
&
src
,
const
Mat
&
K
,
const
Mat
&
R
,
int
interp_mode
,
int
border_mode
,
Mat
&
dst
)
=
0
;
// TODO add other backward functions for consistency or move this into a separated interface
virtual
void
warpBackward
(
const
Mat
&
src
,
const
Mat
&
K
,
const
Mat
&
R
,
int
interp_mode
,
int
border_mode
,
Size
dst_size
,
Mat
&
dst
)
=
0
;
virtual
Rect
warpRoi
(
Size
src_size
,
const
Mat
&
K
,
const
Mat
&
R
)
=
0
;
virtual
float
getScale
()
const
{
return
1.
f
;
}
virtual
void
setScale
(
float
)
{}
};
...
...
@@ -104,6 +106,9 @@ public:
Rect
warpRoi
(
Size
src_size
,
const
Mat
&
K
,
const
Mat
&
R
);
float
getScale
()
const
{
return
projector_
.
scale
;
}
void
setScale
(
float
val
)
{
projector_
.
scale
=
val
;
}
protected
:
// Detects ROI of the destination image. It's correct for any projection.
...
...
@@ -129,8 +134,6 @@ class CV_EXPORTS PlaneWarper : public RotationWarperBase<PlaneProjector>
public
:
PlaneWarper
(
float
scale
=
1.
f
)
{
projector_
.
scale
=
scale
;
}
void
setScale
(
float
scale
)
{
projector_
.
scale
=
scale
;
}
Point2f
warpPoint
(
const
Point2f
&
pt
,
const
Mat
&
K
,
const
Mat
&
R
,
const
Mat
&
T
);
Rect
buildMaps
(
Size
src_size
,
const
Mat
&
K
,
const
Mat
&
R
,
const
Mat
&
T
,
Mat
&
xmap
,
Mat
&
ymap
);
...
...
@@ -225,12 +228,12 @@ struct CV_EXPORTS CompressedRectilinearProjector : ProjectorBase
class
CV_EXPORTS
CompressedRectilinearWarper
:
public
RotationWarperBase
<
CompressedRectilinearProjector
>
{
public
:
CompressedRectilinearWarper
(
float
scale
,
float
A
=
1
,
float
B
=
1
)
{
projector_
.
a
=
A
;
projector_
.
b
=
B
;
projector_
.
scale
=
scale
;
}
CompressedRectilinearWarper
(
float
scale
,
float
A
=
1
,
float
B
=
1
)
{
projector_
.
a
=
A
;
projector_
.
b
=
B
;
projector_
.
scale
=
scale
;
}
};
...
...
@@ -250,7 +253,7 @@ public:
{
projector_
.
a
=
A
;
projector_
.
b
=
B
;
projector_
.
scale
=
scale
;
projector_
.
scale
=
scale
;
}
};
...
...
@@ -271,7 +274,7 @@ public:
{
projector_
.
a
=
A
;
projector_
.
b
=
B
;
projector_
.
scale
=
scale
;
projector_
.
scale
=
scale
;
}
};
...
...
@@ -292,7 +295,7 @@ public:
{
projector_
.
a
=
A
;
projector_
.
b
=
B
;
projector_
.
scale
=
scale
;
projector_
.
scale
=
scale
;
}
};
...
...
modules/stitching/include/opencv2/stitching/stitcher.hpp
View file @
27eb5d07
...
...
@@ -64,15 +64,6 @@ public:
// Creates stitcher with default parameters
static
Stitcher
createDefault
(
bool
try_use_gpu
=
false
);
Status
estimateTransform
(
InputArray
images
);
Status
estimateTransform
(
InputArray
images
,
const
std
::
vector
<
std
::
vector
<
Rect
>
>
&
rois
);
Status
composePanorama
(
OutputArray
pano
);
Status
composePanorama
(
InputArray
images
,
OutputArray
pano
);
Status
stitch
(
InputArray
images
,
OutputArray
pano
);
Status
stitch
(
InputArray
images
,
const
std
::
vector
<
std
::
vector
<
Rect
>
>
&
rois
,
OutputArray
pano
);
double
registrationResol
()
const
{
return
registr_resol_
;
}
void
setRegistrationResol
(
double
resol_mpx
)
{
registr_resol_
=
resol_mpx
;
}
...
...
@@ -130,6 +121,19 @@ public:
const
Ptr
<
detail
::
Blender
>
blender
()
const
{
return
blender_
;
}
void
setBlender
(
Ptr
<
detail
::
Blender
>
b
)
{
blender_
=
b
;
}
Status
estimateTransform
(
InputArray
images
);
Status
estimateTransform
(
InputArray
images
,
const
std
::
vector
<
std
::
vector
<
Rect
>
>
&
rois
);
Status
composePanorama
(
OutputArray
pano
);
Status
composePanorama
(
InputArray
images
,
OutputArray
pano
);
Status
stitch
(
InputArray
images
,
OutputArray
pano
);
Status
stitch
(
InputArray
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_
;
}
private
:
Stitcher
()
{}
...
...
samples/cpp/CMakeLists.txt
View file @
27eb5d07
...
...
@@ -5,13 +5,15 @@
SET
(
OPENCV_CPP_SAMPLES_REQUIRED_DEPS opencv_core opencv_flann opencv_imgproc
opencv_highgui opencv_ml opencv_video opencv_objdetect opencv_photo opencv_nonfree
opencv_features2d opencv_calib3d opencv_legacy opencv_contrib opencv_stitching opencv_videostab
)
opencv_features2d opencv_calib3d opencv_legacy opencv_contrib opencv_stitching opencv_videostab
opencv_core_vision_api
)
ocv_check_dependencies
(
${
OPENCV_CPP_SAMPLES_REQUIRED_DEPS
}
)
add_definitions
(
-DENABLE_LOG
)
if
(
BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND
)
project
(
c
pp
_samples
)
project
(
c
ore_vision_api
_samples
)
ocv_include_directories
(
"
${
OpenCV_SOURCE_DIR
}
/include"
)
#for opencv.hpp
ocv_include_modules
(
${
OPENCV_CPP_SAMPLES_REQUIRED_DEPS
}
)
...
...
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