IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

compute the LUT that matches 2 histograms More...

IPSDKIPLINTENSITYTRANSFORM_API attr::IntensityLUTPtr ipsdk::imaproc::itrans::matchHistograms (const ipsdk::imaproc::attr::HistogramDataConstPtr &pHisto1, const ipsdk::imaproc::attr::HistogramDataConstPtr &pHisto2)
 wrapper function for compute the LUT that matches 2 histograms More...
 

Detailed Description

compute the LUT that matches 2 histograms

This algorithm computes a LUT that, once applied to input histogram, permits to match the resulting histogram with the reference one.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InHistogram1 [Input] first histogram X
ipsdk::imaproc::attr::InHistogram2 [Input] second histogram X
ipsdk::imaproc::attr::OutIntensityLUT [Output] intensity lookup table used by algorithm ipsdk::processor::allocate (_pOutIntensityLUT)

Global Rule description

Global rule description for algorithm :
ipsdk::processor::none ()

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr

Code Example

# opening of input images
inImg1 = PyIPSDK.loadTiffImageFile(inputImgPath1)
inImg2 = PyIPSDK.loadTiffImageFile(inputImgPath2)
# computation of image histograms
histo1 = glbmsr.histogramMsr2d(inImg1)
histo2 = glbmsr.histogramMsr2d(inImg2)
# histogram matching computation
outLut = itrans.matchHistograms(histo1, histo2)

Example of C++ code :

Example informations

Associated library

IPSDKIPLIntensityTransform

Header file

Code Example

boost::filesystem::path inPath, refPath;
// initialization of paths
// ...
// restore images stored in input files
image::ImagePtr pRefImg = loadTiffImageFile(refPath);
// compute histograms on images
imaproc::glbmsr::histogramMsr(pInImg);
imaproc::glbmsr::histogramMsr(pRefImg);
// compute look-up table matching the 2 histograms
imaproc::itrans::matchHistograms(pInHistogram, pRefHistogram);
See also
MatchHistogramsLvl1

Function Documentation

◆ matchHistograms()

wrapper function for compute the LUT that matches 2 histograms

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure