Syntax Classify

to specify
  • Training sites for bottom type signatures
  • Bottom_Type_Classification
  • Modal_Filtering of classified image


 
1 - NO NEED for field data, nor for atmospheric correction
2 - this is demonstrated in this website, using a variety of hyper/multi spectral data
 
Requirements are
1 - homogeneous water body and atmosphere
2 - some coverage of optically deep water
3 - some coverage of dry land
 
Problems are
1 - the precision on estimated depth is found wanting, because the noise-equivalent change in radiance  of accessible data is too high for shallow water column correction work 
2 - radiance data should be preprocessed by the provider at level 1 in order to improve S/N ratio
3 - exponential decay: the deeper/darker the bottom, the poorer the performances
 
So
I keep digging
until suitable data
become available
 
 
HowTo Classify
HowTo Modal Filter
-Classify/Typer_0.2/Classifier_0.5_0_ef_LastChType2/mode_5_11_16
  • -Classify/Typer10_0.2
    • runs the Typer  for  shapefile type_10.shp
      • to retreive the spectral signature of AOI type_10.shp
      • tolerance is set to 0.2
    • writes and runs signature_10.sh
    • displays plot signature_10.eps
    • writes to textfile  database_m0.sig
  • -Classify/Typer_0.2
    • ?reads textfile database_m0.sig for all registered type_N.shp shapefiles
    • runs the typer for all type_N.shp
      • writes and runs signature_N.sh
      • displays all signature_N.eps
      • writes to textfile database_m0.sig
  • -Classify/typer_0.2/Classifier_0.5_0_ef_LastChType2
  • runs the classifier, using signature textfile image_m0.sig
    • tolerance is set to 0.5
    • nbMISS is set to 0
    • F(f)   fast classification
      • F........reads from water column corrected LSB channels : much faster
      • f.........model from scratch and classify "on the fly"
    • LastChType is set to 2............uses channels 1 and 2 for BGRN images
    • writes classified image to channel_U8_BSC
  • Reserved types
    • type_0.shp to type_5.shp are reserved:
      • 0 Land
      • 1 NOT_classified
      • 2 DeepWater
      • 3 NoData
      • 4 WaveBreakers
      • 5 Cloud/Shadows
  • type_6.shp to type_255.shp
    • shallow bottom types are coded 6, 7, etc, up to 255

MODAL FILTERING
HowTo
reads from chModIn and writes to chModOut
  • -Classify/typer_0.2/classifier_0.5_0_ef_LastChType2/Mode_5_11_16
    • runs the modal filter
    • applies a filtering circular window : radius is set to 5
    • reads classified image from u8_channel_11
    • and writes to modal-filtered image in U8_channel_16
      • may be any U8 channel : best use a void/free channel though!
      • Mode_5_26_26 would overwrite any U8 channel (26 here) onto itself while modal-filtering

 

 

Syntax Classify
HowTo Classify for bottom typing menton caicos gezirat reef
HowTo Modal Filter menton modal filtered
Once the modeling is deemed satisactory, it is time to attempt bottom typing.
This is the ultimate purpose of the 4SM project:
to derive water depth and bottom typing, prior to the use of any field data.

Field data
are definitely needed for labelling each bottom type,
and most likely for reducing the number of classes into significant bins.
 
  • Database_m0.sig: you must have a database_m0.sig text file available 
    • for this, SIG must be enabled in the -Z... argument
    •  -Z+/1.18/.1/0.00/2.0/1.0/PAN_1_12/SIG_11w5/N_6/1.000
  • Choose Training Sites:
    • delineate several small shapefiles for regions of interest that are deemed representative of various and predominant homogeneous water column corrected spectral signatures.
    • name them from type_6.shp to type_N.shp
    • as type_0.shp to type_5.shp are reserved
  • Add and enable a -Classify argument  in your modeling script:
    • -Classify_4_0F/mode_2_19_24
  • CoefSIG and NbMISS
    • CoefSIG=4.........isa good start. The water column corrected interval is  SIG[n]+-CoefSIG*STD[n]
    • NbMISS=0..........is a good start. All bands from 1 to wZ must pass
    • NbMISS=1 ............would allow one of those water column corrected LSB[n] to miss out, i.e. to be higher or lower than SIG[n]+-CoefSIG*STD[n]
