to gray scale image
A gray scale image consists of each pixel and its value ranges from 0 (black) to 255 (white). The transformation is based on the equation
gray value = 0.299*r + 0.587*g + 0.114*b
where r, g, b are the red, green, blue values of a pixel in the color image.
negative image
It mainly works for gray scale image
It replaces each color (gray scale value) with its opposite value
This can be accomplished by the simple formula: new value = 255 - old value.
Brighten
This brightens the image
Darken
This darkens the image
Thresholding
We use this method only for gray scale images. Select a value T.and any pixel having a value not less than T will be changed to white(Foreground), otherwise to black(background)
Histogram equalization
Histogram equalization means all pixels values are spread uniformly in the image.The steps necessary to do are:
- Generate histogram. The histogram is an array h[0..255] of integer, in which h[i] is the occurrence frequency of pixels having value i in a given image.
- Generate Cumulatice Distribution Function (CDF). The CDF function is defined as follows:
- CDF[i] = h[0] + h[1] + ... + h[i] for i = 0, 1, .., 255.
- After scaling, map into a uniform histogram.
Median filter
Median filter replaces each pixel with its median neighborhood. The middle pixel is called the median neighbor
At first select a neighbourhood mask such as 3x3 etc
1.Arrange the pixels in the ascending order
2. Select the median of those values
3. Replace the value at the center of the neighbourhood mask
Erosion
Erosion is mainly applied to only black and white images. Erosion removes a layer from around the periphery of all regions.
Dilation
Dilation adds any background pixel that touches a foreground pixel. This will add a layer around the periphery of each region.
Counting objects
It is done by using region growing technique.
- Initialize the counter to 0 and unmark all pixels.
- For each unmarked pixel not on the background, do the following:
- Increment the counter by one.
- From this pixel, grow to all neighbors not on the background, and mark them with an identification number. This process is performed repeatedly to create an area.
No comments:
Post a Comment