PICTURE PROCESSING METHOD AND APPARATUS, ELECTRONIC DEVICE AND STORAGE MEDIUM

Information

  • Patent Application
  • 20230015096
  • Publication Number
    20230015096
  • Date Filed
    September 29, 2022
    a year ago
  • Date Published
    January 19, 2023
    a year ago
  • Inventors
  • Original Assignees
    • BEIJNG BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Abstract
A picture processing method includes: identifying a target area where a QR code is located in a picture; obtaining parameters of the picture; and performing effacing process on the target area of the picture based on the parameters.
Description
CROSS REFERENCE TO RELATED APPLICATIONS

This application claims priority and benefits to Chinese Application No. 202111189145.7, filed on Oct. 12, 2021, the entire content of which is incorporated herein by reference.


TECHNICAL FIELD

The disclosure relates to a field of artificial intelligence technologies, especially to a field of computer vision technologies, and in particular to a picture processing method, a picture processing apparatus, an electronic device and a storage medium.


BACKGROUND

Currently, in order to avoid potential security risks caused by quick response (QR) codes, all pictures will be reviewed and pictures containing the QR codes will be deleted.


For most pictures on the Internet, the remaining part of the picture after removing the QR code and the content directed by the AR code may have high use value. If the whole picture is deleted, the picture containing the QR code cannot be transmitted normally.


SUMMARY

According to a first aspect, a picture processing method is provided. The method includes: identifying a target area where a quick response (QR) code is located in a picture; obtaining parameters of the picture; and performing effacing process on the target area of the picture based on the parameters.


According to a second aspect, an electronic device is provided. The electronic device includes: at least one processor and a memory communicatively coupled to the at least one processor. The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is configured to perform the method according to the first aspect of the disclosure.


According to a third aspect, a non-transitory computer-readable storage medium having computer instructions stored thereon is provided. The computer instructions are configured to cause a computer to perform the method according to the first aspect of the disclosure.


It is understandable that the content described in this section is not intended to identify key or important features of the embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Additional features of the disclosure will be easily understood based on the following description.





BRIEF DESCRIPTION OF THE DRAWINGS

The drawings are used to better understand the solution and do not constitute a limitation to the disclosure.



FIG. 1 is a flowchart illustrating a picture processing method according to some examples of the disclosure.



FIG. 2 is a flowchart illustrating a picture processing method according to some examples of the disclosure.



FIG. 3 is a flowchart illustrating a picture processing method according to some examples of the disclosure.



FIG. 4 is a schematic diagram illustrating a 36-color standard color card.



FIG. 5 is a flowchart illustrating a picture processing method according to some examples of the disclosure.



FIG. 6 is a flowchart illustrating a picture processing method according to some examples of the disclosure.



FIG. 7 is a flowchart illustrating a picture processing method according to some examples of the disclosure.



FIG. 8 is a flowchart illustrating a picture processing method according to some examples of the disclosure.



FIG. 9 is a block diagram illustrating a picture processing apparatus according to some examples of the disclosure.



FIG. 10 is a block diagram illustrating a picture processing apparatus according to some examples of the disclosure.



FIG. 11 is a block diagram illustrating an electronic device configured to perform the picture processing method according to some examples of the disclosure.





DETAILED DESCRIPTION

The following describes the exemplary embodiments of the disclosure with reference to the accompanying drawings, which includes various details of the embodiments of the disclosure to facilitate understanding, which shall be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. For clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.


Artificial Intelligence (AI) is a technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. Currently, AI technology has the advantages of high automation degree, high accuracy and low cost, and has been widely used.


Computer Vision (CV) is a science that studies how to make machines “see”, it further refers to a science that causes cameras and computers instead of human eyes to identify, track, and measure targets, and further performs graphics processing, to obtain images more suitable for human eyes to observe or transmit to instruments for detection through computer processing. As a scientific discipline, CV studies related theories and technologies, and tries to generate AI systems that can obtain information from images or multi-dimensional data.


A picture processing method, a picture processing apparatus, an electronic device, and a storage medium according to the embodiments of the disclosure are described below with reference to the accompanying drawings.



FIG. 1 is a flowchart illustrating a picture processing method according to some examples of the disclosure.


As illustrated in FIG. 1, the picture processing method includes the following.


At step S101, a target area where a quick response (QR) code is located in a picture is identified.


The execution body of the picture processing method according to the disclosure may be a picture processing apparatus according to some examples of the disclosure. The picture processing apparatus may be a hardware device with data and information processing capability and/or software required for driving the hardware device. As an example, the execution body may be a workstation, a server, a computer, a user terminal or other devices. The user terminal includes but is not limited to mobile phone, computer, smart voice interaction device, smart home appliance, vehicle-mounted terminal, and the like.


It is noteworthy that the QR code is a coding mode widely used on mobile devices. Compared with traditional bar code, the QR code can store more information and represent more data types. For example, in the scenario of information acquisition, information such as business cards, maps, WIFI passwords, and data can be obtained through the QR code. In the advertisement push scenario, users can directly browse the audio and video advertisements pushed by the merchant after scanning the QR code. In the mobile E-commerce scenario, users can scan the QR code to directly conduct mobile shopping and place an order. In the anti-counterfeiting traceability scenario, users can scan the QR code to check the production place of the product and obtain the consumption place of the product in the background. In the promotion scenarios, users can download electronic coupons and draw lottery after scanning the QR code. In the membership management scenario, users can obtain electronic membership information and carry out membership services through the QR code. In the mobile payment scenario, the product can be scanned by means of the QR code and the payment can be completed through the mobile phone channel provided by the bank or third-party payment. In the account login scenario, users can log in to websites or applications through the QR code.


Due to the open nature of the QR code, the process of generating, storing, transmitting, displaying and using the QR code is almost free from any information security control, some illegal practitioners generate QR codes with malicious functions and spread the QR codes on the Internet. After scanning these malicious QR codes, users will be induced to download illegal applications or jump to designated malicious websites, which will cause the user's computer to be infected with viruses, thereby causing property losses to the user.


In the related art, in order to avoid the potential security risks caused by the QR codes, some service providers will review all pictures and delete the pictures containing the QR codes. However, for most pictures on the Internet, the remaining part of the picture after removing the QR code self and the content directed by the AR code may have high use value.


In view of the above problems, embodiments of the disclosure provide a picture processing method in which the area including the QR code in the picture is effaced, to avoid the possible security risks caused by generation, storage, transmission, display and use of the QR code.


Therefore, the implementation and use cost is low, the valuable content of the picture is preserved as much as possible, the user's demands for normal transmission of the pictures can be satisfied, and the user experience is greatly improved.


The above-mentioned “target area” at least includes a QR code area occupied by the QR code. The above-mentioned “picture” is an image file containing the QR code stored on a cloud server or a host. The identification of the target area where the QR code is located can be carried out in various ways. For example, the identification can be performed through an object detection algorithm, such as You Only Look Once (YOLO, which is a deep convolutional neural network), Faster Region-Convolutional Neural Networks (Faster R-CNN), which are not limited in this disclosure.


It is understandable that, before identifying the target area where the QR code is located in the picture, the QR code is identified by performing QR code identification on the obtained picture. That is, it is determined whether the picture contains a QR code. If it is determined that the picture does not contain any QR code, no processing is performed. If it is determined that the picture contains a QR code, the target area where the QR code is located is identified.


At step S102, parameters of the picture are obtained.


The parameters of the picture containing the QR code are obtained. The above-mentioned “parameters” may include picture parameters of areas other than the target area (i.e., first picture parameters of other areas of the picture other than the target area, which is also called first parameters) and picture parameters of the target area (i.e., second picture parameters of the target area, which is also called second parameters). The first parameters of the other areas may include a dominant color system of the other areas (also called a first dominant color system). The second parameters of the target area may include, but not limited to, a dominant color system of the target area (also called a second dominant color system), attributes of a central icon of the QR code (for example, the logo of the central icon and/or the size of the central icon of the QR code), and a fault-tolerant ratio of the QR code. The specific manner of acquiring the picture parameters is not limited in the disclosure.


At step S103, effacing process is performed on the target area of the picture based on the parameters.


Corresponding effacing process can be performed on the target area of the picture based on the parameters of the picture obtained at the block S102. Depending on the parameters obtained at the block S102, the effacing process modes may include, but are not limited to, a color filling mode, a blurring processing mode and a QR code masking mode.


With the picture processing method according to the disclosure, the target area where the QR code is located in the picture is identified, the parameters of the picture are obtained, and the effacing process is performed on the target area based on the parameters. Therefore, normal dissemination of pictures is realized on the premise of avoiding the potential security risks caused by the QR code by performing the effacing process on the target area where the QR code is located, thereby improving the user experience. Moreover, performing the effacing process based on the parameters of the picture can ensure that the content information of the QR code is effaced or removed as much as possible, thus the aesthetics of the picture will not be greatly reduced, and the user experience can be further improved.



FIG. 2 is a flowchart illustrating a picture processing method according to some examples of the disclosure.


As illustrated in FIG. 2, on the basis of examples related to FIG. 1, the picture processing method according to examples the disclosure may include the following steps.


The step S101 of “identifying the target area where the QR code is located in the picture” may include the following steps S201 and S202.


At step S201, edges of the QR code are identified.


The edges of the QR code in the picture are identified, and coordinate information of the edges of the QR code is obtained. The specific manner of the identification of the edges is not limited in the disclosure.


At step S202, an area enclosed by the edges is determined as the target area.


According to the edges of the QR code obtained at the step S201, the area within the edges is determined as the target area where the QR code is located according to the coordinate information, which is the object to be processed in the subsequent effacing process.


At step S203, parameters of the picture are obtained.


At step S204, effacing process is performed on the target area of the picture based on the parameters.


In detail, steps S203-S204 in this example are the same as steps S102-S103 in the above example, and details are not repeated here.


Further, as illustrated in FIG. 3, the step S203 of “obtaining the parameters of the picture” in the above example may include obtaining a first dominant color system of other areas of the picture excluding the target area, which may specifically include the following steps S301-S302.


At step S301, first color values of pixels within a preset area of the picture other than the target area are obtained.


According to the target area obtained at the step S202, the preset area having an expansion width of X and outside the target area is selected, and color values of the pixels within the preset area are obtained, that is, the first color values are obtained. For example, the first color values can be obtained through a statistic on the Red-Green-Blue (RGB) color values of all pixels within the preset area having the expansion width of X (the value of X can be adjusted according to specific actual needs, which generally ranges from 3 to 5 pixels) and outside the target area.


At step S302, the first dominant color system is determined based on the first color values.


As a feasible implementation, the pixels are divided into groups, and pixels contained in each group separately have the same color. The first dominant color system may be determined based on the number of pixels contained in each group of pixels having the same color. For example, the color corresponding to a group having the largest number of pixels is determined as the first dominant color system.


As another feasible implementation, the first color values of the pixels within the preset area obtained at step S301 are compared once with colors of a Color Card respectively one by one to find, from the Color Card, colors matched with the first color values according to the proximity principle. That is, colors (also called first matched colors) of the Color Card matching with the first color values are determined according to the proximity allocation principle. Each time determining that a first matched color of the Color Card matches with a first color value, the matching count of this first matched color is increased by one. The first dominant color system is determined based on values of respective matching count of the first matched colors. For example, a certain first matched color corresponding to the largest value of the matching count is used as the first dominant color system. The Color Card may be a color wheel having 12 colors, a color card having 24 standard colors, or a color card having 36 standard colors. The color card having 36 standard colors are illustrated as FIG. 4.


Further, as illustrated in FIG. 5, in the case that the second parameters include the second dominant color system of the target area of the picture, the step S203 of “obtaining the parameters of the picture” includes acquiring the second dominant color system of the target area of the picture, which includes the following steps S501-S502.


At step S501, second color values of pixels within the target area are obtained.


According to the target area acquired at the step S202, the second color values of the pixels in the target area are acquired. The acquisition mode of the second color values is the same as that at the step S301, which is not repeated here.


At step S502, a second dominant color system is determined based on the second color values.


As a feasible implementation, the pixels are divided into groups, and pixels contained in each group separately have the same color. The second dominant color system may be determined based on the number of pixels contained in each group of pixels having the same color. For example, the color corresponding to a group having the largest number of pixels is determined as the second dominant color system.


As another feasible implementation, the second color values of the pixels within the target area are compared once with colors of a Color Card respectively one by one to find, from the Color Card, colors matched with the second color values according to the proximity principle. That is, colors (also called first matched colors) of the Color Card matching with the first color values are determined according to the proximity allocation principle. The specific mode is the same as that of step S302, which is not repeated here.


Further, as illustrated in FIG. 6, the step S204 of “performing effacing process on the target area of the picture based on the parameters” in above example may include the following steps S601-S602.


At block S601, an effacing method is obtained.


The effacing method can be set by the system by default, or the effacing method can be preset by users before performing the effacing process on the target area of the picture. The effacing method may include, but is not limited to, a method of filling color to the target area, a method of blurring the target area and a method of adding a QR code masking to the target area. In actual practice, the effacing method can be set based on a configuration file or a configuration database, accompanied by a configuration Graphical User Interface (GUI for short), Any of the three effacing methods can be chose to perform the effacing process on the target area of the picture. The method of blurring the target area may include mosaic processing, and frosted glass processing.


At block S602, the effacing process is performed on the target area by adopting the effacing method based on the parameters.


A color setting operation can be performed based on the picture parameters within the target area where the QR code is located and/or the picture parameters within the other area. For example, reference colors, solid colors and gradient colors can be set for the target area and/or other areas.


In the case where the effacing method is the method of filling color in the target area, the parameters include the first parameters, and the first parameters include the first dominant color system of other areas of the picture other than the target area, the above step S602 of “performing the effacing process on the target area by adopting the effacing method based on the parameters” includes performing color filling on the target area based on the first dominant color system.


In detail, the first dominant color system is used to perform the color filling on the target area. For example, the first dominant color system can be used as the reference color to set solid colors or gradient colors for the target area. Setting the gradient colors for the target area may be setting linear gradient colors or center-radial gradient colors. Performing the color filling on the target area in the picture according to the first dominant color system of other areas of the picture other than the target area can make the color of the processed target area similar to the color of the other areas of the picture, so as to ensure the aesthetics of the picture as much as possible.


In the case where the effacing method is the method of blurring the target area, the parameters include the second parameters, and the second parameters include the second dominant color system of the target area, the above step S602 of “performing the effacing process on the target area by adopting the effacing method based on the parameters” may include: determining a reference color to be used in the method of blurring the target area based on the second dominant color system, and performing the effacing process on the target area based on the reference color.


For example, colors within the target area is used as the reference color. That is, the reference color to be used in the method of blurring the target area is determined based on the second dominant color system within the target area. For example, the second dominant color system within the target area is used as the reference color to be used by the method of blurring the target area to performing the blurring processing on the target area. Determining the colors within the target area as the reference color, compared with the traditional blurring method of unified black and white mosaic or white frosted glass, can make the blurring effect smoother and reduce the impact on the aesthetics of the picture as much as possible.


In the case where the effacing method is the method of adding a QR code mask to the target area, the parameters include the second parameters, and the second parameters include at least one of the second dominant color system of the target area, attributes of a central icon of the QR code, and the fault-tolerant ratio of the QR code, as illustrated in FIG. 7, the above step S602 of “performing the effacing process on the target area by adopting the effacing method based on the parameters” may include the following steps S701-S704.


At step S701, a QR code mask is displayed within the target area, and content corresponding to the QR code mask is null or security prompt information.


The content of the QR code mask can be set as null or security prompt information, where the security prompt information may be the wording “** reminds you, do not access the QR code from unknown sources, beware of fraud!”. Therefore, when the user scans the QR code mask, the specific security prompt information can be provided to the user. This effacing method has little impact on the original picture and does not damage the aesthetics of the original picture. In the target area, the QR code mask is displayed above the QR code. The QR code mask is a generated QR code having the same parameters as the original QR code, but the content of the generated QR code is different from that of the original QR code. There are many technical options, for example, QRcode library in Python (a programming language) language, MyQR (a function for creating QR codes) library or QRCode.js (QR code generation) library in JavaScript (a programming language) language. The parameters of the QR code mask can refer to the second parameters, that is, the second dominant color system, the attributes of the central icon of the QR code, the size of the central icon of the QR code, and the fault-tolerant ratio of the QR code.


At step S702, the color is set for the QR code mask based on the second dominant color system.


The reference color of the QR code mask is set based on the second dominant color system in the second parameters, that is, the color of the QR code mask is set based on the second dominant color system in the second parameters. For example, the second dominant color system in the second parameters is set as the color of the QR code mask, which can be set through a configuration file or a configuration database based on the configuration GUI.


At step S703, attributes of a central icon of the QR code mask is set based on the attributes of the central icon of the QR code.


The central icon of the QR code in the second parameters can be set as the central icon of the QR code mask, and the size of the central icon of the QR code mask is the same as the size of the central icon in the second parameters, which can be set through a configuration file or a configuration database based on the configuration GUI.


At step S704, a fault-tolerant ratio of the QR code mask is set based on the fault-tolerant ratio of the QR code.


The fault-tolerant ratio of the QR code in the second parameters can be set as the fault-tolerant ratio of the QR code mask, which can be set through a configuration file or a configuration database based on the configuration GUI.


According to the parameters of the original QR code in the picture, the QR code mask with the same style as the original QR code is generated, which can ensure the aesthetics of the picture as much as possible. The content of the QR code mask is set to be null or security prompt information, which can avoid the potential security risks caused by the original QR code.


