Image processing method and device
By generating the mask of the mask area on the target object through image processing technology, the existing verification code technology is solved, and the problem of low security and single interaction is achieved, achieving higher automatic recognition difficulty and complexity of login verification.
Patent Information
- Application Number
- CN202411112280.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-03
AI Technical Summary
The existing verification code technology has low security during the login process of online services, which is easy to be recognized by intelligent algorithms, and the interaction form is single, lacks fun, making it difficult to increase the difficulty of automatic recognition.
By obtaining the image to be processed, the mask area of the target object is determined, the expected coordinate information of the pixel point is calculated, and the masking area is output to the target object based on the distance detection distribution, and the target image is generated for login verification, so as to improve the image Richness and difficulty in automatic identification.
It improves the security and fun of login verification, increases the difficulty of automatic recognition, and realizes the complexity of login verification through pixel point clearing in the mask area, enhancing the reliability of verification of user identity.
Smart Images

Figure CN119066642A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of image processing technology, and in particular to an image processing method and device. Background Art
[0002] With the continuous development of Internet technology and the continuous advancement of social information, various online services have emerged in an endless stream, such as applications, sub-programs, and portals. During the account login process for online services, in order to verify that the user is a real user, verification code technology will be used for verification.
[0003] At present, there are many options for account login for online services through verification code technology, such as text verification code, digital verification code, graphic verification code, and slider verification code. However, in the process of using text, numbers, graphics and other media to generate verification information for users to identify or interact, the security is still low and it is easy to be recognized by intelligent algorithms. In addition, the interaction form is relatively simple and lacks fun. Summary of the invention
[0004] An object of one embodiment of the present specification is to provide an image processing method and apparatus to solve the technical problem of how to increase the richness of images used for login verification and the difficulty of automatic recognition.
[0005] To solve the above technical problems, an embodiment of this specification is implemented as follows:
[0006] In a first aspect, an embodiment of the present specification provides an image processing method, the method comprising:
[0007] Acquire an image to be processed, and determine a mask area of a target object in the image to be processed;
[0008] Calculating expected coordinate information of each pixel point according to current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area;
[0009] Performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance;
[0010] If the detection is successful, a target image obtained by masking the target object in the image to be processed based on the mask area is output, so as to perform login verification after it is detected that the pixels in the mask area of the target image are cleared.
[0011] In a second aspect, another embodiment of the present specification provides an image processing device, the device comprising:
[0012] An image acquisition module, used to acquire an image to be processed and determine a mask area of a target object in the image to be processed;
[0013] A coordinate calculation module, used for calculating the expected coordinate information of each pixel point according to the current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area;
[0014] A distance calculation module, used to perform distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and perform distribution detection on each pixel point of the mask area based on the calculated distance;
[0015] The image output module is used to output a target image obtained by masking the target object in the image to be processed based on the mask area if the detection is passed, so as to perform login verification after the pixels of the mask area of the target image are detected and cleared.
[0016] In a third aspect, another embodiment of the present specification provides an image processing device, comprising: a memory, a processor, and computer executable instructions stored in the memory and executable on the processor, wherein the computer executable instructions, when executed by the processor, implement the steps of the image processing method as described in the first aspect above.
[0017] In a fourth aspect, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the image processing method described in the first aspect above are implemented.
[0018] In a fifth aspect, another embodiment of the present specification provides a computer program product, wherein the computer program product includes an image processing program, and the image processing program is executed by a processor to implement the steps of the image processing method as described in the first aspect above.
[0019] The image processing method provided in the present embodiment first determines the mask area of the target object in the image to be processed, calculates the expected coordinate information of each pixel based on the current coordinate information and movement parameters of each pixel corresponding to the mask texture type of the mask area, and then performs distance calculation in combination with the expected coordinate information of each pixel and the specific coordinate information of the mask area, and performs distribution detection on each pixel in the mask area based on the calculated distance, and outputs a target image obtained by masking the target object in the image to be processed based on the mask area after the detection is passed, so as to perform login verification after the pixels in the mask area of the target image are cleared, thereby improving the richness of the target image through the mask texture type of the mask area and masking the target object in the image to be processed through the mask area, and performing login verification by clearing the pixels in the mask area of the target image, thereby improving the fun of login verification, and improving the complexity of login verification through clearing interaction, thereby increasing the difficulty of automatic recognition during login verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A processing flow chart of an image processing method provided by one embodiment of this specification;
[0022] Figure 2 A schematic diagram of a verification question corresponding to a target image and a target object provided by an embodiment of the present specification;
[0023] Figure 3 A schematic diagram of clearing an image provided by one embodiment of this specification;
[0024] Figure 4 A schematic diagram of a first marking result provided by an embodiment of this specification;
[0025] Figure 5 A schematic diagram of a second marking result provided by one embodiment of this specification;
[0026] Figure 6 A processing flow chart of an image processing method applied to a cultural relic scene provided by one embodiment of this specification;
[0027] Figure 7 A schematic diagram of an image processing device provided in one embodiment of this specification;
[0028] Figure 8 A schematic diagram of the structure of an image processing device provided in one embodiment of this specification. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0030] An embodiment of an image processing method provided in this specification is as follows:
[0031] Reference Figure 1 The image processing method provided in this embodiment specifically includes the following steps S102 to S108.
[0032] Step S102: acquiring an image to be processed, and determining a mask region of a target object in the image to be processed.
[0033] The image to be processed in this embodiment refers to an initial image used to generate login verification; the target object in the image to be processed includes an object with a clear outline in the image to be processed. The mask area of the target object refers to the area where the target object in the image to be processed is masked, and the mask area can be a mask layer, which can be created by HTML5 canvas. This embodiment can be applied to a client, which can be a browser, an application or a subroutine, or other types of clients.
[0034] In specific implementation, in order to increase the richness of login verification and increase the fun of user login verification, the image to be processed can be obtained in the following way: determine the service type according to the service identifier of the login service carried in the login request, and filter out the image to be processed from the image data set based on the service type.
[0035] Among them, the login service refers to a service for login verification, which can be an application, a sub-program (such as a mini-program), a website, or other types of services; the service type can be an application type, a sub-program type, or a website type, in addition, the service type can also be other service types.
[0036] In an optional implementation manner provided by this embodiment, the image to be processed is obtained by:
[0037] Determine the website type according to the website identifier carried in the website login request;
[0038] The image to be processed is selected from the image data set based on the website type.
[0039] Among them, the image dataset refers to a collection composed of one or more images. The image dataset can be an image database. The image dataset can be an image dataset corresponding to the website type. The image dataset can be a collection that is manually reviewed and ensures that each image in the collection contains a complete and clear object outline.
[0040] For example, the website type is determined to be a cultural relic website type based on the website identifier carried in the website login request, and cultural relic images are screened out from the image data set corresponding to the cultural relic website type based on the cultural relic website type; the image to be processed may be one or more, and during the screening process, a preset number of images to be processed may be randomly screened.
[0041] It should be noted that the process of determining the website type according to the website identifier carried in the website login request and filtering the image to be processed from the image data set based on the website type can be executed by the server and can be executed after the client submits the website login request to the server.
[0042] After filtering out the image to be processed, the server can identify the boundary coordinate information of the target object in the image to be processed. Specifically, the image recognition algorithm can be called to identify the boundary coordinate information of the target object in the image to be processed, and the object area of the target object can be calculated based on the boundary coordinate information of the target object. In addition, the server can also randomly filter out the mask texture type from the texture type set. The mask texture type can be one or more. The server can return the image to be processed to the client, and can also respond to the login request submitted by the client and return the image to be processed, the boundary coordinate information of the target object in the image to be processed, the object area, the mask texture type, or the image to be processed, the boundary coordinate information of the target object in the image to be processed and the mask texture type to the client.
[0043] In the specific execution process, the image to be processed can be obtained, and the mask area of the target object can be determined based on the boundary coordinate information of the target object in the image to be processed; for example, the mask area of the cultural relic can be determined based on the boundary coordinate information of the cultural relic in the image of the cultural relic; the boundary coordinate information here refers to the coordinate information of the object contour of the target object in the image to be processed; specifically, the client can obtain the image to be processed, the boundary coordinate information of the target object in the image to be processed, and the mask texture type. In addition, the image to be processed, the boundary coordinate information of the target object in the image to be processed, the mask texture type, and the verification question corresponding to the target object can also be obtained; the verification question includes the selection question in the login verification process.
[0044] Step S104 , calculating expected coordinate information of each pixel point according to the current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area.
[0045] The mask area of the target object in the image to be processed is determined above. In this step, the expected coordinate information of each pixel is calculated based on the current coordinate information and movement parameters of each pixel corresponding to the mask texture type of the mask area.
[0046] The mask texture type described in this embodiment refers to the texture type for performing pixel processing on the mask area, such as the mask texture type is a gravel texture type; the pixel points corresponding to the mask texture type include the texture pixel points corresponding to the mask texture type, such as the mask texture type is a gravel texture type, and the pixel points corresponding to the mask texture type are the gravel pixel points corresponding to the gravel texture type; it should be noted that the mask texture type in this embodiment can be any texture type, and the gravel texture type here is merely schematic, for example, the mask texture type can also be a flower texture type, a landscape texture type, and the like.
[0047] The current coordinate information of each pixel point refers to the coordinate information of each pixel point in the mask area, that is, the coordinate information of the center of each pixel point in the mask area, such as (x, y); the movement parameters include the movement parameters for moving each pixel point in the mask area; the expected coordinate information of each pixel point refers to the coordinate information of each pixel point expected to move in the mask area according to the movement parameters. The mask area of the target object is created based on the boundary coordinate information of the target object in the image to be processed.
[0048] During specific implementation, in order to improve the effectiveness of the target image subsequently generated for login verification, the target object in the image to be processed needs to be covered to avoid being automatically recognized by the intelligent algorithm, thereby improving the security of login verification. Sufficient pixel points can be generated and distributed at appropriate positions in the mask area of the target object. In this case, the number of pixel points corresponding to the mask texture type of the mask area can be determined based on the boundary coordinate information of the target object in the image to be processed, and the number of pixel points can be positively correlated with the object contour size corresponding to the boundary coordinate information of the target object.
[0049] In practical applications, each pixel point in the mask area needs to cover the key part of the target object in the image to be processed, so that the target object is not easily recognized by the intelligent algorithm. The position of each pixel point in the mask area is crucial, and the key part of the target object in the image to be processed is often the central part of the target object. In view of this, an optional implementation method provided in this embodiment is to calculate the expected coordinate information of each pixel point according to the current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area, and perform the following operations:
[0050] Generate a moving direction angle and a deflection angle of each pixel point, and calculate an offset direction angle of each pixel point according to the moving direction angle and the deflection angle;
[0051] The moving distance of each pixel point is determined based on the maximum moving step length, and the expected coordinate information of each pixel point is calculated based on the moving distance, the offset direction angle and the current coordinate information.
[0052] The moving direction angle of each pixel point includes the angle of the moving direction of each pixel point relative to a reference axis. The deflection angle may be a deflection angle toward the center. The maximum moving step may be the maximum step of each pixel point moving within the mask area, for example, the maximum moving step is x pixels. The moving distance of each pixel point may be the moving distance in the offset direction.
[0053] The direction of each pixel during movement is controlled by the moving direction angle of each pixel, and the deflection angle is set to make each pixel more biased towards the center of the mask area of the target object and distributed around the center, which can cover the key part of the target object and make the subsequent target image not easily recognized automatically.
[0054] On this basis, in order to improve the randomness of the movement of each pixel point, and further improve the randomness and naturalness of the distribution of each pixel point in the mask area; in an optional implementation manner provided by this embodiment, in the above-mentioned process of generating the moving direction angle and the deflection angle of each pixel point, and calculating the offset direction angle of each pixel point according to the moving direction angle and the deflection angle, the following operations are performed:
[0055] Generating a moving direction angle of each pixel point based on a preset moving direction angle interval, and generating a deflection angle of each pixel point based on a preset deflection angle interval;
[0056] The sum of the moving direction angle and the deflection angle is calculated as the offset direction angle.
[0057] Among them, the preset moving direction angle interval refers to an optional interval of the preset moving direction angle, for example, the preset moving direction angle interval can be 0-360 degrees; the preset deflection angle interval refers to an optional interval of the preset deflection angle, for example, the preset deflection angle interval can be 0-45 degrees.
[0058] Specifically, the moving direction angle of each pixel point can be randomly generated based on a preset moving direction angle interval, and the deflection angle of each pixel point can be randomly generated based on a preset deflection angle interval, and the sum of the moving direction angle and the deflection angle of each pixel point is calculated as the offset direction angle of each pixel point, the moving step length interval is determined based on the maximum moving step length, and the moving step length of each pixel point is randomly determined within the moving step length interval as the moving distance, and the expected coordinate information of each pixel point is calculated based on the moving distance, deflection direction angle and current coordinate information of each pixel point.
[0059] For example, a linear congruential random number generation algorithm is used to determine the moving direction angle α of each pixel within a preset moving direction angle range of 0-360 degrees. A linear congruential random number generation algorithm is used to determine the deflection angle β of each pixel within a preset deflection angle range of 0-45 degrees. The sum of the moving direction angle α and the deflection angle β is calculated as α+β=α' as the offset direction angle α' of each pixel. The offset direction angle of each pixel can control the moving direction of each pixel while enabling each pixel to be distributed around the center of the mask area. On this basis, the moving step interval is determined to be 1-x based on the maximum moving step x. The moving step of each pixel is randomly determined within the moving step interval 1-x as the moving distance d of each pixel. Based on the moving distance d of each pixel, the deflection direction angle α' and the current coordinate information (x, y), the expected coordinate information (x', y') of each pixel is calculated.
[0060] Step S106: performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance.
[0061] The above-mentioned method calculates the expected coordinate information of each pixel point based on the current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area. In this step, the distance is calculated in combination with the expected coordinate information of each pixel point and the specific coordinate information of the mask area, and the distribution of each pixel point in the mask area is detected based on the calculated distance; the distance refers to the position distance between the expected position corresponding to the expected coordinate information of each pixel point and the specific position corresponding to the specific coordinate information.
[0062] The specific coordinate information of the mask area described in this embodiment refers to certain coordinate information of the specific mask area. For example, the specific coordinate information of the mask area is the center coordinate information of the mask area, that is, the coordinate information of the center position of the mask area, that is, the coordinate information of the center position of the target object in the image to be processed.
[0063] In practical applications, when each pixel point moves in the mask area, it may intersect or overlap with other pixel points, and when moving according to the expected coordinate information of each pixel point calculated in the same way, the distribution of each pixel point may be more regular, and it cannot be randomly and naturally distributed in the mask area. In view of this, in order to avoid overlapping distribution between each pixel point, resulting in waste of mask of each pixel point, and at the same time to improve the naturalness of distribution of each pixel point in the mask area and present a better visual effect to the user; in an optional implementation manner provided by this embodiment, in the process of performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance, the following operations are performed:
[0064] According to the expected coordinate information of each pixel point, the coordinate information of the remaining pixel points and the mask area, coordinate correction is performed on each pixel point to obtain the corrected coordinate information of each pixel point;
[0065] The distance is calculated based on the corrected coordinate information and the specific coordinate information, and distribution detection is performed on each pixel point in the mask area based on the distance.
[0066] The coordinate information of the remaining pixels refers to the other pixels except each pixel among the pixels. For example, if there are 5 pixels, the remaining pixels of each pixel are the other 4 pixels except itself.
[0067] On this basis, in an optional implementation manner provided by this embodiment, in the process of performing coordinate correction on each pixel point according to the expected coordinate information of each pixel point, the coordinate information of the remaining pixel points and the mask area to obtain the corrected coordinate information of each pixel point, the following operations are performed:
[0068] Performing distance calculation according to the expected coordinate information of each pixel point and the coordinate information of the remaining pixel points;
[0069] If the calculated distance is greater than or equal to a preset distance threshold, the expected coordinate information is disturbed to obtain the disturbed coordinate information of each pixel point, and when the disturbed coordinate information is in the mask area, the disturbed coordinate information is used as the corrected coordinate information.
[0070] The expected coordinate information of each pixel includes the expected coordinate information of the center of each pixel; the coordinate information of the remaining pixels includes the coordinate information of the center of the pixel of the remaining pixels. The distance here refers to the position distance between the center of each pixel and the center of the remaining pixels. The preset distance threshold may be a preset distance threshold, such as the preset distance threshold is the radius r of the pixel. In the case where the disturbed coordinate information is not in the mask area, the current coordinate information of each pixel is maintained or no processing is performed.
[0071] In the process of performing distribution detection on the pixels in the mask area based on the distance, in an optional implementation manner provided by this embodiment, the following operations are performed:
[0072] Determine a distribution block of each pixel point among a plurality of distribution blocks in the mask area based on the distance, and generate a random number for each pixel point;
[0073] If the random number is smaller than the pixel distribution threshold corresponding to the distribution block, each pixel point is moved according to the corrected coordinate information, and the detection is determined to be passed after the number of distribution detections of each pixel point is greater than the number threshold.
[0074] Among them, the multiple distribution blocks of the mask area can be multiple concentric circles of the mask area, that is, multiple concentric circles drawn outward based on the specific position corresponding to the specific coordinate information of the mask area. The random number of each pixel point refers to a randomly generated value for each pixel point, and the random number can be a randomly generated value between 0 and 1. The number of distribution detection times of each pixel point includes the number of executions of the process of calculating the expected coordinate information of each pixel point and performing distribution detection on each pixel point. The pixel distribution threshold corresponding to the distribution block includes the density threshold of the pixel distribution density corresponding to the distribution block.
[0075] Specifically, in the process of perturbing the expected coordinate information to obtain the perturbed coordinate information of each pixel point, noise may be added to the expected coordinate information of each pixel point to obtain the perturbed coordinate information of each pixel point, such as adding Perlin noise to the expected coordinate information of each pixel point to obtain the perturbed coordinate information of each pixel point.
[0076] If the random number is greater than or equal to the pixel distribution threshold corresponding to the distribution block, the current coordinate information of each pixel point is maintained, that is, no processing is performed.
[0077] For example, according to the expected coordinate information (x', y') of each pixel point and the coordinate information (x o ,y o ) to calculate the distance, and the calculated distance is If the calculated distance dis is greater than or equal to the preset distance threshold, it means that each pixel will not collide with the remaining pixels. Perlin noise is added to the expected coordinate information (x', y') of each pixel to obtain the disturbed coordinate information (x", y"), and when the disturbed coordinate information is in the mask area, the disturbed coordinate information (x", y") is used as the corrected coordinate information of each pixel.
[0078] The distance is calculated based on the corrected coordinate information of each pixel point and the specific coordinate information of the mask area. The concentric circle where each pixel point is located is determined within multiple concentric circles of the center position corresponding to the central coordinate information of the mask area based on the distance, and a random number is generated for each pixel point. If the random number of each pixel point is less than the pixel distribution threshold corresponding to the concentric circle, each pixel point is moved according to the corrected coordinate information, and the detection is determined to be passed after the number of distribution detections of each pixel point is greater than the number threshold.
[0079] It should be noted that if the distance between the target pixel point obtained by the distance calculation based on the expected coordinate information of each pixel point and the coordinate information of the remaining pixel points and the remaining pixel points is less than the preset distance threshold, it means that the pixel points may collide, and the secondary offset direction angle and secondary moving distance of the target pixel point are generated in the same way, and then the subsequent processes such as calculating the expected coordinate information based on the secondary offset direction angle and the secondary moving distance are continued.
[0080] It should also be noted that, optionally, the pixel distribution thresholds corresponding to the multiple distribution blocks of the mask area are positively correlated with the distance from the specific position corresponding to the specific coordinate information of the mask area, that is, the greater the distance between the multiple distribution blocks and the specific position, the larger the pixel distribution thresholds corresponding to the multiple distribution blocks. For example, the pixel distribution threshold corresponding to the concentric circles close to the center of the mask area is 0.5, and the pixel distribution threshold corresponding to the concentric circles away from the center of the mask area is 0.8, that is, the pixel distribution threshold increases from the center of the mask area outward; therefore, since the pixel distribution thresholds of the multiple distribution blocks gradually increase from the center to the edge, the probability that the random number is less than the pixel distribution threshold of the distribution block close to the center is relatively high, and the probability that the random number is less than the pixel distribution threshold of the distribution block at the edge is relatively low, so the probability of each pixel point moving to the distribution block close to the center is relatively high, and the probability of each pixel point moving to the distribution block at the edge is relatively low, so that the pixel distribution is gradually sparse from the center to the edge, making the pixel distribution more natural.
[0081] In addition, in the process of performing coordinate correction on each pixel point according to the expected coordinate information of each pixel point, the coordinate information of the remaining pixel points and the mask area to obtain the corrected coordinate information of each pixel point, distance calculation can also be performed according to the expected coordinate information of each pixel point and the coordinate information of the remaining pixel points. If the calculated distance is greater than or equal to a preset distance threshold and the expected coordinate information of each pixel point is in the mask area, the expected coordinate information of each pixel point is used as the corrected coordinate information of each pixel point.
[0082] Alternatively, the process of performing coordinate correction on each pixel point according to the expected coordinate information of each pixel point, the coordinate information of the remaining pixel points and the mask area to obtain the corrected coordinate information of each pixel point can be replaced by performing coordinate correction on each pixel point according to the expected coordinate information of each pixel point and the mask area to obtain the corrected coordinate information of each pixel point. Specifically, the expected coordinate information of each pixel point can be disturbed to obtain the disturbed coordinate information of each pixel point. When the disturbed coordinate information is in the mask area, the disturbed coordinate information is used as the corrected coordinate information.
[0083] It should be supplemented that, the above process of calculating the expected coordinate information of each pixel point according to the current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area, performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance can be executed once or multiple times until the number of distribution detections of each pixel point is greater than the number threshold, that is, the number of executions of the above-mentioned calculation of the expected coordinate information of each pixel point and distribution detection for each pixel point is greater than the number threshold; it should also be supplemented that the initial coordinate information of each pixel point corresponding to the mask texture type of the mask area can be the coordinate information of any position in the mask area, for example, if the initial coordinate information is the coordinate information of the upper left corner of the mask area, each pixel point can be initialized at the upper left corner of the mask area, and then the coordinate movement can be started from the upper left corner; the current coordinate information of each pixel point in this embodiment can be the initial coordinate information or any coordinate information after the first time.
[0084] Step S108, if the detection is passed, outputting a target image obtained by masking the target object in the image to be processed based on the mask area, so as to perform login verification after detecting that the pixels in the mask area of the target image are cleared.
[0085] Masking the target object in the image to be processed based on the mask region may be covering the target object in the image to be processed with the mask region, and pixels of the target object in the image to be processed may be replaced with pixels in the mask region.
[0086] The target image in this embodiment includes an image for login verification, that is, a login verification image, that is, a verification code image, which can be used for login verification to verify whether a real user logs in. Clearing in this embodiment includes erasing.
[0087] In a specific implementation, if the detection is passed, the target image obtained by masking the target object in the image to be processed based on the mask area can be output, and the verification questions corresponding to the target image and the target object can be displayed, so that login verification can be performed after the pixel points of the mask area of the target image are detected to be cleared. In addition, the intermediate image obtained by masking the target object in the image to be processed based on the mask area can also be denoised to obtain the target image, and the verification questions corresponding to the target image and the target object can be displayed, so that login verification can be performed after the pixel points of the mask area of the target image are detected to be cleared; the denoising process can include filtering processing, such as median filtering processing, to reduce image distribution noise; Figure 2 The target image and the verification question corresponding to the target object shown are: the target object in the image to be processed is the cultural relic object "horse". The target image obtained by masking the target object "horse" in the image to be processed based on the mask area is a target image in which the target object is covered by each pixel point corresponding to the sand and gravel texture type. The verification question corresponding to the target object is "The name of the cultural relic on the left is".
[0088] In addition, after obtaining the target image, the target image and the verification question can be synthesized, and the synthesized target image can be displayed. Figure 2 It can also be a schematic diagram of the synthesized target image.
[0089] During the specific execution process, after the target image is generated, the login verification can be performed by clearing the pixels in the mask area of the target image. By clearing the interaction, the target image cannot be automatically recognized, thereby improving the security of the login verification. In an optional implementation manner provided by this embodiment, the pixels in the mask area of the target image are cleared, which is implemented in the following manner:
[0090] Collecting a plurality of erased pixel points according to an erase instruction of pixel points in a mask area of the target image, and performing curve fitting processing based on the plurality of erased pixel points to obtain a fitting curve;
[0091] The erasing path is clipped in the mask area of the target image according to the fitting curve, and the pixel points included in the erasing block formed by the clipped erasing path are cleared.
[0092] Among them, the erasing instruction of the pixel points in the mask area refers to the instruction to erase the pixel points in the mask area; the multiple erasing pixel points refer to the multiple pixel points that need to be erased. Optionally, the erasing instruction of the pixel points in the mask area is generated based on the dragging operation of the erasing tool, and the erasing instruction of the pixel points in the mask area can also be generated when the number of boundary pixel points covered by the erasing tool reaches a preset number threshold. For example, if the preset number threshold is x, then the erasing instruction is generated when the number of boundary pixel points covered by the erasing tool reaches the preset number threshold, for example, one pixel point is collected to points[] for every 20 pixels, that is, each login verification may have multiple erasing actions, and each erasing action collects the pixel point points[]. The erasing tool can be a brush. The fitting curve can be a closed curve.
[0093] Specifically, multiple erased pixel points can be collected according to the erasing instruction of the pixel points in the mask area, and curve fitting processing can be performed based on the multiple erased pixel points to obtain a Bezier fitting curve. For example, the built-in curve fitting method of the JS (JavaScript) script can be called to perform curve fitting processing based on multiple erased pixel points to obtain a Bezier fitting curve.
[0094] For example, according to the erase instruction of the pixel points in the mask area, multiple erased pixel points[] are collected, and the built-in BezierCurveTo() method of JS is called to perform curve fitting processing based on the multiple erased pixel points[] to obtain a third-order Bezier curve. During the curve fitting processing, the BezierCurveTo() method can continuously take a point group [p0, p1, p2, p3] from points[], and use the first pixel point as the data point and the second pixel point as the control point to perform curve fitting. For example, p0 and p3 are data points, and p1 and p2 are control points. The process of taking the point group for curve fitting can be repeated many times, and then all curve segments are connected to obtain a third-order Bezier curve.
[0095] After obtaining the Bezier fitting curve as described above, the erasing path can be clipped in the mask area of the target image according to the Bezier fitting curve, and the pixel points contained in the erasing block formed by the clipped erasing path can be cleared; for example, the clip() of Canvas can be used to clip the erasing path in the mask area of the target image according to the Bezier fitting curve, and the pixel points contained in the erasing block formed by the clipped erasing path can be cleared, and the cleared image obtained after clearing can be displayed, as shown in FIG. Figure 3 In the cleared image shown, the pixels in the mask area are cleared, and the target object "horse" is displayed; the Bezier fitting curve obtained by curve fitting is used to clip the erasing path, so that the erased block displayed to the user can be visually smoother and reduce jitter. At the same time, the curve area of the smooth fitting curve can reduce the difficulty of subsequent calculation of the erased area.
[0096] In practical applications, the larger the erased area of the mask region of the target image, the larger the displayed area of the target object, and the easier it is to answer the verification question corresponding to the target object. Therefore, in order to further verify that the login process is a real user operation, it is possible to determine whether to obtain the candidate answer to the verification question corresponding to the target object based on the ratio of the erased area of the mask region to the mask area of the mask region. In an optional implementation provided by this embodiment, based on the above-mentioned erasing path clipping in the mask region of the target image according to the fitting curve, and clearing the pixel points contained in the erased block formed by the erased path obtained by erasing, the following operations are performed during the login verification process:
[0097] Calculating a curve area based on the fitting curve, and calculating an erased area according to the curve area, the plurality of erased pixel points and historical erased pixel points;
[0098] Calculate the ratio of the erased area to the mask area of the mask area of the target image, and when the ratio reaches a ratio threshold, obtain candidate answers for the verification question corresponding to the target object, and perform login processing when the selected answer selected based on the candidate answers is a preset answer.
[0099] Wherein, the curve area refers to the area of the closed area formed by the fitting curve. The historically erased pixels include the pixels that have been erased in the mask area in this login verification. The erased area refers to the area of the pixels in the mask area that have been erased. The mask area of the mask area of the target image can be the object area of the target object in the image to be processed, and the mask area of the mask area can be calculated based on the boundary coordinate information of the target object in the image to be processed. The preset answer refers to the correct answer to the verification question.
[0100] Specifically, in the process of calculating the curve area based on the fitting curve, the measureText() method of Canvas may be called to calculate the curve area of the fitting curve.
[0101] On this basis, in order to improve the accuracy and effectiveness of the erased area and avoid adding invalid erased area to the erased area, in an optional implementation provided by this embodiment, in the process of calculating the erased area according to the curve area, the multiple erased pixel points and the historical erased pixel points, the following operations are performed:
[0102] Calculate the intermediate newly added area according to the curve area and the tool area of the erasing tool;
[0103] Calculating first boundary information of the plurality of erased pixel points and second boundary information of the historically erased pixel points, and calculating an intersection area according to the first boundary information and the second boundary information;
[0104] The effective new area is calculated according to the intermediate new area and the intersection area, and the erased area is calculated according to the effective new area and the historically erased area corresponding to the historically erased pixel point.
[0105] Among them, the first boundary information of the multiple erased pixels may be the convex hull of the multiple erased pixels, that is, the first convex hull; the second boundary information of the historically erased pixels may be the convex hull of the historically erased pixels, that is, the second convex hull. The intersection area may be the area of the intersection shape of the first convex hull and the second convex hull, and specifically may be the area of the intersection polygon. The historically erased area corresponding to the historically erased pixels refers to the area of the mask area that has been erased corresponding to the pixels that have erased the mask area in this login verification.
[0106] Specifically, in the process of calculating the intermediate added area according to the curve area and the tool area of the erasing tool, the ratio of the curve area to the tool area can be calculated, and the product of the integer in the ratio and the tool area is calculated as the intermediate added area; in the process of calculating the first boundary information of the multiple erased pixel points and the second boundary information of the historically erased pixel points, and calculating the intersection area according to the first boundary information and the second boundary information, the first convex hull of the multiple erased pixel points and the second convex hull of the historically erased pixel points can be calculated, and the area of the intersection shape of the first convex hull and the second convex hull is calculated as the intersection area; in the process of calculating the effective added area according to the intermediate added area and the intersection area, the difference between the intermediate added area and the intersection area can be calculated as the effective added area; in the process of calculating the erased area according to the effective added area and the historically erased area corresponding to the historically erased pixel points, the sum of the effective added area and the historically erased area corresponding to the historically erased pixel points can be calculated as the erased area.
[0107] Specifically, the first convex hull of multiple erased pixels and the second convex hull of historically erased pixels can be calculated through the convex-hull library, and the area of the intersection shape of the first convex hull and the second convex hull can be calculated through the intersect-polygon library as the intersection area.
[0108] For example, the curve area of the fitting curve is A, and the tool area of the erasing tool is width 20*height 20=400. The ratio of the curve area A to the tool area 400 is calculated, and the product of the integer n in the ratio and the tool area 400 is calculated as the intermediate newly added area a. The first convex hull of multiple erased pixel points and the second convex hull of historical erased pixel points areaPoints[] are calculated, and the area of the intersection polygon area of the first convex hull and the second convex hull is calculated as the intersection area. The difference between the intermediate newly added area a and the intersection area is calculated as the effective newly added area a1, and the effective newly added area a1 is added to the historical erased area corresponding to the historical erased pixel point to obtain the erased area. In this way, the area in the intermediate newly added area that is repeated with the historical erased pixel point is removed, thereby improving the effectiveness of the erased area.
[0109] After that, the ratio of the erased area to the masked area of the masked area is calculated. When the ratio reaches the ratio threshold, the candidate answers to the verification question corresponding to the target object are obtained, and the login process is performed when the selected answer based on the candidate answers is the preset answer. In this way, login verification is performed by combining erasure with verification questions, which further improves the complexity and fun of login verification, increases the difficulty of automatic machine recognition, and achieves the flexibility of login verification by combining the two methods, making identity verification more reliable.
[0110] Specifically, when the ratio reaches a ratio threshold, candidate answers to the verification question corresponding to the target object can be obtained from the server, and login processing can be performed if the selected answer based on the candidate answers is the preset answer; specifically, when the ratio reaches the ratio threshold, the client can send an answer acquisition request to the server, and receive the candidate answers to the verification question corresponding to the target object sent by the server. The client collects the selected answer from the candidate answers and sends it to the server. The server detects whether the selected answer from the candidate answers is the correct answer. If so, a verification success reminder is returned to the client. The client can perform a first marking process on the preset answer in the candidate answers based on the verification success reminder, and display the first marking result. Further login processing can also be performed. If not, a verification failure reminder is returned to the client. The client can perform a second marking process on the selected answer in the candidate answers based on the verification failure reminder, and display the second marking result.
[0111] like Figure 3 As shown in FIG. 1 , when the ratio reaches the ratio threshold, the candidate answers of the verification question corresponding to the target object are obtained as follows: “Pig Stepping on Flying Swallow, Horse Stepping on Flying Swallow, Horse Stepping on Airplane, Cow Stepping on Flying Swallow”. If the selected answer in the candidate answers is the preset answer “Horse Stepping on Flying Swallow”, the preset answer “Horse Stepping on Flying Swallow” in the candidate answers is first marked using the first marking symbol “√”. Figure 4The first marking result shown in the figure is displayed. If the selected answer in the candidate answers is not the preset answer "Horse Stepping on Flying Swallow", the second marking symbol "×" is used to perform the second marking process on the selected answer "Horse Stepping on Airplane" in the candidate answers. Figure 5 The second marking result shown is displayed.
[0112] It should be supplemented that each optional implementation method in step S102 to step S108 provided in this embodiment can be executed independently as needed, or can be combined and referenced with each other. At the same time, each specific execution step in each optional implementation method can also be executed independently, and this embodiment does not make specific limitations.
[0113] In summary, the image processing method provided by the present embodiment first determines the mask area of the target object in the image to be processed, generates the moving direction angle and deflection angle of each pixel point corresponding to the mask texture type of the mask area, calculates the offset direction angle of each pixel point according to the moving direction angle and the deflection angle, determines the moving distance of each pixel point based on the maximum moving step length, and calculates the expected coordinate information of each pixel point based on the moving distance, the offset direction angle and the current coordinate information of each pixel point; secondly, corrects the coordinates of each pixel point according to the expected coordinate information of each pixel point, the coordinate information of the remaining pixels and the mask area to obtain the corrected coordinate information of each pixel point; calculates the distance based on the corrected coordinate information and the specific coordinate information of the mask area; determines the distribution block of each pixel point in multiple distribution blocks in the mask area based on the distance, and generates a random number for each pixel point; if the random number is less than the pixel distribution threshold corresponding to the distribution block, then Each pixel is moved according to the corrected coordinate information, and after the number of distribution detections of each pixel is greater than the number threshold, the output intermediate image obtained by masking the target object in the processed image based on the mask area is denoised to obtain the target image, so as to perform login verification after the pixels of the mask area of the target image are detected and cleared, thereby improving the richness of the target image by masking the mask texture type and the target object in the processed image through the mask area, and performing login verification by clearing the pixels of the mask area of the target image to improve the fun of login verification, and improving the complexity of login verification through clearing interaction, thereby increasing the difficulty of automatic recognition in the login verification process, and improving the security of login verification, and at the same time, determining whether to move each pixel to the distribution block of each pixel through the random number of each pixel, and flexibly controlling the pixel distribution density of multiple distribution blocks in the mask area.
[0114] The following combination Figure 6 , taking the application of the image processing method provided by this embodiment in a cultural relic scene as an example, the image processing method provided by this embodiment is further described. Figure 6 ,The image processing method applied to the cultural relics scene specifically includes the following steps.
[0115] Step S602: Acquire a cultural relic image and determine a mask region of the cultural relic in the cultural relic image.
[0116] Optionally, the cultural relic image determines the type of the cultural relic website based on the website identifier carried in the website login request, and is obtained by screening from a corresponding image data set based on the type of the cultural relic website.
[0117] Step S604 , generating a moving direction angle and a deflection angle of each pixel point corresponding to the mask texture type of the mask area, and calculating an offset direction angle of each pixel point according to the moving direction angle and the deflection angle.
[0118] Step S606, determining the moving distance of each pixel point based on the maximum moving step length, and calculating the expected coordinate information of each pixel point based on the moving distance, the offset direction angle and the current coordinate information.
[0119] Step S608, performing distance calculation based on the expected coordinate information of each pixel point and the coordinate information of the remaining pixel points.
[0120] Step S610: If the calculated distance is greater than or equal to the preset distance threshold, the expected coordinate information is disturbed to obtain the disturbed coordinate information of each pixel point, and when the disturbed coordinate information is in the mask area, the distance is calculated based on the disturbed coordinate information and the center coordinate information of the mask area.
[0121] Step S612, determining the distribution block of each pixel point among multiple distribution blocks at the center position corresponding to the center coordinate information based on the distance, and generating a random number for each pixel point.
[0122] Step S614: if the random number is smaller than the pixel distribution threshold corresponding to the distribution block, each pixel point is moved according to the disturbance coordinate information.
[0123] Step S616, after the number of distribution detections of each pixel point is greater than the number threshold, the intermediate image obtained by masking the cultural relics in the cultural relics image based on the mask area is denoised to obtain the target image, so as to perform login verification after the pixel points of the mask area of the target image are detected and cleared.
[0124] The target image may be a captcha image.
[0125] It should be noted that any one of steps S602 to S616 or any combination of multiple steps can be replaced by the corresponding technical means provided in the above steps S102 to S108 according to the needs of implementation and deployment, and will not be described one by one here.
[0126] Figure 7A schematic diagram of an image processing device provided by an embodiment of the present invention is shown in FIG. Figure 7 As shown, the device comprises:
[0127] The image acquisition module 702 is used to acquire the image to be processed and determine the mask area of the target object in the image to be processed;
[0128] A coordinate calculation module 704, configured to calculate expected coordinate information of each pixel point according to current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area;
[0129] A distance calculation module 706 is used to perform distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and perform distribution detection on each pixel point of the mask area based on the calculated distance;
[0130] The image output module 708 is used to output a target image obtained by masking the target object in the image to be processed based on the mask area if the detection is passed, so as to perform login verification after detecting that the pixels in the mask area of the target image are cleared.
[0131] The image processing device provided in this embodiment firstly acquires the image to be processed by running the image acquisition module 702, and determines the mask area of the target object in the image to be processed, runs the coordinate calculation module 704, calculates the expected coordinate information of each pixel according to the current coordinate information and movement parameters of each pixel corresponding to the mask texture type of the mask area, then runs the distance calculation module 706, performs distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performs distribution detection on each pixel in the mask area based on the calculated distance, and finally runs the image output module 708. If the detection passes, the target image obtained by masking the target object in the image to be processed based on the mask area is output, so as to perform login verification after detecting that the pixels in the mask area of the target image are cleared, so as to increase the richness of the image used for login verification and the difficulty of automatic recognition.
[0132] The image processing device provided in one embodiment of the present specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0133] Furthermore, an embodiment of the present specification also provides an image processing device, Figure 8 A schematic diagram of the structure of an image processing device provided in an embodiment of this specification is shown in FIG. Figure 8As shown, the device includes: a memory 801, a processor 802, a bus 803 and a communication interface 804. The memory 801, the processor 802 and the communication interface 804 communicate through the bus 803, and the communication interface 804 may include an input and output interface, which includes but is not limited to a keyboard, a mouse, a display, a microphone, a loudspeaker, etc.
[0134] Figure 8 In the embodiment, the memory 801 stores computer executable instructions that can be run on the processor 802, and when the computer executable instructions are executed by the processor 802, the following process is implemented:
[0135] Acquire an image to be processed, and determine a mask area of a target object in the image to be processed;
[0136] Calculating expected coordinate information of each pixel point according to current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area;
[0137] Performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance;
[0138] If the detection is successful, a target image obtained by masking the target object in the image to be processed based on the mask area is output, so as to perform login verification after it is detected that the pixels in the mask area of the target image are cleared.
[0139] The image processing device provided in this embodiment determines the mask area of the target object in the image to be processed through the cooperation of the memory 801, the processor 802, the bus 803 and the communication interface 804, calculates the expected coordinate information of each pixel point based on the current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area, and then performs distance calculation in combination with the expected coordinate information of each pixel point and the specific coordinate information of the mask area, and performs distribution detection on each pixel point in the mask area based on the calculated distance, and outputs the target image obtained by masking the target object in the image to be processed based on the mask area after the detection is passed, so as to perform login verification after the pixels in the mask area of the target image are cleared, so as to increase the richness of the image used for login verification and the difficulty of automatic recognition.
[0140] The image processing device provided in one embodiment of the present specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0141] Furthermore, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented:
[0142] Acquire an image to be processed, and determine a mask area of a target object in the image to be processed;
[0143] Calculating expected coordinate information of each pixel point according to current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area;
[0144] Performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance;
[0145] If the detection is successful, a target image obtained by masking the target object in the image to be processed based on the mask area is output, so as to perform login verification after it is detected that the pixels in the mask area of the target image are cleared.
[0146] The computer-readable storage medium provided in this embodiment determines the mask area of the target object in the image to be processed, calculates the expected coordinate information of each pixel based on the current coordinate information and movement parameters of each pixel corresponding to the mask texture type of the mask area, and then performs distance calculation in combination with the expected coordinate information of each pixel and the specific coordinate information of the mask area, and performs distribution detection on each pixel in the mask area based on the calculated distance. After the detection is passed, a target image obtained by masking the target object in the image to be processed based on the mask area is output, so as to perform login verification after the pixels in the mask area of the target image are cleared, so as to increase the richness of the image used for login verification and the difficulty of automatic recognition.
[0147] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0148] The computer-readable storage medium provided in an embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0149] Furthermore, another embodiment of the present specification also provides a computer program product, which implements the following process when executed by a processor:
[0150] Acquire an image to be processed, and determine a mask area of a target object in the image to be processed;
[0151] Calculating expected coordinate information of each pixel point according to current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area;
[0152] Performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance;
[0153] If the detection is successful, a target image obtained by masking the target object in the image to be processed based on the mask area is output, so as to perform login verification after it is detected that the pixels in the mask area of the target image are cleared.
[0154] The computer program product provided in this embodiment determines the mask area of the target object in the image to be processed, calculates the expected coordinate information of each pixel based on the current coordinate information and movement parameters of each pixel corresponding to the mask texture type of the mask area, and then performs distance calculation in combination with the expected coordinate information of each pixel and the specific coordinate information of the mask area, and performs distribution detection on each pixel in the mask area based on the calculated distance. After the detection is passed, a target image obtained by masking the target object in the image to be processed based on the mask area is output, so as to perform login verification after the pixels in the mask area of the target image are cleared, so as to increase the richness of the image used for login verification and the difficulty of automatic recognition.
[0155] The computer program product provided in one embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0156] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0157] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0158] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0159] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0160] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0161] Memory may include non-permanent storage in a computer-readable storage medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable storage medium.
[0162] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0163] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0164] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may 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.) that contain computer-usable program code.
[0165] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire an image to be processed, and determine a mask area of a target object in the image to be processed; Calculating expected coordinate information of each pixel point according to current coordinate information and movement parameters of each pixel point corresponding to the mask texture type of the mask area; Performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance; If the detection is successful, a target image obtained by masking the target object in the image to be processed based on the mask area is output, so as to perform login verification after it is detected that the pixels in the mask area of the target image are cleared.
2. The image processing method according to claim 1, characterized in that: The calculating the expected coordinate information of each pixel point according to the current coordinate information and the movement parameter of each pixel point corresponding to the mask texture type of the mask area includes: Generate a moving direction angle and a deflection angle of each pixel point, and calculate an offset direction angle of each pixel point according to the moving direction angle and the deflection angle; The moving distance of each pixel point is determined based on the maximum moving step length, and the expected coordinate information of each pixel point is calculated based on the moving distance, the offset direction angle and the current coordinate information.
3. The image processing method according to claim 2, characterized in that: The generating of the moving direction angle and the deflection angle of each pixel point, and calculating the offset direction angle of each pixel point according to the moving direction angle and the deflection angle, comprises: Generating a moving direction angle of each pixel point based on a preset moving direction angle interval, and generating a deflection angle of each pixel point based on a preset deflection angle interval; The sum of the moving direction angle and the deflection angle is calculated as the offset direction angle.
4. The image processing method according to claim 1, characterized in that: The performing distance calculation based on the expected coordinate information and the specific coordinate information of the mask area, and performing distribution detection on each pixel point of the mask area based on the calculated distance, includes: According to the expected coordinate information of each pixel point, the coordinate information of the remaining pixel points and the mask area, coordinate correction is performed on each pixel point to obtain the corrected coordinate information of each pixel point; The distance is calculated based on the corrected coordinate information and the specific coordinate information, and distribution detection is performed on each pixel point in the mask area based on the distance.
5. The image processing method according to claim 4, characterized in that: The step of correcting the coordinates of each pixel point according to the expected coordinate information of each pixel point, the coordinate information of the remaining pixel points and the mask area to obtain the corrected coordinate information of each pixel point includes: Performing distance calculation according to the expected coordinate information of each pixel point and the coordinate information of the remaining pixel points; If the calculated distance is greater than or equal to a preset distance threshold, the expected coordinate information is disturbed to obtain the disturbed coordinate information of each pixel point, and when the disturbed coordinate information is in the mask area, the disturbed coordinate information is used as the corrected coordinate information.
6. The image processing method according to claim 4, characterized in that: The performing distribution detection on each pixel point in the mask area based on the distance includes: Determine a distribution block of each pixel point among a plurality of distribution blocks in the mask area based on the distance, and generate a random number for each pixel point; If the random number is smaller than the pixel distribution threshold corresponding to the distribution block, each pixel point is moved according to the corrected coordinate information, and the detection is determined to be passed after the number of distribution detections of each pixel point is greater than the number threshold.
7. The image processing method according to claim 1, characterized in that: The pixels in the mask area of the target image are cleared, which is achieved in the following way: Collecting a plurality of erased pixel points according to an erase instruction of pixel points in a mask area of the target image, and performing curve fitting processing based on the plurality of erased pixel points to obtain a fitting curve; The erasing path is clipped in the mask area of the target image according to the fitting curve, and the pixel points included in the erasing block formed by the clipped erasing path are cleared.
8. The image processing method according to claim 7, characterized in that: The login verification comprises: Calculating a curve area based on the fitting curve, and calculating an erased area according to the curve area, the plurality of erased pixel points and historical erased pixel points; Calculate the ratio of the erased area to the mask area of the mask area of the target image, and when the ratio reaches a ratio threshold, obtain candidate answers for the verification question corresponding to the target object, and perform login processing when the selected answer selected based on the candidate answers is a preset answer.
9. The image processing method according to claim 8, characterized in that: The calculating the erased area according to the curve area, the plurality of erased pixel points and the historical erased pixel points comprises: Calculate the intermediate newly added area according to the curve area and the tool area of the erasing tool; Calculating first boundary information of the plurality of erased pixel points and second boundary information of the historically erased pixel points, and calculating an intersection area according to the first boundary information and the second boundary information; The effective new area is calculated according to the intermediate new area and the intersection area, and the erased area is calculated according to the effective new area and the historically erased area corresponding to the historically erased pixel point.
10. The image processing method according to claim 1, characterized in that: The image to be processed is obtained in the following manner: Determine the website type according to the website identifier carried in the website login request; The to-be-processed images are screened out from the image data set based on the website type.
