TWI485653B - Imaging system and method - Google Patents

Imaging system and method Download PDF

Info

Publication number
TWI485653B
TWI485653B TW101123168A TW101123168A TWI485653B TW I485653 B TWI485653 B TW I485653B TW 101123168 A TW101123168 A TW 101123168A TW 101123168 A TW101123168 A TW 101123168A TW I485653 B TWI485653 B TW I485653B
Authority
TW
Taiwan
Prior art keywords
pixel
pixels
refinement
disparity map
image
Prior art date
Application number
TW101123168A
Other languages
Chinese (zh)
Other versions
TW201401229A (en
Inventor
Chao Kang Liao
Chi Hao Wu
Original Assignee
Imec Taiwan Co
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 Imec Taiwan Co filed Critical Imec Taiwan Co
Priority to TW101123168A priority Critical patent/TWI485653B/en
Publication of TW201401229A publication Critical patent/TW201401229A/en
Application granted granted Critical
Publication of TWI485653B publication Critical patent/TWI485653B/en

Links

Landscapes

  • Image Processing (AREA)

Description

成像系統及方法Imaging system and method

本發明大體而言係關於電腦視覺領域,特別係關於一種產生深度圖之成像系統及方法。The present invention relates generally to the field of computer vision, and more particularly to an imaging system and method for generating a depth map.

立體匹配(Stereo-matching)技術透過對於平行相機所拍攝之一對立體影像或視訊中的對應像素或像素組之間之視差距離進行估計,以擷取一場景中物體的景深資訊。立體匹配技術有諸多應用,例如三維手勢辨識、視點合成以及立體電視。Stereo-matching technology captures the depth of field information of an object in a scene by estimating the parallax distance between a pair of stereo images or corresponding pixels or groups of pixels in a parallel camera. Stereo matching techniques have many applications, such as three-dimensional gesture recognition, viewpoint synthesis, and stereoscopic television.

一般而言,產生深度圖之成像方法分為兩類:整體性方法及區域性方法。In general, imaging methods that produce depth maps fall into two categories: holistic approaches and regional approaches.

整體性方法通常將立體匹配問題公式化為一能量函數,並以尋找可最小化整體能量之視差函數d 為目標。能量函數可以下列方程式表示:E(d) =E data (d) +λE smooth (d) (1)The holistic approach typically formulates the stereo matching problem as an energy function and targets the parallax function d that minimizes the overall energy. The energy function can be expressed by the following equation: E(d) = E data (d) + λE smooth (d) (1)

其中,E data (d) 計量視差函數d 與立體影像對相符的程度,及E smooth (d) 對整體性方法的平緩度假設進行編碼,且計量相鄰像素或像素組之視差間的差異。當能量函數之公式確定後,可透過例如動態規劃、圖形分割及可信度傳遞等進行最小化。Where E data (d) measures the degree to which the parallax function d matches the stereo image pair, and E smooth (d) encodes the gradual assumption of the holistic method and measures the difference between the parallaxes of adjacent pixels or groups of pixels. When the formula of the energy function is determined, it can be minimized by, for example, dynamic programming, pattern segmentation, and credibility transfer.

區域性方法在一視窗範圍內獨立估計一像素或像素組的 視差距離,其加總視窗範圍內位於立體影像對其中之一之像素或像素組與位於立體影像對其中之另一之候選匹配像素或像素組的匹配代價,並可找出複數個具有不同視差距離之候選匹配像素或像素組中匹配代價最小者,以選出所述像素或像素組在視差圖中的視差值。Regional method for independent estimation of a pixel or group of pixels within a window The parallax distance, in the summation window, the matching cost of the pixel or pixel group of one of the stereo image pairs and the candidate matching pixel or pixel group of the other pair of stereo image pairs, and can find a plurality of different parallaxes The candidate matching pixel or the pixel group of the distance has the smallest matching cost to select the disparity value of the pixel or the pixel group in the disparity map.

此二類方法均存在有深度圖品質及計算複雜度的取捨問題。舉例而言,對於整體性方法來說,能量函數中的平緩度項E smooth (d) 可透過採用較大之鄰近區域,例如鄰近區域為8而非2,以取得較佳的邊界,但優化整體能量之計算複雜度則將接近無法控制。就區域性方法而言,其計算複雜度較整體性方法低許多,但卻以品質為代價。為了增進品質,可以較高之位元數表示一像素或像素組,以獲得較細緻之視差圖,但匹配代價之計算及加總,是針對每一像素或像素組進行,因此當每一像素或像素組以較高之位元數表示時,計算複雜度將顯著增加。Both of these methods have the trade-off problem of depth map quality and computational complexity. For example, for a holistic approach, the smoothness term E smooth (d) in the energy function can be achieved by using a larger neighborhood, such as a neighborhood of 8 instead of 2, to achieve a better boundary, but optimized The computational complexity of the overall energy will be close to uncontrollable. In terms of regional methods, the computational complexity is much lower than the holistic approach, but at the expense of quality. In order to improve the quality, a higher number of bits can be used to represent a pixel or a group of pixels to obtain a more detailed disparity map, but the calculation and summation of the matching cost is performed for each pixel or group of pixels, so when each pixel When the pixel group is represented by a higher number of bits, the computational complexity will increase significantly.

因此,目前亟需提供一種成像系統及方法,其可增進視差圖之品質但卻不會加重成像系統及方法中,需要進行大量計算部分的複雜度。Therefore, there is an urgent need to provide an imaging system and method that can improve the quality of the parallax map without imposing the complexity of the computational portion of the imaging system and method.

本發明提供一種成像系統及方法,其透過利用影像其中之一之邊緣資訊作為導引,識別視差圖上需要增進之區域來增進視差圖之品質,以使在不增加例如視差估計之需進行大量計算之部分之複雜度的情況下,增進視差圖之品質。利用邊緣資訊作為導引以增進視差圖之品質甚至可減 小視差估計之複雜度。The present invention provides an imaging system and method for improving the quality of a parallax map by using an edge information of one of the images as a guide to identify an area on the parallax map that needs to be enhanced, so that a large amount of parallax estimation is not required. In the case of calculating the complexity of the part, the quality of the parallax map is improved. Use edge information as a guide to improve the quality of parallax maps and even reduce The complexity of small parallax estimation.

於一實施例中,成像系統包含一邊緣偵測模組、第一及第二視差估計模組、一交叉檢查模組、一遮蔽細化模組以及一破洞填充模組。邊緣偵測模組係用於偵測一第一影像中至少一參考線之一或多邊緣座標。第一及第二視差估計模組係分別用於獲得該第一影像相對於一第二影像之一第一估計視差圖及該第二影像相對於該第一影像之一第二估計視差圖之一當前位置線。交叉檢查模組係用於利用該第二估計視差圖之該當前位置線交叉檢查該第一估計視差圖之該當前位置線,以識別該第一估計視差圖之該當前位置線中之一遮蔽像素集合。該遮蔽細化模組係用來對該遮蔽像素集合進行細化以產生一經細化之遮蔽像素集合。該破洞填充模組係用來在該第一估計視差圖之該當前位置線中填充該經細化之遮蔽像素集合,以獲得一第一細化視差圖之一當前位置線。In one embodiment, the imaging system includes an edge detection module, first and second parallax estimation modules, a cross-check module, a mask refinement module, and a hole filling module. The edge detection module is configured to detect one or more edge coordinates of at least one reference line in a first image. The first and second disparity estimation modules are respectively configured to obtain a first estimated disparity map of the first image relative to a second image and a second estimated disparity map of the second image relative to the first image. A current location line. The cross-checking module is configured to cross-check the current position line of the first estimated disparity map by using the current position line of the second estimated disparity map to identify one of the current position lines of the first estimated disparity map. Pixel collection. The mask refinement module is configured to refine the masked pixel set to generate a refined masked pixel set. The hole filling module is configured to fill the refined set of masked pixels in the current position line of the first estimated disparity map to obtain a current position line of a first refinement disparity map.

於一實施例中,該遮蔽細化模組包含一細化基本暫存器,且該遮蔽細化模組係用於:利用該細化基本暫存器及含有該遮蔽像素集合的該第一估計視差圖之該當前位置線,透過基於一細化基本區域中遮蔽像素或像素組之數目將該第一估計視差圖之該當前位置線上之一在細化中的像素或像素組識別為被遮蔽而對該遮蔽像素集合進行細化,該細化基本區域分別在一第一方向及與該第一方向相反之方向上不超出該第一估計視差圖之該當前位置線中最接近該在細化中的像素或像素組之邊緣座標,不超出對應於該 第一估計視差圖之該當前位置線在該細化基本區域中之一部分之邊緣座標,且在與該第二方向相反之方向上不超出該第一估計視差圖之該當前位置線;以及用含有該遮蔽像素集合或該經細化之遮蔽像素集合的第一估計視差圖之該當前位置線以及與該第一影像之該參考線的該經偵測之一或多邊緣座標相關之資訊,對該細化基本暫存器進行更新。In an embodiment, the occlusion refinement module includes a refinement basic register, and the occlusion refinement module is configured to: utilize the refinement basic register and the first one including the occlusion pixel set Estimating the current position line of the disparity map by identifying pixels or groups of pixels in the refinement of the current position line of the first estimated disparity map as being (by) a number of masked pixels or groups of pixels in a refinement basic region Shielding and refining the set of masked pixels, the refined basic regions being closest to the current position line of the first estimated disparity map in a first direction and a direction opposite to the first direction The edge coordinates of the pixel or pixel group in the refinement do not exceed the corresponding An edge coordinate of the current position line of the first estimated disparity map in a portion of the refinement basic region, and does not exceed the current position line of the first estimated disparity map in a direction opposite to the second direction; The current position line of the first estimated disparity map including the masked pixel set or the refined masked pixel set and information related to the detected one or more edge coordinates of the reference line of the first image, Update the refinement basic scratchpad.

於一實施例中,該破洞填充模組係用於基於每一遮蔽像素或像素組之至少一各別鄰近像素或像素組在該第一估計視差圖之該當前位置線中填充該經細化之遮蔽像素集合。In an embodiment, the hole filling module is configured to fill the thinned current pixel of the first estimated disparity map with the at least one neighboring pixel or pixel group of each masking pixel or pixel group. A set of shaded pixels.

於一實施例中,該細化基本區域另外分別在第一方向及與第一方向相反之方向上不超出距該第一估計視差圖之該當前位置線中之在細化中的像素或像素組具預定距離之像素或像素組。於一實施例中,該細化基本區域另外在第二方向上不超出距該第一估計視差圖之該當前位置線具一預定距離之一位置線。In an embodiment, the refinement basic region further does not exceed the pixel or pixel in the refinement in the current direction line of the first estimated disparity map in the first direction and the direction opposite to the first direction, respectively. A group of pixels or groups of pixels with a predetermined distance. In an embodiment, the refinement basic region additionally does not exceed a position line of a predetermined distance from the current position line of the first estimated disparity map in the second direction.

於一實施例中,當限定於該細化基本區域之遮蔽像素或像素組之數目大於限定於該細化基本區域之像素或像素組之總數的一半時,該遮蔽細化模組將在細化中的像素或像素組識別為被遮蔽。In an embodiment, when the number of masked pixels or groups of pixels defined in the refinement basic region is greater than half of the total number of pixels or groups of pixels defined in the refinement basic region, the mask refinement module will be thin. The pixels or groups of pixels in the recognition are identified as being masked.

於另一實施例中,該破洞填充模組包含一填充基本暫存器,且該破洞填充模組係用於利用該填充基本暫存器及含有該經細化之遮蔽像素集合的該第一估計視差圖之該當前位置線,透過基於一填充基本區域中像素或像素組之視差 值之統計資訊填充該經細化之遮蔽像素集合中之一受到填充的像素或像素組而在該第一估計視差圖之該當前位置線中填充該經細化之遮蔽像素集合,以獲得該第一細化視差圖之該當前位置線,該填充基本區域分別在該第一方向及與該第一方向相反之該方向上不超出該第一估計視差圖之該當前位置線中最接近該受到填充的像素或像素組之邊緣座標,且在與該第二方向相反之該方向上不超出該第一估計視差圖之該當前位置線;以及以該第一細化視差圖之該當前位置線更新該填充基本暫存器。In another embodiment, the hole filling module includes a padding basic register, and the hole filling module is configured to utilize the padding basic register and the layer containing the refined masking pixel set. The current position line of the first estimated disparity map is transmitted based on a parallax of pixels or groups of pixels in the filled basic region The statistical information of the value fills the pixel or group of pixels in the refined set of masked pixels and fills the refined set of masked pixels in the current position line of the first estimated disparity map to obtain the First refining the current position line of the disparity map, wherein the filling basic area is closest to the first direction and the current position line of the first estimated disparity map in the direction opposite to the first direction The edge coordinates of the filled pixel or group of pixels, and the current position line of the first estimated disparity map is not exceeded in the direction opposite to the second direction; and the current position of the first refinement disparity map The line update fills the basic scratchpad.

於一實施例中,該填充基本區域另外分別在第一方向及與第一方向相反之方向上不超出距該第一估計視差圖之該當前位置線中之受到填充的像素或像素組具預定距離之像素或像素組。於一實施例中,該填充基本區域另外在第二方向上不超出距該第一估計視差圖之該當前位置線具一預定距離之一位置線。於一實施例中,填充基本區域另外在與第二方向相反之方向上不超出含有受到填充的像素或像素組之位置線。In one embodiment, the padding base region is further predetermined in the first direction and the direction opposite to the first direction, and the pixel or pixel group that is filled in the current position line from the first estimated disparity map is predetermined. The pixel or pixel group of the distance. In an embodiment, the padding base region further does not exceed a position line of a predetermined distance from the current position line of the first estimated disparity map in the second direction. In one embodiment, the fill base region additionally does not exceed the position line containing the filled pixels or groups of pixels in a direction opposite the second direction.

於一實施例中,該破洞填充模組透過進行多階段表決方法來獲得統計資訊,多階段表決方法包含:獲得填充基本區域中最多數目個像素或像素組所關聯於之一系列視差值;及獲得該一系列視差值中填充基本區域中最多數目個像素或像素組所關聯於之一視差值。In one embodiment, the hole filling module obtains statistical information by performing a multi-stage voting method, and the multi-stage voting method includes: obtaining a maximum number of pixels or pixel groups in the filled basic region associated with one of the series of disparity values And obtaining a maximum of the number of pixels or groups of pixels in the fill basic region of the series of disparity values associated with one of the disparity values.

於另一實施例中,一種電腦系統包含:儲存包含程式常式之資訊之一或多記憶體,及耦接至該一或多記憶體以控 制該等程式常式之執行的一或多個處理單元。該等程式常式包含一邊緣偵測模組、第一及第二視差估計模組、一交叉檢查模組、一遮蔽細化模組以及一破洞填充模組。該邊緣偵測模組係用於偵測一第一影像中之邊緣座標。該第一及該第二視差估計模組係分別用於獲得該第一影像相對於一第二影像之一第一估計視差圖及該第二影像相對於該第一影像之一第二估計視差圖。該交叉檢查模組係用於利用該第二估計視差圖交叉檢查該第一估計視差圖,以識別該第一估計視差圖中之一遮蔽像素集合。該遮蔽細化模組係用來對該遮蔽像素集合進行細化以產生一經細化之遮蔽像素集合。該破洞填充模組係用來在該第一估計視差圖中填充該經細化之遮蔽像素集合,以獲得一第一細化視差圖。In another embodiment, a computer system includes: storing one or more memories including program routines, and coupling to the one or more memories for control One or more processing units that perform the execution of the program routines. The program routines include an edge detection module, first and second parallax estimation modules, a cross-check module, a mask refinement module, and a hole filling module. The edge detection module is configured to detect edge coordinates in a first image. The first and second disparity estimation modules are respectively configured to obtain a first estimated disparity map of the first image relative to a second image and a second estimated disparity of the second image relative to the first image. Figure. The cross-checking module is configured to cross-check the first estimated disparity map with the second estimated disparity map to identify one of the masked pixel sets in the first estimated disparity map. The mask refinement module is configured to refine the masked pixel set to generate a refined masked pixel set. The hole filling module is configured to fill the refined masked pixel set in the first estimated disparity map to obtain a first refinement disparity map.

於一實施例中,該遮蔽細化模組係用於透過基於一細化基本區域中遮蔽像素或像素組之數目將該第一估計視差圖上之至少一在細化中的像素或像素組識別為被遮蔽,對該遮蔽像素集合進行細化,該細化基本區域分別在一第一方向及與該第一方向相反之方向上不超出含有該在細化中的像素或像素組之一位置線中最接近該在細化中的像素或像素組之邊緣座標,且分別在一第二方向上及與該第二方向相反之方向上不超出對應於含有該在細化中的像素或像素組之該位置線在該細化基本區域中之一部分之邊緣座標。In an embodiment, the mask refinement module is configured to transmit at least one pixel or pixel group in the first estimated disparity map based on the number of masked pixels or groups of pixels in a refinement basic region. Recognizing as being masked, the shading pixel set is refined, and the refinement basic region does not exceed one of the pixels or pixel groups in the refinement in a first direction and a direction opposite to the first direction The edge coordinates of the pixel or pixel group closest to the refinement in the position line, and respectively in a second direction and in a direction opposite to the second direction, do not exceed the pixel corresponding to the refinement or The position line of the pixel group is at an edge coordinate of a portion of the refinement basic region.

於一實施例中,該破洞填充模組係用於基於每一遮蔽像素或像素組之至少一各別鄰近像素或像素組填充該經細化 之遮蔽像素集合。In one embodiment, the hole filling module is configured to fill the refinement based on at least one respective neighboring pixel or group of pixels of each masking pixel or group of pixels. The shaded pixel collection.

於另一實施例中,一種成像方法包含:提供一第一及一第二影像;偵測該第一影像中之邊緣座標;獲得該第一影像相對於該第二影像之一第一估計視差圖及該第二影像相對於該第一影像之一第二估計視差圖;利用該第二估計視差圖交叉檢查該第一估計視差圖,以識別該第一估計視差圖中之一遮蔽像素集合;對該遮蔽像素集合進行細化以產生一經細化之遮蔽像素集合;以及在該第一估計視差圖中填充該經細化之遮蔽像素集合,以獲得一第一細化視差圖。In another embodiment, an imaging method includes: providing a first image and a second image; detecting edge coordinates in the first image; obtaining a first estimated parallax of the first image relative to the second image And a second estimated disparity map of the second image relative to the first image; the first estimated disparity map is cross-checked by the second estimated disparity map to identify one of the masked pixel sets in the first estimated disparity map And sizing the masked pixel set to generate a refined masked pixel set; and filling the refined masked pixel set in the first estimated disparity map to obtain a first refinement disparity map.

於一實施例中,對該遮蔽像素集合進行細化包含基於一細化基本區域中遮蔽像素或像素組之數目將該第一估計視差圖上之一在細化中的像素或像素組識別為被遮蔽,該細化基本區域分別在一第一方向及與該第一方向相反之方向上不超出含有該在細化中的像素或像素組之一位置線中最接近該在細化中的像素或像素組之邊緣座標,且分別在一第二方向上及與該第二方向相反之方向上不超出對應於含有該在細化中的像素或像素組之該位置線在該細化基本區域中之一部分之邊緣座標。In an embodiment, the thinning the set of masked pixels comprises identifying the pixel or group of pixels in the thinned first disparity map as being based on the number of masked pixels or groups of pixels in a refinement basic region as Masked, the refinement basic regions are respectively in a first direction and a direction opposite to the first direction not exceeding a position in a line of pixels or a pixel group in the refinement that is closest to the refinement The edge coordinates of the pixel or the pixel group, and respectively in a second direction and in a direction opposite to the second direction does not exceed the position line corresponding to the pixel or pixel group containing the refinement in the refinement basic The edge coordinates of one part of the area.

於一實施例中,填充該經細化之遮蔽像素集合係基於每一遮蔽像素或像素組之至少一各別鄰近像素或像素組。In one embodiment, filling the refined set of masked pixels is based on at least one respective neighboring pixel or group of pixels of each masked pixel or group of pixels.

於一實施例中,該細化基本區域在與第二方向相反之方向上不超出含有在細化中的像素或像素組之位置線。於一實施例中,該細化基本區域另外分別在第一方向及與第一 方向相反之方向上不超出含有在細化中的像素或像素組之位置線中距在細化中的像素或像素組具預定距離之像素或像素組。於一實施例中,該細化基本區域另外在該第二方向上不超出距含有該在細化中的像素或像素組之該位置線具一預定距離之一位置線。In one embodiment, the refinement basic region does not exceed the position line of the pixel or pixel group contained in the refinement in a direction opposite to the second direction. In an embodiment, the refinement basic regions are additionally in the first direction and the first The direction of the opposite direction does not exceed the pixel or group of pixels having a predetermined distance from the pixel or group of pixels in the thinning in the position line of the pixel or group of pixels in the refinement. In one embodiment, the refinement basic region additionally does not exceed a position line at a predetermined distance from the position line containing the pixel or pixel group in the refinement in the second direction.

於一實施例中,當限定於該細化基本區域之遮蔽像素或像素組之數目大於限定於該細化基本區域之像素或像素組之總數的一半時,該遮蔽細化模組將在細化中的像素或像素組識別為被遮蔽。In an embodiment, when the number of masked pixels or groups of pixels defined in the refinement basic region is greater than half of the total number of pixels or groups of pixels defined in the refinement basic region, the mask refinement module will be thin. The pixels or groups of pixels in the recognition are identified as being masked.

於一實施例中,該破洞填充模組基於一填充基本區域中的像素或像素組之視差值之統計資訊填充該經細化之遮蔽像素或像素組集合中之一受到填充的像素或像素組,該填充基本區域分別在該第一方向上及與該第一方向相反之該方向上不超出含有該受到填充的像素或像素組之一位置線中最接近該受到填充的像素或像素組之邊緣座標。In one embodiment, the hole filling module fills the pixel that is filled in one of the refined masked pixels or groups of pixel groups based on a statistical information of a disparity value of pixels or groups of pixels in the filled basic region. a pixel group, the filling basic region in the first direction and the direction opposite to the first direction respectively not exceeding a pixel or a pixel closest to the filled pixel in a position line containing the filled pixel or pixel group The edge coordinates of the group.

於一實施例中,該填充基本區域另外分別在第一方向及與第一方向相反之方向上不超出含有受到填充的像素或像素組之位置線中距受到填充的像素或像素組具預定距離之像素或像素組。於一實施例中,該填充基本區域另外在第二方向上不超出距含有該受到填充的像素或像素組之該位置線具一預定距離之一位置線。於一實施例中,該填充基本區域另外在與第二方向相反之方向上不超出含有受到填充的像素或像素組之位置線。In an embodiment, the filling base region is further spaced apart from the filled pixel or pixel group in a position line opposite to the first direction in a direction opposite to the first direction, respectively, in a direction line containing the filled pixel or pixel group. The pixel or group of pixels. In one embodiment, the fill base region additionally does not exceed a position line at a predetermined distance from the position line containing the filled pixel or pixel group in the second direction. In one embodiment, the fill base region additionally does not exceed the position line containing the filled pixels or groups of pixels in a direction opposite to the second direction.

於一實施例中,該破洞填充模組透過進行多階段表決方 法來獲得統計資訊,多階段表決方法包含:獲得填充基本區域中最多數目個像素或像素組所關聯於之一系列視差值;及獲得該一系列視差值中基本區域中最多數目個像素或像素組所關聯於之一視差值。In one embodiment, the hole filling module is configured to perform multi-stage voting To obtain statistical information, the multi-stage voting method includes: obtaining a maximum number of pixels or groups of pixels in the filled basic region associated with a series of disparity values; and obtaining a maximum number of pixels in the basic region of the series of disparity values Or a group of pixels associated with one of the disparity values.

於另一實施例中,一非暫態之電腦可讀取之記錄媒體儲存一電腦程式,以使一電腦系統執行上述之成像方法。In another embodiment, a non-transitory computer readable recording medium stores a computer program to cause a computer system to perform the imaging method described above.

上述說明為本發明技術特徵及優勢的概述,以能更清楚瞭解以下本發明之詳細說明。以下將進一步說明本發明之技術特徵及優勢,以支持本發明之申請專利範圍所請求之標的。本領域中具有通常知識者應能理解所揭露之觀念及特定實施例可能直接成為修改或設計其他結構或程序以達成與本發明相同之功能之基礎。本領域中具有通常知識者應瞭解上述等同之設計並無背離本發明之精神而應由以下之申請專利範圍涵蓋。The above description is a summary of the features and advantages of the present invention in order to provide a The technical features and advantages of the present invention are further described below to support the subject matter claimed in the claims of the present invention. Those having ordinary skill in the art should understand that the concept and specific embodiments disclosed may be directly modified or designed to achieve the same function as the present invention. Those having ordinary skill in the art should understand that the above-described equivalent design does not depart from the spirit of the invention and should be covered by the following claims.

本發明之目標及優點將在閱讀以下描述及在參看隨附圖式之後變得顯而易見。The objects and advantages of the invention will be apparent from the description and appended claims.

圖1顯示根據本發明之一實施例之成像系統20之應用之方塊圖。請參照圖1,於成像系統20之應用中,立體相機10包含從不同之視點拍攝一場景之兩個原始影像12或視訊之兩個相機。立體相機可為能夠從不同之視點拍攝一場景之兩個影像之任何影像記錄器件。視不同應用而定,相機可整合為一個裝置或分開配置。校正與扭正方塊14進行兩個原始影像12之校正以移除透鏡畸變,以及進 行兩個原始影像12之扭正以移除共面及核線上之不匹配,以使輸出之第一影像16及第二影像18可進行單線對單線之比對。成像系統20利用第一影像16及第二影像18產生深度圖22。深度圖22提供場景中物體距立體相機10之距離資訊。由於深度圖22可直接由視差圖計算得出,故以下將視差圖稱為成像系統20之輸出,視差圖是透過測量第一影像16與第二影像18之視差距離得出。應用方塊24因此可利用深度圖22進行例如三維手勢辨識、視點合成及立體電視呈現。1 shows a block diagram of an application of imaging system 20 in accordance with an embodiment of the present invention. Referring to FIG. 1, in the application of the imaging system 20, the stereo camera 10 includes two cameras that capture two original images 12 or video of a scene from different viewpoints. A stereo camera can be any image recording device that can capture two images of a scene from different viewpoints. Depending on the application, the camera can be integrated into one device or configured separately. Correction and correction block 14 performs correction of two original images 12 to remove lens distortion, and The two original images 12 are twisted to remove the mismatch between the coplanar and the nuclear lines, so that the output first image 16 and the second image 18 can be compared by a single line to a single line. Imaging system 20 utilizes first image 16 and second image 18 to generate depth map 22. The depth map 22 provides distance information of the object from the stereo camera 10 in the scene. Since the depth map 22 can be directly calculated from the disparity map, the disparity map is hereinafter referred to as the output of the imaging system 20, and the disparity map is obtained by measuring the parallax distance between the first image 16 and the second image 18. Application block 24 can thus utilize depth map 22 for, for example, three-dimensional gesture recognition, view synthesis, and stereoscopic television presentation.

成像系統20可以硬體實施,例如以場可程式化閘陣列(Field Programmable Gate Array,FPGA)實施,以及以特定功能積體電路(Application Specific Integrated Circuit,ASIC)實施,或可透過一般性電腦系統以軟體實施,或以硬體與軟體之組合實施。硬體實施相較於軟體實施可達成較高效能,但需要較高的設計成本。對於即時性應用而言,通常選擇硬體實施,以符合速度的要求。The imaging system 20 can be implemented by a hardware, such as a Field Programmable Gate Array (FPGA), and implemented by an Application Specific Integrated Circuit (ASIC), or can be transmitted through a general computer system. It is implemented in software or in a combination of hardware and software. Hardware implementation can achieve higher performance than software implementation, but requires higher design costs. For instant applications, hardware implementations are often chosen to meet speed requirements.

圖2及3分別顯示本發明之一實施例之成像系統之方塊圖。請參照圖2,於一實施例中,透過排序緩衝區硬體實施之成像系統20接收一第一影像及一第二影像,輸出一細化視差圖,且包含邊緣偵測模組204、第一及第二視差估計模組208、258、交叉檢查模組212、遮蔽細化模組216及破洞填充模組220。2 and 3 respectively show block diagrams of an imaging system in accordance with an embodiment of the present invention. Referring to FIG. 2, in an embodiment, the imaging system 20 implemented by the sorting buffer hardware receives a first image and a second image, outputs a refined disparity map, and includes an edge detection module 204, The first and second parallax estimation modules 208 and 258, the cross-check module 212, the mask refinement module 216, and the hole filling module 220.

邊緣偵測模組204係用於接收第一影像中至少一參考線以及偵測第一影像中參考線之一或多邊緣座標以產生邊緣 圖206。對應於第一影像之參考線上之位置,產生細化視差圖之當前位置線。The edge detection module 204 is configured to receive at least one reference line in the first image and detect one or more edge coordinates of the reference line in the first image to generate an edge Figure 206. Corresponding to the position on the reference line of the first image, a current position line of the refined disparity map is generated.

第一視差估計模組208係用於接收第一影像之當前位置線以及獲得第一影像相對於第二影像之第一估計視差圖210之當前位置線(如圖中雙箭頭之左向部分所顯示)。相似地,第二視差估計模組258係用於接收第二影像之當前位置線以及獲得第二影像相對於第一影像之第二估計視差圖260之當前位置線(如圖中雙箭頭之右向部分所顯示)。第一或第二視差估計模組208或258可利用整體性方法或是區域性方法實施。如上所述,區域性方法相較於整體性方法有低得多之複雜度,因此,為了能達成例如即時性應用所需之較高速度,於以下所描述的本發明之一實施例中,採用區域性方法。The first disparity estimation module 208 is configured to receive a current position line of the first image and obtain a current position line of the first estimated disparity map 210 of the first image relative to the second image (as shown in the left part of the double arrow in the figure) display). Similarly, the second disparity estimation module 258 is configured to receive a current position line of the second image and obtain a current position line of the second image relative to the second estimated disparity map 260 of the first image (as shown by the double arrow in the figure) Shown to the section). The first or second disparity estimation module 208 or 258 can be implemented using a holistic approach or a regional approach. As noted above, the regional approach has a much lower complexity than the holistic approach, and thus, in order to achieve a higher speed, such as that required for immediate applications, in one embodiment of the invention described below, A regional approach is adopted.

請參照圖2及3,於一實施例中,第一視差估計模組208包含第一普查轉換模組2081、第一代價加總模組2083以及第一視差選擇模組2085;第二視差估計模組258包含第二普查轉換模組2581、第二代價加總模組2583及第一視差選擇模組2585。Referring to FIG. 2 and FIG. 3, in an embodiment, the first disparity estimation module 208 includes a first census conversion module 2081, a first cost summation module 2083, and a first disparity selection module 2085; The module 258 includes a second census conversion module 2581, a second cost addition module 2583, and a first parallax selection module 2585.

包含一第一普查暫存器(未圖示)之第一普查轉換模組2081係用於接收第一影像之當前位置線,以及利用第一普查暫存器及第一影像之當前位置線,進行普查轉換以產生第一影像之對應線,並以第一影像之當前位置線更新第一普查暫存器,以及輸出第一影像之經普查轉換之比對線2082。於一實施例中,第一普查暫存器之大小等於第一影 像之寬度、像素或像素組之位元長度及兩條線之高度之乘積。高度係由普查轉換所使用之鄰近區域決定。相似地,包含第二普查暫存器之第二普查轉換模組2581係用於接收第二影像之當前位置線,以及使用第二普查暫存器及第二影像之當前位置線,進行普查轉換以產生第二影像之比對線,以第二影像之當前位置線更新第二普查暫存器,以及輸出第二影像之經普查轉換之比對線2582。a first census conversion module 2081 including a first census register (not shown) for receiving a current position line of the first image, and using a first census register and a current position line of the first image, Performing a census conversion to generate a corresponding line of the first image, and updating the first census register with the current position line of the first image, and outputting the census converted comparison line 2082 of the first image. In an embodiment, the size of the first census register is equal to the first shadow The product of the width, pixel or pixel group bit length and the height of the two lines. The height is determined by the neighborhood used by the census conversion. Similarly, the second census conversion module 2581 including the second census register is configured to receive a current position line of the second image, and perform a census conversion using the second census register and the current position line of the second image. To generate a second image comparison line, the second census register is updated with the current position line of the second image, and the census converted comparison line 2582 of the second image is output.

包含第一加總視窗暫存器(未圖示)之第一代價加總模組2083係用於分別接收第一影像及第二影像之比對線2082及2582;對於複數個視差距離,計算第一影像之比對線2082相對於第二影像之比對線2582之當前匹配代價;對於所述複數個視差距離,利用第一加總視窗暫存器及當前匹配代價,加總匹配代價;以當前匹配代價更新第一加總視窗暫存器;以及對於所述複數個視差距離,輸出經加總匹配代價2084。在本實施例中,第一及第二影像之比對線係分別從第一普查轉換模組2081之輸出2082及第二普查轉換模組2581之輸出2582獲得。於一實施例中,第一加總視窗暫存器之大小等於第一影像之寬度、像素或像素組之位元長度及加總視窗之高度(將於以下部分之說明書說明)之乘積。The first cost summation module 2083 including the first summation window register (not shown) is configured to respectively receive the comparison lines 2082 and 2582 of the first image and the second image; for a plurality of parallax distances, calculate The current matching cost of the comparison line 2082 of the first image with respect to the second image comparison line 2582; for the plurality of parallax distances, the first matching window buffer and the current matching cost are used to add the matching cost; Updating the first summing window register with the current matching cost; and for the plurality of disparity distances, outputting the summed matching cost 2084. In this embodiment, the comparison lines of the first and second images are obtained from the output 2082 of the first census conversion module 2081 and the output 2582 of the second census conversion module 2581, respectively. In one embodiment, the size of the first summing window register is equal to the product of the width of the first image, the length of the pixel or pixel group, and the height of the summing window (described in the description of the following section).

相似地,包含第二加總視窗暫存器(未圖示)之第二代價加總模組2583係用於分別接收第一影像及第二影像之比對線2082及2582;對於複數個視差距離,計算第二影像之比對線2582相對於第一影像之比對線2082之當前匹配 代價;對於所述複數個視差距離,利用第二加總視窗暫存器及當前匹配代價,加總匹配代價;以當前匹配代價更新第二加總視窗暫存器;以及對於所述複數個視差距離,輸出經加總匹配代價2584。應注意,在本實施例中,對經普查轉換之影像進行代價加總。然而,本發明不限於以此方式實施。於其他實施例中,可對未轉換之影像進行代價加總。Similarly, a second cost summation module 2583 including a second sum total window register (not shown) is configured to receive the first and second image comparison lines 2082 and 2582, respectively; for a plurality of parallaxes Distance, calculating the current match of the second image comparison line 2582 with respect to the first image comparison line 2082 a cost; for the plurality of disparity distances, summing the matching cost using the second summing window register and the current matching cost; updating the second summing window register with the current matching cost; and for the plurality of disparities Distance, the output is summed to match the cost of 2584. It should be noted that in the present embodiment, the cost of the census converted image is added up. However, the invention is not limited to being implemented in this manner. In other embodiments, the unconverted images may be cost-added.

第一視差選擇模組2085係用於接收第一代價加總模組2083之複數個視差距離的加總之匹配代價2084;為第一估計視差圖210之當前位置線上之每一座標,分別選擇所述複數個視差距離其中之一,作為第一估計視差圖210上之座標處之視差值,以及輸出第一估計視差圖210之當前位置線。相似地,第二視差選擇模組2585係用於自第二代價加總模組2583接收所述複數個視差距離的經加總匹配代價2584;為第二估計視差圖260之當前位置線上之每一座標,分別選擇所述複數個視差距離其中之一,作為第二估計視差圖260之座標處之視差值,以及輸出第二估計視差圖260之當前位置線。The first disparity selection module 2085 is configured to receive the summed matching cost 2084 of the plurality of disparity distances of the first cost summation module 2083; for each coordinate on the current position line of the first estimated disparity map 210, select the respective One of a plurality of parallax distances is used as the disparity value at the coordinates on the first estimated disparity map 210, and the current position line of the first estimated disparity map 210 is output. Similarly, the second disparity selection module 2585 is configured to receive, from the second cost summation module 2583, the aggregated matching cost 2584 of the plurality of disparity distances; each of the current position lines of the second estimated disparity map 260 A flag selects one of the plurality of parallax distances as a disparity value at a coordinate of the second estimated disparity map 260, and outputs a current position line of the second estimated disparity map 260.

交叉檢查模組212係用於接收第一估計視差圖210之當前位置線及第二估計視差圖260之當前位置線;利用第二估計視差圖260之當前位置線交叉檢查第一估計視差圖210之當前位置線,以識別第一估計視差圖210之當前位置線中之一遮蔽像素集合214,或進行相反操作;以及輸出第一估計視差圖210之當前位置線中之遮蔽像素集合 214。遮蔽像素集合214可含有零或多個遮蔽像素或像素組。The cross-check module 212 is configured to receive the current position line of the first estimated disparity map 210 and the current position line of the second estimated disparity map 260; and cross-check the first estimated disparity map 210 by using the current position line of the second estimated disparity map 260. a current position line to identify one of the current position lines of the first estimated disparity map 210 to mask the set of pixels 214, or to perform the reverse operation; and output a set of masked pixels in the current position line of the first estimated disparity map 210 214. The masked pixel set 214 can contain zero or more masked pixels or groups of pixels.

包含細化基本暫存器(未圖示)之遮蔽細化模組216係用於接收第一估計視差圖210之當前位置線中的遮蔽像素集合214;利用細化基本暫存器及含有遮蔽像素集合214的第一估計視差圖210之當前位置線,透過基於細化基本區域中之遮蔽像素或像素組之數目將第一估計視差圖210之當前位置線上的在細化中的像素或像素組識別為被遮蔽,對遮蔽像素集合214進行細化;以及用含有遮蔽像素集合214或經細化之遮蔽像素集合218的第一估計視差圖210之當前位置線以及與邊緣圖206中之第一影像之參考線的經偵測之一或多邊緣座標相關之資訊,對細化基本暫存器進行更新。細化基本區域分別在一第一方向及與該第一方向相反之方向上不超出第一估計視差圖210之當前位置線中最接近在細化中的像素或像素組之邊緣座標,不超出對應於第一估計視差圖210之當前位置線在細化基本區域中之部分的邊緣座標,以及在與第二方向相反之方向上不超出第一估計視差圖210之當前位置線。與經偵測之一或多邊緣座標相關之資訊可為(但不限於)第一估計視差圖210之當前位置線之每一像素或像素組與第二方向上之各別邊緣座標之間的距離。舉例而言,若第一估計視差圖210之當前位置線上之像素或像素組位於第一影像之參考線上所偵測到之邊緣座標處,則將該距離設定為零;否則,像素或像素組之距離將為當前位置線之在前一位置線中的對應 像素或像素組之距離遞增一。The occlusion refinement module 216 including the refinement basic register (not shown) is configured to receive the occlusion pixel set 214 in the current position line of the first estimated disparity map 210; using the refinement basic register and containing the occlusion The current position line of the first estimated disparity map 210 of the set of pixels 214 passes through the refined pixels or pixels on the current position line of the first estimated disparity map 210 based on the number of masked pixels or groups of pixels in the refinement basic region. The group is identified as being masked, and the masked pixel set 214 is refined; and the current position line of the first estimated disparity map 210 containing the masked pixel set 214 or the refined masked pixel set 218 and the edge map 206 The information about one or more edge coordinates of a reference line of an image is updated to refine the basic scratchpad. Refining the basic regions in a first direction and in a direction opposite to the first direction, not exceeding the edge coordinates of the pixel or pixel group closest to the refinement in the current position line of the first estimated disparity map 210, not exceeding The edge coordinates corresponding to a portion of the current position line of the first estimated disparity map 210 in the refinement basic region, and the current position line of the first estimated disparity map 210 are not exceeded in a direction opposite to the second direction. The information related to the detected one or more edge coordinates may be, but is not limited to, between each pixel or pixel group of the current position line of the first estimated disparity map 210 and the respective edge coordinates in the second direction. distance. For example, if the pixel or pixel group on the current position line of the first estimated disparity map 210 is located at the edge coordinate detected on the reference line of the first image, the distance is set to zero; otherwise, the pixel or the pixel group The distance will be the corresponding position of the current position line in the previous position line The distance of a pixel or group of pixels is incremented by one.

於一實施例中,細化基本區域另外分別在第一方向及與第一方向相反之方向上不超出距第一估計視差圖之該當前位置線中之在細化中的像素或像素組具預定距離rr 、rl 之像素或像素組。於另一實施例中,細化基本區域另外在第二方向上不超出距該第一估計視差圖之當前位置線具預定距離ru 之位置線。於本實施例中,細化基本暫存器之大小等於第一影像之寬度、等於預定距離ru 之位元長度與儲存與第一影像之參考線的經偵測之一或多邊緣座標相關之資訊所需之位元長度之總和之乘積,儲存資訊所需之位元長度於一實施例中等於log2 (ru )+1。In an embodiment, the refinement basic region is further in the first direction and the direction opposite to the first direction, and does not exceed the pixel or pixel group in the refinement from the current position line of the first estimated disparity map. A pixel or a group of pixels of a predetermined distance r r , r l . In another embodiment, the refinement base region additionally does not exceed a position line having a predetermined distance r u from the current position line of the first estimated disparity map in the second direction. In this embodiment, refining the size of the basic register equal to the width of the first image, the length of the bit equal to the predetermined distance r u , and storing the detected one or more edge coordinates of the reference line of the first image The product of the length of the bit length required for the information, the bit length required to store the information is equal to log 2 (r u )+1 in one embodiment.

破洞填充模組220係用於接收第一估計視差圖210之當前位置線中的經細化之遮蔽像素集合218,至少基於每一遮蔽像素或像素組之各別鄰近像素或像素組,在第一估計視差圖210之當前位置線中填充經細化之遮蔽像素集合218,以產生第一細化視差圖之當前位置線。於一實施例中,破洞填充模組220利用第一估計視差圖210之當前位置線中最接近受到填充的像素或像素組之非遮蔽像素或像素組之視差值來對受到填充的像素或像素組進行填充。於另一實施例中,包含一填充基本暫存器(未圖示)之破洞填充模組220係用於利用該填充基本暫存器及含有經細化之遮蔽像素集合218的第一估計視差圖210之當前位置線,透過基於一填充基本區域中像素或像素組之視差值之統計資訊填充經細化之遮蔽像素集合218中之一受到填充的像 素或像素組而在第一估計視差圖210之當前位置線中填充經細化之遮蔽像素集合218,以獲得該第一細化視差圖之該當前位置線,該填充基本區域分別在該第一方向及與該第一方向相反之該方向上不超出第一估計視差圖210之當前位置線中最接近該受到填充的像素或像素組之邊緣座標,且在與該第二方向相反之該方向上不超出第一估計視差圖210之當前位置線。The hole filling module 220 is configured to receive the refined masked pixel set 218 in the current position line of the first estimated disparity map 210, based at least on each neighboring pixel or pixel group of each masking pixel or pixel group. The current position line of the first estimated disparity map 210 is filled with the refined masked pixel set 218 to generate a current position line of the first refinement disparity map. In one embodiment, the hole filling module 220 uses the disparity pixel of the non-masked pixel or pixel group closest to the filled pixel or pixel group in the current position line of the first estimated disparity map 210 to the filled pixel. Or pixel groups are filled. In another embodiment, a hole filling module 220 including a padding basic register (not shown) is used to utilize the padding basic register and the first estimate containing the refined masked pixel set 218. The current position line of the disparity map 210 is filled with an image that is filled in one of the thinned masked pixel sets 218 by statistical information based on a disparity value of pixels or groups of pixels in the filled basic region. Filling the refined masked pixel set 218 with the pixel or the pixel group in the current position line of the first estimated disparity map 210 to obtain the current position line of the first refinement disparity map, respectively One direction and the direction opposite to the first direction does not exceed an edge coordinate of the current position line of the first estimated disparity map 210 that is closest to the filled pixel or group of pixels, and is opposite to the second direction The current position line of the first estimated disparity map 210 is not exceeded in the direction.

於一實施例中,該填充基本區域另外分別在第一方向及與第一方向相反之方向上不超出距該第一估計視差圖之該當前位置線中之在細化中的像素或像素組具預定距離sr 、sl 之像素或像素組。另外,於一實施例中,該填充基本區域另外在第二方向上不超出距該第一估計視差圖之當前位置線具預定距離su 之位置線。於一實施例中,預定距離su 等於一條位置線,且於本實施例中,填充基本暫存器之大小為第一影像之寬度以及用於儲存前一位置線中像素或像素組之視差值之最大視差值所需之位元長度、用於將前一位置線之像素或像素組標示為邊緣像素或像素組所需之位元長度1與用於將第一估計視差圖210之當前位置線上之像素或像素組標示為遮蔽像素或像素組之位元長度1之總和的乘積。In an embodiment, the padding base region further does not exceed the pixel or pixel group in the refinement from the current position line of the first estimated disparity map in the first direction and the direction opposite to the first direction, respectively. A pixel or group of pixels having a predetermined distance s r , s l . In addition, in an embodiment, the padding base region additionally does not exceed a position line having a predetermined distance s u from a current position line of the first estimated disparity map in the second direction. In one embodiment, the predetermined distance s u is equal to one position line, and in this embodiment, the size of the padding basic register is the width of the first image and is used to store the pixels or groups of pixels in the previous position line. The length of the bit required for the maximum disparity value of the difference, the bit length 1 required to mark the pixel or group of pixels of the previous position line as the edge pixel or the pixel group, and the first estimated disparity map 210 The pixel or group of pixels on the current position line is indicated as the product of the sum of the bit lengths 1 of the masked pixels or groups of pixels.

於另一實施例中,成像系統20係透過一般性電腦系統以軟體實施。一般性電腦系統包含用於儲存包含程式常式之資訊之一或多個記憶體(未圖示),及耦接至該一或多記憶體用於控制包括軟體模組之程式常式之執行之一或多處 理單元(未圖示)。請參照圖2,於一實施例中,程式常式包含邊緣偵測模組204、第一及第二視差估計模組208、258、交叉檢查模組212、遮蔽細化模組216及破洞填充模組220。In another embodiment, imaging system 20 is implemented in software via a general computer system. The general computer system includes one or more memories (not shown) for storing information including a program routine, and is coupled to the one or more memories for controlling execution of a program routine including the software module. One or more Unit (not shown). Referring to FIG. 2, in an embodiment, the routine includes an edge detection module 204, first and second parallax estimation modules 208 and 258, a cross-check module 212, a mask refinement module 216, and a hole. The module 220 is filled.

邊緣偵測模組204係用於偵測第一影像中之邊緣座標。第一視差估計模組208係用於獲得第一影像相對於一第二影像之第一估計視差圖210(圖中雙箭頭之左向部分所顯示)。相似地,第二視差估計模組258係用於獲得第二影像相對於第一影像之第二估計視差圖260(圖中雙箭頭之右向部分所顯示)。交叉檢查模組212係用於利用第二估計視差圖260交叉檢查第一估計視差圖210,以識別第一估計視差圖210中之一遮蔽像素集合214。遮蔽細化模組216係用於透過基於一細化基本區域中遮蔽像素或像素組之數目將第一估計視差圖210上之至少一在細化中的像素或像素組識別為被遮蔽,對遮蔽像素集合214進行細化,以獲得經細化之遮蔽像素集合218。於一實施例中,細化基本區域分別在一第一方向及與第一方向相反之方向上不超出含有該在細化中的像素或像素組之一位置線中最接近該在細化中的像素或像素組之邊緣座標,且分別在一第二方向上及與第二方向相反之方向上不超出對應於含有該在細化中的像素或像素組之該位置線在該等最接近邊緣座標之間的部分之邊緣座標。破洞填充模組220係用於基於每一遮蔽像素或像素組之至少一各別鄰近像素或像素組填充經細化之遮蔽像素集合218,以獲得一第一細化視差圖。The edge detection module 204 is configured to detect edge coordinates in the first image. The first disparity estimation module 208 is configured to obtain a first estimated disparity map 210 of the first image relative to a second image (shown in the leftward portion of the double arrow in the figure). Similarly, the second disparity estimation module 258 is configured to obtain a second estimated disparity map 260 of the second image relative to the first image (shown in the rightward portion of the double arrow in the figure). The cross-check module 212 is configured to cross-check the first estimated disparity map 210 with the second estimated disparity map 260 to identify one of the masked pixel sets 214 in the first estimated disparity map 210. The mask refinement module 216 is configured to identify at least one pixel or group of pixels in the refinement of the first estimated disparity map 210 as being masked by masking pixels or groups of pixels in a refinement basic region, The masked pixel set 214 is refined to obtain a refined shaded pixel set 218. In one embodiment, the refinement basic regions are respectively in a direction opposite to the first direction in a direction opposite to the first direction, and are closest to the refinement in a position line of the pixel or the pixel group in the refinement. Edge coordinates of the pixels or groups of pixels, and in a direction opposite to the second direction in a second direction and in a direction opposite to the second direction, respectively, corresponding to the position line corresponding to the pixel or group of pixels in the refinement The edge coordinates of the portion between the edge coordinates. The hole filling module 220 is configured to fill the refined masked pixel set 218 based on at least one respective neighboring pixel or group of pixels of each masking pixel or group of pixels to obtain a first refined disparity map.

上述實施例僅為本發明之成像系統20之實例且替代之均等實施係可能的。舉例而言,模組中之操作次序可以不同,且並不需要所有模組,此將自以下描述變得更顯而易見。模組之詳細操作可直接自關於本發明之一實施例之成像方法之以下描述獲得。The above-described embodiments are merely examples of the imaging system 20 of the present invention and alternative implementations are possible. For example, the order of operations in the modules can vary, and all modules are not required, as will become more apparent from the following description. The detailed operation of the module can be obtained directly from the following description of the imaging method of one embodiment of the present invention.

圖4顯示本發明之一實施例之成像方法之流程圖。圖5顯示本發明之一實施例之以區域性方法實施之視差估計步驟之流程圖。圖6顯示進行立體匹配之第一及第二影像之示意圖。圖7顯示本發明之一實施例之邊緣圖之示意圖。圖8顯示本發明之一實施例之普查轉換步驟之示意圖。圖9顯示本發明之一實施例之代價加總步驟之示意圖。圖10顯示本發明之一實施例之交叉檢查步驟之示意圖。圖11及12顯示本發明之不同實施例之遮蔽細化步驟之示意圖。圖13顯示本發明之一實施例之遮蔽細化步驟之結果之示意圖。圖14顯示本發明之一實施例之破洞填充步驟之示意圖。4 is a flow chart showing an image forming method of an embodiment of the present invention. Figure 5 is a flow chart showing the parallax estimation step implemented by the regional method in accordance with one embodiment of the present invention. Figure 6 shows a schematic diagram of the first and second images for stereo matching. Figure 7 is a schematic illustration of an edge map of one embodiment of the present invention. Figure 8 is a diagram showing the census conversion step of one embodiment of the present invention. Figure 9 is a diagram showing the cost-adding step of one embodiment of the present invention. Figure 10 is a schematic illustration of the cross-checking step of one embodiment of the present invention. Figures 11 and 12 show schematic views of the mask refinement steps of various embodiments of the present invention. Figure 13 is a diagram showing the results of the mask refinement step of one embodiment of the present invention. Figure 14 is a diagram showing the steps of filling a hole in an embodiment of the present invention.

於一實施例中,成像方法為電腦實施之方法且可儲存於非暫態之電腦可讀記錄媒體上以使電腦系統進行成像方法。請參照圖4,於一實施例中,成像方法400包含下列步驟:提供一第一及一第二影像(S402);偵測該第一影像中之邊緣座標(S404);獲得該第一影像相對於該第二影像之一第一估計視差圖及該第二影像相對於該第一影像之一第二估計視差圖(S406);利用該第二估計視差圖交叉檢查該第一估計視差圖,以識別一遮蔽像素集合(S408);對該 遮蔽像素集合進行細化(S410);以及填充該經細化之遮蔽像素集合(S412)。In one embodiment, the imaging method is a computer implemented method and can be stored on a non-transitory computer readable recording medium to cause the computer system to perform an imaging method. Referring to FIG. 4, in an embodiment, the imaging method 400 includes the following steps: providing a first image and a second image (S402); detecting edge coordinates in the first image (S404); obtaining the first image Correlating a first estimated disparity map with respect to one of the second images and a second estimated disparity map of the second image with respect to one of the first images (S406); using the second estimated disparity map to cross-check the first estimated disparity map To identify a masked pixel set (S408); The set of masked pixels is refined (S410); and the refined set of masked pixels is filled (S412).

請參照圖4及圖6,於步驟S402中,提供第一及第二影像60及65。如上所述且如圖6中所顯示,第一影像60及第二影像65已經過扭正,以使第一影像60及第二影像65中對齊之水平線可進行像素或像素組對像素或像素組之匹配。於本實施例中,第一影像60為左視影像而第二影像65為右視影像。於另一實施例中,第一影像可為右視影像而第二影像可為左視影像。Referring to FIG. 4 and FIG. 6, in step S402, first and second images 60 and 65 are provided. As described above and as shown in FIG. 6, the first image 60 and the second image 65 have been twisted so that the horizontal lines aligned in the first image 60 and the second image 65 can be pixel or pixel pair pixels or pixels. Match of groups. In this embodiment, the first image 60 is a left view image and the second image 65 is a right view image. In another embodiment, the first image may be a right view image and the second image may be a left view image.

請參照圖4且亦請參照圖7,於步驟S404中,偵測第一影像60中之邊緣座標,以獲得邊緣圖70。於邊緣圖70中,對應於第一影像60中物體之邊界像素或像素組的邊緣座標702被標示。可利用本領域中適當之邊緣偵測技術獲得清晰的物體邊界。Referring to FIG. 4 and FIG. 7 again, in step S404, edge coordinates in the first image 60 are detected to obtain an edge map 70. In edge map 70, edge coordinates 702 corresponding to boundary pixels or groups of pixels in the first image 60 are labeled. Clear object boundaries can be obtained using appropriate edge detection techniques in the art.

請參照圖4,於步驟S406中,獲得第一影像60相對於第二影像65之第一估計視差圖。可利用整體性方法或區域性方法獲得第一估計視差圖。如上所述,整體性方法將立體匹配問題以一能量函數公式化,能量函數可由式(1)表示。能量函數包含平緩度項E smooth (d) ,該平緩度項可導致第一估計視差圖在各處均平緩且因此使物體邊界變模糊以及影響視差圖之品質。Referring to FIG. 4, in step S406, a first estimated disparity map of the first image 60 relative to the second image 65 is obtained. The first estimated disparity map can be obtained using a holistic or regional approach. As described above, the holistic approach formulates the stereo matching problem as an energy function, which can be represented by equation (1). The energy function includes a graduality term E smooth (d) that can cause the first estimated disparity map to be flat everywhere and thus blur the object boundaries and affect the quality of the disparity map.

於一實施例中,視差估計步驟S406係以包含以下步驟之區域性方法進行。在下文中將參照圖5、圖6及圖9。於圖9中,網格90表示第一影像60之部分像素或像素 組,以及網格952、954、956表示第二影像65中之部分像素或像素組。於步驟S504中,計算及加總參考視窗(網格90中之斜線標示部分)以及複數個候選匹配視窗(網格952、954及956中之斜線標示部分)之匹配代價,參考視窗與第一影像60中具有(x,y)座標之參考像素或像素組重疊,上述複數個候選匹配視窗與第二影像65中例如具有(x,y)、(x-1,y)、(x-2,y)…(x-dmax ,y)座標之各別候選匹配像素或像素組重疊。具有(x,y)、(x-1,y)、(x-2,y)…或(x-dmax ,y)座標之每一候選匹配像素或像素組相對於參考像素(x,y)具有一不同之視差距離d=0、d=-1、d=-2…或d=-dmax 。接著,於步驟S506中,根據加總匹配代價,選擇候選匹配像素或像素組其中之一所對應之視差距離d為在第一估計視差圖上位於參考像素(x,y)之座標之一視差值。於一實施例中,選擇具有最小加總匹配代價之候選匹配像素或像素組所對應之視差距離。接著,於步驟S508中,如果所處理的位於座標(x,y)之參考像素為第一影像60中之最後一個參考像素或像素組,則已完成第一估計視差圖;否則,重複進行步驟S504及S506。代價加總步驟S504減少第一影像602中之雜訊對於視差圖之精確度之影響,但卻使物體之邊界模糊化,影響視差圖之品質。In one embodiment, the disparity estimation step S406 is performed in a regional method including the following steps. Reference will be made hereinafter to FIGS. 5, 6, and 9. In FIG. 9, grid 90 represents a portion of a pixel or group of pixels of first image 60, and grids 952, 954, 956 represent portions of pixels or groups of pixels in second image 65. In step S504, the matching cost of the reference window (the slash indication portion in the grid 90) and the plurality of candidate matching windows (the slash indication portions in the grids 952, 954, and 956) are calculated and added, and the reference window and the first Reference pixels or groups of pixels having (x, y) coordinates in the image 60 overlap, and the plurality of candidate matching windows and the second image 65 have, for example, (x, y), (x-1, y), (x-2) , y)...(xd max , y) The respective candidate matching pixels or groups of pixels of the coordinates overlap. Each candidate matching pixel or group of pixels having (x, y), (x-1, y), (x-2, y) ... or (xd max , y) coordinates has relative to the reference pixel (x, y) A different parallax distance d = 0, d = -1, d = - 2 ... or d = - d max . Next, in step S506, according to the total matching cost, the parallax distance d corresponding to one of the candidate matching pixels or the pixel group is selected as one of the coordinates of the reference pixel (x, y) on the first estimated disparity map. Difference. In one embodiment, the parallax distance corresponding to the candidate matching pixel or group of pixels having the smallest total matching cost is selected. Next, in step S508, if the processed reference pixel located at the coordinate (x, y) is the last reference pixel or pixel group in the first image 60, the first estimated disparity map is completed; otherwise, the steps are repeated. S504 and S506. The cost summing step S504 reduces the influence of the noise in the first image 602 on the accuracy of the disparity map, but blurs the boundary of the object and affects the quality of the disparity map.

於不同的實施例中,步驟S504中的加總匹配代價C可利用分別顯示於式(2)-(4)之絕對差值和(Sum of Absolute Difference,SAD)、差值平方和(Sum of Squared Differences,SSD),或是正規化互相關性(Normalized Cross Correlation,NCC)計算。In different embodiments, the total matching cost C in step S504 can be obtained by using Sum of Absolute Difference (SAD) and Sum of Difference (Sum of Absolute Difference, SAD, respectively). Squared Differences (SSD), or normalized cross-correlation (Normalized Cross Correlation, NCC) calculations.

