Image display

Image display

1 shows a binary map:

imshow (BW); BW binary data matrix bitmap.

Image matrix 0 representing black and 1 for white.

 

2 shows a gray scale image:

The first: imshow (I); I grayscale image data matrix

The second: imshow (I, [low, high]); I is a gray scale image data matrix, and a value less than the low set to all black, all greater than the low set to white. Plotted by the low level of gray intermediate the high value.

 

Comparison of two mapping results:

 

R & lt = imread ( ' asahi.jpg ' );% Original 

the I = rgb2gray (R & lt);% converted to grayscale 

Figure; 

the subplot ( 121 ); imshow (the I);% the subplot ( 121 ), a first row of two column mapping 

the subplot ( 122 ); imshow (the I, [ 20 is , 80 ]); %% the subplot ( 122 ), a second row of two columns of plotted

 

 

 

 

3 Index image display

imshow index image display, data matrix may be provided, and color images simultaneously mapping table

imshow(I,map);

 

FIG 4 shows RGB

imshow(RGB);

 

5 shows an image file

Imshow(‘filename’);

 

6 Add a color bar

Add colorbar function in the function display

Imread = R & lt ( ' asahi.jpg ' );% Original 

the I = rgb2gray (R & lt);% converted to grayscale 

Figure; 

the subplot ( 131 is ); imshow (R & lt); 

the colorbar 

the subplot ( 132 ); imshow (the I); the subplot% ( 121 ), a first row of two columns of plotted 

colorbar 

the subplot ( 133 ); imshow (the I, [ 20 is , 80 ]); %% the subplot ( 122 ), a second row of two columns of plotted 

colorbar

 

 

 

7 texture mapping

imshow (); can only display two-dimensional images, matlab provides a warp-dimensional image can be mapped onto a three-dimensional object.

 

[x, y, z] = sphere;% draw sphere, the x, y, z coordinate axis is set to 

the I = imread ( ' asahi.jpg ' ); 

Warp (X + . 1 , Y, Z + 2 , the I);% the center point ( 1 , 0 , 2 )

 

 

Guess you like

Origin www.cnblogs.com/asahiLikka/p/11611544.html