theta-limited / openathena Goto Github PK
View Code? Open in Web Editor NEWOpenAthena allows common drones to spot precise geodetic locations
License: Other
OpenAthena allows common drones to spot precise geodetic locations
License: Other
python3 -m pip install -r requirements.txt
......................
Using legacy 'setup.py install' for matplotlib, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pillow, since package 'wheel' is not installed.
Using legacy 'setup.py install' for imagecodecs, since package 'wheel' is not installed.
Building wheels for collected packages: mgrs
Building wheel for mgrs (pyproject.toml) ... done
Created wheel for mgrs: filename=mgrs-1.4.5-cp311-cp311-linux_x86_64.whl size=51702 sha256=cd36d18e6997c41c4249d095f9304d1fb93cd888a3ca39c01a5501bd87a2c8c7
Stored in directory: /tmp/pip-ephem-wheel-cache-2bpcj0r2/wheels/5b/92/1d/bc202481fdffa49ca25be0127b71436204b80482e03e80878b
Successfully built mgrs
Installing collected packages: pillow, imagecodecs, fasteners, entrypoints, certifi, pyproj, numcodecs, mgrs, matplotlib, zarr, geotiff
Running setup.py install for pillow ... error
error: subprocess-exited-with-error
× Running setup.py install for pillow did not run successfully.
│ exit code: 1
╰─> [192 lines of output]
running install
/usr/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/features.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/_version.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/_util.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/_binary.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/__main__.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/__init__.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/TarIO.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/Image.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/FontFile.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-cpython-311/PIL
copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-cpython-311/PIL
running egg_info
writing src/Pillow.egg-info/PKG-INFO
writing dependency_links to src/Pillow.egg-info/dependency_links.txt
writing top-level names to src/Pillow.egg-info/top_level.txt
reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.c'
warning: no files found matching '*.h'
warning: no files found matching '*.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.clang-format'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
no previously-included directories found matching '.ci'
adding license file 'LICENSE'
writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
running build_ext
The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
Traceback (most recent call last):
File "/tmp/pip-install-yire0dg_/pillow_dca1cd4b200c4f9198ae27ba6dc01a2e/setup.py", line 989, in <module>
setup(
File "/usr/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 177, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 193, in run_commands
dist.run_commands()
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 1229, in run_command
super().run_command(command)
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/usr/lib/python3.11/site-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 690, in run
self.run_command('build')
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 317, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 1229, in run_command
super().run_command(command)
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/usr/lib/python3.11/site-packages/setuptools/command/build.py", line 24, in run
super().run()
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
self.run_command(cmd_name)
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 317, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.11/site-packages/setuptools/dist.py", line 1229, in run_command
super().run_command(command)
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/usr/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/usr/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/tmp/pip-install-yire0dg_/pillow_dca1cd4b200c4f9198ae27ba6dc01a2e/setup.py", line 804, in build_extensions
raise RequiredDependencyException(f)
RequiredDependencyException: jpeg
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-yire0dg_/pillow_dca1cd4b200c4f9198ae27ba6dc01a2e/setup.py", line 1009, in <module>
raise RequiredDependencyException(msg)
RequiredDependencyException:
The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pillow
After following install instructions after python3 parseGeoTIFF.py Rome-30m-DEM.tif command getting error:
File "/../....../..../athen_env/lib/python3.9/site-packages/matplotlib/cbook/__init__.py", line 2194, in _g_sig_digits (math.floor(math.log10(abs(value))) + 1 if value else 1) ValueError: math domain error
The GPS standard uses the WGS84 reference ellipsoid as an idealized model of the earth's shape and size. This model is most commonly used for specifying horizontal location using lat/lon, but height above/below the ellipsoid is also commonly used as a vertical datum, such as with standard GPS
An alternative, commonly used vertical datum is EGM96, which is an Earth gravitational model which takes the rotation and gravity of the earth into consideration and uses the resultant expected sea level as the reference point for altitude.
Open Athena must be able to consume either vertical datum for its input drone images
According to the widely used EPSG identifier codes for projections:
EPSG:4326 is a commonly used geodetic coordinate system based on the WGS84 ellipsoid, and EPSG:4979 is a 3D version of EPSG:4326 that includes height information. For EGM96, the EPSG code is 5773.
This really shouldn't be so hard.
I will have to create my own darn class for doing this...
In the Android version of OpenAthena, an industry-standard Cursor on Target message is sent to the local device whenever the user taps the "🧮" button.
Equivalent functionality should be built in to this headless Python version. It should also somehow be user-configurable when getTarget.py is invoked
See here for more documentation on the Android capability and the Cursor on Target message format:
Theta-Limited/OpenAthenaAndroid#15
OpenAthena currently has no workable build or runtime package available for Windows systems. This is mostly because the GDAL maintainer's pygdal package is broken, and has been for some time
The expansive gdal library will be replaced much narrower pypi geotiff library to rectify this situation in a future version of OpenAthena
Line 317 in f4e780d
This almost certainly has been accomplished elsewhere.
The problem is, finding code that would work...
Doable via this link
I foresee the most ugly parts of this project being:
Programming a position resolution calculator, with all the math involved, such that is is able to resolve the target's location (given that it is already has a set of sensor data from the rotary-wing aircraft including altitude, position, azimuth, and angle of declanation).
Program an app to run on the rotary-wing aircraft's paired device (e.g. an app which makes use of the drone's API's that runs on the iPhone or Android smartphone connected to the radio controller device) to integrate the rotary wing aircraft's sensor data and automatically use it for calculations.
So, my thoughts are:
Task 1 is the most important part of this project, but also likely to be the most difficult.
Task 1 can be accomplished and tested with synthesized or recorded flight sensor data from a rotary-wing aircraft as a proof-of-concept
Task 1 and 2 can be decoupled as separate apps if necessary, with human input used to transcribe sensor values (this is not optimal for several reasons, however)
To make OpenAthena more useful with object detection and other computer vision integrations, this library should be able to cast a ray towards any pixel in the image (as is possible in the Android version) rather than only the center point.
Relevant PR from the Android version:
Theta-Limited/OpenAthenaAndroid#56
Pre-requisite package gdal does not install properly with pip3 on MacOS. Brew should be used instead to install gdal on this platform
More information:
https://stackoverflow.com/a/46295749
Newer tools from Theta automatically generate DEMs using the filename extension .tiff Further, users importing their own generated GeoTIFFs may name the files with arbitrary filename extensions. OA python needs to be able to eat GeoTIFF files regardless of their filename extension.
With #19 recently merged, OpenAthena uses Kip Crossing's geotiff
library instead of GDAL
as a pre-requisite
One downside of this implementation: OpenAthena is no longer able to detect if a provided GeoTIFF is rotated or skewed
Before PR #19, OpenAthena would print an error and stop if the provided GeoTIFF was rotated or skewed. The software used the dydx
and dxdy
parameters of the GDAL
.GetGeoTransform()
function
An equivalent solution must be found and implemented for OpenAthena with the geotiff
library
Synthesis of data for testing the resolving calculator can be accomplished even without the use of aircraft, purely by using simulation software to obtain a position in the air with a specific measured
while the camera is aimed at a fixed point on the ground.
This can be used to test the viability of the software resolving calculator concept.
Examples of simulation software include Google Earth or the Outerra Engine
SK-42 is normally expressed as a Geodetic (i.e. in degrees) coordinate pair, with altitude (in meters above ellipsoid)
However: a grid-ref system using 6° "slices" called the Gauss-Krüger system exists that can express a position in terms of its zone number (which slice, i.e. within a 6° chunk of longitude)
OpenAthena currently outputs SK-42 Geodetic coordinates (as an alternative to WGS84 Geodetic coordinates), but does not output a zone number and X/Y meters using the same Krasovsky 1940 ellipsoid
Some code is available here which will convert directly from WGS84 (Geodetic) to SK-42 Gauss-Krüger (in meters, with zone number)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.