Skip to content

Instantly share code, notes, and snippets.

@faisal-w
Created March 17, 2015 22:52
Show Gist options
  • Save faisal-w/b545d9960bff1949c2d2 to your computer and use it in GitHub Desktop.
Save faisal-w/b545d9960bff1949c2d2 to your computer and use it in GitHub Desktop.
Computer Vision lab activities 1.1 - Filtering (Conv)
clear all; close all;
%Read a PGM file
%pgm_1 = pgmread('shaftim.pgm');
pgm_1 = imread('coins.png');
%Viewing a PGM file as an image
my_disp(pgm_1)
% Create a averaging filter
h = ones(5,5) / 25;
%Applying filter
I2 = imfilter(pgm_1,h,'conv');
figure,imshow(I2),title('Filtered');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment