图像的读取,显示以及保存

  • Post author:
  • Post category:其他


%读取图像

image = imread(‘hunan.jpg’);

%显示图像

imshow(image)

read_show_image

警告: 图像太大,无法在屏幕上显示;将以 33% 显示

In images.internal.initSize (line 71)

In imshow (line 332)

In read_show_image (line 4)

%显示图像数组的附加信息

whos f

additional_information

Name Size Bytes Class Attributes

f 1200x1077x3 3877200 uint8

%确定图像大小

size(f)

determine_size

ans =

    1200        1077           3

%将图像写到磁盘上

imwrite(f,’hunan.jpg’,’quality’,20)

%压缩并获得图像的其他详细信息

imfinfo hunan.jpg

compress_get_information

ans =

包含以下字段的 struct:

       Filename: 'D:\WorkSpaces\Matlab\hunan.jpg'
    FileModDate: '14-Sep-2018 21:42:10'
       FileSize: 64197
         Format: 'jpg'
  FormatVersion: ''
          Width: 1077
         Height: 1200
       BitDepth: 24
      ColorType: 'truecolor'
FormatSignature: ''
NumberOfSamples: 3
   CodingMethod: 'Huffman'
  CodingProcess: 'Sequential'
        Comment: {}