TW201514926A - Disparity calculating method and stereo matching system thereof - Google Patents

Disparity calculating method and stereo matching system thereof Download PDF

Info

Publication number
TW201514926A
TW201514926A TW102136820A TW102136820A TW201514926A TW 201514926 A TW201514926 A TW 201514926A TW 102136820 A TW102136820 A TW 102136820A TW 102136820 A TW102136820 A TW 102136820A TW 201514926 A TW201514926 A TW 201514926A
Authority
TW
Taiwan
Prior art keywords
image
matrix
disparity
previous
global
Prior art date
Application number
TW102136820A
Other languages
Chinese (zh)
Inventor
guang-zhi Liu
Lei Zhou
Cheng-Wei Chou
Original Assignee
Novatek Microelectronics 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 Novatek Microelectronics Corp filed Critical Novatek Microelectronics Corp
Priority to TW102136820A priority Critical patent/TW201514926A/en
Publication of TW201514926A publication Critical patent/TW201514926A/en

Links

Landscapes

  • Image Processing (AREA)

Abstract

A disparity calculating method, for a stereo matching system, includes calculating a global energy matrix according to a first image, a second image and a previous disparity matrix of a previous frame; calculating a global disparity matrix according to the global energy matrix and a first matching algorithm; calculating a first image block of the first image, a second image block of the second image, a previous block disparity matrix between the first image and the second image and the global disparity matrix; and calculating a local disparity matrix between the first image block and the second image block according to the local energy matrix and a second matching algorithm.

Description

視差計算方法及其立體匹配系統 Parallax calculation method and stereo matching system thereof

本發明係指一種視差計算方法及其立體匹配系統,尤指一種能夠產生具有時間及空間上穩定性的視差圖的視差計算方法及其立體匹配系統。 The present invention relates to a parallax calculation method and a stereo matching system thereof, and more particularly to a parallax calculation method capable of generating a parallax map with temporal and spatial stability and a stereo matching system thereof.

隨著影像技術不斷進步,消費者可挑選之顯示裝置的尺寸與功能日益多元,而為了滿足不同的使用者需求,各家顯示裝置的製造商也設法提供輸出效能及解析度更佳的新產品,其中最值得關注的產品之一係具有三維立體顯示的顯示裝置。而一般常見的三維立體顯示技術有偏光式(Polarized)、交錯式(Interlaced)或分時式(Anaglyph)等顯示方式,其原理為將相關於深度資訊之不同視角影像利用特殊光學設計分別投射到人的左右眼,如此可使人的左右眼分別看到不同視角的影像,並經過人腦之合成後而產生三維深度資訊,讓人感覺出三維立體之影像。 With the continuous advancement of imaging technology, the size and function of display devices that consumers can choose are increasingly diverse, and in order to meet the needs of different users, manufacturers of display devices have also managed to provide new products with better output performance and better resolution. One of the most interesting products is a display device having a three-dimensional display. The commonly used three-dimensional display technology has a display mode such as Polarized, Interlaced or Anaglyph. The principle is to project different perspective images related to depth information by special optical design. The left and right eyes of the person can make the left and right eyes of the person see the images of different viewing angles respectively, and after the synthesis of the human brain, the three-dimensional depth information is generated, and the three-dimensional image is perceived.

當具有三維立體顯示功能之顯示裝置欲顯示之來源影像為不具有深度資訊之二維影像時,由於來源影像缺少深度資訊,故顯示裝置無法產生出各種相關於深度資訊之多視角(multi-view)影像,以投射到人的左右眼。在此情形下,顯示裝置需另針對二維影像進行分析以獲得深度資訊,進而才能顯示出多視角影像。在習知技術中,需利用如多個影像擷取裝置分別位於不同位置來獲得至少兩個不同之視角影像,才可分析出深度資訊,而針對兩不同視角影像來進行分析以獲得深度資訊之流程稱之為立體匹配(stereo matching),其原理為於兩不同視角影像之間相互搜尋是否有匹配之物件(或 者也可為特徵或像素點等),進而獲得兩不同視角影像中匹配物件位置值之差值,成為視差(disparity)資訊(即所謂之視差圖),並透過視差資訊可計算出匹配物件之深度資訊。 When the source image to be displayed by the display device having the three-dimensional display function is a two-dimensional image without depth information, since the source image lacks depth information, the display device cannot generate various multi-views related to depth information (multi-view) ) Image to project to the left and right eyes of the person. In this case, the display device needs to analyze the two-dimensional image to obtain the depth information, so as to display the multi-view image. In the prior art, if at least two different viewing angle images are obtained by using multiple image capturing devices at different positions, the depth information can be analyzed, and the two different viewing angle images are analyzed to obtain the depth information. The process is called stereo matching. The principle is to search for matching objects between two different perspective images (or The difference between the position values of the matching objects in the two different viewing angle images can be obtained as the disparity information (the so-called disparity map), and the matching object can be calculated through the parallax information. In-depth information.

然而,當於兩不同視角影像間執行立體匹配來取得深度資訊時,由於影像之景觀不盡相同,且用來取得兩不同視角影像之兩影像擷取裝置間位置距離也不相同,因此如何於兩不同視角影像間正確地搜尋出匹配物件並獲得正確之視差資訊將會影響深度資訊之準確性。例如,當兩影像之物件發生匹配錯誤時,例如左視角影像之A物件匹配至右視角影像之B物件而非A物件,則物件之視差資訊便會產生錯誤,故會獲得錯誤之深度資訊而使物件顯示出錯誤深度,並使人看不見相對應之物件,或者造成物件變形。因此,於兩視角影像間執行立體匹配時,如何準確獲得影像中各物件之立體匹配結果,已成為立體視覺技術最重要的課題之一。 However, when stereoscopic matching is performed between two different viewing angle images to obtain depth information, since the landscapes of the images are not the same, and the position distances between the two image capturing devices for obtaining two different viewing angle images are different, how to Properly searching for matching objects between two different perspective images and obtaining the correct parallax information will affect the accuracy of the depth information. For example, when an object of the two images has a matching error, for example, the A object of the left view image matches the B object of the right view image instead of the A object, the parallax information of the object may generate an error, so that the error depth information is obtained. Make the object show the wrong depth, and make the object invisible or make the object deform. Therefore, when performing stereo matching between two-view images, how to accurately obtain the stereo matching result of each object in the image has become one of the most important topics of stereoscopic vision technology.

為了解決上述的問題,本發明提供了一種能夠產生具有時間及空間上穩定性的視差圖的視差計算方法及其立體匹配系統。 In order to solve the above problems, the present invention provides a parallax calculation method capable of generating a parallax map having temporal and spatial stability and a stereo matching system thereof.

於一方面,揭露一種視差(disparity)計算方法,用於一立體匹配系統中,該視差計算方法包含有根據一第一影像、一第二影像及一先前影像的一先前視差矩陣,計算一全域能量矩陣;根據該全域能量矩陣及一第一匹配演算法,計算一全域視差矩陣;根據該第一影像的一第一影像區塊、該第二影像的一第二影像區塊、該第一影像與該第二影像間的一先前區塊視差矩陣及該全域視差矩陣,計算該第一影像區塊與該第二影像區塊間的一區域能量矩陣;以及根據該區域能量矩陣及一第二匹配演算法,計算該第一影像區塊與該第二影像區塊間的一區域視差矩陣。 In one aspect, a disparity calculation method is disclosed for a stereo matching system, where the disparity calculation method includes calculating a global domain according to a previous disparity matrix of a first image, a second image, and a previous image. An energy matrix; calculating a global parallax matrix according to the global energy matrix and a first matching algorithm; a first image block of the first image, a second image block of the second image, the first Calculating a region energy matrix between the first image block and the second image block by using a previous block disparity matrix between the image and the second image and the global disparity matrix; and calculating an energy matrix according to the region And a matching algorithm, calculating a regional parallax matrix between the first image block and the second image block.

於另一方面,揭露一種立體匹配系統,包含有一全域視差儲存模組,用來儲存一先前影像的一先前視差矩陣及一全域視差矩陣;一先前區塊視差儲存模組,用來儲存一第一影像與一第二影像間的一先前區塊視差矩陣;一當前區塊視差儲存模組,用來儲存一區域視差矩陣;一全域視差計算模組,耦接於該全域視差儲存模組,用來根據該第一影像、該第二影像及該先前視差矩陣,計算一全域能量矩陣;以及根據該全域能量矩陣及一第一匹配演算法,計算該全域視差矩陣;一區域視差計算模組,耦接於該全域視差儲存模組、該先前區塊視差儲存模組及該當前區塊視差儲存模組,用來根據該第一影像的一第一影像區塊、該第二影像的一第二影像區塊、該先前區塊視差矩陣及該全域視差矩陣,計算該第一影像區塊與該第二影像區塊間的一區域能量矩陣;根據該區域能量矩陣及一第二匹配演算法,計算該第一影像區塊與該第二影像區塊間的該區域視差矩陣。 In another aspect, a stereo matching system is disclosed, including a global parallax storage module for storing a previous parallax matrix of a previous image and a global parallax matrix; and a previous block parallax storage module for storing a first a previous block disparity matrix between an image and a second image; a current block disparity storage module for storing a regional disparity matrix; a global disparity computing module coupled to the global disparity storage module, And calculating a global energy matrix according to the first image, the second image, and the previous parallax matrix; and calculating the global parallax matrix according to the global energy matrix and a first matching algorithm; and a regional parallax computing module The first parallax storage module and the current block parallax storage module are coupled to the first image block and the second image of the first image. a second image block, the previous block disparity matrix, and the global disparity matrix, and calculating an area energy matrix between the first image block and the second image block; And a second matrix region energy matching algorithm, calculates a disparity in the region between the matrix block of the first image and the second image block.

10‧‧‧立體匹配系統 10‧‧‧ Stereo Matching System

100‧‧‧全域視差儲存模組 100‧‧‧Global parallax storage module

102‧‧‧先前區塊視差儲存模組 102‧‧‧Previous block parallax storage module

104‧‧‧當前區塊視差儲存模組 104‧‧‧ Current block parallax storage module

106‧‧‧全域視差計算模組 106‧‧‧Global Parallax Computing Module

108‧‧‧區域視差計算模組 108‧‧‧Regional Parallax Calculation Module

110‧‧‧解析度調整單元 110‧‧‧resolution adjustment unit

112‧‧‧全域視差計算單元 112‧‧‧Global Disparity Computing Unit

30‧‧‧視差計算方法 30‧‧‧ Parallax calculation method

300~312‧‧‧步驟 300~312‧‧‧Steps

B1、B2‧‧‧影像區塊 B1, B2‧‧‧ image blocks

CF‧‧‧當前影像 CF‧‧‧ current image

GDM‧‧‧全域視差矩陣 GDM‧‧‧ global parallax matrix

GEM‧‧‧全域能量矩陣 GEM‧‧‧Global Energy Matrix

IL、ILL‧‧‧左眼影像 IL, ILL‧‧‧ left eye image

IMG1、IMG2‧‧‧影像 IMG1, IMG2‧‧‧ images

IR、IRL‧‧‧右眼影像 IR, IRL‧‧‧ right eye image

LDM‧‧‧區域視差矩陣 LDM‧‧‧Regional Parallax Matrix

LEM‧‧‧區域能量矩陣 LEM‧‧‧Regional Energy Matrix

PBDM‧‧‧先前區塊視差矩陣 PBDM‧‧‧Previous block parallax matrix

PDM‧‧‧先前視差矩陣 PDM‧‧‧Previous Parallax Matrix

PF‧‧‧先前影像 PF‧‧‧ previous image

SM1、SM2‧‧‧匹配演算法 SM1, SM2‧‧‧ matching algorithm

第1圖為本發明實施例一立體匹配系統的示意圖。 FIG. 1 is a schematic diagram of a stereo matching system according to an embodiment of the present invention.

第2圖為本發明實施例一非線性方程式的示意圖。 2 is a schematic diagram of a nonlinear equation according to an embodiment of the present invention.

第3圖為本發明實施例一視差計算方法的示意圖。 FIG. 3 is a schematic diagram of a parallax calculation method according to an embodiment of the present invention.

在本發明之範例實施例中,立體匹配系統根據一先前影像的視差資訊及當前影像的先前區域的視差資訊,產生用於判斷當前影像的當前區域的視差的能量矩陣。據此,立體匹配系統所輸出的視差圖可同時具備時間上及空間上的連續性,進而獲得精準且穩定的視差圖。為更清楚地瞭解本發明,以下將配合圖式,以至少一範例實施例來作詳細說明。此外,以下實施例中所提到的連接用語,例如:耦接或連接等,僅是參考附加圖式用以例示說明,並非用來限制實際上兩個元件之間的連接關係是直接耦接或間接耦接。 In an exemplary embodiment of the present invention, the stereo matching system generates an energy matrix for determining a disparity of a current region of the current image according to the disparity information of a previous image and the disparity information of the previous region of the current image. Accordingly, the parallax map output by the stereo matching system can have both temporal and spatial continuity, thereby obtaining a precise and stable parallax map. In order to more clearly understand the present invention, the following detailed description will be described in the accompanying drawings. In addition, the connection terms mentioned in the following embodiments, such as couplings or connections, are merely exemplified with reference to the additional drawings, and are not intended to limit the connection between the two elements. Or indirectly coupled.

請參考第1圖,第1圖為本發明實施例一立體匹配系統10的示意圖。立體匹配系統10用來計算立體影像中各像素的視差(disparity)。如第1圖所示,立體匹配系統10包含有一全域視差儲存模組100、一先前區塊視差儲存模組102、一當前區塊視差儲存模組104、一全域視差計算模組106以及一區域視差計算模組108。全域視差儲存模組100用來儲存一先前影像PF的先前視差矩陣PDM及一全域視差矩陣GDM。先前區塊視差儲存模組102用來儲存一影像IMG1與一影像IMG2間的一先前區塊視差矩陣PBDM。當前區塊視差儲存模組104用來儲存一區域視差矩陣LDM。全域視差計算模組106包含有一解析度調整單元110及一全域視差計算單元112,且耦接於全域視差儲存模組100。全域視差計算模組106用來根據影像IMG1、IMG2及先前視差矩陣PDM,計算一全域能量矩陣GEM,並根據全域能量矩陣GEM及一匹配演算法SM1,計算全域視差矩陣GDM。區域視差計算模組108耦接於全域視差儲存模組100、先前區塊視差儲存模組102及當前區域視差儲存模組104,用來根據影像IMG1中一影像區塊B1、影像IMG2中相對應於影像區塊B1的一影像區塊B2、先前區塊視差矩陣PBDM及全域視差矩陣GDM,計算影像區塊B1及影像區塊B2間的一區域能量矩陣LEM;區域視差計算模組108並根據區域能量矩陣LEM及一匹配演算法SM2,計算影像區塊B1與B2之間的區域視差矩陣LDM。簡言之,由於根據先前影像PF的先前視差矩陣PDM所產生的全域視差矩陣GDM與先前影像PF的視差資訊間具有相關性,因此當立體匹配系統10根據全域視差矩陣GDM產生區域視差矩陣LDM時,區域視差矩陣LDM與先前影像PF的視差資訊間具有相關性(即區域視差矩陣LDM具有時間上的連續性)。進一步地,由於先前區塊視差矩陣PBDM包含有影像區塊B1、B2周圍區塊的視差資訊,因此當立體匹配系統10根據先前區塊視差矩陣PBDM產生區域視差矩陣LDM時,區域視差矩陣LDM與區塊B1、B2周圍區塊的視差資訊間具有關聯性(即區域視 差矩陣LDM具有空間上的連續性)。如此一來,區域視差矩陣LDM將同時具有時間及空間上的連續性。據此,立體匹配系統10可產生穩定且精準的視差圖。 Please refer to FIG. 1. FIG. 1 is a schematic diagram of a stereo matching system 10 according to an embodiment of the present invention. The stereo matching system 10 is used to calculate the disparity of each pixel in the stereoscopic image. As shown in FIG. 1 , the stereo matching system 10 includes a global disparity storage module 100 , a previous block disparity storage module 102 , a current block disparity storage module 104 , a global disparity computing module 106 , and an area . Parallax calculation module 108. The global disparity storage module 100 is configured to store a previous disparity matrix PDM of a previous image PF and a global disparity matrix GDM. The previous block disparity storage module 102 is configured to store a previous block disparity matrix PBDM between an image IMG1 and an image IMG2. The current block disparity storage module 104 is configured to store an area parallax matrix LDM. The global disparity computing module 106 includes a resolution adjusting unit 110 and a global disparity computing unit 112, and is coupled to the global disparity storage module 100. The global disparity calculation module 106 is configured to calculate a global energy matrix GEM based on the images IMG1, IMG2 and the previous parallax matrix PDM, and calculate the global disparity matrix GDM according to the global energy matrix GEM and a matching algorithm SM1. The regional disparity computing module 108 is coupled to the global disparity storage module 100, the previous block disparity storage module 102, and the current regional disparity storage module 104, and is configured to correspond to an image block B1 and an image IMG2 in the image IMG1. Calculating a region energy matrix LEM between the image block B1 and the image block B2 in an image block B2, a previous block disparity matrix PBDM, and a global disparity matrix GDM of the image block B1; the regional disparity calculation module 108 is based on The regional energy matrix LEM and a matching algorithm SM2 calculate the regional parallax matrix LDM between the image blocks B1 and B2. In short, since the global disparity matrix GDM generated from the previous disparity matrix PDM of the previous image PF has a correlation with the disparity information of the previous image PF, when the stereo matching system 10 generates the regional disparity matrix LDM according to the global disparity matrix GDM The regional parallax matrix LDM has a correlation with the disparity information of the previous image PF (ie, the regional disparity matrix LDM has temporal continuity). Further, since the previous block disparity matrix PBDM includes disparity information of the blocks around the image blocks B1, B2, when the stereo matching system 10 generates the regional disparity matrix LDM according to the previous block disparity matrix PBDM, the regional disparity matrix LDM and The disparity information of the blocks around blocks B1 and B2 is related (ie, regional view) The difference matrix LDM has spatial continuity). As a result, the regional parallax matrix LDM will have both temporal and spatial continuity. Accordingly, the stereo matching system 10 can produce a stable and accurate parallax map.

