DOI-USGS / ISIS3

Integrated Software for Imagers and Spectrometers v3. ISIS3 is a digital image processing software package to manipulate imagery collected by current and past NASA and International planetary missions.
https://isis.astrogeology.usgs.gov
Other
200 stars 168 forks source link

Destriping filter #4952

Closed colindundas closed 1 year ago

colindundas commented 2 years ago

It would be helpful to implement a destriping filter similar to that described in Kirk et al. (2003, JGR), which is useful for photoclinometry. This can be implemented by scripting together existing tools.

rbeyer commented 2 years ago

Maybe there's somewhere else in Kirk et al. (2003) that talks about destriping, but it looks like what the "filtering" in paragraph 44 is talking about are artifacts in stereo-derived DEMs related to jitter. Can you describe how this would be used for photoclinometry?

jessemapel commented 2 years ago

How would this differ from dstripe? I'm not seeing an exact algorithm in that paper.

rbeyer commented 2 years ago

I had a sidebar conversation with Colin. dstripe operates horizontally or vertically. The "destriping" algorithm exemplified in Kirk et al. (2003) could be applied to remove "striping" with any orientation in the image, I think, not just horizontally and vertically.

However, this may be more of a "workflow" of ISIS programs as Colin alludes to that wouldn't need to be its own executable. As such, it falls into that funny place of should it be a program, should it be a script, or should it just be a tutorial or narrative technique description in documentation?

lwellerastro commented 2 years ago

I would consider this more of a workflow because it involves multiple additional steps. There was a time (isis2/tae) when we had a TAE pdf that did such a thing (if interested in details involving some programs having since been replaced see pcdstripe.pdf in my home /bin area).

It boils down to rotating the image (we used an azimuth value, not sure which though) to make the stripes horizontal (or maybe vertical, don't recall the preference), destripe, rotate back and mask the output. It looks like I used this extensively destriping output from Randy's old PC process, but I don't see anything via ISIS3, only isis2.

Edit: According to a document I put together in 2011 documenting Randy's PC process (including pre and post processing), the rotation value was based on output from Randy's PC program called "Azimuth of characteristics" (we used the negative of that value). Not sure the PC software you use reports such a thing, but it was extremely helpful for the destripe process we used back in the day. It was quite the process to clean up the data after the PC process.

jessemapel commented 2 years ago

dstripe is just an application that calls the highpass and lowpass applications with the appropriate parameters. We could add an additional extra step that performs a rotation. We already have a rotate application.

colindundas commented 2 years ago

Here are more details following a sidebar discussion with Randy Kirk. Destriping would consist of scripting together pieces we already have. The existing “destripe filter” is already a small script:

dstripe = lowpass highpass fx

The full process is: lowpass highpass enlarge (highpassed file) rotate (to align stripes w/ row or column) dstripe dstripe (bigger each time) dstripe dstripe dstripe rotate (reverse rotation) crop (to original enlarged pixels) reduce (to original pixels) fx (add back lowpass filtered version, or alternatively lowpass filtered altimetry instead)

The potentially tricky part is forcing the rotations to have the same parity (odd/even # of pixels) so that you can pull out the original image area rather than one of the same size that’s shifted by a fraction of a pixel.

Some additional details that need to be considered (recommend working with Randy on the details):

  1. What rotation angle puts the stripes in the right orientation? It’s roughly the sun direction but may be slightly different. ISIS2 pc2d calculates this.
  2. What magnification factor? This is to be determined. Either 2 or 3 would be OK. Randy has previously used 3 because it’s odd.
  3. What are the filter sizes for the series of dstripe calls? Randy has a standard set that works well, and will share it.
github-actions[bot] commented 1 year ago

Thank you for your contribution!

Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'

If no additional action is taken, this issue will be automatically closed in 180 days.