Code Monkey home page Code Monkey logo

core3d-metrics's Introduction

SHR3D

SHR3D classifies a 3D point cloud to generate simple geospatial products including a Digital Surface Model (DSM); a Digital Terrain Model (DTM); a classification image labeling ground, buildings, and trees; and a simplified building outlines vector product.

SHR3D Usage

./shr3d <Input File (LAS|TIF)> DH=<Horizontal uncertainty(m)> DZ=<Vertical uncertainty(m)> AGL=<Min building height(m)> <Options>
Options:
    AREA=<Min building area(m^2)>   Buildings smaller than this size will not be labeled (default: 50)
    EGM96                           Set this flag to write vertical datum
    BOUNDS=<MINX,MAXX,MINY,MAXY>    Set to define image bounds
    DTM=<DTM File (TIF)>            Path to optional DTM file
    GND_LABEL=<LABEL>               Set to the value of the point cloud ground classification label (typically 2) if the point cloud has already been partially classified.

Example:

./shr3d shr3dMe.las DH=0.5 DZ=0.5 AGL=2 AREA=50

This will produce multiple files as a result:

  • Raster files (*.tif):
    • Classification image- 'Colored' by classification for each pixel: buildings, ground, and trees
    • Building image- Binary mask of all detected buildings
    • DSM- Digital surface model (reflective surface)
    • DTM- Digital terrain model (bare earth, or ground)
    • INT- Intensity image
  • Vector files (shapefiles: *.shp, *.prj, *.shx, *.dbf):
    • Building outlines- Simplified polygons of detected building perimeters

ALIGN3D

ALIGN3D estimates and applies a transform to align 3D point clouds. This algorithm was developed for use with airborne lidar, multiple view satellite imagery, and synthetic aperture radar derived point clouds.

ALIGN3D Usage

./align3d <Reference point cloud(LAS)> <Target point cloud(LAS)> maxdz=<Maximum local z difference(m)> gsd=<Ground sample distance(m)> maxt=<Maximum XY translation for search(m)>

Example:

./align3d reference.las target.las maxt=10.0 gsd=1.0

This will produce multiple output files:

  • Aligned.las- A point cloud representation of the target, aligned to the reference
  • Aligned.tif- A DSM of the target, aligned to the reference
  • Offsets.txt- A list of the xyz offsets to translate the target to align with the reference

core3d-metrics's People

Contributors

aleichtman avatar cstutts avatar danlipsa avatar drewgilliam avatar gsrhodes avatar msmolens avatar pubgeo avatar sean-s-wang avatar slipperysaxophone avatar wdixon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

core3d-metrics's Issues

CLSMatchValue of 256

Commit 828f511 introduced a new CLSMatchVaue of "256", where metrics will be checked against all non-zero reference CLS pixels.

# object masks based on CLSMatchValue(s)
refMask = np.zeros_like(refCLS, np.bool)
# For CLS value 256, evaluate against all non-zero pixels
# CLS values should range from 0 to 255 per ASPRS
# (American Society for Photogrammetry and Remote Sensing)
# LiDAR point cloud classification LAS standard
if config['INPUT.REF']['CLSMatchValue'] == [256]:
refMask[refCLS != 0] = True
else:
for v in config['INPUT.REF']['CLSMatchValue']:
refMask[refCLS == v] = True
testMask = np.zeros_like(testCLS, np.bool)
if config['INPUT.TEST']['CLSMatchValue'] == [256]:
testMask[testCLS != 0] = True
else:
for v in config['INPUT.TEST']['CLSMatchValue']:
testMask[testCLS == v] = True

Ground truth files (provided separately) appear to label the CLS ground plane as a non-zero value (typically 2). So it looks like a CLSMatchValue of 256 will typically evaluate across all pixels, including the ground plane.

@pubgeo - is this expected?

Configure core3d-metrics into an installable Python module, provide a command-line entry point.

Currently, one has to change directories into the core3d-metrics directory to run the metrics code, or manually configure paths. It would be cleaner to reconfigure core3d-metrics as a python module, that can be installed into the user (virtual) environment. This would allow users to import core3dmetrics in their code, to gain access to functions within core3dmetrics.

One can use setuptools to provide a command-line entry point; setuptools will create a script (<~>/bin/core3d-metrics) which redirects command line arguments to core3dmetrics.main(). The end reuslt is that users can run the metrics code, from anywhere, via

core3d-metrics <AOI Configuration>

Installation would be via setuptools

python setup.py install

Schema Validation Error

config.py appears to be checking the input configuration file against a JSON schema. We're using the test harness config text files provided on 12/18. This causes raise jsonschema.exceptions.ValidationError('validation error') on line 126 of config.py to occur.

Should this validation be skipped if the input file is text format?

Craig

relative config paths

The paths for files specified in a config are not treated as relative to the config, but instead relative to the run_geometrics.py

So given the following filesystem layout:

  • geometrics
    • run_geometrics.py
  • binaries/
    • configs/
      • a.config (references ../data/some_data)
    • data/
      • some_data

Running 'python3 run_geometrics.py -c ../binaries/configs/a.config' from the geometrics folder will try to use geometrics/data/some_data instead of binaries/data/some_data

It would make the most sense for relative paths in a config be relative to the config instead of the program running it.

Couldn't Connect To Display

We run the evaluation metrics on a cluster which is headless only (no GUI). and I am getting the following error when running the docker container

Traceback (most recent call last):
  File "/usr/local/bin/core3d-metrics", line 11, in <module>
    load_entry_point('core3dmetrics==0.0.0', 'console_scripts', 'core3d-metrics')()
  File "/usr/local/lib/python3.6/dist-packages/core3dmetrics/run_geometrics.py", line 345, in main
    run_geometrics(configfile=args.config,**kwargs)
  File "/usr/local/lib/python3.6/dist-packages/core3dmetrics/run_geometrics.py", line 190, in run_geometrics
    plot.make(refDSM, 'Reference DSM', 111, colorbar=True, saveName="input_refDSM", badValue=noDataValue)
  File "/usr/local/lib/python3.6/dist-packages/core3dmetrics/geometrics/plot.py", line 65, in make
    plt.figure(fig)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/pyplot.py", line 548, in figure
    **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/backend_bases.py", line 161, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/backends/_backend_tk.py", line 1044, in new_figure_manager_given_figure
    window = Tk.Tk(className="matplotlib")
  File "/usr/lib/python3.6/tkinter/__init__.py", line 2020, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display "192.168.34.9:11.0"

I have attached the full output log as well

error.log

My ShowPlots options is set to false, SavePlots is true. If both are set to false, I don't get this error message

Is there a way to run the scorer in fully headless mode and still have plots?

Add a tag to help with conda package versions

I am a member of core3d involved in building conda packages for code used in core3d including cored-metrics.
For this, it would be useful to tag the git source code. This will help us to automatically set the package version, order packages and see the correspondence between the package and code.
We'll need 'annotated tags' set like this:
git tag -a v0.1 -m "my version 0.1"

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.