![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
Filters an image in Fourier domain by selecting a frequency range. More...
| IPSDKIPLFILTERING_API image::ImagePtr | ipsdk::imaproc::filter::frequencyFiltering2dImg (const image::ImageConstPtr &pInImg, const attr::eFrequencyBandPassFilterType &frequencyBandPassFilterType, const ipReal64 cutoffFrequency, const ipReal32 inStdDev) |
| wrapper function for Filters an image in Fourier domain by selecting a frequency range More... | |
| IPSDKIPLFILTERING_API image::ImagePtr | ipsdk::imaproc::filter::frequencyFiltering2dImg (const image::ImageConstPtr &pInImg, const attr::eFrequencyBandPassFilterType &frequencyBandPassFilterType, const ipReal64 cutoffFrequency, const ipReal32 inStdDev, const ipReal32 theta, const ipReal64 thetaRange) |
| wrapper function for Filters an image in Fourier domain by selecting a frequency range More... | |
| IPSDKIPLFILTERING_API void | ipsdk::imaproc::filter::frequencyFiltering2dImg (const image::ImageConstPtr &pInImg, const attr::eFrequencyBandPassFilterType &frequencyBandPassFilterType, const ipReal64 cutoffFrequency, const ipReal32 inStdDev, image::ImagePtr &pOutImg) |
| wrapper function for Filters an image in Fourier domain by selecting a frequency range More... | |
| IPSDKIPLFILTERING_API void | ipsdk::imaproc::filter::frequencyFiltering2dImg (const image::ImageConstPtr &pInImg, const attr::eFrequencyBandPassFilterType &frequencyBandPassFilterType, const ipReal64 cutoffFrequency, const ipReal32 inStdDev, const ipReal32 theta, const ipReal64 thetaRange, image::ImagePtr &pOutImg) |
| wrapper function for Filters an image in Fourier domain by selecting a frequency range More... | |
Filters an image in Fourier domain by selecting a frequency range.
This algorithm applies a band-pass filter to the input image in the frequency domain. Such an approach is very powerful since a convolution in the spatial domain becomes a pixelwise multiplication in the Fourier domain. Hence, it is computationnally faster than a spatial filtering, in particular for large kernel sizes. Moreover, it is possible to design a filter in order to fit a determined frequency range.
The steps of the algorithm are:
, the disctrete Fourier transform of the input image,
and
by its related filter coefficient,
,The figure below illustrates how the band-pass filtering in frequency domain works (the signal spectrum is normalized for convenience).
The first row displays a noisy signal, which normalized frequency equals 0.2. In the second row are shown the signal spectrum and a window filter centered around 0.2 (the signal frequency). Because the signal spectrum is symmetric, so is the filter. Finally, the third row plots the reconstructed signal: the noise has been deleted.
However, a step filter as illustrated in the figure above will produce ringing artefacts (https://en.wikipedia.org/wiki/Ringing_artifacts), as shown in the figure below:
In this figure, the initial image is a square (top-left image), its spectrum modulus (bottom-left image), the filter (bottom-right image) and the resulting filtered image, presenting ringing artefacts (top-right image).
For this reason, the algorithm does not use window filters and two other band-pass filters instead:
where
,
being respectively the frequencies along the image axes.
Both filters need only two parameters: a cutoff frequency cutoffFrequency and a standard deviation stdDev, which make them easily configurable. However, the logGabor bandwidth changes when varying the cutoff frequency, even if the standard deviation is constant. The figure below shows how the logGabor function varies when the cut off frequency increases and the standard deviation is constant and set to 0.25.
In some images, it may be interesting to isolate a texture with a specific orientation. For this reason, the algorithm allows to specify an orientation theta and a range thetaRange which will mask the filtered spectrum and keep only the information in the desired direction range, both in degrees.
theta
180° and 0° < thetaRange
180°. If not, the default values are theta = 0° and thetaRange = 180° (i.e. select all the orientations).The figure below illustrates an image with three shapes in the first column. The square and the circle textures have the same frequency (0.04) but different orientations whereas the triangle texture frequency is different (0.08). The second columns shows the logGabor filter configured to select the square and circle textures (top) and its masked oriented version (bottom). Finally, the third column displays the resulting filtered images. We can see that both textures are selected in the non oriented filter whereas only the texture of the circle remains after applying the oriented filter.
Attribute description for algorithm :
| Name | ToolTip | Default Initializer |
|---|---|---|
| ipsdk::imaproc::attr::InImg | [Input] image for processing operation | X |
| ipsdk::imaproc::attr::InFrequencyBandPassFilterType | [Input] Indicates the band-pass filter to apply on the input image | X |
| ipsdk::imaproc::attr::InCutoffFrequency | [Input] Cutoff normalizes frequency for band-pass filtering in Fourier space (must belong to [-0.5, 0.5[) | X |
| ipsdk::imaproc::attr::InStdDev | [Input] standard deviation used for operation along all axis | X |
| ipsdk::imaproc::attr::InOptTheta | [Input Optional] 2d orientation for processing operation | X |
| ipsdk::imaproc::attr::InOptRangeTheta | [Input Optional] Orientation range in degrees | X |
| ipsdk::imaproc::attr::OutWk1RealImg | [Output] Temporary working image for algorithm | duplicateInOut (_pOutWk1RealImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Real32) |
| ipsdk::imaproc::attr::OutWk2RealImg | [Output] Temporary working image for algorithm | duplicateInOut (_pOutWk2RealImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Real32) |
| ipsdk::imaproc::attr::OutWk3RealImg | [Output] Temporary working image for algorithm | duplicateInOut (_pOutWk3RealImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Real32) |
| ipsdk::imaproc::attr::OutWk4RealImg | [Output] Temporary working image for algorithm | duplicateInOut (_pOutWk4RealImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Real32) |
| ipsdk::imaproc::attr::OutImg | [Output] image for processing operation | duplicateInOut (_pOutImg, _pInImg) |
Global rule description for algorithm :
ipsdk::imaproc::matchSizeAndType (_pInImg,_pOutImg) &&
ipsdk::imaproc::matchSizeAndType (_pOutWk1RealImg,_pOutWk2RealImg) &&
ipsdk::imaproc::matchSizeAndType (_pOutWk2RealImg,_pOutWk3RealImg) &&
ipsdk::imaproc::matchSizeAndType (_pOutWk3RealImg,_pOutWk4RealImg) &&
ipsdk::imaproc::matchSize (_pInImg,_pOutWk1RealImg)
| IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::frequencyFiltering2dImg | ( | const image::ImageConstPtr & | pInImg, |
| const attr::eFrequencyBandPassFilterType & | frequencyBandPassFilterType, | ||
| const ipReal64 | cutoffFrequency, | ||
| const ipReal32 | inStdDev | ||
| ) |
wrapper function for Filters an image in Fourier domain by selecting a frequency range
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::frequencyFiltering2dImg | ( | const image::ImageConstPtr & | pInImg, |
| const attr::eFrequencyBandPassFilterType & | frequencyBandPassFilterType, | ||
| const ipReal64 | cutoffFrequency, | ||
| const ipReal32 | inStdDev, | ||
| const ipReal32 | theta, | ||
| const ipReal64 | thetaRange | ||
| ) |
wrapper function for Filters an image in Fourier domain by selecting a frequency range
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::frequencyFiltering2dImg | ( | const image::ImageConstPtr & | pInImg, |
| const attr::eFrequencyBandPassFilterType & | frequencyBandPassFilterType, | ||
| const ipReal64 | cutoffFrequency, | ||
| const ipReal32 | inStdDev, | ||
| image::ImagePtr & | pOutImg | ||
| ) |
wrapper function for Filters an image in Fourier domain by selecting a frequency range
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::frequencyFiltering2dImg | ( | const image::ImageConstPtr & | pInImg, |
| const attr::eFrequencyBandPassFilterType & | frequencyBandPassFilterType, | ||
| const ipReal64 | cutoffFrequency, | ||
| const ipReal32 | inStdDev, | ||
| const ipReal32 | theta, | ||
| const ipReal64 | thetaRange, | ||
| image::ImagePtr & | pOutImg | ||
| ) |
wrapper function for Filters an image in Fourier domain by selecting a frequency range
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
1.8.14