Skip to content

Different return types for histogram equalizations #1192

Closed

Description

@pratapvardhan

For a uint8 type input image,
rescale_intensity returns uint8 image,
equalize_hist returns float64 image,
equalize_adapthist returns unit16 image.

from skimage import data, exposure
coins = data.coins()
coins_rescale = exposure.rescale_intensity(coins,
                                           in_range=tuple(np.percentile(coins, (2, 98))))
coints_eqhist = exposure.equalize_hist(coins)
coins_adapthist = exposure.equalize_adapthist(coins)

def img_metrics(imgage):
    return imgage.dtype, imgage.min(), imgage.max()

print 'image              - ', ('dtype', 'min', 'max')
print 'input              - ', img_metrics(coins)
print 'rescale_intensity  - ', img_metrics(coins_rescale)
print 'equalize_hist      - ', img_metrics(coints_eqhist)
print 'equalize_adapthist - ', img_metrics(coins_adapthist)

Results:

image              -  ('dtype', 'min', 'max')
input              -  (dtype('uint8'), 1, 252)
rescale_intensity  -  (dtype('uint8'), 0, 255)
equalize_hist      -  (dtype('float64'), 8.5946094609460941e-06, 1.0)
equalize_adapthist -  (dtype('uint16'), 0, 65535)

Should there be standard output type for same input image type across skimage.exposure functions?
Maybe, return output image in same format as input?

Activity

  1. blink1073 commented on Nov 2, 2014

    @blink1073
    Contributor

    @pratapvardhan, did you still want to leave this open, advocating for a change in the data type policy?

  2. stefanv commented on Nov 4, 2014

    @stefanv
    Member

    Closing for now--please re-open if necessary.

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