With the picture processing method according to the disclosure, the area enclosed by the identified edges of the QR code is determined as the target area, and the first color values of the pixels within the target area and/or the second color values of the pixels with the other areas of the picture other than the target area and corresponding first matching colors and second matching colors are obtained. The first dominant color system and the second dominant color system are determined based on the number of successful match times corresponding to each matched color, and after the system settings including the effacing method setting and the color setting are performed based on the effacing parameters, the picture is effaced by adopting the corresponding effacing method. With the picture processing method according to examples of the disclosure, by effacing the target area where the QR code is located of the picture, normal spread of the picture is realized on the premise of avoiding the potential security risks caused by the QR code, and the user experience is improved. The effacing process is performed based on the parameters of the picture, such as the method of filling color to the target area is performed based on the first dominant color system of the picture other than the target area, the method of blurring the target area is performed based on the second dominant color system within the target area, and the method of adding a QR code mask to the target area is performed based on the second dominant color system, the attributes of the central icon of the QR code and the fault-tolerant ratio of the QR code. It is ensured that after the content information of the QR code is effaced as much as possible, the aesthetics of the picture will not be greatly reduced, and the user experience will be further improved.


In order to clearly illustrate the picture processing method according to the disclosure, the specific implementation process will be described below with reference to FIG. 8. As illustrated in FIG. 8, the method includes the following steps.


At step S801, edges of the QR code are identified.


At step S802, an area within the edges is determined as the target area.


At step S803, first color values of pixels within a preset area of the picture other than the target area are obtained.


At step S804, first matched colors matched with the first color values of the pixels within the preset area are determined from a color card.


At step S805, the first dominant color system is determined based on the number of successful match times between each first matched color and the first color values of the pixels within the preset area.


At block S806, second color values of pixels within the target area are obtained.


At block S807, second matched colors matched with the second color values of the pixels within the target area are determined from the color card.


At block S808, the second dominant color system is determined based on the number of successful match times between each second matched color and the second color values of the pixels within the target area.


At block S809, attributes of a central icon of the QR code and a fault-tolerant ratio of the QR code within the target area are obtained.


At block S810, an effacing method is obtained.


At block S811, color filling is performed on the target area based on the first dominant color system.


At block S812, a reference color to be used in the method of blurring the target area is determined based on the second dominant color system, and the effacing process is performed on the target area based on the reference color.


At block S813, a QR code mask is displayed in the target area, and content of the QR code mask is null or security prompt information.


At block S814, a color is set for the QR code mask based on the second dominant color system.


At block S815, attributes of a central icon of the QR code mask is set based on the attributes of the central icon of the QR code.


At block S816, a fault-tolerant ratio of the QR code mask is set based on the fault-tolerant ratio of the QR code.



FIG. 9 is a block diagram of a picture processing apparatus according to some examples of the disclosure.


As illustrated in FIG. 9, the picture processing apparatus 900 includes: an identifying module 901, an obtaining module 902 and an effacing module 903.


The identifying module 901 is configured to identify a target area where a QR code is located in a picture.


The obtaining module 902 is configured to obtain parameters of the picture.


The effacing module 903 is configured to perform effacing process on the target area of the picture based on the parameters.


It is noteworthy that the above explanation of the examples of the picture processing method is applicable to the picture processing apparatuses according to examples of the disclosure, and the specific processes will not be repeated here.


With the picture processing apparatus according to the disclosure, the target area where the QR code is located in the picture is identified, the parameters of the picture are obtained, and the effacing process is performed on the target area of the picture based on the parameters. Therefore, normal dissemination of the picture is realized on the premise of avoiding the potential security risks caused by the QR code by performing the effacing process on the target area where the QR code is located, thereby improving the user experience. Moreover, the effacing process is performed based on the parameters of the picture to ensure that the content information of the QR code is effaced as much as possible, thus the aesthetics of the picture will not be greatly reduced, and the user experience can be further improved.



FIG. 10 is a block diagram illustrating a picture processing apparatus according to some examples of the disclosure.


As illustrated in FIG. 10, the picture processing apparatus 1000 includes: an identifying module 1001, an obtaining module 1002 and an effacing module 1003.


The identifying module 1001 has the same structure and function as the identifying module 901 in the previous example, the obtaining module 1002 has the same structure and function as the obtaining module 902 in the previous example, and the effacing module 1003 has the same structure and function as the effacing module 903 in the previous example.


The identifying module 1001 further includes: an identifying unit 10011 and a first determining unit 10012. The identifying unit 10011 is configured to identify edges of the QR code. The first determining unit 10012 is configured to determine an area enclosed by the edges as the target area.


The parameters include: first parameters of other areas of the picture other than the target area and/or second parameters of the target area. The first parameters include a first dominant color system. The second parameters include at least one of a second dominant color system, attributes of a central icon of the QR code and a fault-tolerant ratio of the QR code.


