TWI493502B - Processing method for image rotating and apparatus thereof - Google Patents

Processing method for image rotating and apparatus thereof Download PDF

Info

Publication number
TWI493502B
TWI493502B TW100134334A TW100134334A TWI493502B TW I493502 B TWI493502 B TW I493502B TW 100134334 A TW100134334 A TW 100134334A TW 100134334 A TW100134334 A TW 100134334A TW I493502 B TWI493502 B TW I493502B
Authority
TW
Taiwan
Prior art keywords
image
data
rotation
module
chromaticity
Prior art date
Application number
TW100134334A
Other languages
Chinese (zh)
Other versions
TW201314624A (en
Inventor
Yoa Ren Hsu
Shih Yuan Peng
Chih Feng Liu
Shuei Lin Chen
Original Assignee
Altek Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Altek Corp filed Critical Altek Corp
Priority to TW100134334A priority Critical patent/TWI493502B/en
Publication of TW201314624A publication Critical patent/TW201314624A/en
Application granted granted Critical
Publication of TWI493502B publication Critical patent/TWI493502B/en

Links

Description

處理影像旋轉的方法與裝置Method and device for processing image rotation

本發明是有關於一種處理影像旋轉的方法與裝置,且特別是有關於一種在解壓縮過程中處理影像旋轉的方法與裝置。The present invention relates to a method and apparatus for processing image rotation, and more particularly to a method and apparatus for processing image rotation during decompression.

一般數位相機或數位攝影機在進行拍照或錄影後,常需要對影像進行旋轉的處理。圖1是一種在執行解壓縮過程中產生旋轉後影像的方法流程圖,請參照圖1。首先如步驟S110所述,在開始執行解壓縮時,採用影像壓縮標準分別對各已壓縮影像的多數個區塊(band)依序執行解壓縮。接著,於步驟S120中,將各解壓縮影像縮放成適當的尺寸。最後,如步驟S130所述,將縮放後的影像經由中央處理單元(Central Processing Unit,CPU)運算,以找出進行旋轉後影像在記憶體中的相對位置,再依據此相對位置對記憶體中的資料進行搬移,以完成旋轉影像的動作。In general, a digital camera or a digital camera often needs to rotate the image after taking a picture or recording. FIG. 1 is a flow chart of a method for generating a rotated image during decompression, please refer to FIG. 1. First, as described in step S110, when decompression is started, decompression is sequentially performed on a plurality of bands of each compressed image by using an image compression standard. Next, in step S120, each decompressed image is scaled to an appropriate size. Finally, as described in step S130, the scaled image is calculated by a central processing unit (CPU) to find the relative position of the rotated image in the memory, and then according to the relative position in the memory. The data is moved to complete the action of rotating the image.

上述流程的步驟S120中,通常是將影像縮小,再經由中央處理單元進行運算,因為縮小後的影像可降低運算量。然而,若使用者希望觀看完整的影像尺寸,而非經過縮放後的尺寸,以目前現有的影像大小而言(例如是14Mb),中央處理單元對完整的影像尺寸進行旋轉運算,需要相當龐大的運算量且過於耗時。In step S120 of the above flow, the image is usually reduced and then calculated by the central processing unit, because the reduced image can reduce the amount of calculation. However, if the user wants to view the full image size instead of the scaled size, the central processing unit rotates the full image size in the current image size (for example, 14 Mb), which requires a considerable amount of The amount of calculation is too time consuming.

此外,若解壓縮影像為YCbCr 420或YCbCr 422格式影像,由於Y分量資料與Cb、Cr分量資料特殊的資料排列方式,因此若以YCbCr格式影像直接進行旋轉,其運算複雜度相當高,且旋轉後影像在記憶體中的相對位置過於離散,導致無法加速記憶體中的資料搬移動作。據此,降低了影像旋轉處理的效能。In addition, if the decompressed image is a YCbCr 420 or YCbCr 422 format image, the Y component data and the Cb and Cr component data have a special data arrangement manner. Therefore, if the YCbCr format image is directly rotated, the computational complexity is quite high, and the rotation is relatively high. The relative position of the post-image in the memory is too discrete, which makes it impossible to accelerate the movement of data in the memory. Accordingly, the performance of the image rotation processing is reduced.

有鑑於此,本發明提供一種處理影像旋轉的方法與裝置,藉由將影像先分離成亮度與色度資料,且利用查表方式來作旋轉的處理,以提升影像處理的效能。In view of the above, the present invention provides a method and apparatus for processing image rotation, by separating the image into luminance and chrominance data, and using a look-up table to perform rotation processing to improve image processing efficiency.

從一觀點來看,本發明提出一種處理影像旋轉的方法,適於接收多數個已壓縮影像,此方法包括下列步驟。先採用影像壓縮標準分別對各已壓縮影像的多數個區塊依序執行解壓縮,以產生對應這些區塊的多數個第一影像。並將各第一影像分離成亮度資料、第一色度資料與第二色度資料。再依據旋轉角度對應表進行查表,分別旋轉亮度資料、第一色度資料與第二色度資料,以產生旋轉後的亮度、第一色度與第二色度資料。並且將旋轉後的亮度、第一色度與第二色度資料合併成第二影像,並將各第二影像依序排列藉以產生旋轉後影像。From a point of view, the present invention provides a method of processing image rotation suitable for receiving a plurality of compressed images, the method comprising the following steps. First, a plurality of blocks of each compressed image are sequentially decompressed by using an image compression standard to generate a plurality of first images corresponding to the blocks. And separating each of the first images into luminance data, first chrominance data, and second chrominance data. Then, according to the rotation angle correspondence table, the brightness table data, the first chromaticity data and the second chromaticity data are respectively rotated to generate the rotated brightness, the first chromaticity and the second chromaticity data. And combining the rotated brightness, the first chromaticity and the second chromaticity data into a second image, and sequentially arranging the second images to generate a rotated image.

在本發明之一實施例中,上述之旋轉角度對應表紀錄旋轉角度與直接記憶體存取(Direct Memory Access,DMA)位置的對應關係。In an embodiment of the invention, the rotation angle correspondence table records a correspondence between a rotation angle and a direct memory access (DMA) position.

在本發明之一實施例中,上述之處理影像旋轉的方法,更包括對上述旋轉後影像進行放大或縮小,以產生調整後影像。In an embodiment of the invention, the method for processing image rotation further includes enlarging or reducing the rotated image to generate an adjusted image.

在本發明之一實施例中,上述之第一影像與第二影像為YCbCr 420格式影像或YCbCr 422格式影像。In an embodiment of the invention, the first image and the second image are YCbCr 420 format images or YCbCr 422 format images.

在本發明之一實施例中,上述之亮度資料為Y分量資料,上述之第一色度資料與第二色度資料為Cb分量資料與Cr分量資料。In an embodiment of the invention, the brightness data is Y component data, and the first chrominance data and the second chrominance data are Cb component data and Cr component data.

在本發明之一實施例中,上述之影像壓縮標準採用聯合影像專家群組(Joint Photographic Experts Group,JPEG)壓縮標準。In an embodiment of the invention, the image compression standard uses a Joint Photographic Experts Group (JPEG) compression standard.

從另一觀點來看,本發明提出一種處理影像旋轉的裝置,適於接收多數個已壓縮影像,此裝置包括影像壓縮模組、分離模組、旋轉模組以及合併模組。其中,影像壓縮模組採用影像壓縮標準分別對各已壓縮影像的多數個區塊依序執行解壓縮,以產生對應這些區塊的多數個第一影像。分離模組耦接影像壓縮模組,將各第一影像分離成亮度資料、第一色度資料與第二色度資料。旋轉模組耦接分離模組,依據旋轉角度對應表進行查表,分別旋轉亮度資料、第一色度資料與第二色度資料,藉以產生旋轉後的亮度、第一色度與第二色度資料。合併模組耦接旋轉模組,將旋轉後的亮度、第一色度與第二色度資料合併成第二影像,合併模組並將各第二影像依序排列藉以產生旋轉後影像。From another point of view, the present invention provides a device for processing image rotation, which is adapted to receive a plurality of compressed images. The device includes an image compression module, a separation module, a rotation module, and a merge module. The image compression module performs decompression on a plurality of blocks of each compressed image in sequence by using an image compression standard to generate a plurality of first images corresponding to the blocks. The separation module is coupled to the image compression module to separate each of the first images into luminance data, first chrominance data, and second chrominance data. The rotating module is coupled to the separating module, and is inspected according to the rotation angle correspondence table, respectively rotating the brightness data, the first chromaticity data and the second chromaticity data, thereby generating the rotated brightness, the first chromaticity and the second color Information. The merging module is coupled to the rotating module, and combines the rotated brightness, the first chromaticity and the second chromaticity data into a second image, merges the modules, and sequentially arranges the second images to generate a rotated image.

在本發明之一實施例中,上述之旋轉模組建立旋轉角度對應表,其中旋轉角度對應表紀錄旋轉角度與直接記憶體存取位置的對應關係。In an embodiment of the invention, the rotation module establishes a rotation angle correspondence table, wherein the rotation angle corresponds to a correspondence between the record rotation angle and the direct memory access position.

在本發明之一實施例中,上述之處理影像旋轉的裝置更包括耦接合併模組的尺寸調整模組,尺寸調整模組對合併模組所產生的旋轉後影像進行放大或縮小,以產生調整後影像。In an embodiment of the present invention, the device for processing image rotation further includes a size adjustment module coupled to the module, and the size adjustment module enlarges or reduces the rotated image generated by the merged module to generate Adjusted image.

在本發明之一實施例中,上述之第一影像與該些第二影像為YCbCr 420格式影像或YCbCr 422格式影像。In an embodiment of the invention, the first image and the second image are YCbCr 420 format image or YCbCr 422 format image.

在本發明之一實施例中,上述之亮度資料為Y分量資料,第一色度資料與第二色度資料為Cb分量資料與Cr分量資料。In an embodiment of the invention, the brightness data is a Y component data, and the first chrominance data and the second chrominance data are Cb component data and Cr component data.

在本發明之一實施例中,上述之影像壓縮模組所採用的影像壓縮標準為聯合影像專家群組壓縮標準。In an embodiment of the present invention, the image compression standard adopted by the image compression module is a joint image expert group compression standard.

基於上述,本發明所提供之處理影像旋轉的方法與裝置藉由將影像分成多數個區塊,且依序將每一區塊之影像分離成亮度與色度資料,利用查表的方式對亮度與色度資料分別進行旋轉,最後再將旋轉後的亮度與色度資料合併以產生旋轉後影像。據此,可增加影像旋轉處理的效能。Based on the above, the method and apparatus for processing image rotation provided by the present invention divides the image into a plurality of blocks, and sequentially separates the image of each block into luminance and chrominance data, and uses the look-up table to measure the brightness. Rotate separately from the chromaticity data, and finally combine the rotated luminance and chrominance data to generate a rotated image. According to this, the performance of the image rotation processing can be increased.

為讓本發明之上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。The above described features and advantages of the present invention will be more apparent from the following description.

圖2是依照本發明之一實施例所繪示之處理影像旋轉的裝置的方塊圖。請參照圖2,本實施例的處理影像旋轉的裝置200例如是數位相機、單眼相機、錄影機或是其他具有影像處理功能的智慧型手機、平板電腦等等,不限於上述。處理影像旋轉的裝置200適於接收多數個已壓縮影像,包括影像壓縮模組210、分離模組220、旋轉模組230以及合併模組240。其功能分述如下:影像壓縮模組210可由軟體、硬體或其組合實作而得,在此不加以限制。影像壓縮模組210採用影像壓縮標準對影像進行壓縮與解壓縮功能,其中影像壓縮標準例如是聯合影像專家群組(Joint Photographic Experts Group,JPEG)壓縮標準。2 is a block diagram of an apparatus for processing image rotation in accordance with an embodiment of the present invention. Referring to FIG. 2, the device 200 for processing image rotation in this embodiment is, for example, a digital camera, a monocular camera, a video recorder, or other smart phone, tablet computer or the like having image processing functions, and is not limited to the above. The apparatus 200 for processing image rotation is adapted to receive a plurality of compressed images, including an image compression module 210, a separation module 220, a rotation module 230, and a merge module 240. The function is described as follows: The image compression module 210 can be implemented by software, hardware, or a combination thereof, and is not limited herein. The image compression module 210 compresses and decompresses the image by using an image compression standard, such as the Joint Photographic Experts Group (JPEG) compression standard.

分離模組220、旋轉模組230以及合併模組240皆為為硬體所實現的功能模塊。其中硬體可包括中央處理單元、可程式化之一般用途或特殊用途的微處理器(Microprocessor)、數位訊號處理器(Digital Signal Processor,DSP)等具有運算功能的硬體設備或上述硬體設備的組合。其中,分離模組220耦接至影像壓縮模組210,用以將所接收的影像分離成不同的亮度、色度資料。旋轉模組230耦接至分離模組220,將不同的亮度、色度資料依據旋轉角度對應表分別進行查表與旋轉。最後,耦接至旋轉模組230的合併模組240將旋轉後的亮度、色度資料進行合併以產生旋轉後影像。The separation module 220, the rotation module 230, and the merge module 240 are all functional modules implemented by hardware. The hardware may include a central processing unit, a programmable general purpose or special purpose microprocessor (Microprocessor), a digital signal processor (DSP), and the like, or a hardware device having a computing function or the foregoing hardware device. The combination. The separation module 220 is coupled to the image compression module 210 for separating the received images into different brightness and chrominance data. The rotation module 230 is coupled to the separation module 220, and different brightness and chromaticity data are respectively inspected and rotated according to the rotation angle correspondence table. Finally, the merge module 240 coupled to the rotation module 230 combines the rotated luminance and chrominance data to generate a rotated image.

圖3是依照本發明之一實施例所繪示之一種處理影像旋轉的方法流程圖。請參照圖3,本實施例的方法適用於圖2的處理影像旋轉的裝置200,以下即搭配圖2中的各模組說明本實施例處理影像旋轉的方法的詳細步驟:首先如步驟S310所述,影像壓縮模組210採用影像壓縮標準分別對各已壓縮影像的多數個區塊依序執行解壓縮,以產生對應這些區塊的多數個第一影像。在本實施例中,影像壓縮標準例如是聯合影像專家群組壓縮標準。影像壓縮模組210對已壓縮影像進行解壓縮時,係採用分區方式,例如可將已壓縮影像中每256列分為一個區塊。圖4是依照本發明之一實施例所繪示之影像分區執行旋轉的示意圖。以下請同時配合參照圖2、圖3與圖4,一張已壓縮影像可分為N個區塊,影像壓縮模組210對N個區塊分別進行解壓縮後產生N個第一影像410_1~410_N,N個第一影像410_1~410_N可為YCbCr 420或YCbCr 422格式影像。YCbCr 420格式影像意指Cb色度分量與Cr色度分量在水平與垂直方向各只有一半的取樣率;YCbCr 422格式影像意指Cb色度分量與Cr色度分量具有相同垂直取樣率,但水平取樣率只有一半。FIG. 3 is a flow chart of a method for processing image rotation according to an embodiment of the invention. Referring to FIG. 3, the method of the present embodiment is applied to the device 200 for processing image rotation of FIG. 2, and the detailed steps of the method for processing image rotation in this embodiment are described below with reference to each module in FIG. 2: first, as shown in step S310. The image compression module 210 sequentially decompresses a plurality of blocks of each compressed image by using an image compression standard to generate a plurality of first images corresponding to the blocks. In this embodiment, the image compression standard is, for example, a joint imaging expert group compression standard. When the image compression module 210 decompresses the compressed image, the partitioning mode is adopted. For example, every 256 columns in the compressed image can be divided into one block. FIG. 4 is a schematic diagram of image partition execution rotation according to an embodiment of the invention. Please refer to FIG. 2, FIG. 3 and FIG. 4 together. A compressed image can be divided into N blocks, and the image compression module 210 decompresses the N blocks to generate N first images 410_1~ 410_N, the N first images 410_1~410_N may be YCbCr 420 or YCbCr 422 format images. The YCbCr 420 format image means that the Cb chrominance component and the Cr chrominance component are only half of the sampling rate in the horizontal and vertical directions; the YCbCr 422 format image means that the Cb chrominance component and the Cr chrominance component have the same vertical sampling rate, but the level The sampling rate is only half.

接著如步驟S320所述,分離模組220依序將N個第一影像410_1~410_N分離成亮度資料、第一色度資料與第二色度資料。如圖4所示,第一影像410_1為YCbCr 420或YCbCr 422格式影像,因此在本實施例中,可將第一影像410_1分成Y分量資料411、Cb分量資料412與Cr分量資料413。Next, as described in step S320, the separation module 220 sequentially separates the N first images 410_1~410_N into luminance data, first chrominance data, and second chrominance data. As shown in FIG. 4, the first image 410_1 is a YCbCr 420 or YCbCr 422 format image. Therefore, in this embodiment, the first image 410_1 can be divided into a Y component data 411, a Cb component data 412, and a Cr component data 413.

接下來,於步驟S330中,旋轉模組230建立旋轉角度對應表,其中旋轉角度對應表紀錄旋轉角度與直接記憶體存取(Direct Memory Access,DMA)位置的對應關係。在本實施例中,依據旋轉角度對應表進行查表,旋轉模組230可分別旋轉Y分量資料411、Cb分量資料412與Cr分量資料413,以產生旋轉後的Y分量資料411’、旋轉後的Cb分量資料412’與旋轉後的Cr分量資料413’。Next, in step S330, the rotation module 230 establishes a rotation angle correspondence table, wherein the rotation angle correspondence table records the correspondence relationship between the rotation angle and the direct memory access (DMA) position. In this embodiment, according to the rotation angle correspondence table, the rotation module 230 can respectively rotate the Y component data 411, the Cb component data 412, and the Cr component data 413 to generate the rotated Y component data 411' and after the rotation. The Cb component data 412' and the rotated Cr component data 413'.

合併模組240並將旋轉後的Y分量資料411’、旋轉後的Cb分量資料412’與旋轉後的Cr分量資料413’合併成第二影像420_1,並將剩餘的第二影像420_2~420_N依序排列以產生完整的旋轉後影像。由於合併後的第二影像420_1~420_N係為有次序的分區,因此,在第二影像420_1排列到相對應的記憶體資料位置後,剩餘的第二影像420_2~420_N只要按照順序依序排列即可,不需多做運算,如此可避免如先前技術所述旋轉後影像在記憶體中的相對位置過於離散的問題。The merge module 240 merges the rotated Y component data 411', the rotated Cb component data 412' and the rotated Cr component data 413' into a second image 420_1, and the remaining second images 420_2~420_N are The order is arranged to produce a complete rotated image. Since the merged second images 420_1~420_N are ordered partitions, after the second image 420_1 is aligned to the corresponding memory data position, the remaining second images 420_2~420_N are sequentially arranged in order. Yes, no more operations are required, so that the problem that the relative position of the image after rotation in the memory is too discrete as described in the prior art can be avoided.

具上所述,本發明在進行影像旋轉時,係將YCbCr格式影像先分離成個別的亮度、色度分量資料,並非如先前技術所述直接以YCbCr格式影像進行運算並做旋轉。因此,本發明利用個別的亮度、色度分量資料進行旋轉,可大為降低運算複雜度。此外,本發明利用旋轉模組來預先建立旋轉角度對應表,並依據查表的方式來找出影像經過旋轉後在記憶體中的相對位置,相較於完全使用軟體來計算影像中每一像素點經過旋轉後在記憶體中的相對位置,本發明所提供的處理影像旋轉的方法與裝置運算速度較快。As described above, in the image rotation, the YCbCr format image is first separated into individual luminance and chrominance component data, and is not directly calculated and rotated in the YCbCr format image as described in the prior art. Therefore, the present invention utilizes individual luminance and chrominance component data for rotation, which greatly reduces computational complexity. In addition, the present invention utilizes a rotating module to pre-establish a rotation angle correspondence table, and according to the manner of looking up the table, finds the relative position of the image in the memory after being rotated, and calculates each pixel in the image compared to completely using the software. The method and apparatus for processing image rotation provided by the present invention are faster in calculating the relative position of the dots in the memory.

以下另舉一實施例作為本發明確實能夠據以實施的範例。圖5是依照本發明之另一實施例所繪示之處理影像旋轉的裝置的方塊圖。在本實施例中,處理影像旋轉的裝置500除了包括影像壓縮模組210、分離模組220、旋轉模組230以及合併模組240之外,還包括尺寸調整模組550。其中,尺寸調整模組550耦接至合併模組240。尺寸調整模組550亦可為硬體所實現的功能模塊,用以對影像進行放大或縮小。由於處理影像旋轉的裝置500與圖2所示之處理影像旋轉的裝置200中的各模組具有相同或相似的功能,故其餘之模組在此不予贅述。The following additional embodiments are provided as examples in which the present invention can be implemented. FIG. 5 is a block diagram of an apparatus for processing image rotation according to another embodiment of the present invention. In this embodiment, the apparatus 500 for processing image rotation includes a size adjustment module 550 in addition to the image compression module 210, the separation module 220, the rotation module 230, and the merge module 240. The size adjustment module 550 is coupled to the merge module 240. The size adjustment module 550 can also be a functional module implemented by a hardware to enlarge or reduce an image. Since the device 500 for processing the image rotation has the same or similar functions as the modules in the device 200 for processing the image rotation shown in FIG. 2, the remaining modules are not described herein.

圖6是依照本發明之另一實施例所繪示之一種處理影像旋轉的方法流程圖。以下將以圖6說明處理影像旋轉的裝置500的運作方式。請同時參照圖5與圖6。FIG. 6 is a flow chart of a method for processing image rotation according to another embodiment of the invention. The mode of operation of the apparatus 500 for processing image rotation will be described below with reference to FIG. Please refer to FIG. 5 and FIG. 6 at the same time.

影像壓縮模組210採用影像壓縮標準分別對各已壓縮影像的多數個區塊依序執行解壓縮,以產生對應這些區塊的多數個第一影像(步驟S610)。接著,分離模組220依序將各第一影像分離成亮度資料、第一色度資料與第二色度資料(步驟S620)。旋轉模組230依據旋轉角度對應表進行查表,分別旋轉亮度資料、第一色度資料與第二色度資料,以產生旋轉後的亮度、第一色度與第二色度資料(步驟S630)。合併模組240將旋轉後的亮度、第一色度與第二色度資料合併成第二影像,並將各第二影像依序排列藉以產生旋轉後影像(步驟S640)。最後,尺寸調整模組550還可針對合併模組240所產生的旋轉後影像進行放大或縮小,以產生調整後影像。此調整後影像可直接輸出至螢幕進行播放。The image compression module 210 sequentially decompresses a plurality of blocks of each compressed image by using an image compression standard to generate a plurality of first images corresponding to the blocks (step S610). Next, the separation module 220 sequentially separates the first images into luminance data, first chrominance data, and second chrominance data (step S620). The rotation module 230 performs a table lookup according to the rotation angle correspondence table, and respectively rotates the brightness data, the first chromaticity data and the second chromaticity data to generate the rotated brightness, the first chromaticity and the second chromaticity data (step S630). ). The merging module 240 combines the rotated brightness, the first chromaticity and the second chromaticity data into a second image, and sequentially arranges the second images to generate a rotated image (step S640). Finally, the resizing module 550 can also zoom in or out on the rotated image generated by the merge module 240 to generate an adjusted image. This adjusted image can be directly output to the screen for playback.

在此須說明的是,由於如先前技術所述之方法,因為由軟體計算影像旋轉的運算量過大,因此必須在影像進行旋轉之前,進行縮小影像的動作,以降低運算量。但由於本發明係採用旋轉模組建立查表的方法,因此可節省運算量,在影像進行旋轉之前並不需要對影像進行縮放處理。尺寸調整模組550係為附加之功能,用以在影像輸出前,可依照使用者需求調整成適當的影像尺寸,以便進行播放與觀賞。It should be noted that, as described in the prior art, since the amount of calculation for calculating the image rotation by the software is too large, it is necessary to perform the operation of reducing the image before the image is rotated to reduce the amount of calculation. However, since the present invention uses a rotating module to establish a table lookup method, the amount of calculation can be saved, and the image does not need to be scaled before the image is rotated. The size adjustment module 550 is an additional function for adjusting the image size to a suitable image size for playback and viewing before the image is output.

由圖5與圖6所示之實施例進行實驗效能的測試,當測試影像大小為4288×3216時,其測試結果如下:分離模組220執行其工作所需花費的時間約為148毫秒(ms);旋轉模組230執行其工作所需花費的時間約為472 ms;合併模組240執行其工作所需花費的時間約為191 ms;尺寸調整模組550執行其工作所需花費的時間約為251 ms;而完成整個影像旋轉的流程所消耗的時間約為1067 ms。The experimental performance test is performed by the embodiment shown in FIG. 5 and FIG. 6. When the test image size is 4288×3216, the test result is as follows: the time taken by the separation module 220 to perform its work is about 148 milliseconds (ms). The time it takes for the rotation module 230 to perform its work is about 472 ms; the time it takes for the merge module 240 to perform its work is about 191 ms; the time it takes for the size adjustment module 550 to perform its work is about It is 251 ms; the time taken to complete the entire image rotation process is approximately 1067 ms.

