201141234 六、發明說明: 【發明所屬之技術領域】 [0001] 本發明涉及圖像處理技術,尤其涉及一種圖像壓縮/解壓 縮之圖像處理系統及方法。 【先前技術】 [0002] 目前,工業產品的檢測通常是利用圖像處理方式來完成 的。在檢測過程中,通常是利用電腦對原始圖像檔進行 處理,但如果待檢測的圖像資料很大,圖像傳輸給電腦 速度較慢,且在處理過程中通常會由於資料過大佔用電 〇 腦的較多的記憶體,從而使圖像處理速度比較慢,甚至 使電腦當機。 [0003] 雖現有技術中出現多種圖像壓縮方式,若對待檢測圖像 進行壓縮後可以提高圖像的傳輸速度。然而,現有的圖 像壓縮方法大多數是利用了圖像的相鄰圖元之間具有一 定的相關性進行編碼。因此,每當解壓縮的時候需要將 整個圖像都進行解壓縮。如圖10所示,例如利用電腦10 ο 對該種壓縮方法處理後的待檢測圖像分析時,需要將整 個待檢測圖像解壓縮後傳輸至電腦記憶體的缓衝區11中 暫存,然後才進行後續的處理。如此,若待檢測圖像的 資料比較龐大,亦即解壓後的資料比較龐大,同樣會佔 用電腦的較多的記憶體,導致出現圖像處理速度比較慢 和電腦當機等問題。 【發明内容】 [0004] 有鑒於此,有必要提供一種提高處理速度的圖像處理系 統0 099115268 表單編號A0101 第3頁/共38頁 0992027027-0 201141234 [0005] 此外,還有必要提供一種提高處理速度的圖像處理方法 〇 [0006] 一種圖像處理系統包括圖像壓縮裝置。所述圖像壓縮裝 置用於獲取一圖像並對該圖像利用預設的壓縮規則進行 壓縮以產生壓縮圖像檔。所述圖像壓縮裝置包括圖像分 割單元、精度分配單元、編碼器以及存儲單元。所述圖 像分割單元用於將獲取的圖像按照預設的大小分割成若 干圖像區塊。精度分配單元用於根據預設的獲取圖像的 R ΟI的位置資訊和精度值資訊分配各圖像區塊中的精度值 。所述編碼器根據各圖像區塊的精度值選擇相應的壓縮 方式對每一圖像區塊進行獨立壓縮編碼生成相應的壓縮 字串,所述壓縮字串構成所述壓縮圖像檔。 [0007] 一種圖像處理方法,其包括如下步驟: [0008] 獲取圖像; [0009] 將獲取的圖像分割為若干圖像區塊; [0010] 根據預設的ROI精度資訊設置各圖像區塊的精度值; [0011] 根據各圖像區塊的精度值選擇相應的壓縮方式對每一圖 像區塊進行獨立壓縮編碼生成相應的壓縮字串,所述壓 縮字串構成與所述獲取圖像相對應的壓縮圖像檔。 [0012] 上述圖像處理系統及方法對各圖像區塊分別進行獨立壓 縮編碼。因此,可以對壓縮圖像檔進行局部解壓,不但 減少圖像佔用系統資源且提高了圖像處理速度。 【實施方式】 099115268 表單編號A0101 第4頁/共38頁 0992027027-0 201141234 [0013] 本發明提供一種圖像處理系統及裝置,其能夠切斷圊像 各相鄰圖元之間的相關性’使得對壓縮圖像進行解壓縮 時,能夠對壓縮圖像進行局部解壓縮’從而減少圖像處 理佔用較多的資源及提高圖像處理的速度。 [0014] 請參看圖1,其為一較佳實施方式的圖像處理系統100的 功能模組示意圖。圖像處理系統100可用於檢測不良工業 產品,例如P C Β板上的異常元件。圖像處理系統1 〇 〇包括 輸入裝置200、圖像壓縮裝置300以及圖像解壓縮裝置 400。 Ο [0015] .: . ... S .... 圖像壓縮裝置300用如獲取圖像,並對獲取的圖像按照預 設的壓縮規則將獲取的圖像以圖像區塊為單位進行獨立 壓縮編碼,以生成壓縮圖像檔。圖像輸入裝置2〇〇接收用 戶輸入的指令以確定解壓縮的圖像區塊。圖像解壓縮裝 置400用於按照預設的解壓縮規則對壓圖像槽中需要解 壓縮的圖像區塊進行解壓縮,亦卻對壓縮圖像擋進行局 Ο 部解壓縮。如圖2所示,在本實施方式卜圖像塵^置 300應用於數位相機30申。圖像解壓縮穿置 腦40中。當數位相機3G攝取拍攝對像的圖Μ用於電 像壓縮裝置300對攝取的圖像進行壓縮處理’經過圖 檔。電腦40接收到確定解壓縮區塊的^人理生成壓縮圖像 的解壓祕廳對壓縮圖_進行局按照預設 至電腦記憶體的緩衝區41〇中谁〜紅 縮’並傳輪 作暫存。如此 圖像資料佔用電腦中記憶體較夕 , 可以避免 處理速度。 、衝區4lQ ’從而提高 圖像壓縮裝置300包括圖像獲取單_ 099115268 表單編衆A0101 第5頁/共38 5 心01、圖像分割單元 〇卯2027027-0 [0016] 201141234 302、精度分配單元303、編碼器304、内部存儲單元305 、外部存儲單元3〇6以及資料處理模組307。 [0017]圖像獲取單元3 〇 1攝取拍攝物件的圖像。 [〇〇18] 圖像分割單元302用於根據預設的大小將獲取的圖像分割 成若干圖像區塊。在本實施方式中’圖像區塊預設的大 小為16*16。如圖3所示,例如’獲取的圖像P的大小為 [ 40000*40000 ],若以[16*16]的大小分割獲取的圖像p ’則獲取的圖像P共可以分割為[ 2500*2500 ]個圖像區塊 Μ。 ....' ..201141234 VI. Description of the Invention: [Technical Field] The present invention relates to image processing technology, and more particularly to an image compression/decompression image processing system and method. [Prior Art] [0002] At present, the detection of industrial products is usually performed by means of image processing. In the detection process, the original image file is usually processed by a computer, but if the image data to be detected is large, the image is transmitted to the computer at a relatively slow speed, and in the process, the data is usually too large to occupy the power. The brain has more memory, which makes the image processing slower and even makes the computer crash. [0003] Although a variety of image compression methods have appeared in the prior art, the image transmission speed can be improved by compressing the image to be detected. However, most of the existing image compression methods utilize a certain correlation between adjacent elements of an image for encoding. Therefore, the entire image needs to be decompressed whenever decompressed. As shown in FIG. 10, for example, when the image to be detected processed by the compression method is analyzed by the computer 10, the entire image to be detected needs to be decompressed and then transferred to the buffer 11 of the computer memory for temporary storage. Subsequent processing is then carried out. Thus, if the data of the image to be detected is relatively large, that is, the data after decompression is relatively large, it will also occupy more memory of the computer, resulting in problems such as slow image processing speed and computer downtime. SUMMARY OF THE INVENTION [0004] In view of the above, it is necessary to provide an image processing system that increases the processing speed. 0 099115268 Form No. A0101 Page 3 / Total 38 Page 0992027027-0 201141234 [0005] In addition, it is also necessary to provide an improvement Image Processing Method of Processing Speed [0006] An image processing system includes an image compressing apparatus. The image compression device is operative to acquire an image and compress the image using a predetermined compression rule to produce a compressed image file. The image compression device includes an image segmentation unit, a precision distribution unit, an encoder, and a storage unit. The image segmentation unit is configured to divide the acquired image into a plurality of image blocks according to a preset size. The precision assigning unit is configured to allocate the precision value in each image block according to the position information and the precision value information of the R Ο I of the preset acquired image. The encoder independently compresses and encodes each image block to generate a corresponding compressed string according to the precision value of each image block, and the compressed string constitutes the compressed image file. An image processing method includes the following steps: [0008] acquiring an image; [0009] dividing the acquired image into a plurality of image blocks; [0010] setting each image according to preset ROI precision information The precision value of the image block is as follows: [0011] each image block is independently compression-coded according to the precision value of each image block to generate a corresponding compressed string, and the compressed string constitutes a The compressed image file corresponding to the acquired image is described. [0012] The image processing system and method described above perform independent compression encoding for each image block. Therefore, the compressed image file can be locally decompressed, which not only reduces the image occupation system resources but also improves the image processing speed. [Embodiment] 099115268 Form No. A0101 Page 4 / Total 38 Page 0992027027-0 201141234 [0013] The present invention provides an image processing system and apparatus capable of cutting off correlation between adjacent elements of an image ' When the compressed image is decompressed, the compressed image can be locally decompressed', thereby reducing image processing and consuming more resources and increasing the speed of image processing. Please refer to FIG. 1, which is a functional block diagram of an image processing system 100 according to a preferred embodiment. Image processing system 100 can be used to detect undesirable industrial products, such as anomalous components on a P C seesaw. The image processing system 1 输入 输入 includes an input device 200, an image compressing device 300, and an image decompressing device 400.图像 [0015] . : . . S .... The image compression device 300 uses, for example, an image, and the acquired image is in units of image blocks according to a preset compression rule. Independent compression coding is performed to generate a compressed image file. The image input device 2 receives an instruction input by the user to determine a decompressed image block. The image decompressing device 400 is configured to decompress the image block to be decompressed in the compressed image groove according to a preset decompression rule, and decompress the compressed image file. As shown in Fig. 2, in the present embodiment, the image dust collector 300 is applied to the digital camera 30. The image is decompressed into the brain 40. When the digital camera 3G picks up the image of the captured image, the image compression device 300 compresses the taken image by the image. The computer 40 receives the decompression secret file of the decompressed block to generate a compressed image, and compresses the image to perform a localization according to a preset buffer to the computer memory buffer 41〇~reduce' and transmit the wheel for temporary storage. . In this way, the image data occupies the memory of the computer, and the processing speed can be avoided. , rushing area 4lQ 'to improve image compression device 300 including image acquisition list _ 099115268 form editor A0101 page 5 / total 38 5 heart 01, image segmentation unit 〇卯 2027027-0 [0016] 201141234 302, precision allocation The unit 303, the encoder 304, the internal storage unit 305, the external storage unit 3〇6, and the data processing module 307. The image acquisition unit 3 摄取 1 takes an image of the photographic subject. [〇〇18] The image dividing unit 302 is configured to divide the acquired image into a plurality of image blocks according to a preset size. In the present embodiment, the size of the image block preset is 16*16. As shown in FIG. 3, for example, the size of the acquired image P is [40000*40000], and if the acquired image p' is divided by the size of [16*16], the image P obtained can be divided into [2500]. *2500] image blocks Μ. ....' ..
[0019] 精度分配單元303用於根據預設的感興趣的區域(R〇I ) 資訊設置每個圖像區塊的精度值,並將各個圓像區塊的 精度值κ以精度表格的形式存儲於第一内部存儲單元3〇5 中,如圖4所示。該預設的R0I資訊存儲於内部存儲單元 305中。該預設的ROI資訊包括拍攝物件的R〇I的位置資 訊以及ROI精度值。ROI位置資訊包括座標和尺寸大小, 精度分配單元303根據肋丨位置資訊獲得圖像中與與 相對應的圖像區塊。在本實施方式中,拍攝物件為一 板。ROI為PCB板上的各種元件,例如電阻、電容以及電 晶體等。預設的ROI精度值用於表示各個R〇I所需要的解 析度。例如’ PCB板上較大的元件需要採用較低的解析度 就可以清楚表示該元件的特徵;PCB板較小的元件需要採 用較高的解析度才可以清楚表示該元件的特徵;而對於 PCB板上不感興趣的區域’即未設置任何元件的位置可採 用最低的解析度。 099115268 表單煸號A0101 第6頁/共38頁 0992027027-0 201141234 [0020]具體地,精度分配單元303分配各圖像區塊的精度值〖的 過程如圖5所示。由於具有不同精度值的多個可能對 應到一個圖像區塊中,此時,精度分配單元3〇3根據最高 的精度值分配該圖像區塊的精度值κ。如圖5a,R〇I 3和 ROI b同時對應到圖像區塊jji中,且r〇i a和匕具有 不同的精度值4和8,則圖像區塊M1的精度值1(設置為8, 如圖5b所示。 [〇〇21]優選地,精度分配單元303還具有平滑處理功能,用於對 q 與多個R01相對應的圖像區塊Ml進行平傦處理。亦即,精 度分配單元303對與圖像區塊mi相鄰的區塊的精度值κ作 進一步調整「以使各圖像區瑰之間平滑變化,具有連續 性。如圖5C所示,上述圖像區塊似經過平滑處理後,圖 像區塊Ml相鄰的區塊之精度值κ變為6。 [0022]資料處理模組307包括JPEG壓縮單元3§〇和圩£(;字串處理 單兀360。JPEG壓縮單元350利用標準的JPEG壓縮編碼規 則對獲取的圖像進行jPEG壓縮編碼得到JpEG字串。通常 〇 ,JPEG壓縮編碼的過程包括色彩空間變換、縮減取樣、 離散余弦變換、量化、可變長編碼(VLC)以及霍夫曼編碼 (Huff man)等。其中圖像經過色彩空間變換用於變換到 yuv空間和縮減取樣後產生8*8的資料塊並對該8*8的 資料塊進行離散余弦變換後得到64個DCT變換係數。該64 個DCT係數中包括位於係數左上角的DC係數,其餘63個 AC係數。接著,對8*8的資料塊進行量化。然後,對量化 後的8*8資料塊在矩陣中按照2字形的次序進行編排;接 著,對輸出的Z字形次序排列的DC係數和AC係數進行νιχ 099115268 表單編號A0101 第7頁/共38頁 0992027027-0 201141234 。其中VLC是對DC係數採用差分脈衝編碼調製(DPCM)進 行編碼以及對A C係數使用行程長度編瑪(R l E)進行編瑪 最後’使用111^丨11^11對1)?〇^編碼後的0(:係數和孔£編瑪 後的AC係數進一步壓縮得到JPEG壓縮字串。在本實施方 式中,JPEG壓縮單元350採用4 : 2 : 0的方式進行採樣。 [0023] [0024] [0025] [0026] 由於現有的JPEG壓縮編碼規則是利用DPCM對DC係數進行 編碼的’因此,相連的資料塊之間具有關聯性,因此, 不能對每個資料塊進行獨立地解碼。而本實施方式中的 圖像處理系統1 0 0可以對圖像進行壓縮編碼並可對圖像中 各個圖像區塊進行獨立編碼和解瑪,真體如下。 JPEG字串處理單元360對JPEG壓縮字串進行Huffman解 碼和相應的DPCM解碼和RLE解碼得到量化後的DC係數和 AC係數’並生成與各圖像區塊分別相對應的Dc係數和 係數。 編碼器304用於根據各圖像區塊的轎皮值1利用預設的壓 縮規則對獲取的圖像進行編碼以:產生塵縮圖像檔,並將 該壓縮圖像棺存儲於外部;儲:軍'元·=3〇6中。外部存儲單元 306可為SD卡、CF卡等。在其他實施方式中,外部存储單 兀306還可以省略,而將該壓縮檔放置於内部存儲 305 中。 編碼器304包括利用預設規則完成抒£(;表格的第—表格創 建單元310以及利用預設規則完成壓縮編碼表格的第二表 格創建單元320。jpeg表格330和壓縮編碼表格340共同 構成該壓縮圖像檔。 099115268 表單蝙號A0101 第8頁/共38頁 0992027027-0 201141234 [0027] 第一表格創建單元310根據各圖像區塊的精度值κ和JPEG 字串處理單元360生成的DC係數和AC係數完成JPEG表格 330。具體地,第一表格創建單元31〇首先根據精度表中 各圖像區塊的精度值K按照預設壓縮規則選擇與各圖像區 塊相應的DC係數和部分/全部AC係數,亦即可丟棄部分AC 係數;然後,將選擇的AC係數進行編碼RLE和Huffman編 碼產生AC編碼字串,並將DC係數和AC編碼字串存儲於 JPEG表格相應的位置中。 [0028] Ο 可以理解地’ 一圖像區塊的精度值f越高表示該圖像區塊 的解析度要求較高,即該圖像區塊AC係數的丟棄個數就 越少,壓縮率就越低,還原後得到的圖像清晰度較高。 反之’ 一圖像區塊的精度值K越低’即該圖像區塊AC係數 的丟棄個數就越多,壓縮率越高,還原後得到的圖像清 晰度較低。在本實施方式中,第一表格剝建單元31〇創建 JPEG表格330依照四種預設壓縮規則: [0029] Ο 當一圖像區塊的精度值K滿定第一精度值範圍時,例如 k> = 8時’表示該圖像區塊要求的解析度最高,則選擇所 有DC係數和AC係數,將選擇的AC係數進行RLE和 Huffman編碼後得到ac編碼字串,並以先DC係數後AC編 碼字串的順序存儲於jpEG表格330中作為壓縮字串。 [0030] 當一圖像區塊的精度值K滿足第二精度值範圍時,例如 l<k< = 7時’表示該圖像區塊要求的解析度較高,則選擇 相應的DC係數並根據相應的精度值κ選擇部*AC係數,將 選擇的AC係數進行rle編瑪後再進行Huff man編碼得到AC 壓縮字串’並以先DC係數後AC編碼字串存儲於jpEG表格 099115268 表早編號A0101 第9頁/共38頁 0992027027-0 201141234 3 3 0中作為壓縮字串。例如,對圖像區塊的γ u v分量採用4 :2 : 〇的比例進行取樣,每個圖像區塊對應6個dc係數。 每個圖像區塊對應6個DC係數,即4個Y分量對應的4個DC 係數,1個U分量對應1個DC係數,一個V分量對應1個DC 係數。每個圊像區塊對應的AC係數包括對應於4個Y分量 的4*63個AC係數,對應於v分量對應63個AC係數,以及 對應於V分量對應63個AC係數。在本實施方式中,精度值 K還對應按照Z字形的次序編排每個矩陣時所編排的行數 。例如’精度值K為4的時候,表示按照Z字形的次序編排 在每個矩陣中前4行的資料得到9個AC係數。第一表格創 . ... ... 建單元310按照YUV分量的順序存放相:應的])(;係數,然後 以相應的順序存放AC編碼字串。 [0031] 當一圖像區塊的精度值K滿足第三精度值範圍時,例如 k = l時,表示該圖像區塊要求的解析度較低,則選擇相斜 應的DC係數而丟棄全部的AC係數,並將選擇的dc係數按 預設的順序存儲於JPEG表中作為壓縮> _。如前所述, 每個圖像區塊分別對應6個Dς係數,亦即4個γ分量對應的 4個DC係數,wu分量對應“固此係數υ,— 個V分量對應1個DC係數γ。且第一表格創建單元31〇以 YUV分量的次序將相應的DC係數,即γ γ γ γ肝,左 00 01 1011 存 放在JPEG表格330中作為壓縮字串。 [0032] 當一圖像區塊的精度值K滿足第四精度值範圍時,例如 k = 〇時,表示該圖像區塊要求的解析度最低,捨棄全部的 AC係數和DC係數,亦即沒有將該圖像區塊相對應DC係數 和AC係數存儲於JPEG表格330中。 099115268 表單編號A0101 第10頁/共38頁 0992027027-0 201141234 [0033] 睛一併參看圖6,第二表格創建單元32〇利用JpEG表格和 精度表格來完成壓縮編碼表格34〇。壓縮編碼表格34〇包 括若干陣列Tab[],每一陣列與每一圖像區塊--對應, Ο 且按照圖像區塊的順序存儲於壓縮編碼表格34〇中。亦即 母圖像區塊為一個獨立壓縮單元。例如,原始圖像 被分割為2500*2500個圖像區塊,則Tab[]陣列的數目為 2500*2500個。每一陣列Tab[]ffi32bit表示,其高四位 元用於表示相應的圖像區塊的精度值κ,其低24位元用於 存儲指向圖像區塊相應壓縮字串的指標字串。該第二表 格創建單元320根據不雜的精摩隹範園錄廡的四種壓縮規 則將指標字串殽置為相應的學縮字串的起始位址或者是 該圖像區塊相應的DC係數,而使壓縮編碼表格34〇中的陣 列Tab[]形成三種壓縮模式。例如: [0034][0019] The precision assigning unit 303 is configured to set the precision value of each image block according to the preset region of interest (R〇I) information, and the precision value κ of each round image block is in the form of a precision table. It is stored in the first internal storage unit 3〇5 as shown in FIG. The preset ROI information is stored in the internal storage unit 305. The preset ROI information includes the position information of the R〇I of the photographed object and the ROI precision value. The ROI position information includes a coordinate and a size, and the accuracy assigning unit 303 obtains an image block corresponding to the image in the image based on the position information of the rib. In the present embodiment, the object to be photographed is a board. The ROI is a variety of components on the PCB, such as resistors, capacitors, and transistors. The preset ROI precision value is used to indicate the degree of resolution required for each R〇I. For example, the larger component on the PCB requires a lower resolution to clearly indicate the characteristics of the component; the smaller component of the PCB requires a higher resolution to clearly indicate the characteristics of the component; The area that is not of interest on the board, that is, the position where no components are placed, can be used with the lowest resolution. 099115268 Form nickname A0101 Page 6 of 38 0992027027-0 201141234 [0020] Specifically, the process of assigning the accuracy value of each image block by the accuracy assigning unit 303 is as shown in FIG. 5. Since a plurality of images having different precision values may correspond to one image block, at this time, the precision assigning unit 3〇3 assigns the precision value κ of the image block according to the highest precision value. As shown in Fig. 5a, R〇I 3 and ROI b simultaneously correspond to the image block jji, and r〇ia and 匕 have different precision values 4 and 8, and the image block M1 has an accuracy value of 1 (set to 8 As shown in Fig. 5b. [21] Preferably, the precision assigning unit 303 further has a smoothing processing function for performing flat processing on the image block M1 corresponding to the plurality of R01s. The allocating unit 303 further adjusts the precision value κ of the block adjacent to the image block mi "to make the image regions smoothly change between each image region, and has continuity. As shown in FIG. 5C, the above image block It seems that after the smoothing process, the precision value κ of the block adjacent to the image block M1 becomes 6. [0022] The data processing module 307 includes the JPEG compression unit 3 § 〇 and ( (; string processing unit 兀 360 The JPEG compression unit 350 performs jPEG compression encoding on the acquired image by using a standard JPEG compression encoding rule to obtain a JpEG string. Generally, the process of JPEG compression encoding includes color space conversion, downsampling, discrete cosine transform, quantization, and variable. Long code (VLC) and Huffman code, etc. The color space transform is used to transform into the yuv space and reduce the sample to generate 8*8 data blocks and perform discrete cosine transform on the 8*8 data block to obtain 64 DCT transform coefficients. The 64 DCT coefficients are included in the coefficients. The DC coefficient in the upper left corner, and the remaining 63 AC coefficients. Next, the 8*8 data block is quantized. Then, the quantized 8*8 data blocks are arranged in a matrix in the order of the zigzag; then, the output is The zigzag order of DC coefficients and AC coefficients are performed by νιχ 099115268 Form No. A0101 Page 7 of 38 0992027027-0 201141234. VLC is a differential DC code encoding for DC coefficients and is used for AC coefficients. The length of the run length is programmed (R l E) to be programmed. Finally, 'use 111^丨11^11 to 1)? 〇^ after encoding 0 (: coefficient and hole, the AC coefficient after encoding is further compressed to obtain the JPEG compression string. In the present embodiment, the JPEG compression unit 350 performs sampling using a 4:2:0 method. [0025] [0026] Since the existing JPEG compression coding rule is to encode DC coefficients by using DPCM. 'Therefore, the connected funds There is an association between the blocks, and therefore, each data block cannot be independently decoded. However, the image processing system 100 in the present embodiment can compress and encode the image and can respectively image each image in the image. The block is independently coded and decoded, and the real body is as follows: JPEG string processing unit 360 performs Huffman decoding and corresponding DPCM decoding and RLE decoding on the JPEG compressed string to obtain quantized DC coefficients and AC coefficients 'and generates and images The corresponding Dc coefficients and coefficients of the blocks. The encoder 304 is configured to encode the acquired image by using a predetermined compression rule according to the car skin value 1 of each image block to: generate a dust image file, and store the compressed image file on the outside; : Army 'yuan·=3〇6. The external storage unit 306 can be an SD card, a CF card, or the like. In other embodiments, the external storage unit 306 can also be omitted and the compressed file placed in the internal storage 305. The encoder 304 includes a first table creation unit 310 that completes the compression coding table by using a preset rule (the first table creation unit 310 of the table and the preset rule). The jpeg table 330 and the compression coding table 340 together constitute the compression. Image file 099115268 Form bat number A0101 Page 8/38 page 0992027027-0 201141234 [0027] The first table creating unit 310 is based on the precision value κ of each image block and the DC coefficient generated by the JPEG string processing unit 360. And the AC coefficient completes the JPEG table 330. Specifically, the first table creating unit 31 first selects the DC coefficient and the portion corresponding to each image block according to the preset compression rule according to the precision value K of each image block in the accuracy table. / All AC coefficients, that is, the partial AC coefficients can be discarded; then, the selected AC coefficients are encoded by RLE and Huffman coding to generate an AC coded string, and the DC coefficients and AC coded strings are stored in corresponding positions of the JPEG table. [0028] Ο It can be understood that the higher the accuracy value f of an image block indicates that the resolution of the image block is higher, that is, the number of discarded AC coefficients of the image block is less. The lower the compression ratio, the higher the sharpness of the image obtained after the reduction. Conversely, the lower the accuracy value K of an image block is, the more the number of discarded AC coefficients of the image block is, the more the compression rate is. High, the image obtained after the reduction is low in definition. In the present embodiment, the first table stripping unit 31 creates the JPEG table 330 according to four preset compression rules: [0029] Ο When an image block When the precision value K is full of the first precision value range, for example, when k>=8, it indicates that the image block requires the highest resolution, then all DC coefficients and AC coefficients are selected, and the selected AC coefficients are RLE and Huffman coded. The ac coded string is obtained and stored in the jpEG table 330 as a compressed string in the order of the first DC coefficient and the AC coded string. [0030] When the accuracy value K of an image block satisfies the second precision value range For example, if l<k<=7' indicates that the resolution required by the image block is high, the corresponding DC coefficient is selected and the selected AC coefficient is rle-edited according to the corresponding precision value κ selection part *AC coefficient. After the horse, then Huff man coding to get the AC compression string 'and DC first The AC coded string after the coefficient is stored in the jpEG table 099115268 table early number A0101 page 9 / 38 pages 0992027027-0 201141234 3 3 0 as a compressed string. For example, the γ uv component of the image block is 4:2 : The ratio of 〇 is sampled, and each image block corresponds to 6 dc coefficients. Each image block corresponds to 6 DC coefficients, that is, 4 DC coefficients corresponding to 4 Y components, and 1 U component corresponds to 1 DC coefficient, one V component corresponds to one DC coefficient. The AC coefficients corresponding to each of the image blocks include 4*63 AC coefficients corresponding to 4 Y components, corresponding to 63 AC coefficients corresponding to the v components, and 63 AC coefficients corresponding to the V components. In the present embodiment, the precision value K also corresponds to the number of lines arranged in the order of the zigzag in the order of the zigzag. For example, when the precision value K is 4, it means that the data of the first 4 lines in each matrix is arranged in the order of zigzag to obtain 9 AC coefficients. The first table creation unit 310 stores the phases in the order of the YUV components: the required ]) (; coefficients, and then stores the AC encoded strings in the corresponding order. [0031] When an image block When the precision value K satisfies the third precision value range, for example, when k = l, indicating that the resolution required by the image block is low, the DC coefficient of the phase deviation is selected and all AC coefficients are discarded, and the selected The dc coefficients are stored in the JPEG table in the preset order as compression > _. As described above, each image block corresponds to 6 Dς coefficients, that is, 4 DC coefficients corresponding to 4 γ components, wu The component corresponds to "fix this coefficient υ, - V components correspond to 1 DC coefficient γ. And the first table creation unit 31 存放 stores the corresponding DC coefficient in the order of YUV components, ie γ γ γ γ liver, left 00 01 1011 As a compressed string in the JPEG table 330. [0032] When the accuracy value K of an image block satisfies the fourth precision value range, for example, k = 〇, indicating that the image block requires the lowest resolution, discarding All AC coefficients and DC coefficients, that is, no corresponding DC coefficients and AC coefficients are stored for the image block. In the JPEG table 330. 099115268 Form No. A0101 Page 10/Total 38 Page 0992027027-0 201141234 [0033] Referring to FIG. 6 together, the second table creating unit 32 performs the compression encoding table 34 using the JpEG table and the precision table. The compression coding table 34A includes a plurality of arrays Tab[], each array corresponding to each image block, and stored in the compression coding table 34A in the order of the image blocks. The block is an independent compression unit. For example, if the original image is divided into 2500*2500 image blocks, the number of Tab[] arrays is 2500*2500. Each array Tab[]ffi32bit indicates that its height is four. The bit element is used to indicate the precision value κ of the corresponding image block, and the lower 24 bits are used to store the index word string corresponding to the corresponding compressed string of the image block. The second table creating unit 320 is based on the non-mixing essence. The four compression rules recorded by Capricorn Fan will confine the indicator string to the starting address of the corresponding learning string or the corresponding DC coefficient of the image block, so that the compression encoding table 34〇 The array Tab[] forms three compression modes. For example: [003 4]
G 如圖6a所示’當一圖像區塊的精度值為〇時,即,該圖像 區塊相應的陣列Tab[]為0#壓縮模式,選擇與該圖像區塊 相對應的DC係數將選擇的DC係數變換為YUV分量所對應的 3個DC值’並按預定的順序排列後作為指標字串存儲於陣 列Tab[]中◊亦即,指標字串為γυν分量相對應的^固沉 係數’而並非是JPEG表格330中的壓縮字串。例如,如前 所述,若一圖像區塊中具有6個DC係數,則陣列Tab []中 存儲YUV分量相對應的3個DC係數的分別為:4個γ分量的 DC係數的平均值Y、ϋ分量相對應的DC係數U、V分量相對 應的DC係數V,並以γυν的順序存儲於Tab[]中。同理, 若採用他取樣方式,例如,若圖像區塊中具有4個γ分量 、4個ϋ分量和4個V分量,則將各分量的DC係數平均值存 099115268 表單編號A0101 第11頁/共38頁 0992027027-0 201141234 儲於壓縮編碼表格申β [0035] ^圖6b所不’當—圖像區塊的精度值為1時,即,該圖像 品走相應的陣列Tab[]為1#壓縮模式,陣列Μ□中存儲 子串疋扣向JPEG表格330中相應的壓縮字串的起始 位址。此時’ _像區麟應關縮㈣包⑽嗔係數 [0036] [0037] [0038] 如圖6(:所不’當—圖像區塊的精度值大於1時,即,該g 像區塊相應的陣列Tab[]為2«縮模式,則陣列Tab[]t 子儲的从子串是指向相應的壓縮字串的起始位址此 時’該圖像區塊對應的屋縮字串包括贿係數和娜 AC編碼字串。 編碼器304創建壓縮編碼表格34()的步驟包括:首先根 據各個圖像區塊的精度值κ將各個圖像區塊的精度值 儲於相應的Tab[]的相應位置中。接著,根據各^圖㈣ 塊的精度值K所對應的精度範圍選擇存儲各圖像區塊的 JPEG字串眺係數或者是相應的壓縮字串的起始位址。 圖像輸入裝置200用於回應用戶操作,而根據預先設置备 R〇1的資訊產生解壓縮指令。例如,圖像處理系統提供_ 各個R01的圖示,用戶藉由輸人裝置m點選該圖示可以 產生用於描述解壓縮區塊位置資訊的解壓縮指令。G As shown in Fig. 6a, when the precision value of an image block is 〇, that is, the corresponding array Tab[] of the image block is 0# compressed mode, the DC corresponding to the image block is selected. The coefficient converts the selected DC coefficient into three DC values corresponding to the YUV component and arranges them in a predetermined order and stores them as an index string in the array Tab[], that is, the index string corresponds to the γυν component. The sag coefficient is not a compressed string in the JPEG table 330. For example, as described above, if there are six DC coefficients in an image block, the three DC coefficients corresponding to the YUV components stored in the array Tab[] are: the average of the DC coefficients of the four γ components. The DC coefficient V corresponding to the DC coefficients U and V components corresponding to the Y and ϋ components is stored in Tab[] in the order of γυν. Similarly, if he uses the sampling method, for example, if there are 4 γ components, 4 ϋ components, and 4 V components in the image block, the average value of the DC coefficients of each component is stored in 099115268. Form No. A0101 Page 11 / Total 38 pages 0992027027-0 201141234 stored in the compression coding table Shen [0035] ^ Figure 6b does not 'when - the image block has a precision value of 1, that is, the image goes to the corresponding array Tab[] In the 1# compression mode, the storage substring in the array is deduced to the start address of the corresponding compressed string in the JPEG table 330. At this time, the _ image area should be closed (4) package (10) 嗔 coefficient [0036] [0037] [0038] Figure 6 (: does not - when the image block accuracy value is greater than 1, that is, the g image The corresponding array Tab[] of the block is 2 «shrink mode, then the slave substring of the array Tab[]t is pointed to the start address of the corresponding compressed string. At this time, the corresponding block of the image block The string includes a bribe coefficient and a Na AC code string. The step of the encoder 304 creating the compression code table 34() includes first storing the precision values of the respective image blocks according to the precision values κ of the respective image blocks. The corresponding position of Tab[]. Next, the JPEG string 眺 coefficient of each image block or the start address of the corresponding compressed string is selected according to the precision range corresponding to the precision value K of each block (four) block. The image input device 200 is configured to generate a decompression command according to the information of the preset R〇1 in response to the user operation. For example, the image processing system provides an icon of each R01, and the user selects the input device m. The illustration may generate decompression instructions for describing decompressed block location information.
[0039] 圖像解壓縮裝置_包括解瑪器4G1和記憶體4Q2。解碼 器401用純據檢寵域指令查找壓縮影像檔中的_相 對應的壓縮字串的起始㈣’然後根據各圖像區塊的料 度值K進行解碼。記憶_)2⑽細解碼後的圖像以^ 099115268 表單編號A0101 第12頁/共38頁 0992027027-0 201141234 [0040] [0041]❹ [0042][0039] The image decompressing device_ includes a decimator 4G1 and a memory 4Q2. The decoder 401 searches for the start (four) of the compression string corresponding to the _ phase in the compressed image file by the pure parity field command and then decodes it according to the value K of each image block. Memory _) 2 (10) Finely decoded image to ^ 099115268 Form number A0101 Page 12 / Total 38 pages 0992027027-0 201141234 [0040] [0041] ❹ [0042]
GG
[0043][0043]
後續操作。由於壓縮圖像檔對應3種壓縮模式,相應地, 解碼器401進行解壓縮時也具有3種解壓縮方式:如圖7所 示。 當圖像區塊精度值K = 〇時,解碼器401直接取得相應的陣 列Tab[]中的指標字串,即γυν分量對應的”固沉係數作 為YUV值,並將YUV值進行γυν空間到RGB空間的變換,獲 得相應R G B值。 當精度值K=1時’圖像解壓縮裝置40〇藉由相應的陣列 Tab[]中的指標字_取得jpEG表格中相應的冗係數,即 Y〇〇Y〇1Y1〇Y11UV ’作為4個Y分量和1個U分量和1個V分量 的值’並將其進行YUV空間到RGB空間的變換,獲得相應 RGB值’無需作其他解碼動作、 當精度值K>1時’圖像解壓縮裝置4〇〇藉由相應的陣列 Tab[]中的指標字串取得jpEG表格中相應壓縮字串,獲 取DC係數和AC編碼字串’並對ac編瑪字串進行Huffman 和RLE解碼得到AC係數’從而將利用反量化和反余弦將叱 係數和AC係數變換得到相應的γϋν值,然後將γυν值從 YUV空間變換到RGB空間得到RGB值。 上述處理系統利用JPEG壓縮格式中的JPEG字串進行處理 ,使得各壓縮圖像區塊可以獨立運作,且還依據R〇I對一 些圖像區塊設定不同的壓縮率,以提高壓縮比。另外, 各壓縮圖像區塊可以獨立運作可以對壓縮圖像檔進行局 部解歷不但減少圖像佔用系統資源且提高了圖像處理速 度。此外’壓縮圖像區塊對一些壓縮圖像區塊利用jpEG 099115268 表單編號A0101 第13頁/共38頁 0992027027-0 201141234 格式的解壓縮動作’進一步加快了圖像處理速度。 [0044] 請參看圖8,其為一較佳實施方式之圖像壓縮方法流程圖 〇 [0045] 步驟801,獲取圖像。即對拍攝對象進行拍攝而得。 [0046] 步驟803,將獲取的圖像分割為若干圖像區塊。例如,圖 像區塊的分割可按照預設的大小進行分割。 [0047] 步驟805,根據預設的R〇I精度資訊設置各圖像區塊的精 度值。该預设的ROI精度> sfl包括R〇 I位置資訊和精度值 。例如,各圖像區捧的輪度值首先根棣位置資訊可以 確定ROI相對應的圖像區塊;然後,將相對應的圖像區塊 的精度值設置為ROI的精度值。另外,若具有不同精度值 的多個RO I對應到一個圖像區塊時,根據多個I中最大 的精度值设置為该圖像£塊的精度值(如圖和圖gb) 。此外,還可與RO I相對應的圖像區塊相鄰的圖像區塊進 行平滑處理,以使各圖像區塢之間事滑變化,具有連續 性(如圖5 c )。 [0048] 步驟,利用JPEG壓縮演算法生成各圖像區塊的jpEG 壓縮字串,並對JPEG壓縮字串進行處理獲得各圖像區塊 相對應的YUV分量的DC係數和ac係數。獲得各圖像區塊相 對應的YUV分量的DC係數和AC係數如前所述,在此不再贅 述。在本實施方式中’對圖像區塊的YUV分量採用4 : 2 : 0的比例進行取樣’每一圖像區塊包括6個DC係數,即4個 Y分量對應4個DC係數Υ^υ^ΥμΥ",一個u分量對應1個 DC係數V,一個V分量對應1個DC係數U。同樣地,每個γ 099115268 表單編號A0101 第14頁/共38頁 0992027027-0 201141234 [0049] [0050] [0051] Ο [0052] ο [0053] [0054] 099115268 分量、U分量及V分量分別對應63個AC係數。 步驟809 ’根據各圖像區塊的精度值和相應的DC係數及AC 係數開始創建JPEG表格和壓縮編碼表格。 步驟811,依次選擇一圖像區塊的精度值存儲於壓縮編碼 表格相應的位置中。 步驟813 ’判斷壓縮編碼表格中的精度值是否大於或等於 1若壓縮編碼表格中的精度值小於1,則執行步驟; 若壓縮編碼表格中的精度值大於或等於1,則執行步驟 817。 步驟815,選擇相應的DC係數,並將DC係數變換為與γυν 分量的相對應的3個Dc係數,並將變換後的])(:係數按照預 設的順序存儲於壓縮編碼表格相應的位置中作為壓縮字 串。如上所述,每一圖像區塊包括6個DC係數,即4.γ分 量對應4個DC係數,一個分量對應丨個!^係數,—個v分 量對應1個DC係數,則該圖像區塊的相應的γυν分量的3個 DC係數分別為4個Ύ分量的j)c係數的平均值γ、υ*量對應 DC係數U以及V分量對應的DC係數v,並以γ、u、v的順序 存儲於壓縮編碼表格中以產生相應的壓縮字串。 步驟817,判斷壓縮編碼表格中的精度值是否大於丨。若 壓縮編碼表格中的精度值大於丨,則執行步驟819 ;若壓 縮編碼表格中的精度值等於1,則執行步驟821。 步驟819,根據相應的精度值選擇相應的阢係數和部分/ 全部AC係數,將AC係數進行RLE和Huffman編碼生成从 編碼字串,並以先DC係數後△(:編碼字串的順序存儲於 表單編號A0101 第15頁/共38頁 0992027027-0 201141234 JPEG表格相應的位置中作為壓縮字串。其中,係數的 選擇則是根據精度值範圍選擇JPEG字串中全部或者部分 的AC係數。例如,當一圖像區塊的精度值1<k< = 7時則 選擇部分相應的AC係數,且精度值κ對應z字形的次序編 排母個矩陣時所編排到的行數。例如,當—圖像區塊的 精度值為4的時候,表示按照z字形的次序編排在每個矩 陣中則4订的資料得到9個人(:係數。當一圖像區塊的精度 值k> = 8時’則選擇全部相應的虬係數。 [0055] [0056] [0057] [0058] [0059] 099115268 ^驟821,選擇相應的DC係數,並將選擇的DC係數按照胃 定的順序存儲於JPEG表格中以產生相應的壓縮字串。如 上所述,每一圖像區塊包括6個叱係數,即4個丫分量對應 4個DC係數Υ〇ΛιΥιοΥιι,—個卩分量對應1個DC係數u, 一個V分量對應丨個此係數v,且以γ t οογ〇ΐγΐ〇γιιυν 的順序 子古於壓縮編碼表格中以產生相應的壓縮字串。 步驟823,獲取壓縮字串相應的#EG表格中的起始位址, 、將獲取的起始位址存儲矜..壓錦編崎奉格相應的位置中 步驟825,判斷是否所有圖像區塊的精度值已被選擇到。 右所有圖像區塊的精度值被選擇到,則完成JpEG表格和 壓縮蝙碼表格的創建,即生成壓縮圖像檔,流程結束; 反之’執行步驟811。 請參看囷9,其為一較佳實施方式之圖像解壓縮方法流程 圖。 步驟901,判斷是否接收到描述圖像區塊的資訊的解壓縮 0992027027-0 表單編號A0101 第16頁/共38頁 201141234 [0060] [0061] [0062] Ο [0063] [0064] [0065] Ο [0066] [0067] 指令。 步驟903右接收到描述圖像區塊的資訊的解壓縮指令, 根據解令從壓縮編碼表格帽取相應的圖像區塊 的精度值。 步驟905 ’判斷相應的精度值是否大於或等於1。若相應 的精度值λΙ、於1 ’執行步驟^ ;若相應的精度值大於或 者等於1執行步驟909。 步驟9G7 ’獲取壓縮編碼^:格巾職字轉為相應的YUV 值。 步驟909 ’進行YUV空間到RGB空間變換,獲得相應的RGB 值。 , 步驟911 ’從壓縮編碼表格中獲取相應的虚縮字串對應的 起始位址。 步驟913 ’判斷相應的精度值是否太於1。若相應的精度 值大於1執行步驟915,若相應的精度值等於丨執行步驟 919。 步驟915,根據獲取相應的起始位址從JpEG表格中獲取相 應的壓縮字串,對壓縮字串進行相應的逆變化得到相應 的YUV分量值。獲得YUV分量值包括:獲取壓縮字串中的 DC係數和AC編碼字串,並對AC蝙碼字串進行Huffinai^ RLE解碼得到AC係數,對DC係數和ac係數進行反量化及 反余弦變化得到相應的YUV值。 步驟917 ’將得到YUV值從YUV變換到RGB空間獲得相應的 099115268 表單編號A0101 第17頁/共38頁 0992027027-0 201141234 RGB 值0 [0068] [0069] [0070] [0071] [0072] [0073] [0074] 099115268 乂’ 9根據獲取的起始位址從相應的表格中獲取 相應的壓縮字串作為相應的YUV分量值。 v驟921進仃γυν到RGB空間的變換獲得相應的㈣值。 步驟923 ’根據得到的RGB值和相應的圖像區塊資訊將相 應的圖像區塊進行還原。 上述圖像處理方法利用則G壓縮格式中的駡字串進行 處理,使得各壓縮圖像區塊可以獨立運作,且還依據謝 對一些圖像區塊設定不_壓縮率,简高壓縮比。另 外’各壓縮圖像區塊可以獨立運作可以對壓縮圖像標進 行局部解壓不但減少圖像佔用系統資琢且提高了圖像處 理速度。此外,壓縮圖像區塊對—麵縮圖像區塊利用 JPEG格式的解壓縮動作,進一步加快了圖像處理速度。 在其他實施方式中’圖像處理系統和圖像處理方法可以 不需要對圖像進行JPEG壓縮得到相應JpEG字串後才對 JPEG字串進行處理得到相”沉係數和ac係數而是對 圖像進行余弦變換和量化後得到相應的D G係數和A c係數 。亦即,t料處理模組307使用余弦變換單元和量化處理 單兀替換JPEG壓縮單元350和JPEG字串處理單元36〇。 【圖式簡單說明】 圖1為一較佳實施方式的圖像處理系統的功能模組圖。 圖2為一較佳實施方式的圖像處理系統處理圖像的過程示 意圖。 圖3為圖1圖像處理系統分割圖像區塊之示意圖 0992027027-0 表單編號A0101 第18頁/共38頁 201141234 [0075] 圖4為圖像區塊精度值表格的示意圖。 [0076] 圖5為圖像區塊精度值分配過程的示意圖。 [0077] 圖6為圖1圖像處理系統壓縮模式示意圖。 [0078] 圖7為解壓縮過程的示意圖。 [0079] 圖8為一較佳實施方式之圖像壓縮方法流程圖。 [0080] 圖9為一較佳實施方式之圖像解壓縮方法流程圖。 [0081] 圖1 0為現有的圖像處理過程示意圖。 〇 【主要元件符號說明】 [0082] 數位相機30 [0083] 電腦40 [0084] 緩衝區410 [0085] 圖像處理系統100 [0086] 輸入裝置200 〇 [0087] 圖像壓縮裝置300 [0088] 圖像解壓縮裝置400 [0089] 圖像獲取單元301 [0090] 資料處理模組307 [0091] JPEG壓縮單元350 [0092] JPEG字串處理單元360 [0093] 圖像分割單元302 099115268 表單編號A0101 第19頁/共38頁 0992027027-0 201141234 [0094] 精度分配單元303 [0095] 編碼is 3 0 4 [0096] 内部存儲單元305 [0097] 第一表格創建單元 310 [0098] 第二表格創建單元 320 [0099] 外部存儲單元306 [0100] JPEG表格 330 [0101] 壓縮編碼表格340 [0102] 解碼器401 [0103] 記憶體402 [0104] 圖像壓縮方法801 -825 [0105] 圖像解壓縮方法901〜923 099115268 表單編號 A0101 第 20 頁/共 38 頁 0992027027-0Follow-up actions. Since the compressed image file corresponds to three compression modes, correspondingly, the decoder 401 also has three decompression modes when decompressing: as shown in Fig. 7. When the image block precision value K = 〇, the decoder 401 directly obtains the index string in the corresponding array Tab[], that is, the "solidification coefficient corresponding to the γυν component as the YUV value, and the YUV value is γυν space to The RGB space is transformed to obtain the corresponding RGB value. When the precision value K=1, the image decompressing device 40 obtains the corresponding redundant coefficient in the jpEG table by the index word_ in the corresponding array Tab[], that is, Y〇 〇Y〇1Y1〇Y11UV 'as the value of 4 Y components and 1 U component and 1 V component' and transform it into YUV space to RGB space to obtain the corresponding RGB value 'No need for other decoding actions, when precision When the value K > 1 'the image decompressing device 4 obtains the corresponding compressed string in the jpEG table by the index string in the corresponding array Tab[], obtains the DC coefficient and the AC encoded string 'and encodes the ac The string is subjected to Huffman and RLE decoding to obtain the AC coefficient', so that the 叱 coefficient and the AC coefficient are transformed by the inverse quantization and the inverse cosine to obtain the corresponding γϋν value, and then the γυν value is transformed from the YUV space to the RGB space to obtain the RGB value. Utilize JPEG words in JPEG compression format Processing, so that each compressed image block can operate independently, and also set different compression ratios for some image blocks according to R〇I to increase the compression ratio. In addition, each compressed image block can operate independently. Compressing the image file for local solution not only reduces the image occupation system resources but also improves the image processing speed. In addition, the 'compressed image block uses jpEG 099115268 for some compressed image blocks. Form No. A0101 Page 13 of 38 0992027027-0 201141234 Format decompression action 'further speeds up image processing. [0044] Please refer to FIG. 8 , which is a flowchart of an image compression method according to a preferred embodiment. [0045] Step 801, acquiring an image That is, the subject is photographed. [0046] Step 803, the acquired image is divided into a plurality of image blocks. For example, the segmentation of the image block may be divided according to a preset size. [0047] 805: Set an accuracy value of each image block according to preset R〇I precision information. The preset ROI precision> sfl includes R〇I position information and precision value. For example, the wheel of each image area The degree value first determines the image block corresponding to the ROI based on the position information; then, sets the precision value of the corresponding image block to the precision value of the ROI. In addition, if multiple RO I have different precision values Corresponding to an image block, the maximum precision value of the plurality of I is set as the precision value of the image block (as shown in the figure and FIG. gb). In addition, the image block corresponding to the RO I may also be used. Adjacent image blocks are smoothed to make things slip between the image areas, and have continuity (Fig. 5c). [0048] Steps: generating a jpEG compressed string of each image block by using a JPEG compression algorithm, and processing the JPEG compressed string to obtain a DC coefficient and an ac coefficient of the YUV component corresponding to each image block. The DC coefficients and AC coefficients of the YUV components corresponding to the respective image blocks are obtained as described above, and will not be described herein. In the present embodiment, 'the YUV component of the image block is sampled with a ratio of 4:2:0'. Each image block includes 6 DC coefficients, that is, 4 Y components correspond to 4 DC coefficients Υ^υ ^ΥμΥ", one u component corresponds to one DC coefficient V, and one V component corresponds to one DC coefficient U. Similarly, each γ 099115268 Form No. A0101 Page 14 / Total 38 Page 0992027027-0 201141234 [0049] [0051] 005 [0053] [0054] 099115268 Component, U component, and V component respectively Corresponds to 63 AC coefficients. Step 809' begins to create a JPEG table and a compression coded table based on the accuracy values of the image blocks and the corresponding DC coefficients and AC coefficients. In step 811, the precision values of an image block are sequentially selected and stored in corresponding positions of the compression coding table. Step 813' determines whether the precision value in the compression coding table is greater than or equal to 1. If the precision value in the compression coding table is less than 1, the step is performed; if the precision value in the compression coding table is greater than or equal to 1, step 817 is performed. Step 815, selecting a corresponding DC coefficient, and converting the DC coefficient into three corresponding Dc coefficients corresponding to the γυν component, and storing the transformed]) (: coefficients in a preset order in a corresponding position of the compression coding table As a compression string, as described above, each image block includes 6 DC coefficients, that is, 4. γ component corresponds to 4 DC coefficients, one component corresponds to ! ! ^ ^ coefficient, - v component corresponds to 1 DC The coefficient, the three DC coefficients of the corresponding γυν component of the image block are respectively the d) the average value γ of the c-factor, the υ* amount corresponding to the DC coefficient U and the DC coefficient v corresponding to the V component, And stored in the compression coding table in the order of γ, u, v to generate a corresponding compressed string. In step 817, it is determined whether the precision value in the compression coding table is greater than 丨. If the precision value in the compression coding table is greater than 丨, step 819 is performed; if the precision value in the compression coding table is equal to 1, step 821 is performed. Step 819: Select a corresponding 阢 coefficient and a partial/all AC coefficient according to the corresponding precision value, and perform an RLE and Huffman coding on the AC coefficient to generate a slave code string, and store the CDMA code (in the order of the code string in the order of the first DC coefficient). Form No. A0101 Page 15 of 38 0992027027-0 201141234 The corresponding position of the JPEG table is used as a compression string. The coefficient is selected by selecting all or part of the AC coefficients in the JPEG string according to the range of precision values. For example, When an image block has an accuracy value of 1 <k<= 7, a corresponding partial AC coefficient is selected, and the precision value κ corresponds to the order of the z-shape to arrange the number of rows to be arranged in the parent matrix. For example, when When the precision value of the block is 4, it means that the data in the order of the z-shape is arranged in each matrix, and 9 pieces of data are obtained (: coefficient. When the accuracy value of an image block is k> = 8) Then select all the corresponding 虬 coefficients. [0058] [0059] [0059] 099115268 ^ 821, select the corresponding DC coefficient, and store the selected DC coefficients in the order of the stomach in the JPEG table To produce the corresponding compression As described above, each image block includes six 叱 coefficients, that is, four 丫 components correspond to four DC coefficients Υ〇ΛιΥιοΥιι, one 卩 component corresponds to one DC coefficient u, and one V component corresponds to one. a coefficient v, and in the order of γ t οογ 〇ΐ ΐ〇 ι ι υ 子 子 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 压缩 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 823 The obtained starting address is stored in step 825 of the position corresponding to the compression complication, and it is judged whether the accuracy values of all the image blocks have been selected. The accuracy values of all right image blocks are selected to Then, the creation of the JpEG table and the compressed bat table is completed, that is, the compressed image file is generated, and the process ends; otherwise, the process proceeds to step 811. Please refer to FIG. 9, which is a flowchart of the image decompression method of a preferred embodiment. Step 901: Determine whether a decompression of the information describing the image block is received 0992027027-0 Form No. A0101 Page 16 of 38 201141234 [0061] [0062] [0065] [0065] Ο [0067] instruction. Step 903 right Receiving a decompression instruction describing the information of the image block, and taking the precision value of the corresponding image block from the compression coding table according to the solution. Step 905 'determine whether the corresponding precision value is greater than or equal to 1. If corresponding The precision value λΙ, at step 1 'execute step ^; if the corresponding precision value is greater than or equal to 1, step 909 is performed. Step 9G7 'Get compression code ^: Grid towel character is converted to the corresponding YUV value. Step 909 ' performs a YUV space to RGB spatial transformation to obtain a corresponding RGB value. Step 911 ' obtains a starting address corresponding to the corresponding shortened string from the compression encoding table. Step 913' determines if the corresponding precision value is too large. If the corresponding precision value is greater than 1, step 915 is performed, and if the corresponding precision value is equal to 丨, step 919 is performed. Step 915: Obtain a corresponding compressed string from the JpEG table according to obtaining the corresponding starting address, and perform corresponding inverse change on the compressed string to obtain a corresponding YUV component value. Obtaining the YUV component value includes: obtaining a DC coefficient and an AC coded string in the compressed string, performing Huffinai^ RLE decoding on the AC bat code string to obtain an AC coefficient, and performing inverse quantization and inverse cosine variation on the DC coefficient and the ac coefficient. The corresponding YUV value. Step 917 'will get the YUV value from YUV to RGB space to obtain the corresponding 099115268 Form No. A0101 Page 17 / Total 38 Page 0992027027-0 201141234 RGB Value 0 [0068] [0070] [0071] [0072] 0073] [0074] 099115268 乂 '9 obtains the corresponding compressed string from the corresponding table as the corresponding YUV component value according to the obtained start address. v 921 仃 仃 υ υ ν to RGB space transformation to obtain the corresponding (four) value. Step 923 ' restores the corresponding image block based on the obtained RGB values and corresponding image block information. The image processing method described above utilizes the 骂 string in the G compression format to process, so that each compressed image block can operate independently, and also according to the setting of the non-compression rate and the simple high compression ratio for some image blocks. In addition, each compressed image block can operate independently, and local decompression of the compressed image mark can not only reduce image occupation system resources but also improve image processing speed. In addition, the compressed image block pair-area image block uses the JPEG format decompression action to further speed up the image processing. In other embodiments, the image processing system and the image processing method may process the JPEG string without JPEG compression of the image to obtain a corresponding JpEG string to obtain a phase coefficient and an ac coefficient but an image. Corresponding cosine transform and quantization are performed to obtain corresponding DG coefficients and A c coefficients. That is, the t-processing module 307 replaces the JPEG compression unit 350 and the JPEG string processing unit 36 using a cosine transform unit and a quantization processing unit. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a functional block diagram of an image processing system according to a preferred embodiment. Fig. 2 is a schematic diagram of a process of processing an image by an image processing system according to a preferred embodiment. Schematic diagram of processing system segmentation image block 0992027027-0 Form No. A0101 Page 18 of 38 201141234 [0075] Figure 4 is a schematic diagram of an image block precision value table. [0076] Figure 5 is image block accuracy 6 is a schematic diagram of a compression mode of the image processing system of FIG. 1. [0078] FIG. 7 is a schematic diagram of a decompression process. [0079] FIG. 8 is a diagram of an image compression method according to a preferred embodiment. flow 9 is a flow chart of an image decompression method according to a preferred embodiment. [0081] FIG. 10 is a schematic diagram of a conventional image processing process. 〇 [Main component symbol description] [0082] Digital camera 30 [0083] Computer 40 [0084] Buffer 410 [0085] Image Processing System 100 [0086] Input Device 200 [0087] Image Compression Device 300 [0088] Image Decompression Device 400 [0089] Image Acquisition Unit 301 [0090] Data Processing Module 307 [0091] JPEG Compression Unit 350 [0092] JPEG String Processing Unit 360 [0093] Image Segmentation Unit 302 099115268 Form Number A0101 Page 19 of 38 0992027027-0 201141234 [0094 Accuracy Allocating Unit 303 [0095] Encoding is 3 0 4 [0096] Internal Table Storage Unit 305 [0098] Second Table Creation Unit 310 [0099] External Storage Unit 306 [0100] JPEG Table 330 [0101] Compressed Encoding Table 340 [0102] Decoder 401 [0103] Memory 402 [0104] Image Compression Method 801 - 825 [0105] Image Decompression Method 901~923 099115268 Form Number A0101 Page 20 of 38 pages 0992027 027-0