Image optimization method, device, equipment and storage medium

By fuzzy judgment and similarity iterative processing of optimized images, the problem of image optimization in network applications is solved, efficient and accurate picture optimization is achieved, and user experience and search engine ratings are improved.

CN114219731BActive Publication Date: 2025-03-18BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111533878.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2025-03-18
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

In web applications, image quality and content richness have an important impact on user experience and search engine ratings, but it is difficult for the existing technology to effectively optimize pictures, especially when dealing with blurred pictures.

Method used

By obtaining the image to be optimized as a reference picture, the blur state is judged, and processing is performed based on the judgment result. If the picture is blurred, enlarge the process; if it is not blurred, compress the process. Repeat iteration until the similarity between the current image and the benchmark image meets the preset threshold, stop iteration and determine the optimized image.

Benefits of technology

It realizes intelligent analysis and optimization of pictures while ensuring that key information of pictures is not lost, improving the efficiency and accuracy of picture optimization, and improving user experience and search engine ratings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114219731B_ABST
    Figure CN114219731B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, equipment and storage medium for image optimization, which relates to the field of artificial intelligence technology, specifically computer vision and deep learning technology. The method includes: obtaining a picture to be optimized, recorded as a reference picture; judging whether the picture to be optimized is blurred, processing the picture to be optimized based on the operation corresponding to the judgment result, and using the processed picture as the current picture; performing the following iterative steps: if it is determined that the similarity between the current picture and the reference picture does not meet the preset similarity threshold, using the current picture as the reference picture for the next iteration, processing the picture to be optimized, using the processed picture as the current picture for the next iteration, and performing the next iteration; if it is determined that the similarity between the current picture and the reference picture meets the similarity threshold, stopping the iteration; determining the current picture as the optimized picture. The method provided by the present disclosure can optimize the picture to be optimized while ensuring that key information is not lost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically computer vision and deep learning technology, and in particular to image optimization methods, devices, equipment and storage media. Background Art

[0002] With the popularization of the web (World Wide Web), network applications have become more and more client-based. Client technologies with strong interactivity have brought users a higher and more comprehensive network experience. As a result, images have taken up an increasingly larger proportion in web applications. Images are an important way to display information on web pages. The quality of images and the richness of their content are both core indicators of search engines. The quality of images and the richness of their content also determine the browsing experience of users throughout the entire search process. Summary of the invention

[0003] The present disclosure provides a method, apparatus, device and storage medium for image optimization.

[0004] According to a first aspect of the present disclosure, a method for optimizing an image is provided, including: obtaining an image to be optimized, recorded as a reference image; judging whether the image to be optimized is blurred, processing the image to be optimized based on an operation corresponding to the judgment result, and using the processed image as a current image; performing the following iterative steps: in response to determining that the similarity between the current image and the reference image does not meet a preset similarity threshold, using the current image as the reference image for the next round of iterative process, continuing to process the image to be optimized, using the processed image as the current image for the next round of iterative process, and performing the next round of iterative process; in response to determining that the similarity between the current image and the reference image meets a preset similarity threshold, stopping the iterative process; and determining the current image as the optimized image.

[0005] According to a second aspect of the present disclosure, there is provided an image optimization device, comprising: a first acquisition module, configured to acquire an image to be optimized, recorded as a reference image; a processing module, configured to determine whether the image to be optimized is blurred, process the image to be optimized based on an operation corresponding to the determination result, and use the processed image as a current image; an iteration module, configured to perform the following iteration steps: in response to determining that the similarity between the current image and the reference image does not meet a preset similarity threshold, use the current image as the reference image for the next iteration process, continue to process the image to be optimized, use the processed image as the current image for the next iteration process, and perform the next iteration process; a termination module, configured to stop the iteration process in response to determining that the similarity between the current image and the reference image meets a preset similarity threshold; a determination module, configured to determine the current image as the optimized image.

[0006] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any implementation manner in the first aspect.

[0007] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to cause a computer to execute the method described in any implementation manner of the first aspect.

[0008] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements the method described in any implementation manner in the first aspect.

[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0011] Figure 1 is an exemplary system architecture diagram in which the present disclosure may be applied;

[0012] Figure 2 is a flow chart of an embodiment of a picture optimization method according to the present disclosure;

[0013] Figure 3 is a flowchart of another embodiment of the picture optimization method according to the present disclosure;

[0014] Figure 4 is a flowchart of another embodiment of the picture optimization method according to the present disclosure;

[0015] Figure 5 is a structural schematic diagram of an embodiment of a picture optimization device according to the present disclosure;

[0016] Figure 6 It is a block diagram of an electronic device used to implement the picture optimization method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0018] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0019] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the picture optimization method or picture optimization apparatus of the present disclosure can be applied.

[0020] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0021] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send information, etc. Various client applications can be installed on the terminal devices 101, 102, 103.

[0022] The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc. When the terminal devices 101, 102, 103 are software, they may be installed in the above electronic devices. They may be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.

[0023] The server 105 can provide various services. For example, the server 105 can analyze and process the images to be optimized obtained from the terminal devices 101, 102, and 103, and generate processing results (eg, optimized images).

[0024] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 105 is software, it can be implemented as multiple software or software modules (for example, for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0025] It should be noted that the image optimization method provided in the embodiment of the present disclosure is generally executed by the server 105 , and accordingly, the image optimization device is generally disposed in the server 105 .

[0026] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0027] Continue to refer Figure 2 , which shows a process 200 of an embodiment of a picture optimization method according to the present disclosure. The picture optimization method comprises the following steps:

[0028] Step 201, obtain a picture to be optimized, recorded as a reference picture.

[0029] In this embodiment, the execution subject of the image optimization method (for example Figure 1 The server 105 shown in the figure can obtain the picture to be optimized and record it as the reference picture. The picture to be optimized can be obtained by taking a picture through the terminal shooting function or extracted from the terminal storage database; it can also be obtained by the above-mentioned execution subject during the user uploading process when the user publishes the content. This embodiment does not make specific restrictions on this. After obtaining the picture to be optimized, the above-mentioned execution subject will record the picture to be optimized as the reference picture.

[0030] Step 202, determine whether the image to be optimized is blurred, process the image to be optimized based on an operation corresponding to the determination result, and use the processed image as the current image.

[0031] In this embodiment, the execution subject can determine whether the image to be optimized obtained in step 201 is blurred, thereby obtaining a corresponding judgment result, wherein the judgment result can be that the image to be optimized is in a blurred state, or that the image to be optimized is not in a blurred state, that is, the image to be optimized is in a non-blurred state. Among them, the execution subject can determine whether the image to be optimized is blurred based on an existing deep learning model, such as a Brenner gradient function, a Tenengrad gradient function, a Laplacian gradient function, etc., and the present disclosure does not make specific limitations on this.

[0032] Then, the execution subject processes the image to be optimized based on the operation corresponding to the judgment result, and uses the processed image as the current image. For example, when the judgment result is that the image to be optimized is in a blurred state, the execution subject enlarges the image to be optimized, and uses the enlarged image as the current image. For another example, when the judgment result is that the image to be optimized is in a non-blurred state, the execution subject compresses the image to be optimized, and uses the compressed image as the current image.

[0033] Step 203: determine whether the similarity between the current image and the reference image meets a preset similarity threshold.

[0034] In this embodiment, the execution subject will determine whether the similarity between the current image and the reference image meets a preset similarity threshold, wherein the similarity threshold can be set according to the situation, and is not limited in this embodiment. Specifically, in this embodiment, it is determined whether the similarity between the feature information of the current image and the feature information of the reference image meets the preset similarity threshold, that is, the execution subject can extract the feature information of the current image and the feature information of the reference image, and then determine whether the similarity between the feature information of the current image and the feature information of the reference image meets the preset similarity threshold. If not, step 204 is executed; if so, step 205 is executed.

[0035] Specifically, in the process of extracting image features, the execution subject will recognize the center point of the image by default, and then extract the feature information of the image. The feature information may include the information of the subject in the image and the coordinate information of the subject in the image. The subject may be the main text content in the image, or a specific object, etc., and then the extracted subject content and its coordinate information are used as the feature information of the image. After extracting the feature information of the reference image and the feature information of the current image, the execution subject will calculate the similarity between the feature information of the current image and the feature information of the reference image, and determine whether the similarity meets the similarity threshold.

[0036] It should be noted that, since the coordinate information of the above text will change during the process of processing the image, the coordinate information in this embodiment refers to the relative coordinate information, that is, what is extracted in this embodiment is the relative coordinate information of the text or object in the image.

[0037] Step 204, using the current picture as the reference picture for the next round of iteration process, continuing to process the picture to be optimized, and using the processed picture as the current picture for the next round of iteration process.

[0038] In this embodiment, when it is determined that the similarity between the current image and the reference image does not meet the preset similarity threshold, that is, when the similarity between the feature information of the current image (the subject in the current image and the relative coordinates of the subject) and the feature information of the reference image (the subject in the reference image and the relative coordinates of the subject) does not meet the preset similarity threshold, the execution subject will use the current image as the reference image for the next round of iteration. That is, in this embodiment, when the similarity between the current image and the reference image does not meet the preset similarity threshold, the image processed in the previous round will be used as the reference image at this time, and then the execution subject will continue to process the image to be optimized, and use the processed image at this time as the latest current image, and then perform the next round of iteration, that is, re-execute step 203 to determine whether the similarity between the current image and the reference image at this time meets the similarity threshold, until the similarity between the current image and the reference image meets the preset similarity threshold.

[0039] As an example, in response to determining that the similarity between the current image and the benchmark image does not meet the preset similarity threshold, the above-mentioned execution entity will use the current image as the benchmark image for the next round of iteration process; then continue to enlarge the image to be optimized, and use the enlarged image as the current image for the next round of iteration process; thereafter, determine whether the similarity between the feature information of the current image and the feature information of the benchmark image meets the similarity threshold.

[0040] Step 205: determine the current picture as the optimized picture.

[0041] In this embodiment, when it is determined that the similarity between the current image and the reference image satisfies the preset similarity threshold, that is, when the similarity between the feature information of the current image (the subject in the current image and the relative coordinates of the subject) and the feature information of the reference image (the subject in the reference image and the relative coordinates of the subject) satisfies the preset similarity threshold, the iteration process will be stopped, and the above-mentioned execution subject will directly determine the current image as the optimized image. The similarity between the feature information of the current image and the feature information of the reference image satisfies the similarity threshold, indicating that the feature information of the image under the current magnification or the current compression ratio can be accurately extracted, and there is no need to continue to magnify or compress at this time, so the above-mentioned execution subject will use the current image at this time as the image to be optimized.

[0042] The picture optimization method provided by the embodiment of the present disclosure first obtains the picture to be optimized and records it as the reference picture; then determines whether the picture to be optimized is blurred, processes the picture to be optimized based on the operation corresponding to the determination result, and uses the processed picture as the current picture; then determines whether the similarity between the current picture and the reference picture meets a preset similarity threshold, in response to determining that the similarity between the current picture and the reference picture does not meet the preset similarity threshold, uses the current picture as the reference picture for the next round of iterative process, continues to process the picture to be optimized, uses the processed picture as the current picture for the next round of iterative process, and performs the next round of iterative process; in response to determining that the similarity between the current picture and the reference picture meets the preset similarity threshold, stops the iterative process; finally, determines the current picture as the optimized picture. The image optimization method in this embodiment first determines the blur state of the image to be optimized, then processes the image to be optimized using an operation corresponding to the determination result, and compares whether the similarity between the feature information of the current image and the feature information of the image obtained by the previous processing meets a preset similarity threshold. If not, the processing continues until the similarity between the feature information of the images before and after the processing meets the similarity threshold, and then the iterative process ends. In this way, the image to be optimized is intelligently analyzed and optimized while ensuring that key information in the image is not lost, thereby improving the efficiency and accuracy of image optimization.

[0043] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0044] Continue to refer Figure 3 , Figure 3 A process 300 of another embodiment of a method for optimizing an image according to the present disclosure is shown. The method for optimizing an image includes the following steps:

[0045] Step 301, obtain a picture to be optimized, recorded as a reference picture.

[0046] Step 301 is basically the same as step 201 of the aforementioned embodiment. The specific implementation method can refer to the aforementioned description of step 201, which will not be repeated here.

[0047] Step 302, in response to the image to be optimized being in a blurred state, the image to be optimized is enlarged to a first preset multiple to obtain a first image, and the first image is used as the current image.

[0048] In this embodiment, when the image to be optimized is in a blurred state, the execution subject of the image optimization method (for example Figure 1The server 105 shown in the figure can enlarge the image to be optimized to a first preset multiple, thereby obtaining a first image, and record the first image as the current image. As an example, the first preset multiple can be set to 2, that is, the image to be optimized is enlarged by 2 times. In this embodiment, the image to be optimized can be enlarged by using image lossless enlargement technology, that is, the length and width of the image to be optimized are enlarged by 2 times, and the image quality is guaranteed to be lossless. If the image to be optimized is in a blurred state, the image to be optimized is enlarged so that the processed image can be clearer.

[0049] Step 303: determine whether the similarity between the current image and the reference image meets a preset similarity threshold.

[0050] In this embodiment, the execution subject can extract the feature information of the current image and the feature information of the reference image, and then determine whether the similarity between the feature information of the current image and the feature information of the reference image meets a preset similarity threshold. If not, step 304 is executed; if yes, step 305 is executed.

[0051] Step 304, using the current picture as the reference picture for the next round of iteration process, enlarging the picture to be optimized to a second preset multiple to obtain a second picture, and using the second picture as the current picture for the next round of iteration process.

[0052] In this embodiment, the above-mentioned execution entity can use the current image as the reference image for the next round of iteration process, and continue to enlarge the image to be optimized to a second preset multiple to obtain a second image, and use the second image as the current image for the next round of iteration process, and then continue to the next round of iteration, that is, continue to determine whether the similarity between the feature information of the new current image and the feature information of the reference image meets the similarity threshold, wherein the second preset multiple is greater than the first preset multiple.

[0053] It should be noted that the above-mentioned execution entity will pre-set a magnification threshold (maximum magnification value), then the first magnification and the second magnification should be values ​​greater than 1 and less than the magnification threshold, and the first magnification is less than the second magnification. For example, it can be set to 16 times, or it can be set to other values ​​according to actual conditions. This embodiment does not make specific limitations on this.

[0054] The process of enlarging the image to be optimized should be a gradual process, that is, the above-mentioned execution subject will gradually enlarge the image to be optimized to the maximum magnification. For example, the magnification can be set to increase by 2 each time, that is, the image to be optimized can be enlarged by 2 times for the first time, 4 times for the second time, 6 times for the third time... and so on, until the image to be optimized is enlarged to the maximum magnification. Because if the image to be optimized is directly enlarged to the maximum magnification, then the image is clear at this time, and the main information in the image can be extracted, but the image to be optimized may be enlarged to a value smaller than the maximum magnification to achieve this effect. At this time, enlarging the image to be optimized to the maximum magnification will lead to the problem of wasting storage space. Therefore, in this embodiment, the image to be optimized will be gradually enlarged, that is, the magnification will be gradually increased until the maximum magnification value is reached.

[0055] Step 305: determine the current picture as the optimized picture.

[0056] Step 305 is basically the same as step 205 of the aforementioned embodiment. The specific implementation method can refer to the aforementioned description of step 205, which will not be repeated here.

[0057] Step 306, obtaining the size information of the optimized image.

[0058] In this embodiment, after determining the optimized image, the execution subject may obtain the size information of the optimized image. Furthermore, the execution subject may pre-set an expected size range of the image, and after obtaining the size information of the optimized image, the execution subject will determine whether the size information is within the preset expected size range.

[0059] Step 307: In response to determining that the size information is within the first preset interval, adjust the contrast and / or sharpness of the optimized image.

[0060] In this embodiment, when it is determined that the size information of the optimized image is within the first preset interval (expected size interval), the above-mentioned execution subject will adjust the contrast and / or sharpness information of the optimized image. For example, the image enhancement technology can be used to adjust the contrast of the too dark or too bright parts in the optimized image, so as to make the image more vivid. For another example, the image clarity enhancement technology can be used to adjust the sharpness (clarity) of the optimized image, that is, to denoise the optimized image and optimize the image texture details, so as to make the picture more natural and clear.

[0061] from Figure 3 It can be seen that Figure 2Compared with the corresponding embodiments, the image optimization method in this embodiment, when the image to be optimized is in a blurred state, enlarges the image to be optimized, and continuously compares whether the similarity between the feature information of the image before and after the enlargement process meets the preset similarity threshold, determines the optimal magnification based on the comparison result, and obtains the optimized image, thereby realizing intelligent analysis and processing of the blurred image, so as to obtain a clear image; in addition, when the size information of the optimized image is within a preset range, the contrast and / or sharpness of the optimized image is adjusted, so that the optimized image is clearer and vivid, thereby improving the quality of the optimized image.

[0062] Continue to refer Figure 4 , Figure 4 A process 400 of another embodiment of a method for optimizing an image according to the present disclosure is shown. The method for optimizing an image includes the following steps:

[0063] Step 401, obtain the image to be optimized, which is recorded as the reference image.

[0064] Step 401 is basically the same as step 201 of the aforementioned embodiment. The specific implementation method can refer to the aforementioned description of step 201, which will not be repeated here.

[0065] Step 402: In response to the image to be optimized being in a non-blurred state, compress the image to be optimized to a first preset compression ratio to obtain a third image, and use the third image as the current image.

[0066] In this embodiment, when the image to be optimized is in a non-blurred state, the execution subject of the image optimization method (for example Figure 1 The server 105 shown in the figure can compress (or reduce) the image to be optimized to the first preset compression rate, thereby obtaining a third image, and record the third image as the current image. As an example, the first preset compression rate can be set to 1 / 2, that is, the image to be optimized is first compressed to 1 / 2. In this embodiment, the image to be optimized can be compressed using image lossless compression technology to ensure lossless image quality. The image to be optimized is in a non-blurred state, indicating that the image to be optimized is clear, so it can be compressed, thereby saving the space it occupies while ensuring that the information in the image is not lost.

[0067] Step 403: determine whether the similarity between the current image and the reference image meets a preset similarity threshold.

[0068] In this embodiment, the execution subject may determine whether the similarity between the feature information of the current image and the feature information of the reference image meets a preset similarity threshold. If not, step 404 is executed; if yes, step 405 is executed.

[0069] Step 404, using the current picture as a reference picture for the next round of iteration process, compressing the picture to be optimized to a second preset compression ratio to obtain a fourth picture, and using the fourth picture as the current picture for the next round of iteration process.

[0070] In this embodiment, the above-mentioned execution entity can use the current image as the reference image for the next round of iterative process, and continue to compress the image to be optimized to the second preset compression rate to obtain a fourth image, and use the fourth image as the current image for the next round of iterative process, and then perform the next round of iterative process, that is, continue to determine whether the similarity between the feature information of the new current image and the feature information of the reference image meets the similarity threshold, wherein the second preset compression rate is less than the first compression rate.

[0071] It should be noted that the above-mentioned execution entity will pre-set a compression rate threshold (minimum compression rate value), then the first preset compression rate and the second preset compression rate should both be values ​​greater than the compression rate threshold and less than 1, and the second preset compression rate is less than the first compression rate. For example, it can be set to 1 / 16, or it can be set to other values ​​according to actual conditions. This embodiment does not make specific limitations on this.

[0072] The process of compressing the image to be optimized should be a gradual process, that is, the execution subject will gradually compress the image to be optimized to the compression rate threshold. For example, the compression rate can be set to be adjusted by 1 / 2 each time, that is, the image to be optimized can be compressed to 1 / 2 for the first time, 1 / 4 for the second time, 1 / 8 for the third time, and so on, until the image to be optimized is compressed to the compression rate threshold. This avoids the problem of unclear images and inability to extract feature information in the image caused by directly compressing the image to the minimum compression rate.

[0073] Step 405: determine the current picture as the optimized picture.

[0074] Step 406, obtaining the size information of the optimized image.

[0075] In this embodiment, after determining the optimized picture, the execution subject can obtain the size information of the optimized picture. In addition, the execution subject can pre-set an expected size interval of the picture. After obtaining the size information of the optimized picture, the execution subject will determine whether the size information is within the preset expected size interval. Steps 405-406 are basically the same as steps 305-306 of the aforementioned embodiment. The specific implementation method can refer to the aforementioned description of steps 305-306, which will not be repeated here.

[0076] Step 407: In response to determining that the size information is within the second preset interval, adjust the compression ratio of the optimized image.

[0077] In this embodiment, when it is determined that the size information of the optimized image is within the second preset interval (expected size interval), the execution subject will adjust the compression ratio of the optimized image. Specifically, the optimized image can be enlarged by a preset multiple, thereby solving the minimum granularity problem of human eye and machine recognition caused by compression, and ensuring the clarity of the optimized image.

[0078] from Figure 4 It can be seen that Figure 3 Compared with the corresponding embodiments, the image optimization method in this embodiment, when the image to be optimized is in a non-blurred state, compresses the image to be optimized, and continuously compares whether the similarity between the feature information of the image before and after the compression processing meets the preset similarity threshold, determines the best compression ratio based on the comparison result, and obtains the optimized image, thereby realizing intelligent analysis and optimization of the non-blurred image, thereby obtaining an image that occupies a smaller space, reducing the bandwidth and storage costs of the server, and saving network resources for users; in addition, when the size information of the optimized image is within a preset range, the compression ratio of the optimized image is adjusted, thereby solving the minimum granularity problem of human eye and machine recognition caused by compression, and ensuring the clarity of the optimized image.

[0079] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a picture optimization device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0080] like Figure 5 As shown, the image optimization device 500 of this embodiment includes: a first acquisition module 501, a processing module 502, an iteration module 503, a termination module 504 and a determination module 505. Among them, the first acquisition module 501 is configured to acquire the image to be optimized, recorded as the reference image; the processing module 502 is configured to determine whether the image to be optimized is blurred, process the image to be optimized based on the operation corresponding to the determination result, and use the processed image as the current image; the iteration module 503 is configured to perform the following iteration steps: in response to determining that the similarity between the current image and the reference image does not meet the preset similarity threshold, use the current image as the reference image of the next round of iteration process, continue to process the image to be optimized, use the processed image as the current image of the next round of iteration process, and perform the next round of iteration process; the termination module 504 is configured to stop the iteration process in response to determining that the similarity between the current image and the reference image meets the preset similarity threshold; the determination module 505 is configured to determine the current image as the optimized image.

[0081] In this embodiment, in the image optimization device 500, the specific processing of the first acquisition module 501, the processing module 502, the iteration module 503, the termination module 504 and the determination module 505 and the technical effects thereof can be referred to respectively. Figure 2 The relevant descriptions of steps 201 - 205 in the corresponding embodiment are not repeated here.

[0082] In some optional implementations of this embodiment, the judgment result includes that the image to be optimized is in a blurred state; and the processing module includes: a first enlargement submodule, configured to enlarge the image to be optimized to a first preset multiple to obtain a first image; a first determination submodule, configured to use the first image as the current image.

[0083] In some optional implementations of this embodiment, the iteration module includes: a second enlarging submodule, configured to enlarge the image to be optimized to a second preset multiple to obtain a second image, wherein the second preset multiple is greater than the first preset multiple; a second determining submodule, configured to use the second image as the current image for the next round of iteration process.

[0084] In some optional implementations of this embodiment, the image optimization device 500 also includes: a second acquisition module, configured to obtain size information of the optimized image; a first adjustment module, configured to adjust the contrast and / or sharpness of the optimized image in response to determining that the size information is within a first preset interval.

[0085] In some optional implementations of this embodiment, the judgment result includes that the picture to be optimized is in a non-blurred state; and the processing module includes: a first compression submodule, configured to compress the picture to be optimized to a first preset compression ratio to obtain a third picture; a third determination submodule, configured to use the third picture as the current picture.

[0086] In some optional implementations of this embodiment, the iteration module includes: a second compression submodule, configured to compress the image to be optimized to a second preset compression ratio to obtain a fourth image, wherein the second preset compression ratio is less than the first preset compression ratio; and a fourth determination submodule, configured to use the fourth image as the current image for the next round of iteration process.

[0087] In some optional implementations of this embodiment, the image optimization device 500 also includes: a third acquisition module, configured to obtain size information of the optimized image; a second adjustment module, configured to adjust the compression ratio of the optimized image in response to determining that the size information is within a second preset interval.

[0088] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0089] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0090] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0091] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0092] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the image optimization method. For example, in some embodiments, the image optimization method or the image retrieval method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the image optimization method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the image optimization method in any other appropriate manner (e.g., by means of firmware).

[0093] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0094] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0095] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 foregoing.

[0096] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

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

[0098] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0100] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for optimizing an image, comprising: Get the image to be optimized and record it as the benchmark image; Determine whether the image to be optimized is blurred, process the image to be optimized based on an operation corresponding to the determination result, and use the processed image as the current image; Performing the following iterative steps: in response to determining that the similarity between the current image and the reference image does not meet a preset similarity threshold, using the current image as the reference image for the next round of iterative process, continuing to process the image to be optimized, using the processed image as the current image for the next round of iterative process, and performing the next round of iterative process; In response to determining that the similarity between the current picture and the reference picture satisfies the preset similarity threshold, stopping the iteration process; Determine the current picture as the optimized picture; The judgment result includes that the image to be optimized is in a blurred state; and The step of processing the image to be optimized based on an operation corresponding to the judgment result and using the processed image as the current image includes: Enlarging the image to be optimized to a first preset multiple to obtain a first image; Taking the first picture as the current picture; The judgment result also includes that the image to be optimized is in a non-blurred state; and The step of processing the image to be optimized based on an operation corresponding to the judgment result and using the processed image as the current image includes: Compressing the image to be optimized to a first preset compression ratio to obtain a third image; The third picture is used as the current picture.

2. The method according to claim 1, wherein: The step of continuing to process the image to be optimized and using the processed image as the current image of the next round of iteration process includes: Enlarging the image to be optimized to a second preset multiple to obtain a second image, wherein the second preset multiple is greater than the first preset multiple; The second picture is used as the current picture of the next round of iteration process.

3. The method according to claim 2, further comprising: Obtaining size information of the optimized image; In response to determining that the size information is within a first preset interval, adjusting the contrast and / or sharpness of the optimized image.

4. The method according to claim 1, wherein: The step of continuing to process the image to be optimized and using the processed image as the current image of the next round of iteration process includes: Compressing the image to be optimized to a second preset compression ratio to obtain a fourth image, wherein the second preset compression ratio is less than the first preset compression ratio; The fourth picture is used as the current picture of the next round of iteration process.

5. The method according to claim 4, further comprising: Obtaining size information of the optimized image; In response to determining that the size information is within a second preset interval, a compression ratio of the optimized image is adjusted.

6. A picture optimization device, comprising: A first acquisition module is configured to acquire a picture to be optimized, recorded as a reference picture; a processing module configured to determine whether the image to be optimized is blurred, process the image to be optimized based on an operation corresponding to the determination result, and use the processed image as the current image; an iteration module, configured to perform the following iteration steps: in response to determining that the similarity between the current image and the reference image does not meet a preset similarity threshold, using the current image as the reference image for the next iteration process, continuing to process the image to be optimized, using the processed image as the current image for the next iteration process, and performing the next iteration process; a termination module, configured to stop the iteration process in response to determining that the similarity between the current picture and the reference picture satisfies the preset similarity threshold; A determination module, configured to determine the current picture as an optimized picture; The judgment result includes that the image to be optimized is in a blurred state; and The processing module comprises: A first enlarging submodule is configured to enlarge the image to be optimized to a first preset multiple to obtain a first image; A first determining submodule is configured to use the first picture as a current picture; The judgment result includes that the image to be optimized is in a non-blurred state; and The processing module comprises: A first compression submodule is configured to compress the image to be optimized to a first preset compression ratio to obtain a third image; The third determining submodule is configured to use the third picture as the current picture.

7. The device according to claim 6, wherein: The iteration module includes: A second magnification submodule is configured to magnify the image to be optimized to a second preset multiple to obtain a second image, wherein the second preset multiple is greater than the first preset multiple; The second determining submodule is configured to use the second picture as the current picture of the next round of iteration process.

8. The apparatus according to claim 7, further comprising: A second acquisition module is configured to acquire size information of the optimized image; The first adjustment module is configured to adjust the contrast and / or sharpness of the optimized image in response to determining that the size information is within a first preset interval.

9. The device according to claim 6, wherein: The iteration module includes: A second compression submodule is configured to compress the image to be optimized to a second preset compression ratio to obtain a fourth image, wherein the second preset compression ratio is less than the first preset compression ratio; The fourth determining submodule is configured to use the fourth picture as the current picture of the next round of iteration process.

10. The apparatus according to claim 9, further comprising: A third acquisition module is configured to acquire size information of the optimized image; The second adjustment module is configured to adjust the compression ratio of the optimized image in response to determining that the size information is within a second preset interval.

11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.

13. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image super-resolution method based on non local mean value

    CN108765287A

  • Image processing method, image processing device and terminal equipment

    CN108921806A