相對地,利用如圖1所述之方法流程進行實驗效能的測試,測試影像大小同樣為4288×3216時,完成整個影像旋轉的流程所消耗的時間約為4034 ms。據此,本發明所提供之處理影像旋轉的方法與裝置確實能提升影像處理的效能。In contrast, the experimental performance test is performed by using the method flow as shown in FIG. 1. When the test image size is also 4288×3216, the time taken to complete the entire image rotation process is about 4034 ms. Accordingly, the method and apparatus for processing image rotation provided by the present invention can indeed improve the performance of image processing.

綜上所述,本發明所提供之處理影像旋轉的方法與裝置藉由將影像分成多數個區塊,且依序將每一區塊之影像分離成亮度與色度資料,利用硬體查表的方式對亮度與色度資料分別進行旋轉,最後再將旋轉後的亮度與色度資料合併以產生旋轉後影像。本發明係採用軟體與硬體合併使用的方式,來增加影像旋轉處理的效能,除了可避免完全使用軟體運算導致運算量過大,處理時間過久的問題,還可避免完全使用硬體運算而導致成本過高的問題。In summary, the method and apparatus for processing image rotation provided by the present invention divide the image into a plurality of blocks, and sequentially separate the image of each block into brightness and chrominance data, and use the hardware to look up the table. The method of rotating the luminance and chrominance data separately, and finally combining the rotated luminance and chrominance data to generate a rotated image. The invention adopts a combination of software and hardware to increase the performance of image rotation processing, in addition to avoiding the problem that the calculation amount is too large and the processing time is too long, and the use of hardware operations can be avoided. The problem of excessive cost.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,故本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the invention, and any one of ordinary skill in the art can make some modifications and refinements without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims.

200、500...處理影像旋轉的裝置200, 500. . . Device for processing image rotation

210...影像壓縮模組210. . . Image compression module

220...分離模組220. . . Separation module

230...旋轉模組230. . . Rotary module

240...合併模組240. . . Merge module

410_1~410_N...第一影像410_1~410_N. . . First image

411、411’...Y分量資料411, 411’. . . Y component data

412、412’...Cb分量資料412, 412’. . . Cb component data

413、413’...Cr分量資料413, 413’. . . Cr component data

420_1~420_N...第二影像420_1~420_N. . . Second image

S110~S130...產生旋轉後影像的方法之各步驟S110~S130. . . Steps of the method of generating a rotated image

S310~S340...本發明一實施例之處理影像旋轉的方法之各步驟S310~S340. . . Each step of the method for processing image rotation according to an embodiment of the present invention

S610~S650...本發明另一實施例之處理影像旋轉的方法之各步驟S610~S650. . . Various steps of a method for processing image rotation according to another embodiment of the present invention

圖1是一種在執行解壓縮過程中產生旋轉後影像的方法流程圖。1 is a flow chart of a method of generating a rotated image during the execution of a decompression process.

圖2是依照本發明之一實施例所繪示之處理影像旋轉的裝置的方塊圖。2 is a block diagram of an apparatus for processing image rotation in accordance with an embodiment of the present invention.

圖3是依照本發明之一實施例所繪示之一種處理影像旋轉的方法流程圖。FIG. 3 is a flow chart of a method for processing image rotation according to an embodiment of the invention.

圖4是依照本發明之一實施例所繪示之影像分區執行旋轉的示意圖。FIG. 4 is a schematic diagram of image partition execution rotation according to an embodiment of the invention.

圖5是依照本發明之另一實施例所繪示之處理影像旋轉的裝置的方塊圖。FIG. 5 is a block diagram of an apparatus for processing image rotation according to another embodiment of the present invention.

圖6是依照本發明之另一實施例所繪示之一種處理影像旋轉的方法流程圖。FIG. 6 is a flow chart of a method for processing image rotation according to another embodiment of the invention.

S310~S340...處理影像旋轉的方法之各步驟S310~S340. . . Steps in the method of processing image rotation

Claims (12)

一種處理影像旋轉的方法,適於接收多數個已壓縮影像,包括:採用一影像壓縮標準分別對各該已壓縮影像的多數個區塊依序執行解壓縮,以產生對應該些區塊的多數個第一影像;將各該第一影像分離成一亮度資料、一第一色度資料與一第二色度資料;依據一旋轉角度對應表進行查表,分別旋轉該亮度資料、該第一色度資料與該第二色度資料,以產生旋轉後的該亮度、該第一色度與該第二色度資料;以及將旋轉後的該亮度、該第一色度與該第二色度資料合併成一第二影像,並將各該第二影像依序排列藉以產生在空間位置上被旋轉的一旋轉後影像。 A method for processing image rotation, which is adapted to receive a plurality of compressed images, comprising: performing decompression on a plurality of blocks of each compressed image in sequence by using an image compression standard to generate a majority corresponding to the blocks; Separating each of the first images into a brightness data, a first chromaticity data, and a second chromaticity data; performing a table lookup according to a rotation angle correspondence table, respectively rotating the brightness data, the first color Degree data and the second chromaticity data to generate the rotated brightness, the first chromaticity and the second chromaticity data; and the rotated brightness, the first chromaticity and the second chromaticity The data is merged into a second image, and each of the second images is sequentially arranged to generate a rotated image that is rotated at a spatial position. 如申請專利範圍第1項所述之處理影像旋轉的方法,其中該旋轉角度對應表紀錄旋轉角度與直接記憶體存取(Direct Memory Access,DMA)位置的對應關係。 The method for processing image rotation as described in claim 1, wherein the rotation angle corresponds to a correspondence between a record rotation angle and a direct memory access (DMA) position. 如申請專利範圍第1項所述之處理影像旋轉的方法,更包括:對該旋轉後影像進行放大或縮小,以產生一調整後影像。 The method for processing image rotation as described in claim 1, further comprising: zooming in or out the rotated image to generate an adjusted image. 如申請專利範圍第1項所述之處理影像旋轉的方法,其中該些第一影像與該些第二影像為YCbCr 420格式影像或YCbCr 422格式影像。 The method for processing image rotation according to the first aspect of the invention, wherein the first image and the second image are YCbCr 420 format image or YCbCr 422 format image. 如申請專利範圍第4項所述之處理影像旋轉的方法,其中該亮度資料為Y分量資料,該第一色度資料與該第二色度資料為Cb分量資料與Cr分量資料。 The method for processing image rotation as described in claim 4, wherein the brightness data is Y component data, and the first chromaticity data and the second chromaticity data are Cb component data and Cr component data. 如申請專利範圍第1項所述之處理影像旋轉的方法,其中該影像壓縮標準採用聯合影像專家群組(Joint Photographic Experts Group,JPEG)壓縮標準。 The method for processing image rotation as described in claim 1, wherein the image compression standard adopts a Joint Photographic Experts Group (JPEG) compression standard. 一種處理影像旋轉的裝置,適於接收多數個已壓縮影像,包括:一影像壓縮模組,採用一影像壓縮標準分別對各該已壓縮影像的多數個區塊依序執行解壓縮,以產生對應該些區塊的多數個第一影像;一分離模組,耦接該影像壓縮模組,將各該第一影像分離成一亮度資料、一第一色度資料與一第二色度資料;一旋轉模組,耦接該分離模組,依據一旋轉角度對應表進行查表,分別旋轉該亮度資料、該第一色度資料與該第二色度資料進行旋轉,以產生旋轉後的該亮度、該第一色度與該第二色度資料;以及一合併模組,耦接該旋轉模組,將旋轉後的該亮度、該第一色度與該第二色度資料合併成一第二影像,合併模組並將各該第二影像依序排列藉以產生在空間位置上被旋轉的一旋轉後影像。 A device for processing image rotation is adapted to receive a plurality of compressed images, comprising: an image compression module, wherein an image compression standard sequentially performs decompression on a plurality of blocks of each of the compressed images to generate a pair a plurality of first images of the plurality of blocks; a separate module coupled to the image compression module to separate each of the first images into a luminance data, a first chrominance data, and a second chrominance data; The rotation module is coupled to the separation module, and is inspected according to a rotation angle correspondence table, and respectively rotates the brightness data, the first chromaticity data and the second chromaticity data to rotate, to generate the brightness after rotation The first chromaticity and the second chromaticity data; and a merging module coupled to the rotating module, combining the rotated brightness, the first chromaticity and the second chromaticity data into a second And merging the modules and sequentially arranging each of the second images to generate a rotated image that is rotated in a spatial position. 如申請專利範圍第7項所述之處理影像旋轉的裝置,其中:該旋轉模組建立該旋轉角度對應表,其中該旋轉角度 對應表紀錄旋轉角度與直接記憶體存取(Direct Memory Access,DMA)位置的對應關係。 The apparatus for processing image rotation according to claim 7, wherein: the rotation module establishes the rotation angle correspondence table, wherein the rotation angle is The correspondence table records the correspondence between the rotation angle and the position of the direct memory access (DMA). 如申請專利範圍第7項所述之處理影像旋轉的裝置,更包括:一尺寸調整模組,耦接該合併模組,該尺寸調整模組對該合併模組所產生的該旋轉後影像進行放大或縮小,以產生一調整後影像。 The apparatus for processing image rotation as described in claim 7 further includes: a size adjustment module coupled to the merge module, wherein the size adjustment module performs the rotated image generated by the merged module Zoom in or out to produce an adjusted image. 如申請專利範圍第7項所述之處理影像旋轉的裝置,其中:該些第一影像與該些第二影像為YCbCr 420格式影像或YCbCr 422格式影像。 The device for processing image rotation according to claim 7, wherein the first image and the second image are YCbCr 420 format image or YCbCr 422 format image. 如申請專利範圍第10項所述之處理影像旋轉的裝置,其中:該亮度資料為Y分量資料,該第一色度資料與該第二色度資料為Cb分量資料與Cr分量資料。 The apparatus for processing image rotation according to claim 10, wherein: the brightness data is Y component data, and the first chromaticity data and the second chromaticity data are Cb component data and Cr component data. 如申請專利範圍第7項所述之處理影像旋轉的裝置,其中:該影像壓縮模組所採用的該影像壓縮標準為聯合影像專家群組壓縮標準。 The apparatus for processing image rotation according to claim 7, wherein the image compression standard used by the image compression module is a joint image expert group compression standard.
TW100134334A 2011-09-23 2011-09-23 Processing method for image rotating and apparatus thereof TWI493502B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW100134334A TWI493502B (en) 2011-09-23 2011-09-23 Processing method for image rotating and apparatus thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW100134334A TWI493502B (en) 2011-09-23 2011-09-23 Processing method for image rotating and apparatus thereof

Publications (2)

Publication Number Publication Date
TW201314624A TW201314624A (en) 2013-04-01
TWI493502B true TWI493502B (en) 2015-07-21

Family

ID=48802569

Family Applications (1)

Application Number Title Priority Date Filing Date
TW100134334A TWI493502B (en) 2011-09-23 2011-09-23 Processing method for image rotating and apparatus thereof

Country Status (1)

Country Link
TW (1) TWI493502B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI511088B (en) * 2014-07-25 2015-12-01 Altek Autotronics Corp Method for generating orientation image

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6594388B1 (en) * 2000-05-25 2003-07-15 Eastman Kodak Company Color image reproduction of scenes with preferential color mapping and scene-dependent tone scaling
US20070115370A1 (en) * 2005-11-18 2007-05-24 Casio Computer Co., Ltd. Image processing apparatus, imaging apparatus, image processing method, and program
TWI338264B (en) * 2007-07-02 2011-03-01 Asustek Comp Inc Image processing method and electric device using the same

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6594388B1 (en) * 2000-05-25 2003-07-15 Eastman Kodak Company Color image reproduction of scenes with preferential color mapping and scene-dependent tone scaling
US20070115370A1 (en) * 2005-11-18 2007-05-24 Casio Computer Co., Ltd. Image processing apparatus, imaging apparatus, image processing method, and program
TWI338264B (en) * 2007-07-02 2011-03-01 Asustek Comp Inc Image processing method and electric device using the same

