简体   繁体   中英

Gabor feature extraction from an image

I am trying to extract gabor feature from an image using the gabor and imgaborfilt functions from image processing toolbox in matlab using the following code. But it keep giving me the error

Undefined function 'gabor' for input arguments of type double

This code is from http://au.mathworks.com/help/images/texture-segmentation-using-gabor-filters.html just the image is changed.

A=imread('101.jpg');
A = imresize(A,0.25);
Agray = rgb2gray(A);
imageSize = size(A);
numRows = imageSize(1);
numCols = imageSize(2);
wavelengthMin = 4/sqrt(2);
wavelengthMax = hypot(numRows,numCols);
n = floor(log2(wavelengthMax/wavelengthMin));
wavelength = 2.^(0:(n-2)) * wavelengthMin;
deltaTheta = 45;
orientation = 0:deltaTheta:(180-deltaTheta);
g = gabor(wavelength,orientation);
gabormag = imgaborfilt(Agray,g);

It's a boring answer, but that's because this function was introduced in the R2015b release, so unless you update to the latest Matlab version you can't use it. Sorry!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM