Image processing method, module, electronic device and readable storage medium

By evaluating factors such as the edge distance, transparency, and number of subjects in the image, the image quality is automatically adjusted to meet preset conditions, solving the problem of image upload failure and improving upload efficiency.

CN113989213BActive Publication Date: 2025-09-16GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111240762.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2025-09-16
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

In the prior art, when uploading pictures, users cannot know in advance whether the picture quality meets the requirements, which leads to the failure of picture upload and reduces the upload efficiency.

Method used

By obtaining quality factors of the target image, such as edge distance, transparency, and the number of image subjects, the image quality is automatically evaluated, and a quality adjustment plan is determined based on the score to adjust the image to meet the preset quality conditions.

Benefits of technology

It realizes automatic adjustment of image quality without the need for users to adjust the image quality in advance, avoids image upload failures, and improves image upload efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113989213B_ABST
    Figure CN113989213B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method, module, electronic device and readable storage medium, which belongs to the field of image processing technology. The method includes: obtaining a target quality factor of a target image, wherein the target quality factor includes at least one of the edge distance between the image content and the image border, the transparency of the target image, and the number of image subjects, and the number of image subjects is the number of sub-images separated by gaps in the target image, and each sub-image is an image subject; determining the target quality of the target image according to the target quality factor; if the target quality does not meet the preset quality condition, determining a corresponding quality adjustment scheme based on the target quality factor; and adjusting the target quality to meet the preset quality condition through the quality adjustment scheme. The present application can improve the efficiency of uploading pictures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, module, electronic device and readable storage medium. Background Art

[0002] With the development of information technology, image data plays an increasingly important role in real life. For example, companies can use images to promote their products, and users can use photos for identity verification. This often requires uploading complete and clear images, but image quality requirements vary across different scenarios, and images often fail to meet requirements. Users cannot determine whether image quality meets requirements in advance, leading to upload failures and the need to adjust image quality again, reducing upload efficiency. Summary of the Invention

[0003] The purpose of the embodiments of the present application is to provide an image processing method, module, electronic device, and readable storage medium to solve the problem of low image upload efficiency. The specific technical solution is as follows:

[0004] In a first aspect, an image processing method is provided, the method comprising:

[0005] Obtaining a target quality factor of a target image, wherein the target quality factor includes at least one of an edge distance between image content and an image border, transparency of the target image, and the number of image subjects, where the number of image subjects is the number of sub-images separated by gaps in the target image, each sub-image being an image subject;

[0006] determining a target quality of the target image according to a target quality factor;

[0007] If the target quality does not meet the preset quality condition, determining a corresponding quality adjustment plan based on the target quality factor;

[0008] The target quality is adjusted to meet the preset quality condition through the quality adjustment scheme.

[0009] Optionally, determining the target quality of the target image according to the target quality factor includes:

[0010] Obtaining a content clarity score of the target image according to the transparency, wherein the transparency is used to indicate display clarity of the image content, and the transparency is inversely proportional to the content clarity score;

[0011] Obtaining an expansibility score of the target image according to the edge distance;

[0012] Obtaining a regional connectivity score of the target image according to the number of image subjects, wherein the number of image subjects is inversely proportional to the regional connectivity score;

[0013] A target score for the target quality is obtained according to at least one of the content clarity score, the extensibility score, and the regional connectivity score.

[0014] Optionally, obtaining the expansibility score of the target image according to the edge distance includes:

[0015] Determining the farthest edge of the image content in a preset direction, wherein the preset direction is set perpendicular to a direction of a border of the target image;

[0016] Determining a sub-edge distance between the farthest edge and a border of the target image with respect to the preset direction;

[0017] Determining a sub-edge score corresponding to each sub-edge distance according to a correspondence between distances and quality scores stored in a database;

[0018] The weighted sum of the sub-edge scores is used as the expansibility score.

[0019] Optionally, the target score includes a first quality score, a second quality score, or a third quality score, and when the target quality does not meet a preset quality condition, determining a corresponding quality adjustment solution based on the target quality factor includes:

[0020] using a weighted sum of the content clarity score, the expansibility score, and the regional connectivity score as a first quality score of the target quality, wherein the target quality factors include the transparency, the edge distance, and the number of image subjects; if the first quality score is lower than a first quality threshold, determining a corresponding quality adjustment scheme based on the transparency, the edge distance, and the number of image subjects; or,

[0021] using any two of the content clarity score, the expansibility score, and the regional connectivity score as a second quality score of the target quality, wherein the target quality factor is any two of the transparency, the edge distance, and the number of image subjects; if the second quality score is lower than a second quality threshold, determining a quality adjustment scheme for the quality factor corresponding to the second quality score; or,

[0022] One of the content clarity score, the expansibility score, and the regional connectivity score is used as a third quality score of the target quality, wherein the target quality factor is one of the transparency, the edge distance, or the number of image subjects; when the third quality score is lower than a third quality threshold, a quality adjustment plan for the quality factor corresponding to the third quality score is determined.

[0023] Optionally, adjusting the target quality to meet the preset quality condition through the quality adjustment scheme includes:

[0024] At least one of the following steps is performed by the quality adjustment scheme:

[0025] Adjusting the transparency to satisfy a preset transparency condition, wherein the preset transparency condition is used to indicate that the display clarity of the image content is greater than a preset clarity threshold;

[0026] Adjusting the edge distance to meet a preset distance range, wherein the preset distance range is used to indicate that the image content is evenly distributed in the target image and the content ratio of the image content is greater than a preset ratio threshold;

[0027] The positions of the plurality of sub-images are adjusted so that adjacent sub-images are spliced ​​together.

[0028] Optionally, adjusting the positions of the multiple sub-images so that adjacent sub-images are spliced ​​includes:

[0029] When it is determined that the image content is complete, the sub-image is processed as follows:

[0030] Identifying a first gap edge and a second gap edge on both sides of a target gap in the target image;

[0031] Determine a first sub-image to which an edge of the first gap is closely attached and a second sub-image to which an edge of the second gap is closely attached;

[0032] Splitting the first sub-image and the second sub-image from the target image;

[0033] The split first sub-image and the second sub-image are seamlessly spliced ​​together.

[0034] Optionally, adjusting the positions of the multiple sub-images so that adjacent sub-images are spliced ​​includes:

[0035] In the case where it is determined that the image content is incomplete, identifying a target gap in the target image;

[0036] Identifying the line direction and image color of the sub-images within a preset range on both sides of the target gap;

[0037] Supplementary lines are added in the target gap according to the direction of the lines, so that the supplementary lines can connect the lines of the sub-images on both sides and supplement the image color in the gap.

[0038] In a second aspect, an image processing module is provided, the module comprising:

[0039] an acquisition module, configured to acquire a target quality factor of a target image, wherein the target quality factor includes at least one of an edge distance between image content and an image border, transparency of the target image, and the number of image subjects, wherein the number of image subjects is the number of sub-images separated by gaps in the target image, each sub-image being an image subject;

[0040] A first determining module, configured to determine a target quality of the target image according to a target quality factor;

[0041] A second determining module is configured to determine a corresponding quality adjustment plan based on the target quality factor if the target quality does not meet the preset quality condition;

[0042] An adjustment module is configured to adjust the target quality to meet the preset quality condition through the quality adjustment scheme.

[0043] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0044] Memory for storing computer programs;

[0045] The processor is used to implement any of the steps of the image processing method when executing the program stored in the memory.

[0046] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any one of the steps of the image processing method is implemented.

[0047] Beneficial effects of the embodiments of the present application:

[0048] In this application, the server can automatically determine whether the target quality of the target image meets the preset quality conditions based on the target quality factors. If not, it can also determine a corresponding quality adjustment plan based on the target quality factors, and then adjust the target quality to meet the preset quality conditions through the quality adjustment plan. This application does not require the user to adjust the image quality in advance, and can automatically adjust the image quality, avoiding image upload failures and improving image upload efficiency.

[0049] Of course, it is not necessary to achieve all of the above advantages at the same time when implementing any product or method of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0051] Figure 1 A schematic diagram of the hardware environment of an image processing method provided in an embodiment of the present application;

[0052] Figure 2 A flowchart of an image processing method provided in an embodiment of the present application;

[0053] Figure 3 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0054] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0056] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of this application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.

[0057] In order to solve the problems mentioned in the background technology, according to one aspect of the embodiments of the present application, an embodiment of an image processing method is provided.

[0058] Optionally, in the embodiment of the present application, the above image processing method can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 103 shown in FIG. Figure 1As shown, the server 103 is connected to the terminal 101 via a network and can be used to provide services for the terminal or a client installed on the terminal. A database 105 can be set on the server or independently of the server to provide data storage services for the server 103. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 includes but is not limited to a PC, a mobile phone, a tablet computer, etc.

[0059] An image processing method in an embodiment of the present application can be executed by the terminal 101, can also be executed by the server 103, or can also be executed jointly by the server 103 and the terminal 101.

[0060] An embodiment of the present application provides an image processing method that can be applied to a server to improve the image quality of an image.

[0061] The following will describe in detail an image processing method provided by an embodiment of the present application in conjunction with specific implementation methods. Figure 2 The specific steps are as follows:

[0062] Step 201: Obtain a target quality factor of a target image.

[0063] Among them, the target quality factor includes at least one of the edge distance between the image content and the image border, the transparency of the target image, and the number of image subjects. The number of image subjects is the number of sub-images separated by gaps in the target image, and each sub-image is an image subject.

[0064] In an embodiment of the present application, when performing operations such as image verification, a user needs to upload a target image to a server via a terminal. The server then determines whether the target image's image quality meets quality requirements. Specifically, the server obtains a target quality factor for the target image. The target quality factor includes at least one of the edge distance between the image content and the image border, the transparency of the target image, and the number of image entities.

[0065] Transparency is used to indicate the display clarity of image content, wherein transparency is inversely proportional to the display clarity of image content. The higher the transparency, the lower the display clarity of image content. The transparency range is 0-100%. When the transparency is 100%, the display clarity of image content is 0.

[0066] If the target image is an image that has been processed manually or machine-processed, if the processing operation is improper, a white gap may appear in the middle of the target image, that is, the target image is divided into multiple sub-images by the gap, each sub-image can be used as an image body, and the number of image bodies is the same as the number of sub-images.

[0067] Step 202: Determine the target quality of the target image according to the target quality factor.

[0068] The server determines the target quality of the target image based on the target quality factor. Since the target quality factor includes at least one of edge distance, transparency, and the number of image subjects, in an embodiment of the present application, the target quality determination method specifically includes the following four methods: the server determines the target quality of the target image based on transparency, edge distance, and the number of image subjects, or the server determines the target quality of the target image based on transparency, or the server determines the target quality of the target image based on edge distance, or the server determines the target quality of the target image based on the number of image subjects.

[0069] Step 203: When the target quality does not meet the preset quality condition, a corresponding quality adjustment plan is determined based on the target quality factor.

[0070] The server determines whether the target quality meets the preset quality conditions. If the server target quality meets the preset quality conditions, the target image is uploaded; if it is determined that the target quality does not meet the preset quality conditions, it is necessary to determine the corresponding quality adjustment plan based on the target quality factor corresponding to the target quality.

[0071] Exemplarily, if the server determines that the target quality does not meet the preset quality conditions, and the target quality factors corresponding to the target quality are transparency, edge distance and number of image subjects, the server determines a first quality adjustment scheme based on transparency, edge distance and number of image subjects.

[0072] Exemplarily, if the server determines that the target quality does not meet the preset quality condition and the target quality factor corresponding to the target quality is transparency, the server determines a second quality adjustment scheme based on transparency. If the server determines that the target quality does not meet the preset quality condition and the target quality factor corresponding to the target quality is edge distance, the server determines a third quality adjustment scheme based on edge distance. If the server determines that the target quality does not meet the preset quality condition and the target quality factor corresponding to the target quality is the number of image subjects, the server determines a fourth quality adjustment scheme based on the number of image subjects.

[0073] Step 204: Adjust the target quality to meet the preset quality condition through the quality adjustment solution.

[0074] After the server determines the effective quality analysis plan, it adjusts the target quality to meet the preset quality conditions through the quality adjustment plan based on the quality factors that cause the target quality to fail.

[0075] In this application, the server can determine whether the target quality of the target image meets the preset quality conditions. If not, it can also determine the corresponding quality adjustment plan based on the target quality factors, and then adjust the target quality to meet the preset quality conditions through the quality adjustment plan. This application does not require the user to adjust the image quality in advance, and can automatically adjust the image quality to avoid image upload failures and improve image upload efficiency. This application can be used in image authentication or image upload scenarios.

[0076] As an optional implementation, determining the target quality of the target image based on the target quality factor includes: obtaining a content clarity score of the target image based on transparency, wherein transparency is used to indicate the display clarity of the image content, and transparency is inversely proportional to the content clarity score; obtaining an expansibility score of the target image based on the edge distance; obtaining a regional connectivity score of the target image based on the number of image subjects, wherein the number of image subjects is inversely proportional to the regional connectivity score; and obtaining a target score of the target quality based on at least one of the content clarity score, the expansibility score, and the regional connectivity score.

[0077] In an embodiment of the present application, the server may obtain a score based on each quality factor, and then obtain a target score for the target quality based on at least one of the multiple scores. The target score may be one of the multiple scores or a weighted sum of the multiple scores.

[0078] The scoring criteria can be adjusted according to actual conditions. Different scenarios may require inconsistent scoring criteria. For example, when uploading ID photos, the size of the face needs to be considered. Users can make modifications based on actual conditions.

[0079] The scoring is done as follows:

[0080] The server obtains a content clarity score of the target image based on the transparency of the target image. Since transparency is used to indicate the display clarity of the image content, the higher the transparency, the lower the display clarity of the image content and the lower the content clarity score. The transparency is inversely proportional to the content clarity score.

[0081] The server obtains the expansibility score of the target image based on the edge distance.

[0082] The target image is divided into multiple sub-images by gaps. Each sub-image can be considered an image body. This allows the server to determine the target image's regional connectivity score based on the number of image bodies. Since the target image should be a complete body, the more image bodies it includes, the more severe the gaps are. Therefore, the number of image bodies is inversely proportional to the regional connectivity score.

[0083] The server may obtain a target score for the target quality based on a weighted sum of the content clarity score, the extensibility score, and the regional connectivity score; or may use one of the content clarity score, the extensibility score, or the regional connectivity score as the target score for the target quality.

[0084] In this application, the server obtains a score corresponding to each quality factor, and then obtains a target score of the target quality based on the score.

[0085] As an optional implementation, obtaining an expansibility score of a target image based on edge distance includes: determining the farthest edge of the image content in a preset direction, wherein the preset direction is set perpendicular to the direction of a border of the target image; determining a sub-edge distance between the farthest edge and the border of the target image in the preset direction; determining a sub-edge score corresponding to each sub-edge distance based on a correspondence between distances and quality scores stored in a database; and taking a weighted sum of the sub-edge scores as the expansibility score.

[0086] In an embodiment of the present application, the target image has multiple borders, and the direction set perpendicular to the direction of the border is a preset direction. The server determines the farthest edge of the image content in the preset direction. The above method can be used to determine multiple farthest edges of the target image corresponding to each border direction. The server determines the sub-edge distance between the farthest edge and the border of the target image for the preset direction. The farthest edge can be the farthest vertex. The server determines the sub-edge distance by essentially determining the distance between the farthest vertex and the border of the target image for the preset direction. The database stores the correspondence between distance and quality score. The server can determine the sub-edge score corresponding to each sub-edge distance based on the correspondence, and then use the weighted sum of the multiple sub-edge scores as the expansibility score.

[0087] Generally, the sub-edge distance should be within the preset sub-distance range. If the sub-edge distance exceeds the preset sub-distance range, it indicates that the distance between the farthest edge and the target image border is too large or too small, and the image content occupies too small or too large a proportion. This will result in a low sub-edge score and a low expansibility score.

[0088] If the image content is unevenly distributed, this will cause some sub-edge distances to exceed the preset sub-distance range, while some sub-edge distances will be within the preset sub-distance range. This will also result in some sub-edge scores being low, and the resulting expansibility score will also be relatively low.

[0089] On the contrary, if the sub-edge distances are all within the preset sub-distance range, the sub-edge score is higher and the obtained expansibility score will also be higher.

[0090] In this application, the server determines the expansibility score based on the sub-edge distance between the farthest edge of the image content and the border of the target image, so that the distribution uniformity and content proportion of the image content can be determined based on the expansibility score.

[0091] As an optional implementation, when the target quality does not meet the preset quality conditions, determining the corresponding quality adjustment solution based on the target quality factor includes the following two methods.

[0092] Method 1:

[0093] The target quality factors include transparency, edge distance, and the number of image entities. The server calculates the first quality score of the target quality as the weighted sum of the content clarity score, expansibility score, and regional connectivity score. If the server determines that the first quality score is below the first quality threshold, it determines the corresponding quality adjustment plan based on transparency, edge distance, and the number of image entities. This quality adjustment plan can analyze quality failures and develop quality improvement plans for all quality factors.

[0094] Method 2:

[0095] The target quality factors are any two of transparency, edge distance, or the number of image subjects. The server uses any two of the content clarity score, extensibility score, and regional connectivity score as the second quality score of the target quality. If the server determines that the second quality score is lower than the second quality threshold, it determines the quality adjustment plan for the quality factor corresponding to the second quality score, performs quality failure analysis on the quality factor, and formulates a quality improvement plan.

[0096] Method 3:

[0097] The target quality factor is one of transparency, edge distance, or the number of image subjects. The server uses one of the content clarity score, expansibility score, and regional connectivity score as the third quality score of the target quality. If the server determines that the third quality score is lower than the third quality threshold, it determines the quality adjustment plan for the quality factor corresponding to the third quality score, performs quality failure analysis on the quality factor, and formulates a quality improvement plan.

[0098] For example, if the server uses the content clarity score as the third quality score of the target quality, if the server determines that the third quality score is lower than the third quality threshold, it determines a quality adjustment plan for transparency, performs a quality failure analysis on transparency, and formulates a quality improvement plan.

[0099] As an optional embodiment, adjusting the target quality to meet the preset quality conditions through the quality adjustment scheme includes: performing at least one of the following steps through the quality adjustment scheme: adjusting the transparency to meet the preset transparency conditions, wherein the preset transparency conditions are used to indicate that the display clarity of the image content is greater than a preset clarity threshold; adjusting the edge distance to meet the preset distance range, wherein the preset distance range is used to indicate that the image content is evenly distributed in the target image and the content ratio of the image content is greater than a preset proportion threshold; adjusting the positions of multiple sub-images to splice adjacent sub-images.

[0100] In an embodiment of the present application, if the quality adjustment scheme is determined based on transparency, edge distance and the number of image subjects, the server executes the following three steps according to the quality adjustment scheme (the three steps are in no particular order); if the quality adjustment scheme is determined based on one of transparency, edge distance or the number of image subjects, the server executes one of the following steps according to the quality adjustment scheme.

[0101] Step 1: The server adjusts the transparency to meet a preset transparency condition, wherein the preset transparency condition is used to indicate that the display clarity of the image content is greater than a preset clarity threshold, that is, the server adjusts the transparency until the display clarity of the image content is greater than the preset clarity threshold.

[0102] Step 2: The server adjusts the edge distance to meet a preset distance range. Specifically, the server adjusts each sub-edge distance to meet the preset sub-distance range, so that the edge distance of the entire image content meets the preset distance range. The preset distance range is used to indicate that the image content is evenly distributed in the target image and the content ratio of the image content is greater than a preset ratio threshold.

[0103] Step 3: Adjust the positions of multiple sub-images so that adjacent sub-images can be stitched together.

[0104] The server adjusts the positions of the multiple sub-images to splice adjacent sub-images, thereby avoiding gaps and preventing the target image from being split into multiple sub-images, thereby ensuring the integrity and visibility of the target image.

[0105] There are two ways for the server to adjust the positions of the multiple sub-images so as to splice adjacent sub-images.

[0106] Method 1: If the server determines that the image content is complete, the sub-image is processed as follows: the first gap edge and the second gap edge on both sides of the target gap in the target image are identified; the first sub-image and the second sub-image to which the first gap edge is closely attached are determined, and the second sub-image and the second sub-image to which the second gap edge is closely attached are determined; the first sub-image and the second sub-image are separated from the target image; and the separated first sub-image and the second sub-image are seamlessly spliced.

[0107] The server uses a gap in the target image as the target gap, and then identifies the first gap edge and the second gap edge on both sides of the target gap. The first gap edge is closely adjacent to the first sub-image, and the second gap edge is closely adjacent to the second sub-image. The server separates the first sub-image from the target image based on the contour of the first sub-image. The server separates the second sub-image from the target image based on the contour of the second sub-image. The server then seamlessly splices the split first and second sub-images, thereby removing the gap in the target image, improving the integrity of the target image, and enhancing visibility. The image contour is obtained based on the image edge lines and edge gaps.

[0108] In the present application, the server can identify the first sub-image and the second sub-image on both sides of the gap based on the gap, and then split the first sub-image and the second sub-image from the target image and re-splice them seamlessly, thereby removing the gap.

[0109] Method 2: If the server determines that the image content is incomplete, it identifies a target gap in the target image; identifies the line direction and image color of the sub-images within a preset range on both sides of the target gap; adds supplementary lines in the target gap according to the line direction, so that the supplementary lines can connect the lines of the sub-images on both sides, and supplements the image color in the gap.

[0110] The server takes a gap in the target image as the target gap, and there are sub-images on both sides of the target gap. The server identifies the line direction and image color of the sub-image within a preset range. The server adds supplementary lines in the target gap according to the line direction, so that the added supplementary lines can connect the lines of the sub-images on both sides, so that the two sub-images on both sides of the gap can be spliced ​​on the lines.

[0111] The server also fills the gap with the sub-image's color, improving the visibility of the gap filling process. Specifically, if the sub-images on either side of the gap have the same color, the target gap is filled with that sub-image's color. If the sub-images on either side of the gap have different colors, the target gap is filled with images of the same color as the adjacent sub-images, with the center line of the target gap serving as the dividing line.

[0112] Based on the same technical concept, the embodiment of the present application also provides an image processing module, such as Figure 3 As shown, the module includes:

[0113] An acquisition module 301 is configured to acquire a target quality factor of a target image, wherein the target quality factor includes at least one of the edge distance between the image content and the image border, the transparency of the target image, and the number of image subjects, where the number of image subjects is the number of sub-images separated by gaps in the target image, where each sub-image is an image subject.

[0114] A first determining module 302 is configured to determine a target quality of a target image according to a target quality factor;

[0115] The second determining module 303 is configured to determine a corresponding quality adjustment solution based on the target quality factor when the target quality does not meet the preset quality condition;

[0116] The adjustment module 304 is configured to adjust the target quality to meet a preset quality condition through a quality adjustment solution.

[0117] Optionally, the first determining module 302 is configured to:

[0118] Obtaining a content clarity score of the target image based on transparency, wherein transparency is used to indicate the display clarity of the image content, and transparency is inversely proportional to the content clarity score;

[0119] Obtain the expansibility score of the target image based on the edge distance;

[0120] Obtaining a regional connectivity score of the target image based on the number of image subjects, wherein the number of image subjects is inversely proportional to the regional connectivity score;

[0121] A target score for the target quality is obtained according to at least one of the content clarity score, the extensibility score, and the regional connectivity score.

[0122] Optionally, the first determining module 302 is further configured to:

[0123] Determining a farthest edge of the image content in a preset direction, wherein the preset direction is set perpendicular to a direction of a border of the target image;

[0124] Determining a sub-edge distance between a farthest edge and a border of a target image for a preset direction;

[0125] Determine the sub-edge score corresponding to each sub-edge distance according to the correspondence between the distance and the quality score stored in the database;

[0126] The weighted sum of the sub-edge scores is used as the expansibility score.

[0127] Optionally, the second determining module 303 is further configured to:

[0128] The weighted sum of the content clarity score, the expansibility score, and the regional connectivity score is used as a first quality score of the target quality, where the target quality factors include transparency, edge distance, and the number of image subjects; if the first quality score is lower than a first quality threshold, a corresponding quality adjustment scheme is determined based on transparency, edge distance, and the number of image subjects; or,

[0129] using any two of the content clarity score, the expansibility score, and the regional connectivity score as a second quality score of the target quality, wherein the target quality factor is any two of the transparency, the edge distance, and the number of image subjects; if the second quality score is lower than a second quality threshold, determining a quality adjustment scheme for the quality factor corresponding to the second quality score; or,

[0130] One of the content clarity score, expansibility score, and regional connectivity score is used as a third quality score of the target quality, where the target quality factor is one of transparency, edge distance, or the number of image subjects; when the third quality score is lower than a third quality threshold, a quality adjustment plan for the quality factor corresponding to the third quality score is determined.

[0131] Optionally, the adjustment module 304 is configured to:

[0132] Perform at least one of the following steps with the quality adjustment scheme:

[0133] Adjusting the transparency to meet a preset transparency condition, wherein the preset transparency condition is used to indicate that the display clarity of the image content is greater than a preset clarity threshold;

[0134] Adjusting the edge distance to meet a preset distance range, wherein the preset distance range is used to indicate that the image content is evenly distributed in the target image and the content ratio of the image content is greater than a preset ratio threshold;

[0135] The positions of the multiple sub-images are adjusted so that adjacent sub-images are stitched together.

[0136] Optionally, the adjustment module 304 is configured to:

[0137] When the image content is determined to be complete, the sub-image is processed as follows:

[0138] Identifying a first gap edge and a second gap edge on both sides of a target gap in a target image;

[0139] Determine a first sub-image closely adjacent to an edge of the first gap and a second sub-image closely adjacent to an edge of the second gap;

[0140] Splitting the first sub-image and the second sub-image from the target image;

[0141] The split first sub-image and the second sub-image are seamlessly spliced ​​together.

[0142] Optionally, the adjustment module 304 is configured to:

[0143] Identifying target gaps in a target image when it is determined that the image content is incomplete;

[0144] Identify the line direction and image color of the sub-images within a preset range on both sides of the target gap;

[0145] Supplementary lines are added in the target gap according to the direction of the lines, so that the supplementary lines can connect the lines of the sub-images on both sides and supplement the image color in the gap.

[0146] According to another aspect of the embodiment of the present application, the present application provides an electronic device, such as Figure 4 As shown, it includes a memory 403, a processor 401, a communication interface 402 and a communication bus 404. The memory 403 stores a computer program that can be run on the processor 401. The memory 403 and the processor 401 communicate through the communication interface 402 and the communication bus 404. When the processor 401 executes the computer program, the steps of the above method are implemented.

[0147] The memory and processor in the electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, and the like.

[0148] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0149] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0150] According to another aspect of the embodiments of the present application, a computer-readable medium having non-volatile program code executable by a processor is provided.

[0151] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store program code for the processor to execute the above method:

[0152] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0153] When implementing the embodiments of the present application, reference may be made to the above embodiments, which have corresponding technical effects.

[0154] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or a combination thereof.

[0155] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0156] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0157] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0158] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0159] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0160] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0161] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or partly contributed to the prior art or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard drive, a ROM, a RAM, a magnetic disk, or an optical disk. It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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 a process, method, article or device. Without further constraints, an element defined by the phrase "comprises a..." does not preclude the existence of additional identical elements in the process, method, article or apparatus that includes the element.

[0162] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Obtaining a target quality factor of a target image, wherein the target quality factor includes an edge distance between image content and an image border, transparency of the target image, and the number of image subjects, where the number of image subjects is the number of sub-images separated by gaps in the target image, each sub-image being an image subject; determining a target quality of the target image according to a target quality factor; If the target quality does not meet the preset quality condition, determining a corresponding quality adjustment plan based on the target quality factor; Adjust the target quality to meet the preset quality condition through the quality adjustment scheme; Wherein, determining the target quality of the target image according to the target quality factor includes: Obtaining a content clarity score of the target image according to the transparency, wherein the transparency is used to indicate display clarity of the image content, and the transparency is inversely proportional to the content clarity score; Obtaining an expansibility score of the target image according to the edge distance, wherein the expansibility score is used to determine the distribution uniformity and content proportion of the image content; Obtaining a regional connectivity score of the target image according to the number of image subjects, wherein the number of image subjects is inversely proportional to the regional connectivity score, and the regional connectivity score is used to indicate the severity of the target image being segmented by gaps; Obtaining a target score for the target quality based on the content clarity score, the extensibility score, and the regional connectivity score; Adjusting the target quality to meet the preset quality condition through the quality adjustment scheme includes: Adjusting the transparency to satisfy a preset transparency condition, wherein the preset transparency condition is used to indicate that the display clarity of the image content is greater than a preset clarity threshold; Adjusting the edge distance to meet a preset distance range, wherein the preset distance range is used to indicate that the image content is evenly distributed in the target image and the content ratio of the image content is greater than a preset ratio threshold; The positions of the plurality of sub-images are adjusted so that adjacent sub-images are spliced ​​together.

2. The method according to claim 1, characterized in that Obtaining the expansibility score of the target image according to the edge distance includes: Determining the farthest edge of the image content in a preset direction, wherein the preset direction is set perpendicular to a direction of a border of the target image; Determining a sub-edge distance between the farthest edge and a border of the target image with respect to the preset direction; Determining a sub-edge score corresponding to each sub-edge distance according to a correspondence between distances and quality scores stored in a database; The weighted sum of the sub-edge scores is used as the expansibility score.

3. The method according to claim 2, characterized in that The target score includes a first quality score, and when the target quality does not meet the preset quality condition, determining a corresponding quality adjustment solution based on the target quality factor includes: A weighted sum of the content clarity score, the expansibility score, and the regional connectivity score is used as a first quality score of the target quality, wherein the target quality factors include the transparency, the edge distance, and the number of image subjects; when the first quality score is lower than a first quality threshold, a corresponding quality adjustment scheme is determined based on the transparency, the edge distance, and the number of image subjects.

4. The method according to claim 1, wherein The adjusting the positions of the plurality of sub-images so as to splice adjacent sub-images comprises: When it is determined that the image content is complete, the sub-image is processed as follows: Identifying a first gap edge and a second gap edge on both sides of a target gap in the target image; Determine a first sub-image to which an edge of the first gap is closely attached and a second sub-image to which an edge of the second gap is closely attached; Splitting the first sub-image and the second sub-image from the target image; The split first sub-image and the second sub-image are seamlessly spliced ​​together.

5. The method according to claim 1, wherein The adjusting the positions of the plurality of sub-images so as to splice adjacent sub-images comprises: In the case where it is determined that the image content is incomplete, identifying a target gap in the target image; Identifying the line direction and image color of the sub-images within a preset range on both sides of the target gap; Supplementary lines are added in the target gap according to the direction of the lines, so that the supplementary lines can connect the lines of the sub-images on both sides and supplement the image color in the gap.

6. An image processing module, characterized in that: The module includes: an acquisition module, configured to acquire a target quality factor of a target image, wherein the target quality factor includes an edge distance between the image content and the image border, transparency of the target image, and the number of image subjects, where the number of image subjects is the number of sub-images separated by gaps in the target image, and each sub-image is an image subject; A first determining module, configured to determine a target quality of the target image according to a target quality factor; A second determining module is configured to determine a corresponding quality adjustment plan based on the target quality factor if the target quality does not meet the preset quality condition; An adjustment module, configured to adjust the target quality to meet the preset quality condition through the quality adjustment scheme; The first determining module is further configured to: Obtaining a content clarity score of the target image according to the transparency, wherein the transparency is used to indicate display clarity of the image content, and the transparency is inversely proportional to the content clarity score; Obtaining an expansibility score of the target image according to the edge distance, wherein the expansibility score is used to determine the distribution uniformity and content proportion of the image content; Obtaining a regional connectivity score of the target image according to the number of image subjects, wherein the number of image subjects is inversely proportional to the regional connectivity score, and the regional connectivity score is used to indicate the severity of the target image being segmented by gaps; Obtaining a target score for the target quality based on the content clarity score, the extensibility score, and the regional connectivity score; The adjustment module is further configured to: Adjusting the transparency to satisfy a preset transparency condition, wherein the preset transparency condition is used to indicate that the display clarity of the image content is greater than a preset clarity threshold; Adjusting the edge distance to meet a preset distance range, wherein the preset distance range is used to indicate that the image content is evenly distributed in the target image and the content ratio of the image content is greater than a preset ratio threshold; The positions of the plurality of sub-images are adjusted so that adjacent sub-images are spliced ​​together.

7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Image uploading interaction method and device and storage medium

    CN110719327A

  • Image processing method and device, equipment and readable storage medium

    CN112258606A

  • Application method and system of AI identification photo in electronic social security card platform

    CN113065114A