IPSDK 4.1.0.2
IPSDK : Image Processing Software Development Kit
Image Histograms Matching 2d
imagematchHistograms2dImg (inImg,refImg)
imagematchHistograms2dImg (inImg,inHistoMsrParams,refImg)
imagematchHistograms2dImg (inImg,inPIHistoMsrParams,refImg)
imagematchHistograms2dImg (inImg,refHistogram)
imagematchHistograms2dImg (inImg,inHistoMsrParams,refHistogram)
imagematchHistograms2dImg (inImg,pIRefHistogram)
imagematchHistograms2dImg (inImg,inHistoMsrParams,pIRefHistogram)

Detailed Description

adjust image dynamic range from a reference using histograms matching

This algorithm applies a LUT to the input image so that the histogram of the resulting image matches with the histogram of the reference image.

Input and output images must have same size.

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
inRefImg = PyIPSDK.loadTiffImageFile(inputRefImgPath)
# image histogram matching computation
outImg = itrans.matchHistograms2dImg(inImg, inRefImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/MatchHistograms2dImg/MatchHistograms2dImg.h>

Code Example

boost::filesystem::path inPath, refPath;
// initialization of paths
// ...
ImagePtr pInImg = loadTiffImageFile(inPath);
ImagePtr pRefImg = loadTiffImageFile(refPath);
ImagePtr pOutImg = matchHistograms2dImg(pInImg, pRefImg);