Skip to content
Snippets Groups Projects
Commit 1d4a8162 authored by David Hammer's avatar David Hammer
Browse files

Reapply "Peak value is relative to mean (thanks Mads)"

This reverts commit 586b0d2f.
parent 586b0d2f
No related branches found
No related tags found
1 merge request!139(Not for merging) online indexing + LPD parallel gain testing
...@@ -149,7 +149,7 @@ extern "C" __global__ void pf9(const unsigned short num_frames, ...@@ -149,7 +149,7 @@ extern "C" __global__ void pf9(const unsigned short num_frames,
// whole peak should have sufficent SNR // whole peak should have sufficent SNR
float peak_weighted_row; float peak_weighted_row;
float peak_weighted_col; float peak_weighted_col;
float peak_total_mass = pixel_val; float peak_total_mass = pixel_val - mean;
{ {
/* TODO: more compact form */ /* TODO: more compact form */
float peak_weighted_row_nom = static_cast<float>(row) * pixel_val; float peak_weighted_row_nom = static_cast<float>(row) * pixel_val;
...@@ -159,9 +159,10 @@ extern "C" __global__ void pf9(const unsigned short num_frames, ...@@ -159,9 +159,10 @@ extern "C" __global__ void pf9(const unsigned short num_frames,
float total_mass_before = peak_total_mass; float total_mass_before = peak_total_mass;
masked_frame.fun_ring(row, col, layer, [&] (unsigned short i, unsigned short j, float val) { masked_frame.fun_ring(row, col, layer, [&] (unsigned short i, unsigned short j, float val) {
if (val > peak_pixel_threshold) { if (val > peak_pixel_threshold) {
peak_total_mass += val; float val_over_mean = val - mean;
peak_weighted_row_nom += val * static_cast<float>(i); peak_total_mass += val_over_mean;
peak_weighted_col_nom += val * static_cast<float>(j); peak_weighted_row_nom += val_over_mean * static_cast<float>(i);
peak_weighted_col_nom += val_over_mean * static_cast<float>(j);
} }
}); });
// in case nothing was added, stop expanding // in case nothing was added, stop expanding
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment