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
651b13f7
Commit
651b13f7
authored
May 19, 2014
by
Ilya Krylov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored class Fisheye to namespace fisheye
parent
c30fef1f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
37 deletions
+35
-37
calib3d.hpp
modules/calib3d/include/opencv2/calib3d/calib3d.hpp
+12
-14
fisheye.cpp
modules/calib3d/src/fisheye.cpp
+23
-23
test_fisheye.cpp
modules/calib3d/test/test_fisheye.cpp
+0
-0
No files found.
modules/calib3d/include/opencv2/calib3d/calib3d.hpp
View file @
651b13f7
...
...
@@ -745,10 +745,8 @@ CV_EXPORTS_W int estimateAffine3D(InputArray src, InputArray dst,
OutputArray
out
,
OutputArray
inliers
,
double
ransacThreshold
=
3
,
double
confidence
=
0.99
);
class
CV_EXPORTS
F
isheye
namespace
f
isheye
{
public
:
enum
{
CALIB_USE_INTRINSIC_GUESS
=
1
,
CALIB_RECOMPUTE_EXTRINSIC
=
2
,
...
...
@@ -762,50 +760,50 @@ public:
};
//! projects 3D points using fisheye model
static
void
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
const
Affine3d
&
affine
,
CV_EXPORTS
void
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
const
Affine3d
&
affine
,
InputArray
K
,
InputArray
D
,
double
alpha
=
0
,
OutputArray
jacobian
=
noArray
());
//! projects points using fisheye model
static
void
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
InputArray
rvec
,
InputArray
tvec
,
CV_EXPORTS
void
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
InputArray
rvec
,
InputArray
tvec
,
InputArray
K
,
InputArray
D
,
double
alpha
=
0
,
OutputArray
jacobian
=
noArray
());
//! distorts 2D points using fisheye model
static
void
distortPoints
(
InputArray
undistorted
,
OutputArray
distorted
,
InputArray
K
,
InputArray
D
,
double
alpha
=
0
);
CV_EXPORTS
void
distortPoints
(
InputArray
undistorted
,
OutputArray
distorted
,
InputArray
K
,
InputArray
D
,
double
alpha
=
0
);
//! undistorts 2D points using fisheye model
static
void
undistortPoints
(
InputArray
distorted
,
OutputArray
undistorted
,
CV_EXPORTS
void
undistortPoints
(
InputArray
distorted
,
OutputArray
undistorted
,
InputArray
K
,
InputArray
D
,
InputArray
R
=
noArray
(),
InputArray
P
=
noArray
());
//! computing undistortion and rectification maps for image transform by cv::remap()
//! If D is empty zero distortion is used, if R or P is empty identity matrixes are used
static
void
initUndistortRectifyMap
(
InputArray
K
,
InputArray
D
,
InputArray
R
,
InputArray
P
,
CV_EXPORTS
void
initUndistortRectifyMap
(
InputArray
K
,
InputArray
D
,
InputArray
R
,
InputArray
P
,
const
cv
::
Size
&
size
,
int
m1type
,
OutputArray
map1
,
OutputArray
map2
);
//! undistorts image, optionally changes resolution and camera matrix. If Knew zero identity matrix is used
static
void
undistortImage
(
InputArray
distorted
,
OutputArray
undistorted
,
CV_EXPORTS
void
undistortImage
(
InputArray
distorted
,
OutputArray
undistorted
,
InputArray
K
,
InputArray
D
,
InputArray
Knew
=
cv
::
noArray
(),
const
Size
&
new_size
=
Size
());
//! estimates new camera matrix for undistortion or rectification
static
void
estimateNewCameraMatrixForUndistortRectify
(
InputArray
K
,
InputArray
D
,
const
Size
&
image_size
,
InputArray
R
,
CV_EXPORTS
void
estimateNewCameraMatrixForUndistortRectify
(
InputArray
K
,
InputArray
D
,
const
Size
&
image_size
,
InputArray
R
,
OutputArray
P
,
double
balance
=
0.0
,
const
Size
&
new_size
=
Size
(),
double
fov_scale
=
1.0
);
//! performs camera calibaration
static
double
calibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints
,
const
Size
&
image_size
,
CV_EXPORTS
double
calibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints
,
const
Size
&
image_size
,
InputOutputArray
K
,
InputOutputArray
D
,
OutputArrayOfArrays
rvecs
,
OutputArrayOfArrays
tvecs
,
int
flags
=
0
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
100
,
DBL_EPSILON
));
//! stereo rectification estimation
static
void
stereoRectify
(
InputArray
K1
,
InputArray
D1
,
InputArray
K2
,
InputArray
D2
,
const
Size
&
imageSize
,
InputArray
R
,
InputArray
tvec
,
CV_EXPORTS
void
stereoRectify
(
InputArray
K1
,
InputArray
D1
,
InputArray
K2
,
InputArray
D2
,
const
Size
&
imageSize
,
InputArray
R
,
InputArray
tvec
,
OutputArray
R1
,
OutputArray
R2
,
OutputArray
P1
,
OutputArray
P2
,
OutputArray
Q
,
int
flags
,
const
Size
&
newImageSize
=
Size
(),
double
balance
=
0.0
,
double
fov_scale
=
1.0
);
//! performs stereo calibaration
static
double
stereoCalibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints1
,
InputArrayOfArrays
imagePoints2
,
CV_EXPORTS
double
stereoCalibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints1
,
InputArrayOfArrays
imagePoints2
,
InputOutputArray
K1
,
InputOutputArray
D1
,
InputOutputArray
K2
,
InputOutputArray
D2
,
Size
imageSize
,
OutputArray
R
,
OutputArray
T
,
int
flags
=
CALIB_FIX_INTRINSIC
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
100
,
DBL_EPSILON
));
}
;
}
}
...
...
modules/calib3d/src/fisheye.cpp
View file @
651b13f7
...
...
@@ -14,15 +14,15 @@ namespace cv { namespace
}}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::projectPoints
/// cv::
f
isheye::projectPoints
void
cv
::
F
isheye
::
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
const
Affine3d
&
affine
,
void
cv
::
f
isheye
::
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
const
Affine3d
&
affine
,
InputArray
K
,
InputArray
D
,
double
alpha
,
OutputArray
jacobian
)
{
projectPoints
(
objectPoints
,
imagePoints
,
affine
.
rvec
(),
affine
.
translation
(),
K
,
D
,
alpha
,
jacobian
);
}
void
cv
::
F
isheye
::
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
InputArray
_rvec
,
void
cv
::
f
isheye
::
projectPoints
(
InputArray
objectPoints
,
OutputArray
imagePoints
,
InputArray
_rvec
,
InputArray
_tvec
,
InputArray
_K
,
InputArray
_D
,
double
alpha
,
OutputArray
jacobian
)
{
// will support only 3-channel data now for points
...
...
@@ -202,9 +202,9 @@ void cv::Fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::distortPoints
/// cv::
f
isheye::distortPoints
void
cv
::
F
isheye
::
distortPoints
(
InputArray
undistorted
,
OutputArray
distorted
,
InputArray
K
,
InputArray
D
,
double
alpha
)
void
cv
::
f
isheye
::
distortPoints
(
InputArray
undistorted
,
OutputArray
distorted
,
InputArray
K
,
InputArray
D
,
double
alpha
)
{
// will support only 2-channel data now for points
CV_Assert
(
undistorted
.
type
()
==
CV_32FC2
||
undistorted
.
type
()
==
CV_64FC2
);
...
...
@@ -264,9 +264,9 @@ void cv::Fisheye::distortPoints(InputArray undistorted, OutputArray distorted, I
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::undistortPoints
/// cv::
f
isheye::undistortPoints
void
cv
::
F
isheye
::
undistortPoints
(
InputArray
distorted
,
OutputArray
undistorted
,
InputArray
_K
,
InputArray
_D
,
InputArray
_R
,
InputArray
_P
)
void
cv
::
f
isheye
::
undistortPoints
(
InputArray
distorted
,
OutputArray
undistorted
,
InputArray
_K
,
InputArray
_D
,
InputArray
_R
,
InputArray
_P
)
{
// will support only 2-channel data now for points
CV_Assert
(
distorted
.
type
()
==
CV_32FC2
||
distorted
.
type
()
==
CV_64FC2
);
...
...
@@ -353,9 +353,9 @@ void cv::Fisheye::undistortPoints( InputArray distorted, OutputArray undistorted
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::undistortPoints
/// cv::
f
isheye::undistortPoints
void
cv
::
F
isheye
::
initUndistortRectifyMap
(
InputArray
_K
,
InputArray
_D
,
InputArray
_R
,
InputArray
_P
,
void
cv
::
f
isheye
::
initUndistortRectifyMap
(
InputArray
_K
,
InputArray
_D
,
InputArray
_R
,
InputArray
_P
,
const
cv
::
Size
&
size
,
int
m1type
,
OutputArray
map1
,
OutputArray
map2
)
{
CV_Assert
(
m1type
==
CV_16SC2
||
m1type
==
CV_32F
||
m1type
<=
0
);
...
...
@@ -449,23 +449,23 @@ void cv::Fisheye::initUndistortRectifyMap( InputArray _K, InputArray _D, InputAr
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::undistortImage
/// cv::
f
isheye::undistortImage
void
cv
::
F
isheye
::
undistortImage
(
InputArray
distorted
,
OutputArray
undistorted
,
void
cv
::
f
isheye
::
undistortImage
(
InputArray
distorted
,
OutputArray
undistorted
,
InputArray
K
,
InputArray
D
,
InputArray
Knew
,
const
Size
&
new_size
)
{
Size
size
=
new_size
.
area
()
!=
0
?
new_size
:
distorted
.
size
();
cv
::
Mat
map1
,
map2
;
initUndistortRectifyMap
(
K
,
D
,
cv
::
Matx33d
::
eye
(),
Knew
,
size
,
CV_16SC2
,
map1
,
map2
);
fisheye
::
initUndistortRectifyMap
(
K
,
D
,
cv
::
Matx33d
::
eye
(),
Knew
,
size
,
CV_16SC2
,
map1
,
map2
);
cv
::
remap
(
distorted
,
undistorted
,
map1
,
map2
,
INTER_LINEAR
,
BORDER_CONSTANT
);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::estimateNewCameraMatrixForUndistortRectify
/// cv::
f
isheye::estimateNewCameraMatrixForUndistortRectify
void
cv
::
F
isheye
::
estimateNewCameraMatrixForUndistortRectify
(
InputArray
K
,
InputArray
D
,
const
Size
&
image_size
,
InputArray
R
,
void
cv
::
f
isheye
::
estimateNewCameraMatrixForUndistortRectify
(
InputArray
K
,
InputArray
D
,
const
Size
&
image_size
,
InputArray
R
,
OutputArray
P
,
double
balance
,
const
Size
&
new_size
,
double
fov_scale
)
{
CV_Assert
(
K
.
size
()
==
Size
(
3
,
3
)
&&
(
K
.
depth
()
==
CV_32F
||
K
.
depth
()
==
CV_64F
));
...
...
@@ -495,7 +495,7 @@ void cv::Fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, Input
}
#endif
undistortPoints
(
points
,
points
,
K
,
D
,
R
);
fisheye
::
undistortPoints
(
points
,
points
,
K
,
D
,
R
);
cv
::
Scalar
center_mass
=
mean
(
points
);
cv
::
Vec2d
cn
(
center_mass
.
val
);
...
...
@@ -560,9 +560,9 @@ void cv::Fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, Input
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::stereoRectify
/// cv::
f
isheye::stereoRectify
void
cv
::
F
isheye
::
stereoRectify
(
InputArray
K1
,
InputArray
D1
,
InputArray
K2
,
InputArray
D2
,
const
Size
&
imageSize
,
void
cv
::
f
isheye
::
stereoRectify
(
InputArray
K1
,
InputArray
D1
,
InputArray
K2
,
InputArray
D2
,
const
Size
&
imageSize
,
InputArray
_R
,
InputArray
_tvec
,
OutputArray
R1
,
OutputArray
R2
,
OutputArray
P1
,
OutputArray
P2
,
OutputArray
Q
,
int
flags
,
const
Size
&
newImageSize
,
double
balance
,
double
fov_scale
)
{
...
...
@@ -642,9 +642,9 @@ void cv::Fisheye::stereoRectify( InputArray K1, InputArray D1, InputArray K2, In
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::calibrate
/// cv::
f
isheye::calibrate
double
cv
::
F
isheye
::
calibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints
,
const
Size
&
image_size
,
double
cv
::
f
isheye
::
calibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints
,
const
Size
&
image_size
,
InputOutputArray
K
,
InputOutputArray
D
,
OutputArrayOfArrays
rvecs
,
OutputArrayOfArrays
tvecs
,
int
flags
,
cv
::
TermCriteria
criteria
)
{
...
...
@@ -758,9 +758,9 @@ double cv::Fisheye::calibrate(InputArrayOfArrays objectPoints, InputArrayOfArray
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// cv::
F
isheye::stereoCalibrate
/// cv::
f
isheye::stereoCalibrate
double
cv
::
F
isheye
::
stereoCalibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints1
,
InputArrayOfArrays
imagePoints2
,
double
cv
::
f
isheye
::
stereoCalibrate
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints1
,
InputArrayOfArrays
imagePoints2
,
InputOutputArray
K1
,
InputOutputArray
D1
,
InputOutputArray
K2
,
InputOutputArray
D2
,
Size
imageSize
,
OutputArray
R
,
OutputArray
T
,
int
flags
,
TermCriteria
criteria
)
{
...
...
@@ -1094,7 +1094,7 @@ void cv::internal::projectPoints(cv::InputArray objectPoints, cv::OutputArray im
Matx33d
K
(
param
.
f
[
0
],
param
.
f
[
0
]
*
param
.
alpha
,
param
.
c
[
0
],
0
,
param
.
f
[
1
],
param
.
c
[
1
],
0
,
0
,
1
);
F
isheye
::
projectPoints
(
objectPoints
,
imagePoints
,
_rvec
,
_tvec
,
K
,
param
.
k
,
param
.
alpha
,
jacobian
);
f
isheye
::
projectPoints
(
objectPoints
,
imagePoints
,
_rvec
,
_tvec
,
K
,
param
.
k
,
param
.
alpha
,
jacobian
);
}
void
cv
::
internal
::
ComputeExtrinsicRefine
(
const
Mat
&
imagePoints
,
const
Mat
&
objectPoints
,
Mat
&
rvec
,
...
...
@@ -1251,7 +1251,7 @@ cv::Mat cv::internal::NormalizePixels(const Mat& imagePoints, const IntrinsicPar
ptr_d
[
i
]
=
(
ptr
[
i
]
-
param
.
c
).
mul
(
Vec2d
(
1.0
/
param
.
f
[
0
],
1.0
/
param
.
f
[
1
]));
ptr_d
[
i
][
0
]
=
ptr_d
[
i
][
0
]
-
param
.
alpha
*
ptr_d
[
i
][
1
];
}
cv
::
F
isheye
::
undistortPoints
(
distorted
,
undistorted
,
Matx33d
::
eye
(),
param
.
k
);
cv
::
f
isheye
::
undistortPoints
(
distorted
,
undistorted
,
Matx33d
::
eye
(),
param
.
k
);
return
undistorted
;
}
...
...
modules/calib3d/test/test_fisheye.cpp
View file @
651b13f7
This diff is collapsed.
Click to expand it.
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