C SAD x ,y |I 1 (x ,y )-I 2 (x -d ,y )| (2) C SAD x , y | I 1 ( x , y )- I 2 ( x - d , y )| (2)

C SSD x ,y (I 1 (x ,y )-I 2 (x -d ,y ))2 (3) C SSD x , y ( I 1 ( x , y )- I 2 ( x - d , y )) 2 (3)

其中,x及y為一參考像素之座標、d為一視差距離,以及I1 及I2 分別表示第一及第二影像60及65之像素強度。Wherein, x and y are coordinates of a reference pixel, d is a parallax distance, and I 1 and I 2 represent pixel intensities of the first and second images 60 and 65, respectively.

請參照圖4、5及8,於另一實施例中,步驟S404進一步包含對第一影像60進行普查轉換之普查轉換步驟S502。舉例而言,於圖8中,網格80顯示第一影像60中部分像素或像素組之像素強度。對第一影像602中位於座標(x,y)之一像素進行普查轉換即表示進行所述像素或像素組與其相鄰像素或像素組之像素強度之分別比較,以獲得如位於網格80'之座標(x,y)處之位元向量。於一實施例中,每一像素或像素組係與其直接相鄰之四個像素或像素組比較,以獲得長度為4之位元向量。於一實施例中,位元向量長度至少為1。於一實施例中,視進行比較之相鄰像素或像素組之數目而定,位元向量長度可為1、2、3或任何更高數字。相較於以上述像素強度表示之像素或像素組,經過普查轉換之像素或像素組具有明顯較短之位元長 度。相似地,第二影像65亦經過普查轉換。網格85顯示第二影像85中部分像素或像素組之像素強度,以及網格85'顯示經過普查轉換之像素或像素組。針對經過普查轉換之影像,步驟S504之加總匹配代價C可透過如式(5)所示之漢明距離(Hamming Distance,HD)計算:C HD x ,y HD (位元向量1 (x ,y ),位元向量2 (x -d ,y )) (5)Referring to FIG. 4, FIG. 5 and FIG. 8 , in another embodiment, step S404 further includes a census conversion step S502 of performing a census conversion on the first image 60. For example, in FIG. 8, grid 80 displays the pixel intensity of a portion of the pixels or groups of pixels in the first image 60. Performing a census conversion on a pixel located in the first image 602 at coordinates (x, y) means performing a comparison of the pixel intensities of the pixels or groups of pixels and their neighboring pixels or groups of pixels to obtain, for example, a grid 80' The bit vector at the coordinates (x, y). In one embodiment, each pixel or group of pixels is compared to its immediately adjacent four pixels or groups of pixels to obtain a bit vector of length 4. In one embodiment, the bit vector length is at least one. In one embodiment, the bit vector length may be 1, 2, 3, or any higher number depending on the number of neighboring pixels or groups of pixels being compared. A pixel or group of pixels that have undergone a census conversion has a significantly shorter bit length than a pixel or group of pixels represented by the pixel intensity described above. Similarly, the second image 65 is also subjected to a census conversion. Grid 85 displays the pixel intensities of a portion of the pixels or groups of pixels in the second image 85, and grid 85' displays the pixels or groups of pixels that have undergone a general scan. For the image converted by the census, the total matching cost C of step S504 can be calculated by Hamming Distance (HD) as shown in equation (5): C HD = Σ x , y HD (bit vector 1 ( x , y ), bit vector 2 ( x - d , y )) (5)

其中,x及y為一參考像素之座標、d為一視差距離,以及BitVec1 及BitVec2 分別表示經過普查轉換之第一及第二影像60及65之像素或像素組之位元向量。Wherein, x and y are coordinates of a reference pixel, d is a parallax distance, and BitVec 1 and BitVec 2 respectively represent bit vectors of pixels or groups of pixels of the first and second images 60 and 65 that have been census-converted.

接下來,請參照圖4及圖10,於步驟S408中,用第二估計視差圖交叉檢查第一估計視差圖100,以識別一遮蔽像素集合102。一般而言,物體在第一估計視差圖及第二估計視差圖中之視差值應相同。視視點位置而定,物體之部分在影像其中之一中可能被遮蔽而僅在另一影像中可見。交叉檢查步驟S408偵測物體之遮蔽部分及其他不匹配之部分。於一實施例中,交叉檢查步驟S408係基於以下所示之限制條件進行: Next, referring to FIG. 4 and FIG. 10, in step S408, the first estimated disparity map 100 is cross-checked with the second estimated disparity map to identify a masked pixel set 102. In general, the object should have the same disparity value in the first estimated disparity map and the second estimated disparity map. Depending on the location of the viewpoint, portions of the object may be obscured in one of the images and only visible in the other image. The cross check step S408 detects the masked portion of the object and other unmatched portions. In an embodiment, the cross-checking step S408 is performed based on the constraint conditions shown below:

其中,DD' 分別代表第一及第二估計視差圖,及λ 為預定之交叉檢查門檻值。第一估計視差圖100上不滿足限 制條件(6)之像素或像素組將包含於遮蔽像素集合102中。另外,如圖10中所示,因為估計視差圖100之品質在整體性方法中可受平緩度項影響,在區域性方法中可受代價加總及/或普查轉換影響,所以物體邊界在第一估計視差圖100中變得模糊。Wherein D and D' represent the first and second estimated disparity maps, respectively, and λ is a predetermined cross check threshold value. Pixels or groups of pixels on the first estimated disparity map 100 that do not satisfy the constraint (6) will be included in the masked pixel set 102. In addition, as shown in FIG. 10, since the quality of the estimated disparity map 100 can be affected by the gradation term in the holistic method, it can be affected by the cost summation and/or the census conversion in the regional method, so the object boundary is in the first An estimated parallax map 100 becomes blurred.

接下來,請參照圖4、圖11、圖12及圖13,於步驟S410中,利用從邊緣偵測步驟S404獲得之邊緣座標702對圖11或圖12中所示之第一估計視差圖100'或100中的遮蔽像素集合102'或102進行細化,以產生第一估計視差圖100"上的經細化之遮蔽像素集合102",如圖13所示。於圖11及圖12中,圖之底部所示之網格為第一估計視差圖100'或100之在遮蔽細化中之不同部分處的放大視圖。於一實施例中,遮蔽像素集合102'或102係透過基於細化基本區域1010(以粗線表示)中遮蔽像素1008之數目將第一估計視差圖100'或100上之在細化中的像素1006識別為被遮蔽而細化。基於交叉檢查步驟S408,細化基本區域1010中之空白像素1006及空白像素1007為未遮蔽像素或像素組。Next, referring to FIG. 4, FIG. 11, FIG. 12 and FIG. 13, in step S410, the first estimated disparity map 100 shown in FIG. 11 or FIG. 12 is obtained by using the edge coordinates 702 obtained from the edge detecting step S404. The shaded pixel set 102' or 102 in 'or 100 is refined to produce a refined shaded pixel set 102" on the first estimated disparity map 100", as shown in FIG. In Figures 11 and 12, the grid shown at the bottom of the figure is an enlarged view of the first estimated disparity map 100' or 100 at different portions of the shading refinement. In one embodiment, the masked pixel set 102' or 102 is in the refinement of the first estimated disparity map 100' or 100 by the number of masked pixels 1008 in the refined basic region 1010 (indicated by a thick line). Pixel 1006 is identified as being shaded and refined. Based on the cross-checking step S408, the blank pixels 1006 and the blank pixels 1007 in the basic region 1010 are refined into unmasked pixels or groups of pixels.

請參照圖11之底部左邊上所示之放大視圖,於一實施例中,於第一方向(例如,X方向)上,細化基本區域1010不超出最接近在細化中的像素1006之邊緣座標(未圖示)且另外不超出含有在細化中的像素1006之位置線中距在細化中的像素1006具預定距離rr 之像素或像素組。於相反於第一方向之方向上,細化基本區域1010不超出最接近 在細化中的像素1006之邊緣座標1004且另外不超出含有在細化中的像素1006之位置線中距在細化中的像素1006具預定距離rl 之像素或像素組。於第二方向(例如Y方向)上,細化基本區域1010不超出對應於含有在細化中的像素1006之位置線在細化基本區域1010中之部分的邊緣座標1002,且另外不超出距含有在細化中的像素1006之位置線具預定距離ru 之位置線。於相反於第二方向之方向上,細化基本區域1010不超出對應於含有在細化中的像素1006之位置線在細化基本區域1010中之部分的邊緣座標(未圖示),且另外不超出距含有在細化中的像素或像素組之位置線具預定距離rd 之位置線。於一實施例中,預定距離rr 、rl 、ru 及rd 等於至少1條位置線。於圖11之底部左邊上所示之實例中,細化基本區域1010由在與第一方向相反之方向上的邊緣座標搜尋期間之邊緣座標1004及第二方向上之邊緣座標1002為界,且在第一方向及與第二方向相反之方向上至多達到預定距離rr 及rd 。相較於圖11之底部左邊上所示之實例,圖11之底部右邊上所示之實例中之細化基本區域1010在與第二方向相反之方向上由邊緣座標1002限定,且在第二方向上至多達到預定距離ruReferring to the enlarged view shown on the bottom left side of FIG. 11, in an embodiment, in the first direction (for example, the X direction), the refinement of the basic region 1010 does not exceed the edge of the pixel 1006 closest to the refinement. The coordinates (not shown) and additionally do not exceed the pixel or group of pixels having a predetermined distance r r from the pixel 1006 in the refinement in the position line of the pixel 1006 in the refinement. In a direction opposite to the first direction, the refinement basic region 1010 does not exceed the edge coordinates 1004 of the pixel 1006 closest to the refinement and additionally does not exceed the position line of the pixel 1006 included in the refinement. The pixel 1006 has a pixel or a pixel group of a predetermined distance r l . In the second direction (eg, the Y direction), the refinement basic region 1010 does not exceed the edge coordinates 1002 corresponding to the portion of the position line of the pixel 1006 included in the refinement in the refinement basic region 1010, and additionally does not exceed the distance The position line of the pixel 1006 contained in the refinement has a position line of a predetermined distance r u . In a direction opposite to the second direction, the refinement basic region 1010 does not exceed an edge coordinate (not shown) corresponding to a portion of the position line of the pixel 1006 included in the refinement in the refinement basic region 1010, and additionally position of the line of pixels or groups of pixels in the thinning without departing from the contained position of the line with the predetermined distance r d. In one embodiment, the predetermined distances r r , r l , r u , and r d are equal to at least one position line. In the example shown on the bottom left side of FIG. 11, the refinement basic region 1010 is bounded by the edge coordinates 1004 during the edge coordinate search in the opposite direction to the first direction and the edge coordinates 1002 in the second direction, and The predetermined distances r r and r d are at most reached in the first direction and in the opposite direction to the second direction. Compared to the example shown on the bottom left side of FIG. 11, the refined basic region 1010 in the example shown on the bottom right side of FIG. 11 is defined by the edge coordinates 1002 in the opposite direction to the second direction, and is in the second The predetermined distance r u is reached at most in the direction.

請參照圖12之底部左邊上之放大視圖,於本實施例中,未搜尋與第二方向(例如Y方向)相反之方向。因此,於第一方向(例如,X方向)上,細化基本區域1010不超出最接近在細化中的像素1006之邊緣座標1004且另外不超 出含有在細化中的像素1006之位置線中距在細化中的像素1006具預定距離rr 之像素或像素組。於相反於第一方向之方向上,細化基本區域1010不超出最接近在細化中的像素1006之邊緣座標(未圖示)且另外不超出含有在細化中的像素1006之位置線中具預定距離rl 之像素或像素組。於第二方向上,細化基本區域1010不超出對應於含有在細化中的像素1006之位置線在細化基本區域1010中之部分的邊緣座標1002,且另外不超出距含有在細化中的像素1006之位置線具預定距離ru 之位置線。於相反於第二方向之方向上,細化基本區域1010不超出含有在細化中的像素1006之位置線。於本實例中,細化基本區域1010由第一方向上的邊緣座標搜尋期間之邊緣座標1004及第二方向上之邊緣座標1002為界,且在與第一方向相反之方向上至多達到預定距離rl 。相較於圖12之底部左邊上所示之實例,圖12之底部右邊上所示之實例中之細化基本區域1010由第一方向及與第一方向相反之方向上的搜尋期間之邊緣座標1004限定。Referring to the enlarged view on the bottom left side of FIG. 12, in the present embodiment, the direction opposite to the second direction (for example, the Y direction) is not searched. Therefore, in the first direction (for example, the X direction), the refinement basic region 1010 does not exceed the edge coordinates 1004 of the pixel 1006 closest to the refinement and additionally does not exceed the position line of the pixel 1006 contained in the refinement. A pixel or group of pixels having a predetermined distance r r from the pixel 1006 in the refinement. In a direction opposite to the first direction, the refinement base region 1010 does not exceed the edge coordinates (not shown) of the pixel 1006 closest to the refinement and additionally does not exceed the position line of the pixel 1006 contained in the refinement. A pixel or group of pixels with a predetermined distance r l . In the second direction, the refinement basic region 1010 does not exceed the edge coordinate 1002 corresponding to the portion of the position line of the pixel 1006 included in the refinement in the refinement basic region 1010, and additionally does not exceed the distance contained in the refinement. The position line of the pixel 1006 has a position line of a predetermined distance r u . In a direction opposite to the second direction, the refinement basic region 1010 does not exceed the position line of the pixel 1006 contained in the refinement. In the present example, the refinement basic region 1010 is bounded by the edge coordinates 1004 during the edge coordinate search in the first direction and the edge coordinates 1002 during the second direction, and reaches a predetermined distance in the opposite direction to the first direction. r l . Compared to the example shown on the bottom left side of FIG. 12, the refined basic region 1010 in the example shown on the bottom right side of FIG. 12 is defined by the first direction and the edge coordinates of the search period in the opposite direction to the first direction. 1004 is limited.

以上描述中所用之片語「不超出」意謂直至規定邊界或在規定邊界內之區域跨度。The phrase "not exceeding" as used in the above description means the span of the area up to the specified boundary or within the specified boundary.

請參照圖4及圖11,於一實施例中,於步驟S410中,當限定於細化基本區域1010之遮蔽像素1008之數目大於限定於細化基本區域1010之像素1006、1007及1008之總數之預定百分比時,將在細化中的像素1006識別為被遮蔽。於一實施例中,預定百分比為至少0.1至0.9。於 圖11中所示之實施例中,在決定是否將在細化中的像素1006標示為被遮蔽時,對在遮蔽細化步驟S410期間識別之遮蔽像素或像素組與從交叉檢查步驟S408獲得之遮蔽像素或像素組一起計數。如圖11中所示,第一估計視差圖100'在在細化中的像素1006上方及左邊之部分已經過遮蔽細化處理且含有來自交叉檢查步驟S408及遮蔽細化步驟S410兩者之遮蔽像素或像素組。於如圖12中所示之不同實施例中,在決定是否將在細化中的像素1006標示為被遮蔽時,僅對從交叉檢查步驟S408獲得之遮蔽像素1008計數。Referring to FIG. 4 and FIG. 11 , in an embodiment, in step S410 , the number of masked pixels 1008 defined in the thinned basic region 1010 is greater than the total number of pixels 1006 , 1007 , and 1008 defined in the refined basic region 1010 . At a predetermined percentage, the pixel 1006 in the refinement is identified as being masked. In one embodiment, the predetermined percentage is at least 0.1 to 0.9. to In the embodiment shown in FIG. 11, when it is determined whether the pixel 1006 in the refinement is marked as being masked, the masked pixel or pixel group identified during the mask refinement step S410 is obtained from the cross check step S408. The masked pixels or groups of pixels are counted together. As shown in FIG. 11, the first estimated disparity map 100' has been subjected to the mask refinement processing in the portion above and to the left of the pixel 1006 in the refinement and contains the mask from both the cross check step S408 and the mask refinement step S410. Pixel or group of pixels. In the different embodiments as shown in FIG. 12, only the masked pixels 1008 obtained from the cross-checking step S408 are counted when deciding whether to mark the pixels 1006 in the refinement as being masked.

接下來,請參照圖4及圖14,於一實施例中,於步驟S412中,基於每一遮蔽像素或像素組之至少一各別鄰近像素或像素組填充經細化之遮蔽像素集合102",以獲得一第一細化視差圖。於一實施例中,假設填充程序係自左至右、自上至下進行,則用含有受到填充的像素1012之位置線(例如,圖14中所示之網格中之第二列)中最接近受到填充的像素1012之非遮蔽像素或像素組之視差值填充受到填充的像素1012。舉例而言,最接近之非遮蔽像素或像素組可為在受到填充的像素1012左邊的具有視差值36之像素或像素組。Next, referring to FIG. 4 and FIG. 14 , in an embodiment, in step S412 , the thinned masked pixel set 102 is filled based on at least one respective neighboring pixel or pixel group of each masked pixel or group of pixels. To obtain a first refinement disparity map. In one embodiment, assuming that the padding process is performed from left to right, top to bottom, a position line containing the filled pixels 1012 is used (eg, in FIG. 14 The disparity pixel of the non-masked pixel or group of pixels closest to the filled pixel 1012 in the second column of the illustrated grid fills the filled pixel 1012. For example, the closest non-masked pixel or group of pixels may Is a pixel or group of pixels having a disparity value 36 to the left of the filled pixel 1012.

於另一實施例中,基於填充基本區域1014(以粗線表示)中之像素或像素組之視差值之統計資訊填充經細化之遮蔽像素集合102"中之受到填充的像素1012。於一實施例中,細化基本區域1014分別在第一方向(例如,X方向)及 與第一方向相反之方向上不超出含有受到填充的像素1012之位置線中最接近受到填充的像素1012之邊緣座標1016。如圖14中所示,於一實施例中,填充基本區域1014另外分別在第一方向及與第一方向相反之方向上不超出含有受到填充的像素1012之位置線中距受到填充的像素1012具預定距離sr 、sl 之像素或像素組。於一實施例中,預定距離rr 、rl 、ru 及rd 等於至少1條位置線。另外,填充基本區域1014另外在第二方向(例如Y方向)上不超出距含有受到填充的像素1012之位置線具預定距離su 之位置線。於一實施例中,填充基本區域1014另外在與第二方向相反之方向上不超出含有受到填充的像素1012之位置線。於一實施例中,預定距離su 等於至少1條位置線。於該圖之頂部處所示之實例中,填充基本區域1014由在第一方向及與第一方向相反之方向上的邊緣座標搜尋期間之邊緣座標1016為界,且在第二方向上至多達到預定距離su 以及在與第二方向相反之方向上至多達到含有受到填充的像素1012之位置線。相較於圖14之頂部處所示之實例,該圖之底部處所示之填充基本區域1014在第一方向上至多達到預定距離srIn another embodiment, the filled pixels 1012 in the refined shaded pixel set 102" are populated based on statistical information of the disparity values of the pixels or groups of pixels in the fill base region 1014 (shown in bold lines). In one embodiment, the refinement basic region 1014 does not exceed the pixel 1012 closest to the fill in the first direction (eg, the X direction) and the direction opposite to the first direction in the position line containing the filled pixel 1012, respectively. Edge coordinates 1016. As shown in FIG. 14, in an embodiment, the filling base regions 1014 are additionally received in the first direction and in the opposite direction to the first direction, respectively, beyond the position of the line containing the filled pixels 1012. The filled pixels 1012 have pixels or groups of pixels of a predetermined distance s r , s l . In one embodiment, the predetermined distances r r , r l , r u , and r d are equal to at least one position line. In addition, the filled basic area 1014 Also in the second direction (e.g., Y direction) without departing from the subject containing the pixel position of the filling line position of the line 1012 with a predetermined distance s u of the embodiment, the base region 1014 to fill a further embodiment in the second direction opposite to the Upwardly by the pixel position of the line does not exceed the filling contains 1012. In one embodiment, u is equal to at least one predetermined position of the line from S. In the example shown at the top of the drawing, the filling of the first base region 1014 The direction and the edge coordinates 1016 during the edge coordinate search in the opposite direction to the first direction are bounded, and at most a predetermined distance s u in the second direction and at most up to the filled direction The position line of the pixel 1012. Compared to the example shown at the top of Fig. 14, the filled basic region 1014 shown at the bottom of the figure reaches a predetermined distance s r at most in the first direction.

繼續以上描述,於一實施例中,透過進行多階段表決方法來獲得統計資訊,多階段表決方法包含:獲得填充基本區域1014中最多數目個像素或像素組所關聯於之一系列視差值;及獲得該一系列視差值中基本區域1014中最多數目個像素或像素組所關聯於之一視差值。於圖14中所 示之實例中,填充基本區域1014中之最多數目個像素或像素組屬於45-49之一系列視差值,且在45-49之範圍內,視差值47具有最多數目之得票。因此,用視差值47對受到填充的像素1012進行填充。Continuing with the above description, in one embodiment, statistical information is obtained by performing a multi-stage voting method. The multi-stage voting method includes: obtaining a maximum number of pixels or groups of pixels in the filled basic region 1014 associated with a series of disparity values; And obtaining a maximum number of pixels or groups of pixels in the basic region 1014 of the series of disparity values associated with one of the disparity values. In Figure 14 In the illustrated example, the maximum number of pixels or groups of pixels in the fill base region 1014 belong to a series of disparity values of 45-49, and within the range of 45-49, the disparity value 47 has the highest number of votes. Therefore, the filled pixel 1012 is filled with the disparity value 47.

於前述實施例中,透過利用第一影像之邊緣座標作為導引來識別必須加以增進之像素或像素組且識別可充當用於修補必須加以增進之每一像素或像素組之參考的至少一像素或像素組,遮蔽細化步驟S410及破洞填充步驟S412增進視差圖之品質。因此,遮蔽細化步驟S410及破洞填充步驟S412可增進視差圖之品質而不會增加需進行大量計算之視差估計步驟S404之複雜度。遮蔽細化步驟S410及破洞填充步驟S412甚至可透過允許利用像素或像素組之更緊湊表示來幫助減小視差估計步驟S404之複雜度,例如在包括普查轉換步驟S502之實施例中。In the foregoing embodiment, by using the edge coordinates of the first image as a guide to identify pixels or groups of pixels that must be enhanced and identifying at least one pixel that can serve as a reference for repairing each pixel or group of pixels that must be enhanced Or the pixel group, the mask refinement step S410 and the hole filling step S412 improve the quality of the disparity map. Therefore, the mask refinement step S410 and the hole filling step S412 can improve the quality of the disparity map without increasing the complexity of the disparity estimation step S404 in which a large amount of calculation is required. The mask refinement step S410 and the hole filling step S412 may even help reduce the complexity of the disparity estimation step S404 by allowing a more compact representation of the pixels or groups of pixels, such as in an embodiment including the census conversion step S502.

應注意,上述成像方法之實施例僅為本發明之實例。替代之等效實施例係可能的。舉例而言,普查轉換步驟S502可逐個區域進行且包含於圖5中所示之處理迴圈中;或如於上述之管線式硬體實施例中,可按行產生第一及第二估計視差圖、遮蔽像素集合、經細化之遮蔽像素集合以及第一細化視差圖。It should be noted that the embodiments of the above imaging method are merely examples of the present invention. Alternative equivalent embodiments are possible. For example, the census conversion step S502 can be performed on a region-by-region basis and included in the processing loop shown in FIG. 5; or as in the above-described pipelined hardware embodiment, the first and second estimated parallax can be generated in rows The graph, the masked pixel set, the refined masked pixel set, and the first refined disparity map.

綜上所述,本發明提供一種成像系統及方法,其產生第一影像及第二影像之視差圖。使用第一影像之邊緣資訊作為導引以識別視差圖上需要增進之區域,以使在不增加例如視差估計之需進行大量計算之部分之複雜度的情況下, 增進視差圖之品質。使用邊緣資訊細化視差圖甚至可減少視差估計之複雜度。透過增進視差圖之品質及控制複雜度,本發明可適用於三維手勢辨識、視點合成及立體電視等應用。In summary, the present invention provides an imaging system and method that generate a disparity map of a first image and a second image. Using the edge information of the first image as a guide to identify the area on the disparity map that needs to be enhanced, so as not to increase the complexity of the part that requires a large amount of calculation, such as disparity estimation, Improve the quality of the parallax map. Using edge information to refine the disparity map can even reduce the complexity of disparity estimation. By improving the quality and control complexity of the parallax map, the present invention is applicable to applications such as three-dimensional gesture recognition, viewpoint synthesis, and stereoscopic television.

本發明之技術內容及技術特定已揭露如上,然而熟悉本項技術之人士仍可能基於本發明之教示及揭露而作種種不背離本發明精神之替換及修飾。舉例而言,上述許多程序可以不同方法實施,以及以其他程序替代,或是其組合。The technical content and the technical details of the present invention have been disclosed above, but those skilled in the art can still make various substitutions and modifications without departing from the spirit and scope of the present invention. For example, many of the above described programs can be implemented in different ways, with alternatives to other programs, or a combination thereof.

另外,本發明之保護範圍應不限於本說明書中所描述之程序、機器、成品、組成物、手段、方法及步驟之特定實施例。本領域中具有通常知識者應能從本發明之揭露內容直接領會具有與本說明書之實施例實質等同之功能或可達成與本說明書之實施例實質相同之結果之目前現有或後來開發的可供本發明使用之程序、機器、成品、組成物、手段、方法或步驟。因此,上述程序、機器、成品、組成物、手段、方法或步驟應由以下之申請專利範圍所涵蓋。In addition, the scope of the present invention is not limited to the specific embodiments of the procedures, machines, products, compositions, means, methods and steps described in the specification. Those having ordinary skill in the art should be able to directly appreciate the presently existing or later developed ones having the functions substantially equivalent to the embodiments of the present specification or substantially achieving the same results as the embodiments of the present specification. The program, machine, product, composition, means, method or procedure used in the present invention. Therefore, the above-mentioned procedures, machines, finished products, compositions, means, methods or steps are to be covered by the following claims.

10‧‧‧立體相機10‧‧‧ Stereo camera

12‧‧‧原始影像12‧‧‧ original image

14‧‧‧校正與扭正方塊14‧‧‧Correction and twist squares

16‧‧‧第一影像16‧‧‧ first image

18‧‧‧第二影像18‧‧‧Second image

20‧‧‧成像系統20‧‧‧ imaging system

22‧‧‧深度圖22‧‧‧Depth map

24‧‧‧應用方塊24‧‧‧Application block

60‧‧‧第一影像60‧‧‧ first image

65‧‧‧第二影像65‧‧‧Second image

70‧‧‧邊緣圖70‧‧‧Edge map

80‧‧‧網格80‧‧‧ grid

80'‧‧‧網格80'‧‧‧ grid

85‧‧‧網格85‧‧‧Grid

85'‧‧‧網格85'‧‧‧Grid

90‧‧‧網格90‧‧‧Grid

100‧‧‧第一估計視差圖100‧‧‧First estimated disparity map

100'‧‧‧第一估計視差圖100'‧‧‧First Estimated Disparity Map

100"‧‧‧第一估計視差圖100"‧‧‧First Estimated Disparity Map

102‧‧‧遮蔽像素集合102‧‧‧Shaded pixel collection

102'‧‧‧遮蔽像素集合102'‧‧‧Shaded pixel collection

102"‧‧‧遮蔽像素集合102"‧‧‧shaded pixel collection

204‧‧‧邊緣偵測模組204‧‧‧Edge Detection Module

206‧‧‧邊緣圖206‧‧‧Edge map

208‧‧‧第一視差估計模組208‧‧‧First Parallax Estimation Module

210‧‧‧第一估計視差圖210‧‧‧First estimated disparity map

212‧‧‧交叉檢查模組212‧‧‧ cross check module

214‧‧‧遮蔽像素集合214‧‧‧shaded pixel collection

216‧‧‧遮蔽細化模組216‧‧‧shadow refinement module

218‧‧‧經細化之遮蔽細像素集合218‧‧‧Refined fine pixel collection

220‧‧‧破洞填充模組220‧‧‧ hole filling module

258‧‧‧第二視差估計模組258‧‧‧Second Parallax Estimation Module

260‧‧‧第二估計視差圖260‧‧‧Second estimated disparity map

400‧‧‧成像方法400‧‧‧ imaging methods

702‧‧‧邊緣座標702‧‧‧Edge coordinates

952‧‧‧網格952‧‧‧Grid

954‧‧‧網格954‧‧‧Grid

956‧‧‧網格956‧‧‧Grid

1002‧‧‧邊緣座標1002‧‧‧Edge coordinates

1004‧‧‧邊緣座標1004‧‧‧Edge coordinates

1006‧‧‧空白像素1006‧‧‧ blank pixels

1007‧‧‧空白像素1007‧‧‧ blank pixels

1008‧‧‧遮蔽像素1008‧‧‧shaded pixels

1010‧‧‧細化基本區域1010‧‧‧Refine the basic area

1012‧‧‧受到填充的像素1012‧‧‧filled pixels

1014‧‧‧填充基本區域1014‧‧‧filled basic area

1016‧‧‧邊緣座標1016‧‧‧Edge coordinates

2081‧‧‧第一普查轉換模組2081‧‧‧First census conversion module

2082‧‧‧比對線2082‧‧‧ alignment line

2083‧‧‧第一代價加總模組2083‧‧‧First Cost Plus Module

2084‧‧‧加總匹配代價2084‧‧‧Additional matching cost

