An image processing method, apparatus, electronic device, and storage medium

By dividing the image into multiple regions and using asynchronous threads to generate and delete interference regions, the image content is dynamically interfered with, solving the problem that CAPTCHAs are easily recognized by machines and improving the security of CAPTCHAs.

CN115512101BActive Publication Date: 2025-12-12CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211008606.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-22
Publication Date
2025-12-12
Estimated Expiration
2042-08-22

AI Technical Summary

Technical Problem

The verification methods for CAPTCHAs in existing technologies are relatively fixed, which makes them more likely to be recognized by machines and less secure.

Method used

By employing dynamic interference, the target image is divided into multiple regions. An asynchronous thread generates and deletes interference regions in each region, forming dynamic interference to cover the verification information.

Benefits of technology

Without compromising image verification information, this approach reduces machine recognition rates, increases the difficulty of user verification, and enhances the security of the verification method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115512101B_ABST
    Figure CN115512101B_ABST
Patent Text Reader

Abstract

The application provides an image processing method and device, electronic equipment and storage medium. The method comprises: acquiring a target image; dividing the target image into a plurality of image regions; for each image region, determining a target region in the image region; the target region comprises verification information; processing the target region in an alternating manner of a first processing manner and a second processing manner; the first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region; the interference region is used to cover the target region. By using the dynamic interference manner, the interference of the target image is formed. In this way, the recognition rate of the machine can be reduced, the verification information in the image is not lost, the necessity of the user to verify is improved, and the security of the verification manner provided by the embodiment of the application is higher.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to an image processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the rapid development of computer technology, computers can now replace manual operations in more and more aspects, which is a double-edged sword in liberating labor. Currently, there are malicious machines with programs that improperly use network resources.

[0003] The appearance of the verification code is to distinguish whether the input operation on the page is performed by a user or a mechanical code programming. The verification method in the related art is usually picture verification, dragging a picture, clicking a prompt, etc. The verification code in these verification methods in the related art is relatively fixed, which leads to a high possibility of being recognized by a machine, that is, the security of the verification method in the related art is low. SUMMARY

[0004] To solve the above technical problems, the present application shows an image processing method, device, electronic equipment and storage medium.

[0005] In a first aspect, an image processing method is provided according to an embodiment of the present disclosure, comprising:

[0006] obtaining a target image; the target image includes verification information;

[0007] dividing the target image into a plurality of image regions;

[0008] for each image region, determining a target region in the image region; the target region includes the verification information;

[0009] processing the target region in an alternating manner of a first processing manner and a second processing manner; the first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region, and the interference region is used to cover the target region.

[0010] Optionally, for each image region, determining a target region in the image region comprises:

[0011] for each image region, determining a target start position and a target end position in the image region through a thread corresponding to the image region; the threads corresponding to different image regions are different;

[0012] determining a target region position in the image region based on the target start position and the target end position;

[0013] determining a region corresponding to the target region position as the target region.

[0014] Optionally, the determining, for each image region, a target start position and a target end position in the image region by the thread corresponding to the image region, comprises:

[0015] dividing, for each image region, the image region into a first number of sub-image regions by the thread corresponding to the image region;

[0016] determining a start position of any target sub-image region in the first number of sub-image regions, and determining the start position of the target sub-image region as the target start position;

[0017] determining a start position of a second number of sub-image regions after the target start position as the target end position; the second number is determined based on a ratio of an area of the target region to an area of the image region.

[0018] Optionally, the determining a start position of any target sub-image region in the first number of sub-image regions, and determining the start position of the target sub-image region as the target start position, comprises:

[0019] numbering the first number of sub-image regions according to an order of the first number of sub-image regions in the image region;

[0020] determining a start position of any target sub-image region in the first number of sub-image regions, and determining the start position of the target sub-image region as the target start position;

[0021] Optionally, the method further comprises:

[0022] if a number corresponding to the second number of sub-image regions after the target start position is greater than the maximum number, calculating a difference between a number of a sub-image region corresponding to the target start position and a third number to obtain a target number; the third number is determined based on a difference between the first number and the second number;

[0023] determining an end position of a sub-image region corresponding to the target number as the target end position.

[0024] Optionally, the method further comprises:

[0025] adding a plurality of pixel points on the target region; the plurality of pixel points have identification information, and a pixel value corresponding to each pixel point is determined randomly;

[0026] The region composed of the plurality of pixel points is determined as an interference region.

[0027] Optionally, deleting the interference region on the target region comprises:

[0028] determining a pixel point with the identification information on the target region;

[0029] deleting the pixel point with the identification information on the target region.

[0030] According to a second aspect of the embodiments of the present disclosure, an image processing apparatus is provided, comprising:

[0031] an image obtaining module, configured to obtain a target image; the target image comprises verification information;

[0032] an image dividing module, configured to divide the target image into a plurality of image regions;

[0033] a region determining module, configured to determine, for each image region, a target region in the image region; the target region comprises the verification information;

[0034] an image processing module, configured to process the target region in an alternating manner of a first processing manner and a second processing manner; the first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region; the interference region is used to cover the target region.

[0035] Optionally, the region determining module is specifically configured to:

[0036] for each image region, determine a target start position and a target end position in the image region through a thread corresponding to the image region; threads corresponding to different image regions are different;

[0037] determine a target region position in the image region based on the target start position and the target end position;

[0038] determine a region corresponding to the target region position as a target region.

[0039] Optionally, the region determining module is further specifically configured to:

[0040] for each image region, divide the image region into a first number of sub-image regions through a thread corresponding to the image region;

[0041] determine a start position of any target sub-image region in the first number of sub-image regions, and determine the start position of the target sub-image region as a target start position;

[0042] determine a starting position of a target sub-image region in the first number of sub-image regions as the target starting position.

[0043] Optionally, the region determining module is further configured to:

[0044] number the first number of sub-image regions according to an order of the first number of sub-image regions in the image region;

[0045] determine a starting position of any target sub-image region in the first number of sub-image regions, and if the starting position of the target sub-image region is equal to a starting position of a sub-image region with a maximum number, determine a starting position of a sub-image region with a minimum number as the target starting position.

[0046] Optionally, the position determining module is further configured to:

[0047] if a number corresponding to a second number of sub-image regions after the target starting position is greater than the maximum number, calculate a difference between a number corresponding to the target starting position and a third number to obtain a target number, the third number being determined based on a difference between the first number and the second number;

[0048] determine an ending position of a sub-image region corresponding to the target number as a target ending position.

[0049] Optionally, the image processing module is configured to:

[0050] add a plurality of pixel points on the target region, the plurality of pixel points having identification information, and a pixel value corresponding to each pixel point being determined randomly;

[0051] determine a region composed of the plurality of pixel points as an interference region.

[0052] Optionally, the image processing module is configured to:

[0053] determine a pixel point with the identification information on the target region;

[0054] delete the pixel point with the identification information on the target region.

[0055] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the image processing method of the first aspect when executing the program.

[0056] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of the image processing method in the first aspect.

[0057] The technical solution provided by the embodiments of the present disclosure includes: obtaining a target image; dividing the target image into a plurality of image regions; for each image region, determining a target region in the image region; and processing the target region in an alternating manner of a first processing manner and a second processing manner, wherein the first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region, and the interference region is used to cover the target region.

[0058] It can be seen that, by using the technical solution of the embodiments of the present application, the interference of the target image is formed in a dynamic interference manner. In this way, without damaging the verification information of the target image, the interference of each image region always exists and moves in the image region. The overall effect is that the entire target image is blocked by relatively uniform interference, and the interference of each image region moves while keeping the total area unchanged. In this way, the recognition rate of the machine can be reduced, the verification information in the image is not lost, the necessity of the user to perform verification is improved, and the security of the verification method provided by the embodiments of the present application is higher. BRIEF DESCRIPTION OF DRAWINGS

[0059] Figure 1 is a schematic diagram of an image including verification information;

[0060] Figure 2 is a flowchart of the overall technical solution provided by the embodiments of the present application;

[0061] Figure 3 is a flowchart of the steps of an image processing method provided by the embodiments of the present application;

[0062] Figure 4 is Figure 3 is a flowchart of the specific implementation of S330 in the method;

[0063] Figure 5 is Figure 4 is a flowchart of the specific implementation of S331 in the method;

[0064] Figure 6 is a structural block diagram of an image processing device provided by the embodiments of the present application;

[0065] Figure 7 is a structural block diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0066] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0067] With the rapid development of computer technology, computers can now replace manual labor in more and more aspects of operations. While freeing up manpower, this is also a double-edged sword, as there are currently cases of programmed machines maliciously and improperly using network resources.

[0068] The purpose of CAPTCHAs is to distinguish between user input on a webpage and automated code. Common verification methods include image verification, drag-and-drop image verification, and clicking on prompts. These methods use relatively fixed CAPTCHA codes, making them more susceptible to machine recognition and thus less secure.

[0069] In order to solve the above-mentioned technical problems in related technologies, this application provides an image processing method, apparatus, electronic device and storage medium.

[0070] To ensure clarity, the technical solutions provided in this application will first be described in conjunction with specific examples.

[0071] To prevent machines from replacing humans in performing operations, this application employs a dynamic asynchronous local change method to generate interference on the verification information in the image. This reduces the machine's recognition rate without losing the verification information in the image, increasing the necessity for users to perform verification. Consequently, the verification method provided by the embodiments of this application has high security.

[0072] 1. For example Figure 1 As shown, the image containing the verification information can be vertically divided into four regions of equal area, namely q1, q2, q3, and q4. The width of the image containing the verification information is W, and the height is H. Therefore, the width of each region is w = 0.25W, and the height is h = H.

[0073] 2. Four asynchronous threads can be executed once per second, each corresponding to a region, generating interference objects of the same area in each of the four regions. The region h can be divided into 100 equal parts. The height of the interference generation region is determined by a random number n within 100, and the width is w.

[0074] Assume that the area of ​​each region, qs, is 25% of the total image area; and the area of ​​the generated interference, gs, is 0.25qs. Then, the starting position of the interference can be n, and the ending position can be n+25.

[0075] And if n = 100, n is reset to 0. If n + 25 > 100, the end position is: n - 75, at this time, the interference is distributed in the top and bottom of the area, and the sum of the areas of the two blocks is 0.25qs.

[0076] It can be understood that each area is processed by different asynchronous threads, and therefore n of each area can be different.

[0077] 3. The generation of interference in each area is to add pixel points with identifier f in the generation area of the interference, until the corresponding verification code area is covered, that is, the area of the added pixel points is 0.25qs, and the pixel value of the added pixel points is randomly determined.

[0078] 4. After adding the interference in each area, the next step is to perform the interference removal operation. Specifically, for each area, the pixel points with identifier f in the area are deleted by the corresponding asynchronous thread of the area.

[0079] For each area, the generation of interference and the deletion of interference are performed by the corresponding asynchronous thread of the area, so that the effect of the interference in the area is that the interference in the area always exists and moves in the breathing state in the area. And the final overall effect is that the entire image is uniformly obscured by a total of 25% of the area, and the interference in each small area moves with variable colors while keeping the total area unchanged.

[0080] As can be seen from the above description, the flowchart of the overall technical solution provided by the embodiments of the present application is as shown in Figure 2 The image is equally divided into four areas, q1, q2, q3 and q4. For each area, the interference is generated in the manner described above, and then the interference is deleted, and the operation of generating and deleting interference is returned to the loop. The effect of the interference in the area is that the interference in the area always exists and moves in the breathing state in the area. The overall effect is that the entire image is uniformly obscured by a total of 25% of the area, and the interference in each small area moves with variable colors while keeping the total area unchanged.

[0081] As can be seen, by using the technical solution provided by the embodiments of the present application, the interference of the image including the verification information is formed in a dynamic interference manner. In this way, without damaging the verification information of the image, the interference can be uniformly generated and the interference position can be constantly changed, so that the recognition rate of the machine can be reduced, the verification information in the image is not lost, the necessity of the user to perform verification is improved, and the security of the verification manner provided by the embodiments of the present application is higher.

[0082] After the technical solutions of the embodiments of the application are described in detail, the image processing method, device, electronic equipment and storage medium provided by the embodiments of the application will be described in detail.

[0083] In the first aspect, the image processing method provided by the embodiments of the application will be described in detail.

[0084] As shown in the image provided in Figure 3 The image processing method provided by the embodiments of the application can include the following steps:

[0085] S310, obtaining a target image.

[0086] The target image includes verification information.

[0087] Specifically, the target image can be the image shown in Figure 1 The verification information included in the target image can be letters, numbers, and characters, and the embodiments of the present disclosure do not make specific limitations on this.

[0088] S320, dividing the target image into multiple image regions.

[0089] Specifically, the target image can be divided into multiple image regions vertically, or the target image can be divided into multiple image regions horizontally. Both are reasonable, and the embodiments of the present application do not make specific limitations on this.

[0090] In addition, the number of image regions can be determined according to actual conditions, for example, the number of image regions can be 4, and the areas of the multiple different image regions can be the same or different, which is reasonable.

[0091] For example, as shown in the image provided in Figure 1 The image including the verification information can be divided into four areas with the same area vertically, which are q1, q2, q3 and q4. Among them, the width of the image including the verification information is W, and the height is H, then the width of each region w = 0.25W, and the height h = H.

[0092] S330, for each image region, determining a target region in the image region.

[0093] The target region includes verification information.

[0094] Specifically, after the target image is divided into multiple image regions, for each image region, a target region can be determined in the image region. The target region includes verification information, and the target region is the region for generating interference in the subsequent.

[0095] For the completeness and clarity of the scheme description, the specific implementation of determining the region position corresponding to the target region will be described in detail in the following embodiments.

[0096] S340, processing the target region in a manner of alternately processing the target region according to the first processing manner and the second processing manner.

[0097] The first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region, and the interference region is used to cover the target region.

[0098] Specifically, after the target region in each image region is determined, the region of the interference object to be generated in each image region is determined. For each image region, an interference region covering the target region in the image region can be generated, and after the interference region is generated, the operation of deleting the interference region can be started, and the interference object can be processed in a manner of alternately processing the generation of the interference object and the deletion of the interference object. In this way, the effect of the interference object in each image region is that the interference object in the image region always exists and breathes and moves in the image region. The overall effect is that the entire target image is covered by relatively uniform interference objects, and the interference object in each image region breathes and moves while keeping the total area unchanged.

[0099] The technical scheme provided by the embodiments of the present disclosure is to obtain a target image; divide the target image into a plurality of image regions; for each image region, determine a target region in the image region; and process the target region in a manner of alternately processing the target region according to a first processing manner and a second processing manner. The first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region, and the interference region is used to cover the target region.

[0100] As can be seen, by using the technical scheme of the embodiments of the present disclosure, the interference object of the target image is formed in a dynamic interference manner. In this way, without damaging the verification information of the target image, the interference object in each image region always exists and breathes and moves in the image region. The overall effect is that the entire target image is covered by relatively uniform interference objects, and the interference object in each image region breathes and moves while keeping the total area unchanged. In this way, the recognition rate of the machine can be reduced, the verification information in the image is not lost, the necessity of the user to perform verification is improved, and the security of the verification manner provided by the embodiments of the present disclosure is higher.

[0101] In Figure 3 On the basis of the embodiments shown in the figure, in an embodiment, S330, for each image region, a target region in the image region is determined, which can include the following steps, respectively: Figure 4

[0102] ​S331, for each image region, determining, by a thread corresponding to the image region, a target start position and a target end position of the target region in the image region.

[0103] wherein threads corresponding to different image regions are different.

[0104] Specifically, each image region corresponds to a thread, and threads corresponding to different image regions are different, that is, a plurality of image regions are processed by a plurality of asynchronous threads.

[0105] For each image region, a target start position and a target end position of the target region in the image region are determined by a thread corresponding to the image region. The target region includes verification information, and a subsequent interference region is generated in the target region. Moreover, the target start position of the target region can be determined randomly, and the target end position of the target region can be determined based on the start position of the target region and the ratio of the area of the interference to be generated to the area of the image region.

[0106] For example, still taking the example in the above embodiment as an example, the height h of the image region can be divided into 100 equal parts, and the height of the target region is determined by a random number n within 100, and the width is w.

[0107] Suppose the area of each image region qs = 25% of the total area of the target image; the area of the interference to be generated gs = 0.25qs, that is, the ratio of the area of the interference to be generated to the area of the image region is 0.25. Then, the target start position of the target region can be n, and the target end position is n+25.

[0108] It can be understood that each image region is processed by different asynchronous threads, so the target start position and the target end position of each image region can be different.

[0109] In order to clearly describe the scheme, the specific implementation of S331, for each image region, determining, by a thread corresponding to the image region, a target start position and a target end position of the target region in the image region, will be described in detail in the following embodiments.

[0110] Moreover, if n = 100, n is reset to 0. If n+25>100, the target end position is: n-75, at this time, the target region is two regions at the top and the bottom, and the sum of the areas of the two regions is 0.25qs.

[0111] S332, determining the target region position in the image region based on the target start position and the target end position.

[0112] S333, determining the region corresponding to the target region position as the target region.

[0113] After the target start position and the target end position of the target region are determined, the target region position of the target region in the image region can be determined according to the target start position and the target end position. That is, the region surrounded by the target start position and the target end position is determined as the target region.

[0114] It can be seen that, by the technical solution provided in the embodiment, a plurality of image regions correspond to a plurality of different asynchronous threads. For each image region, the target start position and the target end position of the target region in the image region can be determined by the thread corresponding to the image region, and then the target region position of the target region in the image region can be accurately determined, so that the interference region of the interference verification information is formed in the target region in the subsequent step.

[0115] Based on the above Figure 4 embodiment, in an embodiment, S331, for each image region, the target start position and the target end position in the image region are determined by the thread corresponding to the image region, which can include the following steps: Figure 5

[0116] S3311, for each image region, the image region is divided into a first number of sub-image regions by the thread corresponding to the image region.

[0117] Specifically, assuming that the target image is cut into a plurality of image regions along the longitudinal direction, for each image region, the image region can be divided into a first number of sub-image regions along the longitudinal direction by the thread corresponding to the image region. Similarly, assuming that the target image is cut into a plurality of image regions along the transverse direction, for each image region, the image region can be divided into a first number of sub-image regions along the transverse direction by the thread corresponding to the image region. The first number can be determined according to actual conditions, and the present embodiment does not make specific limitation thereto.

[0118] For example, the target image is cut into 4 image regions along the longitudinal direction, for each image region, the image region can be divided into 100 sub-image regions of the same area along the longitudinal direction by the thread corresponding to the image region, and at this time, the first number is 100.

[0119] S3312, the start position of any target sub-image region in the first number of sub-image regions is determined, and the start position of the target sub-image region is determined as the target start position.

[0120] ​Specifically, one of the first quantity of sub-image regions can be determined randomly, and for the sake of clear description of the scheme, the sub-image region can be referred to as a target sub-image region, and the starting position of the target sub-image region can be determined as the target starting position of the target region in the image region.

[0121] For example, the target image is divided into 4 image regions along the longitudinal direction, for each image region, the image region is divided into 100 sub-image regions with the same area along the longitudinal direction by the thread corresponding to the image region, then, any target sub-image region can be determined in the 100 sub-image regions, and the starting position of the target sub-image region can be determined as the target starting position of the target region in the image region.

[0122] For the sake of clear description of the scheme, the specific implementation of S3312 will be described in detail in the following embodiments.

[0123] S3313, the starting position of the second quantity of sub-image regions after the target starting position is determined as the target ending position.

[0124] The second quantity is determined based on the area ratio of the target region to the image region.

[0125] Specifically, after the starting position of the target region in the image region is determined, the starting position of the second quantity of sub-image regions after the starting position can be determined as the ending position of the target region in the image region, wherein the second quantity can be determined based on the area ratio of the starting position of the target region to the area of the image region and the area of the target region to be generated.

[0126] For example, still taking the example in the above embodiment as an example, the height h of the image region can be divided into 100 equal parts, the height of the target region is determined by a random number n within 100, and the width is w.

[0127] Suppose the area of each image region qs=25% of the total area of the target image; the area of the target region to be generated, i.e., the target region gs=0.25qs, i.e., the area ratio of the target region to the image region is 0.25. Then, the second quantity can be 25, and if the target starting position of the target region can be n, the target ending position can be n+25.

[0128] It can be seen that by the technical scheme provided in the embodiments of the present application, by dividing each image region into a first quantity of sub-image regions, and by the starting position of any one of the first quantity of sub-image regions and the starting position of the second quantity of sub-image regions after the starting position, the ending position of the target region in the image region can be determined, and then the region position of the target region in the image region can be determined.

[0129] And, since the starting position and the ending position of the target region in the image region are determined by different asynchronous threads for the plurality of image regions, the positions of the regions corresponding to the target region in the plurality of image regions are different, and the interference objects can be generated uniformly and the interference positions can be changed constantly without damaging the image verification information.

[0130] In Figure 5 Based on the embodiment shown, in an implementation, S3312, the starting position of any target sub-image region in the first number of sub-image regions is determined, and the starting position of the target sub-image region is determined as the target starting position, which can include the following steps, steps a1 and a2 respectively:

[0131] Step a1, the first number of sub-image regions is numbered in the order of the first number of sub-image regions in the image region.

[0132] Specifically, if the target image is divided into the first number of sub-image regions along the vertical direction of the image region, the first number of sub-image regions can be labeled in the order from top to bottom, and the labels are 1 to 100 in turn.

[0133] Similarly, if the target image is divided into the first number of sub-image regions along the horizontal direction of the image region, the first number of sub-image regions can be labeled in the order from left to right, and the labels are 1 to 100 in turn.

[0134] Step a2, the starting position of any target sub-image region in the first number of sub-image regions is determined, and if the starting position of the target sub-image region is equal to the starting position of the sub-image region with the maximum number, the starting position of the sub-image region with the minimum number is determined as the target starting position.

[0135] Specifically, the starting position of any target sub-image region in the first number of sub-image regions can be determined randomly, and if the starting position of the target sub-image region is equal to the starting position of the sub-image region with the maximum number, for example, the image region is divided into 100 equal parts, the first number is 100, and the maximum number is 100, if the starting position of the target sub-image region is the starting position of the 100th sub-image region, i.e. the target sub-image region is the last sub-image region, the starting position needs to be reset, i.e. the starting position of the sub-image region with the minimum number is determined as the target starting position of the target region in the image region.

[0136] It can be seen that, if the target sub-image region determined randomly is the sub-image region with the largest number, the target sub-image region can be reset, i.e., the sub-image region with the smallest number is determined as the target sub-image region, and the starting position of the sub-image region with the smallest number is determined as the starting position of the target region in the image region, and then the starting position and the ending position of the target region can be accurately determined.

[0137] On the basis of the above embodiment, in an implementation, the image processing method can further include the following steps, i.e., step b1 and step b2.

[0138] In step b1, if the numbers corresponding to the second number of sub-image regions after the target starting position are greater than the maximum number, the difference between the number corresponding to the sub-image region at the target starting position and the third number is calculated to obtain the target number.

[0139] The third number is determined based on the difference between the first number and the second number.

[0140] Specifically, if the numbers corresponding to the second number of sub-image regions after the target starting position are greater than the maximum number, the target ending position of the target region in the image region cannot be directly determined at this time, therefore, the difference between the number corresponding to the sub-image region at the target starting position and the third number can be calculated to obtain the target number, and the third number is determined based on the difference between the first number and the second number.

[0141] For example, still taking the above example as an example, assuming that the image region is divided into 100 equal parts, the first number is 100, if the number corresponding to the target sub-image region is 76, and the second number is 25, then the sum of 76 and the second number 25 is 101, which is greater than 100, at this time, the third number is the difference between the first number 100 and the second number 25, i.e., the third number is 75, therefore, the target number is the difference between 76 and 75, i.e., the target number is 1.

[0142] In step b2, the ending position of the sub-image region corresponding to the target number is determined as the target ending position.

[0143] Specifically, the ending position of the sub-image region corresponding to the target number is determined as the target ending position of the target region in the image region, at this time, the target region is distributed in two parts in the image region. If the image region is divided along the vertical direction, the first part of the target region is the region from the target starting position to the bottom of the image region, and the second part of the target region is the region from the top of the image region to the target ending position.

[0144] Still taking the above example as an example, assuming that the image region is divided into 100 equal parts, then the first number is 100, if the target sub-image region corresponds to the number 76, the second number is 25, then the sum of 76 and the second number 25 is 101, which is greater than 100, at this time, the third number is the difference between the first number 100 and the second number 25, that is, the third number is 75, therefore, the target number is the difference between 76 and 75, that is, the target number is 1, at this time, the target region is composed of the sub-image region with the number from 76 to 100, and the sub-image region with the number 1.

[0145] It can be seen that, through the technical scheme provided by the embodiment of the application, if the number corresponding to the second number of sub-image regions after the target starting position is greater than the maximum number, then the target ending position of the target region in the image region is recalculated based on the number of the sub-image region corresponding to the target starting position and the third number. Further, the target region position of the target region in the image region can be accurately determined.

[0146] On the basis of the above embodiment, in an implementation manner, generating the interference region on the target region can include the following steps, which are step c1 and step c2 respectively:

[0147] Step c1, adding a plurality of pixel points on the target region.

[0148] Among them, the plurality of pixel points has identification information, and the pixel value corresponding to each pixel point is randomly determined.

[0149] Step c2, determining the region composed of the plurality of pixel points as the interference region.

[0150] Specifically, when generating the interference region on the target region, a plurality of pixel points can be added on the target region until the plurality of pixel points cover the target region, and the pixel value corresponding to each pixel point is randomly determined. Finally, the region composed of the plurality of pixel points is determined as the interference region.

[0151] And, in order to be able to delete the interference region in the target region in the subsequent steps, the plurality of pixel points all have identification information, which can be f, so that when it is necessary to delete the interference region, the pixel points with f identification information can be deleted.

[0152] In an implementation manner, deleting the interference region on the target region can include the following steps, which are step d1 and step d2 respectively:

[0153] Step d1, determining the pixel point with identification information on the target region.

[0154] Specifically, when deleting the interference region on the target region, first, the pixel points with the identification information on the target region are determined, that is, the pixel points with the added pixel points in the generated interference region are determined on the target region.

[0155] Step d2, deleting the pixel points with the identification information on the target region.

[0156] Specifically, after the pixel points with the identification information on the target region are determined, the pixel points with the identification information on the target region can be deleted, so that the purpose of deleting the interference region on the target region is achieved.

[0157] On the basis of the above embodiment, the areas of the interference regions in different image regions are the same. In this way, it can be ensured that the entire target image is uniformly covered, and the interference objects of each image region move in a variable color breathing manner while keeping the total area unchanged.

[0158] The technical solution provided in this embodiment is to cyclically perform the operations of generating interference objects and deleting interference objects. The effect of the interference objects in the image region is that the interference objects in the image region always exist and move in a breathing state in the region. The overall effect is that the entire image is uniformly covered, and the interference objects of each small region move in a variable color breathing manner while keeping the total area unchanged.

[0159] As can be seen, by using the technical solution provided in the embodiments of the present application, the interference objects of the image including the verification information are formed in a dynamic interference manner. In this way, the interference objects can be uniformly generated and the interference positions can be constantly changed without damaging the verification information in the image, so that the recognition rate of the machine can be reduced, the verification information in the image is not lost, the necessity of the user to perform verification is improved, and the security of the verification method provided in the embodiments of the present application is higher.

[0160] It should be noted that, for the method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action order described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by the present application.

[0161] In a second aspect, the embodiments of the present application provide an image processing device, as shown in the following figure, which comprises: Figure 6

[0162] An image acquisition module 610 is configured to acquire a target image; the target image comprises verification information.

[0163] An image division module 620 is configured to divide the target image into a plurality of image regions.​

[0164] The region determination module 630 is configured to determine, for each image region, a target region in the image region; the target region includes the verification information.

[0165] The image processing module 640 is configured to process the target region in an alternating manner of a first processing manner and a second processing manner; the first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region; the interference region is used to cover the target region.

[0166] The technical scheme provided by the embodiment of the present disclosure comprises: obtaining a target image; dividing the target image into a plurality of image regions; determining, for each image region, a target region in the image region; and processing the target region in an alternating manner of a first processing manner and a second processing manner; wherein the first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region; the interference region is used to cover the target region.

[0167] It can be seen that, by using the technical scheme of the embodiment of the present disclosure, the interference of the target image is formed in a dynamic interference manner. In this way, the interference of each image region always exists and moves in the image region without damaging the verification information of the target image. The overall effect is that the entire target image is covered by relatively uniform interference, and the interference of each image region moves while keeping the total area unchanged. In this way, the recognition rate of the machine can be reduced without losing the verification information in the image, improving the necessity of the user to verify, and thus the security of the verification method provided by the embodiment of the present disclosure is higher.

[0168] Optionally, the region determination module is specifically configured to:

[0169] For each image region, a target start position and a target end position are determined in the image region by a thread corresponding to the image region; the threads corresponding to different image regions are different.

[0170] Based on the target start position and the target end position, a target region position in the image region is determined.

[0171] A region corresponding to the target region position is determined as the target region.

[0172] Optionally, the region determination module is further specifically configured to:

[0173] For each image region, the image region is divided into a first number of sub-image regions by a thread corresponding to the image region.

[0174] determining a starting position of any target sub-image region in the first quantity of sub-image regions, and determining the starting position of the target sub-image region as a target starting position;

[0175] determining a starting position of any target sub-image region in the first quantity of sub-image regions, and determining the starting position of the target sub-image region as a target starting position;

[0176] Optionally, the region determining module is further configured to:

[0177] numbering the first quantity of sub-image regions according to the order of the first quantity of sub-image regions in the image region;

[0178] determining a starting position of any target sub-image region in the first quantity of sub-image regions, and determining the starting position of the target sub-image region as a target starting position;

[0179] Optionally, the position determining module is further configured to:

[0180] if the number corresponding to the second quantity of sub-image regions after the target starting position is greater than the maximum number, calculating the difference between the number corresponding to the sub-image region at the target starting position and a third quantity to obtain a target number, the third quantity being determined based on the difference between the first quantity and the second quantity;

[0181] determining the ending position of the sub-image region corresponding to the target number as a target ending position.

[0182] Optionally, the image processing module is configured to:

[0183] adding a plurality of pixel points on the target region, the plurality of pixel points having identification information, and the pixel value corresponding to each pixel point being determined randomly;

[0184] determining the region composed of the plurality of pixel points as an interference region.

[0185] Optionally, the image processing module is configured to:

[0186] determining the pixel point having the identification information on the target region;

[0187] deleting the pixel point having the identification information on the target region.

[0188] For the device embodiment, it is basically similar to the method embodiment, so the description is relatively simple, and the related parts refer to the part of the method embodiment.

[0189] In a third aspect, an electronic device is provided, comprising a memory 710, a processor 720, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the steps of the image processing method of the first aspect when executing the program. Figure 7 As shown in FIG. 7, the electronic device comprises a memory 710, a processor 720, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the steps of the image processing method of the first aspect when executing the program.

[0190] The technical solution provided by the embodiments of the present disclosure comprises: obtaining a target image; dividing the target image into a plurality of image regions; for each image region, determining a target region in the image region; and processing the target region in an alternating manner of a first processing mode and a second processing mode, wherein the first processing mode is to generate an interference region on the target region, and the second processing mode is to delete the interference region on the target region, and the interference region is used to cover the target region.

[0191] It can be seen that, by using the technical solution of the embodiments of the present disclosure, the interference of the target image is formed in a dynamic interference manner. In this way, without damaging the verification information of the target image, the interference of each image region always exists and moves in the image region. The overall effect is that the entire target image is blocked by relatively uniform interference, and the interference of each image region moves while keeping the total area unchanged. In this way, the recognition rate of the machine can be reduced, the verification information in the image is not lost, the necessity of the user to perform verification is improved, and the security of the verification method provided by the embodiments of the present disclosure is higher.

[0192] In a fourth aspect, a computer readable storage medium is provided, wherein the computer readable storage medium stores a computer program, and the computer program implements the steps of the image processing method of the first aspect when executed by a processor.

[0193] The technical solution provided by the embodiments of the present disclosure comprises: obtaining a target image; dividing the target image into a plurality of image regions; for each image region, determining a target region in the image region; and processing the target region in an alternating manner of a first processing mode and a second processing mode, wherein the first processing mode is to generate an interference region on the target region, and the second processing mode is to delete the interference region on the target region, and the interference region is used to cover the target region.

[0194] It can be seen that, by the technical solution of the embodiment of the present application, the interference objects of the target image are formed in a dynamic interference manner. In this way, the interference objects of each image region exist and move in the image region without damaging the verification information of the target image. The overall effect is that the entire target image is blocked by relatively uniform interference objects, and the interference objects of each image region move while keeping the total area unchanged. In this way, the recognition rate of the machine can be reduced without losing the verification information in the image, the necessity of the user to perform verification is improved, and thus the security of the verification manner provided by the embodiment of the present application is higher.

[0195] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the embodiments can be referred to each other.

[0196] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, an apparatus, or a computer program product. Therefore, the present application can adopt a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0197] The present application is described with reference to flowcharts and / or block diagrams according to the method, terminal device (system), and computer program product of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the computer or other programmable data processing terminal device produce a device for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The apparatus for implementing the functions specified in one or more flows and / or blocks.

[0198] These computer program instructions can also be stored in a computer readable storage medium that can guide the computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer readable storage medium produce a product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The apparatus for implementing the functions specified in one or more flows and / or blocks.

[0199] These computer program instructions can also be loaded into a computer or other programmable data processing terminal device, so that a series of operational steps are performed on the computer or other programmable terminal device to generate a computer-implemented process, thus the instructions executed on the computer or other programmable terminal device provide a process for implementing the functions specified in the flowchart Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0200] Although the preferred embodiments of the application have been described, those skilled in the art will be able to make additional changes and modifications to these embodiments once they have the benefit of the present disclosure. Therefore, the appended claims are intended to cover all changes and modifications that fall within the scope of the application.

[0201] Finally, it should be noted that, in the present document, the terms such as first and second, etc. are merely intended to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising", "containing" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or terminal device. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or terminal device including the element.

[0202] The above provides a kind of image processing method, device, electronic equipment and storage medium provided by the present application, detailed introduction is carried out, the principle and implementation mode of the present application are described in this paper by specific example, the above example is only for helping to understand the method of the present application and its core idea;For those skilled in the art, according to the idea of the present application, there will be changes in specific implementation mode and application range, and the above description should not be understood as the limitation of the present application.

Claims

1. An image processing method, characterized by, The method comprises: acquiring a target image; the target image comprises verification information; dividing the target image into a plurality of image regions; for each image region, determining a target region in the image region; the target region comprises the verification information; processing the target region in an alternating manner of a first processing manner and a second processing manner; the first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region; the interference region is used to cover the target region, wherein the interference of the image region always exists and moves in the image region in a breathing state.

2. The method of claim 1, wherein, The method further comprises: for each image region, determining a target start position and a target end position in the image region by a thread corresponding to the image region; the threads corresponding to different image regions are different; determining a target region position in the image region based on the target start position and the target end position; determining a region corresponding to the target region position as the target region.

3. The method of claim 2, wherein, The method further comprises: for each image region, dividing the image region into a first number of sub-image regions by a thread corresponding to the image region; determining a start position of any target sub-image region in the first number of sub-image regions, and determining the start position of the target sub-image region as the target start position; determining a start position corresponding to a second number of sub-image regions after the target start position as the target end position; the second number is determined based on a ratio of an area of the target region to an area of the image region.

4. The method of claim 3, wherein, The method further comprises: numbering the first number of sub-image regions in an order of the first number of sub-image regions in the image region; determining a start position of any target sub-image region in the first number of sub-image regions, and determining the start position of the target sub-image region as the target start position if the start position of the target sub-image region is equal to a start position of a sub-image region with a maximum number.

5. The method of claim 4, wherein, The method further comprises: if a number corresponding to the second number of sub-image regions after the target start position is greater than the maximum number, calculating a difference between a number corresponding to a sub-image region of the target start position and a third number to obtain a target number; the third number is determined based on a difference between the first number and the second number; determining an end position of a sub-image region corresponding to the target number as the target end position.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: adding a plurality of pixel points on the target region; the plurality of pixel points have identification information, and a pixel value corresponding to each pixel point is determined randomly. The region composed of the plurality of pixel points is determined as an interference region.

7. The method of claim 6, wherein, The interference region on the target region is deleted, including: Determining a pixel point with the identification information on the target region; Deleting the pixel point with the identification information on the target region.

8. An image processing apparatus characterized by comprising: Including: An image acquisition module, configured to acquire a target image; the target image includes verification information; An image division module, configured to divide the target image into a plurality of image regions; A region determination module, configured to determine, for each image region, a target region in the image region; the target region includes the verification information; An image processing module, configured to process the target region in an alternating manner of a first processing manner and a second processing manner; the first processing manner is to generate an interference region on the target region, and the second processing manner is to delete the interference region on the target region; the interference region is used to cover the target region, and the interference object of the image region always exists and moves in the image region in a breathing state.

9. The apparatus of claim 8, wherein, The region determination module is specifically configured to: For each image region, determine a target start position and a target end position in the image region through a thread corresponding to the image region; threads corresponding to different image regions are different; Determine a target region position in the image region based on the target start position and the target end position; Determine a region corresponding to the target region position as a target region.

10. The apparatus of claim 9, wherein, The region determination module is further specifically configured to: For each image region, divide the image region into a first number of sub-image regions through a thread corresponding to the image region; Determine a start position of any target sub-image region in the first number of sub-image regions, and determine the start position of the target sub-image region as a target start position; Determine a start position corresponding to a second number of sub-image regions after the target start position as a target end position; the second number is determined based on a ratio of an area of the target region to an area of the image region.

11. The apparatus of claim 10, wherein, The region determination module is further specifically configured to: Number the first number of sub-image regions in an order of the first number of sub-image regions in the image region; Determine a start position of any target sub-image region in the first number of sub-image regions, and if the start position of the target sub-image region is equal to a start position of a sub-image region with a maximum number, determine a start position of a sub-image region with a minimum number as a target start position.

12. The apparatus of claim 11, wherein, The region determination module is further specifically configured to: If a number corresponding to the second number of sub-image regions after the target start position is greater than the maximum number, calculate a difference between a number of a sub-image region corresponding to the target start position and a third number to obtain a target number; the third number is determined based on a difference between the first number and the second number; Determine an end position of a sub-image region corresponding to the target number as a target end position.

13. The apparatus of any one of claims 8 to 12, wherein, The image processing module is specifically configured to: Add a plurality of pixel points on the target region; the plurality of pixel points have identification information, and pixel values corresponding to each pixel point are determined randomly; A region formed by the plurality of pixel points is determined as an interference region.

14. The apparatus of claim 13, wherein, The image processing module is specifically used for: Determining a pixel point with the identification information on the target region; Deleting the pixel point with the identification information on the target region.

15. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the image processing method according to any one of claims 1 to 7 when executing the program.

16. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the image processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Picture identifying code creation method and device

    CN101339666A

  • Method for generating and verifying verification code

    CN105577367A