Skip to main content
. 2017 Sep 24;17(10):2196. doi: 10.3390/s17102196
Algorithm 1 Detection of pre-exiting termite mounds with hyperspectral imaging.
Input: raw hyperspectral image file
Pre-processing
1. Calculate hyper-cube radiance
2. Perform Orthorectification process
3. Load GPS coordinates from register file, and obtain a ROI
4. Apply closing operator once            ▷ structuring element: 3 × 3 rectangle
Material Classification
5. Load illuminant spectrum from white reference
6. Calculate reflectance
7. Load material reflectance library
8. Run SVM classifier
9. Filter segmented material layers: “Eroded Soil” and “Light Grass”
Object Detection
10. Apply Smooth-Median Filter on soil layer                 ▷ kernel size: 3
11. Apply closing operator on soil layer once      ▷ structuring element: 3 × 3 rectangle
12. Create a temporal Image T1
13. T1 double dilation operator on soil layer      ▷ structuring element: 3 × 3 ellipse
14. Apply Smooth-Median Filter on grass layer               ▷ kernel size: 3
15. Create a temporal Image T2
16. T2 AND operator between grass layer and T1
17. if Mean(T2) =0.0 then return null
18. end if
19. Find contours from the soil layer
20. for i0,n do                 ▷ n= number of detected soil contours
21.   Select SC(i)                   ▷ SC(i)= soil contour at i index
22.   Run MatchShapes method                   ▷ output: ratio
23.   Psc perimeter of SC(i)
24.   if ratio0.15 Psc10 then
25.     Discard SC(i)
26.   else
27.     Find contours from the grass layer
28.     for j0,m do           ▷ m= number of detected grass contours
29.       Select GC(j)             ▷ GC(j)= grass contour at j index
30.      Pgc perimeter of GC(j)
31.      d distance between GC(j) and SC(i) centroids
32.      rad radius of SC(i)
33.      PropPgc/Psc
34.      if d=1.2*rad (PgcPsc || Prop0.8) then
35.       ILD Minimum intersection line distance between SC(i) and GC(j)
36.       if ILD=2.5 then
37.         Draw contours at ROI image
38.       end if
39.      end if
40.    end for
41.   end if
42. end for
43. return ROI Image