Modelos, Control y Sistema de Visión

Central     Modelos     Control     Visión     Aplicaciones     Mapa del sitio     Publicaciones     Sobre el autor      
Hardware     Imágenes     Transformaciones     Histograma     Filtros     Gradiente     Morfología      
                                                        Presentación

Color (RGB)

Enlace a Fuente

>> I=imread('nbii_h00615.jpg');
>> whos
Name   Size          Bytes 
I   5312x3535x3  56333760

Class

uint8

>> imfinfo('nbii_h00615.jpg')
ans =
Filename: 'nbii_h00615.jpg'
FileSize: 12877633
Format: 'jpg'
Width: 3535
Height: 5312
BitDepth: 24
ColorType: 'truecolor'

Escala de grises

 

 >> II=rgb2gray(I);
>> whos
Name  Size        Bytes    Class
II   5312x3535 18777920 uint8
>> imwrite(II,'ima_gris1.jpg','jpeg');
>> imfinfo('ima_gris1.jpg')
ans =
Filename: 'ima_gris1.jpg'
FileSize: 1056532
Format: 'jpg'
Width: 3535
Height: 5312
BitDepth: 8
ColorType: 'grayscale'

 Blanco y Negro

 

>> III=im2bw(II,0.5);
>> whos
Name  Size        Bytes  

III   5312x3535 18777920

Class

logical   

>> imwrite(III,'ima_bw1.jpg','jpeg');
>> imfinfo('ima_bw1.jpg')
Filename: 'ima_bw1.jpg'
FileSize: 397327
Format: 'jpg'
Width: 3535
Height: 5312
BitDepth: 8
ColorType: 'grayscale'

uint16

 

Imagen

imwrite(ytotal,'ytotal.tif',

'Compression','none');

>> imfinfo('ytotal.tif')
ans =
Filename: 'ytotal.tif'
FileSize: 1280870
Format: 'tif'
Width: 640
Height: 1000
BitDepth: 16
ColorType: 'grayscale'
BitsPerSample: 16
Compression: 'Uncompressed'
MaxSampleValue: 65535
MinSampleValue: 0

 

int16

 

 

ytotal_int16=im2int16(ytotal);
>> whos
Name            Size        Bytes 
ytotal_int16 1000x640 1280000

Class

int16

 

 

 

 

 

 

 

 

 

 

uint8

 

>> ytotal_uint8=im2uint8(ytotal);
>> whos
Name               Size    ytotal_uint8   1000x640

Bytes               Class

640000             uint8  

 

 

 

 

 

 

 

 

 

 

Formato PNG

      

Enlace a Fuente

>> imfinfo('Lenstarg_25_5906p

_15g_0is.png')
ans =
Filename: 'Lenstarg_25_5906p_15g_0is.png'
FileSize: 170143
Format: 'png'
Width: 5906
Height: 1798
BitDepth: 8

 

 

 

JPEG con pérdida de calidad

           

 

koren=imread('Lenstarg_25_5906p

_15g_0is.png');

>> imwrite(koren,'koren2.jpg','Mode','lossy');
>> imfinfo('koren2.jpg')
ans =
Filename: 'koren2.jpg'
FileSize: 744114
Format: 'jpg'
Width: 5906
Height: 1798
BitDepth: 8
ColorType: 'grayscale'

JPEG sin pérdida de calidad

          

 

>> imwrite(koren,'koren3.jpg',

'Mode','lossless');
>> imfinfo('koren3.jpg')
ans =
Filename: 'koren3.jpg'
FileSize: 3860795
Format: 'jpg'

Width: 5906
Height: 1798
BitDepth: 8
ColorType: 'grayscale'

 

 

 

Referencias:

 

González, R.; Woods, R.: Digital Image Processing. Prentice Hall. 2002.