Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
295e5634
Commit
295e5634
authored
Apr 07, 2020
by
Cédric Traizet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: use the minimum size between the two inputs to compute the scalar product
parent
165fd9f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
Modules/Filtering/ImageManipulation/include/otbSpectralAngleFunctor.h
...ering/ImageManipulation/include/otbSpectralAngleFunctor.h
+2
-1
No files found.
Modules/Filtering/ImageManipulation/include/otbSpectralAngleFunctor.h
View file @
295e5634
...
...
@@ -42,7 +42,8 @@ template <class TInput, class TReference, class TOutput>
TOutput
ComputeSpectralAngle
(
TInput
const
&
input
,
typename
TInput
::
ValueType
const
&
inputNorm
,
TReference
const
&
reference
,
typename
TReference
::
ValueType
refNorm
)
{
double
scalarProduct
=
std
::
inner_product
(
&
input
[
0
],
&
input
[
input
.
Size
()],
&
reference
[
0
],
0.
);
auto
minSize
=
std
::
min
(
input
.
Size
(),
reference
.
Size
());
double
scalarProduct
=
std
::
inner_product
(
&
input
[
0
],
&
input
[
minSize
],
&
reference
[
0
],
0.
);
auto
normProd
=
inputNorm
*
refNorm
;
if
((
normProd
==
0.0
)
||
(
scalarProduct
/
normProd
>
1
))
{
...
...
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