TW202348018A - Data processing method and data processing system - Google Patents
Data processing method and data processing system Download PDFInfo
- Publication number
- TW202348018A TW202348018A TW111139055A TW111139055A TW202348018A TW 202348018 A TW202348018 A TW 202348018A TW 111139055 A TW111139055 A TW 111139055A TW 111139055 A TW111139055 A TW 111139055A TW 202348018 A TW202348018 A TW 202348018A
- Authority
- TW
- Taiwan
- Prior art keywords
- address
- memory
- pixel
- pixels
- valid
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 34
- 230000001186 cumulative effect Effects 0.000 claims description 23
- 238000009825 accumulation Methods 0.000 claims description 5
- 230000003287 optical effect Effects 0.000 claims description 5
- 230000003068 static effect Effects 0.000 claims description 5
- 238000013507 mapping Methods 0.000 description 27
- 238000010586 diagram Methods 0.000 description 14
- 238000003860 storage Methods 0.000 description 10
- 238000000034 method Methods 0.000 description 3
- 230000001788 irregular Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/60—Memory management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/80—Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Input (AREA)
- Image Processing (AREA)
- Hardware Redundancy (AREA)
- Communication Control (AREA)
- Measurement Of Optical Distance (AREA)
- Length Measuring Devices With Unspecified Measuring Means (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
Description
本揭示關於一種資料處理方法及資料處理系統,特別有關於一種輸入影像之資料存取於記憶體之處理方法及處理系統。This disclosure relates to a data processing method and a data processing system, and in particular to a processing method and processing system for accessing data of an input image in a memory.
在多媒體或人工智能的應用中,攝像裝置可配合於記憶體協同運作。攝像裝置產生輸入影像之後,輸入影像的資料可暫存於記憶體之中,以利於整體系統的運作。In multimedia or artificial intelligence applications, the camera device can cooperate with the memory to operate cooperatively. After the camera device generates the input image, the data of the input image can be temporarily stored in the memory to facilitate the operation of the overall system.
然而,當輸入影像的像素的資料量較大時,像素的資料可能佔據記憶體大部分的使用量。並且,當輸入影像的像素的資料高頻率的存取於記憶體時,輸入影像的資料存取可能佔據大量頻寬,導致整體系統的運作效率降低。However, when the amount of pixel data in the input image is large, the pixel data may occupy most of the memory usage. Moreover, when the pixel data of the input image is accessed in the memory at a high frequency, the data access of the input image may occupy a large amount of bandwidth, resulting in a reduction in the operating efficiency of the overall system.
因此,本技術領域之技術人員係致力於改良輸入影像與記憶體之間的資料處理方法,期能夠降低輸入影像的資料對於記憶體的存取頻寬以及使用量。Therefore, those skilled in the art are committed to improving the data processing method between the input image and the memory, hoping to reduce the access bandwidth and usage of the input image data to the memory.
根據本揭示之一方面,提供一種資料處理方法,包括以下步驟。接收輸入影像,輸入影像具有複數個像素,各像素具有像素位置。於輸入影像之中定義有效區域,像素之中的複數個有效像素位於有效區域內,且各有效像素具有有效資料。根據記憶體的起始寫入位址及輸入影像的有效寬度,或者根據起始寫入位址、輸入影像的起始偏移及記憶體的累積位址,將有效資料對應寫入記憶體中的目標位址。According to one aspect of the present disclosure, a data processing method is provided, including the following steps. Receive an input image. The input image has a plurality of pixels, and each pixel has a pixel position. A valid area is defined in the input image, a plurality of valid pixels among the pixels are located in the valid area, and each valid pixel has valid data. According to the starting writing address of the memory and the effective width of the input image, or according to the starting writing address, the starting offset of the input image and the accumulated address of the memory, the valid data is written into the memory correspondingly. target address.
在本揭示一實施例中,輸入影像經由攝像裝置而產生,有效區域的形狀與面積相關於攝像裝置的光學特性。In an embodiment of the present disclosure, the input image is generated by a camera device, and the shape and area of the effective area are related to the optical characteristics of the camera device.
在本揭示一實施例中,根據第一位址配置關係式或第二位址配置關係式配置些目標位址,其中,第一位址配置關係式相關於記憶體的起始寫入位址及輸入影像的有效寬度,第二位址配置關係式相關於起始寫入位址、輸入影像的起始偏移及累積位址。In an embodiment of the present disclosure, some target addresses are configured according to a first address configuration relationship or a second address configuration relationship, wherein the first address configuration relationship is related to the starting write address of the memory. and the effective width of the input image. The second address configuration relationship is related to the starting write address, the starting offset of the input image, and the accumulation address.
在本揭示一實施例中,將有效資料對應寫入記憶體中的目標位址之步驟包括以下。判斷些像素之中的目前像素是否具有有效資料。以及,當目前像素具有有效資料時,根據第一位址配置關係式將目前像素的有效資料寫入對應的目標位址。In an embodiment of the present disclosure, the steps of writing valid data corresponding to a target address in the memory include the following. Determine whether the current pixel among these pixels has valid data. And, when the current pixel has valid data, the valid data of the current pixel is written to the corresponding target address according to the first address configuration relationship.
在本揭示一實施例中,根據第一位址配置關係式從記憶體中讀取目標位址儲存的有效資料。In an embodiment of the present disclosure, valid data stored at the target address is read from the memory according to the first address configuration relationship.
在本揭示一實施例中,將有效資料對應寫入記憶體中的目標位址之步驟包括以下。判斷些像素之中的一目前像素是否具有有效資料。當目前像素具有有效資料時,根據第二位址配置關係式將目前像素的有效資料寫入對應的目標位址。以及,從記憶體的起始寫入位址開始累加目前像素對應於記憶體的一位址,並將目前像素的有效資料寫入目前累加的位址以將些目標位址配置為連續位址。In an embodiment of the present disclosure, the steps of writing valid data corresponding to a target address in the memory include the following. Determine whether a current pixel among the pixels has valid data. When the current pixel has valid data, the valid data of the current pixel is written into the corresponding target address according to the second address configuration relationship. And, starting from the starting write address of the memory, accumulating the current pixel corresponds to an address in the memory, and writing the valid data of the current pixel to the currently accumulated address to configure these target addresses as continuous addresses. .
在本揭示一實施例中,根據第二位址配置關係式從記憶體中讀取目標位址儲存的有效資料。In an embodiment of the present disclosure, valid data stored at the target address is read from the memory according to the second address configuration relationship.
在本揭示一實施例中,有效區域的邊界相關於滿足式,當像素之中的目前像素的像素位置符合滿足式時,判斷目前像素具有有效資料。In an embodiment of the present disclosure, the boundary of the effective area is related to a satisfying expression. When the pixel position of the current pixel among the pixels meets the satisfying expression, it is determined that the current pixel has valid data.
在本揭示一實施例中,像素於輸入影像之中排列為複數個列,各列的有效寬度或各列對應的累積位址紀錄於查詢表,根據查詢表判斷像素之中的目前像素是否具有有效資料且將有效資料寫入對應的目標位址。In an embodiment of the present disclosure, pixels are arranged in a plurality of columns in the input image. The effective width of each column or the cumulative address corresponding to each column is recorded in a lookup table. According to the lookup table, it is determined whether the current pixel among the pixels has valid data and writes the valid data to the corresponding target address.
在本揭示一實施例中,記憶體是動態隨機存取記憶體,且查詢表建立於記憶體以外的靜態隨機存取記憶體。In one embodiment of the present disclosure, the memory is a dynamic random access memory, and the lookup table is established in a static random access memory other than the memory.
根據本揭示之另一方面,提供一種資料處理系統,包括攝像裝置、處理器及記憶體。攝像裝置用以產生輸入影像,輸入影像具有複數個像素,各像素具有像素位置。記憶體具有複數個目標位址。處理器用以於輸入影像之中定義有效區域,像素之中的複數個有效像素位於有效區域內,且各有效像素具有有效資料。其中處理器根據記憶體的起始寫入位址及輸入影像的一有效寬度,或者根據起始寫入位址、輸入影像的一起始偏移及記憶體的一累積位址,將有效資料對應寫入記憶體中的複數個目標位址。According to another aspect of the present disclosure, a data processing system is provided, including a camera device, a processor and a memory. The camera device is used to generate an input image. The input image has a plurality of pixels, and each pixel has a pixel position. The memory has multiple target addresses. The processor is used to define a valid area in the input image, a plurality of valid pixels among the pixels are located in the valid area, and each valid pixel has valid data. The processor corresponds the valid data according to the starting writing address of the memory and a valid width of the input image, or according to the starting writing address, a starting offset of the input image and an accumulated address of the memory. Write multiple target addresses in memory.
在本揭示一實施例中,有效區域的形狀與面積相關於攝像裝置的光學特性。In an embodiment of the present disclosure, the shape and area of the effective area are related to the optical characteristics of the camera device.
在本揭示一實施例中,處理器根據第一位址配置關係式或第二位址配置關係式配置目標位址,其中,第一位址配置關係式相關於起始寫入位址及有效寬度,第二位址配置關係式相關於起始寫入位址、起始偏移及累積位址。In an embodiment of the present disclosure, the processor configures the target address according to a first address configuration relationship or a second address configuration relationship, wherein the first address configuration relationship is related to the starting write address and the effective Width, the second address configuration relationship is related to the starting write address, starting offset and cumulative address.
在本揭示一實施例中,處理器判斷像素之中的一目前像素是否具有有效資料,當目前像素具有有效資料時,根據第一位址配置關係式將目前像素的有效資料寫入對應的目標位址。In an embodiment of the present disclosure, the processor determines whether a current pixel among the pixels has valid data. When the current pixel has valid data, it writes the valid data of the current pixel into the corresponding target according to the first address configuration relationship. address.
在本揭示一實施例中,處理器根據第一位址配置關係式從記憶體中讀取目標位址儲存的有效資料。In an embodiment of the present disclosure, the processor reads valid data stored at the target address from the memory according to the first address configuration relationship.
在本揭示一實施例中,處理器判斷像素之中的一目前像素是否具有有效資料,當目前像素具有有效資料時,根據第二位址配置關係式將目前像素的有效資料寫入對應的目標位址,以及從記憶體的起始寫入位址開始累加目前像素對應於記憶體的一位址,並將目前像素的有效資料寫入目前累加的位址以將目標位址配置為連續位址。In an embodiment of the present disclosure, the processor determines whether a current pixel among the pixels has valid data. When the current pixel has valid data, it writes the valid data of the current pixel to the corresponding target according to the second address configuration relationship. address, and start accumulating the current pixel from the starting write address of the memory corresponding to an address in the memory, and write the valid data of the current pixel to the currently accumulated address to configure the target address as a continuous bit site.
在本揭示一實施例中,處理器根據第二位址配置關係式從記憶體中讀取目標位址儲存的有效資料。In an embodiment of the present disclosure, the processor reads valid data stored at the target address from the memory according to the second address configuration relationship.
在本揭示一實施例中,像素於輸入影像之中排列為複數個列,各列的一有效寬度或各列對應的一累積位址紀錄於一查詢表,根據查詢表讀取目標位址儲存的有效資料。In an embodiment of the present disclosure, pixels are arranged in a plurality of columns in the input image, an effective width of each column or a cumulative address corresponding to each column is recorded in a lookup table, and the target address is read and stored according to the lookup table. valid information.
在本揭示一實施例中,有效區域的一邊界相關於一滿足式,查詢表根據滿足式而建立。In an embodiment of the present disclosure, a boundary of the effective area is related to a satisfying expression, and the lookup table is established according to the satisfying expression.
在本揭示一實施例中,記憶體是動態隨機存取記憶體,且查詢表建立於記憶體以外的靜態隨機存取記憶體。In one embodiment of the present disclosure, the memory is a dynamic random access memory, and the lookup table is established in a static random access memory other than the memory.
透過閱讀以下圖式、詳細說明以及申請專利範圍,可見本揭示之其他方面以及優點。By reading the following drawings, detailed descriptions and patent claims, other aspects and advantages of the present disclosure can be seen.
本說明書的技術用語係參照本技術領域之習慣用語,如本說明書對部分用語有加以說明或定義,該部分用語之解釋係以本說明書之說明或定義為準。本揭示之各個實施例分別具有一或多個技術特徵。在可能實施的前提下,本技術領域具有通常知識者可選擇性地實施任一實施例中部分或全部的技術特徵,或者選擇性地將這些實施例中部分或全部的技術特徵加以組合。The technical terms in this specification refer to the idioms in the technical field. If there are explanations or definitions for some terms in this specification, the explanation or definition of this part of the terms shall prevail. Each embodiment of the present disclosure has one or more technical features. Under the premise that implementation is possible, a person with ordinary skill in the art can selectively implement some or all of the technical features in any embodiment, or selectively combine some or all of the technical features in these embodiments.
第1圖為本揭示之輸入影像100的示意圖。如第1圖所示,輸入影像100包括複數個像素p00~像素p66,此些像素排列為複數個列(row)(或可稱為「線(line)」) L0~L6及複數個行(column) C0~C6。像素p00~像素p66每一者的像素位置(y,x)對應於列Ly與行Cx。例如,像素p00的像素位置(0,0)對應於列L0與行C0,像素p01的像素位置(0,1)對應於列L0與行C1,依此類推。Figure 1 is a schematic diagram of the
輸入影像100是經由攝像裝置(圖中未顯示)而產生的。輸入影像100的像素p00~像素p66每一者具備了資料(即,輸入影像100的影像資料),每一像素的資料之資料量例如為一個位元組(byte)(即,8個位元)。基於攝像裝置的特性,在像素p00~像素p66之中,僅有部分像素之資料為有效,具備有效資料的像素稱為「有效像素」。此些有效像素形成輸入影像100的有效區域R1。當有效區域為實際能有效接收到光源的區域時,有效區域R1的形狀與面積大小相關於攝像裝置的光學特性,例如,當攝像裝置之鏡頭為魚眼鏡頭時,有效區域R1大致為圓形。此外,有效區域可以是使用者自訂區域。The
在第1圖的實施例中,有效區域R1包括之像素(即,位於有效區域R1內之像素)為:列L1的像素p11~像素p15、列L2的像素p21~像素p25、列L3的像素p31~像素p35、列L4的像素p41~像素p45及列L5的像素p51~像素p55。即,上述的像素p11~p15、p21~p25、p31~p35、p41~p45及p51~p55為有效像素,此些有效像素具備了有效資料。In the embodiment of FIG. 1, the pixels included in the effective area R1 (that is, the pixels located in the effective area R1) are: pixels p11 to p15 in the column L1, pixels p21 to p25 in the column L2, and pixels in the column L3. p31 ~ pixel p35, pixels p41 ~ pixel p45 in column L4, and pixels p51 ~ pixel p55 in column L5. That is, the above-mentioned pixels p11~p15, p21~p25, p31~p35, p41~p45 and p51~p55 are valid pixels, and these valid pixels have valid data.
相對的,位於有效區域R1外之像素為:列L0的像素p00~像素p06、列L6的像素p60~像素p66、行C0的像素p10~p50及行C6的像素p16~p56。上述的像素p00~p06、p60~p66、p10~p50及p16~p56為「無效像素」,此些無效像素具備了無效資料。In contrast, the pixels located outside the effective area R1 are: pixels p00 to p06 in column L0, pixels p60 to p66 in column L6, pixels p10 to p50 in row C0, and pixels p16 to p56 in row C6. The above-mentioned pixels p00~p06, p60~p66, p10~p50 and p16~p56 are "invalid pixels", and these invalid pixels have invalid data.
可藉由攝像裝置本身的處理器進行即時(real-time)運算或線上(on-line)運算,或藉由攝像裝置以外的處理器進行離線(off-line)運算,以得到像素位置(y,x)的滿足式,據以定義有效區域R1的邊界。在本實施例中,有效區域R1為圓形,有效區域R1的圓心RC對應至像素位置(3,3)的像素p33,有效區域R1的半徑為2。有效區域R1的圓周為邊界,邊界上的像素位置(y,x)與圓心RC的距離等於2。式(1)為像素位置(y,x)的第一滿足式,用於定義有效區域R1的邊界: (1) The pixel position (y , x) satisfies the formula to define the boundary of the effective area R1. In this embodiment, the effective area R1 is circular, the center RC of the effective area R1 corresponds to the pixel p33 at the pixel position (3,3), and the radius of the effective area R1 is 2. The circumference of the effective area R1 is the boundary, and the distance between the pixel position (y, x) on the boundary and the center RC of the circle is equal to 2. Equation (1) is the first satisfying expression of the pixel position (y, x), which is used to define the boundary of the effective area R1: (1)
類似的,式(2)為像素位置(y,x)的第二滿足式,用於定義有效區域R1內的有效像素: (2) Similarly, equation (2) is the second satisfying equation of pixel position (y, x), which is used to define the effective pixels in the effective area R1: (2)
當像素的像素位置(y,x)符合第二滿足式時,可判斷此像素位於有效區域R1內,此像素為有效像素,此像素具備了有效資料。上述的式(1)的第一滿足式及式(2)的第二滿足式適用於有效區域R1為圓形。在其他示例中,當有效區域R1可以是其他形狀(例如,矩形、方形、三角形、六角形、其他多邊形,等等),則根據不同的滿足式來定義不同形狀之有效區域R1的邊界。When the pixel position (y, x) of a pixel meets the second satisfying expression, it can be determined that the pixel is located in the effective area R1, the pixel is a valid pixel, and the pixel has valid data. The above-mentioned first satisfying expression of equation (1) and the second satisfying expression of equation (2) are applicable when the effective region R1 is circular. In other examples, when the effective region R1 can be other shapes (eg, rectangle, square, triangle, hexagon, other polygon, etc.), the boundaries of the effective region R1 of different shapes are defined according to different satisfying formulas.
第2圖為本揭示第一實施例的資料處理方法的示意圖。資料處理方法包括寫入操作與讀取操作,可應用於第1圖的輸入影像100。寫入操作是將輸入影像100之像素的資料寫入記憶體200,讀取操作是將已寫入記憶體200的資料讀取出來。記憶體200例如為動態隨機存取記憶體(DRAM),在本實施例中,記憶體200的位址(address)以連續的十進位數值來表示。記憶體200的起始位址是位址0、起始位址的次一個位址是位址1,依此類推,記憶體200的最終位址例如是位址48。Figure 2 is a schematic diagram of a data processing method according to the first embodiment of the present disclosure. The data processing method includes writing operations and reading operations, which can be applied to the
在第2圖的實施例中,為了節省輸入影像100的寫入操作的頻寬(即,減少從輸入影像100寫入記憶體200的寫入次數與寫入資料量),僅將輸入影像100之中的有效像素(有效區域R1內的像素)的資料寫入記憶體200,無效像素(有效區域R1外的像素)則無需寫入記憶體200。在一種示例中,可根據目前的像素之像素位置(y,x)是否符合式(2)的第二滿足式,來判斷目前的像素是否為有效像素。例如,目前的像素p00不符合第二滿足式,判斷像素p00為無效像素,則像素p00的資料不寫入記憶體200的位址0,同時,記憶體200的位址累積(即,累加1個位址)為位址1。接著,在下一個時間點,對於目前的像素p01進行判斷。像素p01判斷為無效像素,則像素p01的資料不寫入記憶體200的位址1,同時,記憶體200的位址累積為位址2。依此類推,依時間點判斷目前的像素之像素位置(y,x)是否符合第二滿足式,並持續累積記憶體200的位址。當該時間點之目前的像素判斷為有效像素時,此像素寫入記憶體200目前累積的位址。當該時間點之目前的像素判斷為無效像素時,此像素不寫入記憶體200,但仍持續累積記憶體200的位址。據此,輸入影像100之有效的像素p11~像素p15、像素p21~像素p25、像素p31~像素p35、像素p41~像素p45及像素p51~像素p55的資料依序寫入記憶體200之目標位址。欲寫入的目標位址包括:位址8~位址12、位址15~位址19、位址22~位址26、位址29~位址33及位址36~位址40。In the embodiment of FIG. 2 , in order to save the bandwidth of the writing operation of the input image 100 (that is, to reduce the number of writing times and the amount of writing data from the
在第2圖的資料處理方法的另一種示例中,是根據輸入影像100之像素的像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係、並根據記憶體200之欲寫入的目標位址的配置方式來執行寫入操作。在第2圖的實施例中,像素位置(y,x)是直接映射於記憶體200之欲寫入的目標位址,映射關係如下:輸入影像100的列L1的像素位置(1,1)~像素位置(1,5)直接映射於記憶體200的第二個橫向列的欲寫入的目標位址8~位址12,列L2的像素位置(2,1)~像素位置(2,5)直接映射於記憶體200的第三個橫向列的位址15~位址19,列L3的像素位置(3,1)~像素位置(3,5)直接映射於記憶體200的第四個橫向列的欲寫入的目標位址22~位址26,列L4的像素位置(4,1)~像素位置(4,5)直接映射於記憶體200的第五個橫向列的欲寫入的目標位址29~位址33,列L5的像素位置(5,1)~像素位置(5,5)直接映射於記憶體200的第六個橫向列的欲寫入的目標位址36~位址40。上述的直接映射的映射關係的意義為:欲寫入記憶體200的目標位址是直接相關於像素位置(y,x)在輸入影像100中的分佈關係。In another example of the data processing method in Figure 2, it is based on the mapping relationship between the pixel position (y, x) of the pixel of the
對於記憶體200之欲寫入的目標位址而言,可根據第一位址配置關係式定義目標位址的配置方式。第一位址配置關係式如式(3)所示:
(3)
For the target address to be written into the
式(3)之各項的定義如下。「目前寫入位址W_Addr」是目前的像素W_p寫入記憶體200的位址。「起始寫入位址Addr_st」是輸入影像100之第一個有效的像素p11寫入記憶體200的位址。「有效寬度wid_img」是輸入影像100的有效寬度。「像素位置y」是目前的像素W_p的像素位置(y,x)對應於列Ly的位置。「像素位置x」是目前的像素W_p的像素位置(y,x)對應於行Cx的位置。The definitions of each term in formula (3) are as follows. "Current writing address W_Addr" is the address where the current pixel W_p is written into the
當執行寫入操作時,依時間點判斷目前的像素W_p之像素位置(y,x)是否符合第二滿足式。當目前的像素W_p符合第二滿足式而判斷為有效像素時,根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係並參考式(3)之第一位址配置關係式,將目前的像素W_p寫入至目前寫入位址W_Addr。例如,目前的像素W_p是像素p33,像素p33的像素位置(3,3)滿足式(2)的第二滿足式而判斷像素p33為有效像素。根據映射關係,像素位置(3,3)映射於記憶體200的位址24,可參考式(3)之第一位址配置關係式將目前的像素p33寫入至記憶體200的目前寫入位址W_Addr=24。據此,有效的像素p11~像素p15、像素p21~像素p25、像素p31~像素p35、像素p41~像素p45及像素p51~像素p55依序寫入記憶體200的位址8~位址12、位址15~位址19、位址22~位址26、位址29~位址33及位址36~位址40。When performing a write operation, it is determined according to the time point whether the pixel position (y, x) of the current pixel W_p meets the second satisfying expression. When the current pixel W_p meets the second satisfying expression and is determined to be a valid pixel, the mapping relationship between the pixel position (y, x) and the target address to be written in the
另一方面,欲讀取已寫入記憶體200的資料時,則執行資料處理方法之讀取操作,讀取操作包括連續(sequential)讀取與隨機(random)讀取。可根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係並參考式(3)之第一位址配置關係式執行讀取操作。On the other hand, when the data written into the
另一方面,根據欲寫入的目標位置的映射關係得知記憶體200的第二個橫向列的位址8~位址12、第三個橫向列的位址15~位址19、第四個橫向列的位址22~位址26、第五個橫向列的位址29~位址33及第六個橫向列的位址36~位址40儲存了有效像素的資料,則對於位址8~位址12、位址15~位址19、位址22~位址26、位址29~位址33及位址36~位址40執行讀取操作。例如,對於第二個橫向列的位址8~位址12執行讀取操作時,參考式(3)之第一位址配置關係式可得知:從位址8讀取出的資料為像素位置(1,1)的像素p11的資料,從位址9讀取出的資料為像素位置(1,2)的像素p12的資料,依此類推。On the other hand, according to the mapping relationship of the target location to be written, it is known that the
第3圖為本揭示第二實施例的資料處理方法的示意圖。相較於第2圖的實施例之像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係是直接映射的關係,在第3圖的實施例中,記憶體200的欲寫入的目標位置是配置為緊密的連續位址,據以節省記憶體200的使用量。Figure 3 is a schematic diagram of a data processing method according to a second embodiment of the present disclosure. Compared with the embodiment of Figure 2, the mapping relationship between the pixel position (y, x) and the target address to be written in the
第3圖的實施例之像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係如下:當記憶體200的起始寫入位址Addr_st為位址0時,輸入影像100的25個有效的像素p11~像素p15、像素p21~像素p25、像素p31~像素p35、像素p41~像素p45及像素p51~像素p55映射於連續的位址0~位址24。更具體而言,有效區域R1內的列L1的有效的像素位置(1,1)~像素位置(1,5)映射於記憶體200的位址0~位址4,列L2的有效的像素位置(2,1)~像素位置(2,5)映射於記憶體200的位址5~位址9,列L3的有效的像素位置(3,1)~像素位置(3,5)映射於記憶體200的位址10~位址14,列L4的有效的像素位置(4,1)~像素位置(4,5)映射於記憶體200的位址15~位址19,列L5的有效的像素位置(5,1)~像素位置(5,5)映射於記憶體200的位址20~位址24。The mapping relationship between the pixel position (y, x) and the target address to be written in the
並且,第3圖的實施例中,輸入影像100之像素p00~像素p66每一者的資料量為一個位元組(byte)(即,8個位元),並且記憶體200之位址0~位址48每一者對應的儲存空間亦為一個位元組,即,像素p00~像素p66每一者的資料量相等於位址0~位址48每一者對應的儲存空間。對於第3圖之實施例的記憶體200之欲寫入的目標位址而言,可根據第二位址配置關係式定義目標位址的配置方式。第二位址配置關係式如式(4)所示:
(4)
Moreover, in the embodiment of FIG. 3 , the data amount of each pixel p00 ~ pixel p66 of the
式(4)之各項的定義如下。「目前寫入位址W_Addr」是目前的像素W_p寫入記憶體200的位址。「起始寫入位址Addr_st」是輸入影像100之第一個有效的像素p11寫入記憶體200的位址。「像素位置x」是目前的像素W_p的像素位置(y,x)對應於行Cx的位置。「累積位址Addr_acc」等於目前的像素W_p所在列之前的所有列已寫入的像素的總數量(排除目前的像素W_p所在列的像素的數量)。「起始偏移St_ofs」是輸入影像100之各列的第一個有效像素相對於輸入影像100各列之第一個像素p00的位置偏移。根據上述定義,在第3圖的實施例中,目前的像素W_p例如是像素p33,像素p33的像素位置x=3。起始寫入位址Addr_st例如是記憶體200的位址0 (即,Addr_st=0)。目前的像素W_p之前已寫入的列L1、列L2包括的像素p11~p15、p21~p25的總數量為10,因此累積位址Addr_acc=10。起始偏移St_ofs是各列的第一個有效像素相對於第一個像素p00的像素位置之偏移,例如,列L1的起始偏移St_ofs=1。根據式(4)的第二位址配置關係式可計算出目前寫入位址W_Addr=12 (即,12=0+10-1+3)。式(4)的第二位址配置關係式可根據式(2)的第二滿足式來產生。其中,根據式(2)的第二滿足式得到輸入影像100之有效像素之各列的起始偏移St_ofs以及各列的累積位址Addr_acc,而後,根據各列的起始偏移St_ofs及累積位址Addr_acc產生式(4)的第二位址配置關係式。The definitions of each term in equation (4) are as follows. "Current writing address W_Addr" is the address where the current pixel W_p is written into the
當執行寫入操作時,依時間點判斷目前的像素W_p之像素位置(y,x)是否符合第二滿足式。當目前的像素W_p符合第二滿足式而判斷為有效像素時,根據式(4)之第二位址配置關係式,將目前的像素W_p寫入至目前寫入位址W_Addr。例如,目前的像素W_p是像素p33,其像素位置(3,3)滿足式(2)的第二滿足式而判斷為有效像素。根據欲寫入的目標位址的映射關係得知像素位置(3,3)映射於記憶體200的位址12,參考式(4)之第二位址配置關係式將目前的像素p33寫入至記憶體200的目前寫入位址W_Addr=12。When performing a write operation, it is determined according to the time point whether the pixel position (y, x) of the current pixel W_p meets the second satisfying expression. When the current pixel W_p meets the second satisfying expression and is determined to be a valid pixel, the current pixel W_p is written to the current writing address W_Addr according to the second address configuration relation of equation (4). For example, the current pixel W_p is the pixel p33, and its pixel position (3, 3) satisfies the second satisfying expression of equation (2) and is determined to be a valid pixel. According to the mapping relationship of the target address to be written, it is known that the pixel position (3,3) is mapped to the
在另一種示例中,第3圖的資料處理方法的寫入操作無須根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係或式(4)之第二位址配置關係式。當目前的像素W_p符合第二滿足式而判斷為有效像素時,從起始寫入位址Addr_st開始,將有效的像素W_p連續寫入記憶體200。例如,像素p11符合第二滿足式而判斷為有效像素,將像素p11寫入至起始寫入位址Addr_st=0。接著,次一個像素p12亦符合第二滿足式而判斷為有效像素,將像素p12寫入至起始寫入位址Addr_st的次一個位址1,依此類推。像素p16、p20不符合第二滿足式而判斷為無效像素時,像素p16、p20不寫入記憶體200。接著,像素p21符合第二滿足式而判斷為有效像素,像素p21寫入至記憶體200,依此類推。In another example, the writing operation of the data processing method in Figure 3 does not need to be based on the mapping relationship between the pixel position (y, x) and the target address to be written in the
在另一種示例中,可根據查詢表(lookup table)定義有效區域R1。相較於儲存於記憶體200之像素的資料,查詢表的資料量較小,因此查詢表可建立於記憶體200以外的另一記憶體(圖中未顯示)。例如,記憶體200為DRAM,則查詢表可建立於DRAM以外的靜態隨機讀取記憶體(SRAM)之中。第3圖的輸入影像100之有效像素為:像素p11~像素p15、像素p21~像素p25、像素p31~像素p35、像素p41~像素p45及像素p51~像素p55。可根據表1所示的查詢表來定義有效區域R1並據此判斷有效像素:
表1
在表1的查詢表中,「偏移ofs」是輸入影像100的每一列的第一個有效像素的像素位置x的偏移,「有效寬度wid」等於各列包括的有效像素的總數量。例如,列L0不包括有效像素,因此列L0的偏移ofs=0 (或者,列L0的偏移ofs可以給定任意數值)且有效寬度wid=0。類似的,列L6不包括有效像素,因此列L6的偏移ofs=0 (或者,列L6的偏移ofs可以給定任意數值)且有效寬度wid=0。此外,列L1的第一個有效的像素p11的像素位置x=1的偏移ofs=1,列L1包括五個有效的像素p11~p15,因此列L1的有效寬度wid=5。類似的,列L2~列L5每一者的偏移ofs=1且有效寬度wid=5。In the lookup table of Table 1, "offset ofs" is the offset of the pixel position x of the first effective pixel in each column of the
在第3圖的資料處理方法的一種示例中,可根據表1的查詢表執行寫入操作,以將有效區域R1內的有效像素的資料寫入記憶體200之對應的位址。例如,表1紀錄了列L1的偏移ofs=1且有效寬度wid=5,可得知:目前的列L1的五個有效的像素p11~p15欲寫入記憶體200。根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係,得到像素p11~p15映射於記憶體200的位址0~位址4。可參考式(4)之第二位址配置關係式得到像素p11對應的目前寫入位址W_Addr=0,像素p12對應的目前寫入位址W_Addr=1,像素p13對應的目前寫入位址W_Addr=2,像素p14對應的目前寫入位址W_Addr=3,像素p15對應的目前寫入位址W_Addr=4。接著,下一個列L2的偏移ofs=1且有效寬度wid=5,可得知:目前的列L2的五個有效的像素p21~p25欲寫入記憶體200。根據根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係,得到像素p21~p25映射於記憶體200的位址5~位址9。參考式(4)之第二位址配置關係式,得到像素p21~p25分別對應的目前寫入位址W_Addr=5,6,7,8,9。In an example of the data processing method in FIG. 3 , a write operation can be performed according to the lookup table in Table 1 to write the data of the effective pixels in the effective area R1 to the corresponding address of the
在另一種示例中,寫入操作無須根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係或式(4)之第二位址配置關係式,而是根據表1紀錄之目前的列之偏移ofs及有效寬度wid,將該列的有效像素連續寫入記憶體200。In another example, the writing operation does not need to be based on the mapping relationship between the pixel position (y, x) and the target address to be written in the
另一方面,當執行讀取操作時,可根據式(2)的第二滿足式建立表1的查詢表。而後,根據表1的查詢表轉換為參考式(4)的第二位址配置關係式,從位址W_Addr讀出對應之像素的資料。例如,對於位址W_Addr=12進行讀取時,根據表1的查詢表及式(4)得知:位址W_Addr=12讀取出的資料為像素p33的資料。在讀取操作的另一種示例中,表1的查詢表是已經建立好的,則直接由另一記憶體(例如SRAM)查找表1的查詢表,並配合參考式(4)而執行讀取操作。On the other hand, when performing a read operation, the lookup table of Table 1 can be established according to the second satisfying expression of equation (2). Then, the lookup table in Table 1 is converted into the second address configuration relational expression of reference equation (4), and the corresponding pixel data is read from the address W_Addr. For example, when reading the address W_Addr=12, according to the lookup table in Table 1 and equation (4), it is known that the data read from the address W_Addr=12 is the data of the pixel p33. In another example of the read operation, the lookup table of Table 1 has been established, and the lookup table of Table 1 is directly looked up from another memory (such as SRAM), and the read is performed in conjunction with the reference formula (4). operate.
當輸入影像的有效區域具有規則形狀時,可根據像素位置(y,x)的滿足式(例如,式(2)的第二滿足式)定義有效區域,亦可根據查詢表(例如,表1紀錄的偏移ofs與有效寬度wid)定義有效區域。在其他示例中,當有效區域具有不規則形狀時,較適合用查詢表定義有效區域。When the effective area of the input image has a regular shape, the effective area can be defined according to the satisfying expression of the pixel position (y, x) (for example, the second satisfying expression of equation (2)), or according to the lookup table (for example, Table 1 The record's offset ofs and effective width wid) define the effective area. In other examples, when the effective area has an irregular shape, it is more appropriate to use a lookup table to define the effective area.
第4圖為本揭示第三實施例的資料處理方法的示意圖,本實施例的輸入影像100b之有效區域R2具有不規則形狀,較適合用查詢表定義有效區域R2。有效區域R2包括列L1的像素p14、p15,列L2的像素p21、p23~p25,列L3的像素p31~p34,列L4的像素p41~p43,及列L5的像素p52。並且,像素p22位於有效區域R2的凹陷處,但像素p22不屬於有效區域R2。然而,在計算列L2的有效寬度wid時,將像素p22列入計算,因此列L2的有效寬度wid=5。可根據表2所示的查詢表來定義有效區域R2:
表2
在表2的查詢表中,列L0的偏移ofs=0且有效寬度wid=0,表示列L0不包括有效像素。列L1的偏移ofs=4且有效寬度wid=2,表示列L1包括兩個有效的像素p14、p15,且列L1的第一個有效像素p14的像素位置x的偏移是4。類似的,表2紀錄的列L2的偏移ofs=1有效寬度wid=5,表示列L2包括四個有效的像素p21、p23、p24、p25 (像素p22不是有效像素,但計算有效寬度wid時計入像素p22),且列L2的第一個有效像素p21的像素位置x的偏移是1,依此類推。In the lookup table of Table 2, the offset ofs=0 and the effective width wid=0 of column L0 means that column L0 does not include effective pixels. The offset ofs=4 and the effective width wid=2 of column L1 means that column L1 includes two effective pixels p14 and p15, and the offset of the pixel position x of the first effective pixel p14 of column L1 is 4. Similarly, the offset of column L2 recorded in Table 2 is ofs=1 and the effective width wid=5, which means that column L2 includes four valid pixels p21, p23, p24, and p25 (pixel p22 is not a valid pixel, but the effective width wid is calculated when into pixel p22), and the offset of the pixel position x of the first effective pixel p21 of column L2 is 1, and so on.
在第4圖的實施例中,像素位置(y,x)是直接映射於記憶體200之欲寫入的目標位址(即,欲寫入記憶體200的目標位址是直接相關於像素位置(y,x)在輸入影像100b中的分佈關係),欲寫入的目標位址的映射關係如下:輸入影像100b的列L1的有效像素的像素位置(1,4)、(1,5)直接映射於記憶體200的第二個橫向列的位址11、12。列L2的有效像素的像素位置(2,1)、(2,3)、(2,4)、(2,5)直接映射於記憶體200的第三個橫向列的位址15、17、18、19。列L3的有效像素的像素位置(3,1)、(3,2)、(3,3)、(3,4)直接映射於記憶體200的第三個橫向列的位址22、23、24、25。列L4的有效像素的像素位置(4,1)、(4,2)、(4,3)直接映射於記憶體200的第三個橫向列的位址29、30、31。L5的有效像素的像素位置(5,2)直接映射於記憶體200的第三個橫向列的位址37。並且,根據式(3)的第一位址配置關係式來定義記憶體200之目標位址的配置方式。In the embodiment of FIG. 4 , the pixel position (y, x) is directly mapped to the target address to be written to the memory 200 (i.e., the target address to be written to the
在第4圖的資料處理方法的一種示例中,根據表2紀錄的各列的有效寬度wid來決定目前的列應當寫入記憶體200的對應寬度的位址,並根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係,且參考式(3)的第一位址配置關係式,執行寫入操作以將像素的資料寫入記憶體200。例如,表2紀錄了列L0的有效寬度wid=0,得知列L0不包括有效像素,因此不寫入記憶體200。接著,表2紀錄了列L1的偏移ofs=4且有效寬度wid=2,得知列L1包括兩個有效的像素p14、p15。根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係,得知像素p14映射於記憶體200的位址11,像素p15映射於記憶體200的位址12。並且,參考式(3)的第一位址配置關係式,將像素p14、p15的資料寫入位址11、12。後續的列L2~L5根據相同方式執行寫入操作。In an example of the data processing method in Figure 4, the address of the corresponding width of the current column that should be written into the
另一方面,在第4圖的資料處理方法的一種示例中,寫入操作可無須根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係且無須參考式(3)的第一位址配置關係式,而是根據表2紀錄的各列的有效寬度wid來決定目前的列應當寫入記憶體200的對應寬度的位址,同時記憶體200的目前寫入位置持續累積。例如,表2紀錄了列L0的有效寬度wid=0,可判斷列L0的七個像素皆為無效像素,因此列L0的七個像素不寫入記憶體200,但記憶體200的目前寫入位址累積為6。接著,表2紀錄了列L1的偏移ofs=4且有效寬度wid=2,可判斷列L1的前四個像素為無效像素而不寫入記憶體200,但記憶體200的目前寫入位址仍持續累積而累積為10。並且,列L1的像素p14、p15為有效像素,則像素p14、p15寫入目前累積的位址10的次兩個位址11、12。接著,列L1的最後一個像素判斷為無效像素而不寫入記憶體200,但記憶體200的目前寫入位址累積為13。後續的列L2~L5根據相同方式執行寫入操作。On the other hand, in an example of the data processing method in FIG. 4 , the writing operation does not need to be based on the mapping relationship between the pixel position (y, x) and the target address to be written in the
第5圖為本揭示第四實施例的資料處理方法的示意圖。相較於第4圖的實施例之像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係是直接映射的關係,在第5圖的實施例中,記憶體200的對應位址是配置為緊密的連續位址,據以節省記憶體200的使用量。第5圖的實施例之像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係如下:當記憶體200的起始寫入位址Addr_st為位址0時,輸入影像100b的14個有效的像素p14、p15、p21、p23~p25、p31~p34、p41~p43及p52映射於連續的欲寫入的目標位址0~14。並且,第5圖的實施例可以藉由表2的查詢表來定義輸入影像100b的有效區域R2,據以判斷是否為有效像素,並根據表2紀錄的各列的有效寬度wid來決定目前的列應當寫入記憶體200的對應寬度的位址。Figure 5 is a schematic diagram of a data processing method according to the fourth embodiment of the present disclosure. Compared with the mapping relationship between the pixel position (y, x) and the target address to be written in the
在一種示例中,根據表2紀錄的各列的有效寬度wid、像素位置(y,x)與記憶體200之目標位址的映射關係、以及根據表2轉換為式(4)的第二位址配置關係式來執行寫入操作。例如,表2紀錄了列L1的偏移ofs=4且有效寬度wid=2,得知列L1包括兩個有效的像素p14、p15,因此目前的列L1應當寫入記憶體200的對應寬度為2的位址(即,應當寫入2個位址)。根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係,得知像素p14映射於記憶體200的位址0,像素p15映射於記憶體200的位址1。可參考式(4)的第二位址配置關係式將像素p14、p15的資料寫入位址0、1。In an example, according to the effective width wid of each column recorded in Table 2, the mapping relationship between the pixel position (y, x) and the target address of the
另一方面,當執行讀取操作時,是根據表2與式(4)的第二位址配置關係式來執行。例如,根據表2及式(4)從記憶體200的位址W_Addr=4讀取像素p23的資料,從位址W_Addr=13讀取像素p43的資料。On the other hand, when performing a read operation, it is performed according to the second address configuration relationship of Table 2 and Equation (4). For example, according to Table 2 and equation (4), the data of the pixel p23 is read from the address W_Addr=4 of the
在另一種示例中,寫入操作無須根據像素位置(y,x)與記憶體200之欲寫入的目標位址的映射關係及式(4)的第二位址配置關係式,而是直接根據表2紀錄的各列的有效寬度wid決定目前的列應當寫入記憶體200的對應寬度的位址,據以連續寫入記憶體200。例如,列L1的偏移ofs=4且有效寬度wid=2,則將列L1的兩個有效的像素p14、p15連續寫入記憶體200的兩個連續的位址0、1。In another example, the writing operation does not need to be based on the mapping relationship between the pixel position (y, x) and the target address to be written in the
第5圖的實施例亦可以藉由表3所示的查詢表來定義輸入影像100b的有效區域R2。表3是紀錄輸入影像100b的每一個列對應的「累積位址Addr_acc」而非紀錄「有效寬度wid」。
表3
表3紀錄的累積位址Addr_acc的意義是:對於輸入影像100b的目前寫入的列而言,之前的列對應的累積位址。例如,對於目前寫入的列L1而言,之前的列L0的累積位址Addr_acc為「N/A」,其中「N/A」可為使用者定義的一特定數值(例如是負數或正最大值);或者,L0的累積位址Addr_acc可設置為0 (可由L1的累積位址Addr_acc減去L2的累積位址Addr_acc為0而得知),表示列L0不包括有效像素,因此列L0的像素不寫入記憶體200。因此,表3紀錄的列L1對應的累積位址Addr_acc=0。The meaning of the cumulative address Addr_acc recorded in Table 3 is: for the currently written column of the
類似的,對於目前寫入的列L2而言,之前已寫入的列L1的兩個有效的像素p14、p15寫入至位址0及位址1,因此列L2對應的累積位址是位址2。因此,表3紀錄的列L2對應的累積位址Addr_acc=2。對於目前寫入的列L3而言,之前已寫入的列L2的五個有效的像素p21~p25寫入至位址2~位址6,因此表3紀錄的列L3對應的累積位址Addr_acc=7。依此類推。Similarly, for the currently written column L2, the two valid pixels p14 and p15 of the previously written column L1 are written to address 0 and
當實際執行記憶體200的寫入操作時,可根據表3的查詢表計算記憶體200的位址。表3紀錄了列L1的偏移ofs=4、列L1的累積位址Addr_acc=0、且下一個列L2的累積位址Addr_acc=2。目前的列L1的累積位址Addr_acc與下一個列L2的累積位址Addr_acc的差距是2。據此,對於列L1的有效像素而言,以偏移ofs=4的像素p14為起始,連續寫入兩個像素p14、p15的資料至記憶體200的位址0、1。When the writing operation of the
類似的,對於列L2而言,表3紀錄了列L2的偏移ofs=1、列L2的累積位址Addr_acc=2、且下一個列L3的累積位址Addr_acc=7。目前的列L2的累積位址Addr_acc與下一個列L3的累積位址Addr_acc的差距是5。據此,以偏移ofs=1的像素p21為起始,連續寫入五個像素p21~p25的資料至記憶體200的位址2~6。Similarly, for column L2, Table 3 records the offset ofs=1 of column L2, the cumulative address Addr_acc=2 of column L2, and the cumulative address Addr_acc=7 of the next column L3. The difference between the accumulated address Addr_acc of the current column L2 and the accumulated address Addr_acc of the next column L3 is 5. Accordingly, starting from the pixel p21 with offset ofs=1, the data of five pixels p21~p25 are continuously written to
另一方面,欲讀取記憶體200的資料時,可根據表3的查詢表執行讀取操作。例如,欲讀取已寫入記憶體200之像素p23的資料時,以像素p23的像素位置y作為索引(index)來查詢出表3之對應的列。像素p23的像素位置y=2,索引為2,查詢出表3紀錄的列L2的偏移ofs=1與累積位址Addr_acc=2。而後,將偏移ofs=1、累積位址Addr_acc=2、像素位置x=3帶入式(4)的第二位址配置關係式。其中,偏移ofs=1帶入式(4)的起始偏移St_ofs,且式(4)的起始寫入位址Addr_st=0。據此計算出像素p23已寫入記憶體200的位址W_Addr=4 (即,4=2-1+3)。而後,實際執行讀取操作,從記憶體200的位址4讀取出像素p23的資料。On the other hand, when the data in the
類似的,在另一種示例中,欲讀取已寫入記憶體200的像素p43的資料時,以像素p43的像素位置y=4作為索引,查詢出表3紀錄之列L4的偏移ofs=1與累積位址Addr_acc=11。而後,將偏移ofs=1、累積位址Addr_acc=11、像素位置x=3帶入式(4)的第二位址配置關係式,計算出像素p43已寫入記憶體200的位址W_Addr=13 (即,13=11-1+3)。而後,實際執行讀取操作,從記憶體200的位址13讀取出像素p43的資料。Similarly, in another example, when you want to read the data of pixel p43 that has been written into the
第6圖為本揭示第五實施例的資料處理方法的示意圖。本實施例類似於第5圖的實施例,差異處在於:本實施輸入影像100b的每一像素之資料的資料量的位元數不等於記憶體200b的每一位址對應的儲存空間的位元數,例如,每一像素之資料的資料量為12個位元,記憶體200b的每一位址對應的儲存空間為8個位元。本實施例根據位元包裝(bit package)模式執行寫入操作,以將輸入影像100b的有效像素的資料寫入記憶體200b的對應位址。本實施例的寫入操作可根據表4的查詢表而執行。
表4
表4紀錄的列L1的累積位址Addr_acc=0,表示從記憶體200b的位址0開始寫入列L1的有效像素。列L1的兩個像素p14、p15的資料共計24個位元,依序寫入記憶體200b的三個位址0~2。表4紀錄的列L2的累積位址Addr_acc=3,表示從記憶體200b的位址3開始寫入列L2的有效像素。列L2的五個像素p21~p25的資料共計60個位元,依序寫入記憶體200b的七個位址3~9及次一個位址10對應的部分儲存空間10-1 (即,位址10儲存的前4個位元)。The cumulative address Addr_acc=0 of column L1 recorded in Table 4 indicates that the effective pixels of column L1 are written starting from
表4紀錄的列L3的累積位址Addr_acc=10,表示從記憶體200b的位址10開始寫入列L3的四個有效的像素p31~p34的資料(共計48個位元),依序寫入至位址10對應的部分儲存空間10-2(即,位址10儲存的後4個位元)、位址11~15及位址16對應的部分儲存空間16-1(即,位址16儲存的前4個位元)。類似的,表4紀錄的列L4的累積位址Addr_acc=16,列L4的三個有效的像素p41~p43的資料(共計36個位元)依序寫入記憶體200b的位址16對應的部分儲存空間16-2(即,位址16儲存的後4個位元)及位址17~20。表4紀錄的列L5的累積位址Addr_acc是21,列L5的有效的像素p52的資料(共計8個位元)寫入記憶體200b的位址21對應的部分儲存空間22-2(即,位址22儲存的前4個位元)。The cumulative address Addr_acc=10 of column L3 recorded in Table 4 means that the data of the four valid pixels p31 to p34 of column L3 (a total of 48 bits) are written starting from the
在第6圖的實施例中,亦可根據記憶體200的目標位址的配置方式而執行寫入操作及讀取操作。第6圖的實施例之目標位址是根據第三位址配置關係式來配置的,第三位址配置關係式如式(5)所示:
(5)
In the embodiment of FIG. 6 , write operations and read operations can also be performed according to the configuration of the target address of the
輸入影像100之每一像素之資料量之位元組數量定義為「byte_per_pixel」。例如,輸入影像100之每一像素之資料量為12個位元,則每一像素之位元組數量byte_per_pixel=1.5。當寫入列L2的像素p21時,將各項的數值帶入式(5)的第三位址配置關係式:像素p21的像素位置x=1,記憶體200b的起始寫入位址Addr_st=0,列L2的起始偏移St_ofs=1,列L2的累積位址Addr_acc=2 (即,在列L2之前,已寫入列L1的兩個像素p14、p15)。據此,由式(5)計算得到像素p21的目前寫入位址W_Addr=3 (即,
= 3),則像素p21寫入記憶體200b的位址3。
The number of bytes of data amount per pixel of the
當輸入影像100b的像素為不同資料類型時,每一像素之資料量為不同的位元數。例如,當輸入影像100b的資料類型為灰階8位元時,每一像素之資料量為8個位元,每一像素之位元組數量byte_per_pixel=1。當輸入影像100b的資料類型為灰階12位元時,每一像素之資料量為12個位元,每一像素之位元組數量byte_per_pixel=1.5。當輸入影像100b的資料類型為YUY2格式時,每一像素之資料量為16個位元,每一像素之位元組數量byte_per_pixel=2。當輸入影像100b的資料類型為RGB24格式時,每一像素之資料量為24個位元,每一像素之位元組數量byte_per_pixel=3。由上,當輸入影像100b為不同資料類型的灰階8位元、灰階12位元、YUY2格式或RGB24格式時,可根據各自對應的位元組數量byte_per_pixel套用至式(5)的第三位址配置關係式而執行寫入操作及讀取操作。When the pixels of the
第7圖為本揭示一實施例的資料處理系統1000的示意圖。資料處理系統1000用於執行第2~6圖的各實施例的資料處理方法。資料處理系統1000包括攝像裝置500、處理器600、記憶體200及匯流排700。攝像裝置500用以產生輸入影像100(或輸入影像100b),輸入影像100具有複數個像素,各像素在輸入影像100之中具有像素位置(y,x)。FIG. 7 is a schematic diagram of a
處理器600可獨立於攝像裝置500而設置。或者,處理器600可設置於攝像裝置500的內部(即,處理器600是內建於攝像裝置500)。處理器600進行即時運算、線上運算或離線運算,以得到像素的像素位置(y,x)的滿足式,據以定義輸入影像100的有效區域R1,並判斷位於有效區域R1內的有效像素,各有效像素具有輸入影像100的有效資料dat(y,x)。或者,處理器600可建立輸入影像100的查詢表,查詢表紀錄了各列的像素的偏移Ofs、有效寬度wid或累積位址Addr_acc,據以定義輸入影像100的有效區域R1。The
處理器600判斷像素之中的目前的像素W_p是否為有效像素的一者。若目前的像素W_p是為有效像素的一者,則處理器600執行寫入操作,以經由匯流排700或直接將目前的像素W_p的有效資料dat(y,x)寫入記憶體200的對應的目標位址。處理器600根據式(1)的第一位址配置關係式、式(2)的第二位址配置關係式或式(3)的第三位址配置關係式來配置目標位址。The
當根據式(1)的第一位址配置關係式將目標位址配置為直接映射至有效像素的像素位置時,則處理器600根據式(1)的第一位址配置關係式、並根據目標位址與像素位置(y,x)的映射關係、滿足式或查詢表執行寫入操作。或者,當根據式(2)的第二位址配置關係式或式(3)的第三位址配置關係式將目標位址配置為緊密的連續位址時,則處理器600根據第二位址配置關係式或第三位址配置關係式、並根據目標位址與像素位置(y,x)的映射關係、滿足式或查詢表執行寫入操作。When the target address is configured to be directly mapped to the pixel position of the effective pixel according to the first address configuration relationship of equation (1), then the
另一方面,處理器600可根據第一位址配置關係式、第二位址配置關係式或第三位址配置關係式、並根據目標位址與像素位置(y,x)的映射關係、滿足式或查詢表執行讀取操作,將已寫入記憶體200的目標位址之有效資料dat(y,x)經由匯流排700或直接讀取出來。On the other hand, the
雖然本發明已以較佳實施例及範例詳細揭示如上,可理解的是,此些範例意指說明而非限制之意義。可預期的是,所屬技術領域中具有通常知識者可想到多種修改及組合,其多種修改及組合落在本發明之精神以及後附之申請專利範圍之範圍內。Although the present invention has been disclosed in detail above with preferred embodiments and examples, it should be understood that these examples are meant to be illustrative rather than limiting. It is expected that those with ordinary skill in the art can think of various modifications and combinations, and the various modifications and combinations fall within the spirit of the present invention and the scope of the appended patent application.
1000:資料處理系統
100,100b:輸入影像
200,200b:記憶體
500:攝像裝置
600:處理器
700:匯流排
R1,R2:有效區域
RC:圓心
p00~p66:像素
0~48:位址
10-1,10-2,22-1,22-2,16-1,16-2:部分儲存空間
C0~C6:行
L0~L6:列
W_p(y,x):目前的像素
(y,x):像素位置
Addr_acc:累積位址
W_Addr:目前寫入位址
Addr_st:起始寫入位址
St_ofs:起始偏移
ofs:偏移
wid_img:有效寬度
wid:有效寬度
1000:Data processing system
100,100b: input image
200,200b: memory
500:Camera device
600: Processor
700:Bus
R1, R2: effective area
RC: circle center
p00~p66:
第1圖為本揭示之輸入影像的示意圖。 第2圖為本揭示第一實施例的資料處理方法的示意圖。 第3圖為本揭示第二實施例的資料處理方法的示意圖。 第4圖為本揭示第三實施例的資料處理方法的示意圖。 第5圖為本揭示第四實施例的資料處理方法的示意圖。 第6圖為本揭示第五實施例的資料處理方法的示意圖。 第7圖為本揭示一實施例的資料處理系統的示意圖。 Figure 1 is a schematic diagram of the input image of the present disclosure. Figure 2 is a schematic diagram of a data processing method according to the first embodiment of the present disclosure. Figure 3 is a schematic diagram of a data processing method according to a second embodiment of the present disclosure. Figure 4 is a schematic diagram of a data processing method according to a third embodiment of the present disclosure. Figure 5 is a schematic diagram of a data processing method according to the fourth embodiment of the present disclosure. Figure 6 is a schematic diagram of a data processing method according to the fifth embodiment of the present disclosure. Figure 7 is a schematic diagram of a data processing system according to an embodiment of the present disclosure.
100:輸入影像 100:Input image
200:記憶體 200:Memory
p00~p66:像素 p00~p66: pixels
0~48:位址 0~48: address
C0~C6:行 C0~C6: OK
L0~L6:列 L0~L6: columns
W_p(y,x):目前的像素 W_p(y,x): current pixel
(y,x):像素位置 (y,x): pixel position
Addr_acc:累積位址 Addr_acc: cumulative address
W_Addr:目前寫入位址 W_Addr: current writing address
Addr_st:起始寫入位址 Addr_st: starting write address
St_ofs:起始偏移 St_ofs: starting offset
wid_img:有效寬度 wid_img: effective width
Claims (20)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US202263343547P | 2022-05-19 | 2022-05-19 | |
US63/343,547 | 2022-05-19 |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI822394B TWI822394B (en) | 2023-11-11 |
TW202348018A true TW202348018A (en) | 2023-12-01 |
Family
ID=88791772
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW111133877A TWI830363B (en) | 2022-05-19 | 2022-09-07 | Sensing device for providing three dimensional information |
TW111139055A TWI822394B (en) | 2022-05-19 | 2022-10-14 | Data processing method and data processing system |
TW112116628A TW202348025A (en) | 2022-05-19 | 2023-05-04 | Calibration system and calibration method for multi-camera system |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW111133877A TWI830363B (en) | 2022-05-19 | 2022-09-07 | Sensing device for providing three dimensional information |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW112116628A TW202348025A (en) | 2022-05-19 | 2023-05-04 | Calibration system and calibration method for multi-camera system |
Country Status (2)
Country | Link |
---|---|
US (1) | US20230377091A1 (en) |
TW (3) | TWI830363B (en) |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6208772B1 (en) * | 1997-10-17 | 2001-03-27 | Acuity Imaging, Llc | Data processing system for logically adjacent data samples such as image data in a machine vision system |
JP5446282B2 (en) * | 2009-01-21 | 2014-03-19 | ソニー株式会社 | Solid-state imaging device and camera system |
US9355719B2 (en) * | 2012-07-19 | 2016-05-31 | Hitachi, Ltd. | Semiconductor device |
JP6239993B2 (en) * | 2014-02-07 | 2017-11-29 | オリンパス株式会社 | Imaging device, display device, and control method |
WO2016033797A1 (en) * | 2014-09-05 | 2016-03-10 | SZ DJI Technology Co., Ltd. | Multi-sensor environmental mapping |
KR20170027922A (en) * | 2015-09-02 | 2017-03-13 | 삼성전자주식회사 | Memory system including plural memory device forming plural ranks and memory controller and operating method of memory system |
US20170242785A1 (en) * | 2016-02-23 | 2017-08-24 | Sandisk Technologies Llc | Efficient Implementation of Optimized Host-Based Garbage Collection Strategies Using Xcopy and Arrays of Flash Devices |
WO2017156705A1 (en) * | 2016-03-15 | 2017-09-21 | Mediatek Inc. | Affine prediction for video coding |
CN113223286A (en) * | 2016-11-14 | 2021-08-06 | 深圳市大疆创新科技有限公司 | Method and system for fusing multi-channel sensing data |
JP6765322B2 (en) * | 2017-02-28 | 2020-10-07 | キオクシア株式会社 | Memory system and control method |
US10699430B2 (en) * | 2018-10-09 | 2020-06-30 | Industrial Technology Research Institute | Depth estimation apparatus, autonomous vehicle using the same, and depth estimation method thereof |
CN110032979A (en) * | 2019-04-18 | 2019-07-19 | 北京迈格威科技有限公司 | Control method, device, equipment and the medium of the working frequency of TOF sensor |
-
2022
- 2022-09-07 TW TW111133877A patent/TWI830363B/en active
- 2022-10-14 US US17/965,817 patent/US20230377091A1/en active Pending
- 2022-10-14 TW TW111139055A patent/TWI822394B/en active
-
2023
- 2023-05-04 TW TW112116628A patent/TW202348025A/en unknown
Also Published As
Publication number | Publication date |
---|---|
TWI830363B (en) | 2024-01-21 |
TW202347258A (en) | 2023-12-01 |
TWI822394B (en) | 2023-11-11 |
TW202347257A (en) | 2023-12-01 |
TW202348025A (en) | 2023-12-01 |
US20230377091A1 (en) | 2023-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7058769B1 (en) | Method and system of improving disk access time by compression | |
US9329995B2 (en) | Memory device and operating method thereof | |
CN104731717B (en) | Storage arrangement and storage management method | |
TWI420298B (en) | Flash memory device and data access method thereof | |
US20050055532A1 (en) | Method for efficiently controlling read/write of flash memory | |
US20150113230A1 (en) | Directory storage method and query method, and node controller | |
KR20170118583A (en) | Sanitize-aware dram controller | |
US20160218739A1 (en) | Data access methods and data access devices utilizing the same | |
JP3639464B2 (en) | Information processing system | |
CN110096450B (en) | Multi-granularity parallel storage system and storage | |
US7310698B2 (en) | Method and apparatus for extending memory addressing | |
WO2023155531A1 (en) | Data read-write method and apparatus and related device | |
US9063667B2 (en) | Dynamic memory relocation | |
US6816165B1 (en) | Memory system having multiple address allocation formats and method for use thereof | |
CN115033185A (en) | Memory access processing method and device, storage device, chip, board card and electronic equipment | |
WO2012149815A1 (en) | Method and device for managing disk cache | |
TWI822394B (en) | Data processing method and data processing system | |
TWI407310B (en) | Data storage device and data access method | |
TW201818248A (en) | Memory managing method for data storage device | |
CN117389914A (en) | Cache system, cache write-back method, system on chip and electronic equipment | |
CN103827837A (en) | Method, device and system for accessing solid state disk space | |
TW201935247A (en) | Management method of metadata and memory device using the same | |
US20230008332A1 (en) | Parsing method, parsing apparatus, electronic device, and computer storage medium | |
CN110825658B (en) | Flash memory controller and method | |
CN103577113B (en) | A kind of memory unit access method |