Tree-detection. Just the normal trees in the street. Not the RandomForest

I've an Aerial image (5cm ground pixel resolution, RGB) and Satellite Images 50 cm pixel resolution (RGB and NearInfrared) and I would like to do some Tree detection image analyses. Just the Trees in the streets. Not the RandomForest-tree as AI algorithm.

But Im not sure where to start: QGIS with the Semi-automatic Classification Plugin or ArcGIS Pro with the Image Analysist Tools?

I've also a shapefile with Trees as point-object. Is that usefull as training data? How many tree-points do I need as training data?

Did someone gave this a try already? Was the result good(-enough)? Did you encounter a problem you couldnt work around? I hope I can learn from your experience and hopefully improve the workprocess.

Posted Aug 12, 2022, 12:45 PM UTC

714
TonzoWonzo•

If you know some Python you could try Deep Forest: https://deepforest.readthedocs.io/en/latest/, it works pretty well with high res aerial imagery, less so with 50cm satellite imagery. I believe it was trained with 10cm resolution data.

3
AccurassiOP•

thanks! I do know some Python but didnt think of it. I'll take a look at it.

2
AccurassiOP•

I tried to install Deepforest in my own way in my Anaconda Base environment. Ofcourse, that doesn't work. So I give it a try in a new, clean environment and that seems to go well. Now Im going to try the "getting started" chapter in the readthedocs

2
TonzoWonzo•

It should be a lot easier doing it in a new environment that you make with i.e conda create -n deepforest python=3 pytorch torchvision cudatoolkit=10.2 -c pytorch, it's generally good practice to work in separate environments to the base env anyway

2
AccurassiOP•

cudatoolkit

I understand you need an Nvidia graphics card for the cuda toolkit? Unfortunatly I've an ATI Radeon RX 580 Series.

In the meantime I've created an new environment for deepforest, but Spyder will not install in that environment. At least, it seems to take hours to Solve packages and things like that. I think I just have to be patient.

1
AccurassiOP•

thanks for the tip. I did create new environment and after hours of waiting while package specifications are solved etc. I finaly get somewhere. In readthedocs I get to the point of 'getting started', in Spyder I get the error:

ImportError: cannot import name 'main' from 'deepforest'

from this part of code:

from deepforest import main
from deepforest import get_data
import os
import matplotlib.pyplot as plt
model = main.deepforest()
model.use_release()

img = model.predict_image(path="/Users/benweinstein/Documents/NeonTreeEvaluation/evaluation/RGB/TEAK_049_2019.tif",return_plot=True)

#predict_image returns plot in BlueGreenRed (opencv style), but matplotlib likes RedGreenBlue, switch the channel order.
plt.imshow(img[:,:,::-1])

It sucks to be stucked here :(

1
thenedzone•

Take a look at Sentinel 1 SAR data. SAR wave are polarized and will allow you to detect straight vertical objects (which trees are). Combine that with NDVI from your NIR and Red data should allow you to refine your tree detection. NASA has some remote sensing material of you wanna learn more about it.

3
AccurassiOP•

thank you for your suggestion. But I'm affraid the Sentinel1 SAR data groundpixalresolution is in the meters (like 5 meter per pixel). Im not sure I can detect and identify individual trees in the streets with it. But I keep it in mind. Or do you have a step-by-step tutorial for me to detect the trees based on the Sentinel1?

1
thenedzone•

NASA has some good tutorials so check it out. Individual tree detection is pretty difficult without doing drone at close quarters since foliage tends to blend together. (Of course it depends on how apart the trees are). Hope that helps!

1
R0b0d0nutOptical•

Use Ilastik.

2
AccurassiOP•

thanks. Looks good. I give the DeepForest python a first try but Ilastik is runner up!

1
Dark0bert•

Why not RF? It works pretty well. Otherwise, this questions could also be solved by using object based classification algorithms.

1
AccurassiOP•

can you a bit more specific with the object based classification algorithms? Do you have first-hand experience? And with which one?

1