TWI762353B - Method for generating projection image with scaling adjustment and seam cut stitching - Google Patents

Method for generating projection image with scaling adjustment and seam cut stitching Download PDF

Info

Publication number
TWI762353B
TWI762353B TW110121015A TW110121015A TWI762353B TW I762353 B TWI762353 B TW I762353B TW 110121015 A TW110121015 A TW 110121015A TW 110121015 A TW110121015 A TW 110121015A TW I762353 B TWI762353 B TW I762353B
Authority
TW
Taiwan
Prior art keywords
seam
image
images
vertex
area
Prior art date
Application number
TW110121015A
Other languages
Chinese (zh)
Other versions
TW202248951A (en
Inventor
呂忠晏
Original Assignee
信驊科技股份有限公司
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 信驊科技股份有限公司 filed Critical 信驊科技股份有限公司
Priority to TW110121015A priority Critical patent/TWI762353B/en
Application granted granted Critical
Publication of TWI762353B publication Critical patent/TWI762353B/en
Publication of TW202248951A publication Critical patent/TW202248951A/en

Links

Images

Landscapes

  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

An image processing method for receiving M lens images and generating a projection image is disclosed. The image processing method comprises: determining P optimal warping coefficients of P control regions in the projection image according to a 2D error table and the M lens images from an image capture module; generating M face images according to the M lens images, a first vertex list and the P optimal warping coefficients; determining a seam for each of N seam regions; and, stitching two overlapping seam images to generate a stitched seam image for each seam region according to its corresponding seam. The 2D error table comprises multiple test warping coefficients and multiple accumulation pixel value differences in the P control regions. The P control regions are respectively located in the N seam regions that are respectively located in N overlap regions of the M face images, where M>=2, N>=1 and P>=3.

Description

以縮放調整及接縫拼接來產生投影影像的方法Method for generating projected images with scaling and seam stitching

本發明係有關於影像處理,特別地,尤有關於一種以縮放調整及接縫拼接來產生投影影像的方法。本發明有助於在影像處理系統產生投影影像。 The present invention relates to image processing, and more particularly, to a method for generating projected images with scaling and seam stitching. The present invention facilitates the generation of projected images in an image processing system.

圖1A係顯示一立方體架構11與一球體12之間的關係。如圖1A所示,一習知照相機具有四個鏡頭且分別架設在一立方體架構11的四個工作面(右面、左面、正面、背面)上,該四個工作面的任二個鄰近面係實質上正交,例如該四個工作面分別朝向虛擬球體12的經度(longitude)0度、90度、180度及270度,以同時捕捉到一個具有360度水平視域(field of view,FOV)及90度垂直FOV的視野,並產生四個鏡頭影像。架設該具四鏡頭的照相機的一個必要條件是任二個鄰近鏡頭的視野之間應有足夠的重疊,以助影像拼接(image mosaicking)。請參考圖1B,區域A(1)~A(2)內的像素是由二個鏡頭/紋理影像重疊而成,而區域15內的像素則來自於單一鏡頭/紋理影像。因此,可對該些重疊區域13進行拼接(stitch)操作,以形成一等距全景影像(equirectangular panoramic image)。 FIG. 1A shows the relationship between a cube frame 11 and a sphere 12 . As shown in FIG. 1A , a conventional camera has four lenses and is mounted on four working surfaces (right, left, front, and back) of a cube frame 11 respectively, and any two adjacent surfaces of the four working surfaces are Substantially orthogonal, for example, the four working surfaces face the longitudes of 0, 90, 180 and 270 degrees of the virtual sphere 12 respectively, so as to simultaneously capture a 360-degree horizontal field of view (FOV) ) and a 90-degree vertical FOV, and produce four lens images. A necessary condition for setting up the camera with four lenses is that there should be sufficient overlap between the fields of view of any two adjacent lenses to facilitate image mosaicking. Referring to FIG. 1B , the pixels in areas A( 1 ) to A( 2 ) are formed by overlapping two lenses/texture images, while the pixels in area 15 are from a single lens/texture image. Therefore, a stitching operation can be performed on the overlapping regions 13 to form an equirectangular panoramic image.

一個完美的投影影像處理系統應讓觀賞者無法察覺視訊是由多個鏡頭所捕捉,因此,觀賞者可以感受到多鏡頭看起來像單一鏡頭的無縫體驗。 A perfect projected image processing system should make it impossible for the viewer to perceive that the video is being captured by multiple cameras, so the viewer can experience a seamless experience where multiple cameras look like a single camera.

有鑒於上述問題,本發明的目的之一是提供一種影像處理方法,以縮放調整及接縫拼接來產生投影影像。 In view of the above problems, one of the objectives of the present invention is to provide an image processing method to generate a projected image by scaling adjustment and seam splicing.

根據本發明之一實施例,係提供一種影像處理方法,用以接收M個鏡頭影像及產生一投影影像,該方法包含:根據一個2D誤差表格及該M個鏡頭影像,決定該投影影像內P個控制區的P個最佳接合係數,其中,以一影像擷取模組,捕捉一個具有X度水平視域及Y度垂直視域的視野,以產生該M個鏡頭影像;根據一第一頂點列表、該P個最佳接合係數以及該M個鏡頭影像,產生M張工作面影像;決定N個接縫區的N條接縫;以及,根據各接縫區的接縫,拼接各接縫區的二張重疊的接縫影像以產生一拼接後接縫影像。其中,各工作面影像包含z張接縫影像以及一張主影像,以及各接縫區係位在該投影影像內的二相鄰主影像之間;該2D誤差表格包含多個測試接合係數以及該P個控制區中對應的多個累積像素值誤差量;該P個控制區係分別位在該N個接縫區之內,以及該N個接縫區係分別位在該M個工作面的N個重疊區之內;該第一頂點列表包含多個具有資料結構的第一頂點,該些資料結構定義單一鏡頭影像及該投影影像之間的第一頂點映射;其中,1<=z<=2、M>=2、N>=1、P>=3、X<=360以及Y<180。 According to an embodiment of the present invention, an image processing method is provided for receiving M lens images and generating a projection image, the method comprising: determining P in the projection image according to a 2D error table and the M lens images P optimal bonding coefficients of each control area, wherein an image capture module is used to capture a field of view with a horizontal field of view of X degrees and a vertical field of view of Y degrees to generate the M lens images; according to a first The vertex list, the P optimal joint coefficients, and the M lens images, generate M work surface images; determine N seams in the N seam areas; and, according to the seams in each seam area, splicing Two overlapping seam images in the seam area to generate a stitched seam image. Wherein, each working surface image includes z seam images and a main image, and each seam area is located between two adjacent main images in the projected image; the 2D error table includes a plurality of test joint coefficients and A plurality of accumulated pixel value error amounts corresponding to the P control areas; the P control areas are respectively located in the N seam areas, and the N seam areas are respectively located in the M working surfaces within the N overlapping regions of ; the first vertex list includes a plurality of first vertices with data structures that define the first vertex mapping between a single lens image and the projected image; wherein, 1<=z <=2, M>=2, N>=1, P>=3, X<=360, and Y<180.

茲配合下列圖示、實施例之詳細說明及申請專利範圍,將上述及本發明之其他目的與優點詳述於後。 The above-mentioned and other objects and advantages of the present invention will be described in detail below in conjunction with the following figures, detailed descriptions of the embodiments and the scope of the patent application.

11:立方體架構 11: Cube Architecture

12:球體 12: Sphere

15:非重疊區域 15: Non-overlapping regions

21:影像擷取模組 21: Image capture module

22:補償裝置 22: Compensation device

23:對應性產生器 23: Correspondence Generator

40:理想成像位置 40: Ideal imaging position

41、44:影像中心 41, 44: Image Center

42:控制區的位置 42: The location of the control area

43:影像擷取模組21的系統中心 43: System Center of Image Capture Module 21

45:物體 45: Objects

46、47:鏡頭中心 46, 47: Lens Center

48:實際成像位置 48: Actual imaging position

55:圖像引擎 55: Image Engine

56:接縫引擎 56: Seam Engine

71:交叉點/頂點 71: Intersection/Vertex

72:四邊形 72: Quadrilateral

78:接縫 78: Seams

81:更新視窗 81: Update Windows

82:分隔點 82: Separation point

200:投影影像處理系統 200: Projection Image Processing System

210:頂點處理裝置230 210: Vertex Processing Device 230

220:影像處理裝置 220: Image processing device

230:拼接決策單元 230: Splicing Decision Unit

510:目的緩衝器 510: Destination Buffer

520:暫時緩衝器 520: Temporary Buffer

560:柵格化引擎 560: Rasterization Engine

570:紋理映射電路 570: Texture Mapping Circuit

571、572:紋理映射引擎 571, 572: Texture mapping engine

580:量測單元 580: Measurement unit

[圖1A]係顯示一立方體架構與一球體之間的關係。 [FIG. 1A] shows the relationship between a cube frame and a sphere.

[圖1B]顯示一等距長方全景影像,係源自於一影像擷取模組21的四個鏡頭影像(背面、左面、右面、正面)的等距長方投影。 FIG. 1B shows an equidistant rectangular panoramic image, which is derived from the equidistant rectangular projection of four lens images (back, left, right, and front) of an image capture module 21 .

[圖2]係根據本發明一實施例,顯示投影影像處理系統的方塊圖。 2 is a block diagram showing a projection image processing system according to an embodiment of the present invention.

[圖3A]顯示一個三角形網格,係用以模型化一球體表面。 [FIG. 3A] shows a triangular mesh used to model the surface of a sphere.

[圖3B]顯示一個多邊形網格,係用以組成/模型化該等距長方全景影像。 [FIG. 3B] shows a polygon mesh used to compose/model the isometric panorama.

[圖3C]顯示一等距長方全景影像中具有四個重疊區域及二十個控制區的例子。 [ FIG. 3C ] An example of an equidistant rectangular panoramic image with four overlapping regions and twenty control regions is shown.

[圖4A]顯示於正面鏡頭影像中該目標頂點P及十個控制區R(6)~R(15)間的關係之一示例。 [ FIG. 4A ] An example of the relationship between the target vertex P and the ten control regions R( 6 ) to R( 15 ) in the frontal lens image is shown.

[圖4B]顯示在頂點處理裝置210根據接合係數修改所有頂點的紋理座標後,一物體之不匹配的影像缺陷如何被改善。 [FIG. 4B] shows how the mismatched image defect of an object is improved after the vertex processing device 210 modifies the texture coordinates of all vertices according to the joint coefficient.

[圖5]係根據本發明一實施例,顯示該影像處理裝置的示意圖。 5 is a schematic diagram showing the image processing apparatus according to an embodiment of the present invention.

[圖6A]係根據本發明一實施例,顯示決定所有控制區之最佳接合係數之方法流程圖。 FIG. 6A is a flowchart showing a method for determining the optimal bonding coefficients of all control regions according to an embodiment of the present invention.

[圖6B]係根據本發明一實施例,顯示該拼接決策單元230進行步驟S612之係數決策操作之方法流程圖。 FIG. 6B is a flowchart showing a method for the splicing decision unit 230 to perform the coefficient decision operation of step S612 according to an embodiment of the present invention.

[圖6C]顯示在該連結計量之所有路徑中,路徑0-1-1(實線路徑)的連結計量值總和是最小的。 [ FIG. 6C ] It is shown that among all the paths of the connection meter, the sum of the connection meter values of the path 0-1-1 (solid line path) is the smallest.

[圖7A]顯示一等距長方全景影像包含四個主影像及其接縫區的例子。 FIG. 7A shows an example of an equidistant rectangular panorama image including four main images and their seam areas.

[圖7B]顯示圖7A的接縫區S(2)的放大圖。 [ FIG. 7B ] An enlarged view showing the seam area S( 2 ) of FIG. 7A .

[圖7C]係根據本發明一實施例,顯示決定一接縫區的最小化誤差路徑(或一接縫)之方法的流程圖。 [FIG. 7C] A flow chart showing a method of determining an error-minimizing path (or a seam) for a seam region according to an embodiment of the present invention.

[圖7D]顯示一接縫78係位在一接縫區內且該接縫區位在一左面主影像及一右面主影像之間的一個例子。 [FIG. 7D] shows an example where a seam 78 is located in a seam area and the seam area is located between a left main image and a right main image.

[圖8A]係根據本發明一實施例,顯示一影像處理方法的流程圖。 8A is a flowchart showing an image processing method according to an embodiment of the present invention.

[圖8B]顯示一接縫區的其中一段的例子,且該接縫區係有關於一接縫78、一接縫影像A以及一接縫影像B。 [ FIG. 8B ] An example of a section of a seam area is shown, and the seam area is related to a seam 78 , a seam image A, and a seam image B. [ FIG.

[圖8C]顯示一接縫區的大小以及三列的更新視窗81的大小及不同位置。 [FIG. 8C] shows the size of a seam area and the size and different positions of the update windows 81 in three columns.

[圖8D]顯示一接縫區同時位在等距長方全景影像的最左側及最右側。 [FIG. 8D] shows that a seam area is located at the leftmost and rightmost sides of the equidistant rectangular panoramic image at the same time.

在通篇說明書及後續的請求項當中所提及的「一」及「該」等單數形式的用語,都同時包含單數及複數的涵義,除非本說明書中另有特別指明。在通篇說明書中,具相同功能的電路元件使用相同的參考符號。 References in the singular form of "a" and "the" throughout this specification and subsequent claims shall include both the singular and the plural, unless the specification expressly states otherwise. Throughout the specification, circuit elements with the same function use the same reference symbols.

圖2係根據本發明一實施例,顯示投影影像處理系統的方塊圖。本發明投影影像處理系統200包含一影像擷取模組21、一補償裝置22以及一對應性產生器(correspondence generator)23。該補償裝置22接收來自對應性產生器23之原始頂點列表及來自影像擷取模組21的多張鏡頭影像,以產生一投影影像。請注意,影像擷取模組21是一部具多鏡頭的照相機可以是一部全景照相機或是一部廣角(wide angle)照相機,因此,上述投影影像可以是一張全景影像或是一張廣角影像。 FIG. 2 is a block diagram showing a projection image processing system according to an embodiment of the present invention. The projection image processing system 200 of the present invention includes an image capture module 21 , a compensation device 22 and a correspondence generator 23 . The compensation device 22 receives the original vertex list from the correspondence generator 23 and a plurality of lens images from the image capture module 21 to generate a projected image. Please note that the image capture module 21 is a multi-lens camera, which can be a panoramic camera or a wide-angle camera. Therefore, the above-mentioned projected image can be a panoramic image or a wide-angle camera image.

許多投影方式都適用於本發明投影影像處理系統200。「投影」一詞指的是:將一球體表面攤平成一個二維平面,例如一投影平面。該投影包含,但不受限於,等距長方投影、圓柱(cylindrical)投影以及修正圓柱投影。修正圓柱形投影包含,但不受限於,米勒(Miller)投影、墨卡托(Mercator)投影、蘭伯特圓柱等面積(Lambert cylindrical equal area)投影、帕尼尼(Pannini)投影等。據此,上述投影影像包含,但不受限於,一等距長方投影影像、一圓柱投影影像以及一修正圓柱投影影像。圖1A-1B及3A-3C係有關等距長方投影。至於圓柱投影以及修正圓柱投影的實施方式已為本領域技術人士所熟知,在此不予贅述。請注意,無論本發明投影影像處理系統200採用哪一種投影方式,上述對應性產生器23都會對應地產生一原始頂點列表(例如表一),其定義了該些鏡頭影像及該投影影像之間的頂點映射關係。為清楚及方便描述,以下的例子及實施例僅以等距長方投影及等距長方全景影像作說明。須注意的是,本發明投影影像處理系統 200的運作方式及影像處理方法(圖6A-6B、7C及8A)同樣亦適用於上述廣角照相機、圓柱投影以及修正圓柱投影。 Many projection methods are applicable to the projection image processing system 200 of the present invention. The term "projection" refers to flattening the surface of a sphere into a two-dimensional plane, such as a projected plane. The projections include, but are not limited to, equirectangular projections, cylindrical projections, and modified cylindrical projections. The modified cylindrical projection includes, but is not limited to, Miller projection, Mercator projection, Lambert cylindrical equal area projection, Pannini projection, and the like. Accordingly, the above-mentioned projection images include, but are not limited to, an equidistant rectangular projection image, a cylindrical projection image, and a modified cylindrical projection image. 1A-1B and 3A-3C are related equirectangular projections. The implementations of cylindrical projection and modified cylindrical projection are well known to those skilled in the art, and will not be repeated here. Please note that no matter which projection method is adopted by the projection image processing system 200 of the present invention, the correspondence generator 23 will correspondingly generate an original vertex list (eg, Table 1), which defines the relationship between the lens images and the projection image. vertex mapping relationship. For the sake of clarity and convenience, the following examples and embodiments only use equidistant rectangular projections and equidistant rectangular panoramic images for illustration. It should be noted that the projection image processing system of the present invention The operation of 200 and the image processing method (FIGS. 6A-6B, 7C, and 8A) are also applicable to the wide-angle camera, cylindrical projection, and modified cylindrical projection described above.

該影像擷取模組21是一部具多鏡頭的照相機,可同時捕捉到一個涵蓋X度水平FOV以及Y度的垂直FOV的視野,以產生多個鏡頭影像,其中X<=360,Y<180,例如360×160或180×90等。舉例而言,如圖1A所示,影像擷取模組21包含四個鏡頭(圖未示)且分別架設在一立方體架構11的四個工作面上,以同時捕捉到一個具有360度水平視域FOV及90度垂直FOV的視野,以產生四個鏡頭影像。請注意,只要能捕捉到一個X度水平FOV及Y度垂直FOV的視野,本發明不會限制該影像擷取模組21所包含的鏡頭數量,其中X<=360,Y<180。架設該影像擷取模組21的一個必要條件是任二個鄰近鏡頭的視野之間應有足夠的重疊,以助影像拼接。 The image capture module 21 is a multi-lens camera, which can simultaneously capture a field of view covering X-degree horizontal FOV and Y-degree vertical FOV to generate multiple lens images, where X<=360, Y< 180, such as 360×160 or 180×90, etc. For example, as shown in FIG. 1A , the image capturing module 21 includes four lenses (not shown in the figure) and is respectively erected on four working surfaces of a cube structure 11 to simultaneously capture an image with a 360-degree horizontal view. Field FOV and 90 degree vertical FOV field of view to produce four lens images. Please note that the present invention does not limit the number of lenses included in the image capturing module 21 as long as a field of view of an X degree horizontal FOV and a Y degree vertical FOV can be captured, where X<=360 and Y<180. A necessary condition for setting up the image capture module 21 is that there should be sufficient overlap between the fields of view of any two adjacent lenses to facilitate image stitching.

在通篇說明書及後續的請求項當中所提及的相關用語定義如下,除非本說明書中另有特別指明。「紋理座標」一詞指的是一紋理空間(如一紋理影像或鏡頭影像)中的座標;「柵格化(rasterization)操作」一詞指的是將場景幾何形狀(scene geometry)(或一投影影像)映射至各鏡頭影像的紋理座標的計算過程。投影影像處理系統200的處理管線(pipeline)分為離線階段(offline phase)和連線階段。於離線階段,分別校正該影像擷取模組21的四個鏡頭,該對應性產生器23採用適合的影像對準(registration)技術來產生一原始頂點列表,並且該原始頂點列表中的各頂點提供該等距長方全景影像及該些鏡頭影像之間(或該等距長方座標及該些紋理座標之 間)的映射關係。例如,半徑2公尺(r=2)的球體12表面上被劃出許多圓圈,當作經度及緯度,其多個交叉點被視為多個校正點。該四個鏡頭捕捉該些校正點,且該些校正點於該些鏡頭影像上的位置為已知。然後,因為該些校正點的視角(view angle)和該些紋理座標被連結,故可建立該等距長方全景影像及該些鏡頭影像之間的映射關係。在本說明書中,具上述映射關係的校正點被定義為一個”頂點”。簡言之,該對應性產生器23對於各頂點,校正在該等距長方全景影像及該些鏡頭影像之間的關係,以得到該原始頂點列表。在離線階段中,該對應性產生器23會完成所有必要計算。 Relevant terms referred to throughout the specification and subsequent claims are defined below, unless otherwise specifically indicated in this specification. The term "texture coordinates" refers to coordinates in a texture space (such as a texture image or lens image); the term "rasterization" refers to the Image) is mapped to the calculation process of the texture coordinates of each lens image. The processing pipeline of the projection image processing system 200 is divided into an offline phase and an online phase. In the offline stage, the four lenses of the image capture module 21 are respectively calibrated, the correspondence generator 23 uses a suitable image registration technique to generate an original vertex list, and each vertex in the original vertex list Provide the distance between the equidistant rectangular panorama image and the lens images (or between the equidistant rectangular coordinates and the texture coordinates ) mapping relationship. For example, many circles are drawn on the surface of the sphere 12 with a radius of 2 meters (r=2), which are regarded as longitude and latitude, and multiple intersection points thereof are regarded as multiple correction points. The four lenses capture the correction points, and the positions of the correction points on the lens images are known. Then, since the view angles of the correction points and the texture coordinates are linked, a mapping relationship between the equidistant rectangular panoramic image and the lens images can be established. In this specification, a correction point with the above-mentioned mapping relationship is defined as a "vertex". In short, the correspondence generator 23 corrects the relationship between the equidistant rectangular panoramic image and the lens images for each vertex to obtain the original vertex list. In the offline phase, the correspondence generator 23 performs all necessary calculations.

圖3A顯示一個三角形網格(mesh),係用以模型化一球體表面。參考圖3A,利用一個三角形網格來模型化一球體12的表面。圖3B顯示一個多邊形網格,係用以組成/模型化該等距長方全景影像。透過對圖3A的三角形網格進行一等距長方投影而產生圖3B的多邊形網格,而圖3B的多邊形網格是多個四邊形或/及多個三角形的集合。 Figure 3A shows a triangular mesh used to model the surface of a sphere. Referring to Figure 3A, the surface of a sphere 12 is modeled using a triangular mesh. Figure 3B shows a polygon mesh used to compose/model the isometric panorama. The polygonal mesh of FIG. 3B is generated by performing an equirectangular projection on the triangular mesh of FIG. 3A , and the polygonal mesh of FIG. 3B is a collection of quadrilaterals and/or triangles.

於離線階段,根據該等距長方全景影像及該些鏡頭影像的幾何形狀,該對應性產生器23為多邊形網格(圖3B)的各頂點,計算其等距長方座標及紋理座標,以產生該原始頂點列表。之後,該對應性產生器23將該原始頂點列表傳送給該頂點處理裝置210。該原始頂點列表是多個頂點的列表,該些頂點形成該多邊形網格(圖3B)的多個四邊形或/及三角形,且各頂點由一相對應資料結構所定義。該資料結構定義了一目的空間及一紋理空間之間(或該等距長方座標及該紋理座 標之間)的頂點映射關係。表一顯示該原始頂點列表中各頂點之資料結構的一個例子。 In the offline stage, according to the geometric shapes of the equidistant rectangular panoramic image and the lens images, the correspondence generator 23 calculates the equidistant rectangular coordinates and texture coordinates for each vertex of the polygonal mesh (FIG. 3B), to produce this original vertex list. Afterwards, the correspondence generator 23 transmits the original vertex list to the vertex processing device 210 . The original vertex list is a list of vertices that form the quads and/or triangles of the polygon mesh (FIG. 3B), and each vertex is defined by a corresponding data structure. The data structure defines between a destination space and a texture space (or the equidistant rectangle and the texture base The vertex mapping relationship between the markers). Table 1 shows an example of the data structure of each vertex in the original vertex list.

Figure 110121015-A0305-02-0010-1
Figure 110121015-A0305-02-0010-1

為清楚及方便描述,以下的例子及實施例係假設影像擷取模組21包含四個鏡頭影像且分別架設在立方體架構11的四個工作面(右面、左面、正面、背面)上。 For clarity and convenience of description, the following examples and embodiments assume that the image capture module 21 includes four lens images and is respectively erected on the four working surfaces (right, left, front, and back) of the cube frame 11 .

圖3C顯示一等距長方全景影像中具有四個重疊區域及二十個控制區R(1)~R(20)的例子。請同時參考圖1B,各重疊區A(1)~A(4)包含P1個控制區,其中P1>=3。以下的例子及實施例係以等距長方全景影像的各重疊區包含5個(P1=5)控制區為例做說明。在圖3C的例子中,該等距長方全景影像有二十個控制區R(1)~R(20), 且該些控制區R(1)~R(20)分別具有二十個接合(warping)係數C(1)~C(20),該二十個接合係數分別表示該二十個控制區R(1)~R(20)的不同接合程度。 FIG. 3C shows an example of an equidistant rectangular panoramic image with four overlapping regions and twenty control regions R(1)-R(20). Please also refer to FIG. 1B , each of the overlapping areas A( 1 ) to A( 4 ) includes P1 control areas, where P1 >=3. The following examples and embodiments are described by taking as an example that each overlapping area of the equidistant rectangular panoramic image includes five (P1=5) control areas. In the example of FIG. 3C, the equidistant rectangular panoramic image has twenty control regions R(1)-R(20). And the control regions R(1)-R(20) respectively have twenty warping coefficients C(1)-C(20), and the twenty warping coefficients respectively represent the twenty control regions R( 1) The different degrees of engagement of ~R(20).

該補償裝置22包含一頂點處理裝置210、一拼接決策單元230以及一影像處理裝置220。在一量測模式下,該頂點處理裝置210接收該原始頂點列表及來自該拼接決策單元320的測試接合係數C(1)~C(20)、以逐頂點方式修正該原始頂點列表中各頂點於所有鏡頭影像之所有紋理座標、以及產生一修正頂點列表(將於稍後說明);根據該修正頂點列表及來自影像擷取模組21的四個鏡頭影像,該影像處理裝置210量測該等距長方全景影像中所有控制區R(1)~R(20)的區域誤差量E(1)~E(20),並輸出該些區域誤差量,之後,該拼接決策單元230根據該些測試接合係數C(1)~C(20),接收該些區域誤差量,以產生一2D誤差表格,再根據該2D誤差表格,產生最佳接合係數C(1)~C(20)。另一方面,在一顯像模式下,該拼接決策單元320被禁能,因此,根據該拼接決策單元230輸出的該些控制區的最佳接合係數,該頂點處理裝置210以及該影像處理裝置220一起運作以產生該些等距長方全景影像。 The compensation device 22 includes a vertex processing device 210 , a splicing decision unit 230 and an image processing device 220 . In a measurement mode, the vertex processing device 210 receives the original vertex list and the test joint coefficients C(1)-C(20) from the splicing decision unit 320, and corrects each vertex in the original vertex list in a vertex-by-vertex manner. at all texture coordinates of all lens images, and generating a corrected vertex list (to be described later); based on the corrected vertex list and the four lens images from the image capture module 21, the image processing device 210 measures the The regional error amounts E(1)-E(20) of all control regions R(1)-R(20) in the isometric rectangular panoramic image, and output these regional error amounts, and then the splicing decision unit 230 according to the Some test joint coefficients C(1)-C(20), receive the regional error amounts to generate a 2D error table, and then generate optimal joint coefficients C(1)-C(20) according to the 2D error table. On the other hand, in a rendering mode, the splicing decision unit 320 is disabled. Therefore, according to the optimal splicing coefficients of the control regions output by the splicing decision unit 230, the vertex processing device 210 and the image processing device 220 operate together to generate the isometric panoramas.

在該量測或顯像模式下,該頂點處理裝置210接收來自該原始頂點列表的目標頂點P(及其資料結構),以及來自該拼接決策單元230的二十個測試/最佳接合係數C(1)~C(20);接著,該頂點處理裝置210對於該目標頂點P有關的各鏡頭影像,根據該目標頂點P的原始紋理座標,對該二十個測試/最佳接合係數之其二進行內插操作,以產生 各鏡頭影像的內插接合係數C’。以正面鏡頭影像為例,根據該原始頂點列表,假設該目標頂點P在正面鏡頭影像中具有原始紋理座標(uP,vP)。第4A圖顯示於正面鏡頭影像中該目標頂點P及十個控制區R(6)~R(15)間的關係之一示例,其中該十個控制區R(6)~R(15)分別具有十個測試/最佳接合程度/係數C(6)~C(15)。一實施例中,根據角度θ,該頂點處理裝置210對該目標頂點P(在該正面鏡頭影像中具有原始紋理座標(uP,vP))最鄰近的二個控制區的二個接合係數,進行內插操作,以產生該目標頂點P在該正面鏡頭影像的內插接合係數C’。其中,該角度θ為順時針方向且形成於一第一向量V1及一第二向量V2之間;該第一向量V1以影像中心41(具紋理座標(ucenter,vcenter))為起點,以啟始控制區R(13)的位置42為終點,而該第二向量V2以影像中心41為起點,以該目標頂點P(uP,vP)為終點。假設θ=119.5°,因為該正面鏡頭影像的左側及右側分別有五個控制區,故90°/4=22.5°、idx=θ/22.5°=5及θ mod 22.5°=θ-idx×22.5°=7°。因此,頂點P最鄰近的二個控制區為R(9)及R(10),且在該正面鏡頭影像中該目標頂點P的內插接合係數C’係以下列方程式定義/計算:C’=C(9)×(7/22.5)+C(10)×(1-7/22.5)。各控制區的位置42包含,但不限於,該控制區的重心(gravity center)、該控制區的區域中心、及該控制區的中間點(median point)。請注意,啟始控制區R(13)僅為示例而非本發明之限制,在另一實施例中,可選擇另一控制區,例如R(11),當作該正面鏡頭影像的啟始控制區,只要該角度仍為順時針方向,以及是從該第一向量V1(以影像中心41(具紋理座標(ucenter,vcenter))為起點,指向啟始控制區R(11)的位置42)量測至該第二向 量V2。 In the measurement or visualization mode, the vertex processing device 210 receives the target vertex P (and its data structure) from the original vertex list, and twenty test/optimal joint coefficients C from the stitching decision unit 230 (1)~C(20); Next, the vertex processing device 210, for each lens image related to the target vertex P, according to the original texture coordinates of the target vertex P, calculates the rest of the twenty test/optimal joint coefficients. 2. Perform an interpolation operation to generate the interpolation joint coefficient C' of each lens image. Taking the front lens image as an example, according to the original vertex list, it is assumed that the target vertex P has the original texture coordinates (u P , v P ) in the front lens image. Fig. 4A shows an example of the relationship between the target vertex P and the ten control regions R(6)~R(15) in the frontal lens image, wherein the ten control regions R(6)~R(15) are respectively There are ten tests/best degree of engagement/factors C(6)~C(15). In one embodiment, according to the angle θ, the vertex processing device 210 obtains the two joint coefficients of the two control regions closest to the target vertex P (with the original texture coordinates (u P , v P ) in the frontal lens image) , and perform an interpolation operation to generate the interpolated joint coefficient C' of the target vertex P in the front lens image. Wherein, the angle θ is clockwise and is formed between a first vector V1 and a second vector V2; the first vector V1 takes the image center 41 (with texture coordinates (u center , v center )) as the starting point, The end point is the position 42 of the start control region R(13), and the second vector V2 has the image center 41 as the start point and the target vertex P(u P , v P ) as the end point. Assuming θ=119.5°, since there are five control areas on the left and right sides of the frontal lens image, 90°/4=22.5°, idx=θ/22.5°=5 and θ mod 22.5°=θ-idx×22.5 °=7°. Therefore, the two control regions closest to the vertex P are R(9) and R(10), and the interpolated joint coefficient C' of the target vertex P in the frontal lens image is defined/calculated by the following equation: C' =C(9)×(7/22.5)+C(10)×(1-7/22.5). The location 42 of each control area includes, but is not limited to, the gravity center of the control area, the regional center of the control area, and the median point of the control area. Please note that the start control area R(13) is only an example and not a limitation of the present invention. In another embodiment, another control area, such as R(11), can be selected as the start of the front lens image The control area, as long as the angle is still clockwise, and from the first vector V1 (with the image center 41 (with texture coordinates (u center , v center )) as the starting point, pointing to the starting control area R(11) Position 42) is measured to the second vector V2.

以上述目標頂點P為例,為簡化上述計算,該對應性產生器23預先決定哪二個控制區(即R(9)及R(10))是最鄰近該目標頂點P,並將其索引(9及10)寫到該原始頂點列表內該目標頂點P的資料結構之該正面鏡頭影像的”接合係數索引”欄位中;另外,該對應性產生器23亦預先計算接合係數(C(9)及C(10))的混合權值(=7/22.5),並將該混合權值寫到該原始頂點列表內該目標頂點P的資料結構之該正面鏡頭影像的”接合係數的混合權值(Alpha)”欄位中。請注意,從該拼接決策單元230輸出的該些測試/最佳接合係數(C(1)~C(20))被安排為1D的接合係數陣列或1D的資料串流。該頂點處理裝置210接收來自該原始頂點列表後,根據該目標頂點P的資料結構中在該正面鏡頭影像的”接合係數索引”欄位(即9及10),從該拼接決策單元230輸出的1D的接合係數陣列中擷取出二個接合係數(C(9)及C(10)),再根據該目標頂點P的資料結構中在該正面鏡頭影像(請參考表一)的”接合係數的混合權值(Alpha)”欄位(即7/22.5),計算出內插接合係數C’。 Taking the above target vertex P as an example, in order to simplify the above calculation, the correspondence generator 23 predetermines which two control regions (ie, R(9) and R(10)) are the closest to the target vertex P, and assigns its index (9 and 10) are written into the "joint coefficient index" field of the front lens image of the data structure of the target vertex P in the original vertex list; in addition, the correspondence generator 23 also pre-calculates the joint coefficient (C( 9) and C(10)) of the blending weight (=7/22.5), and write the blending weight to the blending coefficient of the front lens image of the data structure of the target vertex P in the original vertex list weight (Alpha)" field. Please note that the test/optimal joint coefficients (C(1)~C(20)) output from the splicing decision unit 230 are arranged as a 1D joint coefficient array or a 1D data stream. After the vertex processing device 210 receives the original vertex list, according to the "joint coefficient index" field (ie, 9 and 10) of the front lens image in the data structure of the target vertex P, the output from the stitching decision unit 230 Two joint coefficients (C(9) and C(10)) are extracted from the 1D joint coefficient array, and then according to the data structure of the target vertex P in the front lens image (please refer to Table 1) "joint coefficients" Mixing weight (Alpha)" field (ie 7/22.5), calculate the interpolated joint coefficient C'.

於接收該內插接合係數C’後,該頂點處理裝置210根據下列方程式,計算該目標頂點P在正面鏡頭影像中的修正紋理座標(uP’,vP’):uP’=(uP-ucenter)* C’+ucenter;vP’=(vP-vcenter)*C’+vcenter。依此方式,該目標頂點P在正面鏡頭影像中的原始紋理座標(u2,v2)就變成修正紋理座標(u2’,v2’)。依此方式,根據該二十個測試/最佳接合係數C(1)~C(20),該頂點處理裝置210依序修正來自該原始頂點列表之各 頂點之四個鏡頭影像的所有紋理座標,以產生該修正頂點列表。表二顯示該修正頂點列表中各頂點之資料結構的一個例子。 After receiving the interpolated joint coefficient C', the vertex processing device 210 calculates the modified texture coordinates (u P ', v P ') of the target vertex P in the frontal lens image according to the following equation: u P '=(u P -u center )* C'+u center ; v P '=(v P -v center )*C'+v center . In this way, the original texture coordinates (u2, v2) of the target vertex P in the frontal lens image become the modified texture coordinates (u2', v2'). In this way, according to the twenty test/best joint coefficients C(1)-C(20), the vertex processing device 210 sequentially corrects all texture coordinates of the four lens images from each vertex of the original vertex list , to generate the corrected vertex list. Table 2 shows an example of the data structure of each vertex in the modified vertex list.

Figure 110121015-A0305-02-0014-2
Figure 110121015-A0305-02-0014-2

在該頂點處理裝置210根據該些測試/最佳接合係數C(1)~C(20)修正完來自該原始頂點列表之所有頂點之所有紋理座標之後,因影像擷取模組21的鏡頭中心偏移(亦即一鏡頭中心46相對於其系統中心43有一個偏移量ofs的距離)而造成的不匹配影像缺陷問題即可大幅改善(即實際成像位置48會被推向理想成像位置40),如圖4B所示。請注意,因為球體12是虛擬的,故物體45有可能位在球體12的外面或裡面或表面。 After the vertex processing device 210 corrects all texture coordinates of all vertices from the original vertex list according to the test/optimal joint coefficients C(1)-C(20), the center of the lens of the image capture module 21 The problem of mismatched image defects caused by offset (that is, a distance of a lens center 46 relative to its system center 43 by an offset ofs) can be greatly improved (that is, the actual imaging position 48 will be pushed to the ideal imaging position 40 ). ), as shown in Figure 4B. Note that since the sphere 12 is virtual, it is possible for the object 45 to be located outside or inside or on the surface of the sphere 12 .

在接收該修正頂點列表及該四個鏡頭影像後,該影像處理裝置220在量測模式下產生二十個控制區R(1)~R(20)的區域誤差量E(1)~E(20),或在顯像模式下產生一等距長方全景影像。圖5係根據本發明一實施例,顯示該影像處理裝置的示意圖。請參考圖5,該影 像處理裝置220包含一圖像引擎(graphics engine)55、一接縫引擎(seam engine)56、一目的緩衝器510以及一暫時緩衝器520。該圖像引擎55包含一柵格化引擎560、一紋理映射電路570以及一量測單元580。該紋理映射電路570包含二個紋理映射引擎571~572。圖3B的多邊形網格是多個四邊形或/及多個三角形的集合。因此,柵格化引擎560可對來自該修正頂點列表的任四個頂點所形成之一個四邊形(如圖3B)內的各像素進行四邊形柵格化操作,或者對來自該修正頂點列表的任三個頂點所形成一個三角形(如圖3B)內的各像素進行三角形柵格化操作。 After receiving the corrected vertex list and the four lens images, the image processing device 220 generates the regional error amounts E(1)-E( of the twenty control regions R(1)-R(20) in the measurement mode 20), or generate an equidistant rectangular panorama image in developing mode. FIG. 5 is a schematic diagram showing the image processing apparatus according to an embodiment of the present invention. Please refer to Figure 5, the The image processing device 220 includes a graphics engine 55 , a seam engine 56 , a destination buffer 510 and a temporary buffer 520 . The image engine 55 includes a rasterization engine 560 , a texture mapping circuit 570 and a measurement unit 580 . The texture mapping circuit 570 includes two texture mapping engines 571-572. The polygon mesh of FIG. 3B is a collection of multiple quadrilaterals or/and multiple triangles. Therefore, the rasterization engine 560 may perform a quadrangular rasterization operation on each pixel in one of the quadrilaterals (as shown in FIG. 3B ) formed by any four vertices from the modified vertex list, or on any three of the modified vertex lists. Each pixel in a triangle formed by the vertices (as shown in FIG. 3B ) is subjected to a triangle rasterization operation.

在四邊形的情況下,假設來自該修正頂點列表的四個頂點(A、B、C、D)(形成圖3B的多邊形網格的一個四邊形)係位在上述二十個控制區R(1)~R(20)之一範圍內且被二個鏡頭影像所重疊(正面及右面;N=2),該頂點列表中該四個頂點(A、B、C、D)分別包含以下資料結構:頂點A:{(xA,yA),2,IDFront,(u1A,v1A),w1A,IDRight,(u2A,v2A),w2A};頂點B:{(xB,yB),2,IDFront,(u1B,v1B),w1B,IDRight,(u2B,v2B),w2B};頂點C:{(xC,yC),2,IDFront,(u1C,v1C),w1C,IDRight,(u2C,v2C),w2C,};頂點D:{(xD,yD),2,IDFront,(u1D,v1D),w1D,IDRight,(u2D,v2D),w2D}。該柵格化引擎560直接對四邊形ABCD進行四邊形柵格化操作。具體而言,該柵格化引擎560利用以下步驟,對一個點Q(具有等距長方座標(x,y)且位在該多邊形網格的該四邊形ABCD內)計算各鏡頭影像的紋理座標:1.利用一雙線性內插(bi-linear interpolation)方法,根據等距長方座標(xA,yA,xB,yB,xC,yC,xD,yD,x,y),計算四個空間權值(a,b,c,d);2.計算該正面鏡 頭影像中該取樣點QF(對應該點Q)之紋理座標:(u1,v1)=(a*u1A+b*u1B+c*u1C+d*u1D,a*v1A+b*v1B+c*v1C+d*v1D);計算該右面鏡頭影像中該取樣點QR(對應該點Q)之紋理座標:(u2,v2)=(a*u2A+b*u2B+c*u2C+d*u2D,a*v2A+b*v2B+c*v2C+d*v2D)。最後,該柵格化引擎560將該二個紋理座標(u1,v1)及(u2,v2)平行傳送給該二個紋理映射引擎571~572。其中,a+b+c+d=1。根據該二個紋理座標(u1,v1)及(u2,v2),該二個紋理映射引擎571~572利用任何合適的方法(例如最近相鄰內插(nearest-neighbour interpolation)法、雙線性內插法、或三線性(trilinear)內插法),紋理映射正面及右面鏡頭影像的紋理資料,以產生二個取樣值s1、s2。其中,各該取樣值可以是一亮度(luma)值、一色度(chroma)值、一邊緣(edge)值,一像素顏色值(RGB)或一移動向量(motion vector)。 In the case of quadrilaterals, it is assumed that four vertices (A, B, C, D) from the modified vertex list (forming a quadrilateral of the polygonal mesh of FIG. 3B ) are located in the aforementioned twenty control regions R(1) Within a range of ~R(20) and overlapped by two lens images (front and right; N=2), the four vertices (A, B, C, D) in the vertex list respectively contain the following data structures: Vertex A: {(x A ,y A ),2,ID Front ,(u 1A ,v 1A ),w 1A ,ID Right ,(u 2A ,v 2A ),w 2A }; Vertex B: {(x B ,y B ),2,ID Front ,(u 1B ,v 1B ),w 1B ,ID Right ,(u 2B ,v 2B ),w 2B }; vertex C: {(x C ,y C ),2, ID Front ,(u 1C ,v 1C ),w 1C ,ID Right ,(u 2C ,v 2C ),w 2C ,}; vertex D: {(x D ,y D ),2,ID Front ,(u 1D ,v 1D ),w 1D ,ID Right ,(u 2D ,v 2D ),w 2D }. The rasterization engine 560 directly performs a quadrilateral rasterization operation on the quadrilateral ABCD. Specifically, the rasterization engine 560 uses the following steps to calculate the texture coordinates of each lens image for a point Q (with equidistant rectangular coordinates (x, y) and located within the quadrilateral ABCD of the polygon mesh) : 1. Using a bi-linear interpolation method, according to the equidistant rectangular coordinates (x A , y A , x B , y B , x C , y C , x D , y D , x ,y), calculate four spatial weights (a,b,c,d); 2. Calculate the texture coordinates of the sampling point Q F (corresponding to the point Q) in the frontal lens image: (u1,v1)=( a*u 1A +b*u 1B +c*u 1C +d*u 1D ,a*v 1A +b*v 1B +c*v 1C +d*v 1D ); calculate the sampling point in the right lens image The texture coordinates of Q R (corresponding to the point Q): (u2,v2)=(a*u 2A +b*u 2B +c*u 2C +d*u 2D ,a*v 2A +b*v 2B +c *v 2C +d*v 2D ). Finally, the rasterization engine 560 transmits the two texture coordinates (u1, v1) and (u2, v2) to the two texture mapping engines 571-572 in parallel. Among them, a+b+c+d=1. According to the two texture coordinates (u1, v1) and (u2, v2), the two texture mapping engines 571-572 use any suitable method (eg, nearest-neighbour interpolation, bilinear interpolation) Interpolation, or trilinear interpolation), texture maps the texture data of the front and right lens images to generate two sample values s1, s2. Each of the sample values may be a luma value, a chroma value, an edge value, a pixel color value (RGB) or a motion vector.

在三角形的情況下,柵格化引擎560及二個紋理映射引擎571~572對來自該修正頂點列表的任三個頂點所形成一個三角形(如圖3B)內的各像素進行類似的操作(類似四邊形的情況)以產生二個對應的取樣值s1、s2,除了柵格化引擎560於步驟(1)中是利用一重心加權(barycentric weighting)方法,而非利用上述雙線性內插方法,根據等距長方座標(xA,yA,xB,yB,xC,yC,x,y),計算三個空間權值(a,b,c)。 In the case of triangles, the rasterization engine 560 and the two texture mapping engines 571 to 572 perform similar operations on each pixel in a triangle (as shown in FIG. 3B ) formed by any three vertices from the modified vertex list (similar to quadrilateral) to generate two corresponding sample values s1, s2, except that the rasterization engine 560 uses a barycentric weighting method in step (1) instead of the above-mentioned bilinear interpolation method, According to the equidistant rectangular coordinates (x A , y A , x B , y B , x C , y C , x, y), three spatial weights (a, b, c) are calculated.

在該量測模式下,該量測單元580根據該點Q的等距長方座標(x,y)及二個取樣值(s1~s2),量測/估計該等距長方全景影像中二十個控制區R(1)~R(20)的區域誤差量E(1)~E(20)。根據該點Q的等距長方座標(x,y),量測單元580判斷該點Q是否落入該二十個控制區(請 參考圖3C)之一,若判斷該點Q落入任一控制區,即開始估計/量測該控制區的區域誤差量。該量測單元580可利用任何已知的演算法,例如絕對差值和(sum of absolute differences,SAD)、平方差值和(sum of squared differences,SSD)、中位數絕對誤差(median absolute deviation,MAD)等等,估計/量測該些控制區的區域誤差量。舉例而言,若判斷該點Q落入控制區R(11),即N=2,該量測單元580利用下列方程式:E=|s1-s2|;E(11)+=E,累積該右面鏡頭影像中控制區R(11)的各點與該正面鏡頭影像中控制區R(11)的對應點之間的取樣值差異的絕對值,以得到一SAD值當作該控制區R(11)的區域誤差量E(11)。依此方式,該量測單元580量測二十個控制區R(1)~R(20)的區域誤差量E(1)~E(20)。 In the measurement mode, the measurement unit 580 measures/estimates the equidistant rectangular panoramic image according to the equidistant rectangular coordinates (x, y) and the two sample values (s1-s2) of the point Q. The area error amounts E(1)~E(20) of the twenty control areas R(1)~R(20). According to the equidistant rectangular coordinates (x, y) of the point Q, the measurement unit 580 determines whether the point Q falls within the twenty control areas (please Referring to one of FIG. 3C ), if it is determined that the point Q falls within any control area, the estimation/measurement of the area error of the control area is started. The measurement unit 580 may utilize any known algorithm, such as sum of absolute differences (SAD), sum of squared differences (SSD), median absolute deviation (median absolute deviation) , MAD), etc., to estimate/measure the area errors of these control areas. For example, if it is determined that the point Q falls within the control region R(11), that is, N=2, the measurement unit 580 uses the following equation: E=|s1-s2|; E(11)+=E, and accumulates the The absolute value of the difference in sampling values between each point in the control area R(11) in the right lens image and the corresponding point in the control area R(11) in the front lens image, to obtain a SAD value as the control area R( 11) of the area error amount E(11). In this way, the measuring unit 580 measures the regional error amounts E(1)-E(20) of the twenty control regions R(1)-R(20).

本發明特色之一是在一預設的迴圈數目(圖6A中的Q1)內最小化不匹配的影像缺陷。該預設的迴圈數目係有關於一偏移量ofs,該偏移量ofs係上述影像擷取模組21的鏡頭中心46偏離其系統中心43的距離(參考圖4B)。 One of the features of the present invention is to minimize mismatched image defects within a predetermined number of loops (Q1 in FIG. 6A). The predetermined number of loops is related to an offset ofs, and the offset ofs is the distance that the lens center 46 of the image capturing module 21 deviates from the system center 43 thereof (refer to FIG. 4B ).

請回到圖2,在量測模式下,根據圖4B的偏移量ofs,該拼接決策單元230將二十個接合係數C(1)~C(20)設定至不同數值範圍,以量測該些區域誤差量,且每一次(或每一次迴圈)係將該二十個接合係數設定至相同值。例如,假設ofs=3公分,該二十個接合係數C(1)~C(20)被設定至數值範圍0.96~1.04,倘若每次增量是0.01,就會有總共九次的量測;假設ofs=1公分,該二十個接合係數 C(1)~C(20)被設定至數值範圍0.99~1.00,若每次增量是0.001,就會有總共十次的量測。 Returning to FIG. 2 , in the measurement mode, according to the offset ofs in FIG. 4B , the splicing decision unit 230 sets the twenty joint coefficients C( 1 ) to C( 20 ) to different value ranges to measure The amount of regional error, and each time (or each loop) the twenty engagement coefficients are set to the same value. For example, assuming ofs=3 cm, the twenty joint coefficients C(1)~C(20) are set to a value range of 0.96~1.04, if each increment is 0.01, there will be a total of nine measurements; Assuming ofs=1 cm, the twenty joint coefficients C(1)~C(20) are set to the value range of 0.99~1.00. If each increment is 0.001, there will be a total of ten measurements.

圖6A係根據本發明一實施例,顯示決定所有控制區之最佳接合係數之方法流程圖。以下,請參考圖4B、5及6A,假設ofs=3公分,說明本發明決定所有控制區之最佳接合係數之方法(適用於量測模式下之拼接決策單元230)。 FIG. 6A is a flowchart showing a method for determining the optimal bonding coefficients of all control regions according to an embodiment of the present invention. 4B, 5 and 6A, assuming ofs=3 cm, the method of determining the optimal joint coefficients of all control regions in the present invention will be described (applicable to the splicing decision unit 230 in the measurement mode).

步驟S602:將迴圈數目Q1及測試接合係數分別設成新的值。一實施例中,第一次迴圈中將Q1設為1,之後每次迴圈都將Q1增加1;若ofs=3公分,第一次迴圈中將該些測試接合係數C(1)~C(20)都設為0.96(即C(1)=...=C(20)=0.96),並在後續迴圈中,依序將該些接合係數C(1)~C(20)設為0.97,....,1.04。 Step S602: Set the number of loops Q1 and the test engagement coefficient to new values respectively. In one embodiment, Q1 is set to 1 in the first loop, and Q1 is increased by 1 for each subsequent loop; if ofs=3 cm, these test joint coefficients C(1) are set in the first loop ~C(20) are all set to 0.96 (ie, C(1)=...=C(20)=0.96), and in the subsequent loops, these joint coefficients C(1)~C(20 ) is set to 0.97,....,1.04.

步驟S604:將所有區域誤差量E(m)清除為0,其中,m=1,2,...,20。 Step S604: Clear all the regional error amounts E(m) to 0, where m=1, 2, . . . , 20.

步驟S606:在該頂點處理裝置210根據步驟S602中所設定的測試接合係數,完成操作後,由該影像處理裝置220的圖像引擎56量測/取得該等距長方全景影像的二十個控制區R(1)~R(20)的區域誤差量E(1)~E(20)。為方便描述,利用E(m)=f(C(m))來代表本步驟S606,其中,m=1,2,...,20,以及f()代表(由該圖像引擎56)根據對應的測試接合係數C(m)與該影像擷取模組21輸出的四個鏡頭影像,量測該些區域誤差量E(m)。 Step S606 : After the vertex processing device 210 completes the operation according to the test joint coefficient set in step S602 , the image engine 56 of the image processing device 220 measures/obtains twenty equidistant rectangular panoramic images. The area error amount E(1)~E(20) of the control area R(1)~R(20). For the convenience of description, this step S606 is represented by E(m)=f(C(m)), where m=1, 2, . . . , 20, and f() represents (by the image engine 56 ) According to the corresponding test joint coefficient C(m) and the four lens images output by the image capturing module 21, the regional error amounts E(m) are measured.

步驟S608:儲存所有區域誤差量E(1)~E(20)於一個2D誤差表格中。表三顯示當ofs=3公分(測試接合係數的數值範圍 0.96~1.04)時,該2D誤差表格的一個例子。 Step S608: Store all the regional error quantities E(1)-E(20) in a 2D error table. Table 3 shows that when ofs=3 cm (the numerical range of the test joint coefficient 0.96~1.04), an example of this 2D error table.

Figure 110121015-A0305-02-0019-3
Figure 110121015-A0305-02-0019-3

在表三的2D誤差表格中,總共有二十個區域誤差量及九個不同的測試接合係數。由於篇幅的限制,表四僅顯示出八個區域誤差量及六個不同的測試接合係數,其餘暫時跳過。請注意,在上述2D誤差表格中區域誤差量及測試接合係數的數目僅為一示例,而非本發明的限制。在實際實施時,上述2D誤差表格可以使用任何數目的區域誤差量及接合係數。 In the 2D error table of Table 3, there are a total of twenty regional error quantities and nine different test joint coefficients. Due to space limitations, Table 4 only shows eight regional error quantities and six different test junction coefficients, and the rest are temporarily skipped. Please note that the area error amount and the number of test joint coefficients in the above 2D error table are only an example, and not a limitation of the present invention. In practical implementation, the above 2D error table can use any number of regional error quantities and joint coefficients.

步驟S610:決定迴圈次數Q1是否到達上限9。若是,跳到步驟S612,否則,回到步驟S602。 Step S610: Determine whether the number of loops Q1 reaches the upper limit 9. If yes, go to step S612, otherwise, go back to step S602.

步驟S612:根據上述2D誤差表格,進行係數決策操作。 Step S612: Perform a coefficient decision operation according to the above 2D error table.

步驟S614:輸出最佳接合係數C(m),其中,m=1,2,...,20。在該顯像模式中,輸出該些最佳接合係數C(m)至該頂點 處理裝置210,使得該影像處理裝置220產生一對應的等距長方全景影像。 Step S614 : output the optimal joint coefficient C(m), where m=1, 2, . . . , 20. In the developing mode, output the optimal joint coefficients C(m) to the vertex The processing device 210 enables the image processing device 220 to generate a corresponding isometric rectangular panoramic image.

圖6B係根據本發明一實施例,顯示該拼接決策單元230進行步驟S612之係數決策操作之方法流程圖。以下,請參考圖3C及6A-6B,說明該進行係數決策操作之所有步驟。 FIG. 6B is a flowchart showing a method for the splicing decision unit 230 to perform the coefficient decision operation of step S612 according to an embodiment of the present invention. In the following, please refer to FIGS. 3C and 6A-6B, which describe all the steps of performing the coefficient decision operation.

步驟S661:將Q2設為0以進行初始化。 Step S661: Set Q2 to 0 for initialization.

步驟S662:從上述2D誤差表格中,擷取出一選定之決策群組。回到圖3C及7B,通常各控制區係分別鄰接二個控制區,一選定之控制區及其鄰接的二個控制區形成一選定之決策群組,以決定該選定之控制區之最佳接合係數。例如,一選定控制區R(9)及其鄰接的二個控制區R(8)及R(10)形成一決策群組。然而,若一選定之控制區(如R(1))係位在重疊區的頂部或底部,則該選定之控制區R(1)就只會與其唯一鄰接的控制區R(2)形成一決策群組,以決定其最佳接合係數C(1)。後續步驟的說明係假設選定一控制區R(2),且R(2)與其鄰接的二個控制區R(1)及R(3)形成一選定之決策群組,以決定其最佳接合係數C(2)。 Step S662: Extract a selected decision group from the 2D error table. 3C and 7B, usually each control area is adjacent to two control areas, a selected control area and its adjacent two control areas form a selected decision group to determine the best control area for the selected control area engagement factor. For example, a selected control region R(9) and its adjacent two control regions R(8) and R(10) form a decision group. However, if a selected control region (eg, R(1)) is located at the top or bottom of the overlapping region, then the selected control region R(1) will only form a single adjacent control region R(2). Decision group to determine its best engagement coefficient C(1). The description of the subsequent steps assumes that a control region R(2) is selected, and that R(2) and its adjacent two control regions R(1) and R(3) form a selected decision group to determine its optimal bonding Coefficient C(2).

步驟S664:在該選定決策群組的各控制區的區域誤差量中,決定局部最小值。表四顯示R(1)~R(3)的區域誤差量及測試接合係數的一個例子。 Step S664: Determine a local minimum value among the regional error amounts of each control area of the selected decision group. Table 4 shows an example of the area error amounts of R(1)~R(3) and the test joint coefficient.

Figure 110121015-A0305-02-0020-4
Figure 110121015-A0305-02-0020-4
Figure 110121015-A0305-02-0021-5
Figure 110121015-A0305-02-0021-5

如表四所示,在R(1)的九個區域誤差量中只有一個局部最小值,而在R(2)及R(3)的九個區域誤差量中各有二個局部最小值,其中表四中各局部最小值旁分別標出星號(*)。 As shown in Table 4, there is only one local minimum in the nine regional error quantities of R(1), and there are two local minima in each of the nine regional error quantities of R(2) and R(3). Among them, each local minimum value in Table 4 is marked with an asterisk (*).

步驟S666:根據該些局部最小值,選出候選者。表五顯示從表四之該些局部最小值中,選出候選者,其中ID表示索引、WC表示接合係數,而RE表示區域誤差量。候選者的數目等於表四中該些局部最小值的數目。 Step S666: Select candidates according to the local minima. Table 5 shows that candidates are selected from the local minima in Table 4, where ID represents the index, WC represents the junction coefficient, and RE represents the regional error amount. The number of candidates is equal to the number of the local minima in Table 4.

Figure 110121015-A0305-02-0021-6
Figure 110121015-A0305-02-0021-6
Figure 110121015-A0305-02-0022-7
Figure 110121015-A0305-02-0022-7

步驟S668:根據表五的該些候選者,建立一連結計量(link metric)。如圖6C所示,根據表五的該些候選者,建立一連結計量。 Step S668: Create a link metric according to the candidates in Table 5. As shown in FIG. 6C , according to the candidates in Table 5, a link meter is established.

步驟S670:在該連結計量的所有路徑中,決定連結計量 值的最小總和。關於二個連結計量值

Figure 110121015-A0305-02-0022-14
Figure 110121015-A0305-02-0022-15
,其二者 間的最小值
Figure 110121015-A0305-02-0022-10
。關於二個連結計量值
Figure 110121015-A0305-02-0022-8
Figure 110121015-A0305-02-0022-9
,其二者間的最小值
Figure 110121015-A0305-02-0022-11
。之後,分別計算路徑0-0-0及路徑0-1- 1的連結計量值的總和如下:
Figure 110121015-A0305-02-0022-17
Figure 110121015-A0305-02-0022-18
Figure 110121015-A0305-02-0022-19
。因為
Figure 110121015-A0305-02-0022-20
>
Figure 110121015-A0305-02-0022-21
,故可決定
Figure 110121015-A0305-02-0022-23
(路徑0-1-1)是 該連結計量的所有路徑中,連結計量值的最小總和,如第6C圖中的實線路徑。 Step S670 : In all the paths of the connection measurement, determine the minimum sum of connection measurement values. About two linked metrics
Figure 110121015-A0305-02-0022-14
and
Figure 110121015-A0305-02-0022-15
, the minimum value between the two
Figure 110121015-A0305-02-0022-10
. About two linked metrics
Figure 110121015-A0305-02-0022-8
and
Figure 110121015-A0305-02-0022-9
, the minimum value between the two
Figure 110121015-A0305-02-0022-11
. After that, calculate the sum of the connection meter values of path 0-0-0 and path 0-1-1 respectively as follows:
Figure 110121015-A0305-02-0022-17
and
Figure 110121015-A0305-02-0022-18
Figure 110121015-A0305-02-0022-19
. because
Figure 110121015-A0305-02-0022-20
>
Figure 110121015-A0305-02-0022-21
, so it can be determined
Figure 110121015-A0305-02-0022-23
(Path 0-1-1) is the smallest sum of connection meter values among all paths of the connection meter, such as the solid line path in Figure 6C.

步驟S672:決定該選定控制區之最佳接合係數。關於步驟S670所舉的例子中,因為

Figure 110121015-A0305-02-0022-35
(路徑0-1-1)是所有路徑中連結計量值的最小總和,故決定1.02為控制區R(2)之最佳接合係數。然而,若結束計算時有二條或更多路徑的連結計量值總和相同,就選擇具最小區域誤差量之節點的接合係數,當作該選定控制區之最佳接合係數。在此,將迴圈次數Q2的值遞增1。 Step S672: Determine the optimal bonding coefficient of the selected control area. In the example given in step S670, because
Figure 110121015-A0305-02-0022-35
(Path 0-1-1) is the minimum sum of connection metering values in all paths, so 1.02 is determined as the optimal bonding coefficient for the control region R(2). However, if there are two or more paths with the same sum of link metrics at the end of the calculation, the joint coefficient of the node with the smallest area error is selected as the best joint coefficient for the selected control area. Here, the value of the number of loops Q2 is incremented by one.

步驟S674:決定迴圈次數Q2是否到達上限20。若是,結束本流程,否則,回到步驟S662以處理下一個控制區。 Step S674: Determine whether the number of laps Q2 reaches the upper limit of 20. If yes, end the flow, otherwise, go back to step S662 to process the next control area.

在通篇說明書及後續的請求項當中所提及的相關用語定義如下,除非本說明書中另有特別指明。「工作面(face)影像」一詞指的是源自於該影像擷取模組21的一對應鏡頭影像的投影而產生的影像;該投影例如等距長方投影、圓柱投影、米勒投影、墨卡托投影、蘭伯特圓柱等面積投影或帕尼尼(Pannini)投影等。「接縫(seam)區」一詞指的是在一投影影像中,位在二個相鄰的第一主影像及第二主影像的中間,且被一接縫影像A以及一接縫影像B所重疊,其中該第一主影像與該接縫影像A是一第一工作影像的一部分,而該第二主影像與該接縫影像B是一第二工作影像的一部分。一般而言,工作面影像係分割成三部分以進行後續的拼接處理,例如,圖7A中,左面工作面影像的第一部份係位在接縫區S(2)內或位在左面主影像的右側,稱為接縫影像A;左面工作面影像的第二部份係位在接縫區S(1)內或在左主影像的左側,稱為接縫影像B;左面工作面影像的第三部份係位在接縫區S(1)及S(2)的中間,稱為左面主影像。相同的分割方式也適用於右面工作面影像、正面工作面影像、背面工作面影像。 Relevant terms referred to throughout the specification and subsequent claims are defined below, unless otherwise specifically indicated in this specification. The term "face image" refers to an image derived from the projection of a corresponding lens image of the image capture module 21; the projection such as equirectangular projection, cylindrical projection, Miller projection , Mercator projection, Lambert cylinder equal area projection or Pannini projection, etc. The term "seam area" refers to a projection image that is located in the middle of two adjacent first and second main images, and is surrounded by a seam image A and a seam image B overlaps, wherein the first main image and the seam image A are part of a first working image, and the second main image and the seam image B are part of a second working image. Generally speaking, the working surface image is divided into three parts for subsequent splicing processing. For example, in FIG. 7A, the first part of the left working surface image is located in the seam area S(2) or located in the main left side. The right side of the image is called seam image A; the second part of the left working surface image is located in the seam area S(1) or on the left side of the left main image, called seam image B; the left working surface image The third part is located in the middle of the seam area S(1) and S(2), and is called the left main image. The same segmentation method also applies to the right work surface image, the front work surface image, and the back work surface image.

圖7A顯示一等距長方全景影像包含四個主影像及四個接縫區的例子。圖7B顯示圖7A的接縫區S(2)的放大圖。圖7B中的四邊形72對應圖3B多邊形網格的四邊形,以及四邊形72的交叉點71就是頂點。根據影像擷取模組21中鏡頭的FOV、鏡頭感測器的解析度以及鏡頭的角度,重疊區的大小會隨之變動。根據本發明,P1個控制區位在一接縫區內,而該接縫區位在一對應重疊 區內,其中P1>=3。一般來說,該重疊區的寬度大於或等於該接縫區的寬度,而該接縫區的寬度大於或等於該P1個控制區的寬度。例如,接縫區S(2)位在重疊區A(2)內(圖未示),A(2)的寬度大於或等於S(2)的寬度,而S(2)的寬度大於或等於R(6)~R(10)的寬度。一較佳實施例中,重疊區(如A(2))、接縫區(如S(2))及控制區(如R(6)~R(10))的寬度的比例為7:5:1。另一實施例中,重疊區(如A(2))、接縫區(如S(2))及控制區(如R(6)~R(10))的寬度的比例為9:7:1、9:9:1、9:5:1、7:7:1或5:5:1。 FIG. 7A shows an example of an equidistant rectangular panoramic image including four main images and four seam regions. FIG. 7B shows an enlarged view of the seam area S( 2 ) of FIG. 7A . The quadrilaterals 72 in FIG. 7B correspond to the quadrilaterals of the polygon mesh of FIG. 3B , and the intersections 71 of the quadrilaterals 72 are vertices. According to the FOV of the lens in the image capturing module 21, the resolution of the lens sensor and the angle of the lens, the size of the overlapping area will vary accordingly. According to the present invention, P1 control areas are located in a seam area, and the seam area is located in a corresponding overlap area, where P1>=3. Generally, the width of the overlapping region is greater than or equal to the width of the seam region, and the width of the seam region is greater than or equal to the width of the P1 control regions. For example, the seam area S(2) is located in the overlapping area A(2) (not shown), the width of A(2) is greater than or equal to the width of S(2), and the width of S(2) is greater than or equal to The width of R(6)~R(10). In a preferred embodiment, the ratio of the widths of the overlapping area (eg A(2)), the seam area (eg S(2)) and the control area (eg R(6)-R(10)) is 7:5 :1. In another embodiment, the ratio of the widths of the overlapping area (eg A(2)), the seam area (eg S(2)) and the control area (eg R(6) to R(10)) is 9:7: 1, 9:9:1, 9:5:1, 7:7:1 or 5:5:1.

為了產生圖7A的等距長方全景影像,圖像引擎56根據來自影像擷取模組21的四個鏡頭影像的等距長方投影,產生四個工作面影像,實際運作時,係產生與上述四個工作面影像有關的九個影像,即一個首要影像(包含背面主影像、正面主影像、左面主影像及右面主影像)以及八個接縫影像(包含四個接縫影像A與四個接縫影像B)。為了在九個不同緩衝器儲存上述九個影像以進行後續的拼接操作,於顯像模式中,對應性產生器23產生(m1+8)個原始單鏡頭頂點列表,亦即m1個原始主要頂點列表以及八個原始接縫頂點列表分別對應至上述四個工作面影像與八個接縫影像,其中1<=m1<=4。舉例而言,若m1=1,則利用一個原始主要頂點列表來一次產生四個主影像;若m1=2,則利用二個原始主要頂點列表之任一來一次產生二個主影像;若m1=4,則利用四個原始主要頂點列表之任一來一次產生該四個主影像之一。對應地,為最小化因影像擷取模組21的鏡頭中心偏移而造成的不匹配影像缺陷問題,根據該(m1+8)個原始單鏡頭頂點列表及上述二十個最佳接合係數C(1)~C(20),該頂點處理裝置210產生(m1+8)個修正單鏡頭頂點列表,亦即m1個修正主要頂點列表以及八個修正接縫 頂點列表以分別對應至上述四個工作面影像與八個接縫影像。請注意,各該(m1+8)個原始單鏡頭頂點列表的格式類似於表一,但僅包含單一鏡頭的一組參數,即IDk、(uk,vk)、(idxk0,idxk1)以及Alphak,其中k=0、1、2或3。請注意,各該(m1+8)個修正單鏡頭頂點列表的格式類似於表二,但僅包含單一鏡頭的一組參數,即IDk以及(u’k,v’k),其中k=0、1、2或3。 In order to generate the equidistant rectangular panorama image shown in FIG. 7A , the image engine 56 generates four working surface images according to the equidistant rectangular projection of the four lens images from the image capturing module 21 . The nine images related to the above four working surface images, namely one primary image (including the rear main image, front main image, left main image and right main image) and eight seam images (including four seam images A and four a seam image B). In order to store the above-mentioned nine images in nine different buffers for subsequent stitching operations, in the development mode, the correspondence generator 23 generates (m1+8) original single-shot vertex lists, that is, m1 original primary vertices The list and the eight original seam vertex lists correspond to the above four work plane images and eight seam images respectively, where 1<=m1<=4. For example, if m1=1, use one original main vertex list to generate four main images at a time; if m1=2, use either of the two original main vertex lists to generate two main images at a time; if m1 = 4, then use any of the four original primary vertex lists to generate the four primary images one at a time. Correspondingly, in order to minimize the problem of mismatched image defects caused by the offset of the lens center of the image capture module 21, according to the (m1+8) original single-lens vertex list and the above twenty optimal joint coefficients C (1) to C(20), the vertex processing device 210 generates (m1+8) modified single-lens vertex lists, that is, m1 modified main vertex lists and eight modified seam vertex lists respectively corresponding to the above four Work plane image and eight seam images. Note that the format of each of the (m1+8) original single-shot vertex lists is similar to Table 1, but only contains one set of parameters for a single shot, namely ID k , (u k ,v k ), (idx k0 ,idx k1 ) and Alpha k , where k=0, 1, 2 or 3. Please note that the format of each of the (m1+8) corrected single-shot vertex lists is similar to Table 2, but only contains a set of parameters for a single shot, namely ID k and (u' k ,v' k ), where k= 0, 1, 2 or 3.

於顯像模式中,根據上述m1個修正主要頂點列表以及該四個鏡頭影像,該圖像引擎56進行柵格化操作及紋理映射以產生上述首要影像(包含背面主影像、正面主影像、左面主影像及右面主影像)。接著,根據上述八個修正接縫頂點列表以及該四個鏡頭影像,該圖像引擎56”依序”進行柵格化操作及紋理映射以產生上述四個接縫影像A及四個接縫影像B,亦即一次產生一張接縫影像。例如,該圖像引擎56根據一個對應的修正接縫頂點列表以及一正面鏡頭影像,進行柵格化操作及紋理映射,以一次產生一個與該正面工作面影像有關的接縫影像A。於另一實施例中,該圖像引擎56可以相反順序來產生上述影像,亦即,可以先產生上述八個接縫影像,再產生上述首要影像。 In the development mode, according to the m1 corrected main vertex lists and the four lens images, the image engine 56 performs rasterization and texture mapping to generate the above-mentioned main images (including the back main image, the front main image, the left main image and the left main image). main image and right main image). Then, according to the above-mentioned eight modified seam vertex lists and the four lens images, the image engine 56 "sequentially" performs rasterization and texture mapping to generate the above-mentioned four seam images A and four seam images B, that is, one seam image is generated at a time. For example, the image engine 56 performs rasterization and texture mapping according to a corresponding list of modified seam vertices and a frontal lens image to generate a seam image A associated with the frontal face image one at a time. In another embodiment, the image engine 56 can generate the above-mentioned images in reverse order, that is, the above-mentioned eight seam images can be generated first, and then the above-mentioned primary image can be generated.

有一個特例是該影像擷取模組21包含一部廣角照相機時,在等距長方投影影像的最左側工作面影像與最右側工作面影像都僅包含一主影像及一接縫影像,亦即該最左側工作面影像與最右側工作面影像的接縫影像A及接縫影像B之其一會被併入主影像。例如,假設該影像擷取模組21包含一部雙鏡頭的廣角照相機(如180°×60°)以產生一左鏡頭影像與一右鏡頭影像,該圖像引擎56根據該二個鏡頭影像、一個或二個修正主要頂點列表以及二個修正接縫頂點列表,產生一首要影像 (包含一左面主影像與一左面主影像)以及與單一接縫區有關的一接縫影像A及一接縫影像B。最後,該影像處理裝置220再將該首要影像、該接縫影像A及該接縫影像B組成一廣角影像。 There is a special case that when the image capture module 21 includes a wide-angle camera, the leftmost working surface image and the rightmost working surface image of the equidistant rectangular projection image only include a main image and a seam image, and also That is, one of the seam image A and the seam image B of the leftmost working face image and the rightmost working face image will be merged into the main image. For example, assuming that the image capture module 21 includes a dual-lens wide-angle camera (eg, 180°×60°) to generate a left-lens image and a right-lens image, the image engine 56 generates a left-lens image and a right-lens image according to the two lens images, One or two modified primary vertex lists and two modified seam vertex lists, resulting in a primary image (including a left main image and a left main image) and a seam image A and a seam image B related to a single seam area. Finally, the image processing device 220 further forms a wide-angle image from the primary image, the seam image A, and the seam image B.

圖7C係根據本發明一實施例,顯示決定一接縫區的最小化誤差路徑(或一接縫)之方法的流程圖。以下,請參考圖5及7A-7D,說明該決定一接縫區的最小化誤差路徑之方法(由該影像處理裝置220之接縫引擎55於顯像模式下所進行)。 7C is a flowchart illustrating a method of determining an error-minimizing path (or a seam) for a seam region, according to an embodiment of the present invention. Hereinafter, referring to FIGS. 5 and 7A-7D, the method of determining the minimizing error path of a seam region (performed by the seam engine 55 of the image processing device 220 in the developing mode) will be described.

為方便說明,座標(x,y)指的是在一等距長方投影領域中一像素的位置。 For the convenience of description, the coordinates (x, y) refer to the position of a pixel in an equidistant rectangular projection field.

步驟S702:於同一個接縫區中,計算接縫影像A中各像素位置相對於接縫影像B中之鄰近像素位置的像素值差異的絕對值。一實施例中,提供以下程式碼來計算同一個接縫區(範圍由Y0至Y1及X0至X1)中,接縫影像A中各像素位置(x,y)相對於接縫影像B的鄰近像素位置(x+1,y)的像素值差異的絕對值|A(x,y)-B(x+1,y)|,其中A(x,y)表示與一第一工作面影像有關之接縫影像A中位置(x,y)上的像素值,而B(x+1,y)表示與一第二工作面影像有關之接縫影像B中位置(x+1,y)上的像素值。請注意,二個像素A(x,y)及B(x+1,y)必須位在同一列y上,以及該第一工作面影像與該第二工作面影像在上述接縫區重疊。 Step S702 : In the same seam area, calculate the absolute value of the pixel value difference between each pixel position in the seam image A relative to the adjacent pixel position in the seam image B. In one embodiment, the following code is provided to calculate the proximity of each pixel position (x, y) in the seam image A relative to the seam image B in the same seam area (range from Y0 to Y1 and X0 to X1) The absolute value of the pixel value difference at the pixel position (x+1,y) |A(x,y)-B(x+1,y)|, where A(x,y) indicates that it is related to a first working plane image The pixel value at the position (x, y) in the seam image A, and B(x+1, y) represents the position (x+1, y) in the seam image B related to a second working plane image pixel value. Please note that the two pixels A(x, y) and B(x+1, y) must be located on the same row y, and the first working plane image and the second working plane image overlap in the seam area.

Figure 110121015-A0305-02-0026-24
Figure 110121015-A0305-02-0027-25
Figure 110121015-A0305-02-0026-24
Figure 110121015-A0305-02-0027-25

另一實施例中,係計算接縫影像A中各像素位置相對於接縫影像B中之鄰近像素位置的像素值平方差(squared error),而非像素值差異或誤差的絕對值。 In another embodiment, the squared error of the pixel value of each pixel position in the seam image A relative to the adjacent pixel position in the seam image B is calculated, rather than the absolute value of the pixel value difference or error.

步驟S704:於上述接縫區中,計算於一目前列中各像素的最小累積誤差(或最小累積像素值差異的絕對值),並找出上一列中具最小累積誤差的X座標。一實施例中,提供以下程式碼來計算計算於一目前列y中各像素的最小累積誤差,並找出上一列(y-1)中具最小累積誤差的X座標,其中y的範圍從Y0至Y1。 Step S704: Calculate the minimum cumulative error (or the absolute value of the minimum cumulative pixel value difference) of each pixel in a current row in the seam area, and find the X coordinate with the minimum cumulative error in the previous row. In one embodiment, the following code is provided to calculate the minimum cumulative error of each pixel in a current row y, and find the X coordinate with the smallest cumulative error in the previous row (y-1), where y ranges from Y0 to Y1.

Figure 110121015-A0305-02-0027-26
Figure 110121015-A0305-02-0028-27
Figure 110121015-A0305-02-0027-26
Figure 110121015-A0305-02-0028-27

步驟S706:於該接縫區的最下面一列中,找出具最小累積誤差的X座標。一實施例中,提供以下程式碼來找出該接縫區的最下面一列中具最小累積誤差的X座標。 Step S706: Find the X coordinate with the smallest accumulated error in the bottom row of the seam area. In one embodiment, the following code is provided to find the X coordinate with the smallest accumulated error in the bottom row of the seam region.

Figure 110121015-A0305-02-0028-28
Figure 110121015-A0305-02-0028-28

步驟S708:從該接縫區的最下面一列追蹤/回溯至最上面一列,以形成一最小化誤差路徑(或一接縫)。如圖7D所示,一接縫78橫跨該接縫區S(2)且於每一列具有一像素位置,即x座標。其中,該接縫78是該接縫區的所有列上的一連串分隔點(或接縫點)的集合。一實施例中,提供以下程式碼來形成一接縫區的接縫:

Figure 110121015-A0305-02-0029-29
Step S708: Trace/backtrack from the bottom row of the seam area to the top row to form an error-minimizing path (or a seam). As shown in FIG. 7D, a seam 78 spans the seam region S(2) and has a pixel position, ie, the x-coordinate, in each row. Therein, the seam 78 is a collection of a series of separation points (or seam points) on all columns of the seam area. In one embodiment, the following code is provided to form a seam in a seam area:
Figure 110121015-A0305-02-0029-29

於本步驟結束時,陣列Seam[y]會包含該接縫區的所有列(Y0~Y1)上的一連串分隔點,即該最小化誤差路徑或該接縫。於另一實施例中,本領域技術人士可適當地修正步驟S704~S708的內容,以相反順序(從該接縫區的最上面一列追蹤至最下面一列),形成該接縫區的接縫,此亦落入本發明之申請專利範圍內。 At the end of this step, the array Seam[y] will contain a series of separation points on all columns (Y0~Y1) of the seam region, ie the minimized error path or the seam. In another embodiment, those skilled in the art can appropriately modify the contents of steps S704-S708 to form the seam of the seam area in the reverse order (trace from the uppermost row to the lowermost row of the seam area). , which also falls within the scope of the patent application of the present invention.

圖8A係根據本發明一實施例,顯示一影像處理方法的流程圖。以下,請參考圖2、5及8A-8D,說明該影像處理方法(係適用於本發明投影影像處理系統200)。 8A is a flowchart illustrating an image processing method according to an embodiment of the present invention. Hereinafter, please refer to FIGS. 2 , 5 and 8A-8D to describe the image processing method (which is applicable to the projection image processing system 200 of the present invention).

步驟S802:得到具有所有測試接合係數及所有控制區的區域誤差量的2D誤差表格。請參考圖6A的步驟S602~S610。於本步驟S802結束時,可得到包含所有測試接合係數以及所有控制區R(1)~R(20)的區域誤差量E(1)~E(20)的2D誤差表格(如表三)。請注意,所有測試接合 係數係有關於上述影像擷取模組21的鏡頭中心46偏離系統中心43的偏移量ofs,如圖4B所示。 Step S802: Obtain a 2D error table with all the test bonding coefficients and the regional error amounts of all the control regions. Please refer to steps S602 to S610 in FIG. 6A . At the end of this step S802, a 2D error table (see Table 3) including all the test bonding coefficients and the regional error amounts E(1)-E(20) of all the control regions R(1)-R(20) can be obtained. Note that all tests engage The coefficient is related to the offset ofs from the center 46 of the lens of the image capturing module 21 from the center 43 of the system, as shown in FIG. 4B .

步驟S804:根據上述2D誤差表格,決定所有控制區之最佳接合係數。請參考圖6A的步驟S612~S61及圖6B的步驟S661~S674。於本步驟S804結束時,可得到所有控制區R(1)~R(20)的最佳接合係數C(1)~C(20),並傳送至該頂點處理裝置210;同時,結束量測模式及開始顯像模式。 Step S804: According to the above-mentioned 2D error table, determine the optimal bonding coefficients of all control regions. Please refer to steps S612 - S61 in FIG. 6A and steps S661 - S674 in FIG. 6B . At the end of this step S804, the optimal bonding coefficients C(1)-C(20) of all the control regions R(1)-R(20) can be obtained, and sent to the vertex processing device 210; at the same time, the measurement is ended mode and start developing mode.

步驟S806:根據多個鏡頭影像、多個原始單鏡頭頂點列表以及於步驟S804取得之最佳接合係數,產生各工作面影像。如前面所述,該頂點處理裝置210根據對應性產生器23輸出的多個原始單鏡頭頂點列表(包含至少一原始主要頂點列表及多個原始接縫頂點列表)以及於步驟S804取得之最佳接合係數,依序產生多個修正單鏡頭頂點列表(包含至少一修正主要頂點列表及多個修正接縫頂點列表)。於圖7的具四個接縫區的等距長方全景影像的例子中,於量測模式下,圖5的圖像引擎56根據來自上述影像擷取模組21的四個鏡頭影像、(m1+8)個修正單鏡頭頂點列表以及於步驟S804取得之二十個最佳接合係數C(1)~C(20),產生四個工作面影像(包含四個主影像、四個接縫影像A以及四個接縫影像B),其中1<=m1<=4。於產生上述四個工作面影像後,圖像引擎56利用以下二種方式之一來儲存九個影像(包含一個首要影像(共包含該四個主影像)、該四個接縫影像A以及該四個接縫影像B)。方式一:首先,由該圖像引擎56將該九個影像儲存於九個不同暫時緩衝器520,且該九個影像之間彼此不重疊;之後,將該首要影像傳送至一目的緩衝器510,其中的四個接縫區是空的;最後,由該接縫引擎55根據上述四 個接縫影像A以及該四個接縫影像B,產生四個拼接後接縫影像後,再將該四個拼接後接縫影像儲存於該目的緩衝器510的四個接縫區以進行顯示。方式二:首先,由該圖像引擎56將該首要影像直接儲存於該目的緩衝器510以及將該上述四個接縫影像A以及該四個接縫影像B分別儲存於八個不同暫時緩衝器520;接著,由該接縫引擎55根據上述四個接縫影像A以及該四個接縫影像B產生四個拼接後接縫影像之後,再將該四個拼接後接縫影像儲存於該目的緩衝器510的四個接縫區。舉例而言,為左面工作面影像之一部份的接縫影像A以及為正面工作面影像之一部份的接縫影像B被饋入至該接縫引擎55以進行拼接,並產生一拼接後接縫影像後,再將該拼接後接縫影像儲存於該目的緩衝器510的接縫區S(2),如圖7A所示。 Step S806 : According to the plurality of lens images, the plurality of original single-lens vertex lists, and the optimal joint coefficient obtained in step S804 , each working surface image is generated. As described above, the vertex processing device 210 obtains the best single-camera vertex list (including at least one original main vertex list and a plurality of original seam vertex lists) outputted by the correspondence generator 23 and the best one obtained in step S804. The joint coefficient is used to sequentially generate a plurality of modified single-lens vertex lists (including at least one modified main vertex list and a plurality of modified seam vertex lists). In the example of the equidistant rectangular panoramic image with four seam areas in FIG. 7, in the measurement mode, the image engine 56 in FIG. m1+8) corrected single-camera vertex lists and the twenty optimal joint coefficients C(1)-C(20) obtained in step S804, to generate four working surface images (including four main images, four seams Image A and four seam images B), where 1<=m1<=4. After generating the above four working plane images, the image engine 56 uses one of the following two methods to store nine images (including a primary image (including the four main images in total), the four seam images A and the Four seam images B). Method 1: First, the image engine 56 stores the nine images in nine different temporary buffers 520, and the nine images do not overlap each other; then, the primary image is sent to a destination buffer 510 , in which the four seam areas are empty; finally, the seam engine 55 according to the above four After the four seam images A and the four seam images B are generated, the four seam images after splicing are stored in the four seam areas of the destination buffer 510 for display. . Method 2: First, the image engine 56 directly stores the primary image in the destination buffer 510 and stores the four seam images A and the four seam images B in eight different temporary buffers respectively 520; Next, after the seam engine 55 generates four seam images after splicing according to the four seam images A and the four seam images B, and then stores the four seam images after splicing in the destination The four seam areas of bumper 510. For example, seam image A, which is part of the left work surface image, and seam image B, which is part of the front work surface image, are fed to the seam engine 55 for stitching, and a stitch is generated After the seam image is created, the seam image after splicing is stored in the seam area S( 2 ) of the destination buffer 510 , as shown in FIG. 7A .

假設上述影像擷取模組21包含一個具三鏡頭的廣角照相機且產生三個鏡頭影像(即一左面鏡頭影像、一正面鏡頭影像以及一右面鏡頭影像),圖5的圖像引擎56將根據來自上述三個鏡頭影像、至少五個修正單鏡頭頂點列表以及多個最佳接合係數,產生三個工作面影像(包含三個主影像以及與二個接縫區有關之二個接縫影像A及二個接縫影像B)。於產生上述三個工作面影像後,圖像引擎56利用上述方式一或方式二來儲存五個影像(包含一個首要影像(共包含該三個主影像)、上述二個接縫影像A及二個接縫影像B),以便進行後續的影像拼接。 Assuming that the above-mentioned image capture module 21 includes a wide-angle camera with three lenses and generates three lens images (ie, a left lens image, a front lens image, and a right lens image), the image engine 56 in FIG. The above-mentioned three lens images, at least five modified single-lens vertex lists and a plurality of optimal joint coefficients, generate three work plane images (including three main images and two seam images A and Two seam images B). After generating the above-mentioned three working plane images, the image engine 56 uses the above-mentioned method 1 or method 2 to store five images (including a primary image (including the three main images in total), the above-mentioned two seam images A and two A seam image B) for subsequent image stitching.

步驟S808:決定各接縫區的最小化誤差路徑(或接縫)。一實施例中,係對圖7A的四個接縫區S(1)~S(4)執行圖7C之決定一接縫區的最小化誤差路徑之方法。於本步驟S808結束時,將產生該四個接縫區S(1)~S(4)的四條最小化誤差路徑或接縫。 Step S808: Determine the minimum error path (or seam) of each seam area. In one embodiment, the method of determining an error minimization path for a seam region of FIG. 7C is performed on the four seam regions S( 1 ) to S( 4 ) of FIG. 7A . At the end of this step S808, four error-minimizing paths or seams of the four seam regions S(1)-S(4) will be generated.

步驟S810:根據各接縫區的最小化誤差路徑或接縫,將重疊的接縫影像A與接縫影像B拼接起來。在圖7D的例子中,接縫78是用來將與左面工作面影像有關之接縫影像A以及與正面工作面影像有關之接縫影像B拚接起來,以產生一拼接後接縫影像。最後,總共四張拼接後接縫影像分別儲存於該目的儲存器510的四個接縫區S(1)~S(4),因此,該四張拼接後接縫影像以及上述四張主影像形成一張完整的等距長方全景影像。 Step S810: splicing the overlapping seam image A and seam image B according to the minimized error path or seam of each seam area. In the example of FIG. 7D, seam 78 is used to stitch the seam image A associated with the left working face image and the seam image B associated with the front working face image to produce a stitched seam image. Finally, a total of four spliced seam images are stored in the four seam areas S( 1 ) to S( 4 ) of the destination storage 510 respectively. Therefore, the four spliced seam images and the above four main images A complete isometric rectangular panoramic image is formed.

圖8B顯示一接縫區的其中一段的例子,且該接縫區係有關於一接縫78、一接縫影像A以及一接縫影像B。圖8C顯示一接縫區的大小以及三列的更新視窗81的大小及不同位置的例子。於步驟S810中,本發明提供以下三種方式(1)~(3)來拼接接縫影像A與接縫影像B,以產生一對應拼接後接縫影像。(1)傳統方式:根據各接縫區的最小化誤差路徑或接縫,將對應的接縫影像A與接縫影像B拼接起來。如圖8B所示,對於拼接後接縫影像或接縫區的每一列,若一像素位置(x,y)是位在接縫78的左側,則指定其在接縫影像A的像素值當做該拼接後接縫影像中同一像素位置(x,y)的像素值;相反地,若一像素位置(x,y)是位在接縫78的右側,則指定其在接縫影像B的像素值會當做該拼接後接縫影像中同一像素位置(x,y)的像素值。 FIG. 8B shows an example of a section of a seam area, and the seam area is associated with a seam 78 , a seam image A, and a seam image B. FIG. FIG. 8C shows an example of the size of a seam area and the sizes and different positions of the update windows 81 in three columns. In step S810, the present invention provides the following three methods (1) to (3) for splicing the seam image A and the seam image B to generate a corresponding seam image after splicing. (1) Traditional method: According to the minimized error path or seam of each seam area, the corresponding seam image A and the seam image B are spliced together. As shown in FIG. 8B, for each row of the seam image or seam area after splicing, if a pixel position (x, y) is located on the left side of the seam 78, the pixel value in the seam image A is designated as The pixel value of the same pixel position (x, y) in the seam image after stitching; on the contrary, if a pixel position (x, y) is located on the right side of the seam 78, then specify its pixel in the seam image B The value will be taken as the pixel value at the same pixel position (x,y) in the stitched seam image.

(2)接縫混和方式(各接縫區是一個連續的整體區域,沒有被切割):根據一接縫區的接縫78,施予一更新視窗81至接縫區的每一列,以拼接對應的接縫影像A與接縫影像B。為平滑化接縫78附近的像素值轉變,本發明提供一種接縫混和方式來更新一更新視窗81中的像素值,其中該更新視窗81的寬度等於2×Ra以及該接縫78上的一分隔點82係位在該 更新視窗81的中心,如圖8C所示。對於接縫區S(2)的每一列,若一像素位置(x,y)是位在更新視窗81的左側,則指定其在接縫影像A的像素值當做該拼接後接縫影像中同一像素位置(x,y)的像素值;相反地,若一像素位置(x,y)是位在更新視窗81的右側,則指定其在接縫影像B的像素值當做拼接後接縫影像中同一像素位置(x,y)的像素值;再者,若一像素位置(x,y)是位在更新視窗81之內,根據該更新視窗81的最後寬度及該像素位置(x,y)相對於更新視窗81之左邊緣的距離,計算一混和權值,再根據該混和權值及於接縫影像A及接縫影像B的二個對應像素值(即ImgA(x,y)及ImgB(x,y)),計算同一像素位置(x,y)的混和像素值。一實施例中,提供以下程式碼來根據接縫區的每一列中更新視窗81的最後寬度及各像素位置(x,y)相對於該更新視窗81的位置,來更新該更新視窗81內的像素值。 (2) Seam blending method (each seam area is a continuous integral area, not cut): according to the seam 78 of a seam area, apply an update window 81 to each row of the seam area to splicing Corresponding seam image A and seam image B. In order to smooth the transition of pixel values near the seam 78, the present invention provides a seam blending method to update pixel values in an update window 81, wherein the width of the update window 81 is equal to 2*Ra and a Separation point 82 is located at the The center of the window 81 is updated, as shown in FIG. 8C. For each column of the seam area S(2), if a pixel position (x, y) is located on the left side of the update window 81, the pixel value of the seam image A is designated as the same in the seam image after splicing The pixel value of the pixel position (x, y); on the contrary, if a pixel position (x, y) is located on the right side of the update window 81, the pixel value in the seam image B is designated as the seam image after stitching The pixel value of the same pixel position (x, y); furthermore, if a pixel position (x, y) is located within the update window 81, according to the last width of the update window 81 and the pixel position (x, y) With respect to the distance from the left edge of the update window 81, a blending weight is calculated, and then according to the blending weight and two corresponding pixel values of the seam image A and the seam image B (ie ImgA(x, y) and ImgB (x,y)), calculate the mixed pixel value of the same pixel position (x,y). In one embodiment, the following code is provided to update the update window 81 according to the last width of the update window 81 in each row of the seam area and the position of each pixel position (x, y) relative to the update window 81 to update the update window 81 Pixel values.

Figure 110121015-A0305-02-0033-30
Figure 110121015-A0305-02-0034-31
Figure 110121015-A0305-02-0033-30
Figure 110121015-A0305-02-0034-31

(3)環繞式(wrap around)接縫混和方式(上述多個接縫區之一被分割成二個不連續的部分且位在全景影像的相對二側):在一特例中,一接縫區可能同時位在等距長方全景影像的左邊緣及右邊緣附近。如圖8D所示,接縫區S(3)同時位在等距長方全景影像的最左側及最右側,換言之,接縫區S(3)被分割成二個部分。為處理這種狀況,本發明提供一種環繞式的接縫混和方式。一實施例中,提供以下程式碼來根據該環繞式的接縫混和方式,形成一接縫區(範圍從Y0至Y1及X0至X1)的拼接後接縫影像:

Figure 110121015-A0305-02-0034-32
Figure 110121015-A0305-02-0035-33
Figure 110121015-A0305-02-0036-34
(3) Wrap around seam blending method (one of the above-mentioned seam areas is divided into two discontinuous parts and located on opposite sides of the panoramic image): In a special case, a seam The area may be located near the left and right edges of the equirectangular panorama at the same time. As shown in FIG. 8D , the seam area S( 3 ) is located at the leftmost and rightmost sides of the equidistant rectangular panoramic image, in other words, the seam area S(3) is divided into two parts. To address this situation, the present invention provides a wraparound seam blend. In one embodiment, the following code is provided to form a stitched seam image of a seam region (ranging from Y0 to Y1 and X0 to X1) according to the wraparound seam blending method:
Figure 110121015-A0305-02-0034-32
Figure 110121015-A0305-02-0035-33
Figure 110121015-A0305-02-0036-34

因此,即使圖8D接縫區S(3)係同時位在等距長方全景影像的最左側及最右側,利用上述環繞式的接縫混和方式依然可以產生一正確的拼接後的接縫影像。 Therefore, even if the seam area S(3) in FIG. 8D is located at the leftmost and rightmost sides of the equidistant rectangular panoramic image, the above-mentioned wraparound seam blending method can still generate a correct stitched seam image .

本發明補償裝置22及對應性產生器23可以軟體、硬體、或軟體(或韌體)及硬體的組合來實施,一單純解決方案的例子是現場可程式閘陣列(field programmable gate array)或一特殊應用積體電路(application specific integrated circuit)。一較佳實施例中,該頂點處理裝置210以及該影像處理裝置220係利用一圖形處理單元(Graphics Processing Unit)以及一第一程式記憶體來實施;該拼接決策單元230及該對應性產生器23利用一第一一般用途(general-purpose)處理器以及一第二程式記憶體來實施。該第一程式記憶體儲存一第一處理器可執行程式,而第二程式記憶體儲存一第二處理器可執行程式。當該圖形處理單元執行該第一處理器可執行程式時,該圖形處理單元被組態(configured)以運作有如:該頂點處理裝置210以及該影像處理裝置220。當該第一一般用途處理器執行該第二處理器可執行程式時,該第一一般用途處理器被組態以運作有如:該拼接決策單元230及該對應性產生器23。 The compensation device 22 and the corresponding generator 23 of the present invention can be implemented by software, hardware, or a combination of software (or firmware) and hardware. An example of a simple solution is a field programmable gate array. or an application specific integrated circuit. In a preferred embodiment, the vertex processing device 210 and the image processing device 220 are implemented by a graphics processing unit (Graphics Processing Unit) and a first program memory; the splicing decision unit 230 and the correspondence generator 23 is implemented using a first general-purpose processor and a second program memory. The first program memory stores a first processor executable program, and the second program memory stores a second processor executable program. When the graphics processing unit executes the first processor executable program, the graphics processing unit is configured to operate as the vertex processing device 210 and the image processing device 220 . When the first general purpose processor executes the second processor executable program, the first general purpose processor is configured to operate as: the splicing decision unit 230 and the correspondence generator 23 .

另一實施例中,該補償裝置22及對應性產生器23利用一第二一般用途處理器以及一第三程式記憶體來實施。該第三程式記憶體儲存一第三處理器可執行程式。當該第二一般用途處理器執行該第三處理器可執行程式時,該第二一般用途處理器被組態以運作有如:該頂點處理裝置210、該拼接決策單元230、該對應性產生器23以及該影像處理裝置220。 In another embodiment, the compensation device 22 and the correspondence generator 23 are implemented using a second general purpose processor and a third program memory. The third program memory stores a third processor executable program. When the second general purpose processor executes the third processor executable, the second general purpose processor is configured to operate as: the vertex processing device 210, the tiling decision unit 230, the correspondence generator 23 and the image processing device 220.

上述僅為本發明之較佳實施例而已,而並非用以限定本發明的申請專利範圍;凡其他未脫離本發明所揭示之精神下所完成的等效改變或修飾,均應包含在下述申請專利範圍內。 The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the patent application of the present invention; all other equivalent changes or modifications without departing from the spirit disclosed in the present invention shall be included in the following application. within the scope of the patent.

Claims (22)

一種影像處理方法,用以接收M個鏡頭影像以產生一投影影像,該方法包含:根據一個2D誤差表格及M個鏡頭影像,決定該投影影像內P個控制區的P個最佳接合係數,其中,以一影像擷取模組,捕捉一個具有X度水平視域及Y度垂直視域的視野,以產生該M個鏡頭影像;根據一第一頂點列表、該P個最佳接合係數以及該M個鏡頭影像,產生M張工作面影像;決定N個接縫區的N條接縫;以及根據各接縫區的接縫,拼接各接縫區的二張重疊的接縫影像以產生一拼接後接縫影像;其中,各工作面影像包含z張接縫影像以及一張主影像,以及各接縫區係位在該投影影像內的二相鄰主影像之間;其中,該2D誤差表格包含多個測試接合係數以及該P個控制區中對應的多個累積像素值誤差量;其中,該P個控制區係分別位在該N個接縫區之內,以及該N個接縫區係分別位在該M個工作面的N個重疊區之內;其中,該第一頂點列表包含多個具有資料結構的第一頂點,該些資料結構定義單一鏡頭影像及該投影影像之間的第一頂點映射;以及其中,1<=z<=2、M>=2、N>=1、P>=3、X<=360以及Y<180。 An image processing method for receiving M lens images to generate a projection image, the method comprising: determining P optimal bonding coefficients of P control regions in the projection image according to a 2D error table and the M lens images, Wherein, an image capture module is used to capture a field of view with a horizontal field of view of X degrees and a vertical field of view of Y degrees to generate the M lens images; according to a first vertex list, the P optimal joint coefficients and The M lens images generate M working surface images; N seams of the N seam areas are determined; and according to the seams of each seam area, two overlapping seam images of each seam area are spliced to generate A seam image after splicing; wherein, each working surface image includes z seam images and a main image, and each seam area is located between two adjacent main images in the projected image; wherein, the 2D image The error table includes a plurality of test joint coefficients and a plurality of accumulated pixel value error amounts corresponding to the P control regions; wherein, the P control regions are respectively located in the N joint regions, and the N joint regions are respectively located. The seam regions are respectively located in the N overlapping regions of the M working surfaces; wherein the first vertex list includes a plurality of first vertices with data structures, and the data structures define the relationship between a single lens image and the projected image. and where 1<=z<=2, M>=2, N>=1, P>=3, X<=360, and Y<180. 如請求項1之方法,更包含: 根據該N個接縫區的N張拼接後接縫影像以及M張主影像,形成該投影影像。 As in the method of claim 1, it further includes: The projection image is formed according to the N seam images after splicing and the M main images of the N seam regions. 如請求項1之方法,其中該決定該P個控制區的P個最佳接合係數步驟包含:根據該影像擷取模組的一鏡頭中心相對於該影像擷取模組之系統中心的偏移量,決定該些測試接合係數;根據該些測試接合係數,修正一第二頂點列表中各第二頂點之第二資料結構內各鏡頭影像的紋理座標,以產生一第三頂點列表;根據該第三頂點列表及該M張鏡頭影像,量測該P個控制區中的該些累積像素值誤差量;重複該修正步驟以及該量測步驟,直到處理完所有的測試接合係數為止,以形成該2D誤差表格;以及根據該2D誤差表格中各控制區之一個或二個最鄰近控制區的累積像素值誤差量的至少一局部最小值,決定各控制區的最佳接合係數;其中,該第二頂點列表包含多個具有資料結構的第二頂點,該些資料結構定義該M個鏡頭影像及該投影影像之間的第二頂點映射;以及其中,該第三頂點列表包含多個具有資料結構的第三頂點,該些資料結構定義該M個鏡頭影像及該投影影像之間的第三頂點映射。 The method of claim 1, wherein the step of determining the P optimal bonding coefficients of the P control regions comprises: according to an offset of a lens center of the image capture module relative to a system center of the image capture module determine the test joint coefficients; according to the test joint coefficients, modify the texture coordinates of each lens image in the second data structure of each second vertex in a second vertex list to generate a third vertex list; The third vertex list and the M lens images are used to measure the accumulated pixel value errors in the P control regions; the correction step and the measurement step are repeated until all the test joint coefficients are processed to form the 2D error table; and according to at least a local minimum value of the accumulated pixel value error amount of one or two adjacent control regions of each control region in the 2D error table, determine the optimal bonding coefficient of each control region; wherein, the The second vertex list includes a plurality of second vertices with data structures defining second vertex mappings between the M lens images and the projected image; and wherein the third vertex list includes a plurality of second vertices with data structures the third vertex of the structure, the data structures define the third vertex mapping between the M lens images and the projection image. 如請求項1之方法,其中各該M張工作影像是源自於該影像擷取模組的一對應鏡頭影像之一預設投影。 The method of claim 1, wherein each of the M working images is derived from a preset projection of a corresponding lens image of the image capture module. 如請求項6之方法,其中該預設投影是等距長方投影、米勒投影、墨卡托投影、蘭伯特圓柱等面積投影以及帕尼尼投影之其一。 The method of claim 6, wherein the preset projection is one of an equirectangular projection, a Miller projection, a Mercator projection, a Lambert cylinder equal-area projection, and a Panini projection. 如請求項1之方法,其中若z=2,各工作面影像的主影像係位在該z張接縫影像之間。 The method of claim 1, wherein if z=2, the main image of each working plane image is positioned between the z seam images. 如請求項1之方法,其中該第一頂點列表包含m1個第一主要頂點列表以及2×N個第一接縫頂點列表,以及其中該產生該M張工作面影像步驟包含:根據該P個最佳接合係數,依序修正該第一頂點列表中所有第一頂點於單一鏡頭影像中的紋理座標,以產生一第四頂點列表,其中該第四頂點列表包含m1個第二主要頂點列表以及2×N個第二接縫頂點列表,其中1<=m1<=M;以及根據該M張鏡頭影像,對來自該第四頂點列表的一組第四頂點所形成的各多邊形內的各點,進行柵格化及紋理映射操作,以依序產生M張主影像、N張第一接縫影像以及N張第二接縫影像;其中,各該m1個第一主要頂點列表以及各該2×N個第一接縫頂點列表包含該些具有第一資料結構的第一頂點,該些第一資料結構定義該單一鏡頭影像及該投影影像之間的第一頂點映射;以及其中,各該m1個第二主要頂點列表以及各該2×N個第二接縫頂點列表包含多個具有第四資料結構的第四頂點,該些第四資料結構定義一對應鏡頭影像及該投影影像之間的第四頂點映射。 The method of claim 1, wherein the first vertex list includes m1 first main vertex lists and 2×N first seam vertex lists, and wherein the step of generating the M working surface images comprises: according to the P an optimal joint coefficient, sequentially correcting the texture coordinates of all the first vertices in the first vertex list in a single lens image to generate a fourth vertex list, wherein the fourth vertex list includes m1 second main vertex lists and 2×N second seam vertex lists, where 1<=m1<=M; and according to the M lens images, for each point in each polygon formed by a set of fourth vertices from the fourth vertex list , perform rasterization and texture mapping operations to sequentially generate M main images, N first seam images, and N second seam images; wherein each of the m1 first main vertex lists and each of the 2 The ×N first seam vertex lists include the first vertices having a first data structure defining a first vertex mapping between the single shot image and the projected image; and wherein each of the The m1 second main vertex lists and each of the 2×N second seam vertex lists include a plurality of fourth vertices having fourth data structures defining a space between a corresponding lens image and the projected image The fourth vertex map of . 如請求項7之方法,其中該修正該紋理座標步驟包含: 根據該些測試接合係數以及各第一頂點之第一資料結構內該單一鏡頭影像的二個接合係數索引及一混合權值,修正各第一頂點之第一資料結構內該單一鏡頭影像的紋理座標,以產生該第四頂點列表;其中該二個接合係數索引係用以從該些測試接合係數中選定其二,以及該混合權值係用以混和該二個選定的測試接合係數。 The method of claim 7, wherein the step of correcting the texture coordinates comprises: Modify the texture of the single-shot image in the first data structure of each first vertex according to the test joint coefficients and the two joint coefficient indices and a blending weight of the single-lens image in the first data structure of each first vertex coordinates to generate the fourth vertex list; wherein the two joint coefficient indices are used to select two of the test joint coefficients, and the blend weight is used to blend the two selected test joint coefficients. 如請求項8之方法,其中該修正該紋理座標步驟更包含:根據該些測試接合係數以及一目標第一頂點之第一資料結構內該單一鏡頭影像的該二個接合係數索引及該混合權值,計算該目標第一頂點於該單一鏡頭影像的一內插接合係數;根據該內插接合係數、該目標第一頂點於該單一鏡頭影像的該內插接合係數及該紋理座標,計算該目標第一頂點於該單一鏡頭影像的修正紋理座標;以及將該目標第一頂點於該單一鏡頭影像的修正紋理座標儲存於該第四頂點列表的一對應第四頂點的第四資料結構中。 The method of claim 8, wherein the step of modifying the texture coordinates further comprises: according to the test stitching coefficients and the two stitching coefficient indices and the blending weight of the single-lens image in the first data structure of a target first vertex value, calculate an interpolation joint coefficient of the target first vertex in the single lens image; according to the interpolation joint coefficient, the interpolation joint coefficient of the target first vertex in the single lens image and the texture coordinate, calculate the The modified texture coordinates of the target first vertex in the single lens image; and the modified texture coordinates of the target first vertex in the single lens image are stored in a fourth data structure corresponding to the fourth vertex in the fourth vertex list. 如請求項7之方法,其中該產生該M張工作面影像步驟更包含:儲存該M張主影像於一第一緩衝器以便顯示;以及儲存該N張第一接縫影像以及該N張第二接縫影像於2×N個不同第二緩衝器,其中,該2×N個第二緩衝器與該第一緩衝器係分隔開來。 The method of claim 7, wherein the step of generating the M working surface images further comprises: storing the M main images in a first buffer for display; and storing the N first seam images and the N first seam images Two seam images in 2×N different second buffers, wherein the 2×N second buffers are separated from the first buffer. 如請求項7之方法,其中該產生該M張工作面影像步驟更包含: 儲存該M張主影像、該N張第一接縫影像以及該N張第二接縫影像於(m2+2×N)個不同第一緩衝器,其中m2<=M;以及將該M張主影像搬移至一第二緩衝器以便顯示。 The method of claim 7, wherein the step of generating the M work surface images further comprises: storing the M main images, the N first seam images and the N second seam images in (m2+2×N) different first buffers, where m2<=M; and the M images The main image is moved to a second buffer for display. 如請求項1之方法,其中該決定各該N個接縫區的接縫步驟包含:於一目標接縫區中,計算一第三接縫影像內各第一像素位置相對於一第四接縫影像內一對應第二像素位置的像素值誤差量,以儲存於一第五資料結構中,其中,各第一像素位置與其對應第二像素位置係位在同一列且相鄰;根據該第五資料結構的資料與一預設搜尋範圍,計算該目標接縫區之目前列y中各第一像素位置的最小累積像素值誤差量,以儲存於一第六資料結構中,以及找出前一列(y-1)中具最小累積像素值誤差量的x座標,以儲存於一第七資料結構;根據該第六資料結構,找出該目標接縫區之最下面一列中具最小累積像素值差異的x座標;以及根據該第七資料結構,從該目標接縫區之最下面一列的x座標回溯至最上面一列,以形成該目標接縫區之接縫,並儲存每一列被貫穿的x座標於一第八資料結構。 The method of claim 1, wherein the step of determining the seam of each of the N seam regions comprises: in a target seam region, calculating the position of each first pixel in a third seam image relative to a fourth seam region A pixel value error amount corresponding to a second pixel position in the slit image is stored in a fifth data structure, wherein each first pixel position and its corresponding second pixel position are located in the same row and adjacent; according to the first pixel position The data of the five data structures and a preset search range are calculated, and the minimum accumulated pixel value error amount of each first pixel position in the current row y of the target seam area is calculated to be stored in a sixth data structure, and the previous In a row (y-1), the x-coordinate with the minimum accumulated pixel value error is stored in a seventh data structure; according to the sixth data structure, find out the minimum accumulated pixel in the bottom row of the target seam area the x-coordinate of the difference in value; and according to the seventh data structure, backtracking from the x-coordinate of the lowermost row of the target seam area to the uppermost row to form the seam of the target seam area, and storing that each row is penetrated The x-coordinate of an eighth data structure. 如請求項1之方法,其中該二張重疊的接縫影像包含一第五接縫影像以及一第六接縫影像,其中該第五接縫影像係有關於該M張工作影像之一第一工作影像以及該第六接縫影像係有關於該M張工作影像之一第二工作影像,其中該第一工作影像的主影像及該第二工作影像的主影像係分別位在 一對應接縫區的左側及右側,以及該對應接縫區之接縫包含多個分隔點,分別位在該對應接縫區的每一列。 The method of claim 1, wherein the two overlapping seam images comprise a fifth seam image and a sixth seam image, wherein the fifth seam image is related to a first one of the M working images The working image and the sixth seam image are related to a second working image of the M working images, wherein the main image of the first working image and the main image of the second working image are respectively located at The left and right sides of a corresponding seam area, and the seam of the corresponding seam area includes a plurality of separation points, which are respectively located in each row of the corresponding seam area. 如請求項13之方法,其中該拼接步驟包含:對於該對應接縫區的每一列,根據該拼接後接縫影像中一像素位置與位在同一列上之對應分隔點的相對位置、該第五接縫影像以及該第六接縫影像,指定一像素值給該拼接後接縫影像中之該像素位置。 The method of claim 13, wherein the splicing step comprises: for each row of the corresponding seam area, according to the relative position of a pixel position in the spliced seam image and the corresponding separation point on the same row, the first The fifth seam image and the sixth seam image assign a pixel value to the pixel position in the stitched seam image. 如請求項14之方法,其中該指定步驟包含:若該像素位置係位在該接縫的左側,指定該像素位置於該第五接縫影像內的像素值給該拼接後接縫影像內相同的像素位置;若該像素位置係位在該接縫的右側,指定該像素位置於該第六接縫影像內的像素值給該拼接後接縫影像內相同的像素位置;以及若該像素位置係位在該接縫上,指定該像素位置於該第五接縫影像及該第六接縫影像之一的對應像素值給該拼接後接縫影像內相同的像素位置。 The method of claim 14, wherein the specifying step comprises: if the pixel position is located on the left side of the seam, specifying the pixel value of the pixel position in the fifth seam image to be the same in the seam image after splicing the pixel position of is located on the seam, and assigns the pixel position to the corresponding pixel value of one of the fifth seam image and the sixth seam image to the same pixel position in the stitched seam image. 如請求項13之方法,其中該拼接步驟包含:根據該對應接縫區的接縫以及該N個接縫區之一是否分割成二個分離的部分,透過分別提供一更新視窗給該對應接縫區的每一列,來拼接該二張重疊接縫影像;其中,該對應接縫區每一列上的分隔點係位在該更新視窗的中心。 The method of claim 13, wherein the splicing step comprises: according to the seam of the corresponding seam area and whether one of the N seam areas is divided into two separate parts, by respectively providing an update window to the corresponding seam area Each row of the seam area is used to stitch the two overlapping seam images; wherein, the separation point on each row of the corresponding seam area is located at the center of the update window. 如請求項16之方法,其中該拼接步驟包含:對於該對應接縫區的每一列, 若一像素位置係位在該接縫區的左邊緣以及該更新視窗的左邊緣之間,指定該像素位置於該第五接縫影像內的像素值給該拼接後接縫影像內相同的像素位置;若該像素位置係位在該接縫的右邊緣以及該更新視窗的右邊緣之間,指定該像素位置於該第六接縫影像內的像素值給該拼接後接縫影像內相同的像素位置;以及若該像素位置係位在該更新視窗內,根據該更新視窗的最後寬度以及該像素位置相對於該更新視窗的左邊緣之距離,計算一混和權值,以及根據該混和權值以及該像素位置於該第五接縫影像及該第六接縫影像內的對應像素值,計算於該拼接後接縫影像內相同像素位置的混和像素值。 The method of claim 16, wherein the splicing step comprises: for each column of the corresponding seam area, If a pixel position is located between the left edge of the seam area and the left edge of the update window, assign the pixel value of the pixel position in the fifth seam image to the same pixel in the stitched seam image position; if the pixel position is between the right edge of the seam and the right edge of the update window, assign the pixel value of the pixel position in the sixth seam image to the same pixel value in the seam image after stitching pixel position; and if the pixel position is located within the update window, calculating a blending weight based on the final width of the update window and the distance of the pixel position relative to the left edge of the update window, and according to the blending weight and the corresponding pixel value of the pixel position in the fifth seam image and the sixth seam image, and calculate the mixed pixel value of the same pixel position in the seam image after splicing. 如請求項17之方法,其中各接縫區是一個完整區域以及該拼接步驟更包含:於該指定步驟以及該計算該混和權值與該混和像素值之前,對於該對應接縫區的每一列,根據該更新視窗的原始寬度,決定該更新視窗的左邊緣以及右邊緣的座標;以及若該更新視窗的左邊緣以及右邊緣之一邊緣會伸出該對應接縫區之外,修正該更新視窗的該邊緣以對齊該對應接縫區之邊界,以得到該更新視窗的最後寬度。 The method of claim 17, wherein each seam area is a complete area and the splicing step further comprises: before the specifying step and the calculating the blending weight and the blending pixel value, for each row of the corresponding seam area , according to the original width of the update window, determine the coordinates of the left edge and the right edge of the update window; and if one of the left and right edges of the update window extends beyond the corresponding seam area, correct the update window The edge of the window is aligned with the border of the corresponding seam area to obtain the final width of the update window. 如請求項17之方法,其中該N個接縫區之一分成二個分離的部分以及該二個分離的部分係位在該投影影像的最左側與最右側,其中該拼接步驟包含: 於該指定步驟以及該計算該混和權值與該混和像素值之前,對於該對應接縫區的每一列,將一對應分隔點的x座標減去該對應接縫區之左邊緣的x座標,以得到對應分隔點的相對距離;若該相對距離小於0,將該相對距離加上該投影影像的寬度以修正該相對距離;根據該相對距離與該更新視窗的原始寬度,決定該更新視窗的左邊緣以及右邊緣的位置;若該更新視窗的左邊緣以及右邊緣之一邊緣會伸出該對應接縫區之外,修正該更新視窗的該邊緣以對齊該對應接縫區之邊界,以得到該更新視窗的最後寬度;計算該對應接縫區中一像素位置相對於該投影影像的左邊緣的距離;以及若該對應接縫區中該像素位置相對於該投影影像的左邊緣的距離大於該投影影像的寬度,將該像素位置相對於該投影影像的左邊緣的距離減去該投影影像的寬度,以修正該像素位置。 The method of claim 17, wherein one of the N seam regions is divided into two separate parts and the two separate parts are located at the leftmost and the rightmost of the projected image, wherein the splicing step comprises: Before the specifying step and before calculating the blending weight and the blending pixel value, for each column of the corresponding seam region, subtract the x-coordinate of the left edge of the corresponding seam region from the x-coordinate of the corresponding separation point, to obtain the relative distance of the corresponding separation point; if the relative distance is less than 0, add the relative distance to the width of the projected image to correct the relative distance; according to the relative distance and the original width of the update window, determine the width of the update window The position of the left and right edges; if one of the left and right edges of the update window protrudes beyond the corresponding seam area, modify the edge of the update window to align with the boundary of the corresponding seam area to Obtain the final width of the update window; calculate the distance of a pixel position in the corresponding seam area relative to the left edge of the projected image; and if the pixel position in the corresponding seam area is relative to the distance of the left edge of the projected image If the width of the projected image is greater than the width of the projected image, the distance of the pixel location relative to the left edge of the projected image is subtracted from the width of the projected image to correct the pixel location. 如請求項1之方法,其中各接縫區包含P1個排成一行的控制區,且P1>=3。 The method of claim 1, wherein each seam area includes P1 control areas arranged in a line, and P1>=3. 如請求項20之方法,其中對於位在一重疊區之一接縫區以及位在該接縫區的該P1個控制區,該重疊區的寬度係大於或等於該接縫區的寬度,以及該接縫區的寬度係大於或等於該P1個控制區的寬度。 The method of claim 20, wherein for a seam area located in an overlap area and the P1 control areas located in the seam area, the width of the overlap area is greater than or equal to the width of the seam area, and The width of the seam area is greater than or equal to the width of the P1 control areas. 如請求項1之方法,其中該投影影像為一全景影像以及一廣角影像之其一。 The method of claim 1, wherein the projected image is one of a panoramic image and a wide-angle image.
TW110121015A 2021-06-09 2021-06-09 Method for generating projection image with scaling adjustment and seam cut stitching TWI762353B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110121015A TWI762353B (en) 2021-06-09 2021-06-09 Method for generating projection image with scaling adjustment and seam cut stitching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110121015A TWI762353B (en) 2021-06-09 2021-06-09 Method for generating projection image with scaling adjustment and seam cut stitching

Publications (2)

Publication Number Publication Date
TWI762353B true TWI762353B (en) 2022-04-21
TW202248951A TW202248951A (en) 2022-12-16

Family

ID=82199269

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110121015A TWI762353B (en) 2021-06-09 2021-06-09 Method for generating projection image with scaling adjustment and seam cut stitching

Country Status (1)

Country Link
TW (1) TWI762353B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI807845B (en) * 2022-06-01 2023-07-01 信驊科技股份有限公司 System and method of generating projection image with region of interest

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7889948B2 (en) * 2006-04-10 2011-02-15 Microsoft Corporation Image stitching using partially overlapping views of a scene
US9979900B2 (en) * 2013-04-04 2018-05-22 Sony Corporation Method and apparatus for applying a border to an image
TWI660328B (en) * 2017-02-23 2019-05-21 鈺立微電子股份有限公司 Image device utilizing non-planar projection images to generate a depth map and related method thereof
TW202025716A (en) * 2018-09-26 2020-07-01 美商卡赫倫特羅吉克斯公司 Surround view generation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7889948B2 (en) * 2006-04-10 2011-02-15 Microsoft Corporation Image stitching using partially overlapping views of a scene
US9979900B2 (en) * 2013-04-04 2018-05-22 Sony Corporation Method and apparatus for applying a border to an image
TWI660328B (en) * 2017-02-23 2019-05-21 鈺立微電子股份有限公司 Image device utilizing non-planar projection images to generate a depth map and related method thereof
TW202025716A (en) * 2018-09-26 2020-07-01 美商卡赫倫特羅吉克斯公司 Surround view generation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI807845B (en) * 2022-06-01 2023-07-01 信驊科技股份有限公司 System and method of generating projection image with region of interest

Also Published As

Publication number Publication date
TW202248951A (en) 2022-12-16

Similar Documents

Publication Publication Date Title
US10104288B2 (en) Method and apparatus for generating panoramic image with stitching process
Szeliski et al. Creating full view panoramic image mosaics and environment maps
TWI728620B (en) Method of adjusting texture coordinates based on control regions in a panoramic image
JP4832878B2 (en) Image composition processing apparatus and method
Shum et al. Systems and experiment paper: Construction of panoramic image mosaics with global and local alignment
Shum et al. Panoramic image mosaics
US7006709B2 (en) System and method deghosting mosaics using multiperspective plane sweep
US10872396B2 (en) Image stitching method and device
JPH11509946A (en) Method and system for image combination using parallax dependent technique
JP2005500756A (en) Multi-projector mosaic with automatic alignment
JP2005244916A (en) Image processor
CN110246161B (en) Method for seamless splicing of 360-degree panoramic images
US11616909B2 (en) Method of compensating for color differences between adjacent lens images in a panoramic image
TWI762353B (en) Method for generating projection image with scaling adjustment and seam cut stitching
KR20060056050A (en) Creating method of automated 360 degrees panoramic image
JP2000155831A (en) Method and device for image composition and recording medium storing image composition program
JP4581512B2 (en) Three-dimensional image processing apparatus, optical axis adjustment method, and optical axis adjustment support method
CN115484442A (en) Method for generating projection image by scaling and seam splicing
JP4776983B2 (en) Image composition apparatus and image composition method
CN116437165A (en) Image processing system and method thereof
JP3540696B2 (en) Image synthesizing method, image synthesizing device, recording medium storing image synthesizing program
TWI807845B (en) System and method of generating projection image with region of interest
TWI837563B (en) Image processing system and method thereof for generating projection images based on a multiple-lens camera
JP2003316256A (en) Method, system, and program for ortho-photo generation
JP2004227095A (en) Texture map formation method, program for texture map formation, and texture map formation device