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
b75bac79
Commit
b75bac79
authored
Aug 09, 2016
by
LaurentBerger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solve Issue 7063
consequences of changes accuracy test Solve issue 7063
parent
44bda8fb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
33 deletions
+32
-33
matrix_decomp.cpp
modules/core/src/matrix_decomp.cpp
+7
-1
test_math.cpp
modules/core/test/test_math.cpp
+19
-0
inner_functions.cpp
modules/ml/src/inner_functions.cpp
+6
-29
autocalib.cpp
modules/stitching/src/autocalib.cpp
+0
-3
No files found.
modules/core/src/matrix_decomp.cpp
View file @
b75bac79
...
@@ -153,8 +153,12 @@ CholImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n)
...
@@ -153,8 +153,12 @@ CholImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n)
L
[
i
*
astep
+
i
]
=
(
_Tp
)(
1.
/
std
::
sqrt
(
s
));
L
[
i
*
astep
+
i
]
=
(
_Tp
)(
1.
/
std
::
sqrt
(
s
));
}
}
if
(
!
b
)
if
(
!
b
)
{
for
(
i
=
0
;
i
<
m
;
i
++
)
L
[
i
*
astep
+
i
]
=
1
/
L
[
i
*
astep
+
i
];
return
true
;
return
true
;
}
// LLt x = b
// LLt x = b
// 1: L y = b
// 1: L y = b
...
@@ -193,6 +197,8 @@ CholImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n)
...
@@ -193,6 +197,8 @@ CholImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n)
b
[
i
*
bstep
+
j
]
=
(
_Tp
)(
s
*
L
[
i
*
astep
+
i
]);
b
[
i
*
bstep
+
j
]
=
(
_Tp
)(
s
*
L
[
i
*
astep
+
i
]);
}
}
}
}
for
(
i
=
0
;
i
<
m
;
i
++
)
L
[
i
*
astep
+
i
]
=
1
/
L
[
i
*
astep
+
i
];
return
true
;
return
true
;
}
}
...
...
modules/core/test/test_math.cpp
View file @
b75bac79
...
@@ -2977,4 +2977,23 @@ TEST(Core_Pow, special)
...
@@ -2977,4 +2977,23 @@ TEST(Core_Pow, special)
}
}
}
}
TEST
(
Core_Cholesky
,
accuracy64f
)
{
const
int
n
=
5
;
Mat
A
(
n
,
n
,
CV_64F
),
refA
;
Mat
mean
(
1
,
1
,
CV_64F
);
*
mean
.
ptr
<
double
>
()
=
10.0
;
Mat
dev
(
1
,
1
,
CV_64F
);
*
dev
.
ptr
<
double
>
()
=
10.0
;
RNG
rng
(
10
);
rng
.
fill
(
A
,
RNG
::
NORMAL
,
mean
,
dev
);
A
=
A
*
A
.
t
();
A
.
copyTo
(
refA
);
Cholesky
(
A
.
ptr
<
double
>
(),
A
.
step
,
n
,
NULL
,
0
,
0
);
for
(
int
i
=
0
;
i
<
A
.
rows
;
i
++
)
for
(
int
j
=
i
+
1
;
j
<
A
.
cols
;
j
++
)
A
.
at
<
double
>
(
i
,
j
)
=
0.0
;
EXPECT_TRUE
(
norm
(
refA
-
A
*
A
.
t
())
<
10e-5
);
}
/* End of file. */
/* End of file. */
modules/ml/src/inner_functions.cpp
View file @
b75bac79
...
@@ -116,35 +116,12 @@ static void Cholesky( const Mat& A, Mat& S )
...
@@ -116,35 +116,12 @@ static void Cholesky( const Mat& A, Mat& S )
{
{
CV_Assert
(
A
.
type
()
==
CV_32F
);
CV_Assert
(
A
.
type
()
==
CV_32F
);
int
dim
=
A
.
rows
;
S
=
A
.
clone
();
S
.
create
(
dim
,
dim
,
CV_32F
);
cv
::
Cholesky
((
float
*
)
S
.
ptr
(),
S
.
step
,
S
.
rows
,
NULL
,
0
,
0
);
S
=
S
.
t
();
int
i
,
j
,
k
;
for
(
int
i
=
1
;
i
<
S
.
rows
;
i
++
)
for
(
int
j
=
0
;
j
<
i
;
j
++
)
for
(
i
=
0
;
i
<
dim
;
i
++
)
S
.
at
<
float
>
(
i
,
j
)
=
0
;
{
for
(
j
=
0
;
j
<
i
;
j
++
)
S
.
at
<
float
>
(
i
,
j
)
=
0.
f
;
float
sum
=
0.
f
;
for
(
k
=
0
;
k
<
i
;
k
++
)
{
float
val
=
S
.
at
<
float
>
(
k
,
i
);
sum
+=
val
*
val
;
}
S
.
at
<
float
>
(
i
,
i
)
=
std
::
sqrt
(
std
::
max
(
A
.
at
<
float
>
(
i
,
i
)
-
sum
,
0.
f
));
float
ival
=
1.
f
/
S
.
at
<
float
>
(
i
,
i
);
for
(
j
=
i
+
1
;
j
<
dim
;
j
++
)
{
sum
=
0
;
for
(
k
=
0
;
k
<
i
;
k
++
)
sum
+=
S
.
at
<
float
>
(
k
,
i
)
*
S
.
at
<
float
>
(
k
,
j
);
S
.
at
<
float
>
(
i
,
j
)
=
(
A
.
at
<
float
>
(
i
,
j
)
-
sum
)
*
ival
;
}
}
}
}
/* Generates <sample> from multivariate normal distribution, where <mean> - is an
/* Generates <sample> from multivariate normal distribution, where <mean> - is an
...
...
modules/stitching/src/autocalib.cpp
View file @
b75bac79
...
@@ -51,9 +51,6 @@ static inline bool decomposeCholesky(double* A, size_t astep, int m)
...
@@ -51,9 +51,6 @@ static inline bool decomposeCholesky(double* A, size_t astep, int m)
{
{
if
(
!
hal
::
Cholesky64f
(
A
,
astep
,
m
,
0
,
0
,
0
))
if
(
!
hal
::
Cholesky64f
(
A
,
astep
,
m
,
0
,
0
,
0
))
return
false
;
return
false
;
astep
/=
sizeof
(
A
[
0
]);
for
(
int
i
=
0
;
i
<
m
;
++
i
)
A
[
i
*
astep
+
i
]
=
(
double
)(
1.
/
A
[
i
*
astep
+
i
]);
return
true
;
return
true
;
}
}
...
...
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