aerospaceresearch / DirectDemod

direct demodulation of radio-signals
MIT License
38 stars 19 forks source link

Prototype of image merger module. #35

Closed caballeto closed 5 years ago

caballeto commented 5 years ago

This is a prototype implementation of image merger module, based on DirectDemod map overlay. It's main purpose is to provide functionality for efficient merging of satellite wheather images. Implementation includes following classes:

Note: configuration constants have been stored in constants.py.

In addition to these classes I have included Experiment 8 - Merger projection testing.ipynb jupyter notebook in order to show basic usage of the provided APIs.

ImageMerger's API is concise and simple. ImageMerger class provides three methods for image merging routine. Each of them returns merged PIL.Image object. In this implementation I assumed that merged images have been made in approximately same time, so their overlapping parts will be almost similar.

APIs are as follows:

Here image descriptor is a json file with following structure. Field values are provided as example.

{
  "image_name": "/path/DirectDemod/samples/SDRSharp_20180615_140752Z_137120000Hz_IQ_f1_map.png",
  "sat_type": "NOAA 19",
  "date_time": "",
  "center": [50.83550180700588, 16.430852851867176],
  "direction": 198.3913296679117
}

Such descriptor file provides easy to understand image description. It contains all needed information needed for creating image projections, plotting etc. Usage of these files will be fundamental in order to build modular software, because in this case each of the modules will be able to interact independently from other modules. This will result in easier testing and more understandable code in general.

This implementation provides panoramic stitching. Photos are being projected on the mercator projection using cartopy and matplotlib libraries. There are 2 types of output formats. The first one is output of the whole map, and the second one is the output of smallest bounded box, which contains all of the images.

Below is the result of projecting one image, output in bounded format.

bounded

And an alternative whole projection.

whole

For overlapping images merger just overlays them. This wouldn't work if images were different, but we assume that images were taken in small time interval (10 minutes for example), therefore their overlapping parts won't differ much. The less the time interval, the lesser the difference between overlapping parts would be. An example merge of totally different images (just to show the logic, wouldn't exist in reality) is presented below.

overlay

I have tried to make the appropriate documentation and code styling, but I am not sure whether everything was done correctly. So I am looking forward to hearing your feedback on how I can improve the implementation, make it easier to understand and provide better documentation.

@7andahalf I will also need your advice concerning file naming and project structure in general.