TWI766434B - Image stitching apparatus, image processing chip and image stitching method - Google Patents
Image stitching apparatus, image processing chip and image stitching method Download PDFInfo
- Publication number
- TWI766434B TWI766434B TW109139553A TW109139553A TWI766434B TW I766434 B TWI766434 B TW I766434B TW 109139553 A TW109139553 A TW 109139553A TW 109139553 A TW109139553 A TW 109139553A TW I766434 B TWI766434 B TW I766434B
- Authority
- TW
- Taiwan
- Prior art keywords
- image
- splicing
- area
- line
- overlapping area
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 20
- 238000001514 detection method Methods 0.000 claims abstract description 53
- 238000004364 calculation method Methods 0.000 claims description 83
- 239000011159 matrix material Substances 0.000 claims description 64
- 238000009825 accumulation Methods 0.000 claims description 47
- 238000006073 displacement reaction Methods 0.000 claims description 21
- 238000003708 edge detection Methods 0.000 claims description 13
- 238000010586 diagram Methods 0.000 description 32
- 230000001186 cumulative effect Effects 0.000 description 6
- 230000004927 fusion Effects 0.000 description 2
- 238000007500 overflow downdraw method Methods 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Images
Landscapes
- Image Analysis (AREA)
Abstract
Description
本發明是關於影像處理技術,尤其是關於一種影像拼接裝置、影像處理晶片及影像拼接方法。The present invention relates to image processing technology, in particular to an image splicing device, an image processing chip and an image splicing method.
影像拼接是指將兩張或者兩張以上的影像融合為一張影像,使得融合後的影像包含更多的資訊,能夠更方便的供使用者查看或者供電腦處理等。影像拼接是影像處理技術領域一個重要的研究方向,有著廣泛的應用價值。然而,相關技術中在進行影像拼接時,僅關注於待拼接影像間的視覺差異,導致最終得到拼接影像的品質不高。Image stitching refers to the fusion of two or more images into one image, so that the fused image contains more information and can be more conveniently viewed by users or processed by computers. Image stitching is an important research direction in the field of image processing technology and has a wide range of application values. However, in the related art, when performing image splicing, only the visual difference between the images to be spliced is concerned, resulting in low quality of the spliced images finally obtained.
鑑於先前技術的問題,本發明之一目的在於提供一種影像拼接裝置、影像處理晶片及影像拼接方法,以改善先前技術。In view of the problems of the prior art, one object of the present invention is to provide an image splicing device, an image processing chip and an image splicing method to improve the prior art.
本發明包含一種影像拼接裝置,包含一移動偵測單元、一確定單元以及一拼接單元。移動偵測單元對需要拼接的一第一影像和一第二影像的重疊區域進行移動偵測,得到重疊區域中存在移動物體的一移動區域。確定單元以避開該移動區域為約束條件,計算一目標拼接線。拼接單元根據目標拼接線拼接第一影像以及第二影像,得到一拼接影像。The invention includes an image splicing device, which includes a motion detection unit, a determination unit and a splicing unit. The motion detection unit performs motion detection on the overlapping area of a first image and a second image to be spliced to obtain a moving area in which a moving object exists in the overlapping area. The determining unit calculates a target splicing line with avoiding the moving area as a constraint. The splicing unit splices the first image and the second image according to the target splicing line to obtain a spliced image.
本發明另包含一種影像處理晶片,包含一介面單元、一區域確定單元以及一影像拼接裝置。介面單元獲取需要進行影像拼接一第一影像及一第二影像。區域確定單元確述第一影像與第二影像間的一重疊區域。影像拼接裝置包含一移動偵測單元、一確定單元以及一拼接單元。移動偵測單元對需要拼接的一第一影像和一第二影像的重疊區域進行移動偵測,得到重疊區域中存在移動物體的一移動區域。確定單元以避開該移動區域為約束條件,計算一目標拼接線。拼接單元根據目標拼接線拼接第一影像以及第二影像,得到一拼接影像。The present invention further includes an image processing chip, which includes an interface unit, an area determination unit and an image splicing device. The interface unit acquires a first image and a second image that need to be stitched. The area determination unit determines an overlapping area between the first image and the second image. The image splicing device includes a motion detection unit, a determination unit and a splicing unit. The motion detection unit performs motion detection on the overlapping area of a first image and a second image to be spliced to obtain a moving area in which a moving object exists in the overlapping area. The determining unit calculates a target splicing line with avoiding the moving area as a constraint. The splicing unit splices the first image and the second image according to the target splicing line to obtain a spliced image.
本發明還包含一種影像拼接方法,包含:對一第一影像和一第二影像間的重疊區域進行移動偵測,得到該重疊區域中存在移動物體的一移動區域;以避開該移動區域為約束條件,計算一目標拼接線;以及,根據該目標拼接線拼接該第一影像以及該第二影像,得到一拼接影像。The present invention also includes an image splicing method, comprising: performing motion detection on an overlapping area between a first image and a second image to obtain a moving area in which a moving object exists in the overlapping area; avoiding the moving area as Constraints, calculating a target splicing line; and splicing the first image and the second image according to the target splicing line to obtain a spliced image.
有關本案的特徵、實作與功效,茲配合圖式作較佳實施例詳細說明如下。Regarding the features, implementation and effects of this case, a preferred embodiment is described in detail as follows in conjunction with the drawings.
應當說明的是,本發明的原理是以實施在一適當的應用環境中來舉例說明。以下的說明是通過所例示的本發明具體實施例,其不應被視為限制本發明未在此詳述的其他具體實施例。It should be noted that the principles of the present invention are exemplified by implementation in an appropriate application environment. The following description is by way of illustrative embodiments of the invention and should not be construed as limiting other embodiments of the invention not detailed herein.
本發明實施例提供的技術是關於影像處理技術領域,具體相關於影像的拼接,透過下文中的實施例進行說明。請參照圖1。圖1顯示本發明一實施例中,影像拼接裝置100的第一種方塊示意圖。影像拼接裝置100可包含相互連接的移動偵測單元110、確定單元120及拼接單元130。實施上,移動偵測單元110、確定單元120以及拼接單元130可藉由硬體電路搭配軟體來實現。The technology provided by the embodiments of the present invention relates to the technical field of image processing, specifically related to image splicing, which will be described through the following embodiments. Please refer to Figure 1. FIG. 1 shows a first block schematic diagram of an
請參照圖2。圖2顯示本發明一實施例中,圖1中的運動偵測單元110對第一影像和第二影像的重疊區域進行運動偵測得到運動區域的示例圖。移動偵測單元110被配置為對需要拼接的第一影像和第二影像之間的重疊區域進行移動偵測,從而得到第一影像和第二影像的重疊區域中具有移動物體的移動區域,此處的移動物體可為任意具有移動的物體,包含但不限於人、物等。此處不對移動偵測單元110的移動偵測方式進行具體限制,可由本領域普通技術人員根據實際需要進行配置。Please refer to Figure 2. FIG. 2 shows an example diagram of the
此外,本發明實施例中,對於以上第一影像和第二影像的來源不作具體限制,比如,第一影像和第二影像可為同一攝影機在水平旋轉過程中的不同角度所拍攝的視野區域部分重疊的兩張影像,或是,第一影像和第二影像可為視野區域部分重疊的兩個攝影機所分別拍攝的兩張影像等。In addition, in this embodiment of the present invention, there is no specific limitation on the sources of the first image and the second image. For example, the first image and the second image may be part of the field of view captured by the same camera at different angles during the horizontal rotation process. The two overlapping images, or, the first image and the second image may be two images respectively shot by two cameras with partially overlapping visual fields.
請參照圖3。圖3顯示本發明一實施例中,圖1中的確定單元120計算得到的目標拼接線的示例圖。確定單元120被配置為以避開移動區域為約束條件,計算用於拼接第一影像和第二影像的一拼接線,記為目標拼接線。如圖3所示,確定單元120所計算得到的目標拼接線避開了移動區域,也即是目標拼接線並不穿過移動區域。此處不對確定單元120計算目標拼接線的方式進行具體限制,可由本領域普通技術人員根據實際需要進行配置。Please refer to Figure 3. FIG. 3 shows an example diagram of a target splice line calculated by the determining
請參照圖4。圖4顯示本發明一實施例中,圖1中的拼接單元130根據圖3所示的目標拼接線拼接第一影像和第二影像得到拼接影像的示例圖。拼接單元130被配置為根據目標拼接線拼接第一影像以及第二影像,得到一拼接影像。如圖4所示,第一影像和第二影像所拼接得到的拼接影像包含第一影像和第二影像的影像內容,其中拼接影像中拼接線左側的影像內容來自於第一影像,拼接線右側的影像內容來自於第二影像。Please refer to Figure 4. FIG. 4 shows an exemplary diagram in which the
請參照圖5。圖5顯示本發明一實施例中,影像拼接裝置100的第二方塊示意圖。在一實施例中,影像拼接裝置100還包含一差異計算單元140,其被配置為針對重疊區域計算得到第一影像和第二影像之間的至少一差異矩陣。得到差異矩陣後,確定單元120還被配置為根據差異矩陣,以最小化拼接線兩側差異且避開移動區域為約束條件計算目標拼接線。Please refer to Figure 5. FIG. 5 shows a second block diagram of the
應當說明的是,差異計算單元140所計算的差異矩陣用於描述第一影像和第二影像的重疊區域中各個位置的差異,可以是像素點之間的差異,也可以是多個像素點構成的像素區塊之間的差異。差異計算單元140計算第一影像和第二影像之間的差異可為色彩差異、灰階值差異、邊緣差異中的一種或者多種。比如,差異計算單元140被配置為計算像素點之間的色彩差異,差異計算單元140將針對第一影像和第二影像的重疊區域計算得到第一影像和第二影像之間的色彩差異矩陣,該色彩差異矩陣用於描述第一影像和第二影像的重疊區域中相同位置的兩個像素點之間的色彩差異。It should be noted that the difference matrix calculated by the
如上,在差異計算單元140計算得到前述差異矩陣,移動偵測單元110偵測到前述移動區域之後,確定單元130即根據前述差異矩陣,以最小化拼接線兩側差異且避開前述移動區域為約束條件,計算得到前述目標拼接線。由此,當拼接單元130採用該目標拼接線拼接第一影像和第二影像時,得到的拼接影像在目標拼接線左右兩側的影像內容的差異最小,且目標拼接線不會穿過移動物體,能夠進一步提高影像的拼接品質。As above, after the
在一實施例中,差異計算單元140被配置為按照多種不同的差異計算方式,針對重疊區域計算得到第一影像和第二影像之間不同類型的多個差異矩陣。In one embodiment, the
請參照圖6。圖6顯示本發明一實施例中,圖5中的差異計算單元140更詳細的方塊示意圖。在一實施例中,差異計算單元140包含色彩差異計算電路1402、邊緣偵測器1404及邊緣差異計算電路1406。色彩差異計算電路1402針對重疊區域,計算第一影像和第二影像中每一組相同位置像素點之間的色彩差異,從而得到一描述第一影像和第二影像的重疊區域中相同位置像素點之間色彩差異的色彩差異矩陣。或者,通過對色彩差異計算電路1402進行配置,使得色彩差異計算電路1402按照一分塊方式,將第一影像和第二影像的重疊區域劃分為多個像素區塊(每一像素區塊包含多個像素點),並計算第一影像和第二影像中重疊區域相同位置像素區塊(對於一像素區塊,融合該像素區塊內所有像素點的色彩值得到一融合色彩值,用於色彩差異的計算,如針對每一色彩通道,分別計算所有像素點的平均色彩值)的色彩差異,從而得到一描述第一影像和第二影像的重疊區域中相同位置像素區塊之間色彩差異的色彩差異矩陣。Please refer to Figure 6. FIG. 6 shows a more detailed block diagram of the
比如,請參照圖7。圖7顯示本發明之一實施例中,圖6中的色彩差異計算電路1402計算得到色彩差異矩陣的示例圖。第一影像和第二影像的重疊區域分別為第一影像右側區域和第二影像左側區域。在進行色彩方面的差異計算時,色彩差異計算電路1402按照相同的分塊方式,將第一影像右側區域和第二影像左側區域均劃分為4x4共16個像素區塊。然後,色彩差異計算電路1402對第一影像右側區域和第二影像左側區域相同位置的每一組像素區塊進行色彩差異的計算。例如,對於第一影像右側區域左上頂點的像素區塊和第二影像左側區域左上頂點的像素區塊為相同位置的一組像素區塊。假設第一影像右側區域左上頂點像素區塊紅色通道、綠色通道、藍色通道的像素值分別為56、255、251,第二影像左側區域左上頂點像素區塊紅色通道、綠色通道、藍色通道的像素值分別為52、253、250,色彩差異計算電路1402分別計算前組像素區塊分別在紅色通道、綠色通道以及藍色通道的之間的差值絕對值,得到結果為4、2、1,取其中最大值4作為前組像素區塊的差異值。For example, please refer to Figure 7. FIG. 7 shows an example diagram of a color difference matrix obtained by the color
按照以上計算方式,色彩差異計算電路1402將計算得到第一影像和第二影像重疊區域中其他相同位置像素區塊之間的色彩方面的差異值,從而由這些對應不同像素區塊組的差異值構成圖7所示的色彩差異矩陣。According to the above calculation method, the color
邊緣偵測器1404分別針對第一影像和和第二影像的重疊區域進行邊緣偵測,以分別產生第一邊緣偵測結果以及第二邊緣偵測結果,實施上,邊緣偵測器1404可藉由分析影像中各像素與其週邊像素的像素值變化或相對關係來偵測影像中物件的邊緣。The
邊緣差異計算電路1406可被配置為根據第一邊緣偵測結果以及第二邊緣偵測結果,計算第一影像和第二影像中重疊區域每一組相同位置像素點或像素區塊之間的邊緣差異,從而得到一描述第一影像和第二影像的重疊區域中相同位置像素點或像素區塊之間邊緣差異的邊緣差異矩陣。當以像素區塊為計算的基礎時,一像素區塊為融合該像素區塊內所有像素點的邊緣值得到的一融合邊緣值,例如像素區塊內所有像素點的平均邊緣值。The edge
比如,請參照圖8。圖8顯示本發明之一實施例中,圖6中的邊緣偵測器1404進行邊緣偵測,並由圖6中的邊緣差異計算電路1406計算得到邊緣差異矩陣的示例圖。第一影像和第二影像的重疊區域分別為第一影像右側區域和第二影像左側區域。在進行邊緣方面的差異計算時,邊緣差異計算電路1406按照相同的分塊方式,將第一影像右側區域和第二影像左側區域均劃分為4x4共16個像素區塊。然後,邊緣差異計算電路1406對第一影像右側區域和第二影像左側區域相同位置的每一組像素區塊進行邊緣差異的計算。例如,對於第一影像右側區域左上頂點的像素區塊和第二影像左側區域左上頂點的像素區塊為相同位置的一組像素區塊,計算得到的差異值為2。For example, please refer to Figure 8. FIG. 8 shows an example diagram of edge detection performed by the
按照以上計算方式,邊緣差異計算電路1406將計算得到第一影像和第二影像重疊區域中其他相同位置像素區塊之間的邊緣方面的差異值,從而由這些對應不同像素區塊組的差異值構成圖8所示的邊緣差異矩陣,用於描述第一影像和第二影像的重疊區域中每一相同位置像素區塊之間邊緣差異的邊緣差異矩陣。According to the above calculation method, the edge
本發明實施例中,通過對色彩差異計算電路1402和邊緣差異計算電路1406進行配置,使得色彩差異計算電路1402所計算得到的色彩差異矩陣與邊緣差異計算電路1406所技術得到的邊緣差異矩陣形狀相同。比如,通過配置色彩差異計算電路1402和邊緣差異計算電路1406均以像素點為差異計算對象,或者均以像素區塊(按照相同的分塊方式進行像素區塊的劃分)為差異計算對象,以使得二者所計算得到的邊緣差異矩陣和色彩差異矩陣的形狀相同。In the embodiment of the present invention, by configuring the color
請參照圖9。圖9顯示本發明之一實施例中,圖5中的確定單元120的方塊示意圖。確定單元120由兩部分構成,分別為資料處理電路1202和拼接線計算電路1204。為了能夠有效的利用所計算得到的第一影像和第二影像之間重疊區域在不同方面的差異,資料處理電路1202首先將色彩差異矩陣和邊緣差異矩陣進行融合,將融合得到的攜帶了色彩差異和邊緣差異的融合差異矩陣作為一用於計算拼接線的成本圖。此外,為了使得計算得到的目標拼接線能夠避開移動區域,資料處理電路1202進一步根據之前偵測到的移動區域,為成本圖對應位置的元素增加懲罰成本,以抑制拼接線經過重疊區域中移動區域的機率。也就是說,資料處理電路1202進一步根據移動區域對成本圖進行修正,而得到修正後的成本圖。其中,對於色彩差異矩陣和邊緣差異矩陣的融合方式,以及懲罰成本的具體取值,此處不作具體限定,可由本領域普通技術人員根據實際需要進行配置。可以理解的是,懲罰成本取值越大,計算的拼接線避開移動區域的機率越大。Please refer to Figure 9. FIG. 9 shows a block diagram of the determining
比如,可以配置色彩差異矩陣和邊緣差異矩陣的融合方式為對應位置元素直接相加,以及配置懲罰成本取值為6。請參照圖10。圖10顯示本發明之一實施例中,圖9中的資料處理電路1202計算得到成本圖的示例圖。假設移動區域為重疊區域右下角的兩像素區塊區域,資料處理電路1202將根據該移動區域生成一移動矩陣,移動矩陣中值為0的元素表示其在重疊區域中對應位置的像素區塊不為移動區域,而值為懲罰成本6的元素表示其在重疊區域中對應位置的像素區塊為移動區域。如圖10所示,資料處理電路1202將色彩差異矩陣和邊緣差異矩陣對應位置上的元素直接相加,得到一成本圖,然後將成本圖與移動矩陣對應位置上的元素直接相加,為成本圖增加懲罰成本,最終得到修正後的成本圖。For example, the fusion method of the color difference matrix and the edge difference matrix can be configured to directly add the corresponding position elements, and the penalty cost can be configured to be 6. Please refer to Figure 10. FIG. 10 shows an example diagram of a cost map calculated by the
在一實施例中,資料處理電路1202被配置為將色彩差異矩陣和邊緣差異矩陣對應位置上的元素加權相加,得到成本圖。例如,以色彩差異矩陣和邊緣差異矩陣的權重之和為1作為約束,並由本領域普通技術人員根據實際需要為色彩差異矩陣和邊緣差異矩陣分配權重。可以理解是,若分配色彩差異矩陣的權重較大,則第一影像和第二影像之間重疊區域的色彩差異將更多地影響目標拼接線的計算,同理,若分配邊緣差異矩陣的權重較大,則第一影像和第二影像之間重疊區域的邊緣差異將更多地影響目標拼接線的計算。In one embodiment, the
得到成本圖之後,拼接線計算電路1204可利用最小成本法根據成本圖計算得到一最小成本拼接線,並將該最小成本拼接線作為用於拼接第一影像和第二影像的目標拼接線。After obtaining the cost map, the splicing
在一實施例中,拼接線計算電路1204延著一累加方向以最小化累加值為約束條件對成本圖的多個元素與其鄰排的相鄰元素中的一元素進行累加,以得到目標拼接線。In one embodiment, the splice
比如,請參照圖11。圖11顯示本發明之一實施例中,圖9中的拼接線計算電路1204計算目標拼接線的示例圖。其為計算目標拼接線的示例圖。拼接線計算電路1204首先根據第一影像和第二影像的重疊區域確定進行成本累加的一累加方向,假設第一影像和第二影像左右重疊,則拼接線計算電路1204可以選擇由上至下的方向為累加方向,也可以選擇由下至上的方向為累加方向,此處選擇由上至下的方向為累加方向進行示例說明。For example, please refer to Figure 11. FIG. 11 shows an exemplary diagram of calculating the target splice line by the splice
在確定累加方向之後,拼接線計算電路1204根據累加方向在成本圖中確定一起始排元素和一結束排元素。請繼續參照圖11,按照前述累加方向,修正成本圖的橫排「6,1,0,1」為首個橫排,不存在累加對象,相應將橫排「6,1,0,1」作為成本累加圖的初始橫排,將橫排「1,6,6,1」設為起始排元素,將橫排「1,7,8,9」設為結束排元素。也即將累加方向上第二排元素設為起始排元素,將累加方向上的最後一排元素設為結束排元素。After the accumulation direction is determined, the splice
在確定起始排元素和結束排元素轉換之後,對於起始排元素中的每一元素,拼接線計算電路1204在與累加方向相反方向的一鄰排元素中,以最小化累加成本(也即最小化累加值)為約束選擇一目標元素進行成本累加。其中,對於累加的一排元素,除了兩端的兩個元素在累加方向相反方向的一鄰排元素中兩個鄰近元素中搜索目標元素之之外,其他元素在累加方向相反方向的一鄰排元素中三個鄰近元素中搜索目標元素。請繼續參照圖11,對於起始排元素左端的「1」,在累加方向相反方向的一鄰排元素「6,1,0,1」中兩個鄰近元素「6,1」中搜索目標元素,此時選擇「1」作為目標元素進行累加,得到累加成本「2」,以及對應的累加路徑「1」-「2」(如圖11中實線箭頭所示);而對於起始排元素中「6」(此處為由左至右的第一個「6」),在累加方向相反方向的一鄰排元素「6,1,0,1」中三個鄰近元素「6,1,0」中搜索目標元素,此時選擇「0」作為目標元素進行累加,得到累加成本「6」,以及對應的累加路徑「0」-「6」;以此類推,完成對起始排元素的成本累加,對應的累加成本為「2,6,6,1」。After determining the starting row element and ending row element transition, for each element in the starting row element, the splice
以此類推,拼接線計算電路1204繼續對起始排元素在累加方向的鄰排元素(即成本圖中由上至下第三排元素)進行成本累加,得到對應的累加成本如圖11中成本累加圖中由上至下的第三排元素所示,為「3,2,1,2」。如此,直至累加至結束排元素(即成本圖中由上至下第四排元素)。By analogy, the splicing
最終,得到成本累加圖同樣4橫排以及4縱排共16個元素,其中按照由上至下的順序分別為「6,1,0,1」、「2,6,6,1」、「3,2,1,2」以及「3,8,9,10」。相應的,拼接線計算電路1204根據累加成本最小的累加路徑(此時為「1」-「2」-「2」-「3」)生成最小成本拼接線,如圖11所示。Finally, the cost accumulation graph is also obtained with 4 horizontal rows and 4 vertical rows, a total of 16 elements, which are "6, 1, 0, 1", "2, 6, 6, 1", " 3, 2, 1, 2" and "3, 8, 9, 10". Correspondingly, the splice
在另一實施例中,拼接線計算電路1204延著一累加方向以最小化累加值為約束條件對成本圖的多個元素與其同排及鄰排的相鄰元素中的一元素進行累加,以得到該目標拼接線。與前面實施例不同的是在這實施例中拼接線計算電路1204在選擇一目標元素進行成本累加的過程中,是自同排及鄰排的相鄰元素中進行選擇,並非僅自鄰排的相鄰元素中選擇。In another embodiment, the splice
請參照圖12。圖12顯示本發明之一實施例中,圖9中的拼接線計算電路1204計算目標拼接線的另一示例圖。其為此實施例計算目標拼接線的示例圖。此實施例選擇由上至下的方向為累加方向進行示例說明。如同前面的實施例,將橫排「1,6,6,1」設為起始排元素,將橫排「1,7,8,9」設為結束排元素。Please refer to Figure 12. FIG. 12 shows another exemplary diagram of calculating the target splice line by the splice
請繼續參照圖12,對於起始排元素左端的「1」,在累加方向相反方向的一鄰排元素「6,1,0,1」中兩個鄰近元素「6,1」中搜索目標元素,此時選擇「1」作為目標元素進行累加,得到累加成本「2」,以及對應的累加路徑「1」-「2」(如圖12中實線箭頭所示);然後,拼接線計算電路1204進一步按照累加方向的一第一垂直方向進行累加成本的更新,即針對同排的鄰近元素進行累加成本的更新。此處以由左至右的方向為第一垂直方向進行示例說明。此時「1」並不存在左側相鄰的元素,不對其累加成本進行更新,保留累加成本「2」。Please continue to refer to Figure 12, for the "1" at the left end of the initial row element, search for the target element in the two adjacent elements "6, 1" in the adjacent row elements "6, 1, 0, 1" in the opposite direction of the accumulation direction , at this time, select "1" as the target element for accumulation, and obtain the accumulated cost "2" and the corresponding accumulation path "1"-"2" (as shown by the solid arrow in Figure 12); then, the splicing
而對於起始排元素中左側的「6」(此處為由左至右的第一個「6」),在累加方向相反方向的一鄰排元素「6,1,0,1」中三個鄰近元素「6,1,0」中搜索目標元素,此時選擇「0」作為目標元素進行累加,得到累加成本「6」,以及對應的累加路徑「0」-「6」;然後,拼接線計算電路1204進一步按照累加方向的一第一垂直方向(此時為由左至右的方向)進行累加成本的更新。此時「6」的左側相鄰元素為「1」,拼接線計算電路1204判斷「6」對應的累加成本是否大於「1」對應的累加成本與「6」的成本之和,是則將「6」對應的累加成本替換為「1」對應的累加成本與「6」的成本之和。如圖12所示,「6」對應的累加成本為6,小於「1」對應的累加成本(2)與「6」的成本(6)之和(8),不對「6」對應的累加成本進行替換。For the "6" on the left side of the initial row of elements (here, the first "6" from left to right), three elements in the adjacent row of elements "6, 1, 0, 1" in the opposite direction of accumulation Search for the target element in the adjacent elements "6, 1, 0". At this time, select "0" as the target element for accumulation to obtain the accumulated cost "6" and the corresponding accumulated path "0"-"6"; then, splicing The
以此類推,在第一垂直方向完成對所有元素的更新後,起始排元素對應的累加成本為「2,6,6,1」,此時,拼接線計算電路1204按照與第一垂直方向相反的一第二垂直方向(此時為由右至左的方向),根據每一元素在第二垂直方向的反向相鄰元素對每一元素的累加成本再次進行更新。對於起始排元素右端的「1」,此時「1」並不存在右側相鄰的元素,不對其累加成本進行更新,保留累加成本「1」。而對於起始排元素中右側的「6」(此處為由左至右的第二個「6」)。此時「6」的右側相鄰元素為「1」,拼接線計算電路1204判斷「6」對應的累加成本是否大於「1」對應的累加成本與「6」的成本之和,是則將「6」對應的累加成本替換為「1」對應的累加成本與「6」的成本之和。如圖12所示,「6」對應的累加成本為6,小於「1」對應的累加成本與「6」的成本之和7,不對「6」對應的累加成本進行替換。以此類推,在第二垂直方向完成對起始排元素累加成本的再次更新,最終得到起始排元素對應的累加成本仍然為「2,6,6,1」。By analogy, after the update of all elements in the first vertical direction is completed, the accumulated cost corresponding to the first row of elements is "2, 6, 6, 1". At this time, the splicing
如上,拼接線計算電路1204繼續對起始排元素在累加方向的鄰排元素(即成本圖中由上至下第三排元素「1,0,0,1」)進行成本累加,並在第一垂直方向和第二垂直方向針對同排的鄰近元素進行更新。如此,直至累加至結束排元素(即成本圖中由上至下第四排元素)。最終,得到成本累加圖同樣4橫排以及4縱排共16個元素,其中按照由上至下的順序分別為「6,1,0,1」、「2,6,6,1」、「2,1,1,2」以及「2,8,9,10」。相應的,拼接線計算電路1204根據累加成本最小的累加路徑(此時為「0」-「1」-「1」-「1」-「1」-「2」)生成最小成本拼接線,如圖12所示。As above, the splice
請參照圖13。圖13顯示本發明之一實施例中,影像拼接裝置100的第三方塊示意圖。在一實施例中,影像拼接裝置100還包含一位移限制單元150,用於獲取拼接線計算電路1204之前計算得到的一先前拼接線,並根據先前拼接線產生一位移限制資料。確定單元120再以避開該移動區域為約束條件,根據前述的至少一差異矩陣及位移限制資料計算目標拼接線。藉由考慮先前拼接線相關的位移限制資料,以避免當下畫面所計算的目標拼接線與前一畫面的先前拼接線差距過大,而影響畫面的連續性。Please refer to Figure 13. FIG. 13 shows a schematic diagram of a third block of the
詳細來說,位移限制單元150可針對成本圖中各元素與先前拼接線的距離而確定移動成本,比如,以距離越大,確定的位移成本越大為約束,進而產生對應的位移限制資料。而確定單元120中的資料處理電路1202再根據位移限制資料對成本圖進行修正。In detail, the
比如,存在視野區域部分重疊的第一攝影機和第二攝影機,且第一攝影機和第二攝影機均處於攝影模式,連續地進行影像擷取。在第一攝影機和第二攝影機開始擷取的起始時刻t0,將第一攝影機在t0時刻擷取的影像作為第一影像,將的第二攝影機在t0時刻擷取的影像作為第二影像,由於此時並不存在先前第一影像和先前第二影像,拼接線計算電路1204在資料處理電路1202融合得到成本圖之後,即根據該成本圖計算一最小成本拼接線,作為用於拼接t0時刻的第一影像和第二影像的目標拼接線。在t0時刻的下一時刻t1,將第一攝影機在t1時刻擷取的影像作為第一影像,將的第二攝影機在t1時刻擷取的影像作為第二影像,此時的先前第一影像即第一攝影機在t0時刻擷取的影像,先前第二影像即第二攝影機在t0時刻擷取的影像,相應的,先前拼接線即拼接線計算電路1204根據先前第一影像和先前第二影像所計算的拼接線。位移限制單元150根據先前拼接線產生對應的位移限制資料。資料處理電路1202可綜合考慮色彩差異矩陣、邊緣差異矩陣、移動矩陣及位移限制資料來產生最後的成本圖。比如,資料處理電路1202可在如圖10所示根據色彩差異矩陣、邊緣差異矩陣、移動矩陣得到一成本圖後,再根據位移限制資料來修正成本圖,其修正方式可為將成本圖中各元素的成本值與位移限制資料中各元素對應的移動成本進行相加。相應的,拼接線計算電路1204再根據修正後的成本圖計算得到目標拼接線。For example, there are a first camera and a second camera with partially overlapping fields of view, and both the first camera and the second camera are in a shooting mode, and images are continuously captured. At the start time t0 when the first camera and the second camera start capturing, the image captured by the first camera at time t0 is taken as the first image, and the image captured by the second camera at time t0 is taken as the second image, Since the previous first image and the previous second image do not exist at this time, after the
在一實施例中,移動偵測單元110被配置為針對重疊區域對第一影像進行移動偵測,得到一第一候選移動區域,針對重疊區域對第二影像進行移動偵測,得到一第二候選移動區域,及融合第一候選移動區域和第二候選移動區域得到移動區域。In one embodiment, the
應當說明的是,對於移動偵測單元110採用何種移動偵測方式,可由本領域普通技術人員根據實際需要進行配置,此處不作具體限制。It should be noted that the motion detection method adopted by the
比如,請參照圖14。圖14顯示本發明之一實施例中,圖1中的運動偵測單元110偵測得到運動區域的示意圖。第一影像和第二影像的重疊區域分別為第一影像右側區域和第二影像左側區域。其中,按照相同的劃分方式將第一影像右側區域和第二影像左側區域均劃分為4x4共16個像素區塊。對於第一影像,移動偵測單元110偵測到的第一候選移動區域為圖14所示2個像素區塊所構成,對於第二影像,移動偵測單元110偵測到的第二候選移動區域為圖14所示2個像素區塊所構成。相應的,移動偵測單元110對第一候選移動區域和第二候選移動區域進行融合,得到圖14所示3個像素區塊所構成的移動區域。For example, see Figure 14. FIG. 14 shows a schematic diagram of a motion area detected by the
在一實施例中,移動偵測單元110被配置為獲取與第一影像視野區域相同的先前第一影像,並針對重疊區域計算第一影像和先前第一影像的像素灰階值差異,以及根據像素灰階值差異偵測出第一候選移動區域。In one embodiment, the
比如,存在視野區域部分重疊的第一攝影機和第二攝影機,且第一攝影機和第二攝影機均處於攝影模式,連續地進行影像擷取。在第一攝影機和第二攝影機開始擷取的起始時刻t0,將第一攝影機在t0時刻擷取的影像作為第一影像,將的第二攝影機在t0時刻擷取的影像作為第二影像,由於此時並不存在先前第一影像和先前第二影像,不進行移動區域的偵測。For example, there are a first camera and a second camera with partially overlapping fields of view, and both the first camera and the second camera are in a shooting mode, and images are continuously captured. At the start time t0 when the first camera and the second camera start capturing, the image captured by the first camera at time t0 is taken as the first image, and the image captured by the second camera at time t0 is taken as the second image, Since the previous first image and the previous second image do not exist at this time, the detection of the moving area is not performed.
在t0時刻的下一時刻t1,將第一攝影機在t1時刻擷取的影像作為第一影像,將的第二攝影機在t1時刻擷取的影像作為第二影像,此時的先前第一影像即第一攝影機在t0時刻擷取的影像,先前第二影像即第二攝影機在t0時刻擷取的影像。相應的,移動偵測單元110針對重疊區域計算第一影像和先前第一影像的像素灰階值差異,以及根據像素灰階值差異偵測出第一候選移動區域。At the next time t1 at time t0, the image captured by the first camera at time t1 is used as the first image, and the image captured by the second camera at time t1 is used as the second image. The previous first image at this time is The image captured by the first camera at time t0, the previous second image is the image captured by the second camera at time t0. Correspondingly, the
以此類推,在t1時刻之後的時刻,移動偵測單元110將按照如上方式進行移動偵測。By analogy, at a time after time t1, the
在一實施例中,移動偵測單元110被配置為將重疊區域劃分為多個子塊,並融合每一子塊內的像素灰階值差異得到一融合灰階值差異,以及根據融合灰階值差異大於預設閾值的子塊生成第一候選移動區域。其中,對於預設閾值的具體取值,可由本領域普通技術人員根據實際需要進行配置,此處不作具體限定。In one embodiment, the
作為一可選的實施方式,移動偵測單元110被配置計算每一子塊內的像素灰階值差異的平均灰階值差異,並將每一子塊的平均灰階值差異作為每一子塊的融合灰階值差異。As an optional embodiment, the
應當說明的是,對於移動偵測單元110對第二影像的移動偵測方式,可以參照移動偵測單元110對第一影像的移動偵測方式相應實施,此處不再贅述。It should be noted that the motion detection method of the
請參照圖15。圖15顯示本發明之一實施例中,影像處理晶片10的方塊示意圖。本發明還提供一種影像處理晶片10,其包含介面單元200、區域確定單元300及影像拼接裝置100。介面單元200用於獲取需要進行影像拼接一第一影像,及一第二影像。區域確定單元300用於確定第一影像與第二影像的一重疊區域。影像拼接裝置100用於根據重疊區域拼接第一影像以及第二影像得到一拼接影像。Please refer to Figure 15. FIG. 15 shows a block diagram of the
舉例來說,介面單元200可以為移動產業處理器介面(Mobile Industry Processor Interface;MIPI)。介面單元200可以接收影像資料,比如介面單元200可以接收來同一攝影機在水平旋轉過程中的不同角度所拍攝的視野區域部分重疊的兩張影像,也可以接收視野區域部分重疊的兩個攝影機所分別拍攝的兩張影像。介面單元200接收到影像資料後,可以將該影像資料傳輸到區域確定單元300進行重疊區域的識別。For example, the
比如,介面單元200接收到同一攝影機在旋轉過程中的不同角度所拍攝的視野區域部分重疊的第一影像和第二影像,並將第一影像及第二影像傳輸至區域確定單元300。相應的,區域確定單元300對第一影像和第二影像的重疊區域進行識別。此外,影像拼接裝置100可以為本發明以上任一實施例所提供的影像拼接裝置100。For example, the
在一實施例中,介面單元200從一第一監控攝影機獲取第一影像,及從一第二監控攝影機獲取第二影像。In one embodiment, the
本發明還提供一種影像拼接方法,請參照圖16。圖16顯示本發明之一實施例中,影像拼接方法的流程示意圖。該影像拼接方法的流程說明如下。The present invention also provides an image splicing method, please refer to FIG. 16 . FIG. 16 shows a schematic flowchart of an image stitching method according to an embodiment of the present invention. The flow of the image stitching method is described as follows.
在步驟510中,對需要拼接的一第一影像和一第二影像的重疊區域進行移動偵測,得到重疊區域中存在移動物體的一移動區域。In
在步驟520中,以避開移動區域為約束條件,計算一目標拼接線。In
在步驟530中,根據目標拼接線拼接第一影像以及第二影像,得到一拼接影像。In
在一實施例中,本發明提供的影像拼接方法還包含針對重疊區域計算得到第一影像和第二影像之間的至少一差異矩陣。之後,再根據差異矩陣,以最小化拼接線兩側差異且避開移動區域為約束條件計算目標拼接線。In one embodiment, the image stitching method provided by the present invention further includes calculating at least one difference matrix between the first image and the second image for the overlapping area. Then, according to the difference matrix, the target splicing line is calculated with the constraints of minimizing the difference on both sides of the splicing line and avoiding the moving area.
在一實施例中,本發明提供的影像拼接方法還包含獲取之前計算得到的一先前拼接線。再根據先前拼接線對成本圖進行修正。In one embodiment, the image splicing method provided by the present invention further includes acquiring a previous splicing line calculated previously. The cost map is then revised based on the previously spliced lines.
應當說明的是,影像拼接方法的詳細說明請參照以上實施例中對於影像拼接裝置的相關說明,在此不再贅述。It should be noted that, for the detailed description of the image splicing method, please refer to the relevant description of the image splicing device in the above embodiment, and details are not repeated here.
以上對本發明實施例提供的影像拼接裝置、影像處理晶片及影像拼接方法進行了詳細介紹。本文中應用了具體個例對本發明的原理及實施方式進行了闡述,以上實施例的說明只是用於幫助理解本發明。同時,對於本領域的技術人員,依據本發明的思想,在具體實施方式及應用範圍上均會有改變之處,綜上該,本說明書內容不應理解為對本發明的限制。The image splicing device, the image processing chip, and the image splicing method provided by the embodiments of the present invention have been described in detail above. The principles and implementations of the present invention are described herein by using specific examples, and the descriptions of the above embodiments are only used to help understand the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific embodiments and application scope. In conclusion, the content of this specification should not be construed as a limitation to the present invention.
10:影像處理晶片
100:影像拼接裝置
110:移動偵測單元
120:確定單元
1202:資料處理電路
1204:拼接線計算電路
130:拼接單元
140:差異計算單元
1402:色彩差異計算電路
1404:邊緣偵測器
1406:邊緣差異計算電路
150:位移限制單元
200:介面單元300:區域確定單元
510~530:步驟
10: Image processing chip
100: Image stitching device
110: Motion detection unit
120: Determine unit
1202: Data Processing Circuits
1204: Splice line calculation circuit
130: Splicing unit
140: Difference calculation unit
1402: Color Difference Calculation Circuit
1404: Edge Detector
1406: Edge Difference Computation Circuit
150: Displacement limit unit
200: interface unit 300:
[圖1]顯示本發明之一實施例中,影像拼接裝置的第一種方塊示意圖; [圖2]顯示本發明之一實施例中,圖1中的運動偵測單元對第一影像和第二影像的重疊區域進行運動偵測得到運動區域的示例圖; [圖3]顯示本發明之一實施例中,圖1中的確定單元計算得到的目標拼接線的示例圖; [圖4]顯示本發明之一實施例中,圖1中的拼接單元根據圖3所示的目標拼接線拼接第一影像和第二影像得到拼接影像的示例圖; [圖5]顯示本發明之一實施例中,影像拼接裝置的第二方塊示意圖; [圖6]顯示本發明之一實施例中,圖5中的差異計算單元更詳細的方塊示意圖; [圖7]顯示本發明之一實施例中,圖6中的色彩差異計算電路計算得到色彩差異矩陣的示例圖; [圖8]顯示本發明之一實施例中,圖6中的邊緣偵測器進行邊緣偵測,並由圖6中的邊緣差異計算電路計算得到邊緣差異矩陣的示例圖; [圖9]顯示本發明之一實施例中,圖5中的確定單元的方塊示意圖; [圖10]顯示本發明之一實施例中,圖9中的資料處理電路計算得到成本圖的示例圖; [圖11]顯示本發明之一實施例中,圖9中的拼接線計算電路計算目標拼接線的示例圖; [圖12]顯示本發明之一實施例中,圖9中的拼接線計算電路計算目標拼接線的另一示例圖; [圖13]顯示本發明之一實施例中,影像拼接裝置的第三方塊示意圖; [圖14]顯示本發明之一實施例中,圖1中的運動偵測單元偵測得到運動區域的示意圖; [圖15]顯示本發明之一實施例中,影像處理晶片的方塊示意圖;以及 [圖16]顯示本發明之一實施例中,影像拼接方法的流程示意圖。 [FIG. 1] shows a first block schematic diagram of an image splicing device in an embodiment of the present invention; [FIG. 2] In an embodiment of the present invention, the motion detection unit in FIG. 1 performs motion detection on the overlapping area of the first image and the second image to obtain an example diagram of a motion area; [Fig. 3] shows an example diagram of the target splicing line calculated by the determining unit in Fig. 1 in an embodiment of the present invention; [FIG. 4] shows an example diagram in which the splicing unit in FIG. 1 splices the first image and the second image according to the target splicing line shown in FIG. 3 to obtain a spliced image in an embodiment of the present invention; [ Fig. 5 ] shows a second block diagram of an image splicing device in an embodiment of the present invention; [FIG. 6] shows a more detailed block diagram of the difference calculation unit in FIG. 5 in an embodiment of the present invention; [Fig. 7] shows an example diagram of a color difference matrix calculated by the color difference calculation circuit in Fig. 6 in an embodiment of the present invention; [FIG. 8] shows an example diagram of edge detection performed by the edge detector in FIG. 6 and an edge difference matrix calculated by the edge difference calculation circuit in FIG. 6 in an embodiment of the present invention; [Fig. 9] shows a block diagram of the determination unit in Fig. 5 in an embodiment of the present invention; [FIG. 10] shows an example diagram of a cost map calculated by the data processing circuit in FIG. 9 in an embodiment of the present invention; [FIG. 11] shows an example diagram of calculating the target splice line by the splice line calculation circuit in FIG. 9 in an embodiment of the present invention; [ Fig. 12 ] shows another example diagram of calculating the target splice line by the splice line calculation circuit in Fig. 9 in an embodiment of the present invention; [ Fig. 13 ] shows a schematic diagram of a third block of an image splicing device in an embodiment of the present invention; [FIG. 14] shows a schematic diagram of a motion area detected by the motion detection unit in FIG. 1 in an embodiment of the present invention; [ FIG. 15 ] shows a block diagram of an image processing chip in an embodiment of the present invention; and [ FIG. 16 ] is a schematic flowchart showing an image stitching method according to an embodiment of the present invention.
100:影像拼接裝置 110:移動偵測單元 120:確定單元 130:拼接單元 100: Image stitching device 110: Motion detection unit 120: Determine unit 130: Splicing unit
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109139553A TWI766434B (en) | 2020-11-12 | 2020-11-12 | Image stitching apparatus, image processing chip and image stitching method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109139553A TWI766434B (en) | 2020-11-12 | 2020-11-12 | Image stitching apparatus, image processing chip and image stitching method |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202219892A TW202219892A (en) | 2022-05-16 |
TWI766434B true TWI766434B (en) | 2022-06-01 |
Family
ID=82558717
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW109139553A TWI766434B (en) | 2020-11-12 | 2020-11-12 | Image stitching apparatus, image processing chip and image stitching method |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI766434B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859433A (en) * | 2009-04-10 | 2010-10-13 | 日电(中国)有限公司 | Image mosaic device and method |
CN104217414A (en) * | 2014-09-10 | 2014-12-17 | 中科九度(北京)空间信息技术有限责任公司 | Method and device for extracting mosaicing line for image mosaic |
US20200101899A1 (en) * | 2013-02-27 | 2020-04-02 | Magna Electronics Inc. | Method for stitching images captured by multiple vehicular cameras |
TW202016880A (en) * | 2018-10-24 | 2020-05-01 | 緯創資通股份有限公司 | Image stitching processing method and system thereof |
-
2020
- 2020-11-12 TW TW109139553A patent/TWI766434B/en active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859433A (en) * | 2009-04-10 | 2010-10-13 | 日电(中国)有限公司 | Image mosaic device and method |
US20200101899A1 (en) * | 2013-02-27 | 2020-04-02 | Magna Electronics Inc. | Method for stitching images captured by multiple vehicular cameras |
CN104217414A (en) * | 2014-09-10 | 2014-12-17 | 中科九度(北京)空间信息技术有限责任公司 | Method and device for extracting mosaicing line for image mosaic |
TW202016880A (en) * | 2018-10-24 | 2020-05-01 | 緯創資通股份有限公司 | Image stitching processing method and system thereof |
Also Published As
Publication number | Publication date |
---|---|
TW202219892A (en) | 2022-05-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115022606B (en) | Projection equipment and obstacle avoidance projection method | |
KR102126513B1 (en) | Apparatus and method for determining the pose of the camera | |
KR101862889B1 (en) | Autofocus for stereoscopic camera | |
US20180218485A1 (en) | Method and apparatus for fusing plurality of depth images | |
US8798387B2 (en) | Image processing device, image processing method, and program for image processing | |
JP6701930B2 (en) | Authoring device, authoring method, and authoring program | |
JP2007278845A (en) | Image processing apparatus and its processing method | |
KR20110059506A (en) | System and method for obtaining camera parameters from multiple images and computer program products thereof | |
JPWO2018163843A1 (en) | Imaging device, imaging method, image processing device, and image processing method | |
US11017587B2 (en) | Image generation method and image generation device | |
US8774276B2 (en) | Image processing method for determining motion vectors of interpolated picture and related apparatus | |
JP6173218B2 (en) | Multi-view rendering apparatus and method using background pixel expansion and background-first patch matching | |
US8482619B2 (en) | Image processing method, image processing program, image processing device, and imaging device for image stabilization | |
JP4296617B2 (en) | Image processing apparatus, image processing method, and recording medium | |
CN112200727B (en) | Image stitching device, image processing chip, and image stitching method | |
US20080226159A1 (en) | Method and System For Calculating Depth Information of Object in Image | |
JP4394487B2 (en) | Stereo image processing device | |
JP2001243478A (en) | Target body tracing device | |
TWI766434B (en) | Image stitching apparatus, image processing chip and image stitching method | |
JPH10240934A (en) | Object extractor | |
US20130057701A1 (en) | Device and method for image processing | |
US9380285B2 (en) | Stereo image processing method, stereo image processing device and display device | |
KR101219126B1 (en) | Control Method And System According to Image Motion Information Estimated with Image Characteristic | |
JPH10289315A (en) | Parallax calculation device and method, and distance calculation device and method | |
EP2657909B1 (en) | Method and image processing device for determining disparity |