Copyright | (c) Alexey Kuleshevich 2017 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Histogram = Histogram {}
- type Histograms = [Histogram]
- class ChannelColour cs where
- csColour :: cs -> AlphaColour Double
- getHistograms :: forall arr cs e. (ChannelColour cs, MArray arr X e, Array arr X e, MArray arr cs e, Array arr cs e) => Image arr cs e -> Histograms
- getHistogram :: MArray arr X e => Image arr X e -> Histogram
- equalizeHistogram :: (ToY cs e, Array arr cs e, Array arr Y Double, Array arr X Word8, MArray arr X Word8) => Image arr cs e -> Image arr Y Double
- cdf :: MArray arr X e => Image arr X e -> Vector Double
- displayHistograms :: Histograms -> IO ()
- writeHistograms :: FilePath -> Histograms -> IO ()
Documentation
A single channel histogram of an image.
type Histograms = [Histogram] Source #
For now it is just a type synonym, but in the future it might become a custom data type with fields like title, width, heigth, etc.
class ChannelColour cs where Source #
csColour :: cs -> AlphaColour Double Source #
Get a pure colour representation of a channel.
Instances
ChannelColour YCbCrA Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour YCbCr Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour YA Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour Y Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour RGBA Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour RGB Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour HSIA Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour HSI Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour CMYKA Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour CMYK Source # | |
Defined in Graphics.Image.IO.Histogram | |
ChannelColour X Source # | |
Defined in Graphics.Image.IO.Histogram |
getHistograms :: forall arr cs e. (ChannelColour cs, MArray arr X e, Array arr X e, MArray arr cs e, Array arr cs e) => Image arr cs e -> Histograms Source #
Create a histogram per channel with 256 bins each.
getHistogram :: MArray arr X e => Image arr X e -> Histogram Source #
Generate a histogram with 256 bins for a single channel Gray image.
equalizeHistogram :: (ToY cs e, Array arr cs e, Array arr Y Double, Array arr X Word8, MArray arr X Word8) => Image arr cs e -> Image arr Y Double Source #
Converts an image to Luma and performs histogram equalization.
cdf :: MArray arr X e => Image arr X e -> Vector Double Source #
Discrete cumulative distribution function.
displayHistograms :: Histograms -> IO () Source #
Display image histograms using an external program. Works in a similar way as
displayImage
.
>>>
frog <- readImageRGB VU "images/frog.jpg"
>>>
displayHistograms $ getHistograms frog
writeHistograms :: FilePath -> Histograms -> IO () Source #
Write histograms into a PNG image file.
>>>
frog <- readImageRGB VU "images/frog.jpg"
>>>
writeHistograms "images/frog_histogram.svg" $ getHistograms frog