The obtaining module 1002 includes: a first obtaining unit and a second determining unit. The first obtaining unit is configured to obtain first color values of pixels within a preset area of the picture other than the target area. The second determining unit is configured to determine the first dominant color system based on the first color values.


The second determining unit includes a first determining sub-unit and a second determining sub-unit. The first determining sub-unit is configured to determine, from a color card, first matched colors matched with the first color values of the pixels within the preset area. The second determining sub-unit is configured to determine the first dominant color system based on the number of successful match times between each first matched color and the first color values of the pixels within the preset area.


In the case that the second parameters include the second dominant color system, the obtaining module 1002 includes a second obtaining unit and a third determining unit. The second obtaining unit is configured to obtain second color values of pixels within the target area. The third determining unit is configured to determine the second dominant color system based on the second color values.


The third determining unit includes: a third determining sub-unit and a fourth determining sub-unit. The third determining sub-unit is configured to determine, from a color card, second matched colors matched with the second color values of the pixels within the target area. The fourth determining sub-unit is configured to determine the second dominant color system based on the number of successful match times between each second matched color and the second color values of the pixels within the target area.


The effacing module 1003 includes a third obtaining unit and an effacing unit. The third obtaining unit is configured to obtain an effacing method. The effacing unit is configured to perform the effacing process on the target area based on the parameters by adopting the effacing method.


The effacing method includes any one of: a method of filling color to the target area, a method of blurring the target area, and a method of adding a QR code mask to the target area. In the case that the effacing method is the method of filling color to the target area, the parameters include first parameters, and the first parameters include the first dominant color system of the other areas of the picture, the effacing unit includes: a filling sub-unit, configured to perform color filling on the target area based on the first dominant color system.


In the case that the effacing method is the method of blurring the target area, the parameters include second parameters, and the second parameters include the second dominant color system of the target area, the effacing unit includes: an effacing sub-unit configured to determine a reference color to be used in the method of blurring the target area based on the second dominant color system, and perform the effacing process on the target area based on the reference color.


In the case that the effacing method is the method of adding a QR code mask to the target area, the parameters include the second parameters, and in the case that the second parameters include at least one of: the second dominant color system of the target area, attributes of a central icon of the QR code and a fault-tolerant ratio of the QR code, the effacing unit includes at least one of a displaying sub-unit, a first setting sub-unit, a second setting sub-unit and a third setting sub-unit. The displaying sub-unit is configured to display a QR code mask in the target area. The content of the QR code mask is null or security prompt information. The first setting sub-unit is configured to set color of the QR code mask based on the second dominant color system. The second setting sub-unit is configured to set attributes of a central icon of the QR code mask based on the attributes of the central icon of the QR code. The third setting sub-unit is configured to set a fault-tolerant ratio of the QR code mask based on the fault-tolerant ratio of the QR code. It is noteworthy that the above explanation on the picture processing method is applicable to the picture processing apparatuses according to the disclosure, and the specific processes will not be repeated here.


With the picture processing apparatus according to the disclosure, the area enclosed by the identified edges of the QR code is determined as the target area, and the first color values of the pixels within the target area and/or the second color values of the pixels with the other areas of the picture other than the target area and corresponding first matching colors and second matching colors are obtained. The first dominant color system and the second dominant color system are determined based on the number of successful match times corresponding to each matched color, and after the system settings including the effacing method setting and the color setting are performed based on the effacing parameters, the picture is effaced by adopting the corresponding effacing method. With the picture processing method according to examples of the disclosure, by effacing the target area where the QR code is located of the picture, normal spread of the picture is realized on the premise of avoiding the potential security risks caused by the QR code, and the user experience is improved. The effacing process is performed based on the parameters of the picture, such as the method of filling color to the target area is performed based on the first dominant color system of the picture other than the target area, the method of blurring the target area is performed based on the second dominant color system within the target area, and the method of adding a QR code mask to the target area is performed based on the second dominant color system, the attributes of the central icon of the QR code and the fault-tolerant ratio of the QR code. It is ensured that after the content information of the QR code is effaced as much as possible, the aesthetics of the picture will not be greatly reduced, and the user experience will be further improved.


In the technical solution of the disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information involved are all in compliance with relevant laws and regulations, and do not violate public order and good customs. According to the embodiments of the disclosure, the disclosure also provides an electronic device, a readable storage medium and a computer program product.