詳細來說,影像IMG1、IMG2可分別為一立體影像I3D的一當前影像CF的一左眼影像IL及一右眼影像IR。於接收到左眼影像IL及右眼影像IR後,全域視差計算模組106首先利用解析度調整單元110降低左眼影像IL及右眼影像IR的解析度,以產生低解析度的左眼影像ILL及右眼影像IRL。根據低解析度的左眼影像ILL、右眼影像IRL及儲存於全域視差儲存模組100中對應於先前影像PF的視差圖的先前視差矩陣PDM,全域視差計算單元112可計算得知全域能量矩陣GEM。先前影像PF可為立體影像I3D中當前影像CF的前一畫面,且計算先前視差矩陣PDM中一像素x對應於複數個視差候選的累積能量(accumulative energy)的公式可表示為: In detail, the images IMG1 and IMG2 are respectively a left eye image IL and a right eye image IR of a current image CF of a stereoscopic image I3D. After receiving the left-eye image IL and the right-eye image IR, the global disparity calculation module 106 first uses the resolution adjustment unit 110 to reduce the resolution of the left-eye image IL and the right-eye image IR to generate a low-resolution left-eye image. ILL and right eye image IRL. The global disparity calculation unit 112 can calculate the global energy matrix according to the low-resolution left-eye image ILL, the right-eye image IRL, and the previous disparity matrix PDM stored in the global disparity storage module 100 corresponding to the disparity map of the previous image PF. GEM. The previous image PF may be the previous picture of the current image CF in the stereo image I3D, and the formula for calculating the accumulative energy of a pixel x in the previous parallax matrix PDM corresponding to the plurality of disparity candidates may be expressed as:

