1. 程式人生 > >影象的讀取,顯示以及儲存

影象的讀取,顯示以及儲存

%讀取影象 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: {}