= LIDAR Classification = == Purpose == To identify different types of LIDAR return and what they relate to. For instance the basic groups will be: ground, vegetation, buildings and noise. For the purpose of ARSF LIDAR deliveries we just classify noisy points. These typically tend to be due to the atmospheric conditions (cloud and haze), signal noise or single isolated points. == Method == We can use the !TerraScan software or the in-house classify_las program for point classification. The !TerraScan usage can be found on other pages of the wiki. === classify_las === This is a c++ utility written to do basic classification on LAS files. The current classification algorithms include: * Isolated points - identify points as noise (classification 7) if there is no other point within x metres of it. * Absolute elevation - identify points as noise (classification 7) if they are above or below a given elevation. A fence can be used to only classify points within a rectangular boundary (in any orientation). '''Usage''' {{{ -lasfilein The LAS file to be imported and classified -lasfileout The name of the output LAS file optional flags -fence minx miny maxx maxy Use a fence whose bounds are given by minx,miny maxx,maxy -fence px py qx qy width Use a fence defined by centre line pq and width. width is the full width of the rectangle not the distance from the centre line to the edge. -exclude "" Exclude points that conform to the given macro from being classified. Macro can be one or more of the following separated by spaces: ib intensity greater than b (i.e. do not classify points with intensity greater than b) ed elevation (z) greater than d nret=f number of returns = f (i.e. do not want to classify any points which are only single returns nret=1) method flags -isolated x g Run the isolated points algorithm using a distance of x metres and group size g -above x Run the absolute elevation algorithm classifying points with elevation above x metres -below x Run the absolute elevation algorithm classifying points with elevation below x metres -intensity x Run the intensity based algorithm classifying points below a certain intensity level -cloud above|below [a [m [t [i]]]] Run the cloud search algorithm to classify cloud points either above or below ground. This can be run using the default values (shown in brackets) or values set on the command line. This method can be run iteratively since when the mean and std deviation are calculated, noisy points are ignored. a = area over which to calculate the mean (500 metres) m = multiplier for distance away from mean eg mean - m*std deviation (3.0) t = threshold to ignore classification eg areas with std deviations less than t are ignored (4.0 metres) i = intensity value threshold - ignore classifying points with intensity greater than i (10) }}} The output LAS file will no longer have its points ordered by time, but rather by the quadtree / pointbucket ordering which is used to speed up searching within the software. Any number of methods can be run through on the same command. '''Example''' - to classify isolated points whom have less than 5 points within 4 metres of them {{{ classify_las -lasfilein example.LAS -lasfileout classified.LAS -isolated 4 5 }}} === classify_las_files.sh === It is also possible to batch process las files within a folder using classify_las_files.sh. {{{ Uses classify_las to preform the classification. Arguments: -d: Directory containing LAS files to be classified or single LAS file to be classified -c: "classification_algorithim(s)_to_be_run" Optional: -o: Directory to outout classified LAS files, defaults to input directory -h: Display usage -a: Details of classification algorithims that are available (or see http://arsf-dan.nerc.ac.uk/trac/wiki/Processing/LidarClassification) }}} Example {{{ classify_las_files.sh -d ~airborne/workspace/PROJCODE/leica/proc_laser -c "-isolated 4 5 -below 250 -above 1000" }}} === Manual Classification === The above methods will not always automatically identify noisy points. This is especially the case where there was excessive cloud coverage and/or a large number of isolated points. Features of LAG can help you to identify and manually classify these points. Particularly helpful is the "Brightness by" > Height option. === Full Waveform === If there is full wave form data you will need to copy the classifications from discrete into the fullwaveform files. Run the following script to copy the classifications over: {{{ get_class_las -c classified.LAS -i unclassifiedfw.LAS -o output.LAS }}} This will copy your classified points into the fw data. To run this on a whole directory (before discrete lidar delivery creation), run: {{{ batch_fw_class.py -v -c classified-directory -i unclassified-directory -o output-directory }}} === Classify using hyperspectral data or a DSM === You can use the HYLIGHT tool als_classify to classify LAS files using a reference DSM or including hyperspectral files or a classification file. Full instructions can be found in the manual (see the live git checkout) but some example commands: Fully classify points using a surface model and hyperspectral data: {{{ als_classify --output classified_las --hsclassification HS_class_mask.bsq --vegheight --buildings --alsfile unclassified_lidar_data.LAS --refsurface my_reference_surface.bsq }}} Classify noisy points against a surface model: {{{ als_classify --output classified_las --alsfile unclassified_lidar_data.LAS --refsurface my_reference_surface.bsq }}} ==== using the wrapper ==== To classify a directory of LAS files using a DSM only you can use the wrapper script classify_las_with_dem.py: {{{ classify_las_with_dem.py --lidar unclassified_las_directory/ --dem dsm_in_same_projection_as_lidar.dem --output classified_las_directory/ }}}