- 'ceil' function: https://www.mathworks.com/help/matlab/ref/ceil.html?searchHighlight=ceil&s_tid=srchtitle_support_results_1_ceil
- 'gabor' function: https://in.mathworks.com/help/images/ref/gabor.html?searchHighlight=gabor&s_tid=srchtitle_support_results_1_gabor
Spatial Kernel size - Gabor filter bank
8 ビュー (過去 30 日間)
古いコメントを表示
Hi
Does anyone know how the kernel size in the Gabor function is calculated from input data such as wavelength and direction?
0 件のコメント
回答 (1 件)
Balavignesh
2023 年 10 月 4 日
Hi Paola,
As per my understanding, you would like to find out how 'kernel size' is calculated from the input data in the 'Gabor' function.
I would suggest you choose an appropriate aspect ratio ('AR') for the kernel size and calculate the spatial frequency ('f') from the wavelength.
You could then determine the standard deviation of the Gaussian envelope ('p') from the desired spatial frequency and aspect ratio. The kernel size could be calculated from the standard deviation using the following relation:
'kSize = ceil(3 * p) * 2 + 1'
The following code may help you achieve this:
% Sample input values. Use your desired values
wavelength = 4;
orientaion = 0;
% Calculate spatial frequency
frequency = 1 / wavelength;
% Set aspect ratio
aspectRatio = 0.5;
% Calculate standard deviation
sigma = 0.56 * (wavelength * aspectRatio + 0.25) / (wavelength * aspectRatio - 0.35);
% Calculate kernel size
kernelSize = ceil(3 * sigma) * 2 + 1
Please refer to the following documentation links to have more information on:
Hope that helps!
Balavignesh
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Filter Banks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!