[go: up one dir, main page]

TW201333873A - Digital image authentication method - Google Patents

Digital image authentication method Download PDF

Info

Publication number
TW201333873A
TW201333873A TW101104631A TW101104631A TW201333873A TW 201333873 A TW201333873 A TW 201333873A TW 101104631 A TW101104631 A TW 101104631A TW 101104631 A TW101104631 A TW 101104631A TW 201333873 A TW201333873 A TW 201333873A
Authority
TW
Taiwan
Prior art keywords
pixel
modified
parity check
check code
bit
Prior art date
Application number
TW101104631A
Other languages
Chinese (zh)
Inventor
zhen-cheng Zhang
Qi-Xiang Zhan
Original Assignee
Univ Feng Chia
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 Univ Feng Chia filed Critical Univ Feng Chia
Priority to TW101104631A priority Critical patent/TW201333873A/en
Publication of TW201333873A publication Critical patent/TW201333873A/en

Links

Landscapes

  • Editing Of Facsimile Originals (AREA)

Abstract

The present invention provides a digital image authentication method, which includes the steps of: performing a column inversion arrangement to plural significant bits of plural pixels; generating parity check bits for each pixel based on a Hamming code; calculating corresponding position for each pixel based on a Torus automorphism; performing a bit rotation to the parity check bits; hiding the parity check bits into the corresponding position of each pixel; determining whether the parity check bits of each modified pixel are modified or not; determining at least one modified pixel; and predicting the modified pixel based on the parity check bits. With the digital image authentication method disclosed by the present invention, it is able to detect and effectively recover the modified complex area.

Description

數位影像認證方法Digital image authentication method

本發明係一種數位影像認證方法,尤指一種可以偵測及有效地回復被修改之複雜區域的數位影像認證方法。The invention relates to a digital image authentication method, in particular to a digital image authentication method capable of detecting and effectively replying to a modified complex area.

由於數位化的發展,數位影像變的易於修改,任何人可以經由影像處理軟體,對數位影像進行修改。因此數位影像的安全機制與智慧財產權的需求,變的越來越迫切。在所發展的技術中,有一類技術稱為影像的認證(Image Authentication)技術,此類技術的目的是用來確保數位影像內容的完整性。由於其目的在保證完整性,因此必須要有能力偵測數位影像是否被竄改。更甚者,能將被修改的區域定位出來,並且進一步將其還原成未被修改的狀態。Due to the development of digitalization, digital images have become easy to modify, and anyone can modify digital images through image processing software. Therefore, the security mechanism of digital images and the demand for intellectual property rights have become more and more urgent. One of the techniques developed in the art is called Image Authentication, which is designed to ensure the integrity of digital image content. Since the purpose is to ensure integrity, it must be capable of detecting whether the digital image has been tampered with. What is more, the modified area can be located and further restored to an unmodified state.

影像的認證(Image Authentication)技術可以分兩大類的方法來實踐:(1)數位簽章方式(Digital Signature Approach)之影像認證技術和(2)浮水印方式(Watermark-based Approach)之影像認證技術。Image Authentication technology can be practiced in two broad categories: (1) Digital Signature Approach image authentication technology and (2) Watermark-based Approach image authentication technology. .

數位簽章方式(Digital Signature Approach)之影像認證技術,其基本精神是將數位影像的特徵訊息萃取出來,在精簡化特徵訊息後,將精簡化過後的特徵訊息獨立保存,做為認證資料(Authentication Data)。當需要確認數位影像是否有被修改時,驗證者必需提供認證資料,才能對數位影像進行認證。Ahmed等人於2010年便是提出此類影像認證技術,其方法先利用秘密金鑰來對像素取餘數(Modulu),以此當作影像特徵。而後,再把影像特徵經由雜湊運算(Hash Function)來得到雜湊值。最後,將雜湊值經由量化運算,來得到影像的認證資料。當需要對數位影像進行偵測時,可以經由認證資料,來對數位影像修改的部分進行定位的動作。由於認證資料是獨立於數位影像之外,任何對數位影像的修改行為,並不會修改到認證資料。然而,這類技術的缺點,是擁有者必須小心的保存認證資料,以備將來認證時使用。The digital signature technology of the Digital Signature Approach is based on extracting the feature information of the digital image. After simplifying the feature message, the simplified feature information is saved separately as the authentication data (Authentication). Data). When it is necessary to confirm whether the digital image has been modified, the verifier must provide the authentication data in order to authenticate the digital image. Ahmed et al. proposed this type of image authentication technology in 2010. The method first uses the secret key to take the remainder of the pixel (Modulu) as an image feature. Then, the image features are hashed to obtain the hash value. Finally, the hash value is quantified to obtain the image authentication data. When it is required to detect a digital image, the authentication data can be used to locate the modified portion of the digital image. Since the authentication data is independent of the digital image, any modification of the digital image will not be modified to the authentication data. However, the downside of this type of technology is that the owner must carefully save the certification data for future certification.

另外一方面,浮水印方式(Watermark-based Approach)之影像認證技術,在將數位影像的特徵訊息萃取出並簡化後,會被藏回到原來的數位影像中,以產生已藏入認證碼之數位影像(Watermarked Image)。而為了達到認證的目的,認證資料必須能從已被修改的數位影像中擷取出來,並且由取出的認證資料,來偵測影像是否被修改過。此類技術依其恢復修改之區域的能力,可以細分為兩類。第一類的技術只有能力從所擷取的認證資料,來進行修改區域的定位動作。舉例來說,Patra等人於2010年提出運用中國餘數定理(Chinese Remainder Theorem(CRT))於經過離散餘弦轉換(Discrete Cosine Transform(DCT))的區塊之係數上,以產生認證資料。而所產生的認證資料,會被藏回到數位影像區塊中。依據實驗結果,Patra等人的方法在藏入認證資料後,並不會對影響產生過大的傷害。此外,已藏認證資料的影像,在經過一些標準影像處理技術(如JPEG壓縮)處理後,並不會誤判此類動作為惡意修改。然而,此類技術所能藏的認證資料的資料量非常有限,其原因在於所要藏入資料的空間,要能經過標準影像處理技術處理過後,仍然能確保所藏的資料不被修改,而這些空間在影像中,本來就非常有限。也因此這類技術只能偵測與定位出被修改的範圍,其所能藏入認證碼的空間,已無法多到可以將回復資料一起藏入,所以這類的的技術,無法將被修改的區域恢復回來。On the other hand, the watermark-based approach image authentication technology, after extracting and simplifying the feature information of the digital image, is hidden back into the original digital image to generate the authentication code. Watermarked Image. For the purpose of authentication, the authentication data must be extracted from the digital image that has been modified, and the authentication data is taken out to detect whether the image has been modified. Such technologies can be broken down into two categories based on their ability to recover modified areas. The first type of technology only has the ability to perform the positioning action of the modified area from the obtained authentication data. For example, in 2010, Patra et al. proposed using Chinese Remainder Theorem (CRT) on the coefficients of a Discrete Cosine Transform (DCT) block to generate authentication data. The generated authentication data will be hidden back into the digital image block. According to the experimental results, the method of Patra et al. does not cause excessive damage to the impact after the identification information is hidden. In addition, images of certified data will not be misidentified as malicious modifications after being processed by some standard image processing techniques (such as JPEG compression). However, the amount of information that can be possessed by such technologies is very limited. The reason is that the space in which the data is to be hidden must be processed by standard image processing technology to ensure that the data stored is not modified. Space in the image is inherently very limited. Therefore, this kind of technology can only detect and locate the modified range, and the space in which the authentication code can be hidden is too much to hide the reply data together, so this kind of technology cannot be modified. The area is back to recovery.

為了要能夠將被修改的區域恢復回來,第二類技術被提出。此類的技術大部分是運用影像壓縮的部分技術,來產生認證資料,並藏入數位影像中。當數位影像被修改時,便能夠從認證資料中,取出區域的影像壓縮碼,並將被修改的區域恢復回來。In order to be able to recover the modified area back, a second type of technology was proposed. Most of these technologies use some of the techniques of image compression to generate authentication data and hide it in digital images. When the digital image is modified, the image compression code of the area can be taken out from the authentication data, and the modified area is restored.

此類的技術如下:Yang和Shen的方法於2010年提出先對要做認證的數位影像,進行向量編碼法(Vector Quantization(VQ))的影像壓縮技術來產生影像索引表(Index Table)。此影像索引表(Index Table)被當成將來用來回復數位影像的資訊,而此回復資訊會被當成認證資料,藏回到數位影像中。這種運用影像壓縮技術來產生認證碼,並利用認證碼來恢復被修改的區域,其將來所能恢復的被修改區域的精細度,會受限於所使用的影像壓縮法。以Yang和Shen的方法為例,由於其方法使用向量編碼法,對數位影像進行壓縮並產生認證碼。因此當要恢復被修改的區域時,其回復的精細度為44個像素,因為向量編碼法是以44個像素為一個區塊單位,進行向量編碼。相同的,Lee和Lin在2008年所提的方法是以22個像素區塊為一編碼單位,其方法首先求區塊的像素之平均值,並保留此平均值轉成二進位碼後的前五個最重要位元,與其他區塊的像素之平均值的前五個最重要位元,結合在一起產生認證資料,藏回到區塊中。顯而易見的,當要恢復被修改的區域時,Lee和Lin的方法回復的精細度為22個像素。The technology of this kind is as follows: Yang and Shen's method proposed in 2010 to first perform digital image compression (Vector Quantization (VQ)) image compression technology to generate an image index table (Index Table). The Index Table is used as information to be used to restore digital images in the future, and this reply information will be used as authentication data and hidden back into the digital image. This uses image compression techniques to generate the authentication code and uses the authentication code to recover the modified region. The fineness of the modified region that can be recovered in the future is limited by the image compression method used. Taking the method of Yang and Shen as an example, since the method uses vector coding, the digital image is compressed and an authentication code is generated. Therefore, when the modified region is to be restored, the granularity of the reply is 44 pixels, because the vector coding method performs vector coding by using 44 pixels as a block unit. In the same way, the method proposed by Lee and Lin in 2008 is to use 22 pixel blocks as a coding unit. The method firstly finds the average of the pixels of the block, and retains the average value before converting to the binary code. The five most important bits, combined with the first five most significant bits of the average of the pixels of other blocks, produce authentication data that is hidden back into the block. Obviously, Lee and Lin's method response has a fineness of 22 pixels when the modified region is to be restored.

是以,要如何解決上述習用之問題與缺失,即為本發明之發明人與從事此行業之相關廠商所亟欲研究改善之方向所在者。Therefore, how to solve the above problems and deficiencies in the above-mentioned applications, that is, the inventors of the present invention and those involved in the industry are eager to study the direction of improvement.

故,本發明之發明人有鑑於上述缺失,乃搜集相關資料,經由多方評估及考量,並以從事於此行業累積之多年經驗,經由不斷試作及修改,始設計出此種數位影像認證方法發明專利者。Therefore, in view of the above-mentioned deficiencies, the inventors of the present invention have collected relevant materials, evaluated and considered them through multiple parties, and have been designing such digital image authentication methods through continuous trial and modification through years of experience in the industry. Patent holder.

本發明之主要目的在於提供一種可以偵測及有效地回復被修改之複雜區域的數位影像認證方法。The main object of the present invention is to provide a digital image authentication method that can detect and effectively reply to a modified complex area.

為了達到上述之目的,本發明一種數位影像認證方法,包括下列步驟:In order to achieve the above object, a digital image authentication method of the present invention comprises the following steps:

(110)提供一數位影像,該數位影像具有複數像素;(110) providing a digital image having a plurality of pixels;

(120)對該各像素之複數重要位元進行反轉排列;(120) performing reverse alignment on the plurality of significant bits of each pixel;

(130)基於一漢明編碼法對該各像素產生一同位元檢查碼;(130) generating a parity check code for each pixel based on a Hamming coding method;

(140)基於一環狀對稱式演算法計算該各像素之相對應位置;(140) calculating a corresponding position of each pixel based on a circular symmetric algorithm;

(150)對該各像素之該同位元檢查碼執行位元旋轉;(150) performing bit rotation on the parity check code of each pixel;

(160)將該各像素之該同位元檢查碼藏入該各像素之相對應位置;(160) hiding the parity check code of each pixel into a corresponding position of each pixel;

(170)判斷該各修改像素之該同位元檢查碼是否被修改;(170) determining whether the parity check code of each modified pixel is modified;

(180)判斷出至少一修改像素;以及(180) determining at least one modified pixel;

(190)基於該同位元檢查碼預測該修改像素。(190) predicting the modified pixel based on the parity check code.

在一較佳實施例中,該基於一漢明編碼法對該各像素產生一同位元檢查碼,係對該各像素中四個位元,產生三個位元的同位元檢查碼。In a preferred embodiment, the one-bit check code is generated for each pixel based on a Hamming coding method, and a three-bit parity check code is generated for four bits in each pixel.

在一較佳實施例中,將該各像素之該同位元檢查碼藏入該各像素之相對應位置,更包括將一指示位元藏入該各像素之相對應位置。In a preferred embodiment, the parity check code of each pixel is hidden in a corresponding position of each pixel, and further includes hiding an indicator bit in a corresponding position of each pixel.

在一較佳實施例中,該位元旋轉更包括新的同位元檢查碼的位元位置J'、原來同位元檢查碼的位元位置J、隨機產生的第i個數字Ri以及要旋轉的總位元個數M、其旋轉方式為J'=(J+R i )mod MIn a preferred embodiment, the bit rotation further includes a bit position J' of the new parity check code, a bit position J of the original parity check code, a randomly generated i-th number R i, and a rotation The total number of bits M is rotated by J '=( J + R i )mod M .

在一較佳實施例中,該基於該同位元檢查碼預測該被修改像素,更包括下列步驟:In a preferred embodiment, the predicting the modified pixel based on the parity check code further includes the following steps:

(191)產生一矩陣用以計算該修改像素周圍未被修改像素之數量;(191) generating a matrix for calculating the number of unmodified pixels around the modified pixel;

(192)還原該修改像素周圍未被修改像素之數量最大者;(192) restoring the largest number of unmodified pixels around the modified pixel;

(193)判斷是否具有該修改像素;以及(193) determining whether the modified pixel is present;

(194)若具有該修改像素,重複執行該步驟(191)。(194) If the modified pixel is present, the step (191) is repeatedly performed.

在一較佳實施例中,該矩陣大小與該數位影像相同。In a preferred embodiment, the matrix size is the same as the digital image.

藉此,本發明係提出基於一漢明編碼法(Hamming Code)來做數位影像的認證與回復被修改之複雜區域。首先,本發明先對該各像素之複數重要位元進行反轉排列,再基於該漢明編碼法對該各像素產生一同位元檢查碼(Parity Check Bits),而為了安全起見,該同位元檢查碼將經過位元旋轉技術(Bit rotation technique)處理,以產生旋轉過的該同位元檢查碼,該旋轉過之該同位元檢查碼會藏入環狀對稱式演算法(Torus automorphism)所計算的相對應位置,由於該同位元檢查碼是運用該漢明編碼法從單一像素產生,因此,相較於先前技術,在恢復被修改像素時,其恢復的精細度為1個像素。也由於該漢明編碼法所具有的特殊特性,當認證過的數位影像在網路上傳輸,產生的突發性位元錯誤(Burst Bit Errors)時,可以利用漢明編碼法的特性恢復回來。Accordingly, the present invention proposes a complex region in which authentication and response of digital images are modified based on a Hamming Code. First, the present invention first reversely arranges the complex important bits of each pixel, and then generates a parity check bit (Parity Check Bits) for each pixel based on the Hamming coding method, and for the sake of security, the parity The meta-check code will be processed by a Bit rotation technique to generate the rotated parity check code, which is hidden in the Torus automorphism algorithm. The corresponding position of the calculation, since the parity check code is generated from a single pixel by using the Hamming coding method, the restored fineness is 1 pixel when the modified pixel is restored compared to the prior art. Also, due to the special characteristics of the Hamming coding method, when the authenticated digital image is transmitted over the network and the Burst Bit Errors are generated, the characteristics of the Hamming coding method can be recovered.

而當需要復原被修改像素時,只要基於該同位元檢查碼即可以預測該被修改像素,經實驗結果可以知道,本發明可以產生高品質的已認證影像,同時對於被修改的區域,具有很高的復原能力。When it is necessary to restore the modified pixel, the modified pixel can be predicted based on the parity check code. According to the experimental results, the present invention can generate a high-quality authenticated image, and has a very high High resilience.

為達成上述目的及功效,本發明所採用之技術手段及構造,茲繪圖就本發明較佳實施例詳加說明其特徵與功能如下,俾利完全了解。In order to achieve the above objects and effects, the technical means and the structure of the present invention will be described in detail with reference to the preferred embodiments of the present invention.

請參閱第一圖所示,係為本發明較佳實施例之流程圖,由圖中可清楚看出,本發明數位影像認證方法包括下列步驟:Referring to the first embodiment, which is a flowchart of a preferred embodiment of the present invention, it can be clearly seen from the figure that the digital image authentication method of the present invention comprises the following steps:

(110)提供一數位影像,該數位影像具有複數像素;(110) providing a digital image having a plurality of pixels;

(120)對該各像素之複數重要位元進行反轉排列;(120) performing reverse alignment on the plurality of significant bits of each pixel;

(130)基於一漢明編碼法對該各像素產生一同位元檢查碼;(130) generating a parity check code for each pixel based on a Hamming coding method;

(140)基於一環狀對稱式演算法計算該各像素之相對應位置;(140) calculating a corresponding position of each pixel based on a circular symmetric algorithm;

