Posts

Color image processing and color models

Image
Color image processing The use of color in image processing is motivated by two principal factors: 1. The fact that color is a powerful descriptor it often simplifies object identification and extraction from a given scene 2. A human can discern thousands of colors shades and intensities, compared to about only a few dozens of shades of gray. Characterizing colors The characteristics generally used to distinguish one color from another are: 1. Hue: Hue is an attribute associated with the dominant wavelength in a mixture of white light. It represents the dominant color as perceived by the observer. 2. Saturation: Saturation refers to the relative purity or amount of white light mixed with a hue. The pure spectrum colors are fully saturated. Colors such as pink (red + white) are less saturated, with degree of saturation being inversely proportional to the amount of white light added. 3. Brightness: Brightness refers to the intensity of light. Hue and saturation toge...

Multiplication of images

Image
Mathematical operations on digital images consist of: 1. Addition 2. Subtraction 3. Multiplication 4. Division Arithmetic multiplication: Arithmetic subtraction can be done using the following two ways: 1. Pixel to pixel multiplication of two images 2. Multiplication of a constant to an image Pixel to pixel multiplication of two images This is the most simple and straightforward operation applied on two input images of identical dimensions that produces an output image of dimensions identical to that of first two, in which a pixel value of the output image is the arithmetic multiplication of the corresponding pixels from the two input images. Mathematically, the multiplication operation of two images can be written as: m(x,y)=f(x,y)*g(x,y) Where f and g are the two input images of identical dimensions and m is the resulting output image while x and y are the spatial coordinates of the corresponding input and output images. If the pixel values in the inpu...

Subtraction of images

Image
Mathematical operations on digital images consist of: 1. Addition 2. Subtraction 3. Multiplication 4. Division Arithmetic subtraction: Arithmetic subtraction can be done using the following two ways: 1. Pixel to pixel subtraction of two images 2. Subtraction of constant from an image Pixel to pixel subtraction of two images This is the most simple and straightforward operation applied on two input images of identical dimensions that produces an output image of dimensions identical to that of first two, in which a pixel value of the output image is the arithmetic difference of the corresponding pixels from the two input images. Mathematically, the subtraction operation of two images can be written as: d(x,y)=f(x,y)-g(x,y) Where f and g are the two input images of identical dimensions and d is the resulting output image while x and y are the spatial coordinates of the corresponding input and output images. If the pixel values in the input image are vectors (e.g. fo...

Digital image formation

Image
Digital Image Formation The digital image conversion process involves namely two process, sampling and quantization. Digitizing the coordinates is called sampling . Digitizing the amplitude is called quantization . This digitization process requires decisions about values for M, N and for the number, L (where L =discrete gray levels allowed for each pixel).   There are no requirements on M and N (dimensions of an image), other than that they have to be positive integers. However, due to processing, storage, and sampling hardware considerations, the number of gray levels typically is an integer power of 2: L = 2^k    The discrete grayscale intensity levels are equally spaced and that they are integers in the interval [0, L-1]. Thus, for an 8 bit image (class: uint8) the number of discrete grayscale intensity levels are [0, 255]. The range of values spanned by the gray scale is called dynamic range of an image. The number of bits (b) required to sto...

Addition of digital images

Image
Mathematical operations on digital images consist of: 1. Addition 2. Subtraction 3. Multiplication 4. Division Arithmetic addition: Arithmetic addition can be done using the following two ways: 1. Pixel to pixel addition of two images 2. Addition of constant to an image Pixel to pixel addition of two images This is the most simple and straightforward operation applied on two input images of identical dimensions that produces an output image of dimensions identical to that of first two, in which pixel value of the output image is the arithmetic sum of the corresponding pixels from the two input images.  Mathematically, the addition operation of two images can be written as: s(x,y)=f(x,y)+g(x,y) Where f and g are the two input images of identical dimensions and s is the resulting output image while x and y are the spatial coordinates of the corresponding input and output images. If the pixel values in the input image are vectors (e.g. for color images) the...

Exploring digital images: Interactive design (Part 2)

Image
In the previous blog, we have seen the use of msgbox to have interaction with user. Let us know, use another interactive tool, called the menu to have more interaction with user. Octave code: clc; clear all; input_image = imread("ubuntu.jpg"); [height width channels] = size(input_image); figure, imshow(input_image); title("Input Image"); if channels == 3   msgbox("Input image is a color image");   choice = menu("Do you want to convert into grayscale", "Yes", "No");   if choice == 1    grayscale_image = rgb2gray(input_image);    figure, imshow(grayscale_image); title("Grayscale Image");    else    msgbox("Exiting execution prcoess");    close all;   end  else  disp("Input image is grayscale image")   imshow(input_image); end Output: Octave code Interactive msgbox Interactive menu option Output of above code Explanation: Menu is a interactive di...

Exploring digital images: Interactive design (Part 1)

Image
Let us check whether the input image that we read is a color image or gray-scale image. As discussed earlier a color image has 3 channels (RGB) while a grayscale image has only one channel (brightness/intensity). In order to have, response based interaction with the user we can add interactive message boxes in GNU Octave. Otcave code: clc; clear all; input_image = imread("google.jpg"); [height width channels] = size(input_image); imshow(input_image); title("Input Image"); if channels == 3   msgbox("Input image is color image. Converting input image to grayscale");   grayscale_image = rgb2gray(input_image);   figure, imshow(grayscale_image); title("Grayscale Image");   else   disp("Input image is grayscale image")   imshow(input_image);   end Output: Octave code Interactive message box Output of the above code Explanation: [x,y,z]=size(): The  size function returns the sizes of each dimension of the ar...