其中,E為累積能量,C(x,k)=|I l (x)-I r (x+k)|,TC(x,k)=f 1(|k-dt n-1(x)|),k為在一特定搜尋範圍內的視差候選,I l 為左眼影像ILL的像素值,I r 為左眼影像IRL的像素值,dt n-1(x)為先前視差矩陣PDM中對應於像素x的視差,f()為一非線性映射方程式。舉例來說,f 1()可為如第2圖所示的非線性方程式,但不限於此。 Where E is the cumulative energy, C ( x , k )=| I l ( x )- I r ( x + k )|, TC ( x , k )= f 1 (| k - dt n -1 ( x ) |), k is a disparity candidate within a specific search range, I l is the pixel value of the left-eye image ILL, I r is the pixel value of the left-eye image IRL, and dt n -1 ( x ) is the previous parallax matrix PDM Corresponding to the parallax of pixel x, f () is a nonlinear mapping equation. For example, f 1 () may be a nonlinear equation as shown in FIG. 2, but is not limited thereto.

透過公式(1),全域視差計算模組106可計算當前影像CF的全域能量矩陣GEM,並根據匹配演算法SM1,取得全域視差矩陣GDM。值得注意的是,當視差候選k與先前影像PF中對應於同一像素x的視差dt n-1(x)差異越大時,TC(x,k)的數值越大(即TC(x,k)正比於視差候選k與視差dt n-1(x)間的差異)。由於公式(1)中加入了TC(x,k),因此全域視差矩陣GEM與先前影像PF的視差資訊間產生關聯性。換言之,於增加TC(x,k)後,全域視差矩 陣GEM可具有時間上的連續性。 Through the formula (1), the global disparity calculation module 106 can calculate the global energy matrix GEM of the current image CF, and obtain the global disparity matrix GDM according to the matching algorithm SM1. It is worth noting that when the difference between the disparity candidate k and the disparity dt n -1 ( x ) corresponding to the same pixel x in the previous image PF is larger, the value of TC ( x , k ) is larger (ie, TC ( x , k ) ) is proportional to the difference between the parallax candidate k and the parallax dt n -1 ( x )). Since TC ( x , k ) is added to the formula (1), the global disparity matrix GEM has a correlation with the disparity information of the previous image PF. In other words, after increasing TC ( x , k ), the global disparity matrix GEM may have temporal continuity.

接下來,區域視差計算模組108根據左眼影像IL的影像區塊B1、右眼影像IR中相對應於影像區塊B1的影像區塊B2、先前區塊視差矩陣PBDM及全域視差矩陣GDM,計算影像區塊B1及影像區塊B2間的區域能量矩陣LEM。在此實施例中,影像區塊B1、B2分別為左眼影像IL與右眼影像IR中位於同一列(row)的像素區域,且先前區塊視差矩陣PBDM為對應於影像區塊B1、B2的前一列像素的視差矩陣,但不限於此。區域視差計算模組108取得計算先前視差矩陣PDM中一像素x對應於複數個視差的能量(energy)的公式可表示為: Next, the regional disparity calculation module 108 is based on the image block B1 of the left-eye image IL, the image block B2 corresponding to the image block B1, the previous block disparity matrix PBDM, and the global disparity matrix GDM in the right-eye image IR. The regional energy matrix LEM between the image block B1 and the image block B2 is calculated. In this embodiment, the image blocks B1 and B2 are pixel regions of the same row in the left eye image IL and the right eye image IR, respectively, and the previous block parallax matrix PBDM corresponds to the image blocks B1 and B2. The parallax matrix of the previous column of pixels, but is not limited to this. The regional disparity calculation module 108 obtains a formula for calculating the energy of a pixel x corresponding to a plurality of disparities in the previous parallax matrix PDM, which can be expressed as:

其中,E為累積能量,C(x,k)=|I l (x)-I r (x+k)|,TC(x,k)=f 2(|k-dt n-1(x)|),SC(x,k)=f 2(|k-ds(x)|),k為在一特定搜尋範圍內的視差候選,I l 為左眼影像IL的像素值,I r 為左眼影像IR的像素值,dt(x)為全域視差矩陣GDM中對應於像素x的視差,ds(x)為先前區塊視差矩陣PBDM中位於同一行(column)的視差。f 2()及f 3()為類似於f 1()的非線性映射方程式。 Where E is the cumulative energy, C ( x , k )=| I l ( x )- I r ( x + k )|, TC ( x , k )= f 2 (| k - dt n -1 ( x ) |), SC (x, k ) = 2 (f | k - ds (x) |), k is a disparity candidate within a specified search range, I l is the pixel value of left-eye image IL, I r to the left The pixel value of the eye image IR, dt ( x ) is the parallax corresponding to the pixel x in the global disparity matrix GDM, and ds ( x ) is the disparity of the same column in the previous block disparity matrix PBDM. f 2 () and f 3 () are nonlinear mapping equations similar to f 1 ().

透過公式(2),區域視差計算模組108可取得影像區塊B1及影像區塊B2的區域能量矩陣LEM,並根據匹配演算法SM2,取得區域視差矩陣LDM。其中,匹配演算法SM2可為一動態規劃(Dynamic Programming)演算法。值得注意的是,當視差候選k與全域視差矩陣GDM中對應於同一像素x的視差dt(x)差異越大時,TC(x,k)的數值越大(即TC(x,k)正比於視差候選k與視差dt(x)間的差異)。由於公式(1)中加入了TC(x,k)且全域視差矩陣GDM具有時間上的連續性,因此區域視差矩陣LDM與先前影像PF的視差間產生關聯性。換言之,於增加TC(x,k)後,區域視差矩陣LDM也與先前影像PF的視差資訊間產生關聯性,從而具有時間上的連續性。另一方面,當視 差候選k與先前區塊視差矩陣PBDM中位於同一行(column)的視差ds(x)差異越大時,SC(x,k)的數值越大(即SC(x,k)正比於視差候選k與視差ds(x)間的差異)。透過於公式(1)中加入SC(x,k),因此區域視差矩陣LDM與當前影像CF中位於影像區塊B1、B2前一列的視差資訊間產生關聯性。換言之,於增加SC(x,k)後,區域視差矩陣LDM可具有空間上的連續性。 Through the formula (2), the regional disparity calculation module 108 can obtain the regional energy matrix LEM of the image block B1 and the image block B2, and obtain the regional parallax matrix LDM according to the matching algorithm SM2. The matching algorithm SM2 can be a dynamic programming algorithm. It is worth noting that when the difference between the parallax candidate k and the parallax dt ( x ) corresponding to the same pixel x in the global disparity matrix GDM is larger, the value of TC ( x , k ) is larger (ie, TC ( x , k ) is proportional The difference between the disparity candidate k and the disparity dt ( x )). Since TC ( x , k ) is added to the formula (1) and the global parallax matrix GDM has temporal continuity, the correlation between the regional parallax matrix LDM and the parallax of the previous image PF is generated. In other words, after increasing TC ( x , k ), the regional parallax matrix LDM also has an association with the disparity information of the previous image PF, thereby having temporal continuity. On the other hand, when the disparity candidate k is larger in difference from the disparity ds ( x ) of the same column in the previous block disparity matrix PBDM, the value of SC ( x , k ) is larger (ie, SC ( x , k ) ) is proportional to the difference between the disparity candidate k and the disparity ds ( x )). By adding SC ( x , k ) to equation (1), the regional parallax matrix LDM has an association with the disparity information of the current image CF located in the previous column of image blocks B1 and B2. In other words, after increasing SC ( x , k ), the regional parallax matrix LDM may have spatial continuity.

此外,觀察左眼影像IL與右眼影像IR可知左眼影像IL與右眼影像IR中同一像素的視差於時間上的相關性較左眼影像IL與右眼影像IR中周圍像素間的相關性低。因此,在公式(2)中,f 2()的增益會比f 3()的增益大,以確保在計算區域視差矩陣LDM時,可同時維持視差的精確性及時間上的穩定性。 In addition, observing the left eye image IL and the right eye image IR, the temporal correlation of the parallax of the same pixel in the left eye image IL and the right eye image IR is more correlated than the surrounding pixels in the left eye image IL and the right eye image IR. low. Therefore, in the formula (2), the gain of f 2 () is larger than the gain of f 3 () to ensure that the accuracy of the parallax and the stability in time can be maintained while calculating the parallax matrix LDM.

