TWI543588B - Data-bearing encoding system and decoding system utilizing black and white pixel swap modulation - Google Patents
Data-bearing encoding system and decoding system utilizing black and white pixel swap modulation Download PDFInfo
- Publication number
- TWI543588B TWI543588B TW104134064A TW104134064A TWI543588B TW I543588 B TWI543588 B TW I543588B TW 104134064 A TW104134064 A TW 104134064A TW 104134064 A TW104134064 A TW 104134064A TW I543588 B TWI543588 B TW I543588B
- Authority
- TW
- Taiwan
- Prior art keywords
- halftone
- data
- image
- unit
- encoded
- Prior art date
Links
Landscapes
- Image Processing (AREA)
Description
本發明是有關於一種資料編碼方法,特別是指一種藉由像素黑白互換而將資料隱藏於半色調圖案中的半色調資料隱寫編碼系統及解碼系統。 The invention relates to a data encoding method, in particular to a halftone data steganography coding system and a decoding system for hiding data in a halftone pattern by pixel black and white interchange.
為了不破壞印刷品整體的美感,業界一直在研發如何將商品資訊,例如防偽資料隱藏在印刷品,例如商標圖案或圖片上,使其能與印刷品內容融為一體。例如圖1所示,美國第8594453號專利揭露一種在半色調影像中編碼的方法,其顯示一由多個像素組成的半色調單元502的一墨點形狀,且藉由將墨點上、下、左、右顛倒,使墨點位置能有四種變化,即可讓具有四種不同墨點位置的半色調單元502、504、506、508分別代表一個二位元編碼資料,例如00、01、10、11,藉此即可將資訊以二位元編碼方式隱寫在半色調影像中,而不致影響影像整體的美感。但此種編碼方法刻意 移動墨點的方式有違傳統半色調轉換方式,並使墨點位置大幅變動,容易使原有半色調影像的品質變差。 In order not to damage the overall beauty of the printed matter, the industry has been developing how to hide product information, such as anti-counterfeiting materials, in printed matter, such as trademark patterns or pictures, so that it can be integrated with printed content. For example, as shown in FIG. 1, U.S. Patent No. 8,854,453 discloses a method of encoding in a halftone image, which displays a dot shape of a halftone unit 502 composed of a plurality of pixels, and by moving the dots up and down. , left and right upside down, so that the ink dot position can have four changes, so that the halftone units 502, 504, 506, 508 having four different ink dot positions respectively represent a two-bit coded material, for example, 00, 01 , 10, 11, by which information can be steganized in half-tone images in a two-bit encoding without affecting the overall beauty of the image. But this coding method is deliberate The way of moving the ink dots is contrary to the conventional halftone conversion method, and the position of the ink dots is greatly changed, which tends to deteriorate the quality of the original halftone image.
此外,習知一種直接二位元搜尋法(direct binary search,以下簡稱DBS)可以將半色調影像的品質調到最佳,其方法如圖2所示,即測試半色調影像中的每一個像素,例如讓圖2位於中心的像素10藉由黑白互換(toggle)或與周邊八個鄰近的像素黑白互換(swap)後,將半色調影像與原始灰階影像兩者經由一人眼視覺模型(模擬人眼的視覺)感知(即比較兩者的差異)而產生一感知誤差值,並且不斷地重覆上述DBS步驟,以遞迴調整半色調影像直到人眼視覺模型產生的感知誤差值不再變動,即半色調影像與原始灰階影像兩者的誤差已達到最小,再對下一個像素重覆進行上述動作直到所有像素皆完成DBS,藉此,使經過直接二位元搜尋的半色調影像在視覺上最接近原始灰階影像。 In addition, a direct binary search (hereinafter referred to as DBS) can optimize the quality of a halftone image, as shown in FIG. 2, that is, test each pixel in a halftone image. For example, after the pixel 10 located at the center of FIG. 2 is swapped by black and white or by swapping with the neighboring eight adjacent pixels, the halftone image and the original grayscale image are both passed through a human visual model (simulation). The visual perception of the human eye (ie, comparing the differences between the two) produces a perceptual error value, and continuously repeats the above DBS steps to recursively adjust the halftone image until the perceptual error value produced by the human visual model no longer changes. That is, the error between the halftone image and the original grayscale image has been minimized, and then the above action is repeated on the next pixel until all the pixels complete the DBS, thereby making the halftone image through the direct binary search Visually closest to the original grayscale image.
因此,如何在半色調影像編碼過程中,減少對半色調影像品質的影響,並且結合DBS技術,讓編碼後半色調影像品質達到最佳化,遂成為本發明的重點。 Therefore, how to reduce the influence on the halftone image quality in the halftone image encoding process, and to combine the DBS technology to optimize the quality of the encoded halftone image, has become the focus of the present invention.
因此,本發明之目的,即在提供一種能維持半色調影像品質的利用像素黑白互換調變的半色調資料隱寫編碼系統及解碼系統。 Accordingly, it is an object of the present invention to provide a halftone data steganography system and decoding system that utilizes pixel black and white interchange modulation to maintain halftone image quality.
於是,本發明利用像素黑白互換調變的半色調資料隱寫編碼系統,用以將一灰階影像轉換成一半色調影像,並將資料隱寫在該半色調影像中;該系統包括:一半色調轉換模組,其根據一mxm正方形臨界值矩陣,將該灰階影像轉換成一具有多個半色調單元的半色調影像,且各該半色調單元具有mxm個像素,其中m為大於2的正整數;及一編碼模組,用以將一資料載入該半色調影像的該等半色調單元中,其判斷該資料是一第一資料時,令要被載入該第一資料的該半色調單元的墨點數維持不變,並且判斷該資料是一第二資料時,從要被載入該第二資料的該半色調單元中隨機選取一個像素,並判斷該像素為墨點時,將該像素換成非墨點,否則將該像素換成墨點,使該半色調單元成為一隱含該資料的已編碼單元,而使該半色調影像成為一編碼後半色調影像。 Accordingly, the present invention utilizes a halftone data steganography system for pixel black and white interchange modulation to convert a grayscale image into a halftone image and to lie data in the halftone image; the system includes: halftone a conversion module that converts the grayscale image into a halftone image having a plurality of halftone cells according to a mxm square threshold matrix, and each of the halftone cells has mxm pixels, wherein m is a positive integer greater than two And an encoding module for loading a data into the halftone units of the halftone image, and determining that the data is a first data, the halftone to be loaded into the first data When the number of ink points of the unit remains unchanged, and when the data is judged to be a second data, a pixel is randomly selected from the halftone unit to be loaded into the second data, and when the pixel is determined to be an ink dot, The pixel is replaced with a non-ink dot, otherwise the pixel is replaced with an ink dot, so that the halftone cell becomes a coded unit that implies the data, and the halftone image is a coded halftone image.
在本發明的一實施例中,該利用像素黑白互換調變的半色調資料隱寫編碼系統還包括一影像最佳化模組,其對該編碼後半色調影像中的該等半色調單元進行直接二位元搜尋,並且一次只對一個半色調單元進行直接二位元搜尋,該直接二位元搜尋判斷該半色調單元中的一個墨點是位在該半色調單元的中間、角落或側邊,並嘗試將該墨點與其相鄰的非墨點像素位置互換,直到判定其中一互換結果使該半色調單元與該灰階影像相對應的一部分影像最接近,即接受該互換結果,再對下一個墨點重覆執行該直接二位 元搜尋,直到全部墨點完成該直接二位元搜尋,該影像最佳化模組才會再對下一個半色調單元進行該直接二位元搜尋,並且對該編碼後半色調影像中的該等半色調單元以由上到下、由左到右方式一一進行該直接二位元搜尋,藉此產生一最佳化編碼後半色調影像。 In an embodiment of the invention, the halftone data steganography system using pixel black and white interchange modulation further includes an image optimization module for directly performing the halftone units in the encoded halftone image. Two-bit search, and perform direct binary search for only one halftone unit at a time, the direct binary search determines that one dot in the halftone unit is located in the middle, corner or side of the halftone unit And attempting to swap the ink dot with its adjacent non-ink dot pixel position until it is determined that one of the interchange results causes the halftone cell to be closest to a portion of the image corresponding to the grayscale image, that is, accepting the interchange result, and then The next ink dot repeats the direct two digits Meta-search, until all the dots complete the direct binary search, the image optimization module will perform the direct binary search for the next halftone unit, and the same in the encoded halftone image The halftone unit performs the direct binary search one by one from top to bottom and left to right, thereby generating an optimized encoded halftone image.
在本發明的一實施例中,該mxm正方形臨界值矩陣包含一由[m,0]、[0,m]兩個二維向量構成的一網幕向量以及mxm個臨界值。 In an embodiment of the invention, the mxm square threshold matrix comprises a screen vector consisting of two two-dimensional vectors [m, 0], [0, m] and mxm threshold values.
在本發明的一實施例中,該等臨界值是由集中式抖色法或分散式抖色法產生。 In an embodiment of the invention, the threshold values are generated by a centralized dithering method or a decentralized dithering method.
在本發明的一實施例中,該第一資料是二進制的數字0,該第二資料是二進制的數字1。 In an embodiment of the invention, the first data is a binary number 0 and the second data is a binary number 1.
再者,本發明利用像素黑白互換調變的半色調資料隱寫解碼系統,用以讀取隱寫在一編碼後半色調影像中的資料,並包括:一資料庫,其記錄與該編碼後半色調影像對應的一原始灰階影像及一mxm正方形臨界值矩陣,以及隱寫在該編碼後半色調影像中的一資料量;一半色調轉換模組,其根據該mxm正方形臨界值矩陣,將該原始灰階影像轉換成一半色調影像;及一解碼模組,其根據該資料量,比對該編碼後半色調影像中的該等已編碼單元與該半色調影像中相對應的該等半色調單元,並於比對該已編碼單元與所對應的該半色調單元中的墨點數相同時,判定該已編碼單元中隱寫 的該資料為一第一資料,且於比對該已編碼單元與所對應的該半色調單元中的墨點數不同時,判定該已編碼單元中隱寫的該資料為一第二資料。 Furthermore, the present invention utilizes a halftone data steganography decoding system for pixel black and white interchange modulation to read data steganized in a coded halftone image, and includes: a database, the record and the coded halftone An original grayscale image corresponding to the image and a mxm square critical value matrix, and a data amount steganized in the encoded halftone image; a halftone conversion module, which is based on the mxm square critical value matrix Converting the image into a halftone image; and a decoding module, based on the amount of data, comparing the coded cells in the encoded halftone image to the halftone cells corresponding to the halftone image, and Determining the steganography of the coded unit when the number of ink points in the coded unit and the corresponding halftone unit are the same The data is a first data, and when the number of ink points in the coded unit and the corresponding halftone unit is different, it is determined that the data steganized in the coded unit is a second data.
在本發明的一實施例中,該mxm正方形臨界值矩陣包含一由[m,0]、[0,m]兩個二維向量構成的一網幕向量以及mxm個臨界值。 In an embodiment of the invention, the mxm square threshold matrix comprises a screen vector consisting of two two-dimensional vectors [m, 0], [0, m] and mxm threshold values.
在本發明的一實施例中,該該等臨界值是由集中式抖色法或分散式抖色法產生。 In an embodiment of the invention, the threshold values are generated by a centralized dithering method or a decentralized dithering method.
在本發明的一實施例中,該第一資料是二進制的數字0,該第二資料是二進制的數字1 In an embodiment of the invention, the first data is a binary number 0, and the second data is a binary number 1
本發明的功效在於:本發明藉由不改變半色調單元中的墨點數目,將第一資料寫入半色調單元中,並藉由改變從半色調單中隨機選出的一像素的色調(黑白互換),將第二資料寫入半色調單元中,以在編碼過程中不致大幅地變動半色調影像中的墨點位置及數量。且藉由從半色調單元中隨機選出一像素並改變其色調,能讓改變色調的該些像素較平均地分佈在編碼後半色調影像中,而使編碼後半色調影像的品質不致受影響;並且藉由影像最佳化模組以一個半色調單元為單位,依循由上到下、由左到右的方式一一對編碼後半色調影像中的每一個半色調單元進行直接二位元搜尋,除了能將編碼後半色調影像最佳化,並可減少直接二位元搜尋執行的次 數,而提升影像處理的速度。 The effect of the present invention is that the present invention writes the first data into the halftone unit without changing the number of dots in the halftone unit, and changes the hue of a pixel randomly selected from the halftone sheet (black and white) Interchange), the second data is written into the halftone unit to not significantly change the position and number of ink dots in the halftone image during the encoding process. And by randomly selecting a pixel from the halftone unit and changing the color tone thereof, the pixels that change the color tone can be evenly distributed in the encoded halftone image, so that the quality of the encoded halftone image is not affected; The image optimization module performs a direct binary search for each halftone unit in a pair of coded halftone images from top to bottom and left to right in a halftone unit. Optimize the encoded halftone image and reduce the number of direct binary search executions Increase the speed of image processing.
1‧‧‧半色調轉換模組 1‧‧‧ halftone conversion module
2‧‧‧編碼模組 2‧‧‧Code Module
3‧‧‧待編碼影像 3‧‧‧Image to be encoded
3’‧‧‧已編碼影像 3’‧‧‧ Coded imagery
4‧‧‧影像最佳化模組 4‧‧‧Image Optimization Module
30‧‧‧灰階影像 30‧‧‧ Grayscale imagery
31‧‧‧半色調影像 31‧‧‧ halftone image
32‧‧‧編碼後影像 32‧‧‧Coded image
33‧‧‧最佳化編碼後影像 33‧‧‧Optimized coded imagery
40‧‧‧正方形臨界值矩陣 40‧‧‧square threshold matrix
51‧‧‧資料庫 51‧‧‧Database
52‧‧‧半色調轉換模組 52‧‧‧ halftone conversion module
53‧‧‧解碼模組 53‧‧‧Decoding module
301‧‧‧區塊 301‧‧‧ Block
311‧‧‧半色調單元 311‧‧‧ halftone unit
312‧‧‧已編碼單元 312‧‧‧Coded unit
本發明之其他的特徵及功效,將於參照圖式的實施方式中清楚地呈現,其中:圖1是習知一種半色調影像編碼方法藉由移動墨點形狀進行編碼的示意圖;圖2是習知一種直接二位元搜尋法的示意圖;圖3顯示本發明利用像素黑白互換調變的半色調資料隱寫編碼系統的一實施例的組成元件示意圖;圖4說明本實施例的半色調轉換模組將灰階影像轉換成半色調影像的做法;圖5說明本實施例的編碼模組將資料隱寫於半色調單元中;圖6說明一編碼後半色調影像經過本實施例的影像最佳化模組處理後成為一最佳化編碼後半色調影像;圖7說明本實施例的影像最佳化模組進行直接二位元搜尋時會先判斷墨點位於半色調單元的中間、角落或側邊;圖8顯示本發明利用像素黑白互換調變的半色調資料隱寫解碼系統的一實施例的組成元件示意圖;及圖9說明圖8中的資料庫記錄一原始灰階影像及一正方形臨界值矩陣,且解碼模組比對半色調影像與編碼後半色調影像中相對位置 的半色調單元而解碼得到隱寫在編碼後半色調影像中的資料。 Other features and effects of the present invention will be apparent from the following description of the drawings, wherein: FIG. 1 is a schematic diagram of a conventional halftone image encoding method for encoding by moving a dot shape; A schematic diagram of a direct binary search method is shown; FIG. 3 is a schematic diagram showing the components of an embodiment of the halftone data steganography system using pixel black and white interchange modulation; FIG. 4 illustrates the halftone conversion mode of the embodiment. The method of converting a grayscale image into a halftone image; FIG. 5 illustrates that the encoding module of the embodiment steganates data in a halftone unit; FIG. 6 illustrates that an encoded halftone image is optimized by the image of the embodiment. The module is processed to become an optimized coded halftone image; FIG. 7 illustrates that the image optimization module of the embodiment first determines that the ink dot is located in the middle, corner or side of the halftone unit when performing direct binary search. 8 is a schematic diagram showing the components of an embodiment of a halftone data steganography decoding system using pixel black and white interchange modulation; and FIG. 9 illustrates the database record of FIG. An original grayscale image and a square threshold matrix, and the decoding module compares the relative positions in the halftone image and the encoded halftone image The halftone unit is decoded to obtain data that is steganized in the encoded halftone image.
在本發明被詳細描述之前,應當注意在以下的說明內容中,類似的元件是以相同的編號來表示。 Before the present invention is described in detail, it should be noted that in the following description, similar elements are denoted by the same reference numerals.
參閱圖3,是本發明利用像素黑白互換調變的半色調資料隱寫編碼系統的一實施例,用以將一灰階影像轉換成一半色調影像,並將資料隱寫在該半色調影像中。該系統包括一半色調轉換模組1及一編碼模組2。其中灰階影像30是以一具有16X16個像素(pixel)的影像為例,其代表一待編碼影像3其中的一小部分。且半色調轉換模組1根據一正方形臨界值矩陣40,將灰階影像30轉換成一半色調影像31。 Referring to FIG. 3, an embodiment of a halftone data rewritable coding system using pixel black and white interchange modulation is used to convert a grayscale image into a halftone image and rewrit the data in the halftone image. . The system includes a halftone conversion module 1 and an encoding module 2. The grayscale image 30 is an example of an image having 16×16 pixels, which represents a small portion of a to-be-coded image 3. The halftone conversion module 1 converts the grayscale image 30 into a halftone image 31 according to a square threshold matrix 40.
半色調(Halftone)是印刷產業中常用來處理階調並模擬連續調(Continue tone)的方法。印表機上所列印的圖像,只能藉由著墨或不著墨兩種階調來表現層次,像這樣的兩值化影像則稱為半色調影像。因此,藉由調整印刷平面上墨點的排列方式,便可利用人眼「視覺積分」的原理,使得在一定的距離觀察下,半色調影像重現連續調影像的感覺。所以半色調技術就是將連續調影像轉換成半色調影像的技術。而半色調網幕法(又稱有序抖色法)是先將一連續調影像(灰階影像)分割成複數個與一臨界值矩陣尺寸相同大小的區塊,再將它們的灰階值與臨界值矩陣中相對位置的一臨界 值作比較,若相對位置的灰階值大於臨界值則輸出白點(不著墨),反之則輸出黑點(著墨),藉此,將連續調影像轉換成半色調影像。 Halftone is a method commonly used in the printing industry to process tone and simulate continuous tone. The images printed on the printer can only be represented by the two tones of ink or no ink. The binary image like this is called halftone image. Therefore, by adjusting the arrangement of the ink dots on the printing plane, the principle of "visual integration" of the human eye can be utilized, so that the halftone image reproduces the feeling of continuously adjusting the image under a certain distance observation. So halftone technology is a technique for converting continuously tuned images into halftone images. The halftone screen method (also known as ordered dithering method) first divides a continuous tone image (grayscale image) into a plurality of blocks of the same size as a threshold matrix, and then sets their grayscale values. a critical relationship with the relative position in the critical matrix The value is compared, if the gray level value of the relative position is greater than the critical value, the white point is output (no ink), and vice versa, the black point (inking) is output, thereby converting the continuous tone image into a halftone image.
而使用半色調網幕法時,所產生的半色調影像的網點排列方式與形狀,會受到臨界值矩陣內的臨界值排列順序影響。因此習知的臨界值矩陣依其型態主要可分為集中式抖色法(Clustered-Dot Ordered Dithering)與分散式抖色法(Dispersed-Dot Ordered Dithering)兩種,例如下列兩圖所示。 When the halftone screen method is used, the arrangement and shape of the dots of the generated halftone image are affected by the order of the critical values in the critical matrix. Therefore, the conventional threshold matrix can be mainly classified into two types: the Clustered-Dot Ordered Dithering method and the Dispersed-Dot Ordered Dithering method, as shown in the following two figures.
此外,使用半色調網幕法時,會影響臨界值矩陣的因素有兩種,第一種是矩陣內的臨界值排列順序,比如前面提到的「集中式抖色法」、「分散式抖色法」。第二種則是網幕向量(Screen Tile Vector),它決定臨界值矩陣的『形狀以及旋轉角』。網幕向量包含兩個二維向量n1、n2,並由該兩個二維向量n1、n2決定半色調影像中的每一個半色調單元(halftone cell)中的圖素數量(以下將進一步說明)。由於「臨界值矩陣」是應用於傳統半色調網幕法的一種習知技術,且非本案討論重點,故於此不加詳述,其相關技術可參見「Design of Color Screen Tile Vector Sets」以及 「Computer-aided design of clustered-dot color screens based on a human visual system model」等論文。 In addition, when using the halftone screen method, there are two factors that affect the threshold matrix. The first one is the order of the critical values in the matrix, such as the aforementioned "concentrated dithering method" and "distributed dithering". Color method." The second is the Screen Tile Vector, which determines the shape and rotation angle of the threshold matrix. The screen vector contains two two-dimensional vectors n 1 , n 2 , and the two two-dimensional vectors n 1 , n 2 determine the number of pixels in each halftone cell in the halftone image (below Will be further explained). Since the "threshold matrix" is a conventional technique applied to the traditional halftone screen method, and is not the focus of this discussion, it will not be described in detail here. For related technologies, see "Design of Color Screen Tile Vector Sets" and "Computer-aided design of clustered-dot color screens based on a human visual system model" and other papers.
因此,在本實施例中,如圖4所示,採用的正方形臨界值矩陣40是以一個4x4分散式臨界值矩陣為例,其包含由兩個二維向量[4,0]、[0,4]組成的一網幕向量以及由4x4個臨界值構成的一矩陣。當然,本實施例亦可採用集中式臨界值矩陣。 Therefore, in the present embodiment, as shown in FIG. 4, the square threshold matrix 40 employed is a 4x4 distributed threshold matrix, which is composed of two two-dimensional vectors [4, 0], [0, 4] A screen vector composed of a matrix consisting of 4x4 thresholds. Of course, this embodiment can also adopt a centralized threshold matrix.
因此,如圖4所示,半色調轉換模組1根據正方形臨界值矩陣40的大小,將灰階影像30以4x4個像素為一個單位,分割成16個區塊301,再由上到下,由左至右,將每一區塊301的4x4個像素的灰階值與臨界值矩陣40中相對位置的臨界值進行比對,若像素的灰階值大於臨界值則輸出1代表白色,否則輸出0代表黑色(墨點),藉此將灰階影像30轉換成只以黑白二色顯示的半色調影像31,使半色調影像31包含複數個半色調單元311,且每一個半色調單元311具有4x4個像素。 Therefore, as shown in FIG. 4, the halftone conversion module 1 divides the grayscale image 30 into 16 blocks 301 in units of 4×4 pixels according to the size of the square threshold matrix 40, and then from top to bottom. From left to right, the grayscale value of the 4x4 pixels of each block 301 is compared with the critical value of the relative position in the threshold matrix 40. If the grayscale value of the pixel is greater than the critical value, the output 1 represents white, otherwise The output 0 represents black (ink dot), whereby the grayscale image 30 is converted into a halftone image 31 displayed only in black and white, the halftone image 31 includes a plurality of halftone units 311, and each halftone unit 311 Has 4x4 pixels.
接著,將半色調影像31輸入編碼模組2,編碼模組2將半色調影像31的每一半色調單元311皆視為一可編碼單元,且每一可編碼單元皆能寫入一個位元的資料,因此,如圖5所示,設若編碼模組2要將二進制的四個位元資料0110隱寫在半色調影像31的連續四個半色調單元311時,其編碼規則如下。首先,編碼模組2判斷第一個位元是一第一資料,例如數字0時,則令圖5中要被載入 第一資料(即0)的第一個半色調單元311的墨點數維持不變,使第一個半色調單元311成為一隱含第一個位元資料(即0)的已編碼單元312。接著,編碼模組2判斷第二個位元是一第二資料,例如數字1時,則從要被載入第二資料(即1)的第二個半色調單元中311隨機選取一個像素(例如圖5中以粗框標示的像素),並判斷該像素是否為墨點,若是,則將該像素換成非墨點(白點),否則將該像素換成墨點,藉此將第二個位元資料(即1)隱寫在第二個半色調單元311,使半色調單元311成為一隱含該第二個位元的已編碼單元312。然後,編碼模組2依照上述編碼規則將第三個位元(1)及第四個位元(0)依序隱寫在第三及第四個半色調單元311中,而使半色調影像31成為如圖6所示的一編碼後半色調影像32。值得一提的是,上述第一資料亦可以是數字1,而第二資料則是數字0。 Then, the halftone image 31 is input to the encoding module 2, and the encoding module 2 treats each halftone unit 311 of the halftone image 31 as a codeable unit, and each of the codeable units can write one bit. Therefore, as shown in FIG. 5, if the encoding module 2 is to steble the binary four-bit data 0110 in the four consecutive halftone units 311 of the halftone image 31, the encoding rule is as follows. First, the encoding module 2 determines that the first bit is a first data, for example, the number 0, so that the figure 5 is to be loaded. The number of dots of the first halftone unit 311 of the first material (i.e., 0) remains unchanged, causing the first halftone unit 311 to become an encoded unit 312 that implies the first bit material (i.e., 0). . Next, the encoding module 2 determines that the second bit is a second data. For example, when the number 1 is 1, a pixel is randomly selected from the second halftone unit 311 to be loaded into the second data (ie, 1). For example, the pixel indicated by the thick frame in FIG. 5, and determine whether the pixel is an ink dot, and if so, the pixel is replaced with a non-ink point (white point), otherwise the pixel is replaced with an ink dot, thereby The two bit data (i.e., 1) is steganized in the second halftone unit 311, causing the halftone unit 311 to become an encoded unit 312 that implies the second bit. Then, the encoding module 2 sequentially dictates the third bit (1) and the fourth bit (0) in the third and fourth halftone units 311 according to the above encoding rule, thereby making the halftone image 31 becomes a coded halftone image 32 as shown in FIG. It is worth mentioning that the above first information can also be the number 1, and the second information is the number 0.
因此,由上述說明可知,半色調影像32中的每一個半色調單元311皆可寫入一位元的資料,因此一張半色調影像32(視其所包含的半色調單元數量)可以被隱寫大量的資料在其中。且本實施例藉由不改變半色調單元311中的墨點數目,將第一資料寫入半色調單元311中,並藉由改變從半色調單元311中隨機選出的一像素的色調,將第二資料寫入半色調單元311中,可以在編碼過程中儘量避免變動半色調影像31中的墨點位置及數量,尤其當寫入的第一資料多於第二資料時,因此在編碼過程中不會大幅地變動半色 調影像中的墨點位置。而且藉由從半色調單元311中隨機選出一像素並改變其色調,能讓改變色調的該些像素較平均地分佈在編碼後半色調影像32中,而使編碼後半色調影像32中即使有些像素被改變色調仍不致影響其影像品質。 Therefore, as can be seen from the above description, each halftone unit 311 in the halftone image 32 can write the data of one bit, so that one halftone image 32 (depending on the number of halftone units it contains) can be hidden. Write a lot of information in it. And the present embodiment writes the first material into the halftone unit 311 by changing the number of ink dots in the halftone unit 311, and by changing the color tone of a pixel randomly selected from the halftone unit 311, The second data is written into the halftone unit 311, and the position and the number of the ink dots in the halftone image 31 can be avoided as much as possible during the encoding process, especially when the first data written is more than the second data, so during the encoding process. Will not change the half color greatly Adjust the position of the ink dots in the image. Moreover, by randomly selecting a pixel from the halftone unit 311 and changing the color tone thereof, the pixels which change the color tone can be evenly distributed in the encoded halftone image 32, so that even some pixels in the encoded halftone image 32 are Changing the color tone does not affect its image quality.
再者,為了使編碼後半色調影像32具有更佳的影像品質,如圖6所示,本實施例還包含一影像最佳化模組4,其對編碼後半色調影像32中的該等半色調單元311(其中亦包含已編碼單元312)進行直接二位元搜尋(以下簡稱DBS),且本實施例的影像最佳化模組4一次只對一個半色調單元311進行DBS,例如圖7所示,直接二位元搜尋先判斷半色調單元311中的一個墨點是位在該半色調單元311的中間(如圖7中的7A所示)、角落(如圖7中的7B所示)或側邊(如圖7中的7C所示),並令該墨點只與其四周(如圖7中的7A、7B、7C中的虛線框所示)相鄰的其中一個非墨點(即白點)像素互換,再將互換像素後的半色調單元311與原始灰階影像中相對應的部分影像兩者經由一模擬人眼視覺的人眼視覺模型(Human visual system filter kernel)感知(即比較兩者的差異)而產生一感知誤差值,並且不斷地重覆上述步驟(即令該墨點分別與其四周相鄰的另一個非墨點(即白點)像素互換),且經由人眼視覺模型不斷產生感知誤差值,直到發現其中一種互換結果讓感知誤差值最小且不再變動,人眼視覺模型即判定半色調單元311與原始灰階影像中 相對應的部分影像的誤差已達到最小,亦即判定半色調單元311與原始灰階影像中相對應的部分影像最接近,並接受該互換結果。然後,再接著對半色調單元311中的下一個墨點重覆執行DBS,直到半色調單元311中的所有墨點皆完成DBS,才會再對下一個半色調單元311進行DBS,藉此產生一最佳化編碼後半色調影像33。而由於上述DBS為習知技術,且非本案重點,於此不加以詳述,其相關技術可參見「A Novel Barcode System for Intelligent Automation Industry」論文。 Moreover, in order to make the encoded halftone image 32 have better image quality, as shown in FIG. 6, the embodiment further includes an image optimization module 4 for the halftones in the encoded halftone image 32. The unit 311 (including the coded unit 312) performs a direct binary search (hereinafter referred to as DBS), and the image optimization module 4 of the embodiment performs DBS on only one halftone unit 311 at a time, for example, FIG. It is shown that the direct binary search first judges that one dot in the halftone unit 311 is located in the middle of the halftone unit 311 (as shown by 7A in FIG. 7) and a corner (as shown by 7B in FIG. 7). Or the side (as shown by 7C in Fig. 7), and let the ink dot be only one of the non-ink dots adjacent to its surroundings (shown by the dashed box in 7A, 7B, 7C in Fig. 7) (ie, White point) pixel interchange, and then the halftone unit 311 after the interchangeable pixel and the corresponding partial image in the original gray scale image are perceived by a human visual system filter kernel (ie, a human visual system filter kernel) (ie, Comparing the differences between the two) produces a perceptual error value and continually repeats the above steps (ie, The ink dots are respectively interchanged with another non-ink point (ie, white point) pixel adjacent to the periphery thereof, and the perceptual error value is continuously generated through the human eye vision model until one of the interchange results is found to minimize the perceptual error value and no longer change. The human visual model determines the halftone unit 311 and the original grayscale image. The error of the corresponding partial image has been minimized, that is, the halftone unit 311 is determined to be closest to the corresponding partial image in the original grayscale image, and the result of the interchange is accepted. Then, DBS is repeatedly executed on the next ink dot in the halftone unit 311 until all the ink dots in the halftone unit 311 complete the DBS, and then the DBS is performed on the next halftone unit 311, thereby generating An encoded halftone image 33 is optimized. Because the above DBS is a conventional technology, and is not the focus of this case, it will not be described in detail here. For related technologies, refer to the paper "A Novel Barcode System for Intelligent Automation Industry".
因此,由於本實施例的影像最佳化模組4所執行的直接二位元搜尋(DBS)只讓半色調單元311中的墨點在半色調單元311中變動其位置(SWAP),因此每一個半色調單元311中的墨點數量仍能保持不變,而得以保留其中所隱含的編碼資料。 Therefore, since the direct binary search (DBS) performed by the image optimization module 4 of the present embodiment causes only the ink dots in the halftone unit 311 to change its position (SWAP) in the halftone unit 311, each The number of dots in one halftone unit 311 can remain unchanged while retaining the encoded material implied therein.
此外,由於本實施例的影像最佳化模組4是依循由上到下、由左到右的方式一一對編碼後半色調影像32中的每一個半色調單元311進行直接二位元搜尋,因此影像最佳化模組4會對一個半色調單元311進行直接二位元搜尋,直到該半色調單元311與原始灰階影像中相對應的部分影像的誤差收斂至最小後,才會再對下一個半色調單元311進行直接二位元搜尋,藉此可減少直接二位元搜尋執行的次數而提升影像處理的速度。 In addition, since the image optimization module 4 of the present embodiment performs a direct binary search by using each of the halftone units 311 in the pair of coded halftone images 32 from top to bottom and left to right. Therefore, the image optimization module 4 performs a direct binary search on a halftone unit 311 until the error of the halftone unit 311 and the corresponding partial image in the original grayscale image converges to a minimum. The next halftone unit 311 performs a direct binary search, thereby reducing the number of direct binary search executions and increasing the speed of image processing.
所以,當一圖案或商標是以一編碼後半色調影像,例 如上述最佳化編碼後半色調影像33呈現時,為了讀取隱寫在最佳化半色調影像33中的資料以進行後續驗證或應用,如圖8所示,本發明利用像素黑白互換調變的半色調資料隱寫解碼系統的一實施例,用以取出隱寫在最佳化編碼後半色調影像33中的資料,且其主要包括一資料庫51、一半色調轉換模組52及一解碼模組53。其中如圖9所示,最佳化編碼後半色調影像33代表一已編碼影像3’其中的一部分影像。資料庫51主要記錄與已編碼影像3’(圖中以最佳化編碼後半色調影像33表示)對應的原始灰階影像3(圖中以部分灰階影像30表示),以及用以將灰階影像30轉換成半色調影像31的正方形臨界值矩陣40。 So, when a pattern or trademark is a coded halftone image, for example When the optimized half-coded halftone image 33 is presented as described above, in order to read the data steered in the optimized halftone image 33 for subsequent verification or application, as shown in FIG. 8, the present invention utilizes pixel black and white interchange modulation. An embodiment of the halftone data steganographic decoding system for extracting data steganized in the optimized encoded halftone image 33, and mainly comprising a database 51, a halftone conversion module 52 and a decoding module Group 53. As shown in Fig. 9, the optimized encoded halftone image 33 represents a portion of the image of an encoded image 3'. The database 51 mainly records the original grayscale image 3 (represented by the partial grayscale image 30 in the figure) corresponding to the encoded image 3' (indicated by the optimized encoded halftone image 33), and is used to set the grayscale The image 30 is converted into a square threshold matrix 40 of halftone images 31.
因此,如圖8與圖9所示,當解碼模組53收到最佳化編碼後半色調影像33時,其通知半色調轉換模組52,則半色調轉換模組52從資料庫51中取出與最佳化編碼後半色調影像33對應的原始灰階影像30,並如同前述半色調轉換模組1的做法,根據正方形臨界值矩陣40,將原始灰階影像30轉換成半色調影像31,並提供給解碼模組53。 Therefore, as shown in FIG. 8 and FIG. 9, when the decoding module 53 receives the optimized halftone image 33, it notifies the halftone conversion module 52, and the halftone conversion module 52 is taken out from the database 51. The original grayscale image 30 corresponding to the optimized coded halftone image 33, and the original grayscale image 30 is converted into the halftone image 31 according to the square threshold matrix 40, as in the foregoing halftone conversion module 1. Provided to the decoding module 53.
然後,如圖9所示,解碼模組53依序比對最佳化編碼後半色調影像33中的已編碼單元312與半色調影像31中位置相對應的半色調單元311的墨點數,例如圖9所示,第一個已編碼單元312中的墨點數和半色調影像31中相對應的半色調單元311中的墨點 數相同,則解碼模組53判定第一個已編碼單元312中隱寫的資料為第一資料(即0),接著解碼模組53比對第二個已編碼單元312中的墨點數和半色調影像31中相對應的半色調單元311中的墨點數,發現兩者墨點數不同,則判定第二個已編碼單元312中隱寫的資料為第二資料(即1),所以,根據上述解碼規則,解碼模組53可以判定第三個已編碼單元312中隱寫的資料為第二資料(即1),且第四個已編碼單元312中隱寫的資料為第一資料(即0),藉此,即可從最佳化編碼後半色調影像33中取出被隱寫的資料0110。 Then, as shown in FIG. 9, the decoding module 53 sequentially compares the number of ink dots of the halftone unit 311 corresponding to the position in the encoded unit 312 and the halftone image 31 in the encoded halftone image 33, for example, for example. 9, the number of ink dots in the first encoded unit 312 and the ink dots in the corresponding halftone unit 311 in the halftone image 31 are shown in FIG. If the number is the same, the decoding module 53 determines that the material steganized in the first encoded unit 312 is the first data (ie, 0), and then the decoding module 53 compares the number of ink points in the second encoded unit 312. If the number of ink dots in the corresponding halftone unit 311 in the halftone image 31 is different, it is determined that the data hidden in the second encoded unit 312 is the second data (ie, 1), so According to the above decoding rule, the decoding module 53 may determine that the data steganized in the third encoded unit 312 is the second data (ie, 1), and the data steganized in the fourth encoded unit 312 is the first data. (i.e., 0), whereby the steganized material 0110 can be taken out from the optimized encoded halftone image 33.
綜上所述,本發明藉由不改變半色調單元311中的墨點數目,將第一資料寫入半色調單元311中,並藉由改變從半色調單元311中隨機選出的一像素的色調(黑白互換),將第二資料寫入半色調單元311中,以在編碼過程中不致大幅地變動半色調影像31中的墨點位置及數量。且藉由從半色調單元311中隨機選出一像素並改變其色調,能讓改變色調的該些像素較平均地分佈在編碼後半色調影像32中,而使編碼後半色調影像32的品質不致受影響;並且藉由影像最佳化模組40以一個半色調單元311為單位,依循由上到下、由左到右的方式一一對編碼後半色調影像32中的每一個半色調單元311進行直接二位元搜尋,除了能將編碼後半色調影像32最佳化,並可減少直接二位元搜尋執行的次數,而提升影像處理的速度,確實達成本發明之功效與目的。 In summary, the present invention writes the first material into the halftone unit 311 by changing the number of ink dots in the halftone unit 311, and changes the color tone of a pixel randomly selected from the halftone unit 311. (Black-and-white interchange), the second material is written in the halftone unit 311 so as not to largely change the position and number of ink dots in the halftone image 31 during the encoding process. And by randomly selecting a pixel from the halftone unit 311 and changing the color tone thereof, the pixels which change the color tone can be evenly distributed in the encoded halftone image 32, so that the quality of the encoded halftone image 32 is not affected. And directly performing, by the image optimization module 40, a halftone unit 311 in a pair of coded halftone images 32 in a top-to-bottom, left-to-right manner in a unit of one halftone unit 311. The two-bit search, in addition to optimizing the encoded halftone image 32, and reducing the number of direct binary search executions, while increasing the speed of image processing, does achieve the efficacy and purpose of the present invention.
惟以上所述者,僅為本發明之實施例而已,當不能以此限定本發明實施之範圍,凡是依本發明申請專利範圍及專利說明書內容所作之簡單的等效變化與修飾,皆仍屬本發明專利涵蓋之範圍內。 However, the above is only the embodiment of the present invention, and the scope of the invention is not limited thereto, and all the equivalent equivalent changes and modifications according to the scope of the patent application and the patent specification of the present invention are still The scope of the invention is covered.
1‧‧‧半色調轉換模組 1‧‧‧ halftone conversion module
2‧‧‧編碼模組 2‧‧‧Code Module
4‧‧‧影像最佳化模組 4‧‧‧Image Optimization Module
Claims (9)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW104134064A TWI543588B (en) | 2015-10-16 | 2015-10-16 | Data-bearing encoding system and decoding system utilizing black and white pixel swap modulation |
US15/147,923 US9990686B2 (en) | 2015-10-16 | 2016-05-06 | Method for generating a data-bearing halftone image, and method for decoding the data-bearing halftone image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW104134064A TWI543588B (en) | 2015-10-16 | 2015-10-16 | Data-bearing encoding system and decoding system utilizing black and white pixel swap modulation |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI543588B true TWI543588B (en) | 2016-07-21 |
TW201715887A TW201715887A (en) | 2017-05-01 |
Family
ID=56997242
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW104134064A TWI543588B (en) | 2015-10-16 | 2015-10-16 | Data-bearing encoding system and decoding system utilizing black and white pixel swap modulation |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI543588B (en) |
-
2015
- 2015-10-16 TW TW104134064A patent/TWI543588B/en not_active IP Right Cessation
Also Published As
Publication number | Publication date |
---|---|
TW201715887A (en) | 2017-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5952178B2 (en) | Four-dimensional (4D) color barcode for encoding and decoding large data | |
TWI514840B (en) | Halftone data-bearing encoding system and halftone data-bearing decoding system | |
CN109102451A (en) | A kind of anti-fake halftoning intelligent digital watermarking method of paper media's output | |
CN101090447A (en) | Image forming apparatus and image forming method | |
JP4631650B2 (en) | High quality halftone processing | |
JP2010023291A (en) | Image processing apparatus and its method | |
JP2003101761A (en) | Image processing apparatus and image processing method | |
JP2008017051A (en) | Image processor, image processing method, and program | |
CN109561232A (en) | Method and system for AM screening and protection printed article | |
JP2003134339A (en) | Image forming apparatus | |
JP2007049443A (en) | Generation of dither matrix | |
CN103581497B (en) | Image processing equipment and image processing method | |
TWI543588B (en) | Data-bearing encoding system and decoding system utilizing black and white pixel swap modulation | |
US10565465B2 (en) | Image processing apparatus that identifies character pixel in target image using first and second candidate character pixels | |
US6002493A (en) | Method for reproducing an image | |
JP4038956B2 (en) | Image generation system and image generation method | |
TWI530914B (en) | Data-bearing encoding system and decoding system utilizing halftone cell dot number modulation | |
JP6256747B2 (en) | Image conversion processing method, program for executing the same, and image conversion processing apparatus | |
JP3684181B2 (en) | Image processing apparatus and image processing method | |
JP3787511B2 (en) | Image processing apparatus and image processing method | |
JP2004350182A (en) | Data processing apparatus, data file, data processing method, and program | |
JPH07242027A (en) | Printer | |
JP5115203B2 (en) | Image processing apparatus, encoding method, and decoding method | |
KR100490244B1 (en) | Error diffusion method using variable threshold value in image processing system | |
JP3684178B2 (en) | Image processing apparatus and image processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |