Matlab – Miss or Hit Transform

This post is about miss or hit transform in image processing. Before you will be able to understand miss or hit transform, there is a requirement which you need to understand first which is erosion. If you have no idea what erosion is or you not understand erosion clearly, please refer to my previous post on erosion. Hit or miss transform is one of the powerful method for finding shapes and their locations in an image. Hit or miss can be defined entirely in term of erosion only. Hit or miss transform is very useful for detecting specific shapes that are intended to extract such as squares, triangles, ridges, corners, junctions and etc. In this post,i will provide you with Matlab source code for miss or hit transform as an example to you. Furthermore, i will include the example with teoretical part how to do miss or hit transform using manual way. Continue reading “Matlab – Miss or Hit Transform”

Matlab – Opening and Closing

Before this, i have share some knowledge on erosion and dilation. This knowledge is necessary to continue with this topic which is Opening and Closing. The purpose of opening is to smoothens contours, nelarges narrow gaps and eliminates thin protrusions and ridges. On the other hand, closing will help to fills narrow gaps, holes and small breaks. In this post, i will explain some general idea of opening and closing and show to you some example Matlab source code for opening and closing. Continue reading “Matlab – Opening and Closing”

Matlab – Spatial Filtering

Filtering is a technique for modifying or enhancing an image. As it name stated, spatial filtering use filter or also know as mask, kernel, template or window. Values of filter sub image are referred to coefficients rather than pixel intensities. Masks are always in odd size such as 3×3, 3×5 or etc. You won’t be able to find the center of the mask if it’s in even size. The process is simply moving the filter mask from point to point in an image. The filter oat each point is calculated using predefined relationship. Continue reading “Matlab – Spatial Filtering”

Matlab – Dilation and Erosion

In digital image processing, you must understand on dilation and erosion. Dilation adds pixels to the boundaries of objects in an image. On the other hand erosion removes pixels on object boundaries. The number of pixels added or removed from the objects in an
image depends on the size and shape of the structuring element used to process the image. In the morphological dilation and erosion operations, the state of any given pixel in the output image is determined by applying a rule to the corresponding pixel and its neighbors in the input image. The rule used to process the pixels defines the operation
as a dilation or an erosion. Continue reading “Matlab – Dilation and Erosion”