於計算完區域視差矩陣LDM後,立體匹配系統10可分別將全域視差矩陣GDM及區域視差矩陣LDM,儲存為先前視差矩陣PDM及先前區塊視差矩陣PBDM,從而計算左眼影像IL與右眼影像IR中位於影像區塊B1、B2下一列像素的視差。透過重複以上步驟,立體匹配系統10可取得當前影像CF的視差圖。 After the regional parallax matrix LDM is calculated, the stereo matching system 10 can store the global parallax matrix GDM and the regional parallax matrix LDM as the previous parallax matrix PDM and the previous block parallax matrix PBDM, thereby calculating the left eye image IL and the right eye image. The parallax of the next column of pixels in the image blocks B1 and B2 in the IR. By repeating the above steps, the stereo matching system 10 can obtain a disparity map of the current image CF.

需注意的是,於在計算累積能量的公式中增加與先前影像及當前影像的周圍像素的視差資訊相關的參數後,上述實施例揭露的立體匹配系統計算所得的視差將具有時間上及空間上的穩定性,進而產生穩定且精準的視差圖。根據不同應用,本領域具通常知識者應可據以實施合適的更動及修改。舉例來說,立體匹配系統10也可利用一掃描線最佳化(Scan-line Optimization)演算法作為匹配演算法SM2,且不限於此。 It should be noted that, after adding the parameters related to the parallax information of the surrounding pixels of the previous image and the current image in the formula for calculating the cumulative energy, the parallax calculated by the stereo matching system disclosed in the above embodiment will have time and space. The stability, which in turn produces a stable and accurate parallax map. Depending on the application, those of ordinary skill in the art should be able to implement appropriate changes and modifications. For example, the stereo matching system 10 can also utilize a scan-line optimization algorithm as the matching algorithm SM2, and is not limited thereto.

上述立體匹配系統10計算區域視差矩陣LDM的方式,可被進一 步地歸納成一視差計算方法30,請參考第3圖。需注意的是,若實質上可得到相同的結果,視差計算方法30的步驟順序不限於第3圖所示的步驟順序。如第3圖所示,視差計算方法30可用於一立體匹配系統,並包含以下步驟: The manner in which the stereo matching system 10 calculates the regional parallax matrix LDM can be further improved. Step by step into a parallax calculation method 30, please refer to Figure 3. It should be noted that, if substantially the same result is obtained, the order of steps of the parallax calculation method 30 is not limited to the sequence of steps shown in FIG. As shown in FIG. 3, the parallax calculation method 30 can be applied to a stereo matching system and includes the following steps:

步驟300:開始。 Step 300: Start.

步驟302:調整該第一影像及該第二影像的解析度,以分別產生一第一低解析度影像及一第二低解析度影像。 Step 302: Adjust the resolution of the first image and the second image to generate a first low-resolution image and a second low-resolution image, respectively.

步驟304:根據該第一低解析度影像、該第二低解析度影像及該先前視差矩陣,計算一全域能量矩陣。 Step 304: Calculate a global energy matrix according to the first low-resolution image, the second low-resolution image, and the previous parallax matrix.

步驟306:根據該全域能量矩陣及一第一匹配演算法,計算一全域視差矩陣。 Step 306: Calculate a global parallax matrix according to the global energy matrix and a first matching algorithm.

步驟308:根據該第一影像的一第一影像區塊、該第二影像的一第二影像區塊、該第一影像與該第二影像間的一先前區塊視差矩陣及該全域視差矩陣,計算該第一影像區塊與該第二影像區塊間的一區域能量矩陣。 Step 308: A first image block of the first image, a second image block of the second image, a previous block disparity matrix between the first image and the second image, and the global disparity matrix And calculating an area energy matrix between the first image block and the second image block.

步驟310:根據該區域能量矩陣及一第二匹配演算法,計算該第一影像區塊與該第二影像區塊間的一區域視差矩陣。 Step 310: Calculate a regional parallax matrix between the first image block and the second image block according to the area energy matrix and a second matching algorithm.

步驟312:結束。 Step 312: End.

根據視差計算方法30,立體匹配系統可產生穩定且精準的視差圖。值得注意的是,由於全域視差矩陣的精準度不需要太高,因此視差計算方法30先於步驟302中降低第一影像及第二影像的解析度,並利用步驟302中所得的第一低解析度影像及第二低解析度影像產生全域能量矩陣,從而降低計算全域能量矩陣及全域視差矩陣所耗費的資源。然而,全域能量矩陣也可直接由第一影像及第二影像所產生。也就是說,步驟302可被省略,視差計算方法30可改為直接根據第一影像、第二影像及先前視差矩陣,產生全域能量矩陣。 According to the parallax calculation method 30, the stereo matching system can generate a stable and accurate parallax map. It should be noted that since the accuracy of the global parallax matrix does not need to be too high, the parallax calculation method 30 lowers the resolution of the first image and the second image in step 302, and uses the first low resolution obtained in step 302. The degree image and the second low-resolution image generate a global energy matrix, thereby reducing the resources used to calculate the global energy matrix and the global parallax matrix. However, the global energy matrix can also be generated directly from the first image and the second image. That is, step 302 can be omitted, and the disparity calculation method 30 can instead generate a global energy matrix directly from the first image, the second image, and the previous parallax matrix.

綜上所述,上述實施例所提供的視差計算方法及其立體匹配系統透過於計算累積能量的公式中增加相關於先前影像的視差資訊以及當前影像的先前區塊的視差資訊的參數,而使得計算所得的視差資訊具有時間及空間上的連續性。據此,上述實施例所提供的視差計算方法及其立體匹配系統可產生穩定且精準的視差圖。 In summary, the parallax calculation method and the stereo matching system provided by the above embodiments increase the parallax information related to the previous image and the parallax information of the previous block of the current image by adding a formula for calculating the accumulated energy. The calculated disparity information has temporal and spatial continuity. Accordingly, the parallax calculation method and the stereo matching system provided by the above embodiments can generate a stable and accurate disparity map.

30‧‧‧視差計算方法 30‧‧‧ Parallax calculation method

300~312‧‧‧步驟 300~312‧‧‧Steps

Claims (14)

一種視差(disparity)計算方法,用於一立體匹配系統中,該視差計算方法包含有:根據一第一影像、一第二影像及一先前影像的一先前視差矩陣,計算一全域能量矩陣;根據該全域能量矩陣及一第一匹配演算法,計算一全域視差矩陣;根據該第一影像的一第一影像區塊、該第二影像的一第二影像區塊、該第一影像與該第二影像間的一先前區塊視差矩陣及該全域視差矩陣,計算該第一影像區塊與該第二影像區塊間的一區域能量矩陣;以及根據該區域能量矩陣及一第二匹配演算法,計算該第一影像區塊與該第二影像區塊間的一區域視差矩陣。 A disparity calculation method for a stereo matching system, the parallax calculation method includes: calculating a global energy matrix according to a first image, a second image, and a previous parallax matrix of a previous image; The global energy matrix and a first matching algorithm calculate a global parallax matrix; a first image block of the first image, a second image block of the second image, the first image, and the first image Calculating a region energy matrix between the first image block and the second image block by using a previous block disparity matrix between the two images and the global parallax matrix; and calculating an energy matrix and a second matching algorithm according to the region And calculating a regional parallax matrix between the first image block and the second image block. 如請求項1所述的視差計算方法,其中根據該第一影像、該第二影像及該先前影像的該先前視差矩陣,計算該全域能量矩陣的步驟包含有:調整該第一影像及該第二影像的解析度,以分別產生一第一低解析度影像及一第二低解析度影像;以及根據該第一低解析度影像、該第二低解析度影像及該先前視差矩陣,計算該全域能量矩陣。 The disparity calculation method of claim 1, wherein the calculating the global energy matrix according to the first image, the second image, and the previous parallax matrix of the previous image comprises: adjusting the first image and the first The resolution of the two images to generate a first low resolution image and a second low resolution image respectively; and calculating the first low resolution image, the second low resolution image, and the previous parallax matrix Global energy matrix. 如請求項1所述的視差計算方法,其中該全域能量矩陣中對應於一第一位置及一第一差異值的一第一全域能量係正比於該第一差異值與該先前視差矩陣中對應於該第一位置的一第一先前視差間之差異。 The disparity calculation method of claim 1, wherein a first global energy system corresponding to a first position and a first difference value in the global energy matrix is proportional to the first difference value and corresponding to the previous disparity matrix A difference between a first previous disparity at the first location. 如請求項1所述的視差計算方法,其中該區域能量矩陣中對應於一第一位置及一第一差異值的一第一能量係正比於該第一差異值與該全域視差 矩陣中對應於該第一位置的一第一先前視差間之差異。 The parallax calculation method of claim 1, wherein a first energy system corresponding to a first position and a first difference value in the regional energy matrix is proportional to the first difference value and the global disparity A difference in a matrix corresponding to a first previous disparity of the first location. 如請求項1所述的視差計算方法,其中該區域能量矩陣中對應於一第一位置及一第一差異值的一第一能量係正比於該第一差異值與該先前區塊視差矩陣中對應於該第一位置的一第一先前區塊視差間之差異。 The disparity calculation method of claim 1, wherein a first energy system corresponding to a first position and a first difference value in the regional energy matrix is proportional to the first difference value and the previous block disparity matrix Corresponding to the difference between the disparity of a first previous block of the first location. 如請求項1所述的視差計算方法,其中該第二匹配演算法包含一動態規劃(Dynamic Programming)演算法。 The disparity calculation method of claim 1, wherein the second matching algorithm comprises a dynamic programming algorithm. 如請求項1所述的視差計算方法,其中該第二匹配演算法包含一掃描線最佳化(Scan-line Optimization)演算法。 The disparity calculation method of claim 1, wherein the second matching algorithm comprises a scan-line optimization algorithm. 一種立體匹配系統,包含有:一全域視差儲存模組,用來儲存一先前影像的一先前視差矩陣及一全域視差矩陣;一先前區塊視差儲存模組,用來儲存一第一影像與一第二影像間的一先前區塊視差矩陣;一當前區塊視差儲存模組,用來儲存一區域視差矩陣;一全域視差計算模組,耦接於該全域視差儲存模組,用來根據該第一影像、該第二影像及該先前視差矩陣,計算一全域能量矩陣;以及根據該全域能量矩陣及一第一匹配演算法,計算該全域視差矩陣;一區域視差計算模組,耦接於該全域視差儲存模組、該先前區塊視差儲存模組及該當前區塊視差儲存模組,用來根據該第一影像的一第一影像區塊、該第二影像的一第二影像區塊、該先前區塊視差矩陣及該全域視差矩陣,計算該第一影像區塊與該第二影像區塊間的一區域能量矩陣;根據該區域能量矩陣及一第二匹配演算法,計算該第 一影像區塊與該第二影像區塊間的該區域視差矩陣。 A stereo matching system includes: a global parallax storage module for storing a previous parallax matrix of a previous image and a global parallax matrix; and a previous block parallax storage module for storing a first image and a a previous block disparity matrix between the second images; a current block disparity storage module for storing a regional disparity matrix; a global disparity computing module coupled to the global disparity storage module for Calculating a global energy matrix according to the first image, the second image, and the previous parallax matrix; and calculating the global parallax matrix according to the global energy matrix and a first matching algorithm; and a regional parallax computing module coupled to The global parallax storage module, the previous block disparity storage module, and the current block disparity storage module are configured to use a first image block of the first image and a second image area of the second image. a block, the previous block disparity matrix, and the global disparity matrix, and calculating a region energy matrix between the first image block and the second image block; A second matching algorithm, the calculation of a parallax matrix of the region between an image block and the second image block. 如請求項8所述的立體匹配系統,其中該全域視差計算模組包含有:一解析度調整單元,用來調整該第一影像及該第二影像的解析度,以分別產生一第一低解析度影像及一第二低解析度影像;以及一全域視差計算單元,用來根據該第一低解析度影像、該第二低解析度影像及該先前視差矩陣,計算該全域能量矩陣。 The stereo matching system of claim 8, wherein the global disparity calculation module comprises: a resolution adjustment unit, configured to adjust resolutions of the first image and the second image to respectively generate a first low a resolution image and a second low-resolution image; and a global disparity calculation unit configured to calculate the global energy matrix according to the first low-resolution image, the second low-resolution image, and the previous parallax matrix. 如請求項8所述的立體匹配系統,其中該全域能量矩陣中對應於一第一位置及一第一差異值的一第一全域能量係正比於該第一差異值與該先前視差矩陣中對應於該第一位置的一第一先前視差間之差異。 The stereo matching system according to claim 8, wherein a first global energy system corresponding to a first position and a first difference value in the global energy matrix is proportional to the first difference value and corresponding to the previous parallax matrix A difference between a first previous disparity at the first location. 如請求項8所述的立體匹配系統,其中該區域能量矩陣中對應於一第一位置及一第一差異值的一第一能量係正比於該第一差異值與該全域視差矩陣中對應於該第一位置的一第一先前視差間之差異。 The stereo matching system according to claim 8, wherein a first energy system corresponding to a first position and a first difference value in the region energy matrix is proportional to the first difference value and the global disparity matrix corresponds to The difference between a first previous disparity of the first location. 如請求項8所述的立體匹配系統,其中該區域能量矩陣中對應於一第一位置及一第一差異值的一第一能量係正比於該第一差異值與該先前區塊視差矩陣中對應於該第一位置的一第一先前區塊視差間之差異。 The stereo matching system of claim 8, wherein a first energy system corresponding to a first position and a first difference value in the region energy matrix is proportional to the first difference value and the previous block disparity matrix Corresponding to the difference between the disparity of a first previous block of the first location. 如請求項8所述的立體匹配系統,其中該第二匹配演算法包含一動態規劃(Dynamic Programming)演算法。 The stereo matching system of claim 8, wherein the second matching algorithm comprises a dynamic programming algorithm. 如請求項8所述的立體匹配系統,其中該第二匹配演算法包含一掃描線最佳化(Scan-line Optimization)演算法。 The stereo matching system of claim 8, wherein the second matching algorithm comprises a scan-line optimization algorithm.
TW102136820A 2013-10-11 2013-10-11 Disparity calculating method and stereo matching system thereof TW201514926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW102136820A TW201514926A (en) 2013-10-11 2013-10-11 Disparity calculating method and stereo matching system thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW102136820A TW201514926A (en) 2013-10-11 2013-10-11 Disparity calculating method and stereo matching system thereof

