Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
7a676914
Commit
7a676914
authored
Aug 24, 2017
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
omnidir: fix wrong memory access in estimateUncertainties
parent
f953e690
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
52 deletions
+1
-52
omnidir.hpp
modules/ccalib/include/opencv2/ccalib/omnidir.hpp
+1
-4
omnidir.cpp
modules/ccalib/src/omnidir.cpp
+0
-48
No files found.
modules/ccalib/include/opencv2/ccalib/omnidir.hpp
View file @
7a676914
...
...
@@ -278,8 +278,6 @@ namespace internal
double
computeMeanReproErrStereo
(
InputArrayOfArrays
objectPoints
,
InputArrayOfArrays
imagePoints1
,
InputArrayOfArrays
imagePoints2
,
InputArray
K1
,
InputArray
K2
,
InputArray
D1
,
InputArray
D2
,
double
xi1
,
double
xi2
,
InputArray
om
,
InputArray
T
,
InputArrayOfArrays
omL
,
InputArrayOfArrays
TL
);
void
checkFixed
(
Mat
&
G
,
int
flags
,
int
n
);
void
subMatrix
(
const
Mat
&
src
,
Mat
&
dst
,
const
std
::
vector
<
int
>&
cols
,
const
std
::
vector
<
int
>&
rows
);
void
flags2idx
(
int
flags
,
std
::
vector
<
int
>&
idx
,
int
n
);
...
...
@@ -309,4 +307,4 @@ namespace internal
}
// omnidir
}
//cv
#endif
\ No newline at end of file
#endif
modules/ccalib/src/omnidir.cpp
View file @
7a676914
...
...
@@ -1785,8 +1785,6 @@ void cv::omnidir::internal::estimateUncertainties(InputArrayOfArrays objectPoint
errors
=
3
*
s
*
_JTJ_inv
.
diag
();
checkFixed
(
errors
,
flags
,
n
);
rms
=
0
;
const
Vec2d
*
ptr_ex
=
reprojError
.
ptr
<
Vec2d
>
();
for
(
int
i
=
0
;
i
<
(
int
)
reprojError
.
total
();
i
++
)
...
...
@@ -1995,52 +1993,6 @@ double cv::omnidir::internal::computeMeanReproErrStereo(InputArrayOfArrays objec
return
reProErr
;
}
void
cv
::
omnidir
::
internal
::
checkFixed
(
Mat
&
G
,
int
flags
,
int
n
)
{
int
_flags
=
flags
;
if
(
_flags
>=
omnidir
::
CALIB_FIX_CENTER
)
{
G
.
at
<
double
>
(
6
*
n
+
3
)
=
0
;
G
.
at
<
double
>
(
6
*
n
+
4
)
=
0
;
_flags
-=
omnidir
::
CALIB_FIX_CENTER
;
}
if
(
_flags
>=
omnidir
::
CALIB_FIX_GAMMA
)
{
G
.
at
<
double
>
(
6
*
n
)
=
0
;
G
.
at
<
double
>
(
6
*
n
+
1
)
=
0
;
_flags
-=
omnidir
::
CALIB_FIX_GAMMA
;
}
if
(
_flags
>=
omnidir
::
CALIB_FIX_XI
)
{
G
.
at
<
double
>
(
6
*
n
+
5
)
=
0
;
_flags
-=
omnidir
::
CALIB_FIX_XI
;
}
if
(
_flags
>=
omnidir
::
CALIB_FIX_P2
)
{
G
.
at
<
double
>
(
6
*
n
+
9
)
=
0
;
_flags
-=
omnidir
::
CALIB_FIX_P2
;
}
if
(
_flags
>=
omnidir
::
CALIB_FIX_P1
)
{
G
.
at
<
double
>
(
6
*
n
+
8
)
=
0
;
_flags
-=
omnidir
::
CALIB_FIX_P1
;
}
if
(
_flags
>=
omnidir
::
CALIB_FIX_K2
)
{
G
.
at
<
double
>
(
6
*
n
+
7
)
=
0
;
_flags
-=
omnidir
::
CALIB_FIX_K2
;
}
if
(
_flags
>=
omnidir
::
CALIB_FIX_K1
)
{
G
.
at
<
double
>
(
6
*
n
+
6
)
=
0
;
_flags
-=
omnidir
::
CALIB_FIX_K1
;
}
if
(
_flags
>=
omnidir
::
CALIB_FIX_SKEW
)
{
G
.
at
<
double
>
(
6
*
n
+
2
)
=
0
;
}
}
// This function is from fisheye.cpp
void
cv
::
omnidir
::
internal
::
subMatrix
(
const
Mat
&
src
,
Mat
&
dst
,
const
std
::
vector
<
int
>&
cols
,
const
std
::
vector
<
int
>&
rows
)
{
...
...
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