CLASSIFICATION SCHEME
  • Out ....................a shallow pixel which does not satisfy the NbMISS  condition for any particular signature may not be assigned to that signature.
  • Iterations......... if a pixel passes several signatures,
    • then CoefSIG is reduced
    • and all signatures are tested again,
    • until
      • either one only signature remains: done
      • or no signature remains: then CoefSIG is increased by smaller increments until
        • either two signatures pass again:  then the pixel is assigned to that signature which is closest in term of average bottom reflectance B: done
        • or one only signature passes again: done
  • Number of classes: increasing CoefSIG and/or NbMISS shall be needed if one wishes to reduce the number of classes.
  • Run your modeling script with one -DDD... argument at a time
    • -DDDFirstRow/LastRow/FirstLine/LastLine_SignatureNumber specify training site for a particular SignatureNumber
    • All ROI pixels: this models all pixels inside the ROI numbered "SignatureNumber"
    • Happy few: then works out an average spectral signature for the predominant group of homogeneous pixels
    • Display: then displays on screen the plot of the average spectral signature
      • see gezirat signature 16
      • in this case, for bottom type 33
        • CoefSIG=4
        • nbMISS=0
        • wZ=11
        • Z=2.23 m
        • B=100.9
      • colored spectra: 2058 pixels (i.e. 97.03% of 2121 pixels)
        • are allocated to bottom type 16
        • and plotted in a color that is representative of WL[11]
      • grey spectra: 63 pixels  are excluded from the computation of the average spectrum, and assigned to other classes (15,11,18,13, 17 and 23), or unclassified (0.00%)
    • Append: and appends it to the database m0.sig textfile

Optimize your optical calibration
  • Look out for bad calibration: see gezirat signature 16 bad ch9
    • the optical calibration for channel 9 might be faulty
    • particularly if that "offset" at channel_9 shows off also for other signatures
    • it was obtained using -CP149.0/134.1/129.3/127.3/121.0/104.9/092.0/084.1/068.0/068.2/018.8/00000
    • The following calibration is more acceptable, is'nt it? see gezirat signature 16 good ch9
  • it was obtained using -CP149.0/134.1/129.3/127.3/121.0/104.9/092.0/084.1/077.0/068.2/018.8/00000
  • Once you have secured several signatures
    • disable any -DDD... argument and run your script again
    • -Classify_4_0F/mode_5_19_25 
      • a fast classification is performed and written to chU8_BSC
    • display chU8_BSC on screen and use leg/pctClassification pseudo color table
    • decide on 
      • new signatures to be added as appropriate
      • signatures to cancel as appropriate
      • modification of ROIs as appropriate
      • modification of CoefSIG and/or NbMISS as appropriate
  • -DDD: when you have most of your desired signatures,  
    • enable a -DDD argument, that is a bare -DDD  
    • run your script again 
      • this runs through the whole list of signatures, as per database m0.sig textfile
      • writes new scripts signature_N.sh 
      • displays all plots signature_N.eps
      • and appends to your database m0.sig textfile, which you shall need to manage accordingly
  • Renumbering
    • review the statistics of bottom typing in database.his text file
    • decide on your prefered order for all signatures and modify their number/order in database m0.sig textfile accordingly
    • and run your script again
    • you shall also need to update your pseudo color table accordingly
  • How strong is each class?
    • disable any particular signature in database m0.sig textfile: just place a # at the start of the line for both SIG and STD: 
      • #SIG....      that line shall be ignored
      • #STD....     that line shall be ignored
    • run your script again, and display: the class that has been disabled now adds to the Not_Classified
      • then you can choose to increase CoefSIG in order to see how the disabled class bins itself with brotherly classes or remains a strong case... 
      • class_10 has been disabled:
        • it now shows as white Not_Classified pixels, along with all other Not_Classified pixels
        • Not_Classified were 4.03%, there are now 5.71% for the whole image
      • ==> you can decide  
        • whether it may be canceled definitely, 
        • or it should better be relocated at some other place where it is more significant and really needed.
  • Progressively, until satisfied
    • refine your choice of usefull and significant training sites
    • weed out or relocate as appropriat
    • rename/re-order  as appropriate
    • try your chance at playing with CoefSIG and nbMISS
      • increase CoefSIG to run a less restrictive classification, as appropriate: if (LSB[c]>=SIG[c][n]-CoefSIG*STD[c][n] && LSB[c]<=SIG[c][n]+CoefSIG*STD[c][n])   then band_n passes, else band_n misses out
      • increase nbMISS  to run a less restrictive classification, as appropriate 
        • 0 is a good choice: all bands from 1 to wZ  must pass
        • 1 is less restrictive: one MISS is allowed
        • etc
  • -Model/... and -classify/...: when modeling with a -classify/... argument available, 
    • modeling is performed from scratch, and bottom typing is performed "on the fly"
    • channel chU8_BSC is updated accordingly along with other channels
  • -Model/... and -Classify/...: 
    • FAST: 
      • the Classifier is operated from reading channels LSB and wZ: this is Fast indeed
      • and only channel chU8_BSC is updated accordingly
    • SLOW: 
      • modeling is performed from scratch: not really worth the computing time
      • bottom typing is performed "on the fly"
      • and only channel chU8_BSC is updated accordingly
  
tmnov classified
Syntax  Modal Filter
 
  • -Classify_4_0F/Mode_WinRadMod_chModIn_chModOut
  • -Classify_4_0F/Mode_5_19_25
    • set WinRadMod in the range 1 to 5: this is the radius of the circular modal filter window
    • chModIn is chU8_BSC.................tmnov classified
    • chModOut is a free channel.........tmnov classified modal filtered
  • no bottom typing is performed, but a modal filter is applied to chModIn instead
  • this shall write a modal-filtered image into chModOut:
    • display it using leg/pctClassified