2085‧‧‧第一視差選擇模組2085‧‧‧First parallax selection module

2581‧‧‧第二普查轉換模組2581‧‧‧Second census conversion module

2582‧‧‧比對線2582‧‧‧ alignment line

2583‧‧‧第二代價加總模組2583‧‧‧Second cost plus module

2584‧‧‧加總匹配代價2584‧‧‧Additional matching cost

2585‧‧‧第二視差選擇模組2585‧‧‧Second parallax selection module

rl ‧‧‧距第一估計視差圖之當前位置線中之在細化中的 像素或像素組的預定距離r l ‧‧‧ predetermined distance from the pixel or group of pixels in the refinement in the current position line of the first estimated disparity map

rr ‧‧‧距第一估計視差圖之當前位置線中之在細化中的像素或像素組的預定距離r r ‧‧‧ predetermined distance from the pixel or group of pixels in the refinement in the current position line of the first estimated disparity map

ru ‧‧‧距第一估計視差圖之當前位置線的預定距離r u ‧‧‧ predetermined distance from the current position line of the first estimated disparity map

rd ‧‧‧距第一估計視差圖之當前位置線中之在細化中的像素或像素組的預定距離r d ‧‧‧ predetermined distance from the pixel or group of pixels in the refinement in the current position line of the first estimated disparity map

sr ‧‧‧第一方向上的距第一估計視差圖之當前位置線中之在細化中的像素或像素組的預定距離s r ‧‧‧ a predetermined distance from the pixel or group of pixels in the refinement in the current position line of the first estimated disparity map in the first direction

sl ‧‧‧與第一方向相反之方向上的距第一估計視差圖之當前位置線中之在細化中的像素或像素組的預定距離s l ‧‧‧ a predetermined distance from the pixel or group of pixels in the refinement from the current position line of the first estimated disparity map in a direction opposite to the first direction

su ‧‧‧第二方向上的距第一估計視差圖之當前位置線之預定距離s u ‧‧‧ a predetermined distance from the current position line of the first estimated disparity map in the second direction

圖1顯示本發明之一實施例之成像系統之應用之方塊圖;圖2顯示本發明之一實施例之成像系統之方塊圖;圖3顯示本發明之另一實施例之成像系統之方塊圖;圖4顯示本發明之又一實施例之成像方法之流程圖;圖5顯示本發明之一實施例之以區域性方法實施之視差估計步驟之流程圖; 圖6顯示進行立體匹配之第一及第二影像之示意圖;圖7顯示本發明之一實施例之邊緣圖之示意圖;圖8顯示本發明之一實施例之普查轉換步驟之示意圖;圖9顯示本發明之一實施例之代價加總步驟之示意圖;及圖10顯示本發明之一實施例之交叉檢查步驟之示意圖;圖11及12顯示本發明之不同實施例之遮蔽細化步驟之示意圖;圖13顯示本發明之一實施例之遮蔽細化步驟之結果之示意圖;及圖14顯示本發明之一實施例之破洞填充步驟之示意圖。1 is a block diagram showing an application of an imaging system according to an embodiment of the present invention; FIG. 2 is a block diagram showing an imaging system according to an embodiment of the present invention; and FIG. 3 is a block diagram showing an imaging system according to another embodiment of the present invention. 4 is a flow chart showing an imaging method according to still another embodiment of the present invention; and FIG. 5 is a flow chart showing a parallax estimation step implemented by a regional method according to an embodiment of the present invention; 6 is a schematic diagram showing first and second images for stereo matching; FIG. 7 is a schematic diagram showing an edge diagram of an embodiment of the present invention; FIG. 8 is a schematic diagram showing a census conversion step according to an embodiment of the present invention; Schematic diagram of a cost-adding step of an embodiment of the present invention; and FIG. 10 is a schematic diagram showing a cross-checking step of an embodiment of the present invention; FIGS. 11 and 12 are diagrams showing a mask refining step of different embodiments of the present invention; Figure 13 is a view showing the result of the mask refining step of one embodiment of the present invention; and Figure 14 is a view showing the step of filling the hole according to an embodiment of the present invention.

204‧‧‧邊緣偵測模組204‧‧‧Edge Detection Module

206‧‧‧邊緣圖206‧‧‧Edge map

208‧‧‧第一視差估計模組208‧‧‧First Parallax Estimation Module

210‧‧‧第一估計視差圖210‧‧‧First estimated disparity map

212‧‧‧交叉檢查模組212‧‧‧ cross check module

214‧‧‧遮蔽像素集合214‧‧‧shaded pixel collection

216‧‧‧遮蔽細化模組216‧‧‧shadow refinement module

218‧‧‧經細化之遮蔽細像素集合218‧‧‧Refined fine pixel collection

220‧‧‧破洞填充模組220‧‧‧ hole filling module

258‧‧‧第二視差估計模組258‧‧‧Second Parallax Estimation Module

260‧‧‧第二估計視差圖260‧‧‧Second estimated disparity map

Claims (26)

一種成像系統,包含:一邊緣偵測模組,用於偵測一第一影像中至少一參考線之一或多邊緣座標;第一及第二視差估計模組,分別用於獲得該第一影像相對於一第二影像之一第一估計視差圖及該第二影像相對於該第一影像之一第二估計視差圖之一當前位置線;一交叉檢查模組,用於利用該第二估計視差圖之該當前位置線交叉檢查該第一估計視差圖之該當前位置線,以識別該第一估計視差圖之該當前位置線中之一遮蔽像素集合;一遮蔽細化模組,其用來對該遮蔽像素集合進行細化以產生一經細化之遮蔽像素集合;以及一破洞填充模組,其用來在該第一估計視差圖之該當前位置線中填充該經細化之遮蔽像素集合,以獲得一第一細化視差圖之一當前位置線。 An imaging system includes: an edge detection module for detecting one or more edge coordinates of at least one reference line in a first image; and first and second parallax estimation modules respectively for obtaining the first a first estimated disparity map of the image relative to a second image and a current position line of the second estimated disparity map of the second image relative to the first image; a cross check module for utilizing the second The current position line of the estimated disparity map cross-checks the current position line of the first estimated disparity map to identify one of the current position lines of the first estimated disparity map, and a masking pixel set; And the thinning filling module is configured to fill the current position line of the first estimated disparity map with the refinement The set of pixels is masked to obtain a current position line of one of the first refinement disparity maps. 如申請專利範圍第1項所述之成像系統,其中,該遮蔽細化模組包含:一細化基本暫存器,用於利用該細化基本暫存器及含有該遮蔽像素集合的該第一估計視差圖之該當前位置線,透過基於一細化基本區域中遮蔽像素或像素組之數目將該第一估計視差圖之該當前位置線上之一在細化中的像素或像素組識別為被遮蔽,對該遮蔽像素集合進行細化,該細化基 本區域分別在一第一方向及與該第一方向相反之方向上不超出該第一估計視差圖之該當前位置線中最接近該在細化中的像素或像素組之邊緣座標,不超出對應於該第一估計視差圖之該當前位置線在該細化基本區域中之一部分之邊緣座標,且在與該第二方向相反之方向上不超出該第一估計視差圖之該當前位置線;以及用含有該遮蔽像素集合或該經細化之遮蔽像素集合的第一估計視差圖之該當前位置線以及與該第一影像之該參考線的該經偵測之一或多邊緣座標相關之資訊,對該細化基本暫存器進行更新。 The imaging system of claim 1, wherein the mask refinement module comprises: a refinement basic register for utilizing the refinement basic register and the first set including the masked pixel set The current position line of the estimated disparity map is identified as a pixel or a group of pixels in the refinement of the current estimated position line of the first estimated disparity map based on the number of masked pixels or groups of pixels in a refinement basic region Masked, the shaded pixel set is refined, the refinement base The region does not exceed the edge coordinate of the pixel or pixel group in the refinement in the first direction and the direction opposite to the first direction, and does not exceed the current position line of the first estimated disparity map, and does not exceed Corresponding to an edge coordinate of the current position line of the first estimated disparity map in a portion of the refinement basic region, and not exceeding the current position line of the first estimated disparity map in a direction opposite to the second direction And the current position line of the first estimated disparity map including the masked pixel set or the refined masked pixel set and the detected one or more edge coordinates of the reference line of the first image Information to update the refinement basic scratchpad. 如申請專利範圍第1項所述之成像系統,其中,該破洞填充模組係用於基於每一遮蔽像素或像素組之至少一各別鄰近像素或像素組在該第一估計視差圖之該當前位置線中填充該經細化之遮蔽像素集合。 The imaging system of claim 1, wherein the hole filling module is configured to map the first estimated disparity map based on at least one respective neighboring pixel or pixel group of each masking pixel or group of pixels. The current position line is filled with the refined masked pixel set. 如申請專利範圍第1項所述之成像系統,其中,該細化基本區域另外在該第二方向上不超出距該第一估計視差圖之該當前位置線具一預定距離之一位置線。 The imaging system of claim 1, wherein the refinement basic region additionally does not exceed a position line of a predetermined distance from the current position line of the first estimated disparity map in the second direction. 如申請專利範圍第1項所述之成像系統,其中,該破洞填充模組包含一填充基本暫存器,且該破洞填充模組用於利用該填充基本暫存器及含有該經細化之遮蔽像素集合的該第一估計視差圖之該當前位置線,透過基於一填充基本區域中像素或像素組之視差值之統計資訊填充該 經細化之遮蔽像素集合中之一受到填充的像素或像素組而在該第一估計視差圖之該當前位置線中填充該經細化之遮蔽像素集合,以獲得該第一細化視差圖之該當前位置線,該填充基本區域分別在該第一方向及與該第一方向相反之該方向上不超出該第一估計視差圖之該當前位置線中最接近該受到填充的像素或像素組之邊緣座標,且在與該第二方向相反之該方向上不超出該第一估計視差圖之該當前位置線;以及以該第一細化視差圖之該當前位置線更新該填充基本暫存器。 The image forming system of claim 1, wherein the hole filling module comprises a filling basic register, and the hole filling module is configured to utilize the filling basic register and include the fine The current position line of the first estimated disparity map of the masked pixel set is filled by statistical information based on a disparity value of a pixel or a pixel group in the filled basic region Filling the refined set of masked pixels in the current position line of the first estimated disparity map to obtain the first refinement disparity map, wherein one of the refined masked pixel sets is filled with pixels or groups of pixels The current position line, the filled basic area is in the first direction and the direction opposite to the first direction, and the pixel that is closest to the filled pixel or pixel in the current position line of the first estimated disparity map An edge coordinate of the group, and the current position line of the first estimated disparity map is not exceeded in the direction opposite to the second direction; and the padding is updated with the current position line of the first refinement disparity map Save. 如申請專利範圍第5項所述之成像系統,其中,該填充基本區域另外在該第二方向上不超出距該第一估計視差圖之該當前位置線具一預定距離之一位置線。 The imaging system of claim 5, wherein the filling base region further does not exceed a position line of a predetermined distance from the current position line of the first estimated disparity map in the second direction. 如申請專利範圍第1項所述之成像系統,其中,該第一視差估計模組包含:一第一代價加總模組,包含一第一加總視窗暫存器,用於:獲得該第一影像及該第二影像之比對線,對於複數個視差距離,計算該第一影像之該比對線相對於該第二影像之該比對線之當前匹配代價,對於該複數個視差距離,利用該第一加總視窗暫存器及該等當前匹配代價,加總匹配代價,及以該等當前匹配代價更新該第一加總視窗暫存器;以及 一第一視差選擇模組,用於為一第一估計視差圖之一當前位置線上的每一像素或像素組分別選擇該等視差距離其中之一,作為該第一估計視差圖之該像素或像素組之一視差值。 The imaging system of claim 1, wherein the first disparity estimation module comprises: a first cost summation module, comprising a first summation window register, configured to: obtain the first a comparison line of an image and the second image, for a plurality of parallax distances, calculating a current matching cost of the comparison line of the first image with respect to the comparison line of the second image, for the plurality of parallax distances Using the first summing window register and the current matching cost, summing the matching cost, and updating the first summing window register with the current matching cost; a first parallax selection module, configured to select one of the parallax distances for each pixel or group of pixels on a current position line of a first estimated disparity map as the pixel of the first estimated disparity map or One of the pixel groups has a disparity value. 如申請專利範圍第7項所述之成像系統,其中,該第一視差估計模組進一步包含:一第一普查轉換模組,包含一第一普查暫存器,用於利用該第一普查暫存器以及該第一影像之一當前位置線,進行普查轉換以產生該第一影像之該比對線,並以該第一影像之該當前位置線更新該第一普查暫存器,其中該第一影像之該比對線中每一經普查轉換之像素或像素組係由長度至少為1的位元向量表示。 The imaging system of claim 7, wherein the first parallax estimation module further comprises: a first census conversion module, comprising a first census register for utilizing the first census And the current position line of the first image, performing a census conversion to generate the comparison line of the first image, and updating the first census register with the current position line of the first image, where Each census-converted pixel or group of pixels in the alignment line of the first image is represented by a bit vector having a length of at least one. 一種電腦系統,包含:儲存包含程式常式之資訊之一或多記憶體,包含:一邊緣偵測模組,用於偵測一第一影像中之邊緣座標;第一及第二視差估計模組,該第一及該第二視差估計模組分別用於獲得該第一影像相對於一第二影像之一第一估計視差圖及該第二影像相對於該第一影像之一第二估計視差圖;一交叉檢查模組,用於利用該第二估計視差圖交叉檢查該第一估計視差圖,以識別該第一估計視差圖中之一遮蔽像素集合;一遮蔽細化模組,其用來對該遮蔽像素集合進行細 化以產生一經細化之遮蔽像素集合;及一破洞填充模組,其用來在該第一估計視差圖填充該經細化之遮蔽像素集合,以獲得一第一細化視差圖;以及一或多處理單元,耦接至該一或多記憶體以用於控制該等程式常式之執行。 A computer system comprising: storing one or more memories containing program routines, comprising: an edge detection module for detecting edge coordinates in a first image; first and second parallax estimation modes The first and second disparity estimation modules are configured to obtain a first estimated disparity map of the first image relative to a second image and a second estimate of the second image relative to the first image. a disparity map; a cross-checking module, configured to cross-check the first estimated disparity map by using the second estimated disparity map to identify one of the masked pixel sets in the first estimated disparity map; and a mask refinement module Used to fine-tune the masked pixel set Forming a refined set of masked pixels; and a hole filling module for filling the refined masked pixel set in the first estimated disparity map to obtain a first refinement disparity map; One or more processing units coupled to the one or more memories for controlling execution of the program routines. 如申請專利範圍第9項所述之電腦系統,其中,該遮蔽細化模組係用於透過基於一細化基本區域中遮蔽像素或像素組之數目將該第一估計視差圖上之至少一在細化中的像素或像素組識別為被遮蔽,對該遮蔽像素集合進行細化,該細化基本區域分別在一第一方向及與該第一方向相反之方向上不超出含有該在細化中的像素或像素組之一位置線中最接近該在細化中的像素或像素組之邊緣座標,且分別在一第二方向上及與該第二方向相反之方向上不超出對應於含有該在細化中的像素或像素組之該位置線在該細化基本區域中之一部分之邊緣座標。 The computer system of claim 9, wherein the occlusion refinement module is configured to transmit at least one of the first estimated disparity maps based on a number of masked pixels or groups of pixels in a refinement basic region The pixels or groups of pixels in the refinement are identified as being masked, and the set of masked pixels is refined, and the refinement basic regions are respectively not included in a first direction and a direction opposite to the first direction. The edge of one of the pixel or pixel group in the position line closest to the pixel or group of pixels in the refinement, and respectively in a second direction and in a direction opposite to the second direction does not exceed The edge line of the portion of the refinement base region of the location line containing the pixel or group of pixels in the refinement. 如申請專利範圍第9項所述之電腦系統,其中,該破洞填充模組係用於基於每一遮蔽像素或像素組之至少一各別鄰近像素或像素組填充該經細化之遮蔽像素集合。 The computer system of claim 9, wherein the hole filling module is configured to fill the refined shadow pixel based on at least one adjacent pixel or pixel group of each masking pixel or pixel group. set. 如申請專利範圍第10項所述之電腦系統,其中,該細化基本區域在與該第二方向相反之方向上不超出含有該在細化中的像素或像素組之該位置線。 The computer system of claim 10, wherein the refinement basic region does not exceed the position line of the pixel or pixel group in the refinement in a direction opposite to the second direction. 如申請專利範圍第10項所述之電腦系統,其中,該細化基本區域另外在該第二方向上不超出距含有該在細化 中的像素或像素組之該位置線具一預定距離之一位置線。 The computer system of claim 10, wherein the refinement basic region additionally does not exceed the distance in the second direction The position line of the pixel or group of pixels has a position line of a predetermined distance. 如申請專利範圍第9項所述之電腦系統,其中,該破洞填充模組基於一填充基本區域中像素或像素組之視差值之統計資訊填充該經細化之遮蔽像素集合中之一受到填充的像素或像素組,該填充基本區域分別在該第一方向上及與該第一方向相反之該方向上不超出含有該受到填充的像素或像素組之一位置線中最接近該受到填充的像素或像素組之邊緣座標。 The computer system of claim 9, wherein the hole filling module fills one of the refined masked pixel sets based on a statistical information of a disparity value of pixels or groups of pixels in the filling basic region. a padded pixel or group of pixels, the padding base region being in the first direction and in the direction opposite to the first direction, respectively, not closest to the position line containing the padded pixel or pixel group The edge coordinates of the filled pixel or group of pixels. 如申請專利範圍第14項所述之電腦系統,其中,該填充基本區域另外在該第二方向上不超出距含有該受到填充的像素或像素組之該位置線具一預定距離之一位置線。 The computer system of claim 14, wherein the filling base region further does not exceed a position line at a predetermined distance from the position line containing the filled pixel or pixel group in the second direction. . 如申請專利範圍第9項所述之電腦系統,其中,該第一視差估計模組係用於透過下列步驟獲得該第一估計視差圖上之一視差值:計算及加總一參考視窗及複數個候選匹配視窗之匹配代價,該參考視窗與該第一影像中之一參考像素或像素組重疊,該複數個候選匹配視窗中之每一者與該第二影像中之一各別候選匹配像素或像素組重疊,其中,每一候選匹配像素或像素組相對於該參考像素或像素組具有一不同視差距離;以及選擇對應於該等候選匹配像素或像素組其中之一的該視差距離作為在該第一估計視差圖上該參考像素或像素 組之座標處的一視差值。 The computer system of claim 9, wherein the first disparity estimation module is configured to obtain a disparity value on the first estimated disparity map by calculating and summing a reference window and a matching cost of the plurality of candidate matching windows, wherein the reference window overlaps with one of the reference pixels or the pixel groups in the first image, and each of the plurality of candidate matching windows matches one of the candidate candidates in the second image Pixel or group of pixels overlapping, wherein each candidate matching pixel or group of pixels has a different parallax distance relative to the reference pixel or group of pixels; and selecting the disparity distance corresponding to one of the candidate matching pixels or groups of pixels as The reference pixel or pixel on the first estimated disparity map A disparity value at the coordinates of the group. 如申請專利範圍第16項所述之電腦系統,其中,該視差估計模組係進一步用於對該第一影像進行一普查轉換,其中,該第一影像之該比對線之每一經普查轉換之像素或像素組係由長度至少為1的位元向量表示。 The computer system of claim 16, wherein the disparity estimation module is further configured to perform a census conversion on the first image, wherein each of the comparison lines of the first image is converted into a census A pixel or group of pixels is represented by a bit vector having a length of at least one. 一種成像方法,包含:提供一第一及一第二影像;偵測該第一影像中之邊緣座標;獲得該第一影像相對於該第二影像之一第一估計視差圖及該第二影像相對於該第一影像之一第二估計視差圖;利用該第二估計視差圖交叉檢查該第一估計視差圖,以識別該第一估計視差圖中之一遮蔽像素集合;對該遮蔽像素集合進行細化以產生一經細化之遮蔽像素集合;及在該第一估計視差圖中填充該經細化之遮蔽像素集合,以獲得一第一細化視差圖。 An imaging method includes: providing a first image and a second image; detecting edge coordinates in the first image; obtaining a first estimated disparity map and a second image of the first image relative to the second image Second estimating the disparity map with respect to one of the first images; using the second estimated disparity map to cross-check the first estimated disparity map to identify one of the masked pixel sets in the first estimated disparity map; Performing refinement to generate a refined set of masked pixels; and filling the refined set of masked pixels in the first estimated disparity map to obtain a first refinement disparity map. 如申請專利範圍第18項所述之成像方法,其中,對該遮蔽像素集合進行細化包含基於一細化基本區域中遮蔽像素或像素組之數目將該第一估計視差圖上之一在細化中的像素或像素組識別為被遮蔽,該細化基本區域分別在一第一方向及與該第一方向相反之方向上不超出含有該在細化中的像素或像素組之一位置線中最接近該在細化中的像素或像素組之邊緣座標,且分別在一第 二方向上及與該第二方向相反之一方向上不超出對應於含有該在細化中的像素或像素組之該位置線在該細化基本區域中之一部分之邊緣座標。 The imaging method of claim 18, wherein the refining the masked pixel set comprises one of the first estimated disparity maps based on a number of masked pixels or groups of pixels in a refinement basic region The pixel or pixel group in the recognition is identified as being masked, and the refinement basic region does not exceed a position line of the pixel or the pixel group in the refinement in a first direction and a direction opposite to the first direction The edge coordinates closest to the pixel or group of pixels in the refinement, and respectively in the first The edge coordinates corresponding to one of the position lines of the pixel or pixel group in the refinement corresponding to the pixel or pixel group in the refinement are not exceeded in the direction of the second direction and the direction opposite to the second direction. 如申請專利範圍第18項所述之成像方法,其中,填充該經細化之遮蔽像素集合係基於每一遮蔽像素或像素組之至少一各別鄰近像素或像素組。 The imaging method of claim 18, wherein filling the refined masked pixel set is based on at least one respective neighboring pixel or group of pixels of each masked pixel or group of pixels. 如申請專利範圍第19項所述之成像方法,其中,該細化基本區域在與該第二方向相反之方向上不超出含有該在細化中的像素或像素組之該位置線。 The image forming method according to claim 19, wherein the refinement basic region does not exceed the position line of the pixel or the pixel group in the refinement in a direction opposite to the second direction. 如申請專利範圍第19項所述之成像方法,其中,該細化基本區域另外在該第二方向上不超出距含有該在細化中的像素或像素組之該位置線具一預定距離之一位置線。 The imaging method of claim 19, wherein the refinement basic region additionally has a predetermined distance from the position line containing the pixel or pixel group in the refinement in the second direction. A position line. 如申請專利範圍第18項所述之成像方法,其中,於填充該經細化之遮蔽像素集合之該步驟中,該經細化之遮蔽像素集合中之一受到填充的像素或像素組係基於一填充基本區域中像素或像素組之視差值之統計資訊加以填充,該基本填充區域分別在該第一方向上及與該第一方向相反之該方向上不超出含有該受到填充的像素或像素組之一位置線中最接近該受到填充的像素或像素組之邊緣座標。 The imaging method of claim 18, wherein in the step of filling the refined masked pixel set, the pixel or pixel group in which one of the refined masked pixel sets is filled is based on Filling a statistical information of a disparity value of a pixel or a group of pixels in the padding region, the basic padding region not exceeding the pixel containing the padding in the first direction and the direction opposite to the first direction The edge coordinate of the pixel or pixel group closest to the filled position in one of the pixel groups. 如申請專利範圍第23項所述之成像方法,其中,該填充基本區域另外在該第二方向上不超出距含有該受到填充的像素或像素組之該位置線具一預定距離之一位置 線。 The imaging method of claim 23, wherein the filling base region further does not exceed a position of the predetermined distance from the position line containing the filled pixel or pixel group in the second direction. line. 如申請專利範圍第18項所述之成像方法,其中,於獲得一第一估計視差圖之該步驟中,透過下列步驟獲得該第一估計視差圖上之一視差值:計算及加總一參考視窗及複數個候選匹配視窗之匹配代價,該參考視窗與該第一影像中之一參考像素或像素組重疊,該複數個候選匹配視窗中之每一者與該第二影像中之一各別候選匹配像素或像素組重疊,其中,每一候選匹配像素或像素組相對於該參考像素或像素組具有一不同視差距離;以及選擇對應於該等候選匹配像素或像素組其中之一的該視差距離作為在該第一估計視差圖上該參考像素或像素組之座標處之一視差值。 The imaging method according to claim 18, wherein in the step of obtaining a first estimated disparity map, one of the disparity values on the first estimated disparity map is obtained by the following steps: calculating and summing one Referring to the matching cost of the reference window and the plurality of candidate matching windows, the reference window overlaps with one of the reference pixels or the pixel group in the first image, and each of the plurality of candidate matching windows and one of the second images Other candidate matching pixels or groups of pixels overlapping, wherein each candidate matching pixel or group of pixels has a different parallax distance relative to the reference pixel or group of pixels; and selecting the one corresponding to one of the candidate matching pixels or groups of pixels The disparity distance is a disparity value at a coordinate of the reference pixel or the pixel group on the first estimated disparity map. 如申請專利範圍第18項所述之成像方法,其中,獲得一第一估計視差圖之該步驟進一步包含對該第一影像進行普查轉換,其中,該第一影像之每一經普查轉換之像素或像素組係由長度至少為1的位元向量表示。The imaging method of claim 18, wherein the step of obtaining a first estimated disparity map further comprises performing a census conversion on the first image, wherein each of the first images is census converted pixels or The pixel group is represented by a bit vector having a length of at least 1.
TW101123168A 2012-06-28 2012-06-28 Imaging system and method TWI485653B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW101123168A TWI485653B (en) 2012-06-28 2012-06-28 Imaging system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW101123168A TWI485653B (en) 2012-06-28 2012-06-28 Imaging system and method

Publications (2)

Publication Number Publication Date
TW201401229A TW201401229A (en) 2014-01-01
TWI485653B true TWI485653B (en) 2015-05-21

Family

ID=50345103

Family Applications (1)

Application Number Title Priority Date Filing Date
TW101123168A TWI485653B (en) 2012-06-28 2012-06-28 Imaging system and method

Country Status (1)

Country Link
TW (1) TWI485653B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115988186B (en) * 2023-03-20 2023-06-09 厦门精图信息技术有限公司 Image processing system and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050163367A1 (en) * 2000-05-04 2005-07-28 Microsoft Corporation System and method for progressive stereo matching of digital images
TW200828182A (en) * 2006-12-27 2008-07-01 Ind Tech Res Inst Method of utilizing multi-view images to solve occlusion problem for photorealistic model reconstruction
TW201035907A (en) * 2008-09-25 2010-10-01 Koninkl Philips Electronics Nv Three dimensional image data processing
TW201044315A (en) * 2009-02-17 2010-12-16 Koninkl Philips Electronics Nv Combining 3D image and graphical data
US20110205226A1 (en) * 2008-10-28 2011-08-25 Koninklijke Philips Electronics N.V. Generation of occlusion data for image properties

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050163367A1 (en) * 2000-05-04 2005-07-28 Microsoft Corporation System and method for progressive stereo matching of digital images
TW200828182A (en) * 2006-12-27 2008-07-01 Ind Tech Res Inst Method of utilizing multi-view images to solve occlusion problem for photorealistic model reconstruction
TW201035907A (en) * 2008-09-25 2010-10-01 Koninkl Philips Electronics Nv Three dimensional image data processing
US20110205226A1 (en) * 2008-10-28 2011-08-25 Koninklijke Philips Electronics N.V. Generation of occlusion data for image properties
TW201044315A (en) * 2009-02-17 2010-12-16 Koninkl Philips Electronics Nv Combining 3D image and graphical data

Also Published As

Publication number Publication date
TW201401229A (en) 2014-01-01

Similar Documents

Publication Publication Date Title
US9237326B2 (en) Imaging system and method
US9361699B2 (en) Imaging system and method
US9485495B2 (en) Autofocus for stereo images
US10321112B2 (en) Stereo matching system and method of operating thereof
US20140294289A1 (en) Image processing apparatus and image processing method
CN105335955A (en) Object detection method and object detection apparatus
JP2013058112A (en) Interpolated image generating device, reconstructed image generating device, interpolated image generating method and program
KR100745691B1 (en) Binocular or multi-view stereo matching apparatus and its method using occlusion area detection
JP5318168B2 (en) Stereoscopic image processing apparatus, stereoscopic image processing method, and program
CN109547765B (en) Image processing apparatus and image processing system
KR100943635B1 (en) Method and apparatus for generating disparity map using digital camera image
JP2011141710A (en) Device, method and program for estimating depth
TWI571099B (en) Device and method for depth estimation
CN103024419A (en) Video image processing method and system
TWI402479B (en) Depth detection method and system using thereof
TWI485653B (en) Imaging system and method
US9113142B2 (en) Method and device for providing temporally consistent disparity estimations
US20120154388A1 (en) Stereo image processing method, stereo image processing device and display device
TWI485654B (en) Imaging system and method
US10430971B2 (en) Parallax calculating apparatus
JP5887974B2 (en) Similar image region search device, similar image region search method, and similar image region search program
KR101804157B1 (en) Disparity map generating method based on enhanced semi global matching
JPH10289315A (en) Parallax calculation device and method, and distance calculation device and method
KR101607504B1 (en) Stereo Matching Method using Summed Area Table Scheme
TWI698836B (en) Stereo matching method with double search interval