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 – Laplacian Mask

Another part of Digital Image Processing is the Laplacian mask. Laplacian mask contains the coefficients of the Laplacian operator (second order derivatives). When dealing with Laplacian mask,you must be very careful with the difference in sign when combining either by adding or subtract a Laplacian filtered image with another image. Laplacian operator have some effect. It tends to produce image that have grayish edge lines and other discontinuities in brighter intensities, all superimposed on a dark, featureless background. To correct the problem of featureless background, you must add the original and Laplacian filtered image together. Continue reading “Matlab – Laplacian Mask”

Matlab – Point Functions and Histogram Image Segmentation

In image processing point operation or function results in new histogram different from the original image. It is basically taking average of several points and make it into one points such as b(i,j) = 10 round (A(i,j) / 10). You can clearly see the difference in histogram view. Image segmentation somehow related to point functions. A scene in an image composed of several different regions, object and etc. Segmentation is decomposition of an image into these regions or objects. As a human, we can easily identify each of object in an image. However, automatic segmentation using computer algorithm is difficult and right now consider unresolved. Automatic segmentation of image is still actively researched.  Continue reading “Matlab – Point Functions and Histogram Image Segmentation”

Matlab – Thresholding an Image

This post about matlab command used in image processing for thresholding an image. Threshold is simple concept of setting range of certain value to be a value. The basic purpose of thresholding in image processing is to adjust the pixel value of an image to certain value. Lets take an example. The matlab command below can be used to thresholding an image. What this command will do is to set the pixel value to 0 if  the original pixel value is below or equal to 128. Otherwise, if the original pixel value is above 128, the new pixel value will be 255. Below is the example command. Continue reading “Matlab – Thresholding an Image”

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”

Matlab – imadjust, histeq, adapthisteq and Image Histogram

This post will describe the use of imadjust, histeq and adapthisteq in image processing. Basically these three matlab command will give different results in adjusting image based on their method of adjusting an image. Imadjust to adjust the intensity values or colormap. Histeq to enhance contrast using histogram equalization while adapthisteq to contrast-limited adaptive histogram equalization (CLAHE). From all these three command, you can see the different of result image or their output between them when you execute the command. You can see how different type of image adjustment will give different result of an image. Continue reading “Matlab – imadjust, histeq, adapthisteq and Image Histogram”

Matlab – imadd Combine Two Images and Add Intensity Value

In this post, we will learn basic command in image processing using Matlab. One of the command is imadd. Image addition will give power to superimpose or overlay an image on top of another or control the brightness of an image. This post will describe two use of imadd which is for combine, joining, adding or overlay two images and the other function of imadd which is to add value to each pixel in the image or picture to control brightness of an image. Continue reading “Matlab – imadd Combine Two Images and Add Intensity Value”