Saturday, 6 April 2013

Average low pass filter for 24-bit color Image

The average low-pass filter is a algorithm where we take average of all adjacent pixels for the each pixel.We start it from the pixel [1][1] and to the pixel[h-2][w-2] and the boundary pixels copy same as available in input image.So we get a filter which takes a pixel and take average of all 8-neighbor and put it into the pixel.Thus if a pixel having a higher value than its neighbors it  is reduced thus there is only  a pass for the low value pixels and it reduces the pixels with high value.So it is called low pass filter.Here is the input and output image used for the program .There is a slight change in input and output image which very difficult to see.

Input Image

Output Image

Friday, 5 April 2013

Horizontal Flip,vertical Flip and Reflection about origin in 24-bit color Image

Horizontal Flip:-Horizontal flip is an exchange of pixels in an image which shift the image left pixels into the right of the image and right pixels in left of the image.We need to traverse the whole image column wise and put all left most pixels into the right most side .Thus we move in each row and the image we get after traversing each row is a horizontally flipped image.Here is an input and output image for the horizontal flip program:-



Input Image
Output Image
 Vertical Flip:-Vertical flip shifts the topmost pixels to the bottom most pixels thus the whole pixels from top to bottom traverse and the pixels which are at the top in the input image goes to the bottom in the output image .In this we move row wise and traverse whole image .Here is the input and output image for the blog.


Input Image
Output Image
  Reflection about origin:-In this algorithms we move pixels diagonally .Thus the pixels which are located at the top left in the input image move to the bottom right in the output image and the output image is reflection about origin .We can say that this the combination of horizontal flip and vertical flip.Here is the input image and  image for the program:-

Input Image

Output Image

Connected component labeling for 24-bit bitmap Image

Connected component labeling is an application where we search the pixel of same pixel value and if found then labeled them with same value .Thus the whole image is processed and the pixels having same value shows the same label.This is also known as blob extraction,region labeling .Connected component labeling  is used in computer vision to detect connected region in binary digital image or color image.There is two method used for connected component labeling 4-way connectivity and 8-way connectivity .In 4-way connectivity the top,bottom ,right and left neighbors are checked while in 8-way connectivity all 8-neighbors are checked and the lowest label is given to the same neighbor .Thus the whole image is traversed and we get a labelled image.
                                          


  Here is the output of a labeled pixels of an image.We can see here the pixels with same color have same      
label.