Use of built-in colormaps - image processing, MATLAB in Engineering

Use of built-in colormaps:

MATLAB has built-in colormaps, it is also possible to generate others by using combinations of any colors. For illustration, the following generates a customized colormap with only three colors: black, white, & red. This is then set to be the present colormap by passing the color map matrix to the colormap function. Then, a 40× 40 matrix of arbitrary integers in the range from 1 to 3 (as there are just 3 colors) is generated, and that is passed to the image function; the results are as shown in figure:

237_Use of built-in colormaps.png

>> mycolormap = [0 0 0; 1 1 1; 1 0 0]

mycolormap =

0 0 0

1 1 1

1 0 0

>> colormap(mycolormap)

>> mat = randint(40,40,[1 3]);

>> image(mat)

Posted Date: 10/22/2012 8:37:33 AM | Location : United States







Related Discussions:- Use of built-in colormaps - image processing, Assignment Help, Ask Question on Use of built-in colormaps - image processing, Get Answer, Expert's Help, Use of built-in colormaps - image processing Discussions

Write discussion on Use of built-in colormaps - image processing
Your posts are moderated
Related Questions
Algorithm for subfunction: The algorithm for subfunction askforn is as shown:  Prompt the user for the positive integer n.  Loop to print an error message and reprom

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

Illustration of anonymous functions: Dissimilar functions stored in the M-files, when no argument is passed to an anonymous function, the parentheses should still be in the fu

Text graphic function - Graphics objects: The text graphic function permits text to be printed in a Figure Window, involving special characters which are printed by using \spe

Matrix operations: There are some common operations on matrices. The operators which are applied term by term, implying that the matrices should be of similar size, sometimes

Passing Structures to Functions: The whole structure can be passed to a function, or separate fields can be passed. For illustration, here are the two distinct versions of a f

Illustration of Passing arguments to functions: Here is an illustration of calling this function: >> printrand() The random # is 0.94 As nothing is passed to

Function call: In the function call, not any arguments are passed so there are no input arguments in the function header. The function returns an output argument, therefore th

Splits a string : The strtok function splits a string into pieces; it can be called in many ways. The function receives one string as an input argument. It appears for the fir

Finding a sting - function strfind: The function strfind does necessarily similar thing, except that the order of the arguments does make dissimilarity. The common form is str