Printable Version of Topic

Click here to view this topic in its original format

Unmanned Spaceflight.com _ Image Processing Techniques _ Mars Raw Image Processing

Posted by: Kevin Gill May 20 2022, 04:15 PM

I wanted to let you know of a project that I've been poking at for the past year. In an effort to streamline my own processing of raw MSL/Perseverance/InSight imaging, I created Mars Raw Utils (boring name, I know...). It has utilities for batch downloading images from the raw image websites and ILT/RAD/etc calibration. Calibration includes decompanding/LUT, debayer, flat fielding, blemish repair/inpainting, color correction, and hot pixel correction. I also made utilities for creating dust devil gifs, Photoshop/GIMP-like levels adjustments, cropping, focus merging, inpainting, and determining current mission date/time/sol. Calibration files are included in the installation and easily modified and/or replaced.

This is all done with the acknowledgment that the raw images are compressed and otherwise modified from the full mission data products so calibration is only a 'best effort' process and full PDS-quality output is not expected. The output is formatted with the expectation that you'll want to do additional processing in Gimp, Photoshop, etc.

It's all command-line driven, multi-platform, open source, and written in Rust.

Here's the project homepage on GitHub: https://github.com/kmgill/mars-raw-utils

And an overview/quickstart: https://github.com/kmgill/mars-raw-utils/wiki

I'm implementing new calibration steps as I get to them, though my latest efforts have been on implementing full support for CAHV/OR/E camera models and compositing.

Posted by: Kevin Gill May 24 2022, 12:46 AM

Since I posted that, in the master branch I've rolled all the commands into subcommands of a single binary 'mru' (in a manner similar to the 'git' command). This'll let me consolidate a bunch of stuff to remove duplicate code and makes the whole thing a little more consistent. I've updated the MSL, M20, InSight, and Dust Devil example scripts to reflect this change. I've also put in an anaglyph function for red/blue stereo pairs. The composite command autostitches mosaics. Both of these commands require a metadata file containing the CAHVOR camera components (automatically generated when downloading via 'mru msl-fetch ...' and 'mru m20-fetch ...'. Once I've done enough testing, I'll cut a release and upload new installers for Linux (deb, rpm), MacOS (Homebrew), and Windows.

-- Kevin

https://flic.kr/p/2nn4ZyD
https://flic.kr/p/2nn4ZyD

Posted by: Sean May 26 2022, 09:06 PM

Amazing work Kevin!

Posted by: Kevin Gill Jul 29 2022, 08:54 PM

Pushed out release v0.5.2 of Mars Raw Utils yesterday. You can install from source or use the provided binaries for Linux (Ubuntu, Debian, Fedora), Windows, and MacOS (via Homebrew).

Project Website: https://github.com/kmgill/mars-raw-utils

Major changes for this release:
* Bug fixes
* Added 'info' subcommand:

CODE
$ mru info -i SI3_0511_0712329673_656ECM_N0261222SRLC08036_0000LMJ01.png
Image: "SI3_0511_0712329673_656ECM_N0261222SRLC08036_0000LMJ01.png"
Sol:                         511
Instrument:                  SHERLOC_WATSON
Image Id:                    SI3_0511_0712329673_656ECM_N0261222SRLC08036_0000LMJ
Date Taken (UTC):            2022-07-29T01:29:40.983
SCLK:                        712329733.872
Data Taken (Mars):           Sol-00511M19:24:15.080
Subframe Rectangle:          [33.0, 17.0, 1584.0, 1184.0]
Camera Model Type:           CAHVOR
Site:                        26
Drive:                       1222
Scale Factor:                1
Filter Name:                 OPEN
Mast Azimuth:                211.377
Mast Elevation:              -86.6125
Date Received:               2022-07-29T05:37:04Z
Sample Type:                 Full
Dimension:                   [1584.0, 1184.0]
Decompanded:                 No
Debayered:                   No
Flatfielded:                 No
Radiometric Correction:      No
Inpainted:                   No
Cropped:                     No
Credit:                      NASA/JPL-Caltech

* Added alpha/masking in compositing
* Added MER Opportunity and Spirit as mer-date subcommand
CODE
$ mru mer-date
MER-A / Spirit:
Mars Sol Date:          52816.3795700982
Coordinated Mars Time:  09:06:34.856
Mission Sol:            6600
Mission Time:           09:06:34.856 LMST
Local True Solar Time:  08:47:50.088 LTST
Solar Longitude:        275.40041567986765
-----------------------------------------------
MER-B / Opportunity:
Mars Sol Date:          52816.3795701195
Coordinated Mars Time:  09:06:34.858
Mission Sol:            6581
Mission Time:           08:05:28.820 LMST
Local True Solar Time:  07:46:44.052 LTST
Solar Longitude:        275.40041569355265

* Focus merge can create depth map using -d

Posted by: JohnVV Jul 31 2022, 02:30 PM

QUOTE (Kevin Gill @ Jul 29 2022, 03:54 PM) *
Pushed out release v0.5.2 of Mars Raw Utils yesterday. You can install from source or use the provided binaries for Linux (Ubuntu, Debian, Fedora), Windows, and MacOS (via Homebrew).

Normally i use isis but i will have a look at your tools and let you know if the rpm will also run on OpenSUSE 15.3

Posted by: Kevin Gill Jul 31 2022, 11:08 PM

QUOTE (JohnVV @ Jul 31 2022, 09:30 AM) *
Normally i use isis but i will have a look at your tools and let you know if the rpm will also run on OpenSUSE 15.3


Thanks! If it doesn't install and you're not comfortable with installing from source I can probably set up a build within a Docker container (which is how I'm making the RPM now as I'm running Ubuntu at the moment).

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)