I have a stars raster object called raster
. I am trying to run edge detection on it like:
image(rot90c(edge.detect(raster[[1]], thresh1=1, thresh2=80, noise="gaussian", noise.s=3, method="Canny")))
This works fine, but when I try to crop the raster against an sf object other_object
using:
image(rot90c(edge.detect(st_crop(raster,other_object)[[1]], thresh1=1, thresh2=80, noise="gaussian", noise.s=3, method="Canny")))
I get errors due to NAs. Is there any way to create a cropped raster such that the edge detection method doesn't throw an error due to missing regions from the image?