Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equalizer output statistics are inconsistent with the actual change applied. #3987

Closed
espeyerer opened this issue Aug 26, 2020 · 2 comments · Fixed by #4000
Closed

Equalizer output statistics are inconsistent with the actual change applied. #3987

espeyerer opened this issue Aug 26, 2020 · 2 comments · Fixed by #4000
Assignees
Labels
bug Something isn't working Missions Issues which are a priority for missions

Comments

@espeyerer
Copy link

ISIS version(s) affected: 3.10.2

Description
I ran equalizer on an image set with some images held and some allowed to be altered by the equalizer program. The adjust parameter was set to gain, therefore the function used to adjust the images is:

output = input * gain

However, the output statistics file from this run contained an extra coefficient (AVERAGE) that should be 0.0:

Object = EqualizationInformation
  Group = General
    TotalOverlaps   = 16043
    ValidOverlaps   = 15971
    InvalidOverlaps = 72
    MinCount        = 100
    SamplingPercent = 100.0
    Weighted        = false
    SolutionType    = 3
    SolveMethod     = 2
    NonOverlaps     = Null
    HasCorrections  = true
  End_Group

  # Formula: newDN = (oldDN - AVERAGE) * GAIN + AVERAGE + OFFSET
  # BandN = (GAIN, OFFSET, AVERAGE)
  Group = Normalization
    FileName = Images_band1/image1.cub
    Band1    = (1.0066179898722, 0.0, 0.073333679055247)
  End_Group

  # Formula: newDN = (oldDN - AVERAGE) * GAIN + AVERAGE + OFFSET
  # BandN = (GAIN, OFFSET, AVERAGE)
  Group = Normalization
    FileName = Images_band1/image2.cub
    Band1    = (1.0070342236916, 0.0, 0.083028097878101)
  End_Group
  ....

As you can see, there is a gain and average value present in this file. I checked and the band math is correct and only the gain value is used and the average is ignored. So, the correction to the image is being applied the right way with adjust = gain, but the output statistics are misleading.

The first entry should look like this:

  # Formula: newDN = (oldDN - AVERAGE) * GAIN + AVERAGE + OFFSET
  # BandN = (GAIN, OFFSET, AVERAGE)
  Group = Normalization
    FileName = Images_band1/image1.cub
    Band1    = (1.0066179898722, 0.0, 0.0)
  End_Group
@jessemapel
Copy link
Contributor

I looked at the code and it does appear to be doing the correct math, just reporting the wrong thing. I'd rather the output the proper equation and only mention the values used. So, it would look like this:

  # Formula: newDN = oldDN * GAIN
  # BandN = GAIN
  Group = Normalization
    FileName = Images_band1/image1.cub
    Band1    = 1.0066179898722
  End_Group

This better matches the equations from the application documentation:

ADJUST argument Equaltion
BOTH output = (input - average(input)) * gain + offset + average(input)
BRIGHTNESS output = offset + average(input)
CONTRAST output = input * gain + average(input) * gain
GAIN output = input * gain

We should also update this for the other options for ADJUST.

@jessemapel jessemapel added the bug Something isn't working label Aug 27, 2020
@jlaura jlaura added the Missions Issues which are a priority for missions label Aug 27, 2020
@espeyerer
Copy link
Author

@jessemapel That sounds like a great solution and will help users understand what equalizer is doing internally.

Thanks

@jessemapel jessemapel self-assigned this Aug 31, 2020
@jessemapel jessemapel mentioned this issue Sep 4, 2020
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Missions Issues which are a priority for missions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants