CN106204559B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN106204559B
CN106204559B CN201610513911.3A CN201610513911A CN106204559B CN 106204559 B CN106204559 B CN 106204559B CN 201610513911 A CN201610513911 A CN 201610513911A CN 106204559 B CN106204559 B CN 106204559B
Authority
CN
China
Prior art keywords
brightness value
poisson
image
random number
pixel
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201610513911.3A
Other languages
Chinese (zh)
Other versions
CN106204559A (en
Inventor
朱洪波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201610513911.3A priority Critical patent/CN106204559B/en
Publication of CN106204559A publication Critical patent/CN106204559A/en
Application granted granted Critical
Publication of CN106204559B publication Critical patent/CN106204559B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Abstract

The present invention discloses a kind of image processing method and device.Method includes: the preset number block for being divided into described image and not overlapping, and each piece of displacement according to horizontal and/or vertical movable random numerical value forms migrated image;Affine deformation is carried out to the migrated image, forms target image;The prospect character of the target image is substituted with the poisson noise of the first Poisson constant, the background of the target image is substituted with the poisson noise of the second Poisson constant, first Poisson constant is greater than second Poisson constant.Using the picture validation code that technical solution provided by the invention obtains, the difficulty of robot program's identification can be largely increased, so that robot program effectively be avoided to carry out a large amount of improper uses to Internet resources.

Description

Image processing method and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of image processing methods and device.
Background technique
Also challenge is brought while the development of internet offers convenience to masses.Some use robot for private interests Program carries out a large amount of improper uses to Internet resources, for example a large amount of downloading free resource, mass-sending spam are even satisfied With attack so that servers go down.In order to avoid above-mentioned malicious act, server needs a kind of method to judge service user It is people or robot program, picture validation code comes into being precisely in order to solving this problem.Picture validation code is that one kind contains There is the picture of character, by the picture validation code of particular procedure, can increase robot program in the case where people can identify and know Other difficulty.
In current technology, mostly uses change the processing means such as font color to form picture validation code greatly, be easier It is identified by robot program, so that robot program can not effectively be avoided to carry out a large amount of improper uses to Internet resources.
Summary of the invention
In view of this, can largely increase robot the present invention provides a kind of image processing method and device The difficulty of procedure identification, so that robot program effectively be avoided to carry out a large amount of improper uses to Internet resources.
To achieve the above object, the invention provides the following technical scheme:
A kind of image processing method, described image include prospect character and background, which comprises
Described image is divided into the preset number block not overlapped, each piece mobile according to horizontal and/or vertical The displacement of random number forms migrated image;
Affine deformation is carried out to the migrated image, forms target image;
The prospect character of the target image is substituted with the poisson noise of the first Poisson constant, by the target figure The background of picture is substituted with the poisson noise of the second Poisson constant, and it is normal that first Poisson constant is greater than second Poisson Number.
Preferably, described that described image is divided into the preset number block not overlapped, each piece according to horizontal and/or vertical Displacement of the histogram to movable random numerical value forms migrated image, comprising:
Described image is divided into the preset number block not overlapped;
Each piece of corresponding first random number is obtained, random number corresponding with first random number is calculated;
The each piece of displacement according to the mobile corresponding random number of horizontal and/or vertical, described in formation Migrated image.
Preferably, described that affine deformation is carried out to the migrated image, form target image, comprising:
The brightness value of all pixels of a new images is set as predetermined luminance value, the shapes and sizes of the new images with The migrated image is consistent;
According to preset formula, the corresponding target in the new images of each pixel in the determining migrated image is calculated Pixel;
The brightness value of each object pixel is replaced with into the object pixel corresponding picture in the migrated image The brightness value of element, forms the target image.
Preferably, the prospect character by the target image is substituted with the poisson noise of the first Poisson constant, Include:
Determine the type of brightness value in the prospect character all pixels;
It is the Poisson distribution formula of first Poisson constant using Poisson constant, calculates the general of each brightness value appearance Rate;
It is and each described brightness value and each described brightness by the whole interval division for the random number being evenly distributed The probability that value occurs distinguishes corresponding subinterval;
Corresponding second random number of each pixel of prospect character is obtained, determines the second random number institute position In the first subinterval, determine corresponding with first subinterval the first brightness value, first brightness value replaced the The current brightness value of one object pixel, the first object pixel are the corresponding pixel of second random number.
Preferably, the background by the target image is substituted with the poisson noise of the second Poisson constant, is also wrapped It includes:
Determine the type of brightness value in the background all pixels;
It is the Poisson distribution formula of second Poisson constant using Poisson constant, calculates the general of each brightness value appearance Rate;
It is and each described brightness value and each described brightness by the whole interval division for the random number being evenly distributed The probability that value occurs distinguishes corresponding subinterval;
The corresponding third random number of each pixel of the background is obtained, determines what the third random number was located at Second subinterval determines the second brightness value corresponding with second subinterval, and second brightness value is replaced the second mesh The current brightness value of pixel is marked, second object pixel is the corresponding pixel of the third random number.
A kind of image processing apparatus, described image include prospect character and background, and described device includes:
Offset module, for described image to be divided into the preset number block not overlapped, each piece according to horizontal and/or The displacement of vertical direction movable random numerical value forms migrated image;
Affine deformation module forms target image for carrying out affine deformation to the migrated image;
Poisson noise alternative module, for by the prospect character of the target image with the Poisson of the first Poisson constant Noise substitution substitutes the background of the target image with the poisson noise of the second Poisson constant, and first Poisson is normal Number is greater than second Poisson constant.
Preferably, the offset module includes:
First division unit, for described image to be divided into the preset number block not overlapped;
First computing unit calculates and first random number for obtaining each piece of corresponding first random number Corresponding random number;
Mobile unit, for each piece according to the mobile corresponding random number of horizontal and/or vertical Displacement, forms the migrated image.
Preferably, the affine deformation module includes:
Setup unit, for set a new images all pixels brightness value as predetermined luminance value, the new images Shapes and sizes it is consistent with the migrated image;
First determination unit, for calculating each pixel in the determining migrated image described according to preset formula Corresponding object pixel in new images;
First replacement unit, for the brightness value of each object pixel to be replaced with the object pixel described inclined The brightness value for moving corresponding pixel in image, forms the target image.
Preferably, the poisson noise alternative module includes:
Second determination unit, for determining the type of brightness value in the prospect character all pixels;
Second computing unit calculates every for being the Poisson distribution formula of first Poisson constant using Poisson constant A kind of probability that brightness value occurs;
Second division unit, for being and each described brightness value by the whole interval division for the random number being evenly distributed The probability occurred with each described brightness value distinguishes corresponding subinterval;
Second replacement unit is determined for obtaining corresponding second random number of each pixel of prospect character The first subinterval that second random number is located at determines the first brightness value corresponding with first subinterval, by institute The current brightness value of the first brightness value replacement first object pixel is stated, the first object pixel is corresponding for second random number Pixel.
Preferably, the poisson noise alternative module includes:
Third determination unit, for determining the type of brightness value in the background all pixels;
Third computing unit calculates every for being the Poisson distribution formula of second Poisson constant using Poisson constant A kind of probability that brightness value occurs;
Third division unit, for being and each described brightness value by the whole interval division for the random number being evenly distributed The probability occurred with each described brightness value distinguishes corresponding subinterval;
Third replacement unit, for obtaining the corresponding third random number of each pixel of the background, determine described in The second subinterval that third random number is located at determines corresponding with second subinterval the second brightness value, by described the Two brightness values replace the current brightness value of the second object pixel, and second object pixel is the corresponding picture of the third random number Element.
It can be seen via above technical scheme that compared with prior art, the present invention provides a kind of image processing method and Device.Technical solution provided by the invention handles the picture (i.e. picture validation code) for including prospect character and background, first Described image is first divided into the preset number block not overlapped, each piece according to horizontal and/or vertical movable random number The displacement of value forms migrated image, then carries out affine deformation to the migrated image, forms target image, target at this time In image, the prospect character is not continuous character, and the regularity of distribution of each sub-block of prospect character becomes not Obviously, so that robot program has certain difficulty when identifying, finally by the prospect character of the target image with the The poisson noise of one Poisson constant substitutes, and the background of the target image is replaced with the poisson noise of the second Poisson constant In generation, first Poisson constant is greater than second Poisson constant, at this point, prospect character and background parts can all thicken, Not only prospect character is not easy to identify, and background parts can also generate the interference in identification to prospect character, so as to largely The upper difficulty for increasing robot program's identification.Therefore, the picture validation code obtained using technical solution provided by the invention, can The difficulty of robot program's identification is largely increased, so that it is a large amount of effectively to avoid robot program from carrying out Internet resources Improper use.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of image processing method provided in an embodiment of the present invention;
Fig. 2 is an original image;
Fig. 3 is the migrated image provided in an embodiment of the present invention corresponding to Fig. 2;
Fig. 4 is the target image provided in an embodiment of the present invention corresponding to Fig. 3;
Fig. 5 is the image provided in an embodiment of the present invention to Fig. 4 after poisson noise substitutes;
Fig. 6 is a kind of structure chart of image processing apparatus provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real Applying mode, the present invention is described in further detail.
Embodiment
Referring to Fig. 1, Fig. 1 is a kind of flow chart of image processing method provided in an embodiment of the present invention.Described image packet Prospect character and background are included, as shown in Figure 1, this method comprises:
Described image is divided into the preset number block not overlapped by step S101, and each piece according to horizontal and/or vertical The displacement of direction movable random numerical value forms migrated image;
Optionally, the preset number should be moderate, should not be too big or too small, optionally, is equal to a × b, wherein a's takes Being worth section is [10,20], and the value interval of b is [10,20].
Specifically, it is described mobile according to horizontal and/or vertical, including three types:
It is mobile according to horizontal direction;It is mobile according to vertical direction;According to horizontally and vertically all moving.
Specifically, the step S101 includes:
Described image is divided into the preset number block not overlapped;
Each piece of corresponding first random number is obtained, random number corresponding with first random number is calculated;
Specifically, rand () function can produce pseudo random number when c language is run, optionally, pseudo random number work is obtained For first random number, by first random number divided by the first default value, then the second default value is subtracted, obtained described Random number.
The each piece of displacement according to the mobile corresponding random number of horizontal and/or vertical, described in formation Migrated image.
Specifically, each piece of position according to the mobile corresponding random number pixel of horizontal and/or vertical It moves, such as the displacement of 5 pixels (the i.e. described random number is equal to 5), forms the migrated image.
Optionally, it should be noted that the random number can also directly take 0, i.e., the described migrated image and the figure As being in visual effect.
Step S102 carries out affine deformation to the migrated image, forms target image;
Specifically, the step S102 includes:
The brightness value of all pixels of a new images is set as predetermined luminance value, the shapes and sizes of the new images with The migrated image is consistent;
Optionally, if the migrated image be black white image, color difference U and color difference V are 128, at this point, it is described preset it is bright Angle value takes 255, i.e. white.
According to preset formula, the corresponding target in the new images of each pixel in the determining migrated image is calculated Pixel;
Optionally, it is assumed that any one pixel in the migrated image (source images), its coordinate are (x, y), brightness Value is L, and coordinate is the pixel of (x, y) and the coordinate of corresponding object pixel in the new images is (x ', y '), then described default Formula are as follows:
Wherein, α and β is generally the decimal close to 0.
The brightness value of each object pixel is replaced with into the object pixel corresponding picture in the migrated image The brightness value of element, forms the target image;
Specifically, the brightness value for the pixel that coordinate in new images is (x ', y ') is changed to L, the target image is formed.
Optionally, it should be noted that α and β can also be 0, i.e.,For unit matrixAt this point, described Target image and the migrated image are the same in visual effect.
Step S103 substitutes the prospect character of the target image with the poisson noise of the first Poisson constant, will The background of the target image is substituted with the poisson noise of the second Poisson constant.
Specifically, first Poisson constant is greater than second Poisson constant, that is to say, that the prospect character and The background is substituted with the poisson noise of different Poisson constants.
Specifically, the prospect character by the target image is substituted with the poisson noise of the first Poisson constant, Include:
Determine the type of brightness value in the prospect character all pixels;
Specifically, color difference U and color difference V are 128, the brightness of each pixel if the target image is black white image Value is 0 (in black) or 255 (white).If wanting the prospect character to substitute with the poisson noise of the first Poisson constant Afterwards, it is still black white image, then is 0 and 255 in the prospect character all pixels there are two types of the types of brightness value.Certainly, It is understood that the pixel in the prospect character can take other brightness values, such as 85, and 170, in this way, if color difference U and color Poor V is 128, then take that the pixel of these brightness values is presented is grey, and only the depth of grey is different.
It is the Poisson distribution formula of first Poisson constant using Poisson constant, calculates the general of each brightness value appearance Rate;
Specifically, the Poisson distribution formula are as follows:
Wherein, x is probability variable, and λ is Poisson constant.
Assuming that λ1For the first Poisson constant, if the color difference U and color difference V of the target image are 128, prospect character is all In pixel the type of brightness value only there are two types of, 0 and 255, then because only that 2 symbols, so probability variable x value only has 0 He 1, for example in order to make white proportion higher, probability variable x above fills out the probability of 1 expression 0, fills out the probability of 0 expression 255, because It is 1 for probability summation, it is possible to which calculating determining 0 probability isAnd 255 probability isIf the mesh The color difference U and color difference V of logo image are 128, and the type of brightness value is 4 kinds in prospect character all pixels, 0,85,170 He 255, then its probability is respectively as follows:
With
It is and each described brightness value and each described brightness by the whole interval division for the random number being evenly distributed The probability that value occurs distinguishes corresponding subinterval;
Specifically, rand () function can produce range in the random number of 0-32768 being evenly distributed in c language.It is optional , by the c language rand () function generate random number whole section [0,32768] be divided into it is described each The probability that brightness value and each described brightness value occur distinguishes corresponding subinterval.For example, the color difference U of the target image It is all 128 with color difference V, if in prospect character all pixels there are two types of the types of brightness value, 0 and 255, what brightness value 0 occurred Probability is 70%, and the probability that brightness value 255 occurs is 30%, then, can divide as follows: the first, [0,32768*0.7) point The probability of other corresponding brightness value 0 and brightness value 0, (32768*0.7,32768] respectively correspond brightness value 255 and brightness value 255 probability;Or second, [0,32768*0.3) probability of brightness value 255 and brightness value 255 is respectively corresponded, (32768*0.3,32768] respectively correspond the probability of brightness value 0 and brightness value 0.
Corresponding second random number of each pixel of prospect character is obtained, determines the second random number institute position In the first subinterval, determine corresponding with first subinterval the first brightness value, first brightness value replaced the The current brightness value of one object pixel, the first object pixel are the corresponding pixel of second random number.
Specifically, such as using the first described division mode, by taking corresponding second random number of A pixel as an example, such as For (generating) random number that fruit rand () function returns in 32768*0.7 or less, it is right which is under the jurisdiction of brightness value 0 Answer subinterval [0,32768*0.7), therefore, the current brightness value of A pixel is replaced with 0;Similarly, if if rand () The current brightness value of A pixel is then replaced with 255 in 32768*0.7 or more by (generating) random number that function returns.
Specifically, the background by the target image is substituted with the poisson noise of the second Poisson constant, comprising:
Determine the type of brightness value in the background all pixels;
Specifically, color difference U and color difference V are 128, the brightness of each pixel if the target image is black white image Value is 0 (in black) or 255 (white).If after wanting the background with the poisson noise substitution of the second Poisson constant, Still it is black white image, then is 0 and 255 in the background all pixels there are two types of the types of brightness value.Of course, it is possible to manage Solution, the pixel in the background can take other brightness values, such as 85, and 170, in this way, if color difference U and color difference V are 128, then take that the pixel of these brightness values is presented is grey, and only the depth of grey is different.
It is the Poisson distribution formula of second Poisson constant using Poisson constant, calculates the general of each brightness value appearance Rate;
Specifically, the Poisson distribution formula are as follows:
Wherein, x is probability variable, and λ is Poisson constant.
Assuming that λ2For the second Poisson constant, if the color difference U and color difference V of the target image are 128, the background is all In pixel the type of brightness value only there are two types of, 0 and 255, then because only that 2 symbols, so probability variable x value only has 0 He 1, for example in order to make white proportion higher, probability variable x above fills out the probability of 1 expression 0, fills out the probability of 0 expression 255, because It is 1 for probability summation, it is possible to which calculating determining 0 probability isAnd 255 probability isIf the mesh The color difference U and color difference V of logo image are 128, and the type of brightness value is 4 kinds in the background all pixels, 0,85,170 He 255, then its probability is respectively as follows:
With
It is and each described brightness value and each described brightness by the whole interval division for the random number being evenly distributed The probability that value occurs distinguishes corresponding subinterval;
Specifically, rand () function can produce range in the random number of 0-32768 being evenly distributed in c language.It is optional , by the c language rand () function generate random number whole section [0,32768] be divided into it is described each The probability that brightness value and each described brightness value occur distinguishes corresponding subinterval.For example, the color difference U of the target image It is all 128 with color difference V, if in the background all pixels there are two types of the types of brightness value, 0 and 255, what brightness value 0 occurred Probability is 30%, and the probability that brightness value 255 occurs is 70%, then, can divide as follows: the first, [0,32768*0.3) point The probability of other corresponding brightness value 0 and brightness value 0, (32768*0.3,32768] respectively correspond brightness value 255 and brightness value 255 probability;Or second, [0,32768*0.7) probability of brightness value 255 and brightness value 255 is respectively corresponded, (32768*0.7,32768] respectively correspond the probability of brightness value 0 and brightness value 0.
The corresponding third random number of each pixel of the background is obtained, determines what the third random number was located at Second subinterval determines the first brightness value corresponding with second subinterval, and first brightness value is replaced the first mesh The current brightness value of pixel is marked, the first object pixel is the corresponding pixel of the third random number.
Specifically, such as using the first described division mode, by taking the corresponding third random number of B pixel as an example, such as For (generating) random number (the i.e. described third random number) that fruit rand () function returns in 32768*0.3 or less, this is random Number be under the jurisdiction of the corresponding subinterval of brightness value 0 [0,32768*0.3), therefore, the current brightness value of B pixel is replaced with 0;Together Reason, if if (generating) random number for returning of rand () function in 32768*0.3 or more, by the current of B pixel Brightness value replaces with 255.
Specifically, please referring to Fig. 2~Fig. 5 by taking black and white picture as an example, Fig. 2 is an original image, and Fig. 3 is that the present invention is real The migrated image corresponding to Fig. 2 of example offer is applied, Fig. 4 is the target image provided in an embodiment of the present invention corresponding to Fig. 3, Fig. 5 For the image provided in an embodiment of the present invention to Fig. 4 after poisson noise substitutes.
It should be noted that technical solution provided in an embodiment of the present invention, is all 128 figure applied to color difference U and color difference V Picture is mainly adjusted by processing of the brightness value L realization to image.
Technical solution provided in an embodiment of the present invention, to include prospect character and background picture (i.e. picture validation code) into Described image, is divided into the preset number block not overlapped, each piece is moved according to horizontal and/or vertical by row processing first The displacement of dynamic random number, forms migrated image, then carries out affine deformation to the migrated image, forms target image, this When target image in, the prospect character is not continuous character, and the distribution rule of each sub-block of prospect character Rule becomes unobvious, so that robot program has certain difficulty when identifying, finally by the prospect of the target image Character is substituted with the poisson noise of the first Poisson constant, by the background of the target image with the Poisson of the second Poisson constant Noise substitution, first Poisson constant is greater than second Poisson constant, at this point, prospect character and background parts can all become Fuzzy, not only prospect character is not easy to identify, and background parts can also generate the interference in identification to prospect character, so as to very big The difficulty of robot program's identification is increased in degree.Therefore, the picture obtained using technical solution provided in an embodiment of the present invention Identifying code can largely increase the difficulty of robot program's identification, to effectively avoid robot program to internet Resource carries out a large amount of improper uses.
In order to illustrate technical solution provided by the invention more fully hereinafter, correspond at image provided in an embodiment of the present invention Reason method, the present invention disclose a kind of image processing apparatus.
Referring to Fig. 6, Fig. 6 is a kind of structure chart of image processing apparatus provided in an embodiment of the present invention.The present invention is implemented The image processing apparatus that example provides, described image includes prospect character and background.As shown in fig. 6, the device includes:
Offset module 601, for described image to be divided into the preset number block not overlapped, each piece according to level And/or the displacement of vertical direction movable random numerical value, form migrated image;
Affine deformation module 602 forms target image for carrying out affine deformation to the migrated image;
Poisson noise alternative module 603, for by the prospect character of the target image with the first Poisson constant Poisson noise substitution substitutes the background of the target image with the poisson noise of the second Poisson constant, first pool Loose constant is greater than second Poisson constant.
Using the picture validation code that image processing apparatus provided in an embodiment of the present invention obtains, can largely increase The difficulty of robot program's identification, so that robot program effectively be avoided to carry out a large amount of improper uses to Internet resources.
Specifically, image processing apparatus provided in an embodiment of the present invention, the offset module 601 include:
First division unit, for described image to be divided into the preset number block not overlapped;
First computing unit calculates and first random number for obtaining each piece of corresponding first random number Corresponding random number;
Mobile unit, for each piece according to the mobile corresponding random number of horizontal and/or vertical Displacement, forms the migrated image.
Specifically, image processing apparatus provided in an embodiment of the present invention, the affine deformation module 602 include:
Setup unit, for set a new images all pixels brightness value as predetermined luminance value, the new images Shapes and sizes it is consistent with the migrated image;
First determination unit, for calculating each pixel in the determining migrated image described according to preset formula Corresponding object pixel in new images;
First replacement unit, for the brightness value of each object pixel to be replaced with the object pixel described inclined The brightness value for moving corresponding pixel in image, forms the target image.
Specifically, image processing apparatus provided in an embodiment of the present invention, the poisson noise alternative module 603 include:
Second determination unit, for determining the type of brightness value in the prospect character all pixels;
Second computing unit calculates every for being the Poisson distribution formula of first Poisson constant using Poisson constant A kind of probability that brightness value occurs;
Second division unit, for being and each described brightness value by the whole interval division for the random number being evenly distributed The probability occurred with each described brightness value distinguishes corresponding subinterval;
Second replacement unit is determined for obtaining corresponding second random number of each pixel of prospect character The first subinterval that second random number is located at determines the first brightness value corresponding with first subinterval, by institute The current brightness value of the first brightness value replacement first object pixel is stated, the first object pixel is corresponding for second random number Pixel.
Specifically, image processing apparatus provided in an embodiment of the present invention, the poisson noise alternative module 603 include:
Third determination unit, for determining the type of brightness value in the background all pixels;
Third computing unit calculates every for being the Poisson distribution formula of second Poisson constant using Poisson constant A kind of probability that brightness value occurs;
Third division unit, for being and each described brightness value by the whole interval division for the random number being evenly distributed The probability occurred with each described brightness value distinguishes corresponding subinterval;
Third replacement unit, for obtaining the corresponding third random number of each pixel of the background, determine described in The second subinterval that third random number is located at determines corresponding with second subinterval the second brightness value, by described the Two brightness values replace the current brightness value of the second object pixel, and second object pixel is the corresponding picture of the third random number Element.
It can be seen via above technical scheme that compared with prior art, the present invention provides a kind of image processing method and Device.Technical solution provided by the invention handles the picture (i.e. picture validation code) for including prospect character and background, first Described image is first divided into the preset number block not overlapped, each piece according to horizontal and/or vertical movable random number The displacement of value forms migrated image, then carries out affine deformation to the migrated image, forms target image, target at this time In image, the prospect character is not continuous character, and the regularity of distribution of each sub-block of prospect character becomes not Obviously, so that robot program has certain difficulty when identifying, finally by the prospect character of the target image with the The poisson noise of one Poisson constant substitutes, and the background of the target image is replaced with the poisson noise of the second Poisson constant In generation, first Poisson constant is greater than second Poisson constant, at this point, prospect character and background parts can all thicken, Not only prospect character is not easy to identify, and background parts can also generate the interference in identification to prospect character, so as to largely The upper difficulty for increasing robot program's identification.Therefore, the picture validation code obtained using technical solution provided by the invention, can The difficulty of robot program's identification is largely increased, so that it is a large amount of effectively to avoid robot program from carrying out Internet resources Improper use.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence " including one ... ", not There is also other identical elements in the process, method, article or apparatus that includes the element for exclusion.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part It is bright.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (10)

1. a kind of image processing method, described image includes prospect character and background, which is characterized in that the described method includes:
Described image is divided into the preset number block not overlapped, each piece according to horizontal and/or vertical movable random The displacement of numerical value forms migrated image;
Affine deformation is carried out to the migrated image, forms target image;
The prospect character of the target image is substituted with the poisson noise of the first Poisson constant, by the target image The background is substituted with the poisson noise of the second Poisson constant, and first Poisson constant is greater than second Poisson constant.
2. the method according to claim 1, wherein described be divided into described image the present count not overlapped Mesh block, each piece of displacement according to horizontal and/or vertical movable random numerical value form migrated image, comprising:
Described image is divided into the preset number block not overlapped;
Each piece of corresponding first random number is obtained, random number corresponding with first random number is calculated;
The each piece of displacement according to the mobile corresponding random number of horizontal and/or vertical forms the offset Image.
3. being formed the method according to claim 1, wherein described carry out affine deformation to the migrated image Target image, comprising:
The brightness value of all pixels of a new images is set as predetermined luminance value, the shapes and sizes of the new images with it is described Migrated image is consistent;
According to preset formula, the corresponding target picture in the new images of each pixel in the determining migrated image is calculated Element;
The brightness value of each object pixel is replaced with into the object pixel corresponding pixel in the migrated image Brightness value forms the target image.
4. the method according to claim 1, wherein the prospect character by the target image is with The poisson noise of one Poisson constant substitutes, comprising:
Determine the type of brightness value in the prospect character all pixels;
It is the Poisson distribution formula of first Poisson constant using Poisson constant, calculates the probability of each brightness value appearance;
It is to go out with each described brightness value and each described brightness value by the whole interval division for the random number being evenly distributed Existing probability distinguishes corresponding subinterval;
Corresponding second random number of each pixel of prospect character is obtained, determines what second random number was located at First subinterval determines the first brightness value corresponding with first subinterval, and first brightness value is replaced the first mesh The current brightness value of pixel is marked, the first object pixel is the corresponding pixel of second random number.
5. method according to any one of claims 1 to 4, which is characterized in that the back by the target image Scape is substituted with the poisson noise of the second Poisson constant, further includes:
Determine the type of brightness value in the background all pixels;
It is the Poisson distribution formula of second Poisson constant using Poisson constant, calculates the probability of each brightness value appearance;
It is to go out with each described brightness value and each described brightness value by the whole interval division for the random number being evenly distributed Existing probability distinguishes corresponding subinterval;
The corresponding third random number of each pixel of the background is obtained, determines the third random number is located at second Subinterval determines the second brightness value corresponding with second subinterval, and second brightness value is replaced the second target picture The current brightness value of element, second object pixel are the corresponding pixel of the third random number.
6. a kind of image processing apparatus, described image includes prospect character and background, which is characterized in that described device includes:
Offset module, for described image to be divided into the preset number block not overlapped, each piece according to horizontal and/or vertical The displacement of direction movable random numerical value forms migrated image;
Affine deformation module forms target image for carrying out affine deformation to the migrated image;
Poisson noise alternative module, for by the prospect character of the target image with the poisson noise of the first Poisson constant Substitution substitutes the background of the target image with the poisson noise of the second Poisson constant, and first Poisson constant is big In second Poisson constant.
7. device according to claim 6, which is characterized in that the offset module includes:
First division unit, for described image to be divided into the preset number block not overlapped;
First computing unit calculates opposite with first random number for obtaining each piece of corresponding first random number The random number answered;
Mobile unit moves the displacement of corresponding random number for each piece according to horizontal and/or vertical, Form the migrated image.
8. device according to claim 6, which is characterized in that the affine deformation module includes:
Setup unit, for set a new images all pixels brightness value as predetermined luminance value, the shape of the new images Shape and size are consistent with the migrated image;
First determination unit, for calculating each pixel in the determining migrated image in the new figure according to preset formula The corresponding object pixel as in;
First replacement unit, for the brightness value of each object pixel to be replaced with the object pixel in the deflection graph The brightness value of corresponding pixel, forms the target image as in.
9. device according to claim 6, which is characterized in that the poisson noise alternative module includes:
Second determination unit, for determining the type of brightness value in the prospect character all pixels;
Second computing unit calculates each for being the Poisson distribution formula of first Poisson constant using Poisson constant The probability that brightness value occurs;
Second division unit, for by the whole interval division for the random number being evenly distributed for each described brightness value and institute The probability for stating the appearance of each brightness value distinguishes corresponding subinterval;
Second replacement unit, for obtaining corresponding second random number of each pixel of prospect character, determine described in The first subinterval that second random number is located at determines corresponding with first subinterval the first brightness value, by described the One brightness value replaces the current brightness value of first object pixel, and the first object pixel is the corresponding picture of second random number Element.
10. according to the described in any item devices of claim 6~9, which is characterized in that the poisson noise alternative module includes:
Third determination unit, for determining the type of brightness value in the background all pixels;
Third computing unit calculates each for being the Poisson distribution formula of second Poisson constant using Poisson constant The probability that brightness value occurs;
Third division unit, for by the whole interval division for the random number being evenly distributed for each described brightness value and institute The probability for stating the appearance of each brightness value distinguishes corresponding subinterval;
Third replacement unit determines the third for obtaining the corresponding third random number of each pixel of the background The second subinterval that random number is located at determines the second brightness value corresponding with second subinterval, bright by described second Angle value replaces the current brightness value of the second object pixel, and second object pixel is the corresponding pixel of the third random number.
CN201610513911.3A 2016-06-30 2016-06-30 Image processing method and device Active CN106204559B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610513911.3A CN106204559B (en) 2016-06-30 2016-06-30 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610513911.3A CN106204559B (en) 2016-06-30 2016-06-30 Image processing method and device

Publications (2)

Publication Number Publication Date
CN106204559A CN106204559A (en) 2016-12-07
CN106204559B true CN106204559B (en) 2019-03-12

Family

ID=57464398

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610513911.3A Active CN106204559B (en) 2016-06-30 2016-06-30 Image processing method and device

Country Status (1)

Country Link
CN (1) CN106204559B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101197678A (en) * 2007-12-27 2008-06-11 腾讯科技(深圳)有限公司 Picture identifying code generation method and generation device
CN101201939A (en) * 2007-12-20 2008-06-18 腾讯科技(深圳)有限公司 Method and system for generating picture identifying code
CN101923702A (en) * 2010-08-25 2010-12-22 郝红卫 Image valid code generating method
CN102831568A (en) * 2012-08-03 2012-12-19 网易(杭州)网络有限公司 Method and device for generating verification code picture
CN104065666A (en) * 2014-07-03 2014-09-24 北京齐尔布莱特科技有限公司 Method and device for generating picture identification code
CN104637077A (en) * 2015-02-13 2015-05-20 浙江农林大学 Generation method of picture verification code based on characters drawing

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2936336A1 (en) * 2008-09-23 2010-03-26 Advanced Track Trace METHOD AND DEVICE FOR AUTHENTICATING GEOMETRIC CODES
US8739276B2 (en) * 2010-06-22 2014-05-27 Microsoft Corporation Automatic construction of human interaction proof engines

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201939A (en) * 2007-12-20 2008-06-18 腾讯科技(深圳)有限公司 Method and system for generating picture identifying code
CN101197678A (en) * 2007-12-27 2008-06-11 腾讯科技(深圳)有限公司 Picture identifying code generation method and generation device
CN101923702A (en) * 2010-08-25 2010-12-22 郝红卫 Image valid code generating method
CN102831568A (en) * 2012-08-03 2012-12-19 网易(杭州)网络有限公司 Method and device for generating verification code picture
CN104065666A (en) * 2014-07-03 2014-09-24 北京齐尔布莱特科技有限公司 Method and device for generating picture identification code
CN104637077A (en) * 2015-02-13 2015-05-20 浙江农林大学 Generation method of picture verification code based on characters drawing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CAPTCHA技术研究综述;李秋洁 等;《计算机研究与发展》;20120315;第49卷(第3期);469-480
基于多形变特征的汉字验证码的设计及实现;戴如意 等;《计算机应用研究》;20100430;第27卷(第4期);第1509页左栏最后一段-右栏(c)段
子图验证码;何培舟 等;《计算机系统应用》;20080815(第8期);22-25、33

Also Published As

Publication number Publication date
CN106204559A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
Poddar et al. Non‐parametric modified histogram equalisation for contrast enhancement
JP6266656B2 (en) System and method for resizing an image
CN107680042B (en) Rendering method, device, engine and storage medium combining texture and convolution network
CN110120021B (en) Image brightness adjusting method and device, storage medium and electronic device
JP7175197B2 (en) Image processing method and device, storage medium, computer device
Du et al. Saliency-guided color-to-gray conversion using region-based optimization
CN101572076B (en) Frame rate conversion apparatus and frame rate conversion method
CN108230333B (en) Image processing method, image processing apparatus, computer program, storage medium, and electronic device
CN111311523A (en) Image processing method, device and system and electronic equipment
Cho et al. Image quality-aware backlight dimming with color and detail enhancement techniques
US11348207B2 (en) Image processing method and apparatus, computer-readable medium, and electronic device
Alexander et al. Evolution of artistic image variants through feature based diversity optimisation
CN101201939A (en) Method and system for generating picture identifying code
US7826678B2 (en) Adaptive image sharpening method
CN108846818A (en) Remove method, apparatus, terminal and the computer readable storage medium of moire fringes
JP2015162718A (en) Image processing method, image processing device and electronic equipment
JP2017044841A5 (en)
CN108304839A (en) A kind of image processing method and device
CN110347456B (en) Image data processing method, device, computer equipment and storage medium
CN108829497A (en) The bearing calibration of affairs causal ordering and device, electronic equipment
CN106204559B (en) Image processing method and device
CN109472874B (en) Display method, display device, VR display device and storage medium
CN110675345A (en) Fuzzy completion processing method and device for remote sensing image to-be-repaired area
CN112202963A (en) Mobile banking peep-proof screen method and device, storage medium and electronic equipment
Schwarz et al. On predicting visual popping in dynamic scenes

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant