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
b632f95f
Commit
b632f95f
authored
Sep 09, 2016
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7133 from sovrasov:interactive_calibration_update
parents
a9ab8698
d5603caa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
90 deletions
+16
-90
CMakeLists.txt
apps/interactive-calibration/CMakeLists.txt
+0
-9
calibCommon.hpp
apps/interactive-calibration/calibCommon.hpp
+1
-1
cvCalibrationFork.cpp
apps/interactive-calibration/cvCalibrationFork.cpp
+0
-0
cvCalibrationFork.hpp
apps/interactive-calibration/cvCalibrationFork.hpp
+0
-56
linalg.cpp
apps/interactive-calibration/linalg.cpp
+0
-0
linalg.hpp
apps/interactive-calibration/linalg.hpp
+0
-13
main.cpp
apps/interactive-calibration/main.cpp
+15
-11
No files found.
apps/interactive-calibration/CMakeLists.txt
View file @
b632f95f
...
...
@@ -5,15 +5,6 @@ if(NOT OCV_DEPENDENCIES_FOUND)
return
()
endif
()
find_package
(
LAPACK
)
if
(
LAPACK_FOUND
)
find_file
(
LAPACK_HEADER
"lapacke.h"
)
if
(
LAPACK_HEADER
)
add_definitions
(
-DUSE_LAPACK
)
link_libraries
(
${
LAPACK_LIBRARIES
}
)
endif
()
endif
()
project
(
interactive-calibration
)
set
(
the_target opencv_interactive-calibration
)
...
...
apps/interactive-calibration/calibCommon.hpp
View file @
b632f95f
...
...
@@ -23,7 +23,7 @@ namespace calib
static
const
std
::
string
consoleHelp
=
"Hot keys:
\n
esc - exit application
\n
"
"s - save current data to .xml file
\n
"
"r - delete last frame
\n
"
"u - enable/disable applying undistortion"
"u - enable/disable applying undistortion
\n
"
"d - delete all frames
\n
"
"v - switch visualization"
;
...
...
apps/interactive-calibration/cvCalibrationFork.cpp
deleted
100644 → 0
View file @
a9ab8698
This diff is collapsed.
Click to expand it.
apps/interactive-calibration/cvCalibrationFork.hpp
deleted
100644 → 0
View file @
a9ab8698
#ifndef CV_CALIBRATION_FORK_HPP
#define CV_CALIBRATION_FORK_HPP
#include <opencv2/core.hpp>
#include <opencv2/aruco/charuco.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/calib3d/calib3d_c.h>
namespace
cvfork
{
using
namespace
cv
;
#define CV_CALIB_NINTRINSIC 18
#define CALIB_USE_QR (1 << 18)
double
calibrateCamera
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints
,
Size
imageSize
,
InputOutputArray
cameraMatrix
,
InputOutputArray
distCoeffs
,
OutputArrayOfArrays
rvecs
,
OutputArrayOfArrays
tvecs
,
OutputArray
stdDeviations
,
OutputArray
perViewErrors
,
int
flags
=
0
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
30
,
DBL_EPSILON
)
);
double
cvCalibrateCamera2
(
const
CvMat
*
object_points
,
const
CvMat
*
image_points
,
const
CvMat
*
point_counts
,
CvSize
image_size
,
CvMat
*
camera_matrix
,
CvMat
*
distortion_coeffs
,
CvMat
*
rotation_vectors
CV_DEFAULT
(
NULL
),
CvMat
*
translation_vectors
CV_DEFAULT
(
NULL
),
CvMat
*
stdDeviations_vector
CV_DEFAULT
(
NULL
),
CvMat
*
perViewErrors_vector
CV_DEFAULT
(
NULL
),
int
flags
CV_DEFAULT
(
0
),
CvTermCriteria
term_crit
CV_DEFAULT
(
cvTermCriteria
(
CV_TERMCRIT_ITER
+
CV_TERMCRIT_EPS
,
30
,
DBL_EPSILON
))
);
double
calibrateCameraCharuco
(
InputArrayOfArrays
_charucoCorners
,
InputArrayOfArrays
_charucoIds
,
Ptr
<
aruco
::
CharucoBoard
>
&
_board
,
Size
imageSize
,
InputOutputArray
_cameraMatrix
,
InputOutputArray
_distCoeffs
,
OutputArrayOfArrays
_rvecs
,
OutputArrayOfArrays
_tvecs
,
OutputArray
_stdDeviations
,
OutputArray
_perViewErrors
,
int
flags
=
0
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
30
,
DBL_EPSILON
)
);
class
CvLevMarqFork
:
public
CvLevMarq
{
public
:
CvLevMarqFork
(
int
nparams
,
int
nerrs
,
CvTermCriteria
criteria
=
cvTermCriteria
(
CV_TERMCRIT_EPS
+
CV_TERMCRIT_ITER
,
30
,
DBL_EPSILON
),
bool
completeSymmFlag
=
false
);
bool
updateAlt
(
const
CvMat
*&
_param
,
CvMat
*&
_JtJ
,
CvMat
*&
_JtErr
,
double
*&
_errNorm
);
void
step
();
~
CvLevMarqFork
();
};
}
#endif
apps/interactive-calibration/linalg.cpp
deleted
100644 → 0
View file @
a9ab8698
This diff is collapsed.
Click to expand it.
apps/interactive-calibration/linalg.hpp
deleted
100644 → 0
View file @
a9ab8698
#ifndef LINALG_HPP
#define LINALG_HPP
#include <opencv2/core.hpp>
namespace
cvfork
{
double
invert
(
cv
::
InputArray
_src
,
cv
::
OutputArray
_dst
,
int
method
);
bool
solve
(
cv
::
InputArray
_src
,
cv
::
InputArray
_src2arg
,
cv
::
OutputArray
_dst
,
int
method
);
}
#endif
apps/interactive-calibration/main.cpp
View file @
b632f95f
...
...
@@ -12,7 +12,6 @@
#include "calibCommon.hpp"
#include "calibPipeline.hpp"
#include "frameProcessor.hpp"
#include "cvCalibrationFork.hpp"
#include "calibController.hpp"
#include "parametersController.hpp"
#include "rotationConverters.hpp"
...
...
@@ -106,7 +105,7 @@ int main(int argc, char** argv)
if
(
!
parser
.
has
(
"v"
))
globalData
->
imageSize
=
capParams
.
cameraResolution
;
int
calibrationFlags
=
0
;
if
(
intParams
.
fastSolving
)
calibrationFlags
|=
CALIB_USE_QR
;
if
(
intParams
.
fastSolving
)
calibrationFlags
|=
cv
::
CALIB_USE_QR
;
cv
::
Ptr
<
calibController
>
controller
(
new
calibController
(
globalData
,
calibrationFlags
,
parser
.
get
<
bool
>
(
"ft"
),
capParams
.
minFramesNum
));
cv
::
Ptr
<
calibDataController
>
dataController
(
new
calibDataController
(
globalData
,
capParams
.
maxFramesNum
,
...
...
@@ -131,11 +130,16 @@ int main(int argc, char** argv)
cv
::
namedWindow
(
mainWindowName
);
cv
::
moveWindow
(
mainWindowName
,
10
,
10
);
#ifdef HAVE_QT
cv
::
createButton
(
"Delete last frame"
,
deleteButton
,
&
dataController
,
cv
::
QT_PUSH_BUTTON
);
cv
::
createButton
(
"Delete all frames"
,
deleteAllButton
,
&
dataController
,
cv
::
QT_PUSH_BUTTON
);
cv
::
createButton
(
"Undistort"
,
undistortButton
,
&
showProcessor
,
cv
::
QT_CHECKBOX
,
false
);
cv
::
createButton
(
"Save current parameters"
,
saveCurrentParamsButton
,
&
dataController
,
cv
::
QT_PUSH_BUTTON
);
cv
::
createButton
(
"Switch visualisation mode"
,
switchVisualizationModeButton
,
&
showProcessor
,
cv
::
QT_PUSH_BUTTON
);
cv
::
createButton
(
"Delete last frame"
,
deleteButton
,
&
dataController
,
cv
::
QT_PUSH_BUTTON
|
cv
::
QT_NEW_BUTTONBAR
);
cv
::
createButton
(
"Delete all frames"
,
deleteAllButton
,
&
dataController
,
cv
::
QT_PUSH_BUTTON
|
cv
::
QT_NEW_BUTTONBAR
);
cv
::
createButton
(
"Undistort"
,
undistortButton
,
&
showProcessor
,
cv
::
QT_CHECKBOX
|
cv
::
QT_NEW_BUTTONBAR
,
false
);
cv
::
createButton
(
"Save current parameters"
,
saveCurrentParamsButton
,
&
dataController
,
cv
::
QT_PUSH_BUTTON
|
cv
::
QT_NEW_BUTTONBAR
);
cv
::
createButton
(
"Switch visualisation mode"
,
switchVisualizationModeButton
,
&
showProcessor
,
cv
::
QT_PUSH_BUTTON
|
cv
::
QT_NEW_BUTTONBAR
);
#endif //HAVE_QT
try
{
bool
pipelineFinished
=
false
;
...
...
@@ -156,10 +160,10 @@ int main(int argc, char** argv)
if
(
capParams
.
board
!=
chAruco
)
{
globalData
->
totalAvgErr
=
cv
fork
::
calibrateCamera
(
globalData
->
objectPoints
,
globalData
->
imagePoints
,
cv
::
calibrateCamera
(
globalData
->
objectPoints
,
globalData
->
imagePoints
,
globalData
->
imageSize
,
globalData
->
cameraMatrix
,
globalData
->
distCoeffs
,
cv
::
noArray
(),
cv
::
noArray
(),
globalData
->
stdDeviations
,
globalData
->
perViewErrors
,
globalData
->
stdDeviations
,
cv
::
noArray
(),
globalData
->
perViewErrors
,
calibrationFlags
,
solverTermCrit
);
}
else
{
...
...
@@ -169,10 +173,10 @@ int main(int argc, char** argv)
cv
::
aruco
::
CharucoBoard
::
create
(
capParams
.
boardSize
.
width
,
capParams
.
boardSize
.
height
,
capParams
.
charucoSquareLenght
,
capParams
.
charucoMarkerSize
,
dictionary
);
globalData
->
totalAvgErr
=
cv
fork
::
calibrateCameraCharuco
(
globalData
->
allCharucoCorners
,
globalData
->
allCharucoIds
,
cv
::
aruco
::
calibrateCameraCharuco
(
globalData
->
allCharucoCorners
,
globalData
->
allCharucoIds
,
charucoboard
,
globalData
->
imageSize
,
globalData
->
cameraMatrix
,
globalData
->
distCoeffs
,
cv
::
noArray
(),
cv
::
noArray
(),
globalData
->
stdDeviations
,
cv
::
noArray
(),
cv
::
noArray
(),
globalData
->
stdDeviations
,
cv
::
noArray
(),
globalData
->
perViewErrors
,
calibrationFlags
,
solverTermCrit
);
}
dataController
->
updateUndistortMap
();
...
...
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