gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master ec380e5: NoiseChisel: binary image before grow


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master ec380e5: NoiseChisel: binary image before growth has blank if input does
Date: Fri, 2 Aug 2019 12:47:38 -0400 (EDT)

branch: master
commit ec380e5b9ac015cef074f3192c1a928d9a474ecb
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    NoiseChisel: binary image before growth has blank if input does
    
    Until now, we weren't forcing the binary image before growth to have blank
    values. Therefore in some scenarios it would keep blank values in the
    output and in others it wouldn't.
    
    With this commit, when the labeled image has blank values, the respective
    pixel is also given a blank value in the binary image (which may later be
    used as output).
    
    This fixes bug #56710.
---
 NEWS                        |  4 +++-
 bin/noisechisel/detection.c | 10 ++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 4cb13ae..2710bc3 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 Copyright (C) 2015-2019 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
-* Noteworthy changes in release X.X (library X.X.X) (XXXX-XX-XX) [stable]
+* Noteworthy changes in release 0.10 (library 8.0.0) (2019-08-02) [stable]
 
 ** New features
 
@@ -152,6 +152,8 @@ See the end of the file for license conditions.
   bug #56662: Converting -R to -Wl,-R causes a crash in configure on macOS.
   bug #56671: Bad sorting with asttable if nan is present.
   bug #56709: Segment crash when input has blanks, but labels don't.
+  bug #56710: NoiseChisel sometimes not including blank values in output.
+
 
 
 
diff --git a/bin/noisechisel/detection.c b/bin/noisechisel/detection.c
index 244248b..a72663e 100644
--- a/bin/noisechisel/detection.c
+++ b/bin/noisechisel/detection.c
@@ -954,9 +954,11 @@ detection_remove_false_initial(struct noisechiselparams *p,
       e_th=p->exp_thresh_full->array;
       do                                    /* Growth is necessary later.  */
         {                                   /* So there is no need to set  */
-          if(*l!=GAL_BLANK_INT32)           /* the labels image, but we    */
-            {                               /* have to count the number of */
-              *b = newlabels[ *l ] > 0;     /* pixels to (possibly) grow.  */
+          if(*l==GAL_BLANK_INT32)           /* the labels image, but we    */
+            *b=GAL_BLANK_UINT8;             /* have to count the number of */
+          else                              /* pixels to (possibly) grow.  */
+            {
+              *b = newlabels[ *l ] > 0;
               if( *b==0 && *arr>*e_th )
                 ++p->numexpand;
             }
@@ -964,11 +966,11 @@ detection_remove_false_initial(struct noisechiselparams 
*p,
         }
       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);
         }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]