Background technology
E-seal is meant: with the seal digitized processing, and by the numerical information encryption of security means to seal, in safe and reliable mode digitized seal is stored, uses and manages.Its management and use-pattern meet the custom and the experience of seal in kind, and the e-file of adding a cover by E-seal has the identical outward appearance of the paper document of adding a cover with seal in kind, identical validity and similar use-pattern.
E-seal is to store with the form of digital picture, and the characteristics of digital technology are exactly accurate, transreplication.Therefore, the complete seal pattern of E-seal is easy to be obtained by modes such as copy screens by the imitator.This authority and security for E-seal is very big threat.Therefore, in the application of E-seal, generally need do certain virtualization and handle the seal that shows, make that the image of seal is clear inadequately, and certain difference degree is arranged, thereby make the imitator directly to obtain the seal pattern by modes such as screen interceptions with original seal pattern.
The virtualization here just is meant a kind of treatment technology to E-seal, but the E-seal after the virtualization had both had identification capability, has the ability that prevents to copy, be difficult to be reduced into the original electron seal image again.
The image virtualization technology that is used for electric seal weakening is a kind of image processing techniques, has utilized the multiple technologies means in the Flame Image Process, makes the virtualization process have following characteristics:
1) virtualization degree self-adaptation is exactly the degree that can adjust virtualization according to the precision of image, can obtain the close virtualization result of degree for distinct image and unsharp image;
2) virtualization effect user acceptance is good, and virtualization can not make that image can not identification, can not make image keep too complete so that easy recuperating original image;
3) virtualization need be handled at various image types, comprises colour, monochrome, gray scale etc.
Yet, adopt general image virtualization technology to be generally used for handling realistic coloured image usually, and seal generally all is monochromatic in the practical application.In fact the color of tradition seal in kind is exactly the color of ink paste, common red blueness etc., so the seal virtualization generally is done virtualization to monochrome image with exactlying, so-called monochrome image is meant that the pixel in the image has 2 kinds of colors, 1 represents foreground, 0 represents background colour.Foreground generally is exactly certain colour, and entire image all is same foreground and background colour.For seal, generally be exactly the red foreground that is, white is background colour.Therefore, adopt general image virtualization technology unsatisfactory to E-seal treatment of picture effect usually, the E-seal image after the processing usually can be because distortion and can't identification.
And, in the existing electric seal weakening process, need the user to come the blur level of identification and definite virtualization, thereby make the virtualization of E-seal have subjectivity by naked eyes, make that the virtualization degree is not accurate enough.
As seen, the reliability of existing electric seal weakening is lower.
Summary of the invention
In view of this, a fundamental purpose of the present invention is, a kind of electric seal weakening method is provided, and can improve the reliability of seal virtualization.
A fundamental purpose according to above-mentioned the invention provides a kind of electric seal weakening method, may further comprise the steps:
According to predefined digital picture parameter, dwindle the original image of the E-seal that obtains;
According to predefined digital picture parameter, amplify the E-seal image after dwindling.
Described digital picture parameter is: image size and/or resolution.
Described during according to predefined image size reduction E-seal image, dwindle before the original image of the E-seal that obtains, this method further comprises: whether judge predefined image size less than the original image size, if then carry out the original image that dwindles the E-seal that obtains; Otherwise, predefined image size is adjusted into numerical value less than the original image size, carry out the original image that dwindles the E-seal that obtains then.
The described numerical value that predefined image size is adjusted into less than the original image size is: with original image size and predefined product less than 1 numerical value as adjusted described image size.
Described when dwindling the original image of E-seal according to predefined resolution, dwindle before the original image of the E-seal that obtains, this method further comprises: according to predefined resolution, image size after the original image of determining the E-seal that obtains dwindles, and the original image of the E-seal that obtains according to the image size reduction of determining.
Described according to predefined resolution, image size after the original image of determining the E-seal that obtains dwindles is: with the merchant of predefined resolution and original image resolution, obtain image size after product dwindles as described original image with multiplying each other of original image size again.
Before the described original image that dwindles the E-seal that obtains, this method further comprises: whether the image size and resolution after the original image of the E-seal that judgement is obtained dwindles is in the predefined span, if then carry out the original image that dwindles the E-seal that obtains.
When image size after the original image of judging the E-seal that obtains dwindles and/or resolution were in outside the predefined span, this method further comprised:
If image size after the original image of the described E-seal that obtains dwindles and/or resolution surpass the upper limit of span, then exceed the image size of span and/or the upper limit that resolution is set to described span; If image size after the original image of the described E-seal that obtains dwindles and/or resolution surpass the lower limit of span, then exceed the image size of span and/or the lower limit that resolution is set to described span; Carry out the original image that dwindles the E-seal that obtains then.
Before the described original image that dwindles the E-seal that obtains, this method further comprises: the image size after the original image of the E-seal that judgement is obtained dwindles and the image magnitude proportion of original image, whether be in the predefined image size span, if then carry out the original image that dwindles the E-seal that obtains.
The image size after the original image of judging the E-seal that obtains dwindles and the image magnitude proportion of original image, when being in outside the predefined image size span, this method further comprises:
The image size that exceeds span is set to the span border numerical value with the immediate image size of its numerical value, and determine image size after needs dwindle the original image of the E-seal that obtains according to the image size of resetting, carry out the described original image that dwindles the E-seal that obtains then.
This shows, the present invention sets in advance the cognizable digital picture parameter of E-seal image after the assurance virtualization, and according to the digital picture parameter, the E-seal image is dwindled, give up a certain proportion of pixel information in the image, according to remaining pixel information, image is amplified to required size again, handles with the virtualization that realizes the E-seal image.The inventive method does not adopt the image processing algorithm at coloured image, does not pass through subjective judgement virtualization degree in the virtualization process yet, has improved the reliability of electric seal weakening.
Embodiment
Basic thought of the present invention is: set in advance the cognizable digital picture parameter of E-seal image that guarantees after the virtualization, and according to the digital picture parameter, the E-seal image is narrowed down to suitable degree be amplified to required size again, thereby the virtualization that realizes the E-seal image is handled.
Wherein, the E-seal image is the digital picture of binaryzation.
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
Fig. 1 is the exemplary process diagram of electric seal weakening method among the present invention, and as shown in Figure 1, the electric seal weakening method among the present invention may further comprise the steps:
Step 101 according to predefined digital picture parameter, is dwindled the E-seal original image that obtains;
Step 102 according to predefined digital picture parameter, is amplified the E-seal image after dwindling.
In the above-mentioned flow process, when dwindling, can realize according to any one existing digital image scaling method and image processing and amplifying method respectively with the amplification electron seal image; After step 101 has been dwindled the E-seal original image, lost a certain proportion of pixel information in the original image, in step 102, carry out image then and amplify according to remaining pixel information, promptly realized the virtualization of E-seal.
Wherein, predefined digital picture parameter is: and image size and/or resolution (Dot Per Inch, DPI) etc.; The image size, i.e. the length of image and width are meant the quantity of the pixel that every row in the digital picture or every row comprise; DPI is meant the pixel quantity that comprises in the inches.
Predefined image size comprises again: the restore target width/height of the picture traverse/length after the image amplification of dwindling target width/length, representing to dwindle of the picture traverse/length after expression is dwindled; Predefined DPI comprises again: the restore target width/height of the image resolution ratio after the image amplification of dwindling target resolution, representing to dwindle of the image resolution ratio after expression is dwindled.
Among the present invention, can determine that the degree of dwindling determines the degree of dwindling of E-seal image according to image size and/or DPI.
For example, with the E-seal original image that obtains, directly the mode by the length and width geometric ratio is reduced into the predefined target width that dwindles; Perhaps earlier determine to dwindle target width according to predefined DPI, again with the E-seal original image that obtains, the mode by the length and width geometric ratio is reduced into definite target width that dwindles, determine the target reduced width process can for:
Target reduced width=(the predefined target resolution * original image width that dwindles)/original image resolution.
In flow process as shown in Figure 1, predefined image size or DPI, also can image dwindle or amplification process in adjust size that can not surpass original image with E-seal image size after guaranteeing to dwindle and/or resolution and/or resolution etc.
For example, under situation according to image size reduction E-seal image, the original image of E-seal is when obtaining, its width is set to 80, and the target width that dwindles that sets in advance is 100, at this moment, just need dwindle target width by a dimensional parameters adjustment that sets in advance, make and dwindle target width that the image size after guaranteeing to dwindle can not surpass the original image size less than the original image width.
Again for example, dwindling according to resolution under the situation of E-seal image, if dwindle the width of target width greater than the E-seal original image by what dwindle that target resolution determines, also can be by the definite target width of dimensional parameters adjustment that sets in advance, perhaps adjust the target resolution that dwindles that sets in advance, the image size after guaranteeing to dwindle can not surpass the original image size.
According to predefined digital picture parameter the E-seal image is dwindled and processing and amplifying, though can realize the virtualization of E-seal by the loss Pixel Information, if but the Pixel Information of loss is too much, then can cause the E-seal image fault after the virtualization; If the Pixel Information of loss is too small, then can cause the virtualization DeGrain.And, because image size=image physical size * DPI, if with a parameter among image size and the DPI as image zoom, then another also can the image physical size variation and change, may make under the situation of the reasonable value of only considering one of them parameter, and make another parameter excessive or too small.
Therefore, for fear of in processing procedure, determine or adjusted image size and/or DPI excessive or too small, cause above-mentioned bad result, can be that image size and/or DPI set a span.
If image size and/or DPI have exceeded predefined span, then can adjust.For example, if greater than the higher limit of span, then image size and/or DPI are set to this higher limit, if less than the lower limit of span, then image size and/or DPI are set to this lower limit.
For fear of in processing procedure, determine or adjusted image size and/or DPI excessive or too small, can also be the image size after dwindling, i.e. length or width, and/or a span of ratio setting of dwindling target resolution and original image.Like this, can guarantee that the pixel information of losing accounts for the ratio of pixel information in the original image in reasonable range in the process of dwindling.If the image after dwindling size and/or the ratio of dwindling target resolution and original image have exceeded predefined span, also carry out the adjustment of relevant parameter.
In the practical application, can be as required, one or more the combination in any in the above-mentioned span is set.
Below, in conjunction with specific embodiments, the electric seal weakening method among the present invention is elaborated.
Fig. 2 is the process flow diagram of electric seal weakening method in the embodiment of the invention.As shown in Figure 2, the electric seal weakening method in the present embodiment may further comprise the steps:
Step 201, the span of dwindling target width W1 and dwindling target resolution DPI1, restore target width W 2 and restore target resolution DPI2 and dwindling target width W1 and/or dwindle target resolution DPI1 of setting E-seal image.
In this step, dwindling target width W1 and dwindling target resolution DPI1 of setting is an initial value, in follow-up processing procedure, if to dwindle target width W1 and a parameter of dwindling among the target resolution DPI1 as image zoom, then another also can change thereupon, make the excessive or too small situation of another parameter occur for fear of the reasonable value of only considering one of them parameter, also need to set the span (W that dwindles target width W1
MAX, W
MIN) and/or dwindle the span (DPI of target resolution DPI1
MAX, DPI
MIN); And, dwindle target width W1 and/or dwindle target resolution DPI1 and in follow-up processing procedure, may adjust, therefore, the span that setting is dwindled target width W1 and/or dwindled target resolution DPI1, can also guarantee that adjusted dwindle target width W1 and/or dwindle target resolution DPI1 can be not excessive or too small, thereby the E-seal image after making virtualization handle can distortion.
In this step, excessive or too small for fear of the image zoom ratio, can also set the convergent-divergent threshold interval.Scaling can and dwindle target width according to former width and calculate, i.e. WR=W1/W0; Can also and dwindle target resolution according to former resolution and calculate, be i.e. DPIR=DPI1/DPI0.Like this, respectively at two kinds of scalings, set two convergent-divergent threshold interval (WR respectively
MAX, WR
MIN) and (DPIR
MAX, DPIR
MIN).
Step 202 is obtained the E-seal image.
In this step, can intercept the E-seal image, also can obtain by the mode of image scanning by the mode of screen copy; When obtaining the E-seal image, can set the life size W0 and the former resolution DPI0 of image; Generally, DPI0 is 300 or 600; The E-seal image that obtains can be the binaryzation digital picture.
Step 203, the parameter of E-seal image institute foundation is dwindled in selection, dwindles the E-seal image according to the target width W1 that dwindles that sets if desired, and then execution in step 204; Dwindle the primary electron seal image according to the target resolution DPI1 that dwindles that sets if desired, then execution in step 205.
If only set dwindling target width W1 and dwindling among the target resolution DPI1 one after dwindling in step 201, then do not need to carry out this step, but direct execution in step 204 or step 205 respectively.
Whether step 204, the former width W 0 of judging the primary electron seal image obtain dwindle target width W1 greater than what set, if then execution in step 207; If not, then execution in step 206.
Step 205, former width W 0 and former resolution DPI0 according to predefined resolution coefficient S, image determine to dwindle target width W1, and execution in step 207.
If set in step 201 and to have dwindled target width W1, this step still needs to determine this parameter, and adopt in subsequent processes that this step determines dwindle target width W1; Determine in this step to dwindle target width W1 process can for:
W1=(S×W0)/DPI0
Wherein, S is a resolution value less than restore target resolution DPI0; If dwindle target resolution DPI1 less than former resolution, then S also can replace with and dwindle target resolution DPI1.
Step 206 according to predefined size factor α, is adjusted the size of dwindling target component W1, and execution in step 207 then.
In this step, size factor α be one less than 1 coefficient, for example 0.75, make W1=W1 * α, if adjusted W1 still greater than former width W, then proceeds to adjust, till former width W is greater than W1; Also can directly make W1=W * α.
Step 207 judges to dwindle target width W1 and dwindle target resolution DPI1 whether be in the span of setting, if both all are in the span, then execution in step 209, otherwise, execution in step 208.
Step 208 according to the predefined span of dwindling target width W1 and/or dwindling target resolution DPI1, is adjusted and is dwindled target width W1 and/or dwindle target resolution DPI1, and execution in step 209.
In this step, adjustment dwindle target width W1 and/or dwindle target resolution DPI1 process can for: exceed dwindling target width W1 and/or dwindle target resolution DPI1 and being set to and the immediate span of its numerical value border numerical value of span, if promptly parameter is greater than the higher limit of its scope of getting, then be the higher limit of the scope of getting with this parameter setting; If parameter less than the lower limit of its scope of getting, then is the lower limit of the scope of getting with this parameter setting.
For example, if W1<W
MIN, then make W1=W
MINIf DPI1>DPI
MAX, then make DPI=DPI
MAX
This step adjusted dwindle target width W1 and/or dwindle target resolution DPI1 after, also execution in step 209 not, but return step 204 or step 205, rejudge adjusted dwindle target width W1 and/or dwindle target resolution DPI1 whether satisfy condition.
Step 209 is calculated scaling, and is judged whether scaling is in the predefined convergent-divergent threshold interval, if then execution in step 211, otherwise execution in step 210.
In this step, scaling comprises scaling WR that calculates according to picture traverse and the scaling DPIR that calculates according to resolution.
Step 210 according to predefined convergent-divergent threshold interval, is adjusted and is dwindled target width W1 and/or dwindle target resolution DPI1, and execution in step 211.
In this step, adjustment dwindle target width W1 and/or dwindle target resolution DPI1 process can for: the scaling that exceeds span is set to and the immediate threshold interval of its numerical value border numerical value, if promptly scaling is greater than the higher limit of threshold interval, then scaling is set at higher limit, if scaling then is set at lower limit with scaling less than the lower limit of threshold interval.Then, according to the scaling that resets and former width W 0 or former resolution DPI0, redefine and dwindle target width W1 and/or dwindle target resolution DPI1.
For example, if WR<WR
MIN, then make WR=WR
MINIf DPIR>DPIR
MAX, then make DPIR=DPIR
MAX, then, according to former width W 0 and the WR that resets or former resolution DPI0 and the DPIR that resets, redefine W1 or DPI1 again.
This step adjusted dwindle target width W1 and/or dwindle target resolution DPI1 after, also execution in step 211 not, but return step 204 or step 205, rejudge adjusted dwindle target width W1 and/or dwindle target resolution DPI1 whether satisfy condition.
Step 211, according to the mode of length and width uniform zoom, it is that W1, resolution are the digital picture of DPI1 that the E-seal image that obtains is reduced into width.
This step is dwindled the process of E-seal image, can realize according to any one existing digital image scaling method; After having carried out this step, the pixel information in the original image only has been left (100 * W1
2/ W0
2) %.
Step 212, according to the mode of length and width uniform zoom, it is that W2, resolution are the digital picture of DPI2 that the E-seal image after will dwindling is enlarged into width.
This step is amplified the process of the E-seal image after dwindling, and can realize according to any one existing digital picture processing and amplifying method.
In the E-seal image after dwindling, only kept (100 * W1 in the original image
2/ W0
2) the pixel information of %, therefore, the processing and amplifying in this step is based on (100 * W1
2/ W0
2) the pixel information of % is carried out, thereby the image that obtains is the E-seal image after the virtualization.
So far, this flow process finishes.
Present embodiment also can according to set in advance dwindle target width W1, dwindle target resolution DPI1 and original image width W 0, the ratio of original image resolution DPI0, determine to dwindle target width W1 and dwindle target resolution DPI1, thereby dwindle the E-seal image.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of being done, be equal to and replace and improvement etc., all should be included within protection scope of the present invention.