TWI506594B - Image gray scale adjusting device and method thereof - Google Patents

Image gray scale adjusting device and method thereof Download PDF

Info

Publication number
TWI506594B
TWI506594B TW103106102A TW103106102A TWI506594B TW I506594 B TWI506594 B TW I506594B TW 103106102 A TW103106102 A TW 103106102A TW 103106102 A TW103106102 A TW 103106102A TW I506594 B TWI506594 B TW I506594B
Authority
TW
Taiwan
Prior art keywords
image
grayscale value
grayscale
adjustment
pixel
Prior art date
Application number
TW103106102A
Other languages
Chinese (zh)
Other versions
TW201533707A (en
Inventor
Jen Hsuan Hsieh
Cheng Fang Lo
Original Assignee
Geosat Informatics & Technology Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Geosat Informatics & Technology Co filed Critical Geosat Informatics & Technology Co
Priority to TW103106102A priority Critical patent/TWI506594B/en
Publication of TW201533707A publication Critical patent/TW201533707A/en
Application granted granted Critical
Publication of TWI506594B publication Critical patent/TWI506594B/en

Links

Landscapes

  • Image Processing (AREA)

Description

影像灰階調整裝置及其方法Image gray scale adjusting device and method thereof 【0001】【0001】

下列敘述是有關於一種影像灰階調整裝置及其方法,特別是,有關於能處理拼接影像的影像灰階調整裝置及其方法。
The following description relates to an image gray scale adjusting device and a method thereof, and more particularly to an image gray scale adjusting device capable of processing a stitched image and a method thereof.

【0002】【0002】

無人載具在進行空拍時,可將多個不同的區域影像進行拼接以形成一大範圍的區域影像,使用者便可以利用此大範圍的區域影像進行研究或分析。然而不同的區域影像在進行拼接時,由於彼此拍攝時攝影機的角度及拍攝時間之差異,在主影像及附屬影像重疊處若僅取單一影像的灰階值以填補新的拼接影像時,其接縫痕跡將會相當明顯,進而破壞拼接影像的美觀及完整程度,故影像灰階調整是影像進行拼接作業時須面對的課題。When an unmanned vehicle is taking an aerial shot, multiple different area images can be spliced to form a wide range of area images, and the user can use this wide range of area images for research or analysis. However, when different regions are spliced, due to the difference between the angle of the camera and the shooting time when shooting each other, if only the grayscale value of the single image is taken at the overlap of the main image and the attached image to fill the new spliced image, The seam marks will be quite obvious, which will destroy the beauty and integrity of the stitched image. Therefore, the image gray scale adjustment is a problem that the image has to face when splicing.

【0003】[0003]

傳統的灰階值平均法,乃是將相鄰影像於重疊處所占的權重視為相同,亦即各取0.5,而取各自的灰階計算平均值填補之,然而相鄰影像所占的權重實際上並非相等,故此作法仍無法漂亮地處理拼接影像,舉例來說,若是主影像和附屬影像的拍照時間隔了30分鐘,由於日光或氣候的變異因素,若仍採用相同權重值進行拼接影像,則兩張影像的重疊處則會看來十分突兀。The traditional gray-scale value averaging method emphasizes that the weights of adjacent images at the overlapping positions are the same, that is, each takes 0.5, and the average value of each gray-scale calculation is filled, but the adjacent images occupy The weights are not actually equal. Therefore, the stitching image cannot be processed beautifully. For example, if the main image and the attached image are separated by 30 minutes, due to the variation of daylight or climate, if the same weight value is still used for stitching. For images, the overlap of the two images will look very abrupt.

【0004】[0004]

因此如何能夠在進行影像拼接時,同時顧及影像的美觀及完整度,便成為一個十分重要的問題。
Therefore, how to make image mosaic, while taking into account the beauty and integrity of the image, becomes a very important issue.

【0005】[0005]

本發明實施例之態樣係針對一種影像灰階調整裝置及其方法,能夠在兩張影像進行拼接時,調整重疊區域內影像之灰階值,進而讓拼接之影像更為美觀及完整。The embodiment of the present invention is directed to an image grayscale adjusting device and a method thereof, which can adjust the grayscale value of an image in an overlapping area when the two images are spliced, thereby making the spliced image more beautiful and complete.

【0006】[0006]

根據本創作之目的,提出一種影像灰階調整方法,用於拼接一主影像與一附屬影像成一拼接影像時,調整主影像與附屬影像之間相重疊的一重疊影像之灰階值,影像灰階調整方法包含:在拼接影像上決定一矩形以包含重疊影像,其中重疊影像係包含主影像之複數個主像素及附屬影像之複數個附屬像素;計算像素si到矩形之一對角線之一最短矩離di,其中像素si為重疊影像中之一任意第i個附屬像素;根據對角線之長度n及最短矩離di求得像素si之一第一權重Wi1及一第二權重Wi2,其中Wi2=((n/2)-di)/(n/2),Wi1=1-Wi2,以及利用第一權重Wi1及第二權重Wi2以計算像素si之一調整灰階值;其中,調整灰階值=(Wi1*Pmi+Wi2*Psi)/(Wi1+Wi2),Pmi為與像素si重疊之一第i個主像素之灰階值,Psi為第i個附屬像素之灰階值。According to the purpose of the present invention, an image grayscale adjustment method is proposed for adjusting a grayscale value of an overlapping image overlapping between a main image and an auxiliary image when splicing a main image and an auxiliary image into a spliced image. The step adjustment method comprises: determining a rectangle on the stitched image to include the overlapped image, wherein the overlap image comprises a plurality of main pixels of the main image and a plurality of auxiliary pixels of the auxiliary image; and calculating one of the pixels si to the diagonal of the rectangle The shortest moment is from di, wherein the pixel si is any one of the i-th auxiliary pixels in the overlapping image; and the first weight Wi1 and the second weight Wi2 of the pixel si are obtained according to the length n of the diagonal and the shortest moment from di, Where Wi2=((n/2)-di)/(n/2), Wi1=1-Wi2, and adjusting the grayscale value by using the first weight Wi1 and the second weight Wi2 to calculate one of the pixels si; wherein, adjusting Grayscale value = (Wi1 * Pmi + Wi2 * Psi) / (Wi1 + Wi2), Pmi is the grayscale value of the i-th main pixel overlapping with the pixel si, and Psi is the grayscale value of the i-th subsidiary pixel.

【0007】【0007】

更佳地,主影像或附屬影像係包含一彩色影像,彩色影像包含一紅色成分影像、一綠色成分影像以及一藍色成分影像。More preferably, the main image or the auxiliary image includes a color image, and the color image includes a red component image, a green component image, and a blue component image.

【0008】[0008]

更佳地,本發明之影像灰階調整方法更包含: 分別計算重疊影像之每一像素在紅色成分影像、綠色成分影像以及藍色成分影像中之一紅色調整灰階值、一綠色調整灰階值以及一藍色調整灰階值;疊加紅色調整灰階值、綠色調整灰階值以及藍色調整灰階值以產生一彩色之拼接影像。More preferably, the image grayscale adjustment method of the present invention further comprises: respectively calculating one of the red component image, the green component image, and the blue component image of each pixel of the superimposed image, and adjusting a grayscale value, a green adjustment grayscale The value and a blue adjustment grayscale value; superimposed red adjustment grayscale value, green adjustment grayscale value, and blue adjustment grayscale value to produce a color mosaic image.

【0009】【0009】

更佳地,本發明之影像灰階調整方法更包含將重疊影像內之像素si之調整灰階值乘上一經驗常數,以微調調整灰階值,其中經驗常數係為小於等於1之正實數。More preferably, the image gray scale adjustment method of the present invention further comprises multiplying the adjusted gray scale value of the pixel si in the overlap image by an empirical constant to fine tune the gray scale value, wherein the empirical constant is a positive real number less than or equal to 1 .

【0010】[0010]

根據本創作之目的,提出一種影像灰階調整裝置,用於拼接一主影像與一附屬影像成一拼接影像時,調整主影像與附屬影像之間相重疊之一重疊影像之灰階值,影像灰階調整裝置包含:一計算區域決定單元,係在拼接影像上決定一矩形以包含重疊影像,其中重疊影像係包含主影像之複數個主像素及附屬影像之複數個附屬像素;一距離產生單元,係計算重疊影像中之一像素si到矩形之一對角線之一最短矩離di,其中像素si為重疊影像中之一任意第i個附屬像素;一權重產生單元,根據對角線之長度n及最短矩離di求得像素si之一第一權重Wi1及一第二權重Wi2,其中Wi2=((n/2)-di)/(n/2),Wi1=1-Wi2,以及一灰階值產生單元,利用第一權重Wi1及第二權重Wi2以計算像素si之一調整灰階值;其中,調整灰階值=(Wi1*Pmi+Wi2*Psi)/(Wi1+Wi2),Pmi為與像素si重疊之一第i個主像素之灰階值,Psi為第i個附屬像素之灰階值。According to the purpose of the present invention, an image grayscale adjustment device is provided for splicing a main image and an auxiliary image into a mosaic image, and adjusting a grayscale value of an overlapping image between the main image and the auxiliary image, the image gray The step adjusting device comprises: a calculating area determining unit, determining a rectangle on the stitched image to include the overlapping image, wherein the overlapping image comprises a plurality of main pixels of the main image and a plurality of auxiliary pixels of the auxiliary image; and a distance generating unit, Calculating one of the pixels from the pixel si to one of the diagonals of the rectangle, the shortest moment from the di, wherein the pixel si is any one of the i-th sub-pixels in the overlapping image; a weight generating unit, according to the length of the diagonal n and the shortest moment are obtained from di one of the first weight Wi1 and a second weight Wi2 of the pixel si, where Wi2=((n/2)-di)/(n/2), Wi1=1-Wi2, and one a grayscale value generating unit that adjusts a grayscale value by using the first weight Wi1 and the second weight Wi2 to calculate one of the pixels si; wherein, adjusting the grayscale value=(Wi1*Pmi+Wi2*Psi)/(Wi1+Wi2), Pmi is the grayscale value of the i-th main pixel overlapping with the pixel si Psi is the i th pixel gray level values of the subsidiary.

【0011】[0011]

更佳地,主影像或附屬影像係包含一彩色影像,彩色影像包含一紅色成分影像、一綠色成分影像以及一藍色成分影像。More preferably, the main image or the auxiliary image includes a color image, and the color image includes a red component image, a green component image, and a blue component image.

【0012】[0012]

更佳地,本發明之影像灰階調整裝置更包含: 分別計算重疊影像之每一像素在紅色成分影像、綠色成分影像以及藍色成分影像中之一紅色調整灰階值、一綠色調整灰階值以及一藍色調整灰階值;疊加紅色調整灰階值、綠色調整灰階值以及藍色調整灰階值以產生一彩色之拼接影像。More preferably, the image grayscale adjusting device of the present invention further comprises: respectively calculating one of the red component image, the green component image, and the blue component image of each pixel of the superimposed image, and adjusting a grayscale value, a green adjustment grayscale The value and a blue adjustment grayscale value; superimposed red adjustment grayscale value, green adjustment grayscale value, and blue adjustment grayscale value to produce a color mosaic image.

【0013】[0013]

更佳地,本發明之影像灰階調整裝置更包含:將重疊影像內之像素si之調整灰階值乘上一經驗常數,以微調調整灰階值,其中經驗常數係為小於等於1之正實數。More preferably, the image gray scale adjusting device of the present invention further comprises: multiplying the adjusted gray scale value of the pixel si in the overlap image by an empirical constant to finely adjust the gray scale value, wherein the empirical constant is less than or equal to 1 Real number.

【0014】[0014]

由以上描述可知,本發明具有優點如下:As can be seen from the above description, the present invention has the following advantages:

【0015】[0015]

1、本發明之方法可以動態地在拼接影像中進行影像灰階調整,而非只單純利用固定的權重值以拼接兩張影像,讓拼接後之影像看來更為美觀。1. The method of the present invention can dynamically adjust the grayscale of the image in the stitched image, instead of simply using the fixed weight value to stitch the two images, so that the stitched image looks more beautiful.

【0016】[0016]

2、本發明之方法利用公式計算距離即可以決定權重值,並減少cpu之一計算量 ,進而達到加速之效果。
2. The method of the present invention can determine the weight value by using the formula to calculate the distance, and reduce the calculation amount of one of the CPUs, thereby achieving the effect of acceleration.

1 影像灰階調整裝置
11 計算區域決定單元
12 距離產生單元
13 權重產生單元
131 第一權重
132 第二權重
14 灰階值產生單元
141 調整灰階值
2 主影像
3 附屬影像
4 重疊影像
S1~S4 步驟流程
C1~C4 矩形頂點
P1 座標點
si 像素
Length 1 對角線長度之一半
Length 2 座標點P1至對角線之最短距離
1 image gray scale adjustment device
11 Calculation area decision unit
12 distance generating unit
13 weight generation unit
131 first weight
132 second weight
14 gray scale value generating unit
141 Adjusting the grayscale value
2 main image
3 attached image
4 overlapping images
S1~S4 step process
C1~C4 rectangle vertex
P1 coordinate point
Si pixel
Length 1 One and a half diagonal length
Length 2 The shortest distance from the coordinate point P1 to the diagonal

【0017】[0017]

本發明之上述及其他特徵及優勢將藉由參照附圖詳細說明其例示性實施例而變得更顯而易知,其中:
第1圖係為根據本發明實施例之影像灰階調整裝置之方塊圖;
第2圖係為根據本發明之另一實施例之影像灰階調整裝置之示意圖;以及
第3圖係為根據本發明之第二實施例之影像灰階調整方法之步驟流程圖。
The above and other features and advantages of the present invention will become more apparent from the detailed description of the exemplary embodiments thereof
1 is a block diagram of an image gray scale adjusting device according to an embodiment of the present invention;
2 is a schematic diagram of an image gray scale adjusting device according to another embodiment of the present invention; and FIG. 3 is a flow chart showing the steps of the image gray scale adjusting method according to the second embodiment of the present invention.

【0018】[0018]

於此使用,詞彙“與/或”包含一或多個相關條列項目之任何或所有組合。當“至少其一”之敘述前綴於一元件清單前時,係修飾整個清單元件而非修飾清單中之個別元件。As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items. When the phrase "at least one of" is preceded by a list of elements, the entire list of elements is modified instead of the individual elements in the list.

【0019】[0019]

請參閱第1圖,其係根據本發明實施例之影像灰階調整裝置之方塊圖。如第1圖所示,此影像灰階調整裝置1在拼接一主影像2(未顯示於圖中)與一附屬影像3(未顯示於圖中)成一拼接影像時,用以調整此主影像2與附屬影像3之間相重疊之一重疊影像4(未顯示於圖中)之灰階值,此影像灰階調整裝置1包含一計算區域決定單元11、一距離產生單元12、一權重產生單元13及一灰階值產生單元14,影像灰階調整裝置1可安裝在一工作站或個人電腦上,計算區域決定單元11、一距離產生單元12、一權重產生單元13及一灰階值產生單元14可包含一軟體之應用程式。Please refer to FIG. 1 , which is a block diagram of an image gray scale adjusting apparatus according to an embodiment of the present invention. As shown in FIG. 1 , the image gray scale adjusting device 1 adjusts the main image when splicing a main image 2 (not shown) and an auxiliary image 3 (not shown) into a spliced image. 2 overlapping with the auxiliary image 3, one of the grayscale values of the superimposed image 4 (not shown in the figure), the image grayscale adjusting device 1 includes a calculating region determining unit 11, a distance generating unit 12, and a weight generating The unit 13 and a gray scale value generating unit 14 can be installed on a workstation or a personal computer, and the calculation area determining unit 11, a distance generating unit 12, a weight generating unit 13 and a gray scale value generating unit Unit 14 can include a software application.

【0020】[0020]

計算區域決定單元11係在併接影像上決定一最小矩形以包含所重疊到之重疊影像4,而在此重疊影像4中同時包含一主影像2之多個主像素及一附屬影像3之多個附屬像素,距離產生單元12則用以計算此重疊影像4中一像素si到此矩形中之對角線之一最短距離,其中此像素si為重疊影像4中任意一附屬像素,換言之,即計算以像素si為起點到此對角線之一垂直距離,而針對像素si而言,權重產生單元13則根據此對角線之長度及最短矩離以求出一第一權重131(公式表示符號為Wi1)及一第二權重132(公式表示符號為Wi2),其中Wi2=((n/2)-最短矩離)/(n/2),其中n為對角線之一長度,Wi1=1-Wi2,即第一權重131和第二權重132互為1之補數。The calculation area determining unit 11 determines a minimum rectangle on the parallel image to include the superimposed image 4 overlapped, and the overlapping image 4 includes a plurality of main pixels of the main image 2 and an auxiliary image 3 The auxiliary pixel 12 is used to calculate the shortest distance from one pixel si in the superimposed image 4 to one of the diagonal lines in the rectangle, wherein the pixel si is any auxiliary pixel in the overlapping image 4, in other words, Calculating a vertical distance from the pixel si as a starting point to the diagonal, and for the pixel si, the weight generating unit 13 derives a first weight 131 according to the length of the diagonal and the shortest moment (the formula indicates The symbol is Wi1) and a second weight 132 (the formula indicates the symbol is Wi2), where Wi2=((n/2)-the shortest moment away/(n/2), where n is one of the diagonal lengths, Wi1 =1-Wi2, that is, the first weight 131 and the second weight 132 are 1's complement each other.

【0021】[0021]

而灰階值產生單元14則利用第一權重131及一第二權重132以計算像素si之一調整灰階值141,此調整灰階值141 = (Wi1*Pmi +Wi2*Psi)/(Wi1+Wi2),其中Pmi為與像素si重疊之一第i個主像素之灰階值,Psi為像素si之灰階值。故由以上可知,當重疊影像4中之像素點距離主影像2較近時,則此點之灰階值的權重值則較偏向主影像2,反之,當距離附屬影像3較近時,則此點之灰階值的權重值則較偏向附屬影像3。The grayscale value generating unit 14 adjusts the grayscale value 141 by using the first weight 131 and a second weight 132 to calculate one of the pixels si, which adjusts the grayscale value 141 = (Wi1*Pmi + Wi2*Psi) / (Wi1 +Wi2), where Pmi is the grayscale value of the i-th main pixel overlapping one of the pixels si, and Psi is the grayscale value of the pixel si. Therefore, it can be seen from the above that when the pixel point in the superimposed image 4 is closer to the main image 2, the weight value of the grayscale value of the point is more biased toward the main image 2, and vice versa, when the distance from the auxiliary image 3 is closer, The weight value of the grayscale value at this point is more biased toward the ancillary image 3.

【0022】[0022]

請參閱第2圖,其係根據本發明之另一實施例之影像灰階調整裝置之示意圖。如第2圖所示,當一主影像2欲與一附屬影像3形成一拼接影像時,其中所重疊到之重疊影像4則分別含有主影像2的部份主像素及附屬影像3之部份附屬像素。首先由計算區域決定單元11在此拼接影像上產生一矩形,此矩形包含由頂點C1, C2, C3, C4構成之矩形且其座標分別為(Cc1, Rc1), (Cc2, Rc2), (Cc3, Rc3), (Cc4, Rc4),其中由C1 到C3形成一矩形之對角線且假設其長度為n。Please refer to FIG. 2, which is a schematic diagram of an image grayscale adjusting device according to another embodiment of the present invention. As shown in FIG. 2, when a main image 2 is to form a spliced image with an auxiliary image 3, the overlapping image 4 overlapped therein includes a part of the main pixel of the main image 2 and a part of the auxiliary image 3 Affiliated pixels. First, the calculation area determining unit 11 generates a rectangle on the spliced image, the rectangle including a rectangle composed of vertices C1, C2, C3, C4 and coordinates (Cc1, Rc1), (Cc2, Rc2), (Cc3) , Rc3), (Cc4, Rc4), wherein a diagonal of a rectangle is formed by C1 to C3 and is assumed to be n in length.

【0023】[0023]

此時考慮重疊影像4裡任一點座標點P1,座標點P1之座標為(CP1, RP1),此時由距離產生單元12利用距離公式以計算座標點P1到對角線上之一最短距離,即Length 2,其作法可以找到對角線上與座標點P1垂直相交之一點,再計算此點到座標點P1的距離即可,再由權重產生單元13計算第二權重132,此第二權重132=((n/2) - 座標點P1到對角線之最短距離)/(n/2)=(Length 1-Length 2)/Length1,其中Length 1=n/2且第一權重131與第二權重132互為1之補數,最後再由灰階值產生單元14計算座標點P1之一調整灰階值141(未顯示於圖中),其值=(第一權重131*與座標點P1重疊之主像素之灰階值+第二權重132*與座標點P1重疊之附屬像素之灰階值)/(第一權重131+第二權重132),彷照如上作法,將重疊影像4裡的每一個像素都由灰階值產生單元14重新產生,而可以將重疊影像4中的影像灰階值調整完畢。At this time, the coordinate point P1 at any point in the superimposed image 4 is considered, and the coordinates of the coordinate point P1 are (CP1, RP1). At this time, the distance generating unit 12 uses the distance formula to calculate the shortest distance from the coordinate point P1 to the diagonal line, that is, Length 2, the method can find a point perpendicularly intersecting the coordinate point P1 on the diagonal line, and then calculating the distance from the point to the coordinate point P1, and then calculating the second weight 132 by the weight generating unit 13, the second weight 132= ((n/2) - the shortest distance from the coordinate point P1 to the diagonal) / (n/2) = (Length 1-Length 2) / Length1, where Length 1 = n/2 and the first weight 131 and the second The weights 132 are 1's complement each other, and finally the grayscale value generating unit 14 calculates one of the coordinate points P1 to adjust the grayscale value 141 (not shown in the figure), and its value = (the first weight 131* and the coordinate point P1) The overlapping grayscale value of the main pixel + the second weight 132* and the grayscale value of the auxiliary pixel overlapping with the coordinate point P1) / (the first weight 131 + the second weight 132), according to the above method, will overlap the image 4 Each pixel is regenerated by the grayscale value generating unit 14, and the image grayscale value in the overlapped image 4 can be adjusted.

【0024】[0024]

詳細地說,其中此主影像2或附屬影像3可以包含一彩色影像,此彩色影像包含一紅色(R)成分影像、一綠色(G)成分影像以及一藍色(B)成分影像,利用本發明之影像灰階調整裝置1,可分別計算在此重疊影像4中之每一像素在紅色(R)成分影像、綠色(G)成分影像以及藍色(B)成分影像中之一紅色調整灰階值、一綠色調整灰階值以及一藍色調整灰階值;接著疊加此紅色調整灰階值、綠色調整灰階值以及藍色調整灰階值以產生一彩色之拼接影像。In detail, the main image 2 or the auxiliary image 3 may include a color image including a red (R) component image, a green (G) component image, and a blue (B) component image. The image gray scale adjusting device 1 of the invention can calculate, respectively, one of the red (R) component image, the green (G) component image, and the blue (B) component image in each of the superimposed images 4 The step value, a green adjustment grayscale value, and a blue adjustment grayscale value; then superimposing the red adjustment grayscale value, the green adjustment grayscale value, and the blue adjustment grayscale value to generate a color mosaic image.

【0025】[0025]

而在實際上進行影像拼接時,此影像灰階調整裝置1更可包含將重疊影像4內之像素si之調整灰階值乘上一經驗常數,以微調產生後之調整灰階值141,其中經驗常數係為小於等於1之正實數。The image grayscale adjusting device 1 may further include multiplying the adjusted grayscale value of the pixel si in the superimposed image 4 by an empirical constant to fine tune the adjusted grayscale value 141. The empirical constant is a positive real number less than or equal to one.

【0026】[0026]

請參閱第3圖,其係根據本發明之第二實施例之影像灰階調整方法之步驟流程圖。如第3圖所示,步驟S1在拼接影像上決定一矩形以包含此重疊影像,其中重疊影像係包含主影像之複數個主像素及附屬影像之複數個附屬像素,如第2圖中由頂點C1, C2, C3及C4所構成之矩形;步驟S2計算像素si到此矩形之一對角線之一最短矩離di,其中像素si為此重疊影像中之一任意第i個附屬像素,此最短距離di如同在第2圖中之Length 2;步驟S3根據此對角線之長度n及最短距離di求得像素si之一第一權重Wi1及一第二權重Wi2,其中Wi2=((n/2)-di)/(n/2),Wi1=1-Wi2,步驟S4利用Wi1及Wi2以計算像素si之一調整灰階值;其中,調整灰階值=(Wi1*Pmi+Wi2*Psi)/(Wi1+Wi2),Pmi為與像素si重疊之一第i個主像素之灰階值,Psi為第i個附屬像素之灰階值。Please refer to FIG. 3, which is a flow chart of the steps of the image grayscale adjustment method according to the second embodiment of the present invention. As shown in FIG. 3, step S1 determines a rectangle on the spliced image to include the superimposed image, wherein the superimposed image includes a plurality of main pixels of the main image and a plurality of auxiliary pixels of the auxiliary image, as shown in FIG. 2 by the vertices. a rectangle formed by C1, C2, C3, and C4; step S2 calculates a shortest moment from one of the diagonals of the pixel si to the rectangle from di, wherein the pixel si is any one of the i-th auxiliary pixels in the overlapped image, The shortest distance di is like Length 2 in FIG. 2; step S3 finds one of the first weight Wi1 and one second weight Wi2 of the pixel si according to the length n and the shortest distance di of the diagonal, where Wi2=((n /2)-di)/(n/2), Wi1=1-Wi2, step S4 uses Wi1 and Wi2 to adjust the grayscale value by one of the calculation pixels si; wherein, adjusting the grayscale value=(Wi1*Pmi+Wi2* Psi)/(Wi1+Wi2), Pmi is the grayscale value of the i-th main pixel overlapping with the pixel si, and Psi is the grayscale value of the i-th auxiliary pixel.

【0027】[0027]

綜合以上所述,本發明之方法可以動態地在拼接影像中進行影像灰階調整,而非只單純利用固定的權重值以拼接兩張影像,讓拼接後之影像看來更為美觀,再者,本發明利用公式計算距離即可決定調整灰階之權重值,以達到減少cpu之計算量,進而產生運算速度之提升。In summary, the method of the present invention can dynamically adjust the grayscale of the image in the stitched image, instead of simply using the fixed weight value to stitch the two images, so that the stitched image looks more beautiful, and The invention uses the formula to calculate the distance to determine the weight value of the gray scale to reduce the calculation amount of the cpu, thereby generating an increase in the calculation speed.

【0028】[0028]

雖然本發明已參照其例示性實施例而特別地顯示及描述,將為所屬技術領域具通常知識者所理解的是,於不脫離以下申請專利範圍及其等效物所定義之本發明之精神與範疇下可對其進行形式與細節上之各種變更。
The present invention has been particularly shown and described with reference to the exemplary embodiments thereof, and it is understood by those of ordinary skill in the art Various changes in form and detail can be made in the context of the category.

 

1 影像灰階調整裝置
11 計算區域決定單元
12 距離產生單元
13 權重產生單元
131 第一權重
132 第二權重
14 灰階值產生單元
141 調整灰階值
1 image gray scale adjustment device
11 Calculation area decision unit
12 distance generating unit
13 weight generation unit
131 first weight
132 second weight
14 gray scale value generating unit
141 Adjusting the grayscale value

Claims (8)

【第1項】[Item 1] 一種影像灰階調整方法,用於拼接一主影像與一附屬影像成一拼接影像時,調整該主影像與該附屬影像之間相重疊的一重疊影像之灰階值,該影像灰階調整方法包含:
在該拼接影像上決定一矩形以包含該重疊影像,其中該重疊影像係包含該主影像之複數個主像素及該附屬影像之複數個附屬像素;
計算一像素si到該矩形之一對角線之一最短矩離di,其中該像素si為該重疊影像中之一任意第i個附屬像素;
根據該對角線之一長度n及該最短矩離di求得該像素si之一第一權重Wi1及一第二權重Wi2,其中Wi2=((n/2)-di)/(n/2),Wi1=1-Wi2,以及
利用該第一權重Wi1及該第二權重Wi2以計算該像素si之一調整灰階值;
其中,該調整灰階值=(Wi1*Pmi+Wi2*Psi)/(Wi1+Wi2),Pmi為與該像素si重疊之一第i個該主像素之灰階值,Psi為該第i個該附屬像素之灰階值。
An image grayscale adjustment method for splicing a main image and an auxiliary image into a spliced image, adjusting a grayscale value of an overlapping image overlapping the main image and the auxiliary image, the image grayscale adjustment method includes :
Determining a rectangle on the spliced image to include the superimposed image, wherein the superimposed image comprises a plurality of main pixels of the main image and a plurality of auxiliary pixels of the auxiliary image;
Calculating a shortest moment from one pixel si to one of the diagonals of the rectangle from di, wherein the pixel si is any one of the i-th auxiliary pixels in the overlapping image;
Finding a first weight Wi1 and a second weight Wi2 of the pixel si according to a length n of the diagonal and the shortest moment di, where Wi2=((n/2)-di)/(n/2 ), Wi1=1-Wi2, and using the first weight Wi1 and the second weight Wi2 to calculate one of the pixels si to adjust the grayscale value;
Wherein, the adjustment grayscale value=(Wi1*Pmi+Wi2*Psi)/(Wi1+Wi2), Pmi is the grayscale value of the i-th main pixel overlapping with the pixel si, and Psi is the i-th The grayscale value of the attached pixel.
【第2項】[Item 2] 如申請專利範圍第1項所述之影像灰階調整方法,其中該主影像或該附屬影像係包含一彩色影像,該彩色影像包含一紅色成分影像、一綠色成分影像以及一藍色成分影像。The image grayscale adjustment method of claim 1, wherein the main image or the auxiliary image system comprises a color image, the color image comprising a red component image, a green component image, and a blue component image. 【第3項】[Item 3] 如申請專利範圍第2項所述之影像灰階調整方法,更包含:  分別計算該重疊影像之每一該像素在該紅色成分影像、該綠色成分影像以及該藍色成分影像中之一紅色調整灰階值、一綠色調整灰階值以及一藍色調整灰階值;疊加該紅色調整灰階值、該綠色調整灰階值以及該藍色調整灰階值以產生一彩色之該拼接影像。The image grayscale adjustment method of claim 2, further comprising: calculating, respectively, one of the red component image, the green component image, and the blue component image of the overlapping image. a grayscale value, a green adjustment grayscale value, and a blue adjustment grayscale value; superimposing the red adjustment grayscale value, the green adjustment grayscale value, and the blue adjustment grayscale value to generate a color of the stitched image. 【第4項】[Item 4] 如申請專利範圍第1項所述之影像灰階調整方法,更包含:將該重疊影像內之該像素si之該調整灰階值乘上一經驗常數,以微調該調整灰階值,其中該經驗常數係為小於等於1之正實數。 The image grayscale adjustment method of claim 1, further comprising: multiplying the adjusted grayscale value of the pixel si in the superimposed image by an empirical constant to fine tune the adjusted grayscale value, wherein the The empirical constant is a positive real number less than or equal to one. 【第5項】[Item 5] 一種影像灰階調整裝置,用於拼接一主影像與一附屬影像成一拼接影像時,調整該主影像與該附屬影像之間相重疊之一重疊影像之灰階值,該影像灰階調整裝置包含:
一計算區域決定單元,係在該拼接影像上決定一矩形以包含該重疊影像,其中該重疊影像係包含該主影像之複數個主像素及該附屬影像之複數個附屬像素;
一距離產生單元,係計算該重疊影像中之一像素si到該矩形之一對角線之一最短矩離di,其中該像素si為該重疊影像中之一任意第i個該附屬像素;
一權重產生單元,根據該對角線之長度n及該最短矩離di求得該像素si之一第一權重Wi1及一第二權重Wi2,其中Wi2=((n/2)-di)/(n/2),Wi1=1-Wi2;以及
一灰階值產生單元,利用該第一權重Wi1及該第二權重Wi2以計算該像素si之一調整灰階值;
其中,該調整灰階值=(Wi1*Pmi+Wi2*Psi)/(Wi1+Wi2),Pmi為與該像素si重疊之一第i個該主像素之灰階值,Psi為該第i個該附屬像素之灰階值。
An image grayscale adjustment device is configured to adjust a grayscale value of an overlapping image between the main image and the auxiliary image when the main image and the auxiliary image are merged into a mosaic image, the image grayscale adjustment device includes :
a computing area determining unit is configured to determine a rectangle on the spliced image to include the overlapping image, wherein the overlapping image includes a plurality of main pixels of the main image and a plurality of auxiliary pixels of the auxiliary image;
a distance generating unit calculates a shortest moment from one of the pixels si in the overlapping image to one of the diagonals of the rectangle, wherein the pixel si is any one of the i-th auxiliary pixels in the overlapping image;
a weight generating unit obtains a first weight Wi1 and a second weight Wi2 of the pixel si according to the length n of the diagonal and the shortest moment di, where Wi2=((n/2)-di)/ (n/2), Wi1=1-Wi2; and a grayscale value generating unit, using the first weight Wi1 and the second weight Wi2 to calculate one of the pixels si to adjust the grayscale value;
Wherein, the adjustment grayscale value=(Wi1*Pmi+Wi2*Psi)/(Wi1+Wi2), Pmi is the grayscale value of the i-th main pixel overlapping with the pixel si, and Psi is the i-th The grayscale value of the attached pixel.
【第6項】[Item 6] 如申請專利範圍第5項所述之影像灰階調整裝置,其中該主影像或該附屬影像係包含一彩色影像,該彩色影像包含一紅色成分影像、一綠色成分影像以及一藍色成分影像。The image grayscale adjustment device of claim 5, wherein the main image or the auxiliary image system comprises a color image, the color image comprising a red component image, a green component image, and a blue component image. 【第7項】[Item 7] 如申請專利範圍第6項所述之影像灰階調整裝置,更包含:  分別計算該重疊影像之每一像素在該紅色成分影像、該綠色成分影像以及該藍色成分影像中之一紅色調整灰階值、一綠色調整灰階值以及一藍色調整灰階值;疊加該紅色調整灰階值、該綠色調整灰階值以及該藍色調整灰階值以產生一彩色之該拼接影像。The image gray scale adjusting device of claim 6, further comprising: calculating, respectively, one of the red component image, the green component image, and the blue component image a step value, a green adjustment gray scale value, and a blue adjustment gray scale value; superimposing the red adjustment gray scale value, the green adjustment gray scale value, and the blue adjustment gray scale value to generate a color of the stitched image. 【第8項】[Item 8] 如申請專利範圍第5項所述之影像灰階調整裝置,更包含:將該重疊影像內之該像素si之該調整灰階值乘上一經驗常數,以微調該調整灰階值,其中該經驗常數係為小於等於1之正實數。
The image grayscale adjusting device of claim 5, further comprising: multiplying the adjusted grayscale value of the pixel si in the superimposed image by an empirical constant to fine tune the adjusted grayscale value, wherein the The empirical constant is a positive real number less than or equal to one.
TW103106102A 2014-02-24 2014-02-24 Image gray scale adjusting device and method thereof TWI506594B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW103106102A TWI506594B (en) 2014-02-24 2014-02-24 Image gray scale adjusting device and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW103106102A TWI506594B (en) 2014-02-24 2014-02-24 Image gray scale adjusting device and method thereof

Publications (2)

Publication Number Publication Date
TW201533707A TW201533707A (en) 2015-09-01
TWI506594B true TWI506594B (en) 2015-11-01

Family

ID=54694838

Family Applications (1)

Application Number Title Priority Date Filing Date
TW103106102A TWI506594B (en) 2014-02-24 2014-02-24 Image gray scale adjusting device and method thereof

Country Status (1)

Country Link
TW (1) TWI506594B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI598847B (en) 2015-10-27 2017-09-11 東友科技股份有限公司 Image jointing method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201117131A (en) * 2009-11-09 2011-05-16 Tele Atlas Bv Method for creating a mosaic image using masks
CN101866096B (en) * 2010-05-04 2012-01-11 北京航空航天大学 Multi-projecting apparatus image splicing automatic edge blending method based on fuzzy control
TW201232468A (en) * 2011-01-31 2012-08-01 Tele Atlas Polska Sp Z O O Method and apparatus for use in forming an image
US20120274739A1 (en) * 2009-12-21 2012-11-01 Huawei Device Co.,Ud. Image splicing method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201117131A (en) * 2009-11-09 2011-05-16 Tele Atlas Bv Method for creating a mosaic image using masks
US20120274739A1 (en) * 2009-12-21 2012-11-01 Huawei Device Co.,Ud. Image splicing method and apparatus
CN101866096B (en) * 2010-05-04 2012-01-11 北京航空航天大学 Multi-projecting apparatus image splicing automatic edge blending method based on fuzzy control
TW201232468A (en) * 2011-01-31 2012-08-01 Tele Atlas Polska Sp Z O O Method and apparatus for use in forming an image

Also Published As

Publication number Publication date
TW201533707A (en) 2015-09-01

Similar Documents

Publication Publication Date Title
KR102641272B1 (en) Motion smoothing for reprojected frames
CN109314753B (en) Method and computer-readable storage medium for generating intermediate views using optical flow
TWI526992B (en) Method for optimizing occlusion in augmented reality based on depth camera
WO2017215899A8 (en) Augmented and virtual reality
TWI419078B (en) Apparatus for generating a real-time stereoscopic image and method thereof
JP2020091890A (en) Varying effective resolution based on screen location in graphic processing by approximating projection of vertex onto curved viewport
US10026230B2 (en) Augmented point cloud for a visualization system and method
US9396530B2 (en) Low memory content aware image modification
WO2020092477A8 (en) Display engine for post-rendering processing
JP2015221089A5 (en)
US9838614B1 (en) Multi-camera image data generation
CN105026997A (en) Projection system, semiconductor integrated circuit, and image correction method
US10803654B2 (en) Three-dimensional human face reconstruction method
JP2018518918A5 (en)
JP2018524896A5 (en)
WO2020252806A1 (en) Event data stream processing method and computing device
CN107145224A (en) Human eye sight tracking and device based on three-dimensional sphere Taylor expansion
TWI506594B (en) Image gray scale adjusting device and method thereof
TW201712639A (en) Stereo image depth map generation device and method
WO2017206824A1 (en) Position information processing method and system for use in smart display of visual images
KR102238741B1 (en) Method of measuring light emitting status of display panel and method of compensating light emitting status of display panel
TWI663427B (en) Head mounted display and chroma aberration compensation method using sub-pixel shifting
CN106415656A (en) Image generation device and operation assistance system
CN116152121A (en) Curved surface screen generating method and correcting method based on distortion parameters
TWI641999B (en) Eyeball recognition method and system