MATLAB Language Image processing Image Filtering

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Let's say you have an image rgbImg, e.g., read in using imread.

>> rgbImg = imread('pears.png');
>> figure, imshow(rgbImg), title('Original Image')

enter image description here

Use fspecial to create a 2D filter:

>> h = fspecial('disk', 7);
>> figure, imshow(h, []), title('Filter')

enter image description here

Use imfilter to apply the filter on the image:

>> filteredRgbImg = imfilter(rgbImg, h);
>> figure, imshow(filteredRgbImg), title('Filtered Image')

enter image description here



Got any MATLAB Language Question?