A method and apparatus for restoring a compressed image
By evaluating the image quality factor and matching recovery data set of the compressed image set, and combining the process parameters of the image processing equipment and the analysis performance adaptation index of the image processing equipment, equipment adjustment is carried out, and the problem of degradation of image recovery quality in complex communication environments is solved, and the effect of improving image recovery quality and equipment performance is achieved.
Patent Information
- Application Number
- CN202411865308.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In complex communication environments, the reliability of data transmission is severely affected, resulting in a degradation of image recovery quality.
By evaluating image quality factors based on image performance parameters of compressed image sets, matching image recovery data sets, collecting process parameters of image processing equipment under complex communication conditions, analyzing performance adaptation index, and performing device adjustments to improve the performance of image processing equipment.
It effectively improves image recovery quality and enhances the overall performance and image processing capabilities of image processing equipment.
Smart Images

Figure CN119324995B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular, to a method and device for restoring compressed images. Background Art
[0002] With the rapid development of information technology, the amount of image data has increased sharply, posing higher requirements for storage and transmission efficiency. However, traditional methods are unable to cope with noise interference, bandwidth limitations, and real-time requirements, especially in complex communication environments, where the reliability of data transmission is severely affected, resulting in a decline in image restoration quality.
[0003] Existing communication image processing technologies have overemphasized the algorithm optimization of image compression and restoration, but the applied image processing devices still remain in a lagging state. As a result, in practical applications, the image processing devices may not be able to keep up with the algorithm optimization of image compression and restoration at the same demand level, making it still impossible to effectively improve the image restoration quality. Summary of the Invention
[0004] The present invention provides a method and device for restoring compressed images to solve the problem that in a complex communication environment, the reliability of data transmission is severely affected, resulting in a decline in image restoration quality.
[0005] According to one aspect of the present invention, there is provided a method for restoring compressed images, including:
[0006] Evaluating the image quality factor of the compressed image set based on the image performance parameters of the compressed image set, and matching the image restoration data set of the compressed image set from the image database based on the image quality factor;
[0007] Under complex communication conditions, collecting the first process parameters of the image processing device for executing the image restoration data set and the second process parameters of the image processing device for restoring the demonstration image;
[0008] Analyzing the performance adaptation index of the image processing device based on the first process parameter and the second process parameter;
[0009] Performing a difference process on the performance adaptation index and the performance adaptation threshold to obtain the performance adaptation index difference of the image processing device, and matching the performance adaptation index difference with the device adjustment set corresponding to each performance adaptation index difference interval in the image database to obtain the device adjustment set of the image processing device;
[0010] Executing the device adjustment set to perform adjustment feedback on the image device to obtain the target image device, and inputting the compressed image set under complex communication conditions into the target image device for image restoration.
[0011] According to another aspect of the present invention, there is provided a device for restoring compressed images, comprising:
[0012] A first matching module, configured to evaluate the image quality factor of the compressed image set based on the image performance parameters of the compressed image set, and match the image restoration data set of the compressed image set from the image database based on the image quality factor;
[0013] A collection module, configured to collect the first process parameters of the image processing device for executing the image restoration data set and the second process parameters of the image processing device for restoring the demonstration image under complex communication conditions;
[0014] An analysis module, configured to analyze the performance adaptation index of the image processing device based on the first process parameter and the second process parameter;
[0015] A second matching module, configured to perform a difference process on the performance adaptation index and the performance adaptation threshold to obtain the performance adaptation index difference of the image processing device, and match the performance adaptation index difference with the device adjustment set corresponding to each performance adaptation index difference interval in the image database to obtain the device adjustment set of the image processing device;
[0016] A feedback module, configured to perform adjustment feedback on the image device by executing the device adjustment set to obtain a target image device, and input the compressed image set under complex communication conditions into the target image device for image restoration.
[0017] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0018] At least one processor;
[0019] And a memory communicatively connected to the at least one processor;
[0020] Wherein, the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for restoring compressed images according to any embodiment of the present invention
[0021] According to another aspect of the present invention, there is provided a computer-readable storage medium, the computer-readable storage medium storing computer instructions, and the computer instructions are used to cause a processor to implement the method for restoring compressed images according to any embodiment of the present invention when executed.
[0022] The technical solution of the embodiment of the present invention can effectively match the image restoration data set of the compressed image set by analyzing the image performance parameters of the compressed image set, ensuring that the restoration process can be optimized for specific compressed image characteristics, thereby improving the quality of the restored image. Then, by collecting the execution process parameters of the image processing device under complex communication conditions, the performance adaptation index of the image processing device can be analyzed, and further, feedback adjustment can be made to the image processing device to improve the overall performance and image processing ability of the image processing device.
[0023] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0025] Figure 1 It is a schematic flow chart of a method for restoring a compressed image provided in Embodiment 1 of the present invention;
[0026] Figure 2 It is a schematic flow chart of a method for restoring a compressed image provided in Embodiment 2 of the present invention;
[0027] Figure 3 It is a schematic diagram of the probability change rate curve of the gray value to which a sampled compressed image belongs provided in Embodiment 2 of the present invention;
[0028] Figure 4 It is a schematic flow chart of a method for restoring a compressed image provided in Embodiment 3 of the present invention;
[0029] Figure 5 It is a schematic flow chart of a method for restoring a compressed image provided in Embodiment 4 of the present invention;
[0030] Figure 6 It is a schematic structural diagram of a device for restoring a compressed image provided in Embodiment 5 of the present invention;
[0031] Figure 7 It is a schematic structural diagram of an electronic device for a method for restoring a compressed image according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0032] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention. It should be understood that the steps recorded in the method embodiments of the present invention can be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this regard.
[0033] As used herein, the term "including" and its variants are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variants thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0035] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless clearly stated otherwise in the context, it should be understood as "one or more".
[0036] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only for illustrative purposes and do not limit the scope of these messages or information.
[0037] Embodiment 1
[0038] Figure 1Schematic flowchart of a method for restoring a compressed image provided in Embodiment 1 of the present invention. This method is applicable to the situation of restoring a compressed image under complex communication conditions. This method can be executed by a compressed image restoration device, where the device can be implemented by software and / or hardware and is generally integrated into an electronic device. In this embodiment, the electronic device includes, but is not limited to: a computer device.
[0039] As Figure 1 shown, a method for restoring a compressed image provided in Embodiment 1 of the present invention includes the following steps:
[0040] S110. Evaluate the image quality factor of the compressed image set based on the image performance parameters of the compressed image set, and match the image restoration data set of the compressed image set from the image database based on the image quality factor.
[0041] Among them, the compressed image set may include at least one compressed image, and there is no limitation on the type and application scenario of the compressed image; the image performance parameters of the compressed image set may include parameters such as gray values, gray value probability change curves, and the width of each sampling edge, and no specific limitation is made here.
[0042] The compressed image set can be uploaded to the image processing device through interfaces and resume interrupted transfer, etc. When the background of the image processing device receives the compressed image set, it can choose to receive it offline or online, and supports the online reception of the compressed image set in the background and timely restoration.
[0043] It should be noted that the image quality factor of the compressed image set is a numerical value used to determine the clarity of the compressed image set. When the gray variance is small, it indicates that the gray value distribution in the compressed image is relatively concentrated, resulting in insufficient details and textures in the compressed image, blurred edges, and a significant increase in the edge width compared to the average width of the reference edge. At the same time, the slow change of the gray value exacerbates the blurring of the image, reducing the change rate of the average gray value with respect to the spatial position, that is, the average change rate of the gray value probability is small. These effects are interrelated and jointly reduce the clarity and visual effect of the compressed image, making the boundaries of objects in the image unclear, details lost, and the overall appearance smooth and blurred, thus comprehensively resulting in a relatively blurred compressed image set with a low quality level. Therefore, it provides a key data basis for restoring the compressed image, helps to accurately reconstruct image details, and improves image clarity.
[0044] In this embodiment, the evaluation process of the image quality factor of the compressed image set includes: calculating the gray variance of each sampled compressed image, the gray value probability change rate curve to which each sampled compressed image belongs, the average edge width of each sampled compressed image, and the preset reference average edge width from the image database based on the image performance parameters of the compressed image; comprehensively analyzing the gray variance, the average change rate of the gray value probability, the average edge width, and the preset reference average edge width from the image database to determine the image quality factor of the compressed image set.
[0045] It should be noted that each sampled compressed image is obtained by extracting image samples from the compressed image set. Since the number of compressed images in the compressed image set is large, with 10.1 million per day on average, analyzing all images in the compressed image set will increase the data processing burden. Therefore, sample extraction is required.
[0046] In this embodiment, the image quality factor of the compressed image set is matched with the image restoration data sets corresponding to each image quality factor interval stored in the image database, thereby obtaining the image restoration data set of the compressed image set.
[0047] Exemplarily, assuming that the image quality factor of the compressed image set is K, in the image quality factor interval [K - 15%, K + 5%] stored in the image database, the processing process of the image restoration data set corresponding to the image quality factor interval [K - 15%, K + 5%] includes: realizing image restoration through the inverse filtering algorithm and the Wiener filtering algorithm, and comprehensively realizing the enhancement of the restored image through the gray level transformation principle and the histogram processing principle.
[0048] Specifically, the inverse filtering algorithm is used to preliminarily restore the image to eliminate degradation factors such as blurring; the Wiener filtering algorithm is used to further improve the image quality (especially when dealing with noisy images); the gray level transformation principle and the histogram processing principle are used to enhance the image, adjust its contrast and brightness, make the image details clearer, and the overall visual effect better.
[0049] S120. Under complex communication conditions, collect the first process parameters of the image processing device for executing the image restoration data set and the second process parameters of the image processing device for restoring the demonstration image.
[0050] Among them, the process parameters of the image processing device for execution include multiple parameters such as the remaining memory, the total traffic used, the CPU utilization rate, and the image restoration duration, which are not specifically limited here.
[0051] The image processing device's execution of the image restoration data set can be understood as the image processing device's invocation and execution of the algorithms involved in the image restoration data set.
[0052] A demonstration image refers to a specific image used for demonstrating, verifying, or testing the recovery ability of an image processing device, which can be a certain compressed image in a compressed image set.
[0053] In this embodiment, by analyzing the process parameters during the execution of the image processing device, further adjustment feedback is performed on the image processing device, enabling the timely discovery of performance bottlenecks in the image processing device and making adjustments, such as releasing the cache, etc., thereby significantly improving the speed and efficiency of the image processing device in processing and recovering images, while enhancing the stability and reliability of the image processing device.
[0054] S130. Analyze the performance adaptation index of the image processing device based on the first process parameter and the second process parameter.
[0055] Specifically, the performance adaptation index of the image processing device is obtained through comprehensive analysis of the free memory amount of the image processing device at the end time point of the execution monitoring cycle, the total traffic used during the execution monitoring cycle, the average network transmission rate of the image processing device during the execution monitoring cycle, the CPU utilization rate of the image processing device during the execution monitoring cycle, and the image recovery deviation duration.
[0056] Among them, the free memory amount of the image processing device at the end time point of the execution monitoring cycle is calculated based on the remaining memory amount of the image processing device at the start time point of the execution monitoring cycle extracted from the first process parameter, the memory occupancy of the compressed image set, and the memory occupancy of the image recovery data set.
[0057] Among them, the total traffic used during the execution monitoring cycle, the average network transmission rate of the image processing device during the execution monitoring cycle, and the CPU utilization rate of the image processing device during the execution monitoring cycle are obtained from the first process parameter.
[0058] Among them, the image recovery deviation duration of the image processing device during the execution monitoring cycle is calculated based on the image recovery duration of the demonstration image to which the image processing device belongs extracted from the second process parameter during the execution monitoring cycle.
[0059] S140. Perform a difference process on the performance adaptation index and the performance adaptation threshold to obtain the performance adaptation index difference of the image processing device, and match the performance adaptation index difference with the device adjustment sets corresponding to each performance adaptation index difference interval in the image database to obtain the device adjustment set of the image processing device.
[0060] Among them, the performance adaptation threshold represents the minimum value of the reasonable range of the performance adaptation index of the image processing device, which can be extracted from the image database; the rules and values corresponding to the device adjustment sets corresponding to each performance adaptation index difference interval are formulated by the device operation administrator based on the historical operation conditions of the image processing device.
[0061] Exemplarily, assume that the performance adaptation index difference of the image processing device is D. In the performance adaptation index difference interval [D - 20%, D + 40%] stored in the image database, the device adjustment set corresponding to the performance adaptation index difference interval [D - 20%, D + 40%] includes: automatically clearing expired cache data, evaluating the validity of cache data using the access frequency metric, and then clearing the data with an access frequency lower than the set access frequency threshold. According to the analysis result of the CPU usage situation, select a CPU scheduling policy, such as priority scheduling, and then set the priority of the image restoration process to the highest priority. Monitor the execution of the cache priority policy to ensure that high-priority tasks can obtain the required cache resources first. Then, the device adjustment set of the image processing device includes the above conditions.
[0062] It should be noted that the device adjustment set includes cache management optimization, hardware resource optimization, and system monitoring of the image processing device. Combining the above optimization measures in various aspects, the device adjustment set can significantly improve the overall performance of the image processing device.
[0063] S150. Execute the device adjustment set to adjust and feedback the image device to obtain a target image device, and input the compressed image set under complex communication conditions into the target image device for image restoration.
[0064] In this embodiment, when the performance adaptation index of the image processing device is greater than or equal to the performance adaptation threshold, a successful adjustment visualization feedback is performed, that is, the image processing device visually pops up a dialog box saying "Next, perform the restoration operation of the compressed image set", so as to continue the image restoration of the compressed image set under complex communication conditions.
[0065] A method for restoring compressed images provided in Embodiment 1 of the present invention first evaluates the image quality factor of the compressed image set based on the image performance parameters of the compressed image set, and matches the image restoration data set of the compressed image set from the image database based on the image quality factor; secondly, under complex communication conditions, collect the first process parameters for the image processing device to execute the image restoration data set and the second process parameters for the image processing device to restore the demonstration image; then analyze the performance adaptation index of the image processing device based on the first process parameter and the second process parameter; after that, perform a difference process on the performance adaptation index and the performance adaptation threshold to obtain the performance adaptation index difference of the image processing device, and match the performance adaptation index difference with the device adjustment set corresponding to each performance adaptation index difference interval in the image database to obtain the device adjustment set of the image processing device; finally, execute the device adjustment set to perform adjustment feedback on the image device to obtain the target image device, and input the compressed image set under complex communication conditions into the target image device for image restoration. The above method can effectively match the image restoration data set of the compressed image set by analyzing the image performance parameters of the compressed image set, ensuring that the restoration process can be optimized for the specific characteristics of the compressed image, thereby improving the quality of the restored image. Then, by collecting the process parameters of the image processing device under complex communication conditions, the performance adaptation index of the image processing device can be analyzed, and further, the image processing device can be adjusted and fed back to improve the overall performance and image processing ability of the image processing device.
[0066] Embodiment 2
[0067] Figure 2 It is a schematic flowchart of a method for restoring compressed images provided in Embodiment 2 of the present invention. Embodiment 2 is optimized on the basis of the above embodiments. For the content not detailed in this embodiment, please refer to Embodiment 1.
[0068] As Figure 2 shown, a method for restoring compressed images provided in Embodiment 2 of the present invention includes the following steps:
[0069] S210. Extract the gray values of each pixel point to which each sampled compressed image belongs from the image performance parameters of the compressed image set, and calculate the gray variance of each sampled compressed image.
[0070] Among them, the gray values of each pixel point to which each sampled compressed image belongs are obtained by using an image processing library, such as the OpenCV or Pillow library, to read each sampled compressed image file (if the image is not a grayscale image, it is first converted to a grayscale image through the grayscale_img function), and the gray values of each pixel point are obtained through functions such as gray_image.
[0071] In this embodiment, the gray values of each pixel point to which each sampled compressed image belongs are extracted from the image performance parameters of the compressed image set, and the gray mean value of the pixel points to which each sampled compressed image belongs is obtained through mean processing. The gray value of each pixel point to which each sampled compressed image belongs is subjected to difference processing with the gray mean value of the pixel points to which the corresponding sampled compressed image belongs, and the results of the difference processing are squared and accumulated in sequence, and the accumulated result is divided by the total number of pixel points to which each sampled compressed image belongs, thereby obtaining the gray variance of each sampled compressed image.
[0072] S220. Extract the gray value probability change curve to which each sampled compressed image belongs from the image performance parameters of the compressed image set, and obtain the gray value probability change rate curve to which each sampled compressed image belongs after data processing of the gray value probability change curve.
[0073] Among them, for the gray value probability change rate curve to which each sampled compressed image belongs, the specific data processing process is: taking the derivative of the gray value probability change curve with respect to the abscissa (i.e., the gray value) to obtain the rate of change of the gray value probability, and plotting this derivative (i.e., the gray value probability change rate) as a curve, thereby obtaining the gray value probability change rate curve to which each sampled compressed image belongs.
[0074] In this embodiment, for the gray value probability change curve to which each sampled compressed image belongs, the frequency of each gray value appearing in the image can be obtained by statistically counting the gray values of each pixel in each sampled compressed image, dividing by the total number of pixels, thereby calculating the probability of each gray value, and then using functions such as plot in Python to draw the gray value probability change curve to which each sampled compressed image belongs.
[0075] S230. Obtain the gray value probability change rate of each sampling detection position point from the gray value probability change rate curve, and perform mean processing on the gray value probability change rate to obtain the average gray value probability change rate of each sampled compressed image.
[0076] In this embodiment, the gray value probability change rate of each sampling detection position point is located and obtained from the gray value probability change rate curve, the gray value probability change rate of each sampling detection position point is subjected to mean processing, and the result of the mean processing is marked as the average gray value probability change rate of each sampled compressed image.
[0077] Exemplarily, Figure 3 is a schematic diagram of the gray value probability change rate curve to which a sampled compressed image provided in Embodiment 2 of the present invention belongs, as Figure 3As shown, the abscissa represents the grayscale value probability, with the unit of percentage, and the ordinate represents the change rate of the grayscale value probability, with the unit of percentage, clearly showing the change of the grayscale value probability. By averaging the change rates of the grayscale value probabilities at each sampling detection position point 1 randomly arranged on the curve of the change rate of the grayscale value probability, the average change rate of the grayscale value probability of the sampled compressed image is obtained.
[0078] S240. Extract the sampling edge widths of each sampled compressed image from the image performance parameters of the compressed image set and perform averaging to obtain the average edge width of each sampled compressed image.
[0079] Among them, for the sampling edge widths of each sampled compressed image, each sampling edge of each sampled compressed image is extracted through an edge detection algorithm (such as Canny, etc.), and the extracted edge is refined to obtain an edge with a single-pixel width. On the refined edge, the gradient direction and normal direction of each edge point are calculated, points with a large change in gradient are searched along the normal direction, and the distance between these two points is measured as the edge width.
[0080] S250. Comprehensively analyze the grayscale variance, the average change rate of the grayscale value probability, the average edge width, and the preset reference average edge width in the image database to determine the image quality factor of the compressed image set.
[0081] In this embodiment, the image quality factor of the compressed image set is obtained through comprehensive analysis of the grayscale variance, the average change rate of the grayscale value probability, the average edge width, and the reference average edge width of each sampled compressed image, and is a numerical value used to determine the clarity of the compressed image set.
[0082] Specifically, the calculation formula for the image quality factor of the compressed image set is:
[0083] ;
[0084] where QVP is the image quality factor of the compressed image set, is the grayscale variance of the d-th sampled compressed image, is the average change rate of the grayscale value probability of the d-th sampled compressed image, is the average edge width of the d-th sampled compressed image, is the preset reference average edge width in the image database, is the influence factor corresponding to the preset grayscale variance unit value in the image database, is the influence factor corresponding to the preset average change rate unit value of the grayscale value probability in the image database, and s is the total number of sampled compressed images.
[0085] In this embodiment, is the gray variance of the d-th sampled and compressed image, which is a statistic used in digital image processing to describe the uniformity of the gray distribution of an image. It is defined as the ratio of the sum of the squares of the differences between the gray values of all pixels in the image and their average gray value to the total number of pixels;
[0086] is the average change rate of the gray value probability of the d-th sampled and compressed image, which refers to the average rate at which the gray value probability changes with the gray value in the image;
[0087] is the average edge width of the d-th sampled and compressed image, which refers to the average width of the edge region in the image. An edge is a place where the gray value changes significantly in the image, usually corresponding to features such as the contour and boundary of an object in the image;
[0088] is the preset reference average edge width in the image database, representing the reference value for analyzing the average edge width of the sampled and compressed image;
[0089] is the influence factor corresponding to the preset gray variance unit value in the image database, which represents the value of the influence degree of the gray variance unit value on the image quality factor of the compressed image set. When using it, the influence factor corresponding to the gray variance unit value can be directly obtained from the image database, and its corresponding relationship can be a preset mapping relationship. For example, the gray variance and the influence factor corresponding to the preset gray variance unit value in the image database form a mapping set, and the real-time gray variance is input into the mapping set to obtain the influence factor corresponding to the gray variance unit value. The mapping relationship therein can be a one-to-one or many-to-one relationship. In this example, its value range is [0, 1];
[0090] is the influence factor corresponding to the preset average change rate unit value of the gray value probability in the image database, which represents the value of the influence degree of the average change rate unit value of the gray value probability on the image quality factor of the compressed image set. When using it, the influence factor corresponding to the average change rate unit value of the gray value probability can be directly obtained from the image database, and its corresponding relationship can be a preset mapping relationship. For example, the average change rate of the gray value probability and the influence factor corresponding to the preset average change rate unit value of the gray value probability in the image database form a mapping set, and the real-time average change rate of the gray value probability is input into the mapping set to obtain the influence factor corresponding to the average change rate unit value of the gray value probability. The mapping relationship therein can be a one-to-one or many-to-one relationship. In this example, its value range is [0, 1].
[0091] d is the number of each sampled and compressed image, d = {1, 2, 3,..., s}, and s is the total number of sampled and compressed images.
[0092] S260. Match the image restoration dataset of the compressed image set from the image database based on the image quality factor.
[0093] S270. Under complex communication conditions, collect the first process parameters generated by the image processing device when executing the image restoration dataset and the second process parameters of the image processing device for restoring the demonstration image, and analyze the performance adaptation index of the image processing device based on the first process parameters and the second process parameters.
[0094] S280. Perform a difference process on the performance adaptation index and the performance adaptation threshold to obtain the performance adaptation index difference of the image processing device, and match the performance adaptation index difference with the device adjustment set corresponding to each performance adaptation index difference interval in the image database to obtain the device adjustment set of the image processing device.
[0095] S290. Execute the device adjustment set to perform adjustment feedback on the image device to obtain the target image device, and input the compressed image set under complex communication conditions into the target image device for image restoration.
[0096] A method for restoring a compressed image provided in Embodiment 2 of the present invention specifies the evaluation process of the image quality factor of the compressed image set. Using this method, the restoration quality of the compressed image can be improved.
[0097] Embodiment 3
[0098] Figure 4 It is a schematic flowchart of a method for restoring a compressed image provided in Embodiment 3 of the present invention. Embodiment 3 is optimized based on the above embodiments. For the content not detailed in this embodiment, please refer to Embodiment 1 and Embodiment 2.
[0099] As Figure 4 shown, a method for restoring a compressed image provided in Embodiment 3 of the present invention includes the following steps:
[0100] S310. Evaluate the image quality factor of the compressed image set based on the image performance parameters of the compressed image set, and match the image restoration dataset of the compressed image set from the image database based on the image quality factor.
[0101] S320. Under complex communication conditions, collect the first process parameters of the image processing device when executing the image restoration dataset and the second process parameters of the image processing device for restoring the demonstration image.
[0102] S330. Extract the remaining memory of the image processing device at the start time point of the execution monitoring cycle from the first process parameters. At the same time, accumulate the memory occupancy of the compressed image set and the memory occupancy of the image recovery data set to obtain the estimated memory occupancy. Perform a difference operation on the remaining memory and the estimated memory occupancy to obtain the free memory of the image processing device at the end time point of the execution detection cycle.
[0103] Among them, the execution monitoring cycle refers to the time period during which the image processing device monitors the process of the image recovery data set and the restored demonstration image. The specific duration is formulated by the device performance R & D team. The remaining memory of the image processing device at the start time point of the execution monitoring cycle is read from the memory information of the image processing device. The memory occupancy of the compressed image set and the memory occupancy of the image recovery data set can be extracted from the file attributes of the compressed image set and the image recovery data set.
[0104] S340. Extract the total used traffic of the image processing device during the execution monitoring cycle, the average network transmission rate of the image processing device during the execution monitoring cycle, and the CPU utilization rate of the image processing device during the execution monitoring cycle from the first process parameters.
[0105] Among them, the total used traffic of the image processing device during the execution monitoring cycle can be monitored by a traffic monitoring tool such as a network traffic analyzer. The CPU utilization rate of the image processing device during the execution monitoring cycle can be monitored by a system performance monitoring tool such as virtual memory statistics. The average network transmission rate of the image processing device during the execution monitoring cycle can be monitored by monitoring network devices such as routers.
[0106] S350. Extract the image recovery duration of the demonstration image to which the image processing device belongs during the execution monitoring cycle from the second process parameters. Calculate the absolute value of the difference between the image recovery duration and the image recovery reference duration, and the result obtained is the image recovery deviation duration of the image processing device during the execution monitoring cycle.
[0107] Among them, the image recovery duration of the demonstration image to which the image processing device belongs during the execution monitoring cycle can be read from the timestamp log to which the image processing device belongs. The image recovery reference duration can be extracted from the image database.
[0108] S360. Comprehensively analyze the free memory, the total used traffic, the average network transmission rate, the CPU utilization rate, and the image recovery deviation duration to determine the performance adaptation index of the image processing device.
[0109] Specifically, the calculation formula for the performance adaptation index of the image processing device is:
[0110] ;
[0111] Wherein, PFI represents the performance adaptation index of the image processing device, FMA represents the amount of free memory of the image processing device at the end time point of the execution monitoring cycle, TDU represents the total traffic used by the image processing device during the execution monitoring cycle, UZN represents the CPU utilization rate of the image processing device during the execution monitoring cycle, DRT represents the image recovery deviation duration of the image processing device during the execution monitoring cycle, ACV represents the average network transmission rate of the image processing device during the execution monitoring cycle, represents the preset reference average network transmission rate in the image database, represents the preset required minimum amount of free memory in the image database, represents the preset reference total traffic used in the image database, represents the preset reference CPU utilization rate in the image database, e represents the natural constant, represents the influence factor corresponding to the unit value of the deviation of the free memory amount in the image database, represents the influence factor corresponding to the unit value of the image recovery deviation duration in the image database.
[0112] In this embodiment, when the free memory amount of the image processing device is close to or lower than the required minimum free memory amount, this clearly indicates that the device after executing the image recovery data set is in a state of tight memory resources. In this tense situation, not only does the pressure on memory usage increase significantly, but also under complex network communication conditions, the average network transmission rate of the device may fluctuate significantly, deviating significantly from the reference network transmission rate. This fluctuation further triggers the phenomenon that the total traffic used deviates significantly from its reference value, and at the same time causes the CPU utilization rate to deviate significantly from the preset reference level. The changes in these series of performance indicators are intertwined and act together on the overall performance of the image processing device, ultimately resulting in a significant increase in the image recovery deviation duration, seriously affecting the speed and efficiency of the device to process the image recovery task. Especially under complex communication conditions, this impact is more significant, further highlighting the limited ability of the image processing device to execute the image recovery data set and subsequent image recovery tasks. Therefore, by comprehensively analyzing the above parameters, problems existing in the operation of the image processing device can be identified more accurately, and effective adjustment strategies can be formulated accordingly to optimize the device operation state and improve its ability to process the image recovery task;
[0113] Among them, FMA is the amount of free memory of the image processing device at the end time point of the execution monitoring cycle, which refers to the part of the memory of the image processing device that has not been used after completing the execution monitoring cycle;
[0114] TDU is the total traffic used by the image processing device during the execution of the monitoring cycle, which refers to the total amount of data transmitted through the network by the image processing device during the execution of the monitoring cycle;
[0115] UZN is the CPU utilization rate of the image processing device during the execution of the monitoring cycle, which refers to the proportion of the CPU of the image processing device occupied during the execution of the monitoring cycle;
[0116] DRT is the image recovery deviation duration of the image processing device during the execution of the monitoring cycle, which refers to the deviation value between the actual image recovery duration and the image recovery reference duration when the image processing device performs recovery processing on the presentation image during the execution of the monitoring cycle;
[0117] ACV is the average network transmission rate of the image processing device during the execution of the monitoring cycle, which refers to the average speed of data transmission through the network by the image processing device during the execution of the monitoring cycle;
[0118] is the preset reference average network transmission rate in the image database, which represents the reference value for analyzing the average network transmission rate of the image processing device during the execution of the monitoring cycle;
[0119] is the preset required minimum free memory amount in the image database, which represents the minimum value of the free memory amount of the image processing device at the end time point of the execution of the monitoring cycle;
[0120] is the preset reference total traffic used in the image database, which represents the reference value for analyzing the total traffic used by the image processing device during the execution of the monitoring cycle;
[0121] is the preset reference CPU utilization rate in the image database, which represents the reference value for analyzing the CPU utilization rate of the image processing device during the execution of the monitoring cycle;
[0122] e is the natural constant, is the influence factor corresponding to the unit value of the free memory amount deviation in the image database, which represents the numerical value of the influence degree of the unit value of the free memory amount deviation on the performance adaptation index of the image processing device. When using it, the influence factor corresponding to the unit value of the free memory amount deviation can be directly obtained from the image database, and its corresponding relationship can be a pre-set mapping relationship. For example, the free memory amount deviation and the influence factor corresponding to the unit value of the free memory amount deviation preset in the image database form a mapping set, and the real-time free memory amount deviation is input into the mapping set to obtain the influence factor corresponding to the unit value of the free memory amount deviation. The mapping relationship therein can be a one-to-one or many-to-one relationship. In this example, its value range is [0, 1];
[0123] It represents the influence factor corresponding to the preset image recovery deviation duration unit value in the image database, which is a numerical value indicating the degree of influence of the image recovery deviation duration unit value on the performance adaptation index of the image processing device. When in use, the influence factor corresponding to the image recovery deviation duration unit value can be directly obtained from the image database, and its corresponding relationship can be a pre-set mapping relationship. For example, the image recovery deviation duration and the influence factor of the preset image recovery deviation duration unit value in the image database on the performance adaptation index of the image processing device form a mapping set. Inputting the real-time image recovery deviation duration into the mapping set to obtain the influence factor corresponding to the image recovery deviation duration unit value, and the mapping relationship therein can be a one-to-one or many-to-one relationship. In this example, its value range is [0, 1].
[0124] Exemplarily, the change table of the performance adaptation index of the image processing device and its corresponding parameters is shown in Table 1.
[0125] Table 1 Change Table of the Performance Adaptation Index of the Image Processing Device and Its Corresponding Parameters
[0126]
[0127] Exemplarily, it is set that the required minimum free memory amount is 5.8 gigabytes, the reference total usage traffic is 185 megabytes, the reference CPU utilization rate is 60%, the reference average network transmission rate is 5 megabits per second. At the same time, the numerical value of the influence factor corresponding to the unit value of the free memory amount deviation is set to 0.78, and the numerical value of the influence factor corresponding to the unit value of the image recovery deviation duration is set to 0.82. It can be seen from Table 1 that under complex communication conditions, if the free memory amount is large, and the total usage traffic, CPU utilization rate, and network transmission average rate differ little from the corresponding reference values, such as the last row of data in Table 1, the adaptation degree of the image processing device to the image recovery dataset is relatively high, the performance adaptation index is correspondingly large, which is 200%, thus conversely resulting in a significant shortening of the deviation duration during the image recovery process.
[0128] S370. Perform a difference process on the performance adaptation index and the performance adaptation threshold to obtain the performance adaptation index difference of the image processing device, and match the performance adaptation index difference with the device adjustment set corresponding to each performance adaptation index difference interval in the image database to obtain the device adjustment set of the image processing device.
[0129] S380. Execute the device adjustment set to perform adjustment feedback on the image device to obtain the target image device, and input the compressed image set under complex communication conditions into the target image device for image recovery.
[0130] A method for restoring compressed images provided in the third embodiment of the present invention can further adjust and feedback the image processing device by analyzing the execution process parameters of the image processing device, timely detect the performance bottleneck of the image processing device and make adjustments, such as releasing the cache, etc., thereby significantly improving the speed and efficiency of the image processing device for processing and restoring images, and enhancing the stability and reliability of the image processing device at the same time.
[0131] Embodiment Four
[0132] Figure 5 FIG. is a schematic flowchart of a method for restoring compressed images provided in the fourth embodiment of the present invention. The fourth embodiment is optimized based on the above embodiments. For the content not detailed in this embodiment, please refer to Embodiments One to Three.
[0133] As Figure 5 shown, a method for restoring compressed images provided in the fourth embodiment of the present invention includes the following steps:
[0134] S410. Evaluate the image quality factor of the compressed image set based on the image performance parameters of the compressed image set, and match the image restoration data set of the compressed image set from the image database based on the image quality factor.
[0135] S420. Under complex communication conditions, collect the first process parameters of the image processing device for executing the image restoration data set and the second process parameters of the image processing device for restoring the demonstration image.
[0136] S430. Analyze the performance adaptation index of the image processing device based on the first process parameter and the second process parameter.
[0137] S440. Perform a difference process on the performance adaptation index and the performance adaptation threshold to obtain the performance adaptation index difference of the image processing device, and match the performance adaptation index difference with the device adjustment set corresponding to each performance adaptation index difference interval in the image database to obtain the device adjustment set of the image processing device.
[0138] S450. Execute the device adjustment set to adjust and feedback the image device to obtain the target image device, and input the compressed image set under complex communication conditions into the target image device for image restoration.
[0139] S460. Integrate and mark the compressed images that have completed image restoration in the compressed image set as the optimized image set.
[0140] S470. Determine the image restoration quality coefficient of the optimized image set according to the optimized performance parameters corresponding to the optimized image set.
[0141] Among them, the optimized performance parameters of the image set may include parameters such as each gray level, the occurrence probability corresponding to each gray level, the average brightness value of the highest brightness area, and the average brightness value of the lowest brightness area, etc., and no specific restrictions are made here.
[0142] In this embodiment, by collecting and analyzing the optimized performance parameters of the optimized image set, the image restoration quality of the optimized image set is quantified, so that the links where the performance can be further improved during the image restoration process can be clearly understood, thereby providing strong data support for subsequent image processing and restoration.
[0143] Specifically, determining the image restoration quality coefficient of the optimized image set according to the optimized performance parameters corresponding to the optimized image set includes:
[0144] Extract the gray levels to which each sampled optimized image belongs and the occurrence probabilities corresponding to the gray levels from the optimized performance parameters corresponding to the optimized image set, and obtain the information entropy of each sampled optimized image through data processing of the gray levels to which each sampled optimized image belongs and the occurrence probabilities corresponding to the gray levels;
[0145] Extract the first average brightness value of the highest brightness area and the second average brightness value of the lowest brightness area to which each sampled optimized image belongs from the optimized performance parameters corresponding to the optimized image set, and use the difference between the first average brightness value and the second average brightness value as the contrast of each sampled optimized image;
[0146] After comprehensively analyzing the information entropy of each sampled optimized image, the contrast of each sampled optimized image, the image restoration deviation duration of each sampled optimized image, and the image quality factor of the optimized image set, the image restoration quality coefficient of the optimized image set is determined.
[0147] In this embodiment, each sampled optimized image refers to each sampled optimized image obtained by extracting image samples from the optimized image set; the gray levels to which each sampled optimized image belongs and the occurrence probabilities corresponding to the gray levels can be obtained through the following methods:
[0148] # Read the image
[0149] image_path='path_to_your_image.jpg' # Replace with the actual image path
[0150] image = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) # Read as a grayscale image
[0151] # Count the gray level distribution
[0152] Histogra, bins = np.histogram(image.flatten(), bins=np.arange(257)) # Use numpy to count the gray level distribution
[0153] # Calculate the occurrence probability
[0154]
[0155] probability = histogram / total_pixels
[0156] Exemplarily, the information entropy is calculated by the following formula, and the specific expression is:
[0157] ;
[0158] where p(j) is the occurrence probability of the gray level j of the g-th sampled and optimized image, j is the number of the gray level, j = {1, 2, 3,..., z}, and z is the total number of gray levels.
[0159] In this embodiment, taking a sampled image as an example, the specific process of obtaining the contrast of a certain sampled and optimized image is as follows: divide the sampled and optimized image into sampled and optimized sub-images with equal areas, obtain the brightness values of each pixel point in each sampled and optimized sub-image through functions such as gray_image, and perform mean processing to obtain the average brightness value of each sampled and optimized sub-image. Arrange the average brightness values in descending order, mark the sampled and optimized sub-image corresponding to the first place as the highest brightness area, and mark the sampled and optimized sub-image corresponding to the last place as the lowest brightness area.
[0160] In this embodiment, the optimized image set is a part of the compressed image set that has been restored. Therefore, the image quality factor evaluation method of the compressed image set can be used to re-evaluate the image quality factor of the optimized image set; the acquisition method of the image restoration deviation duration of each sampled and optimized image is the same as that of the image restoration deviation duration of the image processing device during the execution of the monitoring period.
[0161] Furthermore, the calculation formula of the image restoration quality coefficient of the optimized image set is:
[0162] ;
[0163] where IRQF is the image restoration quality coefficient of the optimized image set, is the information entropy of the g-th sampled and optimized image, is the contrast of the g-th sampled and optimized image, is the image quality factor of the optimized image set, is the image restoration deviation duration for the g-th sampled optimized image, is the influence factor corresponding to the preset information entropy unit value in the image database, is the influence factor corresponding to the preset contrast unit value in the image database, B is the weight factor corresponding to the preset image quality factor in the image database, is the influence factor corresponding to the preset image restoration deviation duration unit value in the image database, g is the number of each sampled optimized image, g = {1, 2, 3,..., r}, and r is the total number of sampled optimized images.
[0164] In this embodiment, IRQF is the image restoration quality coefficient of the optimized image set. When the image quality factor of the optimized image set is small, it indicates that the restored compressed image still maintains a high degree of blurriness. Specifically, this situation is not only accompanied by a decrease in the information entropy of the optimized image, but also accompanied by a significant reduction in contrast. As a key indicator for measuring the information content of an image, the decrease in information entropy means that the amount of information in the image is decreasing, which is directly manifested as the blurring of image details and features. The reduction in contrast further exacerbates this blurring degree, making the light and dark differences in the image become blurred and difficult to distinguish. It should be noted that there is a close connection between information entropy and contrast. Images with high contrast often have more light and dark changes, thus containing more information, that is, having a higher information entropy. Conversely, blurred images have less obvious light and dark differences, less information, and the information entropy also decreases accordingly. In addition, a small image quality factor of the optimized image set may also have an adverse impact on the image restoration process. During the image restoration process, if the performance of the image restoration data set is poor, more time and computing resources are required to try to restore the details and features of the image. This additional computational burden often leads to an increase in the image restoration deviation duration. Therefore, the comprehensive analysis of the above parameters can deeply analyze the image restoration quality of the optimized image set from multiple dimensions, reduce the deviation of single-dimensional analysis, and thus can guide the adoption of effective measures to improve the effect of image restoration.
[0165] S480. Perform feedback adjustment on the image compression and restoration under complex communication conditions to make the image restoration quality coefficient greater than or equal to the image restoration quality threshold.
[0166] Specifically, the process of performing feedback adjustment on the image compression and restoration under complex communication conditions includes:
[0167] Compare the image restoration quality coefficient of the optimized image set with the image restoration quality threshold;
[0168] If the image restoration quality coefficient is less than the image restoration quality threshold, calculate the ratio of the image restoration quality coefficient to the image restoration quality threshold to obtain the image restoration quality coefficient ratio of the optimized image set.
[0169] Match the image restoration quality coefficient ratio with the image compression and restoration adjustment sets corresponding to each image restoration quality coefficient ratio interval in the image database to obtain the image compression and restoration adjustment set of the optimized image set;
[0170] Input the image compression and restoration adjustment set into an image processing device for execution, restore the optimized image set again, and continuously monitor the image compression and restoration under complex communication conditions to complete the feedback adjustment of the image compression and restoration under complex communication conditions.
[0171] Among them, the image restoration quality threshold represents the minimum value of the reasonable range of the image restoration quality coefficient of the optimized image set, which can be extracted from the image database; if the image restoration quality coefficient of the optimized image set is greater than or equal to the image restoration quality threshold, it indicates that during the restoration process of the image restoration data set for this optimized image set, the restoration quality of the image meets the established image restoration quality threshold requirements. Therefore, the compressed image can continue to be restored and monitored; if the image restoration quality coefficient of the optimized image set is less than the image restoration quality threshold, it indicates that during the restoration process of the image restoration data set for this optimized image set, due to certain special communication factors or other related reasons, the restoration quality of the image fails to reach the established image restoration quality threshold requirements. Therefore, feedback on the image compression and restoration under complex communication conditions is required.
[0172] Exemplarily, assume that the image restoration quality coefficient ratio of the optimized image set is G. In the image restoration quality coefficient ratio interval [G - 10%, D + 10%] stored in the image database, the image compression and restoration adjustment set corresponding to the image restoration quality coefficient ratio interval [G - 10%, D + 10%] includes: implementing image restoration through the inverse inverse filtering algorithm and the constrained least squares filtering algorithm, and comprehensively implementing restored image enhancement through the gray-level transformation principle, histogram processing principle, and spatial domain filtering principle. Specifically, filter the image through the inverse inverse filtering algorithm to try to eliminate degradation effects such as blur and motion artifacts, and initially restore the clarity and details of the image. Then, add additional constraints, such as the smoothness and edge preservation of the image, and solve the least squares problem under the constraints through the constrained least squares filtering algorithm, which can remove blur and noise, and better preserve the sharpness and texture features of the image. Finally, in the later stage of image restoration, adjust the gray-level distribution of the image through the gray-level transformation principle to improve its contrast and brightness, re-distribute the gray levels through the histogram processing principle to enhance the contrast of the image or achieve specific gray-level distribution characteristics, and further improve the texture and details of the image through the spatial domain filtering principle; the image compression and restoration adjustment set of the optimized image set includes: implementing image restoration through the inverse inverse filtering algorithm and the constrained least squares filtering algorithm, and comprehensively implementing restored image enhancement through the gray-level transformation principle, histogram processing principle, and spatial domain filtering principle.
[0173] In an exemplary embodiment, after the image processing device performs an optimized image set's image compression recovery adjustment set and re-analyzes the performance adaptation index of the image processing device until the performance adaptation index of the image processing device is greater than or equal to the performance adaptation threshold, the optimized image set is re-restored, and the recovery and monitoring of the uncompleted compressed images are continued, whereby continuous monitoring of the recovery process can be performed.
[0174] It should be noted that the image recovery data set is formulated based on the common characteristics of a large number of images. It aims to provide a generally applicable image recovery solution. Relatively speaking, the image compression recovery adjustment set is customized for the defects existing in a specific image set. Its purpose is to optimize the image recovery effect through targeted adjustments. Therefore, after the image compression recovery adjustment set is executed and the image processing device re-restores the optimized image set, the image recovery quality coefficient of the optimized image set can be greater than or equal to the image recovery quality threshold.
[0175] A method for recovering compressed images provided in Embodiment 4 of the present invention determines the image recovery quality coefficient of the optimized image set by collecting the performance parameters of the optimized image set, thereby providing feedback on the image compression recovery under complex communication conditions, and thus improving the adaptability and reliability of the image compression recovery technology; by collecting and analyzing the optimized performance parameters of the optimized image set, the quality of the image recovery of the optimized image set is quantified, so that the links where the performance can be further improved during the image recovery process can be clearly understood, thereby providing strong data support for subsequent image processing and recovery.
[0176] Embodiment 5
[0177] Figure 6 FIG. 4 is a schematic structural diagram of a device for recovering compressed images provided in Embodiment 5 of the present invention. The device is applicable to the situation of recovering compressed images under complex communication conditions, and the device can be implemented by software and / or hardware and is generally integrated on an electronic device.
[0178] As Figure 6 shown, the device includes: a first matching module 110, a collection module 120, an analysis module 130, a second matching module 140, and a feedback module 150.
[0179] The first matching module 110 is configured to evaluate the image quality factor of the compressed image set based on the image performance parameters of the compressed image set, and match the image recovery data set of the compressed image set from the image database based on the image quality factor;
[0180] A collection module 120, configured to collect first process parameters of an image processing device for executing the image restoration data set and second process parameters of the image processing device for restoring a demonstration image under complex communication conditions;
[0181] An analysis module 130, configured to analyze a performance adaptation index of the image processing device based on the first process parameters and the second process parameters;
[0182] A second matching module 140, configured to perform a difference process on the performance adaptation index and a performance adaptation threshold to obtain a performance adaptation index difference of the image processing device, and match the performance adaptation index difference with device adjustment sets corresponding to respective performance adaptation index difference intervals in an image database to obtain a device adjustment set of the image processing device;
[0183] A feedback module 150, configured to perform adjustment feedback on the image device by executing the device adjustment set to obtain a target image device, and input a compressed image set under complex communication conditions into the target image device for image restoration.
[0184] In this embodiment, the apparatus first evaluates an image quality factor of the compressed image set by a first matching module 110 based on image performance parameters of the compressed image set, and matches an image restoration data set of the compressed image set from an image database based on the image quality factor; secondly, under complex communication conditions, a collection module 120 collects first process parameters of the image processing device for executing the image restoration data set and second process parameters of the image processing device for restoring a demonstration image; then, an analysis module 130 analyzes a performance adaptation index of the image processing device based on the first process parameters and the second process parameters; thereafter, a second matching module 140 performs a difference process on the performance adaptation index and a performance adaptation threshold to obtain a performance adaptation index difference of the image processing device, and matches the performance adaptation index difference with device adjustment sets corresponding to respective performance adaptation index difference intervals in the image database to obtain a device adjustment set of the image processing device; finally, a feedback module 150 performs adjustment feedback on the image device by executing the device adjustment set to obtain a target image device, and inputs a compressed image set under complex communication conditions into the target image device for image restoration.
[0185] This embodiment provides a compressed image restoration apparatus, which can effectively improve the restoration quality of compressed images.
[0186] Further, the first matching module 110 includes an evaluation unit, and the evaluation unit is configured to:
[0187] Extract gray values of respective pixel points to which respective sampled compressed images belong from the image performance parameters of the compressed image set, and calculate a gray variance of the respective sampled compressed images;
[0188] Extract the gray value probability change curves to which the sampled compressed images belong from the image performance parameters of the compressed image set, and obtain the gray value probability change rate curves to which the sampled compressed images belong after processing the gray value probability change curves;
[0189] Obtain the gray value probability change rates of the respective sampling detection position points from the gray value probability change rate curve, and perform mean processing on the gray value probability change rates to obtain the average gray value probability change rates of the sampled compressed images;
[0190] Extract the respective sampling edge widths to which the sampled compressed images belong from the image performance parameters of the compressed image set and perform mean processing to obtain the average edge widths of the sampled compressed images;
[0191] Comprehensively analyze the gray variance, the average gray value probability change rate, the average edge width, and the preset reference average edge width in the image database to determine the image quality factor of the compressed image set.
[0192] Based on the above technical solution, the calculation formula for the image quality factor of the compressed image set is:
[0193] ;
[0194] where QVP is the image quality factor of the compressed image set, is the gray variance of the d-th sampled compressed image, is the average gray value probability change rate of the d-th sampled compressed image, is the average edge width of the d-th sampled compressed image, is the preset reference average edge width in the image database, is the influence factor corresponding to the preset unit value of the gray variance in the image database, is the influence factor corresponding to the preset unit value of the average gray value probability change rate in the image database, and s is the total number of sampled compressed images.
[0195] Further, the analysis module 130 is specifically configured to: extract the remaining memory of the image processing device at the start time point of the execution monitoring period from the first process parameter, and at the same time accumulate the memory occupancy of the compressed image set and the memory occupancy of the image restoration data set to obtain the estimated memory occupancy; perform a difference process on the remaining memory and the estimated memory occupancy to obtain the free memory of the image processing device at the end time point of the execution detection period; extract the total usage traffic of the image processing device during the execution monitoring period, the average network transmission rate of the image processing device during the execution monitoring period, and the CPU utilization rate of the image processing device during the execution monitoring period from the first process parameter; extract the image restoration duration of the demonstration image to which the image processing device belongs during the execution monitoring period from the second process parameter, and calculate the absolute value of the difference between the image restoration duration and the image restoration reference duration, and the result obtained is the image restoration deviation duration of the image processing device during the execution monitoring period; perform a comprehensive analysis on the free memory, the total usage traffic, the average network transmission rate, the CPU utilization rate, and the image restoration deviation duration to determine the performance adaptation index of the image processing device.
[0196] Based on the above technical solution, the calculation formula for the performance adaptation index of the image processing device is:
[0197] ;
[0198] where PFI represents the performance adaptation index of the image processing device, FMA represents the free memory of the image processing device at the end time point of the execution monitoring period, TDU represents the total usage traffic of the image processing device during the execution monitoring period, UZN represents the CPU utilization rate of the image processing device during the execution monitoring period, DRT represents the image restoration deviation duration of the image processing device during the execution monitoring period, ACV represents the average network transmission rate of the image processing device during the execution monitoring period, represents the preset reference average network transmission rate in the image database, represents the preset required minimum free memory in the image database, represents the preset reference total usage traffic in the image database, represents the preset reference CPU utilization rate in the image database, e represents the natural constant, represents the influence factor corresponding to the unit value of the free memory deviation in the image database, represents the influence factor corresponding to the unit value of the image restoration deviation duration in the image database.
[0199] Further, the device further includes a feedback module, including:
[0200] An integration unit for integrating and marking the compressed images that have completed image restoration in the set of compressed images as an optimized image set;
[0201] A determination unit for determining the image restoration quality coefficient of the optimized image set according to the optimized performance parameters corresponding to the optimized image set;
[0202] A feedback unit for performing feedback adjustment on image compression and restoration under complex communication conditions so that the image restoration quality coefficient is greater than or equal to the image restoration quality threshold.
[0203] Based on the above technical solution, the determination unit is specifically configured to: extract the gray levels to which each sampled optimized image belongs and the occurrence probabilities corresponding to the gray levels from the optimized performance parameters corresponding to the optimized image set, and obtain the information entropy of each sampled optimized image through data processing of the gray levels to which each sampled optimized image belongs and the occurrence probabilities corresponding to the gray levels; extract the first average brightness value of the highest brightness region and the second average brightness value of the lowest brightness region to which each sampled optimized image belongs from the optimized performance parameters corresponding to the optimized image set, and use the difference between the first average brightness value and the second average brightness value as the contrast of each sampled optimized image; determine the image restoration quality coefficient of the optimized image set after comprehensively analyzing the information entropy of each sampled optimized image, the contrast of each sampled optimized image, the image restoration deviation duration of each sampled optimized image, and the image quality factor of the optimized image set.
[0204] Among them, the calculation formula for the image restoration quality coefficient of the optimized image set is:
[0205] ;
[0206] Among them, IRQF is the image restoration quality coefficient of the optimized image set, is the information entropy of the gth sampled optimized image, is the contrast of the gth sampled optimized image, is the image quality factor of the optimized image set, is the image restoration deviation duration of the gth sampled optimized image, is the influence factor corresponding to the preset information entropy unit value in the image database, is the influence factor corresponding to the preset contrast unit value in the image database, B is the weight factor corresponding to the preset image quality factor in the image database, is the influence factor corresponding to the preset image restoration deviation duration unit value in the image database, g is the number of each sampled optimized image, g = {1, 2, 3,..., r}, and r is the total number of sampled optimized images.
[0207] Further, the feedback unit is specifically configured to: compare the image restoration quality coefficient of the optimized image set with the image restoration quality threshold; if the image restoration quality coefficient is less than the image restoration quality threshold, calculate the ratio of the image restoration quality coefficient to the image restoration quality threshold to obtain the image restoration quality coefficient ratio of the optimized image set; match the image restoration quality coefficient ratio with the image compression restoration adjustment set corresponding to each image restoration quality coefficient ratio interval in the image database to obtain the image compression restoration adjustment set of the optimized image set; input the image compression restoration adjustment set into the image processing device for execution, restore the optimized image set again, and continuously monitor the image compression restoration under complex communication conditions, so as to complete the feedback adjustment of the image compression restoration under complex communication conditions.
[0208] The above compression image restoration device can execute the compression image restoration method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0209] Embodiment Six
[0210] Figure 7 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement an embodiment of the present invention. 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 (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described herein and / or claimed.
[0211] As Figure 7 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0212] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0213] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the method for restoring a compressed image.
[0214] In some embodiments, the method for restoring a compressed image can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps in the method for restoring a compressed image described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the method for restoring a compressed image by any other suitable means (e.g., by means of firmware).
[0215] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-a-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments 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 dedicated or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0216] In some embodiments, the method for restoring a compressed image can be implemented as a computer program, which is invisibly included in a computer program product. When the computer program is executed by a processor, the method for restoring the compressed image of the present invention is implemented. A computer program product can be understood as a software product that mainly implements its solution through a computer program. The computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs can be executed entirely on the machine, partially on the machine, executed as an independent software package partially on the machine and partially on a remote machine, or executed entirely on a remote machine or server.
[0217] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, 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.
[0218] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 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 a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds 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 the input received from the user can be in any form (including acoustic input, voice input, or tactile input).
[0219] The systems and techniques described herein can be implemented in a computing system that includes backend 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 frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0220] A computing system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0221] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0222] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for restoring a compressed image, characterized in that: The method comprises: evaluating an image quality factor of the compressed image set based on an image performance parameter of the compressed image set, and matching an image restoration data set of the compressed image set from an image database based on the image quality factor; Under complex communication conditions, collecting first process parameters of the image processing device executing the image restoration data set and second process parameters of the image processing device restoring the demonstration image; Analyzing a performance adaptation index of the image processing device based on the first process parameter and the second process parameter; Performing difference processing on the performance adaptation index and the performance adaptation threshold to obtain a performance adaptation index difference of the image processing device, and matching the performance adaptation index difference with a device adjustment set corresponding to each performance adaptation index difference interval in the image database to obtain a device adjustment set of the image processing device; Execute the device adjustment set to adjust the image device and provide feedback to obtain a target image device, and input the compressed image set under complex communication conditions into the target image device for image restoration; Among them, the first process parameters include the remaining memory of the image processing device at the start time of the execution monitoring cycle, the memory occupancy of the compressed image set and the memory occupancy of the image recovery data set, the total traffic used during the execution monitoring cycle, the average network transmission rate of the image processing device during the execution monitoring cycle, and the CPU utilization of the image processing device during the execution monitoring cycle; the second process parameters include the image recovery time of the demonstration image belonging to the image processing device during the execution monitoring cycle.
2. The method according to claim 1, characterized in that Evaluating an image quality factor of a compressed image set based on an image performance parameter of the compressed image set includes: Extracting the grayscale value of each pixel of each sampled compressed image from the image performance parameters of the compressed image set, and calculating the grayscale variance of each sampled compressed image; Extracting the grayscale value probability change curve of each sampled compressed image from the image performance parameters of the compressed image set, and obtaining the grayscale value probability change rate curve of each sampled compressed image after data processing of the grayscale value probability change curve; Obtaining the grayscale value probability change rate of each sampling detection position point from the grayscale value probability change rate curve, and performing mean processing on the grayscale value probability change rate to obtain the grayscale value probability average change rate of each sampled compressed image; Extract the width of each sampled edge of each sampled compressed image from the image performance parameters of the compressed image set and perform mean processing to obtain the average edge width of each sampled compressed image; The grayscale variance, the grayscale value probability average change rate, the edge average width and the reference edge average width preset in the image database are comprehensively analyzed to determine the image quality factor of the compressed image set.
3. The method according to claim 2, characterized in that The calculation formula of the image quality factor of the compressed image set is: ; Where QVP is the image quality factor of the compressed image set, is the grayscale variance of the dth sampled compressed image, is the average probability change rate of the gray value of the dth sampled compressed image, is the average edge width of the d-th sampled compressed image, is the average width of the reference edge preset in the image database, is the influence factor corresponding to the grayscale variance unit value preset in the image database, is the influence factor corresponding to the unit value of the average gray value probability change rate preset in the image database, and s is the total number of sampled compressed images.
4. The method according to claim 1, characterized in that: The analyzing the performance adaptation index of the image processing device based on the first process parameter and the second process parameter includes: Extracting the remaining memory amount of the image processing device at the start time of the monitoring cycle from the first process parameter, and accumulating the memory occupancy of the compressed image set and the memory occupancy of the image recovery data set to obtain the estimated memory occupancy; performing difference processing between the remaining memory amount and the estimated memory occupancy to obtain the free memory amount of the image processing device at the end time of the detection cycle; Extracting the total flow rate used by the image processing device during the execution monitoring period, the average network transmission rate of the image processing device during the execution monitoring period, and the CPU utilization rate of the image processing device during the execution monitoring period from the first process parameters; Extracting the image recovery time of the demonstration image of the image processing device within the execution monitoring cycle from the second process parameter, and calculating the absolute value of the difference between the image recovery time and the image recovery reference time as the image recovery deviation time of the image processing device within the execution monitoring cycle; A comprehensive analysis is performed on the free memory amount, the total traffic used, the average network transmission rate, the CPU utilization rate, and the image recovery deviation time to determine a performance adaptation index of the image processing device.
5. The method according to claim 4, characterized in that The calculation formula of the performance adaptation index of the image processing device is: ; Among them, PFI represents the performance adaptation index of the image processing device, FMA represents the amount of free memory of the image processing device at the end of the execution monitoring cycle, TDU represents the total traffic used by the image processing device during the execution monitoring cycle, UZN represents the CPU utilization of the image processing device during the execution monitoring cycle, DRT represents the image recovery deviation duration of the image processing device during the execution monitoring cycle, and ACV represents the average network transmission rate of the image processing device during the execution monitoring cycle. represents the average transmission rate of the reference network preset in the image database, Indicates the preset minimum amount of free memory required in the image database. Indicates the total reference usage flow preset in the image database. represents the reference CPU utilization preset in the image database, e represents a natural constant, Indicates the impact factor corresponding to the unit value of the preset free memory deviation value in the image database, Indicates the impact factor corresponding to the unit value of the image restoration deviation time preset in the image database.
6. The method according to claim 1, characterized in that The method further comprises: Integrate and mark the compressed images in the compressed image set that have completed image restoration as an optimized image set; Determining an image restoration quality coefficient of the optimized image set according to an optimization performance parameter corresponding to the optimized image set; Feedback adjustment is performed on the image compression recovery under complex communication conditions so that the image recovery quality coefficient is greater than or equal to the image recovery quality threshold.
7. The method according to claim 6, characterized in that The step of determining the image restoration quality coefficient of the optimized image set according to the optimization performance parameter corresponding to the optimized image set includes: Extracting each gray level of each sampled optimized image and the corresponding occurrence probability of each gray level from the optimization performance parameters corresponding to the optimized image set, and obtaining the information entropy of each sampled optimized image by processing each gray level of each sampled optimized image and the corresponding occurrence probability of each gray level; Extracting a first average brightness value of a highest brightness region and a second average brightness value of a lowest brightness region of each sampled image from the optimization performance parameters corresponding to the optimization image set, and taking a difference between the first average brightness value and the second average brightness value as a contrast of each sampled optimized image; The image restoration quality coefficient of the optimized image set is determined after comprehensive analysis of the information entropy of each sampled optimized image, the contrast of each sampled optimized image, the image restoration deviation duration of each sampled optimized image and the image quality factor of the optimized image set.
8. The method according to claim 7, characterized in that The calculation formula of the image restoration quality coefficient of the optimized image set is: ; Among them, IRQF is the image restoration quality factor of the optimized image set, Optimize the information entropy of the image for the g-th sample, Optimize the contrast of the image for the gth sample, To optimize the image quality factor of a set of images, The image recovery deviation duration for the g-th sampled optimized image, is the impact factor corresponding to the information entropy unit value preset in the image database, is the impact factor corresponding to the contrast unit value preset in the image database, B is the weight factor corresponding to the image quality factor preset in the image database, is the impact factor corresponding to the unit value of the image restoration deviation time preset in the image database, g is the number of each sampled optimized image, g={1,2,3,...,r}, and r is the total number of sampled optimized images.
9. The method according to any one of claims 6 to 8, characterized in that: The process of feedback adjustment for image compression recovery under complex communication conditions includes: comparing the image restoration quality coefficient of the optimized image set with the image restoration quality threshold; If the image restoration quality coefficient is less than the image restoration quality threshold, then calculating the ratio of the image restoration quality coefficient to the image restoration quality threshold to obtain the image restoration quality coefficient ratio of the optimized image set; Matching the image restoration quality coefficient ratio with the image compression restoration adjustment set corresponding to each image restoration quality coefficient ratio interval in the image database to obtain an image compression restoration adjustment set for an optimized image set; The image compression recovery adjustment set is input into the image processing device for execution, the optimized image set is restored and the image compression recovery under complex communication conditions is continuously monitored to complete feedback adjustment of the image compression recovery under complex communication conditions.
10. A compressed image recovery device, characterized in that: The device comprises: A first matching module, configured to evaluate an image quality factor of the compressed image set based on an image performance parameter of the compressed image set, and match an image restoration data set of the compressed image set from an image database based on the image quality factor; A collecting module, used for collecting, under complex communication conditions, a first process parameter of the image processing device executing the image restoration data set and a second process parameter of the image processing device restoring the demonstration image; An analysis module, configured to analyze a performance adaptation index of an image processing device based on the first process parameter and the second process parameter; A second matching module is used to perform difference processing on the performance adaptation index and the performance adaptation threshold to obtain a performance adaptation index difference of the image processing device, and match the performance adaptation index difference with a device adjustment set corresponding to each performance adaptation index difference interval in the image database to obtain a device adjustment set of the image processing device; A feedback module, used for executing the device adjustment set to adjust the image device to obtain a target image device, and inputting the compressed image set under complex communication conditions into the target image device for image restoration; Among them, the first process parameters include the remaining memory of the image processing device at the start time of the execution monitoring cycle, the memory occupancy of the compressed image set and the memory occupancy of the image recovery data set, the total traffic used during the execution monitoring cycle, the average network transmission rate of the image processing device during the execution monitoring cycle, and the CPU utilization of the image processing device during the execution monitoring cycle; the second process parameters include the image recovery time of the demonstration image belonging to the image processing device during the execution monitoring cycle.
Citation Information
Patent Citations
Image restoration method, device and equipment
CN113222855A
Image restoration method and apparatus
US20220138924A1
Cited By
High-compression-ratio sequence image quality improvement method, system and device and medium
CN122372752A