FIG. 11 is a block diagram of an example electronic device 1100 used to implement the embodiments of the disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections and relations, and their functions are merely examples, and are not intended to limit the implementation of the disclosure described and/or required herein. As illustrated in FIG. 11, the electronic device 1100 includes: a computing unit 1101 performing various appropriate actions and processes based on computer programs stored in a read-only memory (ROM) 1102 or computer programs loaded from the storage unit 1108 to a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 are stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other through a bus 1104. An input/output (I/O) interface 1105 is also connected to the bus 1104.


Components in the device 1100 are connected to the I/O interface 1105, including: an inputting unit 1106, such as a keyboard, a mouse; an outputting unit 1107, such as various types of displays, speakers; a storage unit 1108, such as a disk, an optical disk; and a communication unit 1109, such as network cards, modems, and wireless communication transceivers. The communication unit 1109 allows the device 1100 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.


The computing unit 1101 may be various general-purpose and/or dedicated processing components with processing and computing capabilities. Some examples of computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated AI computing chips, various computing units that run machine learning model algorithms, and a digital signal processor (DSP), and any appropriate processor, controller and microcontroller. The computing unit 1101 executes the various methods and processes described above, such as the picture processing method shown in FIGS. 1-8. For example, in some embodiments, the method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 1108. In some embodiments, part or all of the computer program may be loaded and/or installed on the device 1100 via the ROM 1102 and/or the communication unit 1109. When the computer program is loaded on the RAM 1103 and executed by the computing unit 1101, one or more steps of the method described above may be executed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform the method in any other suitable manner (for example, by means of firmware).


Various implementations of the systems and techniques described above may be implemented by a digital electronic circuit system, an integrated circuit system, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), System on Chip (SOCs), Load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or a combination thereof. These various embodiments may be implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general programmable processor for receiving data and instructions from the storage system, at least one input device and at least one output device, and transmitting the data and instructions to the storage system, the at least one input device and the at least one output device.


The program code configured to implement the method of the disclosure may be written in any combination of one or more programming languages. These program codes may be provided to the processors or controllers of general-purpose computers, dedicated computers, or other programmable data processing devices, so that the program codes, when executed by the processors or controllers, enable the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may be executed entirely on the machine, partly executed on the machine, partly executed on the machine and partly executed on the remote machine as an independent software package, or entirely executed on the remote machine or server. In the context of the disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), electrically programmable read-only-memory (EPROM), flash memory, fiber optics, compact disc read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.


In order to provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (e.g., a Cathode Ray Tube (CRT) or a Liquid Crystal Display (LCD) monitor for displaying information to a user); and a keyboard and pointing device (such as a mouse or trackball) through which the user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user. For example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or haptic feedback), and the input from the user may be received in any form (including acoustic input, voice input, or tactile input).


The systems and technologies described herein can be implemented in a computing system that includes background components (for example, a data server), or a computing system that includes middleware components (for example, an application server), or a computing system that includes front-end components (for example, a user computer with a graphical user interface or a web browser, through which the user can interact with the implementation of the systems and technologies described herein), or include such background components, intermediate computing components, or any combination of front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), the Internet and a block-chain network.


The computer system may include a client and a server. The client and server are generally remote from each other and interacting through a communication network. The client-server relation is generated by computer programs running on the respective computers and having a client-server relation with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in a cloud computing service system, in order to solve the existing defects of difficult management and weak business expansion in traditional physical hosting and virtual private server (VPS) services. The server can also be a server of a distributed system, or a server combined with a block-chain.


According to the embodiment of the disclosure, the disclosure also provides a computer program product including computer programs. When the computer programs are executed by a processor, the steps of the picture processing method shown in the above embodiments of the disclosure is implemented.


It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the disclosure could be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in the disclosure is achieved, which is not limited herein.


The above specific embodiments do not constitute a limitation on the protection scope of the disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent replacement and improvement made within the spirit and principle of this application shall be included in the protection scope of this application.

Claims
  • 1. A picture processing method, comprising: identifying a target area where a quick response (QR) code is located in a picture;obtaining parameters of the picture; andperforming effacing process on the target area of the picture based on the parameters.
  • 2. The method of claim 1, wherein identifying the target area where the QR code is located in the picture, comprises: identifying edges of the QR code; anddetermining an area enclosed by the edges as the target area.
  • 3. The method of claim 1, wherein the parameters comprise at least one of: first parameters of other areas of the picture other than the target area or second parameters of the target area.
  • 4. The method of claim 3, wherein the first parameters comprise a first dominant color system, and the second parameters comprise at least one of a second dominant color system, attributes of a central icon of the QR code and a fault-tolerant ratio of the QR code.
  • 5. The method of claim 4, wherein obtaining the parameters of the picture comprises: obtaining first color values of pixels within a preset area of the other areas; anddetermining the first dominant color system based on the first color values.
  • 6. The method of claim 5, wherein determining the first dominant color system based on the first color values comprises: determining, from a color card, first matched colors matched with the first color values within the preset area; anddetermining the first dominant color system based on the number of successful match times between each first matched color and the first color values of the pixels within the preset area.
  • 7. The method of claim 4, wherein obtaining the parameters of the picture in the case that the second parameters comprise the second dominant color system, comprises: obtaining second color values of pixels within the target area; anddetermining the second dominant color system based on the second color values.
  • 8. The method of claim 7, wherein determining the second dominant color system based on the second color values comprises: determining, from a color card, second matched colors matched with the second color values of the pixels within the target area; anddetermining the second dominant color system based on the number of successful match times between each second matched color and the second color values of the pixels within the target area.
  • 9. The method of claim 1, wherein performing the effacing process on the target area of the picture based on the parameters comprises: obtaining an effacing method; andbased on the parameters, performing the effacing process on the target area by adopting the effacing method;wherein the effacing method comprises any one of the following:a method of filling color to the target area, a method of blurring the target area, and a method of adding a QR code mask to the target area.
  • 10. The method of claim 9, wherein in the case that the effacing method is the method of filling color to the target area, the parameters comprise first parameters, and the first parameters comprise the first dominant color system of other areas of the picture other than the target area, performing the effacing process on the target area based on the parameters by adopting the effacing method comprises: performing color filling on the target area based on the first dominant color system.
  • 11. The method of claim 9, wherein in the case that the effacing method is the method of blurring the target area, the parameters comprise second parameters, and the second parameters comprise the second dominant color system of the target area, performing the effacing process on the target area based on the parameters by adopting the effacing method comprises: determining a reference color to be used in the method of blurring the target area based on the second dominant color system, and performing the effacing process on the target area based on the reference color.
  • 12. The method of claim 9, wherein the effacing method is the method of adding a QR code mask to the target area, the parameters comprise the second parameters, and the second parameters comprise at least one of: the second dominant color system of the target area, attributes of a central icon of the QR code and a fault-tolerant ratio of the QR code, performing the effacing process on the target area based on the parameters by adopting the effacing mode comprises at least one of the followings: displaying a QR code mask in the target area, wherein content of the QR code mask is null or security prompt information;setting a color for the QR code mask based on the second dominant color system;setting attributes of a central icon of the QR code mask based on the attributes of the central icon of the QR code; andsetting a fault-tolerant ratio of the QR code mask based on the fault-tolerant ratio of the QR code.
  • 13. An electronic device, comprising: at least one processor; anda memory communicatively coupled to the at least one processor; wherein,the memory stores instructions executable by the at least one processor, when the instructions are executed by the at least one processor, the at least one processor is configured to:identify a target area where a quick response (QR) code is located in a picture;obtain parameters of the picture; andperform effacing process on the target area of the picture based on the parameters.
  • 14. The electronic device of claim 13, wherein the at least one processor is configured to: identify edges of the QR code; anddetermine an area enclosed by the edges as the target area.
  • 15. The electronic device of claim 13, wherein the parameters comprise at least one of: first parameters of other areas of the picture other than the target area or second parameters of the target area.
  • 16. The electronic device of claim 15, wherein the first parameters comprise a first dominant color system, and the second parameters comprise at least one of a second dominant color system, attributes of a central icon of the QR code and a fault-tolerant ratio of the QR code.
  • 17. The electronic device of claim 16, wherein the at least one processor is configured to: obtain first color values of pixels within a preset area of the other areas; anddetermine the first dominant color system based on the first color values.
  • 18. The electronic device of claim 16, wherein the at least one processor is configured to: obtain second color values of pixels within the target area; anddetermine the second dominant color system based on the second color values.
  • 19. The electronic device of claim 13, wherein the at least one processor is configured to: obtaining an effacing method; andbased on the parameters, performing the effacing process on the target area by adopting the effacing method;wherein the effacing method comprises any one of the following: a method of filling color to the target area, a method of blurring the target area, and a method of adding a QR code mask to the target area.
  • 20. A non-transitory computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions are configured to cause a computer to a picture processing method, wherein the method comprises: identifying a target area where a quick response (QR) code is located in a picture;obtaining parameters of the picture; andperforming effacing process on the target area of the picture based on the parameters.
Priority Claims (1)
Number Date Country Kind
202111189145.7 Oct 2021 CN national