Also Published As

Publication number Publication date
TW201314624A (en) 2013-04-01

Similar Documents

Publication Publication Date Title
US9619861B2 (en) Apparatus and method for improving quality of enlarged image
CN112204993B (en) Adaptive panoramic video streaming using overlapping partitioned segments
WO2020063507A1 (en) Image processing method and system, and computer readable storage medium
WO2020063505A1 (en) Image processing method, system, and computer readable storage medium
TWI568257B (en) System, method, and non-transitory, computer-readable stroage medium for in-stream rolling shutter compensation
CN111741274B (en) Ultrahigh-definition video monitoring method supporting local amplification and roaming of picture
WO2020063508A1 (en) Smart terminal, image processing method and computer readable storage medium
JP7359521B2 (en) Image processing method and device
US10110821B2 (en) Image processing apparatus, method for controlling the same, and storage medium
JP2003263148A (en) Index image display control device
US20120169900A1 (en) Image processing device and image processing method
US20110134208A1 (en) Panoramic image synthesizer, panoramic image synthesis method, and program
US7701466B2 (en) Method and system for providing accelerated video processing in a communication device
US20150103204A1 (en) Image processing device and method capable of displaying high-quality image while preventing display delay, and image pickup apparatus
US20110261061A1 (en) Method and system for processing image data on a per tile basis in an image sensor pipeline
JP2004179881A5 (en)
JP4340836B2 (en) Image composition apparatus and image composition program
US7212214B2 (en) Apparatuses and methods for interpolating missing colors
TWI493502B (en) Processing method for image rotating and apparatus thereof
JPWO2017187508A1 (en) Display processing apparatus and imaging apparatus
TW201905852A (en) Image capturing device and image processing method
CN110519530B (en) Hardware-based picture-in-picture display method and device
TWI597658B (en) Electronic device, display system and image processing method
WO2020071467A1 (en) Video processing device, display device, and video processing method
JP2014216668A (en) Imaging apparatus

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees