Image processing method, apparatus, device, medium and product
By performing multi-dimensional analysis of images and selecting an adaptive algorithm, the problem of low accuracy in the image processing chain is solved, achieving more efficient and accurate image processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, the accuracy of image processing links is not high, and they cannot adapt to images with different backgrounds and types, resulting in insufficient processing precision.
By performing multi-dimensional analysis on the image to be processed, and using the analysis results to select an adaptive image processing algorithm, personalized image processing can be achieved.
It improves the accuracy and efficiency of image processing, enabling it to adapt to various scenarios and types, and enhancing the adaptability and effectiveness of image processing.
Smart Images

Figure CN115830362B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the technical field of computer, and particularly, to an image processing method, device, equipment, medium and product. BACKGROUND
[0002] At present, in the field of computer vision, an automatic image processing link can be set to process and apply images. For example, a user can upload an image, and the uploaded image is processed by the image processing link to obtain a final image processing result, and the image processing result is displayed to the user. For example, a user can upload a landscape image, and the landscape image is processed by the image processing link such as face region recognition, image cropping of the face region, identity recognition of the face region image, and the like to obtain a final identity recognition result.
[0003] As described above, the image processing link can include various image processing algorithms to achieve the final processing of the image. However, when all images use the image processing link, the image processing accuracy is not high. SUMMARY
[0004] Embodiments of the present disclosure provide an image processing method, device, equipment, medium and product to overcome the problem that the image processing accuracy is not high when all images use the image processing link.
[0005] In a first aspect, embodiments of the present disclosure provide an image processing method, comprising:
[0006] obtaining a to-be-processed image in response to an image processing request;
[0007] analyzing the to-be-processed image from at least one analysis dimension to obtain at least one analysis result of the to-be-processed image;
[0008] selecting a target processing algorithm for the to-be-processed image according to the at least one analysis result;
[0009] performing corresponding image improvement processing on the to-be-processed image based on the target processing algorithm to obtain an improved target image.
[0010] In a second aspect, embodiments of the present disclosure provide an image processing device, comprising:
[0011] an image obtaining unit configured to obtain a to-be-processed image in response to an image processing request;
[0012] an image analyzing unit configured to analyze the to-be-processed image from at least one analysis dimension to obtain at least one analysis result of the to-be-processed image;
[0013] An algorithm selection unit is configured to select a target processing algorithm for the to-be-processed image according to the at least one analysis result.
[0014] An image processing unit is configured to perform corresponding image processing on the to-be-processed image based on the target processing algorithm, and obtain an image processing result.
[0015] In a third aspect, an electronic device is provided, and the electronic device includes a processor and a memory.
[0016] The memory stores computer-executable instructions.
[0017] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the image processing method according to the first aspect and various possible designs of the first aspect.
[0018] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the image processing method according to the first aspect and various possible designs of the first aspect is implemented.
[0019] In a fifth aspect, a computer program product is provided, and the computer program product includes a computer program. When a processor executes the computer program, the image processing method according to the first aspect and various possible designs of the first aspect is implemented.
[0020] The technical solution provided in this embodiment can analyze a to-be-processed image from at least one analysis dimension, and can obtain at least one analysis result. A target processing algorithm can be selected for the to-be-processed image based on the at least one analysis result. The selection of the target processing algorithm depends on the analysis result of the to-be-processed image, and the adaptive algorithm selection for the to-be-processed image is implemented. Through the algorithm selection, the processing efficiency and accuracy of the image can be improved. After the target processing algorithm is obtained, the target processing algorithm can be used to perform corresponding image improvement processing on the to-be-processed image, and an improved target image is obtained. This image processing manner depends on the image itself to select the target processing algorithm, improves the adaptation degree of the selected target processing algorithm and the to-be-processed image, and when the target processing algorithm is used to process the to-be-processed image, the individualized processing of the to-be-processed image is implemented, and the processing efficiency and accuracy of the to-be-processed image can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor under the premise of the drawings.
[0022] Figure 1 An application example of the image processing method provided by the embodiments of the present disclosure is provided.
[0023] Figure 2 A flowchart of the image processing method provided by the embodiments of the present disclosure is provided.
[0024] Figure 3 Another flowchart of the image processing method provided by the embodiments of the present disclosure is provided.
[0025] Figure 4 Another embodiment of the image processing method provided by the embodiments of the present disclosure is provided.
[0026] Figure 5 Another flowchart of the image processing method provided by the embodiments of the present disclosure is provided.
[0027] Figure 6 An example diagram of an algorithm decision tree provided by the embodiments of the present disclosure is provided.
[0028] Figure 7 A structural diagram of the image processing device provided by the embodiments of the present disclosure is provided.
[0029] Figure 8 A hardware structural diagram of the electronic device provided by the embodiments of the present disclosure is provided. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below in combination with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some embodiments of the present disclosure, not all embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present disclosure.
[0031] The technical solutions of the present disclosure can be applied to the image real-time application processing scene. By analyzing the real-time obtained to-be-processed image from each analysis dimension, and using the analysis obtained result for the selection of the image processing algorithm, the automatic selection of the image processing algorithm is realized, and the accuracy and precision of the image algorithm selection are improved.
[0032] At present, the application mode of images is diversified, such as vehicle tracking, image beautification, face recognition and many other application fields. Any kind of image processing may involve multiple image processing algorithms, such as image denoising, region recognition, image enhancement and a series of algorithm processing links. The process of image processing generally includes that a user can upload an image, the image uploaded by the user is processed through the image processing link to obtain the final image processing result, and the image processing result is displayed to the user. For example, a user can upload a landscape image, and through the image processing link of face region recognition, face region image cropping, face region image identity recognition and the like from the landscape image, the final identity recognition result is obtained. The image processing link can include multiple image processing algorithms, and the algorithms of each processing link are usually fixed, and are obtained by training using images matched with the design background during the training process, and cannot be applied to other links. Therefore, if any image is input into an image processing link, if the background of the image is different from the background of the image processing link, the image processing recognition may be inaccurate.
[0033] To solve the above technical problems, in the technical scheme of the present disclosure, the analysis of the image is adopted to obtain the analysis results of the image in different dimensions, such as definition, background, brightness and the like. Through the analysis results of each dimension, the algorithm is adaptively selected for the image, instead of using the fixed image processing link to process the collected image, so that the application range of the image is wider and the processing efficiency is higher.
[0034] In the embodiment of the present disclosure, for the obtained to-be-processed image, the to-be-processed image can be parsed from at least one analysis dimension, and at least one analysis result can be obtained. The target processing algorithm can be selected for the to-be-processed image through the at least one analysis result. The selection of the target processing algorithm depends on the analysis result of the to-be-processed image, and the adaptive algorithm selection for the to-be-processed image is realized. Through the algorithm selection, the processing efficiency and accuracy of the image can be improved. After obtaining the target processing algorithm, the target processing algorithm can be used to perform corresponding image improvement processing on the to-be-processed image to obtain an improved target image. This image processing mode depends on the image itself to realize the selection of the target processing algorithm, improves the adaptation degree of the selected target processing algorithm and the to-be-processed image, and realizes the personalized processing of the to-be-processed image when the target processing algorithm is used to process the to-be-processed image, so that the processing efficiency and accuracy of the to-be-processed image can be improved.
[0035] The technical scheme of the present disclosure and how the technical scheme of the present disclosure solves the above technical problems will be described in detail in the specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in detail in some embodiments. The embodiments of the present disclosure will be described in detail below with reference to the drawings.
[0036] Figure 1 is an application network architecture diagram according to the image processing method of the present disclosure. The application network architecture according to the embodiment of the present disclosure can include an electronic device and a client network connected with the electronic device through a local area network or a wide area network. It is assumed that the electronic device can be a personal computer, a general server, a super personal computer, a cloud server, and the like. The specific type of the electronic device is not limited in the present disclosure. The client can be a mobile phone, a tablet computer, a personal computer, a smart home appliance, a wearable device, and the like. The specific type of the client is not limited in the present disclosure.
[0037] As shown in Figure 1 , the electronic device is a cloud server 1, and the client 2 can be one or more of a mobile phone 21, a tablet computer 22, and the like. Any client 2 can initiate an image processing request to the cloud server 1 and provide a to-be-processed image to the server 1. The cloud server 1 can obtain the to-be-processed image in response to the image processing request, select a target processing algorithm according to the dimension analysis result of the to-be-processed image, and obtain the target processing algorithm. The target processing algorithm can be used for improved processing of the to-be-processed image to obtain an improved target image. The algorithm selection through the analysis result of the target image can realize adaptive selection of the image and improve the selection efficiency and accuracy of the image.
[0038] Referring to Figure 2 , Figure 1 , a flowchart of one embodiment of an image processing method provided by the embodiment of the present disclosure. The image processing method can include the following steps:
[0039] 201: obtaining a to-be-processed image in response to an image processing request.
[0040] Optionally, the image processing request can be initiated by a user. In actual application, in order to improve the image processing efficiency, an image processing page can be provided. The image processing page can include an image upload control or a video upload control. The electronic device can detect that the user triggers the image upload control or the video upload control to determine that the user initiates the image processing request, and obtain the image or the video uploaded by the user to obtain the to-be-processed image from the image or the video uploaded by the user.
[0041] Exemplarily, the image to be processed can include a single-person image, an image of multiple persons, an image of different types of commodity categories, an image taken in a natural scene, and the like. Due to the large number of categories to which the image to be processed belongs, the image processing purposes and angles of different categories are different, and directly inputting the image into an image processing model set in the related art can result in low processing accuracy of the image. Therefore, in the embodiment, an adaptive manner is adopted to perform image analysis on the image to be processed, so as to obtain a corresponding image processing algorithm for the image by using the image analysis result.
[0042] The image type of the image to be processed is unknown. The image to be processed can belong to any one of a plurality of image types. The image type can refer to any one of a quantity type set according to the number of persons in the image, an image type corresponding to an object contained in the image, a classification of an image background, and the like, such as a vehicle background, a building background, a natural scenery background, a solid color background, and the like. In the embodiment, the type to which the image belongs is not limited too much. The processing algorithms of different image processing types can be different.
[0043] 202: Analyzing the image to be processed from at least one analysis dimension to obtain at least one analysis result of the image to be processed.
[0044] In order to solve the algorithm acquisition problem of the image to be processed of different image types, the image to be processed can be analyzed in different analysis dimensions.
[0045] The analysis dimension can refer to an angle of image analysis of the image to be processed, that is, the content of image analysis and the requirement for the analysis result can be defined through the analysis dimension.
[0046] The analysis result can be a result obtained by analyzing the image to be processed in a certain analysis dimension. For example, when the analysis dimension is a brightness dimension, the analysis result can be an image brightness value obtained by analysis.
[0047] The analysis dimension can include one or more, which can be set according to actual use requirements. For example, for a simple image processing scene, such as a face recognition scene, the number of portraits and brightness can be used as the analysis dimensions. For an image beautification scene, the angles of brightness, resolution, noise, and the like can be used as the analysis dimensions.
[0048] 203: Selecting a target processing algorithm for the image to be processed according to the at least one analysis result.
[0049] Optionally, the to-be-processed image can be parsed from at least one parsing dimension respectively to obtain a parsing result of each parsing dimension. The at least one parsing result can include a parsing result corresponding to each of the at least one parsing dimension. In order to effectively utilize the parsing result, the at least one parsing result can also be an effective parsing result in the parsing result corresponding to each of the at least one parsing dimension. The effective parsing result can be obtained by performing effectiveness judgment on the parsing result of the corresponding parsing dimension.
[0050] The target processing algorithm can be an image processing algorithm for image processing of the to-be-processed image. The image processing algorithm can include at least one.
[0051] The target processing algorithm can be obtained by utilizing the at least one parsing result to perform result analysis and algorithm selection. Through the at least one parsing result, the target processing algorithm required by the to-be-processed image can be accurately obtained, and efficient utilization of the parsing result of the to-be-processed image is realized.
[0052] 204: performing corresponding image improvement processing on the to-be-processed image based on the target processing algorithm to obtain an improved target image.
[0053] The target processing algorithm can include at least one, and the target processing algorithm as a whole can be utilized to perform corresponding image improvement processing on the to-be-processed image to obtain an improved target image.
[0054] The target image can be output data obtained by processing input data by a last processing algorithm in the target processing algorithm. The target image can be input as input data to a first processing algorithm in the target processing algorithm. The processing algorithms are sequentially executed, and the output data of a previous processing algorithm can be input data of a subsequent processing algorithm.
[0055] In the embodiments of the present disclosure, the to-be-processed image is parsed from at least one parsing dimension to obtain at least one parsing result. Through the at least one parsing result, the target processing algorithm can be selected for the to-be-processed image. The selection of the target processing algorithm depends on the parsing result of the to-be-processed image, which realizes adaptive algorithm selection for the to-be-processed image, and through the algorithm selection, the processing efficiency and accuracy of the image can be improved. After obtaining the target processing algorithm, the target processing algorithm can be utilized to perform corresponding image improvement processing on the to-be-processed image to obtain an improved target image.
[0056] In actual applications, a parsing model of an image can be set, and the to-be-processed image can be parsed from different dimensions through various parsing models to obtain parsing results of each dimension. As an embodiment, the to-be-processed image is parsed from at least one parsing dimension to obtain at least one parsing result of the to-be-processed image, which can include:
[0057] acquire the image analysis model matched with each analysis dimension;
[0058] input the image to be processed into the image analysis model of each analysis dimension for analysis calculation, to obtain the analysis result corresponding to the image to be processed in at least one analysis dimension, and to obtain at least one analysis result of the image to be processed.
[0059] Optionally, the image analysis model can include at least one of an image quality analysis model, an image meta-information analysis model, an object recognition model, a scene judgment model, a copyright identification model, and the like.
[0060] The image quality analysis model can be used to detect the quality-related parameters of the image. The image quality analysis model can include at least one of a VQScore (Video Quality Score) model, a noise detection model, a brightness detection model, a color detection model, a contrast detection model, and an aesthetic detection model.
[0061] The image meta-information can refer to the attribute information involved in the generation process of the image. The image meta-information analysis model can be used to analyze certain meta-information of the image. The image meta-information analysis model can include at least one of a resolution detection model, a format acquisition model, an encoding quality analysis model, a transparency detection model, and a theme color analysis model.
[0062] The object recognition model can be a model for recognizing the category of the object in the image. The object recognition model can include at least one of a portrait recognition model, a vehicle recognition model, a product recognition model, and a license plate recognition model.
[0063] The scene judgment model can be a model for detecting the acquisition scene of the image. The scene judgment model can include a landscape detection model, a synthetic image detection model, and a cartoon image detection model.
[0064] The copyright identification model can be used to detect the copyright information of the image, and the copyright information can be used for subsequent algorithm selection. For example, if a watermark is detected in the image, a watermark removal model can be used as an image processing algorithm. The copyright identification model can include at least one of a text recognition model, an identification detection model, a PS trace recognition model, and a watermark detection model.
[0065] In the embodiments of the present disclosure, by setting the image analysis model matched with each analysis dimension, the image to be processed can be input into the image analysis model of each analysis dimension for analysis calculation, and the image to be processed can be analyzed in at least one analysis dimension. By setting the image analysis model for each analysis dimension, the image to be processed can be analyzed from each analysis dimension, and the analysis efficiency and accuracy of the image to be processed can be improved.
[0066] As Figure 3 shown, a flowchart of still another embodiment of the image processing method provided by the embodiments of the present disclosure is different from the foregoing embodiments in that, according to at least one analysis result, a target processing algorithm is selected for the image to be processed, which can include the following steps.
[0067] 301: At least one image processing node in an algorithm decision tree is determined, and the algorithm decision tree is connected by at least one image processing node according to an algorithm selection strategy of each node.
[0068] Optionally, the algorithm decision tree provided in the embodiments can include a data structure for decision-making using a “tree” structure, and the image processing node can be a node in the algorithm decision tree. The algorithm decision tree can be used for image algorithm determination to determine the algorithm associated with each image processing node.
[0069] The algorithm decision tree can include at least one image processing node, and the at least one image processing node can be connected to form the algorithm decision tree according to the algorithm selection strategy of each node. Each image processing node can be associated with an algorithm selection strategy. The algorithm selection strategy of each image processing node can be used for algorithm selection of the corresponding image processing node.
[0070] The algorithm selection strategy can include the algorithm selection strategy set for each image processing node, and the image processing algorithm of the corresponding image processing node can be obtained by executing the algorithm selection strategy.
[0071] 302: A target analysis result is selected for each image processing node from the at least one analysis result to obtain the target analysis result corresponding to each image processing node.
[0072] The target analysis result can include multiple target analysis results, and each target analysis result can correspond to corresponding analysis content information. The analysis content information can include text describing the analyzed content. The analysis result can include, for example, a brightness value obtained by detecting a brightness detection model. The image processing node can include an image enhancement node, and the image enhancement node can include a brightness enhancement node.
[0073] The target analysis result corresponding to each image processing node can include a target analysis result selected according to the processing function or processing requirement of the image processing node.
[0074] 303: A target processing node that meets an algorithm execution condition in the algorithm decision tree is determined using the target analysis result of each image processing node.
[0075] The algorithm decision tree can include at least one image processing node, and the target processing node satisfying an algorithm execution condition in the algorithm decision tree can be determined. The algorithm execution condition can refer to a judgment condition for the image processing node to execute an associated algorithm. If it is determined that the image processing node satisfies the algorithm execution condition, the image processing node is determined as the target processing node. If it is determined that the image processing node does not satisfy the algorithm execution condition, the image processing node is determined as the target processing node.
[0076] The algorithm execution conditions of different image processing nodes can be different and can be determined according to the processing functions of the image processing nodes. For example, the algorithm execution condition can be set as a luminance value less than 30 for a luminance enhancement node, and the algorithm execution condition can be set as a color value less than 55 for a color correction node. Therefore, for any image processing node, the corresponding algorithm execution condition can be determined according to the processing function or requirement of the image processing node.
[0077] 304: A target processing algorithm of the target processing node is selected according to the algorithm selection strategy to obtain a target processing algorithm of the image to be processed.
[0078] The algorithm selection strategy can include an algorithm execution condition, which can be part of the algorithm selection strategy. In addition to the algorithm execution condition, the algorithm selection strategy can also include a specific selection strategy of the algorithm. The algorithm selection strategy can include two steps. The first step can be to determine whether the image processing node satisfies the algorithm execution condition according to the algorithm execution condition. The second step can be to select the algorithm associated with the node in the case that the image processing node is the target processing node satisfying the algorithm execution condition, to obtain the target processing algorithm of the node.
[0079] In this embodiment, when selecting an algorithm for the algorithm decision tree, the algorithm can be selected according to at least one image processing node and the algorithm selection strategy managed by each image processing node. By setting the image processing algorithm for each image processing node, the algorithm selection for each image processing node can be more targeted and accurate.
[0080] For ease of understanding, as shown in Figure 4 A flowchart of another embodiment of an image processing method provided by this embodiment is different from the foregoing embodiments in that the target processing node satisfying the algorithm execution condition in the algorithm decision tree is determined by using the target analysis result of each image processing node, which can include:
[0081] 401: According to a top-down order, starting from the first image processing node of the algorithm decision tree, it is determined whether the target analysis result of the image processing node satisfies the algorithm execution condition. If yes, 402 is executed, and if no, 405 is executed.
[0082] Exemplarily, in one embodiment, if it is determined that the target analysis result of the image processing node satisfies the algorithm execution condition, the image processing node is determined as the target processing node, and after a target processing algorithm of the target processing node is selected according to the algorithm selection strategy, the next image processing node associated with the target processing algorithm is entered, and it is continued to judge whether the target analysis result of the image processing node satisfies the algorithm execution condition. In another embodiment, if it is determined that the target analysis result of the image processing node does not satisfy the algorithm execution condition, the next image processing node associated with the image processing node is entered, and it is continued to judge whether the target analysis result of the image processing node satisfies the algorithm execution condition.
[0083] Optionally, the algorithm execution condition can be used to perform the condition judgment step by the algorithm selection strategy. The algorithm selection strategy includes at least one numerical interval, and the at least one numerical interval includes a first numerical interval and a second numerical interval. The target analysis result of the image processing node satisfying the algorithm execution condition can include that the target analysis result of the image processing node does not belong to the first numerical interval in the at least one numerical interval, or the target analysis result of the image processing node belongs to the second numerical interval in the at least one numerical interval.
[0084] 402: Determine that the image processing node is the target processing node.
[0085] 403: Select a target processing algorithm of the target processing node according to the algorithm selection strategy.
[0086] 404: Enter the next image processing node associated with the target processing algorithm, return to the judgment step in step 401, and continue until the algorithm decision tree traversal ends.
[0087] 405: Enter the next image processing node associated with the image processing node, return to the judgment step in step 401, and continue until the algorithm decision tree traversal ends.
[0088] 406: Obtain the target processing node obtained when the algorithm decision tree traversal ends.
[0089] Optionally, the algorithm decision tree can include multiple layers, each layer can include one or more nodes, and there can be a connection relationship between nodes of different layers. The node can refer to the image processing node.
[0090] According to the top-down order, it can be referred to that whether the image processing node to be traversed satisfies the algorithm execution condition is determined from top to bottom starting from the first layer of the algorithm decision tree. In actual application, not every image processing node is traversed in the process of traversing the algorithm decision tree, and the selection of the image processing node can be performed according to the algorithm selection strategy to realize the overall decision of the algorithm decision tree.
[0091] The algorithm decision tree can form a tree structure for the at least one image processing node according to the connection relationship corresponding to the algorithm selection strategy between the image processing nodes.
[0092] In this embodiment, when the selection of the target processing node is performed, the target analysis result of the image processing node can be determined whether it meets the algorithm execution condition in a top-down order, starting from the first image processing node in the algorithm decision tree. Through the determination of the algorithm execution condition, the target processing algorithm meeting the algorithm execution condition can be obtained, and the efficient and accurate selection of the target processing algorithm can be realized. On the basis of the determination of the algorithm execution condition, the next image processing node can be entered, and the smooth execution of the algorithm decision tree can be realized until the traversal of the algorithm decision tree is completed. Through the sequential condition determination of each image processing node in the algorithm decision tree, the accurate selection of the target processing node can be realized.
[0093] As a possible implementation, the algorithm selection strategy includes at least one numerical interval of the image processing node, each numerical interval is associated with an image processing algorithm or a next image processing node, and the image processing algorithm of each numerical interval is connected to the next image processing node.
[0094] The target processing node meeting the algorithm execution condition in the algorithm decision tree is determined by using the target analysis result of each image processing node, including:
[0095] The at least one numerical interval corresponding to the algorithm selection strategy of each image processing node is determined.
[0096] The first numerical interval directly associated with the next image processing node is determined from the at least one numerical interval corresponding to each image processing node.
[0097] The algorithm decision tree is traversed, and if the target analysis result of any image processing node does not belong to the first numerical interval of the image processing node, the image processing node is determined as the target processing node meeting the algorithm execution condition, and the target processing node aggregated by the algorithm decision tree is obtained.
[0098] The image processing node can be associated with one or more image processing algorithms, and the image processing node can classify data according to different numerical intervals. The numerical interval can be set according to the processing function or requirement of the image processing node, and the data interval can be divided according to the data type corresponding to the analysis result of the image processing node. For example, the higher the brightness value, the better the image quality, and for example, the higher the noise value, the worse the image quality. The numerical interval can be obtained according to the actual processing requirement of the image processing node.
[0099] Optionally, the target analysis result of the image processing node belonging to the first numerical interval can include that if the numerical value of the target analysis result is greater than the lower bound of the first numerical interval and / or less than the upper bound of the first numerical interval, it can be determined that the target analysis result belongs to the first numerical interval, otherwise, the target analysis result does not belong to the first numerical interval. The lower bound and the upper bound of the first numerical interval can refer to two real numbers forming the interval range, and the lower bound real number is less than the upper bound real number.
[0100] Optionally, if only the numerical interval is not set in the algorithm selection strategy, the numerical interval of the algorithm selection strategy can be set as infinite to infinitesimal by default. If the image processing algorithm is set in the algorithm selection strategy, the image processing algorithm can be directly determined as the target processing algorithm of the image processing node. If the image processing algorithm is not set in the algorithm selection strategy, the image processing node can be skipped and the next image processing node can be entered.
[0101] In the embodiments of the present disclosure, different algorithm selection strategies can be set for different image processing nodes, and the setting of different algorithm selection strategies can realize the rapid selection of algorithms of the corresponding image processing nodes, avoid the problem of fixed algorithm selection mode caused by single algorithm selection strategy, and improve the algorithm selection efficiency and accuracy. At the same time, through the setting of the numerical interval, the image processing node can be set from multiple data stages, and the setting accuracy and precision of the image processing node can be improved.
[0102] In the specific implementation process, the target processing algorithm of the target processing node can be selected according to the algorithm selection strategy, which can include:
[0103] Determining that the algorithm selection strategy corresponds to a second numerical interval other than the first numerical interval in at least one numerical interval;
[0104] Based on the target analysis result of the target processing node, determining a target numerical interval to which the target analysis result belongs from the second numerical interval;
[0105] The image processing algorithm associated with the target numerical interval is used as the target processing algorithm of the target processing node.
[0106] Optionally, the algorithm selection strategy can include at least one numerical interval, and the numerical interval can be associated with an image processing algorithm or not associated with an image processing algorithm. The numerical interval not associated with the image processing algorithm can be connected to the next image processing node. If the target analysis result of the previous image processing node is in a numerical interval not associated with the image processing algorithm, it can be determined that the image processing node does not meet the algorithm selection condition.
[0107] In this embodiment, a second numerical interval in the at least one numerical interval in the algorithm selection strategy can be determined, the second numerical interval can be a numerical interval associated with an image processing algorithm, therefore, by matching the second numerical interval and the target analysis result, an accurate target processing algorithm can be obtained, and the selection efficiency and accuracy of the target processing algorithm can be improved.
[0108] For ease of understanding, as shown in Figure 5 Another embodiment of the image processing method provided in this embodiment is shown in a flowchart, which is different from the foregoing embodiments in that the target processing node and the determination of the target processing algorithm of the target processing node can be obtained by the following steps:
[0109] 501: In a top-down order, starting from the first image processing node of the algorithm decision tree, at least one numerical interval corresponding to the algorithm selection strategy of each image processing node is obtained.
[0110] 502: A first numerical interval and a second numerical interval in the at least one numerical interval are determined. The first numerical interval is associated with a next image processing node, and the second numerical interval is associated with an image processing algorithm, and the image processing algorithm is associated with a next image processing node. The next image processing algorithms associated with different numerical intervals can be the same or different, which can be set and obtained according to the algorithm selection requirement.
[0111] 503: It is judged whether the target analysis result of the image processing node belongs to the first numerical interval, if yes, 504 is executed, and if not, 505 is executed.
[0112] 504: It is determined that the image processing node is not the target processing node, switched to the next image processing node associated with the first numerical interval of the image processing node, and returned to execute 501.
[0113] 505: It is determined that the image processing node is the target processing node.
[0114] 506: Based on the target analysis result of the target processing node, a target numerical interval in which the image processing node is located is determined from the second numerical interval.
[0115] 507: The image processing algorithm associated with the target numerical interval is taken as the target processing algorithm of the target processing node, switched to the next image processing node associated with the target processing algorithm, and returned to execute 501.
[0116] 508: The target processing node obtained when the algorithm decision tree traversal ends is obtained.
[0117] Of course, in actual application, the at least one numerical interval can further include a third numerical interval and other numerical intervals, and the number of the at least one numerical interval is not specifically limited in the embodiment. The first numerical interval and the second numerical interval shown in the embodiment are used for detailed description of comparison of the target analysis result with the first numerical interval and the second numerical interval in the scheme, and should not be regarded as detailed limitation of the technical scheme of the disclosure.
[0118] In the embodiment, when the target processing algorithm and the target processing node are selected from the algorithm decision tree, the tree structure of the algorithm decision tree can be used to divide the numerical interval of the image processing node, to obtain the first numerical interval directly associated with the next image processing node and the second numerical interval not directly associated with the next image processing node, and to quickly select the target processing node and the target processing algorithm associated with the target processing node through joint application of the second numerical interval and the second numerical interval, thereby improving selection efficiency and accuracy.
[0119] In actual application, in order to perform more detailed image processing on the image, the image processing node can be formed by a plurality of processing nodes. The image processing node can generally include an image enhancement node, a content extraction node, and an image repair node.
[0120] Exemplarily, the image enhancement node can include at least one of a resolution enhancement node, a noise reduction node, a brightness enhancement node, and a color correction node.
[0121] As an optional implementation, the image processing node includes an image enhancement node, and the image enhancement node specifically includes at least one of a resolution enhancement node, a noise reduction node, a brightness enhancement node, and a color correction node.
[0122] The target analysis result corresponding to the resolution enhancement node includes a resolution value.
[0123] The target analysis result corresponding to the noise reduction node includes a definition and a noise score.
[0124] The target analysis result corresponding to the brightness enhancement node includes a brightness value.
[0125] The target analysis result corresponding to the color correction node includes a color score.
[0126] Optionally, in addition to the at least one of the resolution enhancement node, the noise reduction node, the brightness enhancement node, and the color correction node, the image enhancement node can further include at least one of a portrait enhancement node, an image quality enhancement node, a portrait slimming node, a color enhancement node, and a noise reduction node. The image quality can be enhanced through the image enhancement node, thereby improving processing effect of subsequent images.
[0127] In this embodiment, by setting the plurality of processing nodes of the image enhancement node to include at least one of the resolution enhancement node, the noise reduction node, the brightness enhancement node, and the color correction node, the image can be repaired from multiple dimensions such as resolution, noise, brightness, and color, and the enhancement angle and accuracy of the image are improved.
[0128] As another optional implementation, the image processing node further includes a content extraction node, and the target analysis result corresponding to the content extraction node includes a number of portraits.
[0129] Optionally, the content extraction node can further include at least one of a portrait region extraction node, an object region segmentation node, and a saliency segmentation node in addition to the content extraction node.
[0130] Different extraction functions can be set through one or more content extraction nodes. Different extraction functions are used to implement corresponding processing algorithms.
[0131] In this embodiment, the image is processed by using the content extraction node to obtain a corresponding processing node, and the number of portraits is analyzed by using the processing node, so that the image is analyzed in a targeted manner by using the number of portraits, and detailed analysis of the image content is implemented.
[0132] As another optional implementation, the image processing node further includes an image repair node, and the image repair node includes at least one of an image erasing algorithm, an image expansion algorithm, an image cropping algorithm, and a portrait slimming algorithm.
[0133] Optionally, the image expansion algorithm can include a product repair algorithm, a cartoon repair algorithm, a landscape repair algorithm, etc. The corresponding processing algorithm can be selected according to the image processing type, the type selection of the algorithm is implemented, the correlation between the algorithm and the image processing type is improved, and the processing efficiency of the algorithm is improved.
[0134] In this embodiment, for the image repair node, any one of the image erasing algorithm, the image expansion algorithm, the image cropping algorithm, and the image slimming algorithm is selected to implement targeted repair of the image, and the repair efficiency and accuracy of the image are improved.
[0135] For ease of understanding, reference is made to Figure 6 Another example of an algorithm decision tree provided by the embodiment of the present disclosure is provided. In the image processing method, the image analysis model corresponding to each of the at least one analysis dimension can include a picture quality detection algorithm, a brightness detection algorithm, a color detection algorithm, a contrast detection algorithm, an aesthetic detection algorithm, a noise detection algorithm, a portrait recognition algorithm, etc. Through the above algorithms, the resolution, picture clarity, color degree, brightness, contrast, aesthetic score, noise score, and number of portraits of the image to be processed can be detected. The above analysis results can be used for selection of a target processing algorithm.
[0136] The algorithm decision tree can include an image enhancement node 601, a content extraction node 602, and an image repair node 603.
[0137] The image enhancement node 601 can include a resolution enhancement node 6011, a definition enhancement node 6012, a noise reduction node 6013, a brightness enhancement node 6014, and a color enhancement node 6015.
[0138] The first processing node in the image enhancement node 601 can be the resolution enhancement node 6011. The resolution enhancement node 6011 can include three numerical intervals of resolution, i.e., (0, 360p), (360p, 1080p), and greater than 1080p. The two numerical intervals of (0, 360p) and (360p, 1080p) belong to the second numerical interval, (0, 360p) is associated with a 4-fold super-resolution algorithm, and (360p, 1080p) is associated with a 2-fold super-resolution algorithm. The first numerical interval greater than 1080p is not associated with an image processing algorithm and is directly connected to the definition enhancement node 6012. After the resolution of the image to be processed is increased by the resolution enhancement algorithm, the noise reduction node 6013 can be entered.
[0139] The noise reduction node 6013 can include two noise intervals, i.e., a second numerical interval of noise value greater than 70 and a first numerical interval of noise value less than 70. The second numerical interval of noise greater than 70 is associated with a noise reduction algorithm, and the first numerical interval of noise less than 70 is directly connected to the brightness enhancement node 6014.
[0140] The definition enhancement node 6012 can include two numerical intervals, i.e., greater than 60 and less than 60. If the second numerical interval of noise score greater than 60 is directly connected to the brightness enhancement node 6014, if the first numerical interval of noise score less than 60, the image to be processed is enhanced in quality based on the quality enhancement algorithm associated with the numerical interval less than 60.
[0141] The brightness enhancement node 6014 can include two numerical intervals, i.e., a first numerical interval greater than 30 and a second numerical interval less than 30. The second numerical interval less than 30 is associated with a brightness enhancement algorithm, and the first numerical interval less than 30 is directly connected to the content extraction node 602.
[0142] The second numerical interval of the noise reduction node 6013 is associated with a noise reduction algorithm, and the noise reduction algorithm can be connected to the color enhancement node 6015. The color enhancement node 6015 can include three numerical intervals, which are less than 25, greater than 25 and less than 55, and greater than 55. The color value less than 25 is associated with an HDR color enhancement algorithm, which is the second numerical interval, the color value greater than 25 and less than 55 is associated with a color correction algorithm, which is the second numerical interval, and the color value greater than 55 is directly connected to the content extraction node 502, which is the first numerical interval.
[0143] The analysis result corresponding to the content extraction node 602 can be the number of portraits, and the content extraction node 602 can include three numerical intervals, which are greater than 1 and less than or equal to 2, greater than 3, and 0. Among them, greater than 1 and less than or equal to 2 can be associated with a skin smoothing algorithm as the second numerical interval, more than 3 can be associated with a portrait enhancement algorithm as the second numerical interval, and 0 directly enters the image repair node 503 as the first numerical interval. After the image is processed by the skin smoothing algorithm or the portrait enhancement algorithm, it can be connected to the image repair node 603. The image repair node 603 can be associated with an intelligent slimming algorithm according to the portrait beauty type.
[0144] Reference Figure 6 The algorithm decision tree shown in the figure, assuming that the resolution of any image to be processed is 256, the color degree is 30, the brightness is 20, the contrast is 30, the aesthetic score is 50, the noise score is 50, and the number of portraits is 2. After the judgment of the resolution enhancement node 6011, the resolution 256 belongs to the second numerical interval of (0, 360p), and the target processing algorithm corresponding to the resolution enhancement node 6011 is a 4 times super-resolution algorithm. Then, enter the noise reduction node 6013 connected by the 4 times super-resolution algorithm, and the noise score 50 belongs to the first numerical interval less than 70, which does not need to be de-noised. Then, enter the brightness enhancement node 6014. The brightness value is 20, which does not belong to the first numerical interval, and belongs to the second numerical interval less than 30. The brightness enhancement node is the target processing node, and the brightness enhancement algorithm associated with less than 30 can be applied. Then, enter the content extraction node 602 connected by the brightness enhancement algorithm, and the number of portraits is 2. It can be determined that the content extraction node is the target processing node, and the corresponding target processing algorithm is the skin smoothing algorithm. Then, the image repair node 603 can be entered, which is directly associated with the slimming algorithm, and the image repair node can be determined as the target processing node, and the corresponding target processing algorithm is the slimming algorithm.
[0145] Therefore, it can be determined that the resolution enhancement node 6011, the brightness enhancement node 6014, the content extraction node 602, and the image repair node 603 are target processing nodes, and the target processing algorithms associated with each target processing algorithm can be obtained.
[0146] In practical applications, in order to realize the smooth processing of images, the images can be processed in the order of the positions of the image processing nodes in the algorithm decision tree. As an embodiment, the target processing node includes at least one, and further includes:
[0147] Based on the positions of the at least one target processing node in the algorithm decision tree, the processing order corresponding to the at least one target processing node is determined respectively;
[0148] Based on the target processing algorithm, the corresponding image processing is performed on the image to be processed, and the image processing result is obtained, including:
[0149] According to the processing order corresponding to the at least one target processing node respectively, the target processing algorithm of each target processing node is sequentially executed, and the node processing result corresponding to the last target processing node is obtained as the image processing result.
[0150] The node processing result corresponding to the last target processing node is obtained as the image processing result.
[0151] Optionally, the position of the target processing node in the algorithm decision tree can refer to the number of layers of the node in the algorithm decision tree and the order of the same layer.
[0152] In this embodiment, by determining the processing order corresponding to the at least one target processing node respectively, the target processing algorithm of each target processing node is executed respectively, so that the at least one target processing node is executed in sequence, the smooth execution of the target processing algorithm of each target processing node is realized, the execution efficiency and execution reliability of the at least one target processing node are effectively improved, and the image processing efficiency is improved.
[0153] In order to accurately select the target analysis result of each image processing node, the target analysis result is selected for each image processing node from the at least one analysis result, and the target analysis result corresponding to each image processing node is obtained, including:
[0154] According to the processing requirement information of each image processing node and the analysis content information corresponding to the at least one analysis result respectively;
[0155] According to the analysis content information corresponding to the at least one analysis result respectively, the analysis result with the highest similarity to the processing requirement information of each image processing node is selected as the target analysis result of each image processing node.
[0156] Optionally, the processing requirement information of the image processing node can be matched with the analysis content information of the at least one analysis result respectively, and the matching degree of the image processing node in the at least one analysis result is obtained, so as to select the analysis result with the highest matching degree as the target analysis result of the image processing node.
[0157] The information matching of the processing requirement information and the parsed content information can include token matching of the processing requirement information and the parsed content information, and obtaining a similarity of the processing requirement information and the parsed content information. That is, the similarity can refer to a number or a proportion of words with the same or similar meanings.
[0158] In the embodiment, when the image processing node selects the parsed content information, information matching can be performed according to the processing requirement information of the image processing node and the parsed content information corresponding to each of the at least one analysis result, respectively. Through the information matching, the adaptation of each image processing node and different analysis dimensions can be realized, the accurate acquisition of the target analysis result for each image processing node can be realized, and the accuracy of the algorithm selection of each processing node can be improved.
[0159] As a further embodiment, after the target processing algorithm is selected for the image to be processed according to the at least one analysis result, the method further includes:
[0160] scheduling the target processing algorithm from the image processing algorithm library to an algorithm container;
[0161] performing corresponding image improvement processing on the image to be processed based on the target processing algorithm to obtain an improved target image, including:
[0162] performing corresponding image improvement processing on the image to be processed based on the target processing algorithm to obtain an improved target image in the algorithm container.
[0163] Optionally, the algorithm container can refer to an independent algorithm running space established for the image to be processed. The algorithm container can realize independent running of the algorithm. The algorithm container can be a CUDA (Compute Unified Device Architecture) context created for the image to be processed.
[0164] The scheduling of the target processing algorithm from the image processing algorithm library to the algorithm container can include scheduling the target processing algorithm from the image processing algorithm library to the algorithm container through an algorithm scheduler.
[0165] The image processing algorithm library can store image processing algorithms obtained through training. The scheduling of the target processing algorithm to the algorithm container can refer to scheduling parameters of the target processing algorithm from the image processing algorithm library to the algorithm container, realizing independent running of the algorithm container on the target processing algorithm, making the image processing process of the image to be processed independent of other algorithm containers, and improving the efficiency and security of algorithm running.
[0166] In this embodiment, after the target processing algorithm is determined, the target processing algorithm can be scheduled to the algorithm container, and the execution process of the target processing algorithm can be made independent of other containers by executing the target processing algorithm through the algorithm container, so as to improve the execution efficiency and safety of the algorithm.
[0167] As shown in Figure 7 FIG. 1 is a structural schematic diagram of an embodiment of an image processing apparatus provided by the present disclosure, which can include the following units:
[0168] An image obtaining unit 701 is configured to obtain a to-be-processed image to be processed in response to an image processing request.
[0169] An image analyzing unit 702 is configured to analyze the to-be-processed image from at least one analysis dimension to obtain at least one analysis result of the to-be-processed image.
[0170] An algorithm selecting unit 703 is configured to select a target processing algorithm for the to-be-processed image according to the at least one analysis result.
[0171] An image processing unit 704 is configured to execute corresponding image processing on the to-be-processed image based on the target processing algorithm to obtain an image processing result.
[0172] As an embodiment, the image analyzing unit includes:
[0173] A model obtaining module is configured to obtain image analysis models matched with the analysis dimensions;
[0174] An image analyzing module is configured to input the to-be-processed image into the image analysis models of the analysis dimensions respectively to perform analysis calculation, and obtain analysis results corresponding to the at least one analysis dimension respectively, thereby obtaining the at least one analysis result of the to-be-processed image.
[0175] As another embodiment, the algorithm selecting unit includes:
[0176] A first determining module is configured to determine at least one image processing node in an algorithm decision tree, and the algorithm decision tree is established by connecting the at least one image processing node according to algorithm selection strategies of the nodes;
[0177] A result selecting module is configured to select target analysis results for the image processing nodes from the at least one analysis result, thereby obtaining the target analysis results corresponding to the image processing nodes;
[0178] A result obtaining module is configured to determine target processing nodes in the algorithm decision tree that meet algorithm execution conditions by using the target analysis results of the image processing nodes.
[0179] The algorithm selection module is configured to select a target processing algorithm of the target processing node according to an algorithm selection strategy, so as to obtain the target processing algorithm of the image to be processed.
[0180] In some embodiments, the result obtaining module comprises:
[0181] The condition judging submodule is configured to judge whether the target analysis result of the image processing node satisfies an algorithm execution condition in a top-down order, starting from the first image processing node of the algorithm decision tree.
[0182] The first processing submodule is configured to determine that the image processing node is the target processing node if it is determined that the target analysis result of the image processing node satisfies the algorithm execution condition, and to enter a next image processing node associated with the target processing algorithm and continue to judge whether the target analysis result of the image processing node satisfies the algorithm execution condition after the target processing algorithm of the target processing node is selected according to the algorithm selection strategy.
[0183] The second processing submodule is configured to enter a next image processing node associated with the image processing node and continue to judge whether the target analysis result of the image processing node satisfies the algorithm execution condition if it is determined that the target analysis result of the image processing node does not satisfy the algorithm execution condition.
[0184] The target obtaining submodule is configured to obtain the target processing node obtained when the algorithm decision tree is traversed.
[0185] As an embodiment, the algorithm selection strategy comprises at least one numerical interval of the image processing node, each numerical interval is associated with an image processing algorithm or a next image processing node, and the image processing algorithm of each numerical interval is associated with a next image processing node.
[0186] The result obtaining module comprises:
[0187] The first determining submodule is configured to determine at least one numerical interval corresponding to the algorithm selection strategy of each image processing node.
[0188] The interval obtaining submodule is configured to determine a first numerical interval directly associated with a next image processing node from at least one numerical interval corresponding to each image processing node.
[0189] The node traversal submodule is configured to traverse the algorithm decision tree, and determine that any image processing node is the target processing node satisfying the algorithm execution condition if the target analysis result of the image processing node does not belong to the first numerical interval of the image processing node, and obtain the target processing node aggregated by the algorithm decision tree.
[0190] As an embodiment, the algorithm selection module comprises:
[0191] The second determining sub-module is configured to determine a second numerical interval, other than the first numerical interval, in the at least one numerical interval corresponding to the algorithm selection strategy.
[0192] The third determining sub-module is configured to determine, based on the target analysis result of the target processing node, a target numerical interval to which the target analysis result belongs from the second numerical interval.
[0193] The algorithm associating sub-module is configured to associate an image processing algorithm corresponding to the target numerical interval as a target processing algorithm of the target processing node.
[0194] As an optional implementation, the image processing node comprises an image enhancement node, and the image enhancement node specifically comprises at least one of a resolution enhancement node, a noise reduction node, a brightness enhancement node, and a color correction node.
[0195] The target analysis result corresponding to the resolution enhancement node comprises a resolution value.
[0196] The target analysis result corresponding to the noise reduction node comprises a definition and a noise score.
[0197] The target analysis result corresponding to the brightness enhancement node comprises a brightness value.
[0198] The target analysis result corresponding to the color correction node comprises a color score.
[0199] As another optional implementation, the image processing node further comprises a content extraction node, and the target analysis result corresponding to the content extraction node comprises a number of portraits.
[0200] As another optional implementation, the image processing node further comprises an image repair node, and the image repair node comprises at least one of an image erasing algorithm, an image extending algorithm, an image cropping algorithm, and a portrait slimming algorithm.
[0201] As an embodiment, the target processing node comprises at least one, and further comprises:
[0202] The sequence determining unit is configured to determine a processing sequence corresponding to each target processing node based on a position of the at least one target processing node in the algorithm decision tree.
[0203] The image processing unit comprises:
[0204] The sequence executing module is configured to sequentially execute the target processing algorithms of the target processing nodes according to the processing sequences corresponding to the target processing nodes respectively, to obtain node processing results of the target processing nodes, and a node processing result output by a previous target processing node is taken as an input of a subsequent target processing node.
[0205] The result obtaining module is configured to obtain the node processing result corresponding to the last target processing node as the image processing result.
[0206] In some embodiments, the result selection module comprises:
[0207] The content obtaining sub-module is configured to obtain, according to the processing requirement information of each image processing node and the analysis content information respectively corresponding to the at least one analysis result, the analysis content information corresponding to the analysis result with the highest similarity to the processing requirement information of each image processing node as the target analysis result of each image processing node.
[0208] The information matching sub-module is configured to obtain, according to the analysis content information respectively corresponding to the at least one analysis result, the analysis content information corresponding to the analysis result with the highest similarity to the processing requirement information of each image processing node as the target analysis result of each image processing node.
[0209] As an embodiment, the method further comprises:
[0210] The algorithm scheduling unit is configured to schedule the target processing algorithm from the image processing algorithm library to the algorithm container.
[0211] The image processing unit comprises:
[0212] The container execution module is configured to execute, in the algorithm container, the corresponding image improvement processing on the to-be-processed image based on the target processing algorithm, to obtain the improved target image.
[0213] The device provided by the embodiment can be used to execute the technical solutions of the method embodiments, and has similar implementation principles and technical effects, which will not be described here again.
[0214] In order to implement the above-mentioned embodiments, the electronic device is also provided by the embodiment of the present disclosure.
[0215] Reference Figure 8 The electronic device 800 can be a terminal device or a server. The terminal device can include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a portable media player (PMP), a vehicle-mounted terminal (for example, a vehicle-mounted navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. Figure 8 The electronic device shown is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.
[0216] As Figure 8As shown, the electronic device 800 can include a processing device (e.g., a central processor, a graphics processor, etc.) 801 that can perform various suitable actions and processes in accordance with programs stored in a Read Only Memory (ROM) 802 or loaded from a storage device 808 into a Random Access Memory (RAM) 803. Various programs and data needed in the operation of the electronic device 800 are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An Input / Output (I / O) interface 805 is also connected to the bus 804.
[0217] Generally, the following devices can be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication devices 809 can allow the electronic device 800 to communicate wirelessly or wired with other devices to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that not all of the shown devices are required to be implemented or present. More or fewer devices can alternatively be implemented or present.
[0218] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 809, or installed from the storage devices 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.
[0219] It should be noted that the computer-readable medium in the above disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present disclosure, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, an RF (radio frequency) or the like, or any suitable combination of the above.
[0220] The computer-readable medium described above can be contained in the electronic device described above; or can exist separately and not be assembled into the electronic device.
[0221] The computer-readable medium described above carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0222] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0223] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may
[0224] The nodes described in the embodiments of the present disclosure can be implemented by software, or can be implemented by hardware. In some cases, the names of the nodes do not constitute a limitation on the nodes themselves. For example, the first obtaining node can also be described as a node that obtains at least two Internet protocol addresses.
[0225] The functions described in this specification can be implemented in part or in whole by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0226] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can 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 the machine-readable storage medium will include one or more of: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0227] In a first aspect, according to one or more embodiments of the present disclosure, an image processing method is provided, comprising:
[0228] obtaining an image to be processed in response to an image processing request;
[0229] parsing the image to be processed from at least one parsing dimension to obtain at least one parsing result of the image to be processed;
[0230] selecting a target processing algorithm for the image to be processed according to the at least one parsing result;
[0231] performing corresponding image improvement processing on the image to be processed based on the target processing algorithm to obtain an improved target image.
[0232] According to one or more embodiments of the present disclosure, parsing the image to be processed from at least one parsing dimension to obtain at least one parsing result of the image to be processed comprises:
[0233] obtaining an image parsing model matched with each parsing dimension;
[0234] inputting the image to be processed into the image parsing model of each parsing dimension for parsing calculation to obtain a parsing result corresponding to each parsing dimension of the image to be processed, thereby obtaining the at least one parsing result of the image to be processed.
[0235] According to one or more embodiments of the present disclosure, selecting a target processing algorithm for the image to be processed according to the at least one parsing result comprises:
[0236] determining at least one image processing node in an algorithm decision tree, the algorithm decision tree being connected by at least one image processing node according to an algorithm selection strategy of each node;
[0237] select a target analysis result for each image processing node from the at least one analysis result, to obtain a target analysis result corresponding to each image processing node;
[0238] determine a target processing node in the algorithm decision tree that meets an algorithm execution condition, by using the target analysis result of each image processing node;
[0239] select a target processing algorithm of the target processing node according to an algorithm selection strategy, to obtain a target processing algorithm of the image to be processed.
[0240] According to one or more embodiments of the present disclosure, the target processing node in the algorithm decision tree that meets the algorithm execution condition is determined by using the target analysis result of each image processing node, including:
[0241] starting from a first image processing node of the algorithm decision tree in a top-down order, determine whether the target analysis result of the image processing node meets the algorithm execution condition;
[0242] if it is determined that the target analysis result of the image processing node meets the algorithm execution condition, determine that the image processing node is the target processing node, and after selecting the target processing algorithm of the target processing node according to the algorithm selection strategy, enter a next image processing node associated with the target processing algorithm, and continue to determine whether the target analysis result of the image processing node meets the algorithm execution condition;
[0243] if it is determined that the target analysis result of the image processing node does not meet the algorithm execution condition, enter a next image processing node associated with the image processing node, and continue to determine whether the target analysis result of the image processing node meets the algorithm execution condition;
[0244] obtain the target processing node obtained when the algorithm decision tree traversal ends.
[0245] According to one or more embodiments of the present disclosure, the algorithm selection strategy includes at least one numerical interval of the image processing node, each numerical interval is associated with an image processing algorithm or a next image processing node, and the image processing algorithm of each numerical interval is associated with a next image processing node;
[0246] determine a target processing node in the algorithm decision tree that meets an algorithm execution condition, by using the target analysis result of each image processing node, including:
[0247] determine at least one numerical interval corresponding to the algorithm selection strategy of each image processing node;
[0248] determine a first numerical interval directly associated with a next image processing node from at least one numerical interval corresponding to each image processing node;
[0249] If the target analysis result of any image processing node does not belong to the first numerical interval of the image processing node, it is determined that the image processing node is a target processing node meeting the algorithm execution condition, and the target processing node meeting the algorithm execution condition is obtained by summarizing the algorithm decision tree.
[0250] According to one or more embodiments of the present disclosure, the target processing algorithm of the target processing node is selected according to an algorithm selection strategy, which includes:
[0251] The algorithm selection strategy is determined to correspond to a second numerical interval in the at least one numerical interval except the first numerical interval.
[0252] Based on the target analysis result of the target processing node, a target numerical interval to which the target analysis result belongs is determined from the second numerical interval.
[0253] The image processing algorithm associated with the target numerical interval is taken as the target processing algorithm of the target processing node.
[0254] According to one or more embodiments of the present disclosure, the image processing node includes an image enhancement node, and the image enhancement node specifically includes at least one of a resolution enhancement node, a noise reduction node, a brightness enhancement node, and a color correction node.
[0255] The target analysis result corresponding to the resolution enhancement node includes a resolution value.
[0256] The target analysis result corresponding to the noise reduction node includes a definition and a noise score.
[0257] The target analysis result corresponding to the brightness enhancement node includes a brightness value.
[0258] The target analysis result corresponding to the color correction node includes a color score.
[0259] According to one or more embodiments of the present disclosure, the image processing node further includes a content extraction node, and the target analysis result corresponding to the content extraction node includes a number of portraits.
[0260] According to one or more embodiments of the present disclosure, the image processing node further includes an image repair node, and the image repair node includes at least one of an image erasing algorithm, an image expanding algorithm, an image cropping algorithm, and a portrait slimming algorithm.
[0261] According to one or more embodiments of the present disclosure, the target processing node includes at least one, and further includes:
[0262] Based on the position of the at least one target processing node in the algorithm decision tree, the processing order corresponding to the at least one target processing node is determined respectively.
[0263] obtaining an image processing result based on the target processing algorithm performing corresponding image processing on the to-be-processed image, including:
[0264] sequentially executing the target processing algorithms of the target processing nodes according to the processing sequences respectively corresponding to the target processing nodes, to obtain node processing results of the target processing nodes, and the node processing result output by a previous target processing node serving as input of a subsequent target processing node;
[0265] obtaining the node processing result corresponding to the last target processing node as the image processing result.
[0266] According to one or more embodiments of the present disclosure, a target analysis result is selected for each image processing node from at least one analysis result, and a target analysis result corresponding to each image processing node is obtained, including:
[0267] According to the analysis content information respectively corresponding to the at least one analysis result and the processing requirement information of each image processing node;
[0268] According to the analysis content information respectively corresponding to the at least one analysis result, an analysis result corresponding to analysis content information having the highest similarity with the processing requirement information of each image processing node is selected as the target analysis result of each image processing node.
[0269] According to one or more embodiments of the present disclosure, after selecting a target processing algorithm for the to-be-processed image according to the at least one analysis result, the method further includes:
[0270] scheduling the target processing algorithm from the image processing algorithm library to the algorithm container;
[0271] obtaining an improved target image based on the target processing algorithm performing corresponding image improvement processing on the to-be-processed image, including:
[0272] In the algorithm container, the target processing algorithm is used to perform corresponding image improvement processing on the to-be-processed image to obtain an improved target image.
[0273] In a second aspect, according to one or more embodiments of the present disclosure, an image processing apparatus is provided, including:
[0274] an image acquisition unit configured to obtain a to-be-processed image to be processed in response to an image processing request;
[0275] an image analysis unit configured to analyze the to-be-processed image from at least one analysis dimension to obtain at least one analysis result of the to-be-processed image;
[0276] an algorithm selection unit configured to select a target processing algorithm for the to-be-processed image according to the at least one analysis result;
[0277] The image processing unit is used to perform corresponding image processing on the image to be processed based on the target processing algorithm, and obtain the image processing result.
[0278] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;
[0279] The memory stores the instructions that the computer executes;
[0280] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the image processing method as described in the first aspect above and various possible designs of the first aspect.
[0281] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, which stores computer-executable instructions that, when executed by a processor, implement the image processing method as described in the first aspect and various possible designs of the first aspect.
[0282] Fifthly, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the image processing method as described in the first aspect and various possible designs of the first aspect.
[0283] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0284] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0285] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. An image processing method, characterized in that, include: In response to an image processing request, obtain the image to be processed; The image to be processed is analyzed from at least one analytical dimension to obtain at least one analytical result of the image to be processed; the analytical dimension includes brightness, number of people, resolution, and noise; Based on the at least one parsing result, a target processing algorithm is selected for the image to be processed; Based on the target processing algorithm, perform corresponding image improvement processing on the image to be processed to obtain the improved target image; The algorithm for selecting a target processing method for the image to be processed based on the at least one parsing result includes: Determine at least one image processing node in the algorithm decision tree, wherein the algorithm decision tree is established by connecting at least one of the image processing nodes according to the algorithm selection strategy of each node; Select a target parsing result for each image processing node from at least one of the parsing results to obtain the target parsing result corresponding to each image processing node; Using the target parsing results of each image processing node, the target processing node in the algorithm decision tree that meets the algorithm execution conditions is determined; The target processing algorithm of the target processing node is selected according to the algorithm selection strategy to obtain the target processing algorithm of the image to be processed.
2. The method according to claim 1, characterized in that, The step of parsing the image to be processed from at least one parsing dimension to obtain at least one parsing result of the image to be processed includes: Obtain an image parsing model that matches each parsing dimension; The image to be processed is input into the image parsing model of each parsing dimension for parsing calculation, and the parsing result corresponding to the image to be processed in at least one of the parsing dimensions is obtained, thus obtaining at least one parsing result of the image to be processed.
3. The method according to claim 1, characterized in that, The step of determining the target processing node in the algorithm decision tree that satisfies the algorithm execution conditions using the target parsing results of each image processing node includes: Starting from the first image processing node in the algorithm decision tree, in a top-down order, determine whether the target parsing result of the image processing node satisfies the algorithm execution conditions. If it is determined that the target parsing result of the image processing node meets the algorithm execution conditions, then the image processing node is determined as the target processing node. After selecting the target processing algorithm of the target processing node according to the algorithm selection strategy, the next image processing node associated with the target processing algorithm is entered, and the determination of whether the target parsing result of the image processing node meets the algorithm execution conditions is continued. If it is determined that the target parsing result of the image processing node does not meet the algorithm execution conditions, then proceed to the next image processing node associated with the image processing node and continue to determine whether the target parsing result of the image processing node meets the algorithm execution conditions. Obtain the target processing node obtained when the decision tree traversal of the algorithm ends.
4. The method according to claim 1, characterized in that, The algorithm selection strategy includes at least one numerical range of the image processing node, each numerical range is associated with an image processing algorithm or the next image processing node, and the image processing algorithm of each numerical range is associated with the next image processing node. The step of determining the target processing node in the algorithm decision tree that satisfies the algorithm execution conditions using the target parsing results of each image processing node includes: Determine at least one numerical range corresponding to the algorithm selection strategy for each image processing node; Determine the first numerical interval that is directly associated with the next image processing node from at least one numerical interval corresponding to each image processing node; Traverse the algorithm decision tree. If the target parsing result of any image processing node does not belong to the first numerical range of the image processing node, then determine the image processing node as a target processing node that satisfies the algorithm execution conditions, and obtain the target processing nodes summarized by the algorithm decision tree.
5. The method according to claim 4, characterized in that, The step of selecting the target processing algorithm for the target processing node according to the algorithm selection strategy includes: The algorithm selection strategy is determined to correspond to at least one second numerical interval other than the first numerical interval; Based on the target parsing result of the target processing node, the target value interval to which the target parsing result belongs is determined from the second value interval; The image processing algorithm associated with the target numerical range is used as the target processing algorithm for the target processing node.
6. The method according to claim 1, characterized in that, The image processing node includes: an image enhancement node; specifically, the image enhancement node includes at least one of: a resolution enhancement node, a noise reduction node, a brightness enhancement node, and a color correction node; The target parsing result corresponding to the resolution enhancement node includes: resolution value; The target parsing results corresponding to the noise reduction node include: sharpness and noise score; The target parsing result corresponding to the brightness enhancement node includes: brightness value; The target parsing result corresponding to the color correction node includes: color score.
7. The method according to claim 1, characterized in that, The image processing node further includes a content extraction node; the target parsing result corresponding to the content extraction node includes the number of human figures.
8. The method according to claim 1, characterized in that, The image processing node further includes an image restoration node; the image restoration node includes at least one of the following: image erasure algorithm, image expansion algorithm, image cropping algorithm, and portrait slimming algorithm.
9. The method according to claim 1, characterized in that, The target processing node includes at least one, and also includes: Based on the position of at least one of the target processing nodes in the algorithm decision tree, determine the processing order corresponding to each of the at least one target processing node; The step of performing corresponding image processing on the image to be processed based on the target processing algorithm to obtain the image processing result includes: According to the processing order corresponding to the at least one target processing node, the target processing algorithm of each target processing node is executed sequentially to obtain the node processing result of each target processing node. The node processing result output by the previous target processing node is used as the input of the next target processing node. The image processing result is obtained by obtaining the node processing result corresponding to the last target processing node.
10. The method according to claim 1, characterized in that, The step of selecting a target parsing result for each image processing node from the at least one parsing result to obtain the target parsing result corresponding to each image processing node includes: Based on the processing requirements of each image processing node and the parsing content information corresponding to at least one of the parsing results; Based on the parsing content information corresponding to at least one of the parsing results, the parsing result corresponding to the parsing content information that has the highest similarity to the processing requirement information of each image processing node is taken as the target parsing result of each image processing node.
11. The method according to claim 1, characterized in that, After selecting a target processing algorithm for the image to be processed based on the at least one parsing result, the method further includes: The target processing algorithm is scheduled from the image processing algorithm library into the algorithm container; The step of performing corresponding image improvement processing on the image to be processed based on the target processing algorithm to obtain the improved target image includes: Within the algorithm container, the image to be processed is subjected to corresponding image improvement processing based on the target processing algorithm to obtain the improved target image.
12. An image processing apparatus, characterized in that, include: The image acquisition unit is used to acquire the image to be processed in response to an image processing request; An image parsing unit is used to parse the image to be processed from at least one parsing dimension to obtain at least one parsing result of the image to be processed; the parsing dimension includes brightness, number of human figures, resolution, and noise; An algorithm selection unit is used to select a target processing algorithm for the image to be processed based on the at least one parsing result; The image processing unit is used to perform corresponding image processing on the image to be processed based on the target processing algorithm to obtain the image processing result; The algorithm selection unit is specifically used to determine at least one image processing node in the algorithm decision tree, wherein the algorithm decision tree is established by connecting at least one image processing node according to the algorithm selection strategy of each node; select a target parsing result for each image processing node from the at least one parsing result to obtain the target parsing result corresponding to each image processing node; determine the target processing node in the algorithm decision tree that meets the algorithm execution conditions using the target parsing results of each image processing node; and select the target processing algorithm of the target processing node according to the algorithm selection strategy to obtain the target processing algorithm of the image to be processed.
13. An electronic device, characterized in that, include: Processor, memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, such that the processor is configured with the image processing method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the image processing method as described in any one of claims 1 to 11.
15. A computer program product, comprising a computer program, characterized in that, The computer program is executed by a processor to configure the image processing method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and computer readable storage medium
CN113674152A
Cited By
Image processing method and apparatus, device, medium and product
WO2024094086A1