IPSDK 0.2
IPSDK : Image Processing Software Development Kit
imagehighPass2dImg (inImg,inHalfKnlSize)

Detailed Description

high pass filter on 2d image

High-pass filters keep high frequencies of the input image and reduce low frequencies. They are usually used to make the image appear sharper. This current implementation of high-pass filter is equivalent to a 2d convolution, using a square kernel of given half size ( $halfKnlSize$), whose all elements equal to -1, except the central element, whose value equals to $(2*halfKnlSize+1)^2$.

A mirror policy is used to apply filter to borders. Input and output images must have same size (see Border policy for more details).

Here is an example of a high-pass filter applied to an 8-bits grey levels input image (with $InHalfKnlSize==2$) :

highPass2d.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# high pass filter 2d computation
outImg = filter.highPass2dImg(inImg, 5)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLFiltering/Processor/HighPass2dImg/HighPass2dImg.h>

Code Example

// definition of a custom output geometry
ImageGeometryPtr pOutImageGeometry =
geometry2d(outImageBufferType,
pInImg->getSizeX(),
pInImg->getSizeY());
// creation of output image
boost::shared_ptr<MemoryImage> pOutImg = boost::make_shared<MemoryImage>();
pOutImg->init(*pOutImageGeometry);
// compute high pass filter on input image
highPass2dImg(pInImg, inHalfKnlSize, pOutImg);