(150)對該各像素之該同位元檢查碼執行位元旋轉;(150) performing bit rotation on the parity check code of each pixel;

(160)將該各像素之該同位元檢查碼藏入該各像素之相對應位置;(160) hiding the parity check code of each pixel into a corresponding position of each pixel;

(170)判斷該各修改像素之該同位元檢查碼是否被修改;(170) determining whether the parity check code of each modified pixel is modified;

(180)判斷出至少一修改像素;以及(180) determining at least one modified pixel;

(190)基於該同位元檢查碼預測該修改像素(190) predicting the modified pixel based on the parity check code

於該步驟(110)中,該像素(pixel)為組成數位影像1的最小單位,所屬技術領域中具有通常知識者應可以輕易理解,於本實施例中,該像素設置為8位元(bits),若為24位元或是32位元也為可行的方案。In this step (110), the pixel is the smallest unit constituting the digital image 1. It should be easily understood by those having ordinary knowledge in the art. In this embodiment, the pixel is set to 8 bits (bits). ), if it is 24-bit or 32-bit, it is also a feasible solution.

於該步驟(120)以及(130)中,該基於一漢明編碼法對該各像素產生一同位元檢查碼,係對該各像素中四個位元,產生三個位元的同位元檢查碼。In the steps (120) and (130), the one-bit check code is generated for each pixel based on a Hamming coding method, and the three-bit parity check is generated for four bits in each pixel. code.

本發明係使用漢明編碼法來達到影像認證的目的。在說明本發明之前,本發明先說明漢明編碼法。漢明編碼法是一種編碼方式,接收端可以依據所收到的編碼本身,來更正在其中可能產生的錯誤。而為了能具有更正能力,漢明編碼法必須藉由原始資料來產生額外的資料,並且將額外資料附在原始資料後面。漢明編碼法的基本概念為“同位元檢查”(Parity check),即漢明編碼法會利用額外資料來對原始資料做認證的動作。其所附加的額外資料量之多寡是依據漢明編碼不等式(Hamming inequality rule)來決定的。在此本發明不對此不等式的原理做詳述,所屬技術領域具有通常知識者應可以輕易理解。根據此不等式可知,四個位元的原始資料需要三個位元的額外資料,所以編碼後資料總共變成七個位元,此即所謂的“(7,4)漢明碼”。The invention uses the Hamming coding method to achieve the purpose of image authentication. Before explaining the present invention, the present invention first describes the Hamming coding method. The Hamming coding method is an encoding method, and the receiving end can correct the error that may be generated according to the received encoding itself. In order to be able to correct the Hamming code, the original data must be used to generate additional data, and additional information is attached to the original data. The basic concept of the Hamming coding method is "Parity check", which means that the Hamming coding method uses additional data to authenticate the original data. The amount of additional data attached is determined by the Hamming inequality rule. The present invention does not describe the principle of this inequality here, and those skilled in the art should be able to easily understand it. According to this inequality, the original data of four bits requires three bits of additional data, so the encoded data becomes seven bits in total, which is called "(7,4) Hamming code".

現在介紹如何使用“(7,4)漢明碼”來產生同位元檢查碼。請同時參閱第三圖所示。令有四個位元的原始資料(D 1,D 2,D 3,D 4),而另三個位元(P 1,P 2,P 3)為同位元檢查碼,每一個圓會包住有關連的原始資料以及認證資料,而這些有關連的資料的位元值,其值為“1”的個數總數必須為偶數。為了滿足上述的條件,對於任四個位元的原始資料,其檢查資料位元可以被唯一決定。也就是可以計算出同位元檢查碼的值,來使每個圓內的位元值為“1”的個數為偶數。舉例來說,同位元檢查碼位元P 1和原始資料位元D 1D 2以及D 4有關。D 1D 2以及D 4的值若分別為1、0與1,為了使圓內位元值為“1”的個數總數為偶數,所以同位元檢查碼位元P 1必需為0,如此才能滿足要求。其他如位元P 1P 2也是利用相同的判斷方式來決定其值,如此就可以產生三個位元的同位元檢查碼。Now I will show you how to use the "(7,4) Hamming code" to generate the parity check code. Please also refer to the third figure. Let there be four bits of raw data ( D 1 , D 2 , D 3 , D 4 ), and the other three bits ( P 1 , P 2 , P 3 ) are parity check codes, and each round will be wrapped. The original data of the relevant company and the certification data, and the number of bits of the related information, the total number of the values of "1" must be an even number. In order to satisfy the above conditions, the inspection data bits can be uniquely determined for the original data of any four bits. That is, the value of the parity check code can be calculated such that the number of bit values in each circle is "1" and the number is even. For example, the parity check code bit P 1 is associated with the original data bits D 1 , D 2 , and D 4 . If the values of D 1 , D 2 , and D 4 are 1, 0, and 1, respectively, the parity check bit P 1 must be 0 in order to make the total number of bits in the circle having a value of "1" an even number. This is enough to meet the requirements. Others, such as bits P 1 and P 2 , also use the same decision mode to determine their values, so that a three-bit parity check code can be generated.

然而在本發明的方法中,三個位元認證資料並不是直接從像素的最重要的四個位元而來。最重要的四個位元,也就是該重要位元必需經過反轉排列,而後才產生三個位元的認證資料,請同時參閱第二圖所示。位元必需反轉排列的原因,在於位元經過反轉排列後,我們可以根據三個位元檢查碼的值,來知道原來像素中最重要位元的位元值。其原理可以由第三圖來說明,請同時參閱第三圖所示,由於每個圓內的位元值為“1”的個數為偶數,所以當任兩組資料位元要具有相同的同位元檢查碼時,此兩組資料位元的D 1D 2D 3的值,必需完全不一樣,但D 4的值卻必須相同,如此才能具有相同的同位元檢查碼。以第三圖的例子來說,兩種資料位元(1011)2與(0101)2,會產生相同的同位元檢查碼(010)2。可以觀察到同位元D 4的值皆為1。更精確的來說,無論資料位元如何的不同,當他們具有相同的同位元檢查碼時,他們的資料位元D 4的值一定會一樣,同時皆為1或者皆為0。所以我們只要將最重要位元放置到D 4位置,就可以根據同位元檢查碼的值,來知道像素的最重要位元(也就是D 4)的值。如此可以做更準確的像素值的預測,所以在本發明的方法中,直接將最重要的四個位元,進行反轉排列,如此就可以將最重要的位元放到D 4位置,以反轉排列過的資料位元來產生同位元檢查碼。In the method of the present invention, however, the three bit authentication material does not come directly from the most significant four bits of the pixel. The most important four bits, that is, the important bits must be reversed, and then three bits of authentication data are generated. Please also refer to the second figure. The reason why the bit must be reversed is that after the bit is inverted, we can know the value of the most significant bit in the original pixel based on the value of the three bit check code. The principle can be explained by the third figure. Please also refer to the third figure. Since the number of bit values in each circle is even, the two sets of data bits should have the same When the parity check code, the values of D 1 , D 2 and D 3 of the two sets of data bits must be completely different, but the values of D 4 must be the same, so that they can have the same parity check code. In the example of the third figure, the two data bits (1011) 2 and (0101) 2 will produce the same parity check code (010) 2 . It can be observed that the value of the same bit D 4 is 1. More precisely, regardless of how the data bits are different, when they have the same parity check code, their data bits D 4 must be the same, both at 1 or both. So as long as we place the most significant bit in the D 4 position, we can know the value of the most significant bit of the pixel (that is, D 4 ) based on the value of the parity check code. In this way, more accurate prediction of pixel values can be made, so in the method of the present invention, the most important four bits are directly inverted, so that the most important bits can be placed at the D 4 position. The aligned data bits are inverted to generate a parity check code.

在產生同位元檢查碼後,將所產生的同位元檢查資料藏回“原來”像素中的三個比較不重要的位元。此動作看似非常合理,然而本發明的目的,並不只是要更正一個位元的錯誤而已,本發明還要做整個區域的修改偵測及復原。如果直接將同位元檢查碼藏回“原來”的像素中,一旦該像素處於遭修改的區域內,則該像素的重要位元資料以及同位元檢查碼會同時毀壞。After generating the parity check code, the generated parity check data is hidden back into three less important bits in the "original" pixel. This action seems to be very reasonable, but the purpose of the present invention is not only to correct a bit error, but also to modify and recover the entire area. If the parity check code is directly hidden back into the "original" pixel, once the pixel is in the modified area, the important bit data of the pixel and the parity check code are simultaneously destroyed.

於該步驟(140)中,為了解決這個問題,請同時參閱第四圖所示,本發明將像素A所產生的同位元檢查碼藏到另一個像素B中比較不重要的位元,對於任何一個像素A,我們如何決定哪一個像素代表像素B是非常重要的。因為當我們要做認證時,必須將認證資料擷取出來,如果當初像素B是任意找的,則在擷取時會無法找到像素B,當然也無法將認證資料擷取出來。因此,我們必須為任何一個像素A,找到其所對應的像素B,而且任兩個像素,亦不能找相同的像素來藏資料。環狀對稱式演算法(Torus automorphism)即具有此功能,此演算法於一九九六年被提出,用於打亂二維空間內的數值,公式如下:In this step (140), in order to solve this problem, please refer to the fourth figure at the same time, the present invention hides the parity check code generated by the pixel A to the less important bit in the other pixel B, for any One pixel A, how we decide which pixel represents pixel B is very important. Because when we want to do authentication, we must extract the authentication data. If the pixel B was originally found, the pixel B could not be found when the data was retrieved. Of course, the authentication data could not be extracted. Therefore, we must find the corresponding pixel B for any one pixel A, and any two pixels, and can not find the same pixel to store data. Torus automorphism has this function. This algorithm was proposed in 1996 to disrupt the values in two-dimensional space. The formula is as follows:

其中x i y i 表示數位影像的第i個像素,他的位置位於第x i 行第y i 列。另外一方面x i '和y i '表示第i個像素其所對應新的位置,其位置位於第x i '行第y i '列。數位影像的長跟寬的像素個數皆為N,而k值可以當作是一把鑰匙,依據這把鑰匙,每一個像素可以從它現在的位置座標,計算出的新位置座標。Wherein x i and y i represent the i-th bit image pixels, located on his row y i x i columns. Further aspect of the x i 'and y i' represents the i-th pixel corresponding to its new position, which is located on a position x i 'row y i' column. The number of pixels in the length and width of the digital image is N , and the value of k can be regarded as a key. According to this key, each pixel can be calculated from its current position coordinates to calculate the coordinates of the new position.

舉例來說,請同時參閱第四圖所示,假設N的值是9,k的值是3,像素A的值是176,其所在位置為(1,1),將值176以二進位表示時,最重要的4個位元為(1011)2,在經過重排後產生(1101)2,由這4個位元可以產生同位元檢查資料為(100)2,依據環狀對稱式演算法,從舊位置座標可以算出其新座標為(2,7),即第四圖上所顯示像素B的位置,於是我們可以將同位元檢查資料藏到像素B。原來像素B的值是47,以二進位表示則為(00101111)2。我們利用像素A所產生的同位元檢查碼來取代像素B中最不重要的三個位元,因此像素B的值會變成(00101100)2。當然,像素A中最不重要的三個位元,也會被拿來藏別的像素的同位元檢查資料。以第四圖為例子,像素C會將其同位元檢查資料藏入像素A中。For example, please refer to the fourth figure at the same time, assuming that the value of N is 9, the value of k is 3, the value of pixel A is 176, its position is (1, 1), and the value 176 is represented by binary. When the most important 4 bits are (1011) 2 , after the rearrangement, (1101) 2 is generated. From these 4 bits, the parity check data can be generated as (100) 2 , according to the circular symmetric calculus. From the old position coordinates, the new coordinates can be calculated as (2, 7), that is, the position of the pixel B displayed on the fourth picture, so we can hide the parity check data to the pixel B. The value of the original pixel B is 47, and the binary representation is (00101111) 2 . We replace the least significant three bits in pixel B with the parity check code generated by pixel A, so the value of pixel B becomes (00101 100 ) 2 . Of course, the least significant three bits in pixel A will also be used to check the parity of the hidden pixels. Taking the fourth figure as an example, pixel C will hide its parity check data in pixel A.

深入地探究環狀對稱式演算法對本發明的影響,我們可以發現k值仍被N所限制住,更精確地說,即k的值會介於1到N-1之間。既然我們可以對每一個像素算出其同位元檢查碼,又可以從1到N-1,去測試k的值,以確認所試的新位置的最後三個位元是否就是同位元檢查碼相符,則經過最多N-1測試,即可找到k的值。既然k值可以被找到,偽造者可以將圖任意修改,並對修改像素,算出新的同位元檢查碼,再依據環狀對稱式演算法以及k的值,算出位置並將新的同位元檢查碼藏入,如此,在偵測時便無法指出已修改的部份。In-depth study of the effect of the circular symmetric algorithm on the present invention, we can find that the k value is still limited by N , more precisely, the value of k will be between 1 and N -1. Since we can calculate the parity check code for each pixel, we can test the value of k from 1 to N -1 to confirm whether the last three bits of the new position tested are the same checksum code. Then after a maximum of N -1 tests, you can find the value of k . Since the k value can be found, the forger can modify the graph arbitrarily, and modify the pixel, calculate a new parity check code, and then calculate the position and check the new parity according to the circular symmetric algorithm and the value of k . The code is hidden, so that the modified part cannot be pointed out when detecting.

於該步驟(150)以及(160)中,為了要解決此一問題,在藏入同位元檢查碼前,必須先使用位元旋轉技術,位元旋轉技術的作用在於旋轉同位元檢查碼的位元的位置,在此本發明必須使用第二把鑰匙k',利用k'來產生一連串的隨機數字R 1,R 2,…,R N × N 。在同位元檢查碼藏入像素時,會根據這些隨機產生的數字來旋轉同位元檢查碼的位元位置,旋轉的方式如下:In this step (150) and (160), in order to solve this problem, before the parity check code is concealed, the bit rotation technique must be used first, and the bit rotation technique is used to rotate the bits of the parity check code. The position of the element, in which the invention must use a second key k ', using k ' to generate a series of random numbers R 1 , R 2 , ..., R N × N . When the parity check code is hidden in the pixel, the bit position of the parity check code is rotated according to the randomly generated numbers, and the rotation is as follows:

J'=(J+R i )mod M J '=( J + R i )mod M

其中R i 為隨機數字的第i個,此數字將會指定給第i個像素來使用。J表示原來同位元檢查資料的位元位置,J'表示新的同位元檢查資料的位元位置,而M表示要旋轉的總位元個數。Wherein R i will be designated as the i-th, the digital random number to be used in the i-th pixel. J represents the bit position of the original parity check data, J ' represents the bit position of the new parity check data, and M represents the total number of bits to be rotated.

舉例來說,請同時參閱第四圖與第五圖所示,同位元檢查碼的位元數為3,所以M的值為3。而在例子中,要藏到像素B的值是(100)2,假設指定給此像素的隨機數字為121,則經過位元旋轉後的結果,旋轉過後的位元為(010)2,將此位元藏回像素B中,最後的像素值將變成(00101010)2For example, please refer to the fourth and fifth figures at the same time, the number of bits of the parity check code is 3, so the value of M is 3. In the example, the value to be hidden in pixel B is (100) 2 . Assuming that the random number assigned to this pixel is 121, the result after the bit is rotated, the rotated bit is (010) 2 , This bit is hidden back into pixel B, and the last pixel value will become (00101010) 2 .

再者,本步驟(160)將該各像素之該同位元檢查碼藏入該各像素之相對應位置,更包括將一指示位元藏入該各像素之相對應位置。本發明在恢復被修改像素時,會根據同位元檢查碼的值,來預測被修改像素的四個最重要位元值。請參閱第七圖所示,可知道每個同位元檢查碼,會對應到兩個可能的為位元資料值,詳細預測的部分會在後面提到。但是當我們有需要進一步增加恢復像素的正確性時,可以針對比較容易誤判的情況,多加一個位元來指出是兩個可能的資料位元中的哪一個。至於哪些是比較容易誤判的情況呢?請參考第七圖所示,當同位元檢查碼的值為3或4時,兩個資料位元值的差,會得到最小差值1(請參考第七圖的最後一個欄位),所以是比較容易產生誤判的情況。雖然此情況容易產生誤判,但是並不會導致像素的值差很多,因為他們的最小差值1。可是當情況變成較易產生誤判且誤判結果會導致像素的值差很多時,本發明會多加一個“指示位元”,用以指出是兩個可能的資料位元中的哪一個,也就是說這些會產生誤判的像素,總共會藏入4個位元(3個位元的同位元檢查碼與一個位元的指示位元)到像素中。Furthermore, in this step (160), the parity check code of each pixel is hidden in a corresponding position of each pixel, and further includes hiding an indicator bit in a corresponding position of each pixel. When recovering a modified pixel, the present invention predicts the four most significant bit values of the modified pixel based on the value of the parity check code. Referring to Figure 7, you can see that each parity check code will correspond to two possible bit data values. The detailed predictions will be mentioned later. But when we need to further increase the correctness of the restored pixels, we can add one more bit to indicate which of the two possible data bits for the case that is easier to misjudge. As for what is easier to misjudge? Please refer to the seventh figure. When the value of the parity check code is 3 or 4, the difference between the two data bit values will get the minimum difference of 1 (please refer to the last field in the seventh figure), so It is a situation that is more likely to cause misjudgment. Although this situation is prone to misjudgment, it does not cause the pixel values to differ a lot because their minimum difference is 1. However, when the situation becomes more prone to misjudgment and the result of the misjudgment results in a large difference in the value of the pixel, the present invention adds an "indicator bit" to indicate which of the two possible data bits, that is, These will produce false positive pixels, and a total of 4 bits (3 bit parity check code and one bit indicator bit) will be hidden into the pixel.

在本發明所提的方法中,雖然同位元檢查碼的值為3或4時,最容易產生誤判,但是其差值只有1,代表縱使誤判,並不會導致像素的值差很多。因此此種情況並不會多加一個“指示位元”。相反的本發明會在同位元檢查碼的值為2或5時,多加一個指示位元,本發名稱此方法為“加指示位元之方法#1”。如此,便可以達到較準確的預測。當我們對於復原品質有更高的需求時,除了上述對同位元檢查碼值是2或5的像素,多加一個“指示位元”外,亦可以增加對於同位元檢查碼值是1或6的像素,多加一個“指示位元”,以達到更高的復原正確性,我們稱此種方法為“加指示位元之方法#2”。最後,若是對所有像素皆加入“指示位元”,我們稱此種方法為“加指示位元之方法#3”。In the method of the present invention, although the value of the parity check code is 3 or 4, the misjudgment is most likely to occur, but the difference is only 1, which means that even if the error is judged, the value difference of the pixel is not caused much. Therefore, this situation does not add an "indicator bit". In contrast, the present invention adds one more indicator bit when the value of the parity check code is 2 or 5. The method of the present name is " method #1 of the indicator bit ." In this way, a more accurate prediction can be achieved. When we have a higher demand for the quality of the restoration, in addition to the above-mentioned pixel with the parity check code value of 2 or 5, plus an "indicator bit", it is also possible to increase the value of the parity check code to 1 or 6. Pixels, plus an "indicator bit" to achieve higher recovery correctness, we call this method " method #2 with indicator bits ". Finally, if "indicator bits" are added to all pixels, we call this method " method #3 with indicator bits ".

於該步驟(170)中,影像的變更有可能是蓄意或是非蓄意的修改而造成,當影像在網路上傳輸,可能會受到網路傳輸品質不良的影響,而產生非蓄意修改,如果此種非蓄意修改只產生一個位元的錯誤,而且這個錯誤是發生在最重要的4個位元或是最不重要的三個位元,則根據漢明碼的編碼方式就可以發現此種錯誤,並且將此錯誤更正回來。In this step (170), the image change may be caused by deliberate or unintentional modification. When the image is transmitted over the network, it may be affected by poor network transmission quality, and unintentional modification may occur. Unintentional modification produces only one bit error, and this error occurs in the most significant 4 bits or the least significant three bits, which can be found according to the Hamming code encoding method, and Correct this error back.

對於蓄意修改,我們必須先將被修改的修改像素區域劃分出來,在(圖六)中,假設灰色的部份即是修改的部份,我們稱此區域為X,其中像素A的值已經被修改了。如上所述,像素A的同位元檢查資料藏在像素B中,而像素C的同位元檢查資料藏在A中。既然像素A已經被修改,則修改過後所算出的同位元檢查資料的值,將不會和之前藏在像素B的同位元檢查資料的值一樣,因此,像素A和像素B都將被判定為修改過的像素。同樣地,像素C也會被判為修改過,因為它的同位元檢查資料藏在像素A中,而像素A已經被修改過了。因此,我們可以將整個影像的所有像素測試過,並將被判定修改的像素作記號,最後,我們可以看到在X區域內的像素,大部分皆會被標上修改記號。另外,還有一些單獨的像素被記上修改記號,如像素B和像素C,由觀察可知,將像素B和像素C標上修改記號是誤判的結果。For deliberate modification, we must first divide the modified pixel area to be modified. In (Figure 6), the gray part is assumed to be the modified part. We call this area X, where the value of pixel A has been edited. As described above, the parity check data of the pixel A is hidden in the pixel B, and the parity check data of the pixel C is hidden in A. Since the pixel A has been modified, the value of the parity check data calculated after the modification will not be the same as the value of the parity check data previously hidden in the pixel B. Therefore, both the pixel A and the pixel B will be determined as Modified pixels. Similarly, pixel C is also judged to be modified because its parity check data is hidden in pixel A, and pixel A has been modified. Therefore, we can test all the pixels of the entire image, and mark the pixels that are determined to be modified. Finally, we can see that most of the pixels in the X area will be marked with modified marks. In addition, some individual pixels are marked with modified symbols, such as pixel B and pixel C. It can be seen from the observation that marking B and pixel C with the modified mark is the result of misjudgment.

於該步驟(180)中,我們必須為誤判的像素除去修改記號,在此,我們使用形態運算子(Morphological operations)來達成我們的目的,該運算子包含了兩個部分:侵蝕運算子(Erosion operations)以及增長運算子(Dilation operations),在依序使用侵蝕運算子及增長運算子後,獨立的標記點或只包含幾個標記點的區域會被消除掉,最後只剩下在X區域內的修改像素會被標上修改記號。經過偵測程序會使得一些像素被標記上修改記號,本發明的下一個步驟,即是試著恢復這些被標記修改記號的像素。既然在區域X內的像素值已經被修改,則不會存在有助於恢復這些像素的訊息,然而,這些像素的同位元檢查碼則未必被修改過,所以接下來要討論如何恢復這些被修改像素。In this step (180), we must remove the modified token for the misjudged pixel. Here, we use the Morphological operations to achieve our goal. The operator contains two parts: the erosion operator (Erosion). Operations) and the growth operator (Dilation operations), after using the erosion operator and the growth operator in sequence, the independent marker points or the area containing only a few marker points will be eliminated, and finally only in the X region The modified pixels will be marked with a modified token. After the detection process causes some pixels to be marked with a modified mark, the next step of the present invention is to try to recover the pixels of the marked modified mark. Since the pixel values in region X have been modified, there will be no messages that help restore these pixels. However, the parity check codes for these pixels are not necessarily modified, so we will discuss how to restore these modifications. Pixel.

於該步驟(190)中,首先,假若同位元檢查碼未被修改且其具有“指示位元”,則此類像素優先恢復,因為他們的值可以唯一被決定。假若只有同位元檢查碼存在且未被修改,我們可以根據同位元檢查碼的值,可以知道原始像素的最重要四個位元具的兩種可能的資料位元,如第七圖所示。此外,根據同位元檢查碼,可以知道預測像素的最重要位元的位元值。舉例來說,當我們知道某個被修改像素,其同位元檢查碼為(000)2,則參考第七圖可知,其資料位元有可能值為(0000)2或(0111)2,所以在回復像素時,必需從這兩個可能的資料位元中,挑選一個,來當作預測資料位元的,用以恢復被修改像素。值得注意的是,根據同位元檢查碼,我們已經知道要預測的資料位元其最重位元的位元值為零。In this step (190), first, if the parity check code is not modified and it has an "indicator bit", such pixels are preferentially restored because their values can be uniquely determined. If only the parity check code exists and has not been modified, we can know the two possible data bits of the most important four bits of the original pixel according to the value of the parity check code, as shown in the seventh figure. In addition, based on the parity check code, the bit value of the most significant bit of the predicted pixel can be known. For example, when we know that a modified pixel has a parity check code of (000) 2 , we can refer to the seventh figure that its data bit has a possible value of (0000) 2 or (0111) 2 , so When replying to a pixel, one of the two possible data bits must be selected as the predicted data bit to recover the modified pixel. It is worth noting that, according to the parity check code, we already know that the data bit to be predicted has the most significant bit value of zero.

而於本步驟(190)中,進一步包括下列步驟:In the step (190), the following steps are further included:

(191)產生一矩陣用以計算該修改像素周圍未被修改像素之數量;(191) generating a matrix for calculating the number of unmodified pixels around the modified pixel;

(192)還原該修改像素周圍未被修改像素之數量最大者;(192) restoring the largest number of unmodified pixels around the modified pixel;

(193)判斷是否具有該修改像素;以及(193) determining whether the modified pixel is present;

(194)若具有該修改像素,重複執行該步驟(191)。(194) If the modified pixel is present, the step (191) is repeatedly performed.

而為了從這兩個可能的資料位元中,挑選一個,我們另外宣告一個與數位影像大小相同的矩陣M,請參閱第八圖所示,用以計算該修改像素其周圍有多少像素未被修改(包含已經恢復的像素)。矩陣M內的元素值,是記錄被修改像素周圍多少像素被標記成“未被修改像素”(包含已經恢復的像素)。當矩陣內的元素具有較大值時,代表其周圍有較多的像素可以參考,因此這些具有較大值的被修改像素,會被優先還原。In order to select one of the two possible data bits, we additionally declare a matrix M of the same size as the digital image, as shown in the eighth figure, to calculate how many pixels around the modified pixel are not Modified (contains pixels that have been restored). The value of the element in the matrix M is how many pixels around the recorded pixel are marked as "unmodified pixels" (including pixels that have been recovered). When the elements in the matrix have larger values, there are more pixels around them that can be referenced, so these modified pixels with larger values will be restored first.

請參閱第八圖所示,因為矩陣內元素的最大值為6,其所對應的像素會先恢復。由於同位元檢查碼的值已經知道,所以可以知道被修改像素11的最重要位元值為何。當要參考周圍“未被修改像素12”時,只有具有相同的最重要位元值的像素,才能參與運算,以求得這些像素的平均值。經由平均值,可以計算出兩個可能的資料位元,何者與平均值的距離最近,與平均值最接近的資料位元,會被用來恢復被修改像素11的四個最重要位元。Please refer to the eighth figure, because the maximum value of the elements in the matrix is 6, the corresponding pixels will be restored first. Since the value of the parity check code is already known, it is possible to know the most significant bit value of the modified pixel 11. When referring to the surrounding "unmodified pixels 12", only pixels with the same most significant bit value can participate in the operation to find the average of these pixels. Through the average, two possible data bits can be calculated, which is the closest to the average, and the data bit closest to the average is used to recover the four most significant bits of the modified pixel 11.

每一回合,我們只恢復具有最大值的被修改像素11。而後被恢復的像素會被標記為“未被修改像素12”,而後再重新計算矩陣M內的元素值,並再繼續恢復矩陣M內具有最大值的元素其所相對應的像素。以第八圖為例,在第一回合中,將所有值是6所對應的像素都恢復,並且再重新計算矩陣M內的元素值。在第二回合中,我們一樣尋找矩陣中具有最大值的元素(也就是值6的像素),來進行恢復動作,直到所有被修改像素11皆被標記為“未被修改像素12”為止。Each round, we only recover the modified pixel 11 with the largest value. The recovered pixels are then marked as "unmodified pixels 12", and then the element values in matrix M are recalculated, and the corresponding pixels in the matrix M having the largest value are resumed. Taking the eighth figure as an example, in the first round, all pixels corresponding to the value of 6 are restored, and the element values in the matrix M are recalculated. In the second round, we look for the element with the largest value in the matrix (that is, the pixel of value 6) to perform the recovery action until all the modified pixels 11 are marked as "unmodified pixels 12".

綜上所述,本發明係使用漢明編碼法來達到影像認證的目的。在本實施例中主要包括了三個程序,第一個程序稱為藏入程序,即是產生認證碼,並將其藏入數位影像中,如步驟(110)~(160)。第二個程序是偵測程序,即當影像被修改時,要如何將已修改的區域劃分出來,如步驟(170)~(180)。最後一個程序是復原程序,也就是如何將被判定為修改的區域恢復回來,如步驟(190)。In summary, the present invention uses Hamming coding to achieve image authentication. In the present embodiment, three programs are mainly included. The first program is called a hidden program, that is, an authentication code is generated and hidden in a digital image, as in steps (110) to (160). The second program is the detection program, which is how to divide the modified area when the image is modified, as in steps (170) ~ (180). The last program is the recovery program, that is, how to restore the area determined to be modified, as in step (190).

以下將說明本發明數位影像認證方法的實驗方式以及其結果,於本實施例中,使用一張大小為512 512像素稱為Lena的數位影像當作實驗對象,Lena為一數位影像檔,這張影像檔長久以來被廣泛地使用在影像壓縮、處理成果測試上,所屬技術領域具有通常知識者應可輕易理解,如第九圖所示。選擇Lena當作實驗影像是因為此張數位影像包含許多平滑及複雜的區域,可以充分顯示出本發明之方法的優越性。The experimental method of the digital image authentication method of the present invention and the result thereof will be described below. In the present embodiment, a digital image of 512 512 pixels called Lena is used as an experimental object, and Lena is a digital image file. Image files have long been widely used in image compression and processing results testing, and those skilled in the art should be able to easily understand them, as shown in the ninth figure. Lena was chosen as the experimental image because this digital image contains many smooth and complex areas that fully demonstrate the superiority of the method of the present invention.

首先,本發明對實驗的數位影像的每一個像素產生同位元檢查碼,並藏入到其他像素,而得到已藏認證資料的影像,與其影像品質顯示於第十圖(a)-(d)。其中第十圖(a)是用“原始所提方方法”所產生之認證影像,也就是未加入指示位元之方法,而第十圖(b)-(d)則是分別利用“加入指示位元之方法#1”、“加入指示位元之方法#2”與“加入指示位元之方法#3”所產生之認證影像。相對於影像品質的計算,本發明採用PSNR(Peak-Signal-to-Noise Ratio)來當作判斷標準,用以計算已藏認證資料的影像品質。下面列出計算PSNR的公式:First, the present invention generates a parity check code for each pixel of the experimental digital image, and hides it into other pixels to obtain an image of the stored authentication data, and its image quality is shown in the tenth (a)-(d) . The tenth figure (a) is the authentication image generated by the " original proposed method ", that is, the method of not adding the indicator bit, and the tenth figure (b)-(d) is respectively using the " join indication". The authentication method generated by the bit method #1 ”, “ method #2 of adding indicator bit ” and “ method #3 of adding indicator bit ”. Compared with the calculation of image quality, the present invention uses PSNR (Peak-Signal-to-Noise Ratio) as a criterion for calculating the image quality of the stored authentication data. The formula for calculating PSNR is listed below:

其中變數HW分別表示影像的高跟寬,I(j,k)表示位於原始影像第j列第k行的像素值,而I'(j,k)表示位於已藏認證資料的影像第j列第k行的像素值。The variables H and W represent the high-heel width of the image, I ( j , k ) represents the pixel value of the k- th row of the j-th column of the original image, and I' ( j , k ) represents the image of the stored authentication data. The pixel value of the kth line of j column.

本發明的第一個實驗是用來展示本發明的方法對突發性位元錯誤之偵測與復原能力,先由已認證電子影像隨機選出5000個位元,將這些位元的值反轉,也就是0變成1或1變成0,在經過突發性位元錯誤以後,將所產生電子影像的其中一部分顯示在第十一圖(a)中,而在經由本發明的復原程序以後,其結果顯示在第十一圖(b)。The first experiment of the present invention is to demonstrate the ability of the method of the present invention to detect and recover from sudden bit errors. First, 5,000 bits are randomly selected from the authenticated electronic image, and the values of these bits are inverted. , that is, 0 becomes 1 or 1 becomes 0, and after a burst bit error, a part of the generated electronic image is displayed in the eleventh figure (a), and after the recovery procedure according to the present invention, The result is shown in Figure 11 (b).

本發明的第二個實驗是用來展示本發明的方法對於惡意修改電子影像之偵測與復原能力。首先,先從已認證電子影像中,挑出四個區域做修改,第一個區域是平滑的區域,而第二個區域則是複雜的區域,另外二個區域則是同時包含平滑與複雜的區域(區域I與區域II),修改的位置如第十二圖所示。A second experiment of the present invention is to demonstrate the ability of the method of the present invention to detect and recover maliciously modified electronic images. First, first select four areas from the certified electronic image for modification. The first area is a smooth area, and the second area is a complex area. The other two areas contain both smooth and complex. The area (Zone I and Area II) is modified as shown in Figure 12.

針對“原始所提方方法”、“加入指示位元之方法#1”、“加入指示位元之方法#2”與“加入指示位元之方法#3”所產生的認證影像,以第十二圖所示之位置進行修改,並利用本發明所提的偵測復原方法,將被修改的像素恢復回來。在第十三圖中顯示在不同的方法的情況下,對於平滑區域的被修改像素的恢復結果。在第十四圖則中顯示在不同的方法的情況下,對於複雜區域的被修改像素的恢復結果。而第十五圖與第十六圖則顯示在不同的方法的情況下,對於同時具有平滑與複雜區域的被修改像素的恢復結果。經由實驗結果可以看到大部分的像素都成功地被復原回來,無論是平滑的背景區域還是複雜的頭髮的紋路,都可以成功地復原回來。更甚者,對於一些如眼睛這種區域,本發明所提的方法可以很精確地偵測及復原修改的區域。也可以發現,隨著有加“指示位元”的像素量的增加,其恢復的效果也越顯著。然而也隨著加“指示位元”的像素量的增加,導致影像品值的下降,如第十圖所示。For the " original proposed method ", " method #1 for adding indicator bits ", " method #2 for adding indicator bits " and " method #3 for adding indicator bits ", the authentication image is generated by the tenth The position shown in the two figures is modified, and the modified pixels are restored by the detection recovery method of the present invention. The recovery result for the modified pixels of the smooth region is shown in the thirteenth figure in the case of different methods. The recovery results for the modified pixels of the complex region are shown in the fourteenth figure in the case of different methods. The fifteenth and sixteenth graphs show the recovery results for modified pixels having both smooth and complex regions in the case of different methods. Through the experimental results, it can be seen that most of the pixels are successfully restored, and the smooth background area or the complex hair texture can be successfully restored. Moreover, for some areas such as the eye, the method of the present invention can detect and recover the modified area very accurately. It can also be found that as the amount of pixels with the "indicator bit" increases, the effect of recovery is more significant. However, as the amount of pixels added with the "indicator bit" increases, the image value decreases, as shown in the tenth figure.

請參閱全部附圖所示,相較於習用技術,本發明具有以下優點:Referring to the drawings, the present invention has the following advantages over conventional techniques:

在具價值性之數位影像交易當中,必須能夠確保購買者能夠能驗證影像之完整性,這類流通在網路上的數位媒體交易已愈趨普及,本發明可以確實的維持數位內容的完整性。In the value of digital image transactions, it must be able to ensure that the purchaser can verify the integrity of the image. Such digital media transactions on the Internet have become more and more popular, and the present invention can surely maintain the integrity of the digital content.

透過上述之詳細說明,即可充分顯示本發明之目的及功效上均具有實施之進步性,極具產業之利用性價值,且為目前市面上前所未見之新發明,完全符合發明專利要件,爰依法提出申請。唯以上所述著僅為本發明之較佳實施例而已,當不能用以限定本發明所實施之範圍。即凡依本發明專利範圍所作之均等變化與修飾,皆應屬於本發明專利涵蓋之範圍內,謹請 貴審查委員明鑑,並祈惠准,是所至禱。Through the above detailed description, it can fully demonstrate that the object and effect of the present invention are both progressive in implementation, highly industrially usable, and are new inventions not previously seen on the market, and fully comply with the invention patent requirements. , 提出 apply in accordance with the law. The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the invention. All changes and modifications made in accordance with the scope of the invention shall fall within the scope covered by the patent of the invention. I would like to ask your review committee to give a clear explanation and pray for it.

(110)~(190)...步驟(110)~(190). . . step

1...影像1. . . image

11...被修改像素11. . . Modified pixel

12...未被修改像素12. . . Unmodified pixel

D1~D4...資料位元D1~D4. . . Data bit

P1~P3...同位元檢查碼P1~P3. . . Parity check code

A、B、C...像素A, B, C. . . Pixel

X...區域X. . . region

M...矩陣M. . . matrix

第一圖 係為本發明較佳實施例之流程圖。The first figure is a flow chart of a preferred embodiment of the invention.

第二圖 係為本發明較佳實施例之實施示意圖一,說明像素的四個資料位元經過反轉排列後命名為D 1D 4,並利用D 1D 4資料位元產生P 1P 3同位元檢查資料。The second figure is a first schematic diagram of the implementation of the preferred embodiment of the present invention. The four data bits of the pixel are reversely arranged and named as D 1 to D 4 , and the D 1 to D 4 data bits are used to generate P 1 . Go to the P 3 parity check data.

第三圖 係為本發明較佳實施例之實施示意圖二,說明D 1D 4為四個資料位元與其所產生的P 1P 3三個同位元檢查資料。The third figure is a schematic diagram of the implementation of the preferred embodiment of the present invention. It is illustrated that D 1 to D 4 are four data bits and three identical parity check data generated by P 1 to P 3 .

第四圖 係為本發明較佳實施例之實施示意圖三,說明一張大小9 9的電子影像,A、B、C為此影像上面的三個像素。The fourth figure is a third embodiment of the preferred embodiment of the present invention, illustrating an electronic image of size 9 9 and A, B, and C for the three pixels above the image.

第五圖 係為本發明較佳實施例之實施示意圖四,說明J表示原來同位元檢查資料的位元位置,J'表示新的同位元檢查資料的位元位置。The fifth figure is a schematic diagram of the implementation of the preferred embodiment of the present invention. The description of J indicates the bit position of the original parity check data, and J' indicates the bit position of the new parity check data.

第六圖 係為本發明較佳實施例之實施示意圖五,說明A、B、C為影像上面的三個像素,區域X(灰色部份)係遭受蓄意修改的區域。The sixth figure is a schematic diagram of the implementation of the preferred embodiment of the present invention. A, B, and C are three pixels on the image, and the area X (gray portion) is subjected to deliberate modification.

第七圖 係為本發明較佳實施例之實施示意圖六,說明最重要位元係指第一個位元,也就是方框所框的位元,最後欄為兩個原始資料位元(也就是第一欄位的值)之間的差值。Figure 7 is a schematic diagram of the implementation of the preferred embodiment of the present invention, illustrating that the most significant bit refers to the first bit, that is, the bit framed by the box, and the last column is two original data bits (also Is the difference between the values of the first field).

第八圖 係為本發明較佳實施例之實施示意圖七,說明矩陣M大小與原始影像大小一樣,黑色框的範圍為修改區域,數字代表該像素附近有多少像素是“未修改像素”(或者已恢復像素)的像素總數。。The eighth figure is a schematic diagram of the implementation of the preferred embodiment of the present invention. The size of the matrix M is the same as the size of the original image. The range of the black frame is the modified area, and the number represents how many pixels in the vicinity of the pixel are “unmodified pixels” (or The total number of pixels that have been restored. .

第九圖 係為本發明較佳實施例之實施示意圖八,係實驗之測試數位影像。The ninth diagram is a schematic diagram of the implementation of the preferred embodiment of the present invention, which is an experimental digital image.

第十圖 係為本發明較佳實施例之實施示意圖九,說明已藏認證資料之電子影像。The tenth figure is a schematic diagram IX of the implementation of the preferred embodiment of the present invention, illustrating an electronic image of the possessed authentication data.

(a)以“原始所提方法”藏入認證碼,其影像品質為PSPR=37.57。(a) The authentication code is hidden by the "original method" and its image quality is PSPR = 37.57 .

(b)以“加入指示位元之方法#1”藏入認證碼,其影像品質為PSPR=35.11。(b) The authentication code is hidden by "Method #1 of adding the indicator bit" , and the image quality is PSPR = 35.11.

(c)以“加入指示位元之方法#2”藏入認證碼,其影像品質為PSPR=32.99。(c) The authentication code is hidden by "Method #2 of adding the indicator bit" , and the image quality is PSPR = 32.99.

(d)以“加入指示位元之方法#3”藏入認證碼,其影像品質為PSPR=31.96。(d) The authentication code is hidden by "Method #3 of adding the indicator bit" , and the image quality is PSPR = 31.96.

第十一圖 係為本發明較佳實施例之實施示意圖十,說明本發明對突發性位元錯誤抵抗之能力11 is a schematic diagram of the implementation of a preferred embodiment of the present invention, illustrating the ability of the present invention to resist sudden bit errors.

(a)針對第十圖(a)遭受突發性位元錯誤之電子影像(隨機將5000個位元做值的0與1的互換)。(a) For the eleventh figure (a), an electronic image of a sudden bit error (a random exchange of 0 and 1 for a value of 5000 bits).

(b)經本發明恢復後之電子影像。(b) An electronic image restored by the present invention.

第十二圖 係為本發明較佳實施例之實施示意圖十一,說明本發明對已加入認證資料的影像進行修改。The twelfth embodiment is a schematic diagram of the implementation of the preferred embodiment of the present invention. The invention is modified to modify the image to which the authentication material has been added.

(a)對平滑區域進行修改。(a) Modify the smooth area.

(b)對複雜區域進行修改。(b) Modifications to complex areas.

(c)對具有平滑與複雜區域的區域I進行修改。(c) Modifying the area I with smooth and complex areas.

(d)對具有平滑與複雜區域的區域II進行修改。(d) Modifying Area II with smooth and complex areas.

第十三圖 係為本發明較佳實施例之實施示意圖十二,說明本發明各種方法對平滑區域遭惡意修改抵抗之能力。Figure 13 is a schematic view of the preferred embodiment of the present invention, illustrating the ability of the various methods of the present invention to resist malicious modifications to smooth areas.

(a)以“原始所提方法”恢復被修改的區域。(a) Restoring the modified area with the " original proposed method ".

(b)以“加入指示位元之方法#1”恢復被修改的區域。(b) Restore the modified area with " Method #1 of joining indicator ".

(c)以“加入指示位元之方法#2”恢復被修改的區域。(c) Restore the modified area with " Method #2 of joining indicator ".

(d)以“加入指示位元之方法#3”恢復被修改的區域。(d) Restoring the modified area with " Method #3 of joining indication bits ".

第十四圖 係為本發明較佳實施例之實施示意圖十三,說明本發明各種方法對複雜區域遭惡意修改抵抗之能力。Figure 14 is a schematic diagram of the implementation of a preferred embodiment of the present invention, illustrating the ability of various methods of the present invention to resist malicious modifications in complex areas.

(a)以“原始所提方法”恢復被修改的區域。(a) Restoring the modified area with the " original proposed method ".

(b)以“加入指示位元之方法#1”恢復被修改的區域。(b) Restore the modified area with " Method #1 of joining indicator ".

(c)以“加入指示位元之方法#2”恢復被修改的區域。(c) Restore the modified area with " Method #2 of joining indicator ".

(d)以“加入指示位元之方法#3”恢復被修改的區域。(d) Restoring the modified area with "Method #3 of joining the indication bit" .

第十五圖 係為本發明較佳實施例之實施示意圖十四,說明本發明各種方法對具有平滑與複雜區域的區域I遭惡意修改抵抗之能力。The fifteenth embodiment is a schematic diagram of the implementation of the preferred embodiment of the present invention, illustrating the ability of the various methods of the present invention to be maliciously modified against areas I having smooth and complex regions.

(a)以“原始所提方法”恢復被修改的區域。(a) Restoring the modified area with the "original proposed method" .

(b)以“加入指示位元之方法#1”恢復被修改的區域。(b) Restoring the modified area with "Method #1 of joining the indication bit" .

(c)以“加入指示位元之方法#2”恢復被修改的區域。(c) Restoring the modified area with "Method #2 of joining the indication bit" .

(d)以“加入指示位元之方法#3”恢復被修改的區域。(d) Restoring the modified area with "Method #3 of joining the indication bit" .

第十六圖 係為本發明較佳實施例之實施示意圖十五,說明本發明各種方法對具有平滑與複雜區域的區域II遭惡意修改抵抗之能力。Figure 16 is a schematic diagram showing the implementation of a preferred embodiment of the present invention. The method of the present invention demonstrates the ability of the region II having smooth and complex regions to be maliciously modified.

(a)以“原始所提方法”恢復被修改的區域。(a) Restoring the modified area with the "original proposed method" .

(b)以“加入指示位元之方法#1”恢復被修改的區域。(b) Restoring the modified area with "Method #1 of joining the indication bit" .

(c)以“加入指示位元之方法#2”恢復被修改的區域。(c) Restoring the modified area with "Method #2 of joining the indication bit" .

(d)以“加入指示位元之方法#3”恢復被修改的區域。(d) Restoring the modified area with "Method #3 of joining the indication bit" .

(110)~(190)...步驟(110)~(190). . . step

Claims (7)

一種數位影像認證方法,包括下列步驟:(110)提供一數位影像,該數位影像具有複數像素;(120)對該各像素之複數重要位元進行反轉排列;(130)基於一漢明編碼法對該各像素產生一同位元檢查碼;(140)基於一環狀對稱式演算法計算該各像素之相對應位置;(150)對該各像素之該同位元檢查碼執行位元旋轉;(160)將該各像素之該同位元檢查碼藏入該各像素之相對應位置;(170)判斷該各修改像素之該同位元檢查碼是否被修改;(180)判斷出至少一修改像素;以及(190)基於該同位元檢查碼預測該修改像素。A digital image authentication method includes the following steps: (110) providing a digital image having a plurality of pixels; (120) inverting the plurality of important bits of each pixel; (130) based on a Hamming code The method generates a parity check code for each pixel; (140) calculating a corresponding position of each pixel based on a circular symmetric algorithm; (150) performing bit rotation on the same check code of each pixel; (160) hiding the parity check code of each pixel into a corresponding position of each pixel; (170) determining whether the parity check code of each modified pixel is modified; (180) determining at least one modified pixel And (190) predicting the modified pixel based on the parity check code. 如申請專利範圍第1項所述之數位影像認證方法,其中該基於一漢明編碼法對該各像素產生一同位元檢查碼,係對該各像素中四個位元,產生三個位元的同位元檢查碼。The digital image authentication method according to claim 1, wherein the one-bit check code is generated for each pixel based on a Hamming coding method, and three bits are generated for four bits in each pixel. The parity check code. 如申請專利範圍第1項所述之數位影像認證方法,其中將該各像素之該同位元檢查碼藏入該各像素之相對應位置,更包括將一指示位元藏入該各像素之相對應位置。The digital image authentication method of claim 1, wherein the parity check code of each pixel is hidden in a corresponding position of each pixel, and further comprises hiding an indicator bit into the phase of each pixel. Corresponding location. 如申請專利範圍第1項所述之數位影像認證方法,其中該位元旋轉更包括新的同位元檢查碼的位元位置J'、原來同位元檢查碼的位元位置J、隨機產生的第i個數字Ri以及要旋轉的總位元個數M,其旋轉方式為J'=(J+R i )mod MThe digital image authentication method according to claim 1, wherein the bit rotation further includes a bit position J′ of the new parity check code, a bit position J of the original parity check code, and a randomly generated bit. The number i of the i numbers R i and the total number of bits to be rotated is J '=( J + R i ) mod M . 如申請專利範圍第1項所述之數位影像認證方法,其中該步驟判斷出至少一修改像素係基於一侵蝕運算子以及一增長運算子以判斷出該至少一修改像素。The digital image authentication method according to claim 1, wherein the step of determining that the at least one modified pixel is based on an erosion operator and a growth operator to determine the at least one modified pixel. 如申請專利範圍第1項所述之數位影像認證方法,其中該步驟基於該同位元檢查碼預測該修改像素,更包括下列步驟:(191)產生一矩陣用以計算該修改像素周圍未被修改像素之數量;(192)還原該修改像素周圍未被修改像素之數量最大者;(193)判斷是否具有該修改像素;以及(194)若具有該修改像素,重複執行該步驟(191)。The digital image authentication method according to claim 1, wherein the step of predicting the modified pixel based on the parity check code further comprises the following steps: (191) generating a matrix for calculating that the modified pixel is not modified. The number of pixels; (192) restores the largest number of unmodified pixels around the modified pixel; (193) determines whether the modified pixel is present; and (194) if the modified pixel is present, repeats the step (191). 如申請專利範圍第6項所述之數位影像認證方法,其中該矩陣大小與該數位影像相同。The digital image authentication method according to claim 6, wherein the matrix size is the same as the digital image.
TW101104631A 2012-02-14 2012-02-14 Digital image authentication method TW201333873A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW101104631A TW201333873A (en) 2012-02-14 2012-02-14 Digital image authentication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW101104631A TW201333873A (en) 2012-02-14 2012-02-14 Digital image authentication method

Publications (1)

Publication Number Publication Date
TW201333873A true TW201333873A (en) 2013-08-16

Family

ID=49479562

Family Applications (1)

Application Number Title Priority Date Filing Date
TW101104631A TW201333873A (en) 2012-02-14 2012-02-14 Digital image authentication method

Country Status (1)

Country Link
TW (1) TW201333873A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114764893A (en) * 2021-01-12 2022-07-19 成都启源西普科技有限公司 Face video-based counterfeiting detection method
TWI847688B (en) * 2023-05-12 2024-07-01 技宸股份有限公司 Computer boot method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114764893A (en) * 2021-01-12 2022-07-19 成都启源西普科技有限公司 Face video-based counterfeiting detection method
TWI847688B (en) * 2023-05-12 2024-07-01 技宸股份有限公司 Computer boot method and system

Similar Documents

Publication Publication Date Title
Fateh et al. A new method of coding for steganography based on LSB matching revisited
CN108537049B (en) An Adaptive Steganography Algorithm Based on Binary Image
Wang et al. A majority-voting based watermarking scheme for color image tamper detection and recovery
US6807634B1 (en) Watermarks for customer identification
CN102903075B (en) Robust watermarking method based on image feature point global correction
Pal et al. Watermarking scheme using local binary pattern for image authentication and tamper detection through dual image
Chang et al. A block-based watermarking scheme for image tamper detection and self-recovery
EP3234845B1 (en) Model anti-collusion watermark
Ernawan et al. A blind recovery technique with integer wavelet transforms in image watermarking
Raj et al. Blockwise fragile watermarking schemes for tamper localization in digital images
Liu et al. Adaptive feature calculation and diagonal mapping for successive recovery of tampered regions
Rose et al. A secure verifiable scheme for secret image sharing
CN103971324B (en) Asymmetric watermarking method for protecting vector map data copyright
CN100395776C (en) Block Fragile Watermark Generation and Authentication Method Based on Chaotic Hash Function
CN107346528B (en) Image tampering detection method based on double-image reversible fragile watermark
Yampolskiy et al. Password protected visual cryptography via cellular automaton rule 30
Li et al. Block mapping and dual-matrix-based watermarking for image authentication with self-recovery capability
CN105741222B (en) A kind of steganography information locating method based on the estimation of pixel subset insertion rate
Qin et al. Effective fragile watermarking for image authentication with high-quality recovery capability.
Zhang et al. Self-recovery reversible image watermarking algorithm
TW201333873A (en) Digital image authentication method
Tefas et al. Multi-bit image watermarking robust to geometric distortions
CN104866737B (en) A kind of DEM fragile watermark completeness certification methods for taking features of terrain into account
Liu et al. A Survey of Fragile Watermarking-based Image Authentication Techniques.
Nguyen et al. Stable messenger: Steganography for message-concealed image generation