IPSDK 0.2
IPSDK : Image Processing Software Development Kit
imageboundImg (inImg,inOutputRange)

Detailed Description

Algorithm allowing to bound image values to a given range algorithm.

Given an input image $ InImg $ and an input range for output image $ InOutputRange = [InOutputMin, InOutputMax] $, output image values are given by :

\[ OutImg[i] = \begin{cases} InOutputMin & \text { if } InImg[i] < InOutputMin \\ InOutputMax & \text { if } InImg[i] > InOutputMax \\ InImg[i] \text { otherwise} \end{cases} \]

Here is an example of image bound applied to a 8-bits grey level image with $[InOutputMin, InOutputMax]=[75, 150]$:

boundImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# image bounding
outImg = arithm.boundImg(inImg, PyIPSDK.createRange(75, 150))

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/BoundImg/BoundImg.h>

Code Example

// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath);
// define a bounding range
RangePtr pRange(boost::make_shared<Range>());
pRange->setValue<Range::Min>(75);
pRange->setValue<Range::Max>(150);
// apply image bounding
ImagePtr pOutImg = boundImg(pInImg, pRange);