Publications (1)

Publication Number Publication Date
TW201514926A true TW201514926A (en) 2015-04-16

Family

ID=53437690

Family Applications (1)

Application Number Title Priority Date Filing Date
TW102136820A TW201514926A (en) 2013-10-11 2013-10-11 Disparity calculating method and stereo matching system thereof

Country Status (1)

Country Link
TW (1) TW201514926A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI553591B (en) * 2015-12-28 2016-10-11 緯創資通股份有限公司 Depth image processing method and depth image processing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI553591B (en) * 2015-12-28 2016-10-11 緯創資通股份有限公司 Depth image processing method and depth image processing system

Similar Documents

Publication Publication Date Title
US8116557B2 (en) 3D image processing apparatus and method
JP7112128B2 (en) METHOD, APPARATUS, IMAGE PROCESSING DEVICE, STORAGE MEDIUM AND THREE-DIMENSION IMAGING SYSTEM FOR CONVERTING TWO-DIMENSIONAL IMAGES TO THREE-DIMENSIONAL IMAGES
CN102939764B (en) Image processor, image display apparatus, and imaging device
US20080199070A1 (en) Three-dimensional image display apparatus and method for enhancing stereoscopic effect of image
KR20110124473A (en) 3-dimensional image generation apparatus and method for multi-view image
US9154765B2 (en) Image processing device and method, and stereoscopic image display device
JP5625979B2 (en) Display device, display method, and display control device
US20130202191A1 (en) Multi-view image generating method and apparatus using the same
US9571824B2 (en) Stereoscopic image display device and displaying method thereof
US20170035268A1 (en) Stereo display system and method for endoscope using shape-from-shading algorithm
JP6128442B2 (en) Method and apparatus for stereo-based expansion of stereoscopic images and image sequences {METHOD AND DEVICE FOR STREEO BASE EXTENSION OF STREOSSCOPIC IMAGES AND IMAGE SEQUENCES}
WO2018032841A1 (en) Method, device and system for drawing three-dimensional image
TWI589150B (en) Three-dimensional auto-focusing method and the system thereof
US20130286164A1 (en) Glassless 3d image display apparatus and method thereof
US20140340491A1 (en) Apparatus and method for referring to motion status of image capture device to generate stereo image pair to auto-stereoscopic display for stereo preview
KR101634225B1 (en) Device and Method for Multi-view image Calibration
US20150085085A1 (en) Disparity calculating method and stereo matching system thereof
TW201514926A (en) Disparity calculating method and stereo matching system thereof
JP5871113B2 (en) Stereo image generation apparatus, stereo image generation method, and stereo image generation program
US20140118344A1 (en) Method for processing image and apparatus for processing image
JP2017525197A (en) Stereoscopic video generation
TWM471597U (en) Auto-stereoscopic display system
JP6490107B2 (en) Stereoscopic video zooming
JP2012169822A (en) Image processing method and image processing device
Song et al. An improved two-view convergent-style-based disparity estimation algorithm