Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

need to extract road using dog filter but its not working properly..help me out

1 view (last 30 days)
fontSize = 10;
I = imread('a8.jpg');
grayImage = rgb2gray(I);
% numberOfColorBands should be = 1.
[rows columns numberOfColorBands] = size(grayImage);
% Display the original gray scale image.
subplot(2,2,1);
imshow(I);
title('Original Image', 'FontSize', fontSize);
subplot(2,2,2);
imshow(grayImage);
title('grayscale Image', 'FontSize', fontSize);
gaussian1 = fspecial('Gaussian', 21, 15);
gaussian2 = fspecial('Gaussian', 21, 20);
dog = gaussian1 - gaussian2;
dogFilterImage = conv2(double(grayImage), dog, 'same');
subplot(2,2,3);
imshow(dogFilterImage, []);
title('DOG Filtered Image', 'FontSize', fontSize);
bw =(dogFilterImage);
subplot(2,2,4);
imshow(bw);

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!