From b8b29627f1fcd6248f3696f336ed1c598b2f8739 Mon Sep 17 00:00:00 2001
From: "jean-matthieu.monnet" <jean-matthieu.monnet@inrae.fr>
Date: Thu, 6 Apr 2023 11:23:12 +0200
Subject: [PATCH] change gap color in examples

---
 R/gap_detection.R     | 10 +++++-----
 R/tree_detection.R    |  1 -
 man/edge_detection.Rd |  2 +-
 man/gap_detection.Rd  |  6 +++---
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/R/gap_detection.R b/R/gap_detection.R
index a9a56ef..5203670 100755
--- a/R/gap_detection.R
+++ b/R/gap_detection.R
@@ -68,9 +68,9 @@
 #' terra::plot(chm_chablais3, main = "Initial image")
 #'
 #' # plot binary image of gaps
-#' terra::plot(gaps$gap_id > 0, main = "Gaps", legend = FALSE)
-#' terra::plot(gaps1$gap_id > 0, main = "Gaps, with reconstruction", legend = FALSE)
-#' terra::plot(gaps2$gap_id > 0, main = "Gaps, no width criterion", legend = FALSE)
+#' terra::plot(gaps$gap_id > 0, main = "Gaps", col = "green", legend = FALSE)
+#' terra::plot(gaps1$gap_id > 0, main = "Gaps, with reconstruction", col = "green", legend = FALSE)
+#' terra::plot(gaps2$gap_id > 0, main = "Gaps, no width criterion", col = "green", legend = FALSE)
 #'
 #' # plot filtered CHM
 #' terra::plot(gaps2$filled_chm, main = "Filtered CHM")
@@ -219,7 +219,7 @@ gap_detection <-
     }
     # set surface of non gaps to NA
     r_surface[is.na(r_labels)] <- NA
-    # removal of labels with small surface
+    # removal of labels with small or very large surface
     dummy <- (r_surface < min_gap_surface) | (r_surface > max_gap_surface)
     r_labels[dummy] <- r_surface[dummy] <- NA
     output <- c(r_labels, r_surface, r.nl)
@@ -263,7 +263,7 @@ gap_detection <-
 #' terra::plot(chm_chablais3, main = "Initial image")
 #'
 #' # plot binary image of gaps
-#' terra::plot(gaps$gap_id > 0, main = "Gaps", legend = FALSE)
+#' terra::plot(gaps$gap_id > 0, main = "Gaps", col = "green", legend = FALSE)
 #'
 #' # plot edges
 #' terra::plot(edges_inside, main = "Edges (inside)", legend = FALSE)
diff --git a/R/tree_detection.R b/R/tree_detection.R
index 2dfd077..b0e82e8 100755
--- a/R/tree_detection.R
+++ b/R/tree_detection.R
@@ -943,7 +943,6 @@ tree_segmentation <- function(dem, dtm = NULL, crown_prop = NULL, crown_hmin = N
   #
   output <- c(maxi, dem_w, dem_nl, dem_gs)
   names(output) <- c("local_maxima", "segments_id", "filled_dem", "smoothed_dem")
-  print(dots)
   output
 }
 
diff --git a/man/edge_detection.Rd b/man/edge_detection.Rd
index f39f3f7..2f5f6b4 100755
--- a/man/edge_detection.Rd
+++ b/man/edge_detection.Rd
@@ -46,7 +46,7 @@ sum(terra::values(edges_outside)) / (nrow(edges_outside) * ncol(edges_outside))
 terra::plot(chm_chablais3, main = "Initial image")
 
 # plot binary image of gaps
-terra::plot(gaps$gap_id > 0, main = "Gaps", legend = FALSE)
+terra::plot(gaps$gap_id > 0, main = "Gaps", col = "green", legend = FALSE)
 
 # plot edges
 terra::plot(edges_inside, main = "Edges (inside)", legend = FALSE)
diff --git a/man/gap_detection.Rd b/man/gap_detection.Rd
index 150ecc9..da798b5 100755
--- a/man/gap_detection.Rd
+++ b/man/gap_detection.Rd
@@ -96,9 +96,9 @@ table(terra::values(gaps2$gap_id)) * terra::res(gaps2$gap_id)[1]^2
 terra::plot(chm_chablais3, main = "Initial image")
 
 # plot binary image of gaps
-terra::plot(gaps$gap_id > 0, main = "Gaps", legend = FALSE)
-terra::plot(gaps1$gap_id > 0, main = "Gaps, with reconstruction", legend = FALSE)
-terra::plot(gaps2$gap_id > 0, main = "Gaps, no width criterion", legend = FALSE)
+terra::plot(gaps$gap_id > 0, main = "Gaps", col = "green", legend = FALSE)
+terra::plot(gaps1$gap_id > 0, main = "Gaps, with reconstruction", col = "green", legend = FALSE)
+terra::plot(gaps2$gap_id > 0, main = "Gaps, no width criterion", col = "green", legend = FALSE)
 
 # plot filtered CHM
 terra::plot(gaps2$filled_chm, main = "Filtered CHM")
-- 
GitLab