GaborFiltering2d
Transforms a two-dimensional image thanks to Gabor filters, which are well known for localisation in frequency and space.
Access to parameter description
The Gabor filters are performed in the Fourier Space (frequency space). Gabor filters recover this space.
For a number of angles $ N_\theta $ and a number of frequences $ N_\omega $, $N_\theta\times N_\omega$ Gabor filters can be defined for:
Access to parameter description
The Gabor filters are performed in the Fourier Space (frequency space). Gabor filters recover this space.
For a number of angles $ N_\theta $ and a number of frequences $ N_\omega $, $N_\theta\times N_\omega$ Gabor filters can be defined for:
- The angles $ \theta = \frac{n_\theta \times \pi}{N_\theta},0 \leq n_\theta < N_\theta $,
- The frequencies $ F=\frac{F_n}{2^{n_\omega}},0\leq n_\omega < N_\omega $. $ F_n $ being the Nyquist frequency.
- $ u=\widetilde{i}\times cos(\theta)+\widetilde{j}\times sin(\theta) $,
- $ v=-\widetilde{i}\times sin(\theta)+\widetilde{j}\times cos(\theta) $,
- $\widetilde{i}$ and $\widetilde{j}$ are the centered and normalized coordinates.
- $ \sigma=\frac{\sqrt{(log(2))/2}}{\pi \times F \times tan(\pi / (2\times N_\theta))},$
- $\lambda=\frac{2^B+1}{2^B-1}\times tan \Big(\frac{\pi}{2\times N_\theta}\Big)$,
- $B=1$ in this implementation thus $\lambda=3\times tan \Big(\frac{\pi}{2\times N_\theta}\Big)$.
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > gaborFiltering2d( std::shared_ptr< iolink::ImageView > inputImage, int32_t frequencyNumber, int32_t angleNumber, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype. gabor_filtering_2d( input_image, frequency_number = 4, angle_number = 4, output_image = None )
This function returns outputImage.
// Function prototype. public static IOLink.ImageView GaborFiltering2d( IOLink.ImageView inputImage, Int32 frequencyNumber = 4, Int32 angleNumber = 4, IOLink.ImageView outputImage = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | nullptr |
![]() |
frequencyNumber |
The number of frequencies. | Int32 | >=1 | 4 |
![]() |
angleNumber |
The number of angles. | Int32 | >=1 | 4 |
![]() |
outputImage |
The output image. Its spatial dimensions and type are forced to the same values as the input. It is an image sequence containing the number of frequencies multiplied by the number of angles time steps. | Image | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
input_image |
The input image. | image | Binary, Label, Grayscale or Multispectral | None |
![]() |
frequency_number |
The number of frequencies. | int32 | >=1 | 4 |
![]() |
angle_number |
The number of angles. | int32 | >=1 | 4 |
![]() |
output_image |
The output image. Its spatial dimensions and type are forced to the same values as the input. It is an image sequence containing the number of frequencies multiplied by the number of angles time steps. | image | None |
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | null |
![]() |
frequencyNumber |
The number of frequencies. | Int32 | >=1 | 4 |
![]() |
angleNumber |
The number of angles. | Int32 | >=1 | 4 |
![]() |
outputImage |
The output image. Its spatial dimensions and type are forced to the same values as the input. It is an image sequence containing the number of frequencies multiplied by the number of angles time steps. | Image | null |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); GaborFiltering2d gaborFiltering2dAlgo; gaborFiltering2dAlgo.setInputImage( polystyrene ); gaborFiltering2dAlgo.setFrequencyNumber( 4 ); gaborFiltering2dAlgo.setAngleNumber( 4 ); gaborFiltering2dAlgo.execute(); std::cout << "outputImage:" << gaborFiltering2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) gabor_filtering_2d_algo = imagedev.GaborFiltering2d() gabor_filtering_2d_algo.input_image = polystyrene gabor_filtering_2d_algo.frequency_number = 4 gabor_filtering_2d_algo.angle_number = 4 gabor_filtering_2d_algo.execute() print( "output_image:", str( gabor_filtering_2d_algo.output_image ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); GaborFiltering2d gaborFiltering2dAlgo = new GaborFiltering2d { inputImage = polystyrene, frequencyNumber = 4, angleNumber = 4 }; gaborFiltering2dAlgo.Execute(); Console.WriteLine( "outputImage:" + gaborFiltering2dAlgo.outputImage.ToString() );
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = gaborFiltering2d( polystyrene, 4, 4 ); std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) result = imagedev.gabor_filtering_2d( polystyrene, 4, 4 ) print( "output_image:", str( result ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); IOLink.ImageView result = Processing.GaborFiltering2d( polystyrene, 4, 4 ); Console.WriteLine( "outputImage:" + result.ToString() );