IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

high pass filter on 2d image More...

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::highPass2dImg (const image::ImageConstPtr &pInImg, const ipUInt32 inHalfKnlSize)
 wrapper function for high pass filter on 2d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::highPass2dImg (const image::ImageConstPtr &pInImg, const ipUInt32 inHalfKnlSize, const image::ImagePtr &pOutImg)
 wrapper function for high pass filter on 2d image More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InHalfKnlSize [Input] half kernel size (square or cubic kernel) X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation promoteUnary (_pOutImg, _pInImg, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutImg)

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

Associated library

IPSDKIPLFiltering

Header file

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);
See also
HighPass2dImgLvl1
HighPass2dImgLvl2
HighPass2dImgLvl3

Function Documentation

◆ highPass2dImg() [1/2]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::highPass2dImg ( const image::ImageConstPtr pInImg,
const ipUInt32  inHalfKnlSize 
)

wrapper function for high pass filter on 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ highPass2dImg() [2/2]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::highPass2dImg ( const image::ImageConstPtr pInImg,
const ipUInt32  inHalfKnlSize,
const image::ImagePtr pOutImg 
)

wrapper function for high pass filter on 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure