STIRA  0.1
Public Member Functions | Static Public Member Functions | List of all members
stira::contrastenhance::HistogramTools Class Reference

class with tools for image intensity remapping using histograms, like histogram matching and histogram equalization More...

#include <HistogramTools.h>

Public Member Functions

 HistogramTools ()
 constructor
 
 ~HistogramTools ()
 destructor
 

Static Public Member Functions

static void RemapHistogramInROI (ArrayGrid< double > *pInGrid, common::RectangularROI< int > rroi, histogram::IntHistogram *fhCumulativeInput, histogram::FloatHistogram *fhCumulativeReference)
 remap intensities in an image ROI to follow a target histogram References http://en.wikipedia.org/wiki/Histogram_equalization -> Backprojection http://en.wikipedia.org/wiki/Histogram_matching More...
 
static double MatchHistogramValue (double inValue, histogram::IntHistogram *fhIncomingCumulativeHistogram, histogram::FloatHistogram *fhCumulativeReferenceHistogram)
 matches an intensity from an image with ihIncomingCumulativeHistogram to transform it to ihCumulativeReferenceHistogram More...
 
static ImageRobustLinearRescale (Image *pSourceImage, double lowerFraction=0.01, double upperFraction=0.99)
 Performs robust linear intensity rescaling, creating a new object as result A new image is created, which becomes the responsability of the caller. More...
 
static bool RobustLinearRescaleNoNew (Image *pSourceImage, double lowerFraction=0.01, double upperFraction=0.99)
 Performs robust linear intensity rescaling on the image itself, creating no new object (No new image is created; old values are overwritten) More...
 
static void HistogramEqualizeSingleBand (ArrayGrid< double > *pInOutGrid)
 performs histogram equalization on a single band More...
 
static ImageHistogramEqualizePerBand (Image *pInImage)
 performs histogram equalization on an image, but for all bands independantly More...
 
static ImageHistogramEqualizeHSI (Image *pInImage)
 performs histogram equalization on an RGB image using transformation to HSI color space RGB colors are transformed to HSI, and only the I component is equalized; after that, the result is transformed back to RGB More...
 
static ImageColorHistogramEqualize (Image *pInImage)
 performs histogram equalization on an RGB image using transformation to CIE-Lab color space RGB colors are transformed to CIE-Lab, and only the L component is equalized; after that, the result is transformed back to RGB (values are clipped to range 0-255) More...
 

Detailed Description

class with tools for image intensity remapping using histograms, like histogram matching and histogram equalization

Member Function Documentation

Image * stira::contrastenhance::HistogramTools::ColorHistogramEqualize ( Image pInImage)
static

performs histogram equalization on an RGB image using transformation to CIE-Lab color space RGB colors are transformed to CIE-Lab, and only the L component is equalized; after that, the result is transformed back to RGB (values are clipped to range 0-255)

Parameters
pInImagethe input image

References stira::imagedata::Image::Clone(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetImageName(), stira::imagedata::Image::GetNumberOfBands(), stira::imagedata::Image::LabTosRGB(), stira::imagedata::Image::SetImageName(), and stira::imagedata::Image::sRGBToLab().

Image * stira::contrastenhance::HistogramTools::HistogramEqualizeHSI ( Image pInImage)
static

performs histogram equalization on an RGB image using transformation to HSI color space RGB colors are transformed to HSI, and only the I component is equalized; after that, the result is transformed back to RGB

Parameters
pInImagethe input image

References stira::imagedata::Image::Clone(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetImageName(), stira::imagedata::Image::GetNumberOfBands(), stira::imagedata::Image::HSIToRGB(), stira::imagedata::Image::RGBToHSI(), and stira::imagedata::Image::SetImageName().

Image * stira::contrastenhance::HistogramTools::HistogramEqualizePerBand ( Image pInImage)
static

performs histogram equalization on an image, but for all bands independantly

Parameters
pInImagethe input image

References stira::imagedata::Image::Clone(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetImageName(), stira::imagedata::Image::GetNumberOfBands(), and stira::imagedata::Image::SetImageName().

void stira::contrastenhance::HistogramTools::HistogramEqualizeSingleBand ( ArrayGrid< double > *  pInOutGrid)
static
double stira::contrastenhance::HistogramTools::MatchHistogramValue ( double  inValue,
histogram::IntHistogram fhIncomingCumulativeHistogram,
histogram::FloatHistogram fhCumulativeReferenceHistogram 
)
static

matches an intensity from an image with ihIncomingCumulativeHistogram to transform it to ihCumulativeReferenceHistogram

Parameters
inValueincoming intensity value to be remapped
fhIncomingCumulativeHistogramincoming cumulative histogram before remapping (not normalized)
fhCumulativeReferenceHistogramtarget cumulative histogram after remapping (not normalized)

References stira::common::MathUtils::ClipValue(), stira::histogram::HistogramMaster< T >::GetBinValue(), and stira::histogram::HistogramMaster< T >::GetNrOfBins().

void stira::contrastenhance::HistogramTools::RemapHistogramInROI ( ArrayGrid< double > *  pInGrid,
common::RectangularROI< int >  rroi,
histogram::IntHistogram fhCumulativeInput,
histogram::FloatHistogram fhCumulativeReference 
)
static

remap intensities in an image ROI to follow a target histogram References http://en.wikipedia.org/wiki/Histogram_equalization -> Backprojection http://en.wikipedia.org/wiki/Histogram_matching

Parameters
pInGridsource image grid with intensity values to be remapped
rroithe rectangular region of interest within which values are to be remapped
ihCumulativeReferenceHistogramtarget cumulative histogram after remapping (not normalized)

References stira::common::MathUtils::ClipValue(), stira::common::RectangularROI< T >::GetBottomRightCorner(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::common::RectangularROI< T >::GetTopLeftCorner(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::ArrayGrid< T >::GetWidth(), stira::imagedata::ArrayGrid< T >::SetValue(), stira::common::Point< T >::x, and stira::common::Point< T >::y.

Image * stira::contrastenhance::HistogramTools::RobustLinearRescale ( Image pSourceImage,
double  lowerFraction = 0.01,
double  upperFraction = 0.99 
)
static

Performs robust linear intensity rescaling, creating a new object as result A new image is created, which becomes the responsability of the caller.

Parameters
pSourceImageinput image
lowerFractionfraction of darkest pixels to ignore
upperFractionfraction of pixels to take into account (1-upperFraction is fraction to be discarded)

References stira::imagedata::Image::Clone().

bool stira::contrastenhance::HistogramTools::RobustLinearRescaleNoNew ( Image pSourceImage,
double  lowerFraction = 0.01,
double  upperFraction = 0.99 
)
static

Performs robust linear intensity rescaling on the image itself, creating no new object (No new image is created; old values are overwritten)

Parameters
pSourceImageinput image; contains result as well
lowerFractionfraction of darkest pixels to ignore
upperFractionfraction of pixels to take into account (1-upperFraction is fraction to be discarded)

References stira::common::MathUtils::ClipValue(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetHeight(), stira::histogram::IntHistogram::GetLowerBound(), stira::imagedata::GridStatistics< T >::GetMinMax(), stira::imagedata::Image::GetNumberOfBands(), stira::histogram::IntHistogram::GetUpperBound(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::Image::GetWidth(), and stira::imagedata::ArrayGrid< T >::SetValue().


The documentation for this class was generated from the following files: