Closed spono closed 3 years ago
Thanks, can you add a minimal example in the documentation and add the raster package to Suggests in the DESCRIPTION file
Thanks for the example. Only one thing:
if( min(x, na.rm = TRUE)>=0 & max(x, na.rm = TRUE) <=255 ){ warning("Values range between 0 and 255: Q might be set to 0")}
can we put this in image_contour_detector.RasterLayer?
What does the image represent?
it's a a Canopy Height Model of a cultivated area in the lowland in the north of Italy.
BTW yes, we can move that part within the raster method, if you prefer. Reading the article on which the algo is based, it seemed good to specify that: leaving Q=2
lead me always to error, while 0
solved the issue.
Interesting image. Just wondering do you know of any tools which can make such at canopy height model or extract lidar images from a drone with a simple camera on it?
Regarding the
if( min(x, na.rm = TRUE)>=0 & max(x, na.rm = TRUE) <=255 ){ warning("Values range between 0 and 255: Q might be set to 0")}
It's a bit strange to request in the documentation (https://github.com/bnosac/image/blob/master/image.ContourDetector/R/contour_detector.R#L12) to pass on a matrix with values in the 0-255 range and if you pass on such a matrix, immediately get a warning.
no, not in R. But you can check Open Drone Map.
you're right about the warning...I didn't notice the specification in the help page. BTW, It can be added to warn if the values exceed that range, in case. And remove on the other side the suggestion to use Q=0
Feel free to add your name in the description file, I'll merge these changes after that.
done. many thanks!
a curiosity: both the contour and line segment detectors identify where there is a passage between two homogeneous areas. Do you know instead a tool/approach to delineate the centre line of a -homogeneous- strip object (e.g. a road centreline)?
maybe look at the sf/sp/rgeos R packages?
I've updated the package on CRAN. https://cran.r-project.org/web/packages/image.ContourDetector Thanks again for your contribution.
maybe look at the sf/sp/rgeos R packages?
Found nothing. I come from those packages and that's how I arrived here :)
Ah, just a note: (I know it's not tomorrow but) in 2024 sp/raster/rgdal/rgeos will be stopped to concentrate on sf/terra/stars. cheers!
Good to know, I'm getting old. sp has been around always. Where did you see that announcement?
Right. That will impact some production systems. Thanks for the link.
Found nothing. I come from those packages and that's how I arrived here :)
Maybe use the magick package to do all kind of morphology operations on the road to reduce it to one line.
I added the RasterLayer method plus some warnings...HTH! tested and it works