Commit 69057bd5 authored by Andrey Filippov's avatar Andrey Filippov

fixed 2d correlation for negative values

parent 22872131
...@@ -1152,6 +1152,8 @@ public class Correlation2d { ...@@ -1152,6 +1152,8 @@ public class Correlation2d {
if (offset >= 0.0) { if (offset >= 0.0) {
if ((fc0 > -offset) && (fc1 > -offset)) { if ((fc0 > -offset) && (fc1 > -offset)) {
cc = Math.sqrt((fc0 + offset) * (fc1 + offset)) - offset; cc = Math.sqrt((fc0 + offset) * (fc1 + offset)) - offset;
} else {
cc = -offset; // smallest value
} }
} else { } else {
cc = 0.5*(fc0+fc1); cc = 0.5*(fc0+fc1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment