狄、發明說明: 【發明所屬之技術領域】 本發明係Μ練赠构倾,侧係-卿於用於 黑白影像防偽之浮水印方法。 【先前技術】 習知的數位浮水印(digital贈_rk)為一種利用 資訊隱藏(inf贿tionhiding)來賴電子資料之完整性 的方法。此方法之原理為在原始電子資料中後入一財產權 信號(ccight si_),並_ :纽賴職術,使獲 得資料的使用者運用-加密演算法操取數位浮水印之資 料,並將此貝料進仃價測(detect)與解碼(d⑽此) ,以驗 證與分辨此資料的完整性。 習知的數位浮水印有良好之防偽效果 ,但其設計只保 蔓色以像著電子化社會的來臨,網際網路快速的 發展’資訊轉非敎利快速,公文、合約、以及其他重 要文件也趨向以黑白影像的數位權案保存與傳輸。然而, 現今黑白#像尚無-良好之防偽機制,故有易遭破壞、鼠 改、以及冒名交易等相關的資訊安全問題。 【發明内容】 本發明之目的為_電子加紐術,提出-種黑白影 像之-兀防偽子水印,以驗證黑白影像的完整性。本發明 5 可廣泛應用於公文、合約、以及其他重要文件之黑白影像 保護’使得此類影像可安全的傳輸與储存,以避免此2影 像被變更,而產生被破壞、竄改、或w名交易等相關的^ 訊安全問題。 本發明之方法主要❹人祕資訊辦與檢測程序實 施。加入防偽資雜序為將原始黑白影像嵌人本發明之黑 白防偽浮水印,以產生具防偽浮水印之黑白影像,以作為 檢測程序之判斷標的;檢測程序為將具防偽浮水印之黑白 影像取出,以判斷以該影像是否被變更。 茲配合下列圖示和實施方式之說明,將本發明描述為 更加清楚。 【實施方式】 第一圖為本發明用於文件防偽之概念圖。參考第一 圖’本發明之方法主要以加入防偽資訊程序丨丨2與檢測程序 114來實施。加入防偽資訊程序112為處理一原始黑白影像 111,並對該影像111加密,進而產生一具防偽浮水印之黑 白影像122;檢測程序114則處理具防偽浮水印之黑白影像 122,並對該影像122解密,產生一檢測結果影像115,以檢 測該影像是否被變更。 第二圖為本發明之加入防偽資訊程序流程圖。參考第 一圖,本發明之加入防偽資訊程序開始為開啟原始黑白影 像檔案;接著,執行步驟202,將該原始黑白影像分割為 mxn個資料區塊;之後,執行步驟203,取出步驟202之一資 料區塊,並判斷該區塊是否為平滑區塊,若為是,則執行 步驟204 ;若為非,則執行步驟2〇5。 上述平滑區塊之定義為該區塊内之像素為全黑或全白 之像素時,該區塊稱之為平滑區塊。 步驟204為對是平滑區塊的區塊不作任何修改,並至下 一區塊;之後,再執行步驟203。步驟205則為對不是平滑區 塊的區塊,計算出可監視該區塊的四個鄰近區塊之所應儲 存之資料,並加上一含有位置資訊的資料,該總加之資料 作為加禮、不是平滑區塊的區塊;之後,進行步驟2〇6。 步驟206為判斷步驟205之總加後之資料是否可隱藏入 該區塊,若為是,執行步驟207;若為非,則執行步驟2〇9。 步驟207為修改總加後之資料,以使得隱藏之資料可被隱藏 入不是平滑區塊的區塊;之後,進行步驟2〇8。 步驟209為修改總加後之資料,以標示不是平滑區塊的 區塊未隱藏資料;之後,執行步驟208。 步驟208為判斷此步驟中的區塊是否為最後一個區 塊,若為非,則執行步驟211;若為是,執行步驟21〇。步驟 211則為執行至下-個區塊,執行完該步驟後,接著,執行 步驟203 ’再取步驟2〇2之一資料區塊,並判斷該區塊是否 為平滑區塊;步驟21G為輸出細偽浮水印之黑自影像,之 後,該程序結束。 第二圖為本發明之檢測程序流程圖。參考第三圖,本 發明之檢測程序114為先執行開始為開啟具防偽浮水印之 黑白影像;接著,執行步驟3〇3,將該具防偽浮水印之黑白 影像分割為mxn個資料區塊;接著,執行步驟3〇4,取出步 驟303之-貧料區塊;之後,執行步驟3()6,判斷該區塊是 否隱藏防偽的貢料,若為是,則執行步驟3〇7,·若為非,則 執行步驟308。 步驟307為判斷該區域是否被修改過,若為是,則執行 步驟3U,儲存修改之資料;若為非,則執行步驟,至 下一個區塊,接著,執行步驟304,再取出步驟303之一資 料區塊。 步驟308為至負責監視該區塊的相鄰四個區塊,取出監 視該區塊·偽資料;接著,執行步驟31G,判斷該區塊是 否被修改過,若為是,則執行步驟311,儲存修改之資料; 若為否,則執行步驟3〇9。至下一個區塊,接著,執行步驟 304,再取出步驟3〇3之一資料區塊。 、、執仃完步驟311後,執行步驟312,判斷該區塊是否為 、】之最後區塊’若為否,則執行步驟期。至下一個區塊, 接著,執行步驟304,再取出步驟3〇3之一資料區塊;若為 是’則執行步驟313,輸出檢測檢果影像,之後,該程序結 束。 第四圖為本發明之加續偽資雌序的說關例。參 考第四圖’圖A為原始黑白文件影像圖例;圖^為使用本發明 加入防偽資訊程序之具防偽浮水印之影像,由此兩圖例可 知’具防偽浮水印之影像,與原始文件影像目視相同,不 易以肉眼判斷有所改變。 第五圖為本發明之檢測程序的說明圖例。參考第五 圖’圖A為更改具防偽浮水印之影像,在該影像上加入一文 子方塊501 ’該文字方塊具陳師孟字樣;圖扮吏用本發明之檢 測程序偵測圖A之檢測結果影像;圖(:為圖放大圖。由圖 B與圖C可得之’使用本發明之檢測程序,則變更具防偽浮 水印之影像時,該檢測結果影像會呈現小方塊,提醒使用 者該文件被變更,以達到保護文件之功效。 唯,以上所述者,僅為本發明之較佳實施例而已,當 不能以此限定本發明實施之範圍。即大凡依本發明申請專 利範圍所做之均等變化與修飾,皆應仍屬本發明專利涵蓋 之範圍内。 1223562 【囷式簡單說明】 第一圖為本發明用於文件防偽之概念囷。 第二圖為本發明之加入防偽資訊程序流程圖β 第三圖為本發明之檢測程序流程囷。 第四圖Α為原始黑白文件影像圖例。· 第四圖B為使用本發明加入防偽資訊程序之具防偽浮水 印之影像。 第五圖A為更改具防偽浮水印之影像,該影像上加入一 具陳師孟字樣的文字方塊。 第五圖B為使用本發明之檢測程序偵測第五圖入之檢測結 果影像。 第五圖C為第五围β之放大圖。 111原始黑白影像 112加入防偽資訊程序 122具防偽浮水印之影像 114檢測程序 115檢測結果影像 2〇2將該原始黑白影像分割為mxn個資料區塊之步驟g 203取出步驟202之一資料區塊,並判斷該區塊是否為平 滑區塊之步驟。 1223562 204 205 206 207 208 209 210 211 303 304 306 307 308 309 為對是平滑區塊的區塊不作任何修改,並至下一區 塊之步驟。 為對不是平滑區塊的區塊,計算出可監視該區塊的 四個鄰近區塊之所應儲存之資料,並加上一含有位 置資訊的資料之步驟。 為判斷步驟205之總加後之資料是否可隱藏入該區塊 之步驟。 為修改總加後之資料,以使得隱藏之資料可被隱藏 入不是平滑區塊的區塊。 為判斷此步驟中的區塊是否為最後一個區塊之步 驟。 為修改總加後之資料,以標示不是平滑區塊的區塊 未隱藏資料之步驟。 為輸出具防偽浮水印之黑白影像之步驟。 為執行至下一個資料區塊之步驟。 為將具防偽浮水印之黑白影像分割為個資料區塊 之步驟。 取出步驟303之一資料區塊之步驟 為判斷該區塊是否隱藏防偽的資料。 為判斷該區域是否被修改過之步驟。 為至負責監視該區塊的相鄰四個區塊,取出監視該 區塊的防偽資料之步驟。 為至下一個區塊之步驟, 1223562 310 為判斷該區塊是否被修改過之步驟。 311為儲存修改之資料之步驟。 312為斷該區塊是否為檢測之最後區塊之步驟。 313為輸出檢測檢果影像之步驟。 501 加入之文字方塊。 12D. Description of the invention: [Technical field to which the invention belongs] The present invention is a watermarking method for anti-counterfeiting of black-and-white images. [Prior art] The conventional digital watermark (digital gift_rk) is a method of relying on information integrity to rely on the integrity of electronic data. The principle of this method is to input a property right signal (ccight si_) in the original electronic data, and _: Neway's job, so that the user who obtains the data uses the encryption algorithm to manipulate the digital watermark data, and The material is detected and decoded to verify and distinguish the integrity of the data. The conventional digital watermark has a good anti-counterfeiting effect, but its design only guarantees the color of the man to be like the advent of the electronic society, the rapid development of the Internet, 'information, non-profit, and documents, contracts, and other important documents. It also tends to save and transmit digital rights in black and white images. However, there is no such thing as a good anti-counterfeiting mechanism in the black and white #images today, so there are related information security issues such as vulnerability, alteration, and impersonation. [Summary of the Invention] The purpose of the present invention is _ electronic kang button technology, which proposes a kind of black-and-white image and a security watermark to verify the integrity of the black-and-white image. The present invention 5 can be widely applied to the protection of black and white images of official documents, contracts, and other important documents, so that such images can be safely transmitted and stored to prevent the two images from being altered, causing damage, tampering, or w-name transactions. And other related security issues. The method of the present invention is mainly implemented by the secret information office and detection procedures. Adding anti-counterfeit miscellaneous order is to embed the original black-and-white image into the black-and-white anti-counterfeit watermark of the present invention to generate a black-and-white image with anti-counterfeit watermark as the judgment target of the detection procedure; the detection procedure is to remove the black-and-white image with the anti-counterfeit watermark. To determine whether the image has been changed. The present invention will be described more clearly with reference to the following drawings and description of the embodiments. [Embodiment] The first figure is a conceptual diagram for document anti-counterfeiting according to the present invention. Referring to the first figure, the method of the present invention is mainly implemented by adding an anti-counterfeiting information program 2 and a detection program 114. A security information program 112 is added to process an original black and white image 111, and the image 111 is encrypted to generate a black and white image 122 with a security watermark. The detection program 114 processes a black and white image 122 with a security watermark and processes the image. 122 is decrypted to generate a detection result image 115 to detect whether the image has been changed. The second figure is a flowchart of the procedure for adding anti-counterfeiting information according to the present invention. Referring to the first figure, the program for adding anti-counterfeiting information of the present invention starts by opening the original black and white image file; then, step 202 is performed to divide the original black and white image into mxn data blocks; after that, step 203 is performed and one of step 202 is taken out Data block, and determine whether the block is a smooth block, if yes, go to step 204; if no, go to step 205. The above-mentioned smooth block is defined as when the pixels in the block are all black or white pixels, the block is called a smooth block. Step 204 is to make no modification to the block that is a smooth block, and go to the next block; after that, step 203 is performed. Step 205 is to calculate the data that should be stored for the four neighboring blocks that can monitor the block for the block that is not a smooth block, and add a piece of data containing location information, and the sum of the data as a gift , A block that is not a smooth block; then, step 206 is performed. Step 206 is to judge whether the added data of step 205 can be hidden in the block. If yes, go to step 207; if not, go to step 209. Step 207 is to modify the added data so that the hidden data can be hidden into a block that is not a smooth block; then, step 208 is performed. Step 209 is to modify the added data to indicate that the data that is not a smooth block is not hidden; after that, step 208 is performed. Step 208 is to determine whether the block in this step is the last block. If not, step 211 is performed; if yes, step 21 is performed. Step 211 is to execute to the next block. After executing this step, then execute step 203 'and then take one of the data blocks of step 202 and determine whether the block is a smooth block; step 21G is The black self-image of the fine pseudo-watermark is output. After that, the procedure ends. The second figure is a flowchart of the detection procedure of the present invention. Referring to the third figure, the detection program 114 of the present invention first executes the black-and-white image with an anti-counterfeit watermark to start, and then executes step 303 to divide the black-and-white image with the anti-counterfeit watermark into mxn data blocks; Next, execute step 304, and take out the poor material block in step 303. After that, execute step 3 () 6 to determine whether the block hides anti-counterfeiting materials. If yes, go to step 307, · If not, step 308 is performed. Step 307 is to determine whether the area has been modified. If yes, go to step 3U to store the modified data; if not, go to step to the next block, then go to step 304 and then take out step 303. A block of data. Step 308 is to monitor four adjacent blocks of the block, and take out and monitor the block and false data; then, execute step 31G to determine whether the block has been modified, and if yes, perform step 311, Save the modified data; if not, go to step 309. Go to the next block, then execute step 304, and then take out one of the data blocks in step 303. After the execution of step 311, step 312 is performed to determine whether the block is the last block of []. If not, the step period is performed. Go to the next block, then execute step 304, and then take out one of the data blocks in step 303; if it is YES, execute step 313 to output a test result image, and then the program ends. The fourth figure is an example of adding the pseudo-female sequence of the present invention. Refer to the fourth figure. Figure A is an example of the original black and white document image; Figure ^ is an image with an anti-counterfeiting watermark added to the anti-counterfeiting information program of the present invention. From these two examples, we can see that the image with the anti-counterfeiting watermark and the original document image are visual Similarly, it is not easy to judge changes with the naked eye. The fifth figure is an explanatory diagram illustrating the detection procedure of the present invention. Refer to the fifth image. 'Figure A is to modify the image with anti-counterfeiting watermark. A text box 501 is added to the image. The text box has the words Chen Shimeng. Figure (: is an enlarged view of the figure. Available from Figures B and C, using the detection procedure of the present invention, when the image with anti-fake watermark is changed, the detection result image will show a small box to remind the user of the document It has been changed to achieve the effect of protecting documents. However, the above are only the preferred embodiments of the present invention, and the scope of implementation of the present invention cannot be limited by this. That is, what is done in accordance with the scope of patent application of the present invention Equal changes and modifications should still be covered by the patent of the present invention. 1223562 [Simplified description of the formula] The first picture is the concept of the invention used for anti-counterfeiting of documents. The second picture is the process of adding anti-counterfeit information program of the present invention. Figure β The third figure is the detection program flow of the present invention. The fourth figure A is an example of the original black-and-white document image. The fourth figure B is a defense against the use of the anti-counterfeiting information program of the present invention. The image of the false watermark. The fifth image A is to change the image with the anti-counterfeit watermark, and a text box with Chen Shimeng is added to the image. The fifth image B is the detection of the fifth image using the detection program of the present invention. The result image. The fifth image C is an enlarged view of the fifth surrounding β. 111 The original black and white image 112 is added with anti-counterfeit information program 122 The image with anti-fake watermark 114 detection program 115 detection result image 202 This original black and white image is divided into mxn Step g 203 of each data block is a step of taking out one of the data blocks in step 202 and determining whether the block is a smooth block. 1223562 204 205 206 207 208 209 210 211 303 304 306 307 308 309 The block's block is not modified in any way, and the process proceeds to the next block. For the block that is not a smooth block, calculate the data that should be stored in the four neighboring blocks that can monitor the block, and add A step containing data of location information. A step for determining whether the added data of step 205 can be hidden in the block. To modify the added data so that the hidden data can be hidden A block that is not a smooth block. A step to determine whether the block in this step is the last block. A step to modify the added data to indicate that the data is not hidden in a block that is not a smooth block. For output The step of black and white image with anti-counterfeit watermark. To perform the step to the next data block. The step of dividing the black and white image with anti-counterfeit watermark into data blocks. The step of taking out one of the data blocks in step 303 is Determine whether the block hides anti-counterfeiting data. Steps to determine whether the area has been modified. In order to monitor the four adjacent blocks of the block, take out the steps to monitor the block's anti-counterfeiting data. To the next A block step, 1223562 310 is a step to determine whether the block has been modified. 311 is a step of storing the modified data. Step 312 is a step of judging whether the block is the last block detected. 313 is a step of outputting a test result image. 501 added text box. 12