I've never worked with QGIS but I need to use it for a project. I have thermal images of a vineyard that were added together in Agisoft Metashape to form a DEM (tif-file). When I load this into QGIS I can see the rows of the plants being a lighter color and the ground a darker color. Following the DEM there's about a 40 cm difference between the two types of pixels. Also, the vineyard is on a slope, which makes that I can't just subtract the ground height from this map to find the canopy pixels.
I was thinking about writing a short program in Python or Matlab that would evaluate the local minimum around every pixel (in a radius of around 10 pixels) to generate a 'ground map' with the lowest pixels representing the ground. This could then be subtracted from the DEM and by using a threshold value of around 40 cm determining which pixels are canopy and which are not. But I'm not sure if this is the right method as I would think the ground map would be underestimated at some spots.
Is there anyone who could recommend me a solution to separate the canopy from the ground based on this DEM?