True color matrice - image processing, MATLAB in Engineering

Assignment Help:

True color matrice:

The true color matrices are the other way to represent images. The true color matrices are 3-dimensional matrices. The first two coordinates are the coordinates of pixel. The third index is the color component; (:,:,1) is the red, (:,:,2) is the green, & (:,:,3) is the blue component. Each and every element in the matrix is of the type uint8 that is an unsigned integer type by using 8 bits. With 8 bits, 28 (or 256) values can be stored and therefore the range of values is 0 to 255. The minimum value, 0, shows the darkest hue available so all 0's answers in a black pixel. The maximum value, 255, shows the brightest hue. For illustration, when the values for a given pixel coordinates px and py (px,py,1) is 255, (px,py,2) is 0 and (px,py,3) is 0 then that pixel will be bright red. All 255's outcomes in a white pixel.

The image function shows the information in the 3-dimensional matrix as an image.

For illustration, this generates a 2× 2 image as shown in figure below. The matrix is 2×2×3, where the third dimension is the color. The pixel in position (1,1) is red, the pixel in position (1,2) is blue, the pixel in position (2,1) is green, and the pixel in position (2,2) is black.

 

>> mat(1,1,1) = 255;

>> mat(1,1,2) = 0;

>> mat(1,1,3) = 0;

>> mat(1,2,1) = 0;

>> mat(1,2,2) = 0;

>> mat(1,2,3) = 255;

>> mat(2,1,1) = 0;

>> mat(2,1,2) = 255;

>> mat(2,1,3) = 0;

>> mat(2,2,1) = 0;

>> mat(2,2,2) = 0;

>> mat(2,2,3) = 0;

>> mat = uint8(mat);

>> image(mat)

673_true color matrixc.png


Related Discussions:- True color matrice - image processing

Evaluating a string, Evaluating a string: The function eval is used to...

Evaluating a string: The function eval is used to compute a string as a function. For illustration, below is the string 'plot(x)'is interpreted to be a call to plot the functi

Finding a sting - function findstr, Finding a sting - function findstr: ...

Finding a sting - function findstr: The function findstr receives two strings as input arguments. It finds all the occurrences of shorter string contained by the longer, and r

Example to change the line width from the default, Example to change the li...

Example to change the line width from the default: For illustration, to change the line width from the default of 0.5 to 1.5: >> set(hl,'LineWidth',1.5) As long as the

Derivatives and plot, Use polyval to evaluate the derivative at xder. This...

Use polyval to evaluate the derivative at xder. This will be the % slope of the tangent line, "a" (general form of a line: y = ax + b). % 4. Calculate the intercept, b, of t

Subfunctions, Subfunctions: Though, it is possible to have more than o...

Subfunctions: Though, it is possible to have more than one function in a given M-file. For illustration, if one function calls the other, the first function would be the prima

Example of image processing, Example of image processing: The other il...

Example of image processing: The other illustration generates a 5 × 5 matrix of arbitrary integers in the range from 1 to the number of colors; the resultant image is as shown

Initializing the data structure - function, Initializing the data structure...

Initializing the data structure - Function: Function is shown as:   >> printcylvols(cyls) Cylinder x has a volume of 169.6 Cylinder a has a volume of 100.5

Example of interpolation and extrapolation, Example of Interpolation and ex...

Example of Interpolation and extrapolation: The MATLAB has a function to do this, known as polyfit. The function polyfit finds the coefficients of the polynomial of the partic

Comparing strings, Comparing strings: There are few functions which co...

Comparing strings: There are few functions which compare strings and return logical true when they are equivalent or logical false when not. The function strcmp compares the s

For loops - iterator variable, For Loops which do not use an iterator Vari...

For Loops which do not use an iterator Variable in the action: In all the illustrations that we seen so far, the value of the loop variable has been used in same way in the ac

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd