Skip to content

Potential bug in breakpoint_stretch #134

Description

@millercommamatt

def breakpoint_stretch(C, breakpoint):

def breakpoint_stretch(C, breakpoint):

These identical breakpoint_stretch functions take a breakpoint value as the second positional input, but it's not used. Subsequent calls to this function as part of NatrualColor provide different breakpoint values.

Is this intentional? I couldn't track down the source for the steps of the NatrualColor processing other than the creation of the pseudo green channel.

I'm guessing it's supposed to look something like this:

def breakpoint_stretch(C, breakpoint):
    """
    Contrast stretching by break point (number provided by Rick Kohrs)
    """
    lower = normalize(C, 0, breakpoint)  # Low end
    upper = normalize(C, breakpoint, 255)  # High end

    # Combine the two datasets
    # This works because if upper=1 and lower==.7, then
    # that means the upper value was out of range and the
    # value for the lower pass was used instead.
    combined = np.minimum(lower, upper)

    return combined

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions