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.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr
Code Example
inImg1 = PyIPSDK.loadTiffImageFile(inputImgPath1)
inImg2 = PyIPSDK.loadTiffImageFile(inputImgPath2)
histo1 = glbmsr.histogramMsr2d(inImg1)
histo2 = glbmsr.histogramMsr2d(inImg2)
outLut = itrans.matchHistograms(histo1, histo2)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/MatchHistograms/MatchHistograms.h>
Code Example
boost::filesystem::path inPath, refPath;
imaproc::glbmsr::histogramMsr(pInImg);
imaproc::glbmsr::histogramMsr(pRefImg);
imaproc::itrans::matchHistograms(pInHistogram, pRefHistogram);