A kind of multiple digital watermark method at the GIS vector data
Technical field
The invention belongs to geography information copyright protection field, be specifically related to a kind of at embedding of GIS vector data employing comprehensive method and the multiple digital watermark method of extraction watermark with raising algorithm robustness.
Background technology
In recent years, Chinese scholars is paid close attention to the design of Geographic Information System (GIS) vector data digital watermarking algorithm, has proposed multiple GIS vector data digital watermarking algorithm.Along with digital watermark technology deepening continuously in GIS vector data product is used, single watermark has significantly target aspect robustness, anti-attack ability is limited, thereby easily the needs that can not satisfy people are grasped or destroyed to victim, has therefore just produced multiple digital watermark technology.Multi-watermarking is meant the technology that embeds a plurality of watermarks in same carrier in many ways, and it can be used to digital product is transmitted tracking, multiple authentication etc., has actual application value at aspects such as digital product copyright protection and entitlement discriminatings.At present, the research about multi-watermarking both at home and abroad also mainly concentrates on multimedia fields such as image, audio frequency, and has obtained some achievements.For example, horse strong (computer utility and software, Vol.24, No.8,186-188,2007) etc. proposed the host image frequency domain is carried out two-dimension discrete cosine transform (dct transform), adopt gray level image YND threshold value and multiple digital substrate that the DCT frequency domain of host image has been constructed and select the piece group technology, to the DCT ac coefficient of intermediate frequency component grouping embed watermark bit,, a plurality of gray scale digital blind watermarks have been embedded to the DCT coefficient of low-and high-frequency component embed watermark bit at random.Multiple digital watermarking research at the GIS vector data is then less relatively.Wherein, Min Lianquan etc. (computer utility and software, Vol.24, No.1,146-148,174,2007 years) have designed a numerical map watermarking algorithm based on DCT, at first extract the unique point of map datum, the composition characteristic image; Then characteristic image is done discrete cosine transform, watermark information is embedded on the medium and low frequency coefficient.This algorithm is embed watermark on the medium and low frequency coefficient simultaneously, and the embedding capacity promotes to some extent, but do not consider intermediate frequency, coefficient characteristics that low frequency is different.In addition, this can be regarded as a kind of non-proper multiple digital watermarking algorithm in fact.
Summary of the invention
The objective of the invention is to: not strong at present single watermarking algorithm robustness; can not effectively protect the problem of GIS vector data; propose a kind of multiple digital watermarking and embed and the method for extracting, make it in attacks of opposing coordinate system transformation, cutting attack, compression attack, add aspects such as attacks of making an uproar, editor's attack, the attack of increase data and have robustness preferably at GIS vector data feature.
To achieve these goals, the technical solution used in the present invention is:
A kind of multiple digital watermark method at the GIS vector data mainly comprises following process:
(1) watermark embed process:
Step 1: reading and handling of data, read the GIS vector data, configuration embeds the parameter of algorithm, checks the legitimacy of all input data and configuration parameter;
Step 2: odd embeds algorithm, embedded object is a source data integral body, utilize the parity of key element node number to represent watermark information " 1 " or " 0 ", key element embeds one watermark information, by increase the parity that a redundant points changes current key element in sequence node;
Step 3: based on the embedded location and the embedded mode of traditional watermark, after utilizing Douglas Pu Kefa that the sequence node of key element is compressed, spatial domain, wavelet transform territory, discrete cosine transform domain at horizontal ordinate, ordinate utilizes low level additivity method, least significant bit (LSB) to replace the method embed watermark respectively, and the watermark embedded object is concrete geographical space key element;
Step 4: zero watermarking algorithm, utilize the key character of carrier data to construct watermark information, this step is added up the node number in each subregion then by according to the scope subregion, constructs zero watermark according to the result, and zero watermark is preserved;
Step 5: preserve embed watermark data afterwards;
(2) watermark extraction process is the inverse process of described (1) telescopiny:
Step 1: reading and handling of data, read the GIS vector data of watermark to be extracted, read the configuration parameter file, check the legitimacy of input data and configuration parameter;
Step 2: zero watermarking algorithm extracts watermark information;
Step 3: odd extracts watermark information;
Step 4: after utilizing the general gram compression method compression of Douglas, spatial domain, wavelet transform territory, the discrete cosine transform domain at horizontal ordinate, ordinate utilizes low level additivity method, least significant bit (LSB) replacement method to extract watermark respectively;
Step 5: the comprehensive watermark information that compares, analyzes the above-mentioned steps extraction draws the optimum result of extraction.
Wherein, it is specific as follows to the present invention is directed to the embedding step of multiple digital watermark method of GIS vector data:
Link one: the data before the embed watermark are prepared.
Read the GIS vector data, adopt the interval polygon method to choose the polygon of embed watermark and be organized as self-defined structure S0 then; Import copyright mark watermark information W1, and be converted into the watermark W2 to be embedded of algorithm inside; Configuration embeds the parameter of algorithm; Check the legitimacy of all input data and configuration parameter.
Link two: odd embed watermark information.This method belongs to the customization watermarking algorithm, only is applicable to line, face data, and it utilizes the parity of the node sum of single key element interior element to represent watermark bit, and promptly even number represents 0, and odd number represents 1.Wherein, by in sequence node, increasing the parity that a redundant points changes current key element because key element has a large amount of nodes, therefore increase a point (can be the mid point of adjacent two nodes) for key element without any influence.
The processing procedure of algorithm is as follows:
1) calculate the embedding number of times, formula is as follows:
Wherein, c embeds number of times, and n is the key element number, and l is the length of watermark,
Be to round symbol.If c<1 is then returned.
2) get a watermark information Wi (0<=i<1) successively, and key element node set S0j (0<=j<n); If watermark information is " 0 ", and key element node number is odd number, then increases a point in the middle of point sequence, and the coordinate of point is got the average of its former and later two points; If watermark information is " 1 ", and key element node number is even number, also increases a point in the middle of point sequence, and the coordinate of point is got the average of its former and later two points;
Link three: (0<=j<n) carries out the general gram compression method compression of Douglas, and (0<=j<n) is as the input data of next stage, and embeds table of comparisons T for the sequence node R0j after obtaining simplifying to S0j.
Link four: horizontal ordinate DWT low frequency additive algorithms embed watermark.At first choose R0j (the summit composition data sequence among 0<=j<n) in proper order according to 8 one group, by this data sequence being carried out wavelet transform (DWT), isolate basic, normal, high three kinds of coefficient of frequencies, then on low frequency coefficient according to the following formula embed watermark information, last again through the data R1j of DWT inverse transformation output embed watermark information (0<=j<n).
x
w=x+w (2)
Wherein,
For containing watermark carrier, x={x
i, 0≤i<N} and w={w
i, 0≤i<N} is respectively initial carrier and watermark.
Link five: horizontal ordinate spatial domain least significant bit (LSB) is replaced the algorithm embed watermark.Promptly in the scope that the map datum precision allows, utilize least significant bit (LSB) to replace algorithm watermark information directly is embedded in input data (the output data R1j in the link four (0<=j<the n)) horizontal ordinate, obtain output data R2j (0<=j<n).
Link six: ordinate DCT low frequency additive algorithms embed watermark information.With link four, only what carry out is the discrete cosine transform of ordinate to this link, then watermark information is embedded in its low frequency coefficient to carrier data (R2j (0<=j<n)), obtains output data R3j (0<=j<n).
Concrete embedding formula is with link four.
Link seven: ordinate DCT intermediate frequency additive algorithms embed watermark information.With link four, only what carry out is the discrete cosine transform of ordinate to the carrier data of this link (R3j (0<=j<n)), then watermark information is embedded in its intermediate frequency coefficient, obtains output data R4j (0<=j<n).
Concrete embedding formula is with link four.
Link eight: the douglas' method back-pressure contracts.According to the embedding table of comparisons T that link three is produced, the carrier data (R4j (0<=j<n)) that will contain watermark is integrated among the total data S0 that did not compress, and obtains containing the not packed data S1 of watermark.
Link nine: zero watermarking algorithm.The key character of this link utilization input data S1 is constructed watermark information, does not revise any information of S1 in the construction process.Detailed process is as follows:
1) all nodes among the traversal S1 obtain its locus distribution maximum magnitude D;
2) obtain adding up interval number C (C=H * Z) according to the horizontal piece number H that is provided with, vertical piece number Z;
3) with 1) in D be divided into C sub-range, and store the bounds in each sub-range;
4) travel through all nodes, judge which sub-range this node belongs to, the node sum Ccount that this is interval increases by 1;
5) according to the node sum, add up interval number, each node number structure " zero watermark " in interval, and save as physical file.
Link ten: preserve embed watermark file afterwards.Detailed process is as follows:
1) node of embed watermark information is ressembled back Data Elements;
2) Data Elements are saved to hard disk.
The extraction that the present invention is directed to the multiple digital watermark method of GIS vector data is the inverse process that embeds, and concrete steps are as follows:
Link one: extract the preceding data of watermark and prepare.
Read the GIS vector data of watermark to be extracted, and be organized as self-defined structure S0; Read the configuration parameter file; Check the legitimacy of input data and configuration parameter.
Link two: extract zero watermarking algorithm.The key character of this link utilization input data S0 is constructed watermark information, does not revise any information of S0 in the construction process.Detailed process is as follows:
1) all nodes among the traversal S0 obtain its locus distribution maximum magnitude D;
2) obtain adding up interval number C (C=H * Z) according to the horizontal piece number H in the configuration parameter, vertical piece number Z;
3) with 1) in D be divided into C sub-range, and store the bounds in each sub-range;
4) travel through all nodes, judge which sub-range this node belongs to, the node sum Ccount that this is interval increases by 1;
5) according to the node sum, add up interval number, each node number structure " zero watermark " W0 in interval, and save as physical file.
Link three: odd extracts watermark information.
The processing procedure of algorithm is as follows:
1) gets key element node set S0j (0<=j<n), and, obtain M, and M is added into watermark character string W1 successively to the complementation of node number;
2) according to the rule parsing W1 of system in advance, obtain copyright mark watermark W1.
Link four: (0<=j<n) carries out the general gram compression method compression of Douglas, and (0<=j<n) is as the input data of next stage for the sequence node R0j after obtaining simplifying to S0j.
Link five: horizontal ordinate DWT low frequency additive algorithms is extracted watermark.At first choose R0j (the summit composition data sequence among 0<=j<n) in proper order according to 8 one group, by this data sequence being carried out wavelet transform (DWT), isolate basic, normal, high three kinds of coefficient of frequencies, on low frequency coefficient, extract watermark information then, obtain watermark information W2 according to following formula.
w=x
w-x (3)
Wherein, w={w
i, the watermark information of 0≤i<N} for extracting,
X={x
i, 0≤i<N} is for containing watermark carrier data and initial carrier data.
Link six: horizontal ordinate spatial domain least significant bit (LSB) is replaced algorithm and is extracted watermark.Directly (utilize least significant bit (LSB) to replace algorithm in the horizontal ordinate sequence of 0<=j<n) and extract watermark information, and the copyright mark information that the obtains W3 of parsing according to the parameter that reads at R0j.
Link seven: ordinate DCT low frequency additive algorithms is extracted watermark information.With link four, only what carry out is the discrete cosine transform of ordinate to this link, extracts watermark information then from low frequency coefficient to carrier data (R0j (0<=j<n)), and resolves and obtain copyright mark information W4.
The concrete formula that extracts is with link five.
Link eight: ordinate DCT intermediate frequency additive algorithms is extracted watermark information.With link four, only what carry out is the discrete cosine transform of ordinate to the carrier data of this link (R0j (0<=j<n)), extracts watermark information then from intermediate frequency coefficient, and resolves and obtain copyright mark information W5.
The concrete formula that extracts is with link five.
Link nine: comprehensively compare, analyze W0, W1, W2, W3, W4, W5, draw the optimum W as a result that extracts.
The present invention is according to the feature of GIS vector data and the custom-designed a kind of multiple digital watermark method of form that is vulnerable to attack, it is respectively with the unique point of whole, the geographical space key element of the carrier data embedded object as watermark information, adopt embed watermark combine with zero watermark, not same area frequently mutually the watermark embedded mode of fusion with the robustness of this enhancement algorithms.It is not strong that the method applied in the present invention has overcome traditional single watermarking algorithm robustness, can't effectively protect the restriction of GIS vector data copyright, can provide effective guarantee for production, propagation, the application of GIS vector data.
Description of drawings
Fig. 1 watermark of the present invention embeds process flow diagram.
Fig. 2 watermark extracting process flow diagram of the present invention.
Fig. 3 draws vector data for Chinese administrative areas at the county level.
The as a result figure of Fig. 4 for being attacked by cutting after Fig. 3 embed watermark.
Embodiment
Be described in further details below in conjunction with drawings and Examples.
Embodiment 1
This example is selected a kind of typical GIS vector data, at the reading of data, pre-service, watermark embedding, result preserve, the whole process of watermark extracting, provide one embodiment of the present of invention, further describe the present invention.Present embodiment selects Chinese administrative areas at the county level to draw vector data (as Fig. 3) as experimental data, and data layout is shp, face figure layer, and the data recording number is 3407.The watermark content is " Nanjing Normal University " text message, and corresponding scale-of-two watermark sequence W is " 11000100110011111 ... 100111 ", and length is 96.
1, at the multiple data waterprint embedded method of GIS vector data.
As Fig. 1, be the embedding workflow diagram of the multiple digital watermark method of GIS vector data proposed by the invention.Whole flow process is divided into following components:
Step 1: the reading and pre-service of carrier data.
1) utilize the increase income function reading of plug-in unit of MapWinGIS to read corresponding carrier data information, the data that present embodiment is chosen such as Fig. 3.It is the face data in the GIS vector data.
2) the data pre-service comprised for two steps: at first, the sequence node in the reading face data is List<IFMEOPoint with data organization〉[] structure, each List object all is a sequence node in the polygon key element; Secondly, adopt the strategy of polygon embed watermark at interval, filter out the polygon of embed watermark, thereby make any two polygonal common edge all only embed a watermark.Through embedding polygonal number after the screening is 1057.
Step 2: odd embed watermark.
1) calculates the embedding number of times.According to the formula (1) that embeds link two in the step,
2) be example to embed a watermark, obtain certain information of scale-of-two watermark successively, be made as w
i, 0≤i<l, l are watermark length.Get the node number n (n>=3) of current embedding key element, if w
i≠ n%2, % are the complementation symbols, and then the 2nd position in this sequence node increases a some p
2, p
2Horizontal ordinate be the mean value of former and later two points;
3) repeat c-1 time 2);
Step 3: carry out the node compression to embedding polygon according to Douglas Pu Kefa, get List<IFMEOPoint〉[] type characteristic point data tabulation CompressedPoints, List<int〉[] type compression corresponding tables CompressedTable.Douglas Pu Kefa is a kind of vector data compression method of maturation, does not repeat them here.
Step 4: horizontal ordinate DWT low frequency additivity mode embed watermark.Sequence node tabulation with each key element is a unit, and per 8 one group is carried out wavelet transform, and 8 of less thaies are not then carried out conversion; Afterwards, by formula (2) with watermark information and embedded position information addition, with this embed watermark information;
Step 5: replace horizontal ordinate least significant bit (LSB) method embed watermark.According to the embedding point position (value is 4) that is provided with, insert length (value is 4) watermark information is directly replaced in the horizontal ordinate accordingly numerical value with this embed watermark;
Step 6: ordinate DCT intermediate frequency, low frequency are respectively with additivity mode embed watermark.The same step 4 of detailed process;
Step 7: the compression of the general gram of anti-Douglas, the parameters C ompressedTable that the sequence node of embed watermark is produced during according to compression is integrated in whole node listings.
Step 8: extract " zero watermark ".Size of data according to whole nodes, determine distribution range, distribution range is Xmax=134.3835199 in the present embodiment, Xmin=74.848011010179221, Ymax=52.90461345, Ymin=18.3902364, according to the piecemeal number (6 * 6=36 piece) that is provided with distribution range is divided concrete statistics interval, travel through whole nodes then and judge which interval it is positioned at, the sum of interior nodes between recording areas, at last with the node sum, block information, information such as interval interior nodes number are formed character string and are preserved with the form of text, i.e. " zero watermark ", 00,220,060,600,000,000,000,000,000,800,002,800,002,100,000,000,000,000,003 60,000,220,000,070,000,280,000,040,000,380,001,400,000,990,000,550,000,020 00,000,000,144,000,302,000,314,000,196,000,012,000,000,000,037,000,218,000 25,800,028,000,007,100,001,800,000,000,000,000,000,000,000,300,008,500,002 6.
Step 9: preserve embed watermark data afterwards.The parameter information that adopts during according to reading of data writes Data Elements in the middle of the new data file, obtains the vector data file of moisture official seal breath.
2, at the multiple digital watermark extracting method of GIS vector data.
Carry out watermark information after embedding finishes and extract checking.The essence of this part is the inverse process of telescopiny, is the workflow of extracting method as Fig. 2, and different with telescopiny is not need to carry out " going common edge " to handle when the data pre-service.Concrete steps are as follows:
Step 1: the reading and pre-service of carrier data.
1) utilize the increase income function reading of plug-in unit of MapWinGIS to read and contain the watermark carrier data accordingly, the data after promptly Fig. 3 handles through above-mentioned telescopiny.It is the face data in the GIS vector data.
2) data pre-service: the sequence node in the reading face data is List<IFMEOPoint with data organization〉self-defined structure of [], be designated as S0, each List object all is a sequence node in the polygon key element.
Step 2: extract zero watermark.
The key character of this link utilization input data S0 is constructed watermark information.Detailed process is as follows:
1) all nodes among the traversal S0 obtain its locus distribution maximum magnitude D;
2) obtain adding up interval number C (C=6 * 6) according to the horizontal piece number H in the configuration parameter, vertical piece number Z;
3) with 1) in D be divided into C sub-range, and store the bounds in each sub-range;
4) travel through all nodes, judge which sub-range this node belongs to, the node sum Ccount that this is interval increases by 1;
5) according to the node sum, add up interval number, each node number structure " zero watermark " W0 in interval, and save as physical file.
Step 3: odd extracts watermark.
The processing procedure of algorithm is as follows:
1) gets key element node set S0j (0<=j<n), and, obtain M, and M is added into watermark character string W1 successively to the complementation of node number;
2) according to the rule parsing W1 of system in advance, obtain copyright mark watermark W1.
Step 4: (0<=j<n) carries out the general gram compression method compression of Douglas, and (0<=j<n) is as the input data of next stage for the sequence node R0j after obtaining simplifying to S0j.
Step 5: horizontal ordinate DWT low frequency additive algorithms is extracted watermark.At first choose R0j (the summit composition data sequence among 0<=j<n) in proper order according to 8 one group, by this data sequence being carried out wavelet transform (DWT), isolate basic, normal, high three kinds of coefficient of frequencies, on low frequency coefficient, extract watermark information then, obtain watermark information W2.
Step 6: horizontal ordinate spatial domain least significant bit (LSB) is replaced algorithm and is extracted watermark.Directly (utilize least significant bit (LSB) to replace algorithm in the horizontal ordinate sequence of 0<=j<n) and extract watermark information, and the copyright mark information that the obtains W3 of parsing according to the parameter that reads at R0j.
Step 7: ordinate DCT low frequency additive algorithms is extracted watermark information.With step 5, only what carry out is the discrete cosine transform of ordinate to this step, extracts watermark information then from low frequency coefficient to carrier data (R0j (0<=j<n)), and resolves and obtain copyright mark information W4.
Step 8: ordinate DCT intermediate frequency additive algorithms is extracted watermark information.With step 5, only what carry out is the discrete cosine transform of ordinate to the carrier data of this step (R0j (0<=j<n)), extracts watermark information then from intermediate frequency coefficient, and resolves and obtain copyright mark information W5.
Step 9: utilize editing distance to calculate the similarity between W0, W1, W2, W3, W4, the W5 in twos and accept or reject, draw the optimum W (11000100110011111 as a result that extracts ... 100111) be original copyright information " Nanjing Normal University " after the reduction.
3, test and analysis.
Method proposed by the invention is the integrated of algorithm, adopts this method to develop and realizes the multiple digital watermarking system of GIS vector data.
(1) coordinate system transformation is attacked
The data that will contain watermark are carried out coordinate conversion, because the coordinate system conversion can cause the coordinate of the point of element that slight variation all takes place, therefore the algorithm of embed watermark can not extract watermark by changing coordinate, but this attack can not influence the watermark extracting of odd, zero watermarking algorithm.Experiment shows that the extraction ratio of odd and zero watermarking algorithm all reaches 100%, so the present invention can resist the coordinate system transformation attack.
(2) cutting is attacked
Moisture printing is attacked according to carrying out cutting, and effect as shown in Figure 4.By the algorithm principle analysis as can be known, the embedding carrier of watermark is to meet all polygons of strategy at interval, is equally distributed so embed polygon in all polygons.Therefore, even if be subjected to shearing attack in a big way, as long as it is to belong to the embedding polygon that a polygon is still arranged, this method just can extract watermark so, and as the universal method among the present invention, the extraction ratio of watermark is 100% in the experiment.But because being based on global data, odd, zero watermark carry out the embedding of watermark and extraction, so do not resist the cutting attack.
(3) compression attack
To workflow Fig. 1 analysis of this method as can be known, just carrier data was carried out Douglas Pu Kefa compression before general mode embed watermark, the embedded location of watermark afterwards is some unique point in the key element.As long as compression attack is not a malice, promptly this compress mode still keeps the grown form of key element, and the inventive method can be resisted this compression attack so.The experiment of carrying out compression attack based on the Generalize compress order of ArcGIS 9.2 shows, when ratio of compression reaches 30%, still can 100% extract watermark.
(4) add the attack of making an uproar, editor's attack, the attack of increase data
This type of attack all is to carry out at the node in the carrier data, in case on a large scale carrier data is used this attack, will reduce the use value of map datum greatly so, and this has just determined this type of attack to belong to local assault.Analyze principle of the present invention as can be known, in general manner the destination object of embed watermark all is the key element object of the overall situation, that is to say that watermark is uniformly distributed in the carrier data, so this type of local assault can not influence the normal extraction of watermark.Experimental result shows that the comprehensive extraction result of these three kinds of attacks has reached 100%.
To sum up analysis, the embedding of inside of the present invention can not cause interference each other with extracting method and conflict, and these methods can be had complementary advantages on the contrary, effectively improve robustness, thereby effectively protect the GIS vector data in producing, propagate, using.