[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 2c55023: NoiseChisel resetting labeled image i
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 2c55023: NoiseChisel resetting labeled image in no growth |
Date: |
Fri, 2 Mar 2018 21:54:19 -0500 (EST) |
branch: master
commit 2c55023a7b7390c848020a2348f3ead29670356c
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
NoiseChisel resetting labeled image in no growth
When there is no growth, the previous commit still didn't reset the labels
(it was actually corrected after a failed `make check' and the original
problem was never re-checked after that!). So a check is now added to
specifically parse over the array and re-set the labels (remove false
detections) if there is no expansion.
---
bin/noisechisel/detection.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/bin/noisechisel/detection.c b/bin/noisechisel/detection.c
index b4b5f01..f74332e 100644
--- a/bin/noisechisel/detection.c
+++ b/bin/noisechisel/detection.c
@@ -936,11 +936,18 @@ detection_remove_false_initial(struct noisechiselparams
*p,
if( *b==0 && *arr>*e_th )
++p->numexpand;
}
- ++b;
- ++arr;
- ++e_th;
+ ++b; ++arr; ++e_th;
}
while(++l<lf);
+
+ /* If there aren't any pixels to later expand, then reset the labels
+ (remove false detections in the labeled image). */
+ if(p->numexpand==0)
+ {
+ b=workbin->array;
+ l=p->olabel->array;
+ do if(*l!=GAL_BLANK_INT32) *l = newlabels[ *l ]; while(++l<lf);
+ }
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master 2c55023: NoiseChisel resetting labeled image in no growth,
Mohammad Akhlaghi <=