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?


1 Answer 1


Producing a canopy height model (CHM) is a well established procedure, so I don't think you will need to "re-invent the wheel" in python or Matlab. See, for example:

from the pyfor package

using the lidR package in R

the lascanopy untility from LasTools

using a pdal pipeline approach

and further searches on google will return lots of other examples using these tools.

(Note: I'm not sure what you mean by DEM created from thermal images. I assume that the DEM was a by-product of the image overlaps?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.