Giter Site home page Giter Site logo

pennyhow / pytrx Goto Github PK

View Code? Open in Web Editor NEW
42.0 5.0 24.0 1.2 GB

PyTrx is a Python object-oriented programme created for the purpose of calculating real-world measurements from oblique images and time-lapse image series. Its primary purpose is to obtain velocities, surface areas, and distances from oblique, optical imagery of glacial environments.

License: MIT License

Python 100.00%
python3 glaciology photogrammetry time-lapse opencv optical-flow template-matching oblique-imagery image-classification

pytrx's Issues

.CR2 raw image parsing

Many requests involve analysing RAW images. Currently, PyTrx is compatiable with JPG and PNG images. This is largely because of differences in the image EXIF information, which PyTrx uses to gather information about each image. Routines are needed to ensure that RAW images can be ingested with compatible information.

Migrate functions from CamEnv_old.py to CamEnv.py

Some of the functions from the old script have not yet been moved to the new script.
Specifically:

  1. getName
  2. getCalibration
  3. getCameraPose
  4. getFullCamera (?)
  5. showGCPs
  6. showPrincipalPoint
  7. approxYPR
  8. Yaw
  9. PitchRoll
  10. voxelviewshed (?)

Also, migrate any useful functionality from the Camera class which is currently commented out in the CamEnv.py script (above the CamEnv class).

driver_velocity2-Calculate velocities

图片
hello sir,In the example driver_velocity2 ,the Calculate velocities, I found that the method parameter is not available. I want to know why ?

Cannot run calcDenseVelocity with campars=None

xyz0, uv0 = seedGrid(campars[0], griddistance, campars[1], mask)

calcDenseVelocity should be able to run with campars = None but, campars is indexed as a list therefore runs into an error if it is not supplied. I wanted to run calcDenseVelocity on two orthoimages resampled in the same grid, and therefore did not need any camera parameters or DEMs. The docstring suggests that the function can be run without campars. It should be stated clearly whether or not campars is needed for the function.

Modules importing incorrectly for readthedocs

OpenCV is having import issues with readthedocs. PyTrx modules that import cv2 bring up this error in the readthedocs compiling:

AttributeError:` partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)

Long-term PyTrx to-do list

  • Better manual delineation functionality in the Area and Line objects (e.g. eliminate the risk of infinite looping)
  • Faster georectification processing. This can either be done by sourcing more efficient methods, or potentially using parrallel processing
  • Faster handling of DEM, so that users that input DEMs with higher spatial resolution and coverage

Better constraining and documentation of georectification viewshed flag

Resolve viewshed limitations within the CamEnv.setProjection function. The viewshed is computed from the camera position and the DEM to ensure that image points are only projected to visible parts of the DEM surface. However, sometimes this is not needed - either the DEM has errors or the reprojection is highly sensitive to elevation changes.

An alternative would be to try and compute the projection with the viewshed, but resort to disregarding it if this does not compute. And also, this should be better documented within the readthedocs (maybe within an example driver script)

Consult Aslak and Alex about the transformation functionality

There are a couple of comments in the CamEnv class where there has been a translation from ImGRAFT, and one specific instance where it is questioned why a certain step has been used. These are specifically in the projection and inverse projection functions.

'ValueError: No Points Given' when running projectUV

In my forked repo, in line 53 running projectUV returns a ValueError: No Points Given. Tracing this to the setProjection function in PyTrx/CamEnv.py, lines 852-862, before the projection, X, Y, and Z are all arrays with points, after the projection they are empty arrays. Thank you for any help you can offer.

Explore other interpolation methods

Related to issue #1
Explore other, more robust ways to interpolate and make velocity fields. Perhaps something that weights the interpolation based on point density?

Implement interpolation functions

Interpolation functions for making velocity fields currently are absent. They should be part of the Utilities and TimeLapse scripts. It is intended to first transpose these functions from Lynne's version of PyTrx.

Implement Measure.py module into the rest of PyTrx

Currently the Measure module works off of functions and classes from an older version of PyTrx. The Area and Length classes can also possibly be refined, as they are a little long-winded at the moment.

Change YPR guidance

Currently, we advise users to use camera yaw, pitch, roll pose (YPR) values of

[0, 0, 0] #[yaw, pitch, roll]

if the parameters are unknown. This can either be set in the camera environment txt file, or as a variable in a driver script. However, this causes problems in the optimisation routine - if the yaw parameter is 0 then the optimisation routine may not be able to resolve the camera environment from the ground control points. It should be advised to use an estimate of the yaw parameter in order to give the optimisation routine a starting point e.g.

[90, 0, 0] #i.e. camera pointing east

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.