April 2020
Intermediate to advanced
438 pages
12h 2m
English
The following are the steps to implement texture classification using the Gabor filter with scikit-learn:
kernels = []for theta in range(4): theta = theta / 4. * np.pi for sigma in (1, 3): for frequency in (0.05, 0.25): kernel = np.real(gabor_kernel(frequency, \ theta=theta, sigma_x=sigma, sigma_y=sigma)) kernels.append(kernel)
def power(image, kernel): # Normalize images for better comparison. image = (image - image.mean()) / image.std() return np.sqrt(ndi.convolve(image, np.real(kernel), \ mode='wrap')**2 + ndi.convolve(image, ...
Read now
Unlock full access