TWI596572B - Method of automatically coloring image blocks - Google Patents
Method of automatically coloring image blocks Download PDFInfo
- Publication number
- TWI596572B TWI596572B TW105121388A TW105121388A TWI596572B TW I596572 B TWI596572 B TW I596572B TW 105121388 A TW105121388 A TW 105121388A TW 105121388 A TW105121388 A TW 105121388A TW I596572 B TWI596572 B TW I596572B
- Authority
- TW
- Taiwan
- Prior art keywords
- image
- color
- electronic device
- reference image
- pixel
- Prior art date
Links
Landscapes
- Image Processing (AREA)
- Processing Or Creating Images (AREA)
Description
本發明是有關於一種自動對一目標圖像的多個待著色的圖像區塊著色的方法,特別是指一種根據一參考圖像來自動對該等圖像區塊著色的方法。The present invention relates to a method for automatically coloring a plurality of image blocks to be colored of a target image, and more particularly to a method for automatically coloring the image blocks according to a reference image.
不論是彩妝化妝品、服飾、汽車,或3C產品,消費者對一產品的注意力通常主要來自對產品的外在視覺感受,例如對產品的外觀色彩或形狀的視覺感受。特別地,色彩被認為是影響美觀和整體視覺愉悅的重要元素;由於色彩多被視為決定產品是否具有美感的指標,故產品的外觀色彩設計也直接影響消費者對於產品的購買意願。Whether it's make-up cosmetics, apparel, cars, or 3C products, consumers' attention to a product usually comes primarily from the external visual perception of the product, such as the visual perception of the color or shape of the product. In particular, color is considered to be an important element affecting aesthetics and overall visual pleasure; since color is often regarded as an indicator of whether a product has aesthetic appeal, the appearance color design of the product also directly affects the consumer's willingness to purchase the product.
現今的設計師在設計產品時,通常以個人感知和經驗進行產品的外形設計與配色,但如此的產品設計恐怕過於主觀。此外,對於較無經驗的新手設計師來說,要對產品的外觀進行適當的配色也是一項困難的任務。Today's designers often design and color the product with personal perception and experience, but such product design may be too subjective. In addition, for less experienced beginner designers, proper color matching of the product's appearance is also a difficult task.
因此,本發明之目的,即在提供一種自動著色圖像區塊的方法。Accordingly, it is an object of the present invention to provide a method of automatically coloring image blocks.
於是,本發明自動著色圖像區塊的方法,用於根據一參考圖像對一目標圖像的多個待著色的圖像區塊著色。Thus, the method for automatically coloring image blocks of the present invention is for coloring a plurality of image blocks to be colored of a target image according to a reference image.
該自動著色圖像區塊的方法由一電子裝置實施,並包含一步驟(a)及一步驟(b)。The method of automatically coloring image blocks is implemented by an electronic device and includes a step (a) and a step (b).
該步驟(a)是該電子裝置根據該參考圖像,計算出該參考圖像的多個組成顏色,及該等組成顏色在該參考圖像中的組成比例。The step (a) is that the electronic device calculates a plurality of constituent colors of the reference image according to the reference image, and a composition ratio of the constituent colors in the reference image.
該步驟(b)是該電子裝置根據該等組成顏色對該等圖像區塊著色,以使得該等組成顏色在該參考圖像中的組成比例接近在該等圖像區塊中的組成比例。The step (b) is that the electronic device colors the image blocks according to the component colors such that the composition ratio of the component colors in the reference image is close to the composition ratio in the image blocks. .
本發明之功效在於:能自動對該等圖像區塊配色,將該參考圖像的配色風格移植到該目標圖像。The effect of the invention is that the image blocks can be automatically color matched, and the color matching style of the reference image is transplanted to the target image.
本發明自動著色圖像區塊的方法用於根據一參考圖像對一目標圖像的多個待著色的圖像區塊著色,並由一例如為個人電腦或行動裝置的電子裝置實施。The method of automatically coloring image blocks of the present invention is for coloring a plurality of image blocks to be colored of a target image according to a reference image, and is implemented by an electronic device such as a personal computer or a mobile device.
在此以圖1所示的目標圖像1及圖2所示的參考圖像2來說明。該目標圖像1為一包含一指甲油產品組的圖像,該指甲油產品組包括四個指甲油瓶,且每一指甲油瓶的瓶身為一待著色的圖像區塊,該等待著色的圖像區塊分別為一第一圖像區塊11,一第二圖像區塊12,一第三圖像區塊13,及一第四圖像區塊14。該參考圖像2為一風景圖畫。Here, the target image 1 shown in FIG. 1 and the reference image 2 shown in FIG. 2 will be described. The target image 1 is an image comprising a nail polish product group, the nail polish product set includes four nail polish bottles, and the bottle body of each nail polish bottle is an image block to be colored, the waiting The colored image blocks are a first image block 11, a second image block 12, a third image block 13, and a fourth image block 14. This reference image 2 is a landscape picture.
參閱圖3,圖3說明本發明自動著色圖像區塊的方法所包含的步驟。Referring to Figure 3, Figure 3 illustrates the steps involved in the method of automatically coloring image blocks of the present invention.
首先,在步驟31,該電子裝置將該參考圖像2的格式轉換成HSV格式而獲得該參考圖像2的每一像素的色相值(Hue)、飽和度值(Saturation),及亮度值(Lightness)。First, in step 31, the electronic device converts the format of the reference image 2 into an HSV format to obtain a hue value, a saturation value, and a brightness value of each pixel of the reference image 2. Lightness).
接著,在步驟32,該電子裝置利用一模糊C-平均分群法(Fuzzy C-Means Clustering, FCM)從該參考圖像2的多個像素的多個色相值中分出多個像素群。Next, in step 32, the electronic device separates a plurality of pixel groups from a plurality of hue values of the plurality of pixels of the reference image 2 by using a fuzzy C-Means Clustering (FCM) method.
接著,在步驟33,該電子裝置針對每一像素群,根據該像素群所包含的像素計算出一代表該像素群的顏色,並以該顏色作為該參考圖像2的一組成顏色;其中,較佳地,對於每一像素群,可利用該像素群的群中心的色相值所對應的顏色作為該代表該像素群的顏色。此外,該等像素群各自所包含的像素數量的比例即為該等組成顏色在該參考圖像2中的組成比例。Next, in step 33, the electronic device calculates, for each pixel group, a color representing the pixel group according to the pixels included in the pixel group, and uses the color as a component color of the reference image 2; Preferably, for each pixel group, the color corresponding to the hue value of the group center of the pixel group can be used as the color representing the pixel group. In addition, the ratio of the number of pixels included in each of the pixel groups is the composition ratio of the constituent colors in the reference image 2.
在本實施方式中,該電子裝置利用FCM分群法從該參考圖像2的該等像素中分出六個像素群,其中各個像素群所包含的像素數量的比例分別為C 1%、C 2%、C 3%、C 4%、C 5%,及C 6%,且各個比例的總和為一百,且C i=第i像素群的像素數量÷該六個像素群的像素總數量;對應地,如圖2所示,該等組成顏色包含一第一組成顏色21、一第二組成顏色22、一第三組成顏色23、一第四組成顏色24,一第五組成顏色25,及一第六組成顏色26,且該等組成顏色在該參考圖像2中的組成比例為:C 1%的第一組成顏色21、C 2%的第二組成顏色22、C 3%的第三組成顏色23、C 4%的第四組成顏色24、C 5%的第五組成顏色25,及C 6%的第六組成顏色26。 In this embodiment, the electronic device divides six pixel groups from the pixels of the reference image 2 by using the FCM grouping method, wherein the proportion of the number of pixels included in each pixel group is C 1 %, C 2 , respectively. %, C 3 %, C 4 %, C 5 %, and C 6 %, and the sum of the respective ratios is one hundred, and C i = the number of pixels of the i-th pixel group ÷ the total number of pixels of the six pixel groups; Correspondingly, as shown in FIG. 2, the constituent colors include a first composition color 21, a second composition color 22, a third composition color 23, a fourth composition color 24, a fifth composition color 25, and a sixth composition color 26, and the composition ratio of the constituent colors in the reference image 2 is: C 1 % of the first composition color 21, C 2 % of the second composition color 22, C 3 % of the third ratio The fourth composition color 24 constituting the color 23, C 4 %, the fifth composition color 25 of C 5 %, and the sixth composition color 26 of C 6 %.
值得一提的是,雖然本實施方式是利用FCM分群法來進行像素的分群,但可不限於此;例如,在另一實施方式中,也可利用K-平均分群法(K-means clustering)、階層式分群法(hierarchical clustering)等其他現有的資料分群演算法來進行像素的分群。It is worth mentioning that although the present embodiment uses the FCM grouping method to perform grouping of pixels, it is not limited thereto; for example, in another embodiment, K-means clustering may be used, Other existing data grouping algorithms, such as hierarchical clustering, perform pixel grouping.
最後,在步驟34,該電子裝置針對每一圖像區塊,選擇該等組成顏色的其中一者來對該圖像區塊著色,而使得該等組成顏色在該參考圖像2中的組成比例接近在該等圖像區塊中的組成比例。Finally, in step 34, the electronic device selects one of the constituent colors for each image block to color the image block, so that the composition colors are composed in the reference image 2. The ratio is close to the composition ratio in the image blocks.
特別地,在本實施方式中,該電子裝置利用一基因演算法(genetic algorithm)來針對每一圖像區塊,選擇該等組成顏色的其中一者來對該圖像區塊著色。基因演算法是一種求解最佳化問題的方法,此方法需先針對所欲求解的問題設計多個染色體的編碼及一適應函數,然後迭代地利用交配(crossover)、突變(mutation)等演化運算來獲得該適應函數的多個較佳解。In particular, in the present embodiment, the electronic device utilizes a genetic algorithm to select one of the constituent colors for each image block to color the image block. Gene algorithm is a method to solve the optimization problem. This method needs to design multiple chromosome coding and an adaptive function for the problem to be solved, and then iteratively utilizes the evolution operations such as crossover and mutation. To obtain a plurality of preferred solutions of the adaptation function.
下列表一說明了本實施方式的每一染色體的編碼形式,其中因為該等待著色的圖像區塊的數量為四,所每一染色體具有四個分別對應該等圖像區塊的基因,每一基因對應該六個組成顏色的其中一者。 表一 <TABLE border="1" borderColor="#000000" width="_0001"><TBODY><tr><td> 第一基因(第一圖像區塊11) </td><td> 第二基因(第二圖像區塊12) </td><td> 第三基因(第三圖像區塊13) </td><td> 第四基因(第四圖像區塊14) </td></tr><tr><td> 對應的組成顏色 </td><td> 對應的組成顏色 </td><td> 對應的組成顏色 </td><td> 對應的組成顏色 </td></tr></TBODY></TABLE>Table 1 below illustrates the coding form of each chromosome of the present embodiment, wherein since the number of image blocks waiting to be colored is four, each chromosome has four genes corresponding to the image blocks, respectively. A gene corresponds to one of six constituent colors. Table I <TABLE border="1" borderColor="#000000" width="_0001"><TBODY><tr><td> First gene (first image block 11) </td><td> Second gene (second image block 12) </td><td> third gene (third image block 13) </td><td> fourth gene (fourth image block 14) </td ></tr><tr><td> Corresponding composition color </td><td> Corresponding composition color </td><td> Corresponding composition color </td><td> Corresponding composition color </ Td></tr></TBODY></TABLE>
此外,該適應函數為 ,其中 n為組成顏色的數量,在此為六; 為第 i基因對應的組成顏色在該四個圖像區塊中的組成比例,也就是 =第 i圖像區塊的像素數量÷該四個圖像區塊的像素總數量; 為第 i基因對應的組成顏色在該參考圖像2中的組成比例。本實施方式藉由基因演算法來演化出最小化該適應函數的多個對應較佳解的染色體,當該電子裝置根據一對應較佳解的染色體所表示的圖像區塊與組成顏色的對應關係來對該四個圖像區塊進行著色時,能使得該六個組成顏色在該參考圖像2中的組成比例較接近在該四個圖像區塊中的組成比例。 In addition, the adaptation function is Where n is the number of constituent colors, here six; The composition ratio of the constituent colors corresponding to the i-th gene in the four image blocks, that is, = the number of pixels of the i-th image block ÷ the total number of pixels of the four image blocks; The composition ratio of the composition color corresponding to the i-th gene in the reference image 2. In this embodiment, a genetic algorithm is used to evolve a chromosome that minimizes a plurality of corresponding preferred solutions of the adaptive function, and the electronic device corresponds to the composition color represented by a chromosome corresponding to a preferred solution. When the relationship is to color the four image blocks, the composition ratio of the six constituent colors in the reference image 2 can be made closer to the composition ratio in the four image blocks.
舉例來說,下列表二例示一對應較佳解的染色體,圖4例示根據該染色體所表示的圖像區塊與組成顏色的對應關係來對該四個圖像區塊進行著色的結果,其中該第一圖像區塊11被著色成該第二組成顏色22,該第二圖像區塊12被著色成該第一組成顏色21,該第三圖像區塊13被著色成該第五組成顏色25,該第四圖像區塊14被著色成該第六組成顏色26。顯然,本發明自動著色圖像區塊的方法能將圖2所示的該參考圖像2的配色風格移植到該目標圖像1的該四個圖像區塊。 表二 <TABLE border="1" borderColor="#000000" width="_0003"><TBODY><tr><td> 第一基因(第一圖像區塊11) </td><td> 第二基因(第二圖像區塊12) </td><td> 第三基因(第三圖像區塊13) </td><td> 第四基因(第四圖像區塊14) </td></tr><tr><td> 第二組成顏色22 </td><td> 第一組成顏色21 </td><td> 第五組成顏色25 </td><td> 第六組成顏色26 </td></tr></TBODY></TABLE>For example, the following list 2 illustrates a chromosome corresponding to a preferred solution, and FIG. 4 illustrates a result of coloring the four image blocks according to a correspondence relationship between the image block and the composition color represented by the chromosome, wherein The first image block 11 is colored into the second composition color 22, the second image block 12 is colored into the first composition color 21, and the third image block 13 is colored into the fifth The color 25 is composed, and the fourth image block 14 is colored into the sixth composition color 26. Obviously, the method of automatically coloring image blocks of the present invention can transplant the color matching style of the reference image 2 shown in FIG. 2 to the four image blocks of the target image 1. Table II <TABLE border="1" borderColor="#000000" width="_0003"><TBODY><tr><td> First gene (first image block 11) </td><td> Second gene (second image block 12) </td><td> third gene (third image block 13) </td><td> fourth gene (fourth image block 14) </td ></tr><tr><td> second composition color 22 </td><td> first composition color 21 </td><td> fifth composition color 25 </td><td> sixth composition Color 26 </td></tr></TBODY></TABLE>
綜上所述,本發明自動著色圖像區塊的方法,藉由計算出該參考圖像的多個組成顏色,及該等組成顏色在該參考圖像中的組成比例,並根據該等組成顏色對該目標影像的多個待著色的圖像區塊著色,以使得該等組成顏色在該參考圖像中的組成比例接近在該等圖像區塊中的組成比例,能達成將該參考圖像的配色風格移植到該目標圖像,並自動對該等圖像區塊配色的功效,故確實能達成本發明的目的。In summary, the method for automatically coloring an image block of the present invention calculates a plurality of constituent colors of the reference image, and a composition ratio of the constituent colors in the reference image, and according to the components Coloring the plurality of image blocks to be colored of the target image, such that the composition ratio of the constituent colors in the reference image is close to a composition ratio in the image blocks, and the reference can be achieved. The color matching style of the image is transplanted to the target image, and the effect of color matching of the image blocks is automatically performed, so that the object of the present invention can be achieved.
惟以上所述者,僅為本發明的實施例而已,當不能以此限定本發明實施的範圍,凡是依本發明申請專利範圍及專利說明書內容所作的簡單的等效變化與修飾,皆仍屬本發明專利涵蓋的範圍內。However, the above is only the embodiment of the present invention, and the scope of the invention is not limited thereto, and all the simple equivalent changes and modifications according to the scope of the patent application and the patent specification of the present invention are still Within the scope of the invention patent.
1‧‧‧目標圖像1‧‧‧ Target image
11‧‧‧第一圖像區塊11‧‧‧First image block
12‧‧‧第二圖像區塊12‧‧‧Second image block
13‧‧‧第三圖像區塊13‧‧‧ Third image block
14‧‧‧第四圖像區塊14‧‧‧Four image block
2‧‧‧參考圖像2‧‧‧ reference image
21‧‧‧第一組成顏色21‧‧‧ first composition color
22‧‧‧第二組成顏色22‧‧‧Second composition color
23‧‧‧第三組成顏色23‧‧‧ Third component color
24‧‧‧第四組成顏色24‧‧‧ fourth composition color
25‧‧‧第五組成顏色25‧‧‧ fifth composition color
26‧‧‧第六組成顏色26‧‧‧ sixth composition color
31~34‧‧‧步驟31~34‧‧‧Steps
本發明的其他的特徵及功效,將於參照圖式的實施方式中清楚地呈現,其中: 圖1是一示意圖,例示一包含多個待著色的圖像區塊的目標圖像; 圖2是一示意圖,例示一參考圖像; 圖3是一流程圖,說明本發明自動著色圖像區塊的方法所包含的步驟;及 圖4是一示意圖,例示對該目標圖像著色的結果。Other features and effects of the present invention will be apparent from the following description of the drawings, wherein: Figure 1 is a schematic diagram illustrating a target image comprising a plurality of image blocks to be colored; A schematic diagram illustrating a reference image; FIG. 3 is a flow chart illustrating the steps involved in the method of automatically coloring an image block of the present invention; and FIG. 4 is a schematic diagram illustrating the result of coloring the target image.
31~34‧‧‧步驟 31~34‧‧‧Steps
Claims (6)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW105121388A TWI596572B (en) | 2016-07-06 | 2016-07-06 | Method of automatically coloring image blocks |
CN201710221351.9A CN107590847A (en) | 2016-07-06 | 2017-04-06 | Method for automatically coloring image block |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW105121388A TWI596572B (en) | 2016-07-06 | 2016-07-06 | Method of automatically coloring image blocks |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI596572B true TWI596572B (en) | 2017-08-21 |
TW201802773A TW201802773A (en) | 2018-01-16 |
Family
ID=60189179
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW105121388A TWI596572B (en) | 2016-07-06 | 2016-07-06 | Method of automatically coloring image blocks |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107590847A (en) |
TW (1) | TWI596572B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020136453A1 (en) * | 2001-02-13 | 2002-09-26 | International Business Machines Corporation | Automatic coloring of pixels exposed during manipulation of image regions |
CN101477695A (en) * | 2009-01-05 | 2009-07-08 | 东南大学 | Method for fast painting image and video |
CN101796507A (en) * | 2007-08-27 | 2010-08-04 | 兰德马克绘图国际公司,哈里伯顿公司 | Systems and methods for computing a variogram model |
CN102214364A (en) * | 2011-04-27 | 2011-10-12 | 天津大学 | Automatic coloring method of gray level images in combination with histogram regression and texture analysis |
US20140071347A1 (en) * | 2012-09-07 | 2014-03-13 | Beihang University | Method for Editing Propagation of Video and Image Content Based on Local Feature Structure Preservation |
CN104376529A (en) * | 2014-11-25 | 2015-02-25 | 深圳北航新兴产业技术研究院 | Gray level image colorization system and method based on GLCM |
TW201545119A (en) * | 2014-05-22 | 2015-12-01 | Nat Univ Chung Cheng | Data clustering method applicable to color images |
CN105118076A (en) * | 2015-07-30 | 2015-12-02 | 上海应用技术学院 | Image colorization method based on over-segmentation and local and global consistency |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8467629B2 (en) * | 2010-08-12 | 2013-06-18 | High Technology Video, Inc. | Methods and systems for automatic coloring of digital images |
-
2016
- 2016-07-06 TW TW105121388A patent/TWI596572B/en not_active IP Right Cessation
-
2017
- 2017-04-06 CN CN201710221351.9A patent/CN107590847A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020136453A1 (en) * | 2001-02-13 | 2002-09-26 | International Business Machines Corporation | Automatic coloring of pixels exposed during manipulation of image regions |
CN101796507A (en) * | 2007-08-27 | 2010-08-04 | 兰德马克绘图国际公司,哈里伯顿公司 | Systems and methods for computing a variogram model |
CN101477695A (en) * | 2009-01-05 | 2009-07-08 | 东南大学 | Method for fast painting image and video |
CN102214364A (en) * | 2011-04-27 | 2011-10-12 | 天津大学 | Automatic coloring method of gray level images in combination with histogram regression and texture analysis |
US20140071347A1 (en) * | 2012-09-07 | 2014-03-13 | Beihang University | Method for Editing Propagation of Video and Image Content Based on Local Feature Structure Preservation |
TW201545119A (en) * | 2014-05-22 | 2015-12-01 | Nat Univ Chung Cheng | Data clustering method applicable to color images |
CN104376529A (en) * | 2014-11-25 | 2015-02-25 | 深圳北航新兴产业技术研究院 | Gray level image colorization system and method based on GLCM |
CN105118076A (en) * | 2015-07-30 | 2015-12-02 | 上海应用技术学院 | Image colorization method based on over-segmentation and local and global consistency |
Also Published As
Publication number | Publication date |
---|---|
CN107590847A (en) | 2018-01-16 |
TW201802773A (en) | 2018-01-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10777021B2 (en) | Virtual representation creation of user for fit and style of apparel and accessories | |
CN104203042B (en) | Makeup auxiliary device, cosmetic auxiliary method and recording medium | |
KR102485503B1 (en) | Apparatus and method for recommending goods based on analysis of image database | |
CN107993131B (en) | Putting-through recommendation method, device, server and storage medium | |
CN108052765A (en) | Scheme of colour automatic generation method and device based on personality impression | |
CN104767983B (en) | A kind of image processing method and device | |
WO2014074072A1 (en) | Clothing matching system and method | |
CN105118076B (en) | Based on over-segmentation and the local image colorization method with global coherency | |
CN101477560A (en) | Clothing matching system and method based on scheme database | |
US20140314315A1 (en) | Systems and Methods for Recommending Cosmetic Products for Users with Mobile Devices | |
CN109345612A (en) | A kind of image generating method, device, equipment and storage medium | |
JP2023537262A (en) | Apparatus and method for recommending color scheme based on spatial image analysis | |
JP6537419B2 (en) | Template selection system, template selection method, template selection program and recording medium storing the program | |
JP2009260530A (en) | Color conversion device, color conversion method, and color conversion program | |
Lin | A systematic approach of predicting color preference on the basis of gray relational grade | |
CN112218006B (en) | Multimedia data processing method and device, electronic equipment and storage medium | |
Liu et al. | Image-driven harmonious color palette generation for diverse information visualization | |
TWI596572B (en) | Method of automatically coloring image blocks | |
JP6052277B2 (en) | Color arrangement determination device, color arrangement determination method, and color arrangement determination program | |
Podlasov et al. | Japanese street fashion for young people: A multimodal digital humanities approach for identifying sociocultural patterns and trends | |
CN115375871A (en) | Intelligent interactive display platform based on virtual reality | |
Wickramarathne et al. | Trenditex: An intelligent fashion designer | |
CN103164210A (en) | Method and device of changing surface of application program interface | |
CN106485206A (en) | The teaching method being combined based on the video pictures made up and device | |
CN117689450B (en) | Digital marketing system based on big data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |