A method, system and medium for lossless magnification of pictures based on system memory processing

Through the lossless amplification method of image processing in the system memory, the pixel loss problem during low-pixel image amplification is solved, efficient lossless amplification is achieved, and user experience is improved.

CN114610918BActive Publication Date: 2025-08-01INSPUR FINANCIAL INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210055492.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-18
Publication Date
2025-08-01
Estimated Expiration
2042-01-18

AI Technical Summary

Technical Problem

When the prior art enlarges low-pixel compressed images transmitted on old photos and social software, it is easy to lead to pixel losses and affect the user's information experience.

Method used

The lossless amplification method of picture based on system memory processing is adopted. By configuring image analysis algorithm, lossless amplification algorithm, pixel value index table and magnification index table, combined with multi-threaded processing and data loading optimization, the lossless amplification of pictures is achieved.

Benefits of technology

Without losing pixel point information, the image amplification efficiency and effect are improved, the user's information experience is improved, and the market value is efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610918B_ABST
    Figure CN114610918B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system and medium for lossless magnification of pictures based on system memory processing. The method includes the following steps: configuring a picture analysis algorithm, a lossless magnification algorithm, a pixel value index table and a magnification factor index table; setting a picture quantity threshold and a data loading form; obtaining a target resolution and a target size, and calling the picture analysis algorithm based on the pixel value index table, the magnification factor index table, the picture quantity threshold, the target resolution and the target size to obtain picture magnification parameters; performing a lossless magnification operation based on the lossless magnification algorithm, the data loading form and the picture magnification parameters to obtain a lossless magnified picture. The present invention can magnify old photos and low-pixel compressed pictures transmitted on social software without losing pixel point information, and will not affect the duration of the lossless magnification operation due to the too large picture format, and the efficiency of picture processing is extremely high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of picture optimization processing, and in particular to a method, system and medium for lossless magnification of pictures based on system memory processing. Background Art

[0002] At present, in order to have a better information experience, users have higher and higher requirements for the clarity of pictures. For some old photos or low-pixel compressed pictures transmitted on social software, their clarity is relatively low. Generally, when magnifying this type of picture, due to the color and format of the picture itself, there will be some pixel losses more or less. Therefore, starting from this point, it is necessary to develop a picture processing method that can efficiently perform pixel-lossless magnification on old photos and low-pixel compressed pictures transmitted on social software, thereby improving the user's information experience. Summary of the Invention

[0003] The main object of the present invention is to develop a picture processing method that can efficiently perform pixel-lossless magnification on old photos and low-pixel compressed pictures transmitted on social software, thereby improving the user's information experience.

[0004] To achieve the above object, a technical solution adopted by the present invention is: to provide a method for lossless magnification of pictures based on system memory processing, including the following steps:

[0005] Initial configuration step:

[0006] Configure a picture analysis algorithm, a lossless magnification algorithm, a pixel value index table, and a magnification factor index table; set a picture quantity threshold and a data loading form;

[0007] Image analysis step:

[0008] Obtain a target resolution and a target size; based on the pixel value index table, the magnification factor index table, the picture quantity threshold, the target resolution, and the target size, call the picture analysis algorithm to obtain picture magnification parameters;

[0009] Lossless magnification step:

[0010] Perform a lossless magnification operation based on the lossless magnification algorithm, the data loading form, and the picture magnification parameters to obtain a lossless magnified picture.

[0011] As an improved solution, the pixel value index table is configured with: a plurality of pixel values and a plurality of target parameters matching the plurality of pixel values; the target parameters include resolution and picture size;

[0012] The magnification index table is configured with: a number of magnifications and a number of picture synchronization processing quantities respectively matched with the number of magnifications.

[0013] As an improved solution, the picture analysis algorithm is:

[0014] Access the pixel value index table, confirm a first target parameter that matches both the target resolution and the target size among a number of the target parameters, and call a screening algorithm to screen out a first pixel value that matches the first target parameter among a number of the pixel values;

[0015] Obtain a first picture, and identify the initial pixel value of the first picture; calculate the quotient of the first pixel value and the initial pixel value to obtain a first magnification; calculate the difference between the first pixel value and the initial pixel value to obtain a first pixel adjustment value;

[0016] Access the magnification index table, and call the screening algorithm to screen out a first picture synchronization processing quantity that matches the first magnification among a number of the picture synchronization processing quantities;

[0017] Compare the first picture synchronization processing quantity with the picture quantity threshold;

[0018] If the first picture synchronization processing quantity reaches the picture quantity threshold, generate a first parameter, and integrate the first magnification, the first pixel adjustment value, and the first parameter to obtain the picture magnification parameter;

[0019] If the first picture synchronization processing quantity does not reach the picture quantity threshold, generate a second parameter, and integrate the first magnification, the first pixel adjustment value, and the second parameter to obtain the picture magnification parameter.

[0020] As an improved solution, the lossless magnification operation includes:

[0021] Read the picture magnification parameter;

[0022] When the second parameter exists in the picture magnification parameter, set the first picture as the picture to be magnified, and start a first thread; perform a magnification processing step on the picture to be magnified through the first thread to obtain a first magnified picture, and set the first magnified picture as the lossless magnified picture;

[0023] When the first parameter exists in the picture magnification parameters, the first picture is evenly divided according to the first picture synchronous processing quantity to obtain a plurality of second pictures; record the corresponding even division processing strategy between the plurality of second pictures, and set the plurality of second pictures as the plurality of pictures to be magnified; start the plurality of first threads according to the first picture synchronous processing quantity; perform the magnification processing step on the plurality of pictures to be magnified through the plurality of first threads respectively to obtain a plurality of first magnified pictures; perform even splicing processing on the plurality of first magnified pictures according to the even division processing strategy to obtain the lossless magnified picture.

[0024] As an improved solution, the magnification processing step includes:

[0025] The first thread calls the lossless magnification algorithm based on the data loading form, the first magnification factor, the first pixel adjustment value, and the picture to be magnified.

[0026] The lossless magnification algorithm is:

[0027] Read a plurality of pixels to be processed of the picture to be magnified; obtain a plurality of RGB data respectively corresponding to the plurality of pixels to be processed; load the plurality of RGB data into the system memory respectively according to the data loading form;

[0028] Based on the first pixel adjustment value, perform data analysis and modification operations on the plurality of RGB data in the system memory respectively to obtain a plurality of data to be read; identify the starting bit of data storage in the system memory, and sequentially read the plurality of data to be read in the system memory based on the starting bit of data storage, and perform picture loading processing based on the plurality of data to be read to obtain the first magnified picture.

[0029] As an improved solution, the data analysis and modification operation includes:

[0030] Modify both the horizontal pixel value and the vertical pixel value of the three-color data in the RGB data according to the first pixel adjustment value.

[0031] As an improved solution, the step of loading the plurality of RGB data into the system memory respectively according to the data loading form further includes:

[0032] Set a first reference parameter value, and perform a loading confirmation step on the plurality of RGB data respectively based on the first reference parameter value;

[0033] The loading confirmation step includes:

[0034] Identify the image width value of the image to be magnified; identify the data bit value corresponding to the RGB data; calculate the product of the image width value and the data bit value to obtain the first byte parameter value;

[0035] Determine whether the first byte parameter value is a multiple of the first reference parameter value;

[0036] If so, set the two-dimensional array parameter value of the system memory according to the first byte parameter value, and load the RGB data corresponding to the first byte parameter value into the system memory according to the data loading form;

[0037] If not, perform useless data elimination processing on the RGB data until the first byte parameter value of the RGB data is a multiple of the first reference parameter value, and set the first byte parameter value as the qualified parameter value; set the two-dimensional array parameter value of the system memory according to the qualified parameter value, and load the RGB data corresponding to the qualified parameter value into the system memory according to the data loading form.

[0038] As an improved solution, when performing the picture loading process based on a number of the data to be read, if the first byte parameter value corresponding to the data to be read has undergone the useless data elimination process, perform data placeholder processing on the data to be read, and perform the picture loading process based on the data to be read after the data placeholder processing.

[0039] The present invention also provides a picture lossless magnification system based on system memory processing, including:

[0040] An initial configuration module, an image analysis module, and a lossless magnification module;

[0041] The initial configuration module is used to configure a picture analysis algorithm, a lossless magnification algorithm, a pixel value index table, and a magnification multiple index table; the initial configuration module is also used to set a picture quantity threshold and a data loading form;

[0042] The image analysis module is used to obtain a target resolution and a target size. The image analysis module calls the picture analysis algorithm based on the pixel value index table, the magnification multiple index table, the picture quantity threshold, the target resolution, and the target size to obtain picture magnification parameters;

[0043] The lossless magnification module is used to perform a lossless magnification operation according to the lossless magnification algorithm, the data loading form, and the picture magnification parameters to obtain a lossless magnification picture.

[0044] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for lossless magnification of pictures based on system memory are implemented.

[0045] The beneficial effects of the present invention are as follows:

[0046] 1. The method for lossless magnification of pictures based on system memory according to the present invention can achieve the magnification of old photos and low-pixel compressed pictures transmitted on social software without losing pixel point information. At the same time, based on the relevant optimization processing of the system memory, the duration of the lossless magnification operation will not be affected by the too-large picture format. The efficiency of picture processing is extremely high, the picture magnification effect is good, the informatization experience of users is improved, and it has extremely high market value and application value.

[0047] 2. The system for lossless magnification of pictures based on system memory according to the present invention can, through the mutual cooperation of the initial configuration module, the image analysis module and the lossless magnification module, achieve the magnification of old photos and low-pixel compressed pictures transmitted on social software without losing pixel point information. At the same time, based on the relevant optimization processing of the system memory, the duration of the lossless magnification operation will not be affected by the too-large picture format. The efficiency of picture processing is extremely high, the picture magnification effect is good, the informatization experience of users is improved, and it has extremely high market value and application value.

[0048] 3. The computer-readable storage medium according to the present invention can realize guiding the initial configuration module, the image analysis module and the lossless magnification module to cooperate, so as to achieve the magnification of old photos and low-pixel compressed pictures transmitted on social software without losing pixel point information. At the same time, based on the relevant optimization processing of the system memory, the duration of the lossless magnification operation will not be affected by the too-large picture format. The efficiency of picture processing is extremely high, the picture magnification effect is good, the informatization experience of users is improved, and the operability of the method for lossless magnification of pictures based on system memory is effectively improved. Description of the Drawings

[0049] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0050] Figure 1 is the flowchart of the method for lossless magnification of pictures based on system memory according to Embodiment 1 of the present invention;

[0051] Figure 2 It is a schematic flowchart of the specific process of the method for lossless image magnification based on system memory processing described in Embodiment 1 of the present invention;

[0052] Figure 3 It is an architecture diagram of the system for lossless image magnification based on system memory processing described in Embodiment 2 of the present invention. Specific embodiments

[0053] The following elaborates on the preferred embodiments of the present invention in conjunction with the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making the protection scope of the present invention more clearly defined.

[0054] In the description of the present invention, it should be noted that the embodiments described in the present invention are some embodiments of the present invention, rather than all embodiments; all other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts belong to the scope of protection of the present invention.

[0055] In the description of the present invention, it should be noted that the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0056] In the description of the present invention, it should be noted that: RGB is a color model.

[0057] Embodiment 1

[0058] This embodiment provides a method for lossless image magnification based on system memory processing, as Figure 1 and Figure 2 shown, including the following steps:

[0059] S100. Initial configuration step, specifically including:

[0060] [[ID=3,6]]S110. Configure the image analysis algorithm, lossless magnification algorithm, pixel value index table, and magnification factor index table; set the image quantity threshold and data loading form; in this embodiment, the image analysis algorithm is used to confirm the specifications and relevant parameters of the image to be processed, and then confirm the most efficient image processing scheme; the lossless magnification algorithm is used to perform lossless magnification processing on the image; the pixel value index table and the magnification factor index table are respectively used to assist the image analysis algorithm in confirming the specifications and parameters of the image; the data loading form is in byte form in this embodiment.

[0061] Specifically, the pixel value index table is configured with: several pixel values and several target parameters matching the several pixel values; the target parameters include: resolution and picture size; correspondingly, since the pixels of a picture are calculated as the product of the resolution and the picture size, in this embodiment, the correspondence between the resolution and the picture size is a one-to-many relationship, that is, under the same resolution, there may be several different picture sizes matching it; for example, if the resolution is 1920*1080, the corresponding picture sizes include but are not limited to 1 inch, 2 inches, and 5 inches, etc., so the corresponding pixel values are also different calculation results;

[0062] The magnification index table is configured with: several magnifications and several picture synchronous processing quantities respectively matching the several magnifications; correspondingly, the picture synchronous processing quantity is set according to the magnification of the picture. The larger the magnification, the greater the consumption of computing resources in the processing process of picture data, and thus it is necessary to perform synchronous processing to improve the processing efficiency. Therefore, the more the picture synchronous processing quantity, the picture synchronous processing quantity is used for subsequent multi-threaded synchronous picture magnification processing operations.

[0063] S200. Image analysis step, specifically including:

[0064] S210. Obtain the target resolution and target size; based on the pixel value index table, the magnification index table, the picture quantity threshold, the target resolution and the target size, call the picture analysis algorithm to obtain the picture magnification parameters;

[0065] Specifically, in this embodiment, first, it is necessary to obtain the picture processing requirements, and then based on the picture analysis algorithm, the pixel value index table, the magnification index table, the picture quantity threshold and the picture processing requirements, perform a picture pre-analysis operation to obtain the picture magnification parameters; the picture processing requirements include a first requirement and a second requirement; the first requirement is that there is a first picture to be losslessly magnified, that is, it is necessary to perform a lossless magnification operation on the first picture; otherwise, it is not required, that is, the second requirement is that there is no first picture to be losslessly magnified;

[0066] Specifically, the picture pre-analysis operation includes:

[0067] Identify the picture processing requirements. When the picture processing requirements are the first requirement, identify the target resolution and the target size corresponding to the picture processing requirements; the target resolution is the picture resolution that the user needs to achieve, and the target size is the size that the user needs to maintain for the image at this target resolution; therefore, based on the pixel value index table, the magnification index table, the picture quantity threshold, the target resolution and the target size, call the picture analysis algorithm to obtain the picture magnification parameters.

[0068] Specifically, the picture analysis algorithm is as follows:

[0069] Access the pixel value index table, confirm the first target parameter that matches both the target resolution and the target size among several target parameters, and call the screening algorithm to screen out the first pixel value that matches the first target parameter from several pixel values;

[0070] Obtain the first picture and identify the initial pixel value of the first picture; the initial pixel value is the current pixel value of the first picture to be processed; calculate the quotient of the first pixel value and the initial pixel value to obtain the first magnification factor; calculate the difference between the first pixel value and the initial pixel value to obtain the first pixel adjustment value; for example, if the initial pixel value is 4*2 and the first pixel value is 40*20, then the quotient is the quotient of 40 and 4 or the quotient of 20 and 2, that is, 10, so the first magnification factor is 10 times; correspondingly, a pixel adjustment value is (40 - 4, 20 - 2), that is, (36, 18); access the magnification factor index table, and call the screening algorithm to screen out the first picture synchronous processing quantity that matches the first magnification factor from several picture synchronous processing quantities; in this embodiment, the screening algorithm includes but is not limited to the regular matching algorithm;

[0071] Compare the first picture synchronous processing quantity with the picture quantity threshold; in this embodiment, the picture quantity threshold is 2. If the first picture synchronous processing quantity reaches the picture quantity threshold, it means that picture lossless magnification needs to be performed synchronously, so generate the first parameter. In this embodiment, the first parameter is "1"; integrate the first magnification factor, the first pixel adjustment value, and the first parameter to obtain the picture magnification parameter; the picture magnification parameter is the relevant data parameter required in the subsequent lossless magnification algorithm; if the first picture synchronous processing quantity does not reach the picture quantity threshold, it means that only the current first picture needs to be directly processed for lossless magnification, and there is no need to perform picture lossless magnification synchronously, so generate the second parameter. In this embodiment, the second parameter is "0", and integrate the first magnification factor, the first pixel adjustment value, and the second parameter to obtain the picture magnification parameter; correspondingly, due to the differences between the first parameter and the second parameter, the picture magnification parameters in the above two cases are partially different.

[0072] S300. The lossless magnification step specifically includes:

[0073] S310. Perform a lossless magnification operation based on the lossless magnification algorithm, the data loading form, and the picture magnification parameter to obtain a lossless magnification picture.

[0074] Specifically, the lossless magnification operation includes:

[0075] Read the picture magnification parameter; when the second parameter exists in the picture magnification parameter, directly perform the magnification process. Therefore, set the first picture as the picture to be magnified, and start the first thread. The first thread is a thread called and controlled by the central processing unit in the terminal system applied by this method; based on the computing resources provided by the first thread, perform the magnification process steps on the picture to be magnified to obtain the first magnified picture, and set this first magnified picture as the lossless magnified picture; the magnification process steps are the main image processing steps in this method.

[0076] When the first parameter exists in the picture magnification parameter, perform multi-threaded synchronous magnification processing. Therefore, evenly divide the first picture according to the first picture synchronous processing quantity to obtain several second pictures; in this embodiment, the even division process is: set the division size based on the quotient of the current size of the first picture and the first picture synchronous processing quantity, evenly divide the first picture at equal distances according to the division size, and record the corresponding even division processing strategy between several second pictures. The even division processing strategy is the placement position relationship between several second pictures, that is, according to this placement position relationship, several second pictures can be spliced into the original first picture; therefore, set several second pictures as several pictures to be magnified respectively; therefore, start several first threads according to the first picture synchronous processing quantity; through several first threads, perform the magnification process steps on several pictures to be magnified respectively to obtain several first magnified pictures; for example, if the first picture synchronous processing quantity is 10, then call ten threads to simultaneously perform the magnification process steps on ten second pictures respectively; the several first magnified pictures obtained also correspond to several second pictures respectively; because the first magnified picture is magnified and the picture content will not change, evenly splice several first magnified pictures according to the even division processing strategy. The even splicing process is to splice several first magnified pictures together again according to this even division processing strategy, and perform edge fading effect processing on the edges where several first magnified pictures are connected in the spliced picture, and finally obtain the lossless magnified picture corresponding to the first picture when the first parameter exists in the picture magnification parameter.

[0077] Specifically, in this embodiment, the magnification process steps include: the first thread calls the lossless magnification algorithm based on the data loading form, the first magnification factor, the first pixel adjustment value, and the picture to be magnified.

[0078] Specifically, the lossless magnification algorithm is:

[0079] First, traverse the data of each pixel in the image to be enlarged. Then, process each pixel. Therefore, a number of pixels to be processed in the image to be enlarged are read, and the number of pixels to be processed is each pixel in the image to be enlarged. Correspondingly, in this method, more emphasis is placed on processing efficiency. Therefore, the core of this algorithm also lies in performing the enlargement process based on the system memory and the data structure in the system memory. Therefore, a number of RGB data corresponding to the respective pixels to be processed are obtained; the number of RGB data is respectively loaded into the system memory according to the data loading form; adjusting the data in the system memory saved in the data loading form is much more efficient than adjusting the pixels themselves; therefore, data analysis and modification operations are respectively performed on the number of RGB data in the system memory to obtain a number of data to be read; identify the starting bit of data storage in the system memory, and sequentially read the number of data to be read in the system memory based on the starting bit of data storage. After the data reading is completed, perform image loading processing based on the number of data to be read that have been read to obtain the first enlarged image; image loading processing is to read byte data based on the system memory and convert and load it into image data, and finally generate the corresponding first enlarged image and output it for display.

[0080] Specifically, the data analysis and modification operations include:

[0081] Modify both the horizontal pixel value and the vertical pixel value of the three-color data in the RGB data according to the first pixel adjustment value; correspondingly, the principle of the data analysis and modification operation is that in this embodiment, when adjusting each RGB data, a lossless enlargement effect is achieved, that is, the pixels are processed in equal proportion. That is, when adding n pixel points in the horizontal direction of the pixel, n pixel points are also added in the vertical direction of the pixel, so as to ensure that the horizontal and vertical directions are in equal proportion when the pixel is enlarged, and the enlargement quality of the pixel is guaranteed.

[0082] Specifically, the step of respectively loading the number of RGB data into the system memory according to the data loading form further includes:

[0083] Correspondingly, when the image is loaded into the system memory, based on the relevant principle of loading image data into the memory, the width of the memory block of the memory must be greater than or equal to the width of the image itself, and based on the relevant calculation formula for loading image data into the memory, the width of the memory block must be a multiple of 4; therefore, in order to achieve lossless enlargement and meet the above requirements, corresponding screening and configuration are required when the data is loaded into the memory. Therefore, a first reference parameter value is set, and the first reference parameter value is 4 in this embodiment; perform a loading confirmation step for each RGB data;

[0084] Specifically, the loading confirmation step includes:

[0085] Identify the image width value of the picture to be enlarged; identify the data bit value corresponding to the RGB data. In this embodiment, the RGB data contains 3 bits of data, so the data bit value is 3; calculate the product of the image width value and the data bit value to obtain the first byte parameter value. For example, in this embodiment, if the image width value is 3, the first byte parameter value is 9; and the memory block width must be a multiple of 4, so the memory block width can only be 12. Then, there will inevitably be a certain amount of data redundancy space, which will cause unused space in the memory block when the data is loaded into the memory, affecting the inaccuracy of data loading and subsequent image loading, and wasting a certain amount of memory resources at the same time; therefore, determine whether the first byte parameter value is a multiple of the first reference parameter value; if so, set the two-dimensional array parameter value of the system memory according to the first byte parameter value, and the two-dimensional array parameter value is the above-mentioned memory block width; the memory block width represents the width of the two-dimensional memory data in the system memory, that is, Stride; so in this embodiment, according to the opposite logic, when the first byte parameter value is a multiple of the first reference parameter value, configure the two-dimensional array parameter value based on the first byte parameter value, so that the two-dimensional array parameter value is a multiple of 4 and matches the first byte parameter value, that is, the memory block width is equal to the width of the image itself. Therefore, load the RGB data corresponding to the first byte parameter value into the system memory according to the data loading form;

[0086] If not, in order to ensure lossless magnification and magnification accuracy, and at the same time improve processing efficiency, the RGB data is processed to remove useless data. Removing useless data means removing the useless data in the RGB data. Useless data includes, but is not limited to, data in the RGB data that does not affect the color value of the original pixel point itself. In this way, there is no need to perform lossless magnification on these data; during the removal process, until the first byte parameter value of the RGB data is a multiple of the first reference parameter value, set the first byte parameter value as the qualified parameter value; set the two-dimensional array parameter value of the system memory according to the qualified parameter value, and load the RGB data corresponding to the qualified parameter value into the system memory according to the data loading form; for example, when the first byte parameter value is 9, it is necessary to remove the useless data in the RGB data to make the image width reach 8, so as to meet the requirements for loading image data in the memory, and at the same time meet the magnification quality and accuracy requirements of lossless magnification.

[0087] Specifically, in order to ensure that the data after lossless magnification has a high degree of restoration and thus ensure the data integrity of the magnified image, when performing image loading processing based on a number of the to-be-read data, if the first byte parameter value corresponding to the to-be-read data has undergone the useless data elimination process, data placeholder processing is performed on the to-be-read data, and the image loading processing is performed based on the to-be-read data after the data placeholder processing; data placeholder processing means inserting invalid placeholder data into the image data (to-be-read data) after magnification adjustment to fill the data integrity, so as to ensure that the image can be successfully loaded; it can be imagined that when finally outputting and displaying the lossless magnified image, the first magnification factor is output at the same time, so as to prompt the user how many times the image has been magnified, and the user can record the relevant target size and target resolution according to this magnification factor for the relevant operations of next image magnification.

[0088] Embodiment 2

[0089] Based on the same inventive concept as the method for lossless magnification of images based on system memory processing described in Embodiment 1, this embodiment provides a system for lossless magnification of images based on system memory processing, as Figure 3 shown, including: an initial configuration module, an image analysis module, and a lossless magnification module;

[0090] In the system for lossless magnification of images based on system memory processing, the initial configuration module is used to configure an image analysis algorithm, a lossless magnification algorithm, a pixel value index table, and a magnification factor index table; the initial configuration module is also used to set a picture quantity threshold and a data loading form;

[0091] Specifically, the pixel value index table is configured with: a number of pixel values and a number of target parameters matching the number of pixel values; the target parameters include resolution and picture size; the magnification factor index table is configured with: a number of magnification factors and a number of picture synchronous processing quantities respectively matching the number of magnification factors.

[0092] In the system for lossless magnification of images based on system memory processing, the image analysis module is used to obtain a target resolution and a target size, and the image analysis module calls the image analysis algorithm based on the pixel value index table, the magnification factor index table, the picture quantity threshold, the target resolution, and the target size to obtain picture magnification parameters;

[0093] Specifically, the picture analysis algorithm is as follows: The image analysis module accesses the pixel value index table. The image analysis module confirms a first target parameter that matches both the target resolution and the target size among a number of the target parameters. The image analysis module calls a screening algorithm to screen out a first pixel value that matches the first target parameter among a number of the pixel values. The image analysis module obtains a first picture and identifies the initial pixel value of the first picture. The image analysis module calculates the quotient of the first pixel value and the initial pixel value to obtain a first magnification factor. The image analysis module calculates the difference between the first pixel value and the initial pixel value to obtain a first pixel adjustment value. The image analysis module accesses the magnification factor index table. The image analysis module calls the screening algorithm to screen out a first picture synchronous processing quantity that matches the first magnification factor among a number of the picture synchronous processing quantities. The image analysis module compares the first picture synchronous processing quantity with the picture quantity threshold. If the first picture synchronous processing quantity reaches the picture quantity threshold, the image analysis module generates a first parameter and integrates the first magnification factor, the first pixel adjustment value, and the first parameter to obtain the picture magnification parameter. If the first picture synchronous processing quantity does not reach the picture quantity threshold, the image analysis module generates a second parameter and integrates the first magnification factor, the first pixel adjustment value, and the second parameter to obtain the picture magnification parameter.

[0094] In the picture lossless magnification system based on system memory processing, the lossless magnification module is used to perform a lossless magnification operation according to the lossless magnification algorithm, the data loading form, and the picture magnification parameter to obtain a lossless magnification picture;

[0095] Specifically, the lossless magnification operation includes: the lossless magnification module reads the picture magnification parameters; when the second parameter exists in the picture magnification parameters, the lossless magnification module sets the first picture as the picture to be magnified and starts the first thread; the lossless magnification module performs a magnification process on the picture to be magnified through the first thread to obtain a first magnified picture, and the lossless magnification module sets the first magnified picture as the lossless magnified picture; when the first parameter exists in the picture magnification parameters, the lossless magnification module evenly divides the first picture according to the first picture synchronous processing quantity to obtain several second pictures; the lossless magnification module records the corresponding even division processing strategy among several second pictures, and the lossless magnification module sets several second pictures as several pictures to be magnified respectively; starts several first threads according to the first picture synchronous processing quantity; the lossless magnification module performs the magnification process on several pictures to be magnified through several first threads respectively to obtain several first magnified pictures; the lossless magnification module evenly splices several first magnified pictures according to the even division processing strategy to obtain the lossless magnified picture.

[0096] Specifically, the magnification process includes: the lossless magnification module calls the lossless magnification algorithm based on the data loading form, the first magnification factor, the first pixel adjustment value and the picture to be magnified through the first thread.

[0097] The lossless magnification algorithm is: the lossless magnification module reads several pixels to be processed of the picture to be magnified through the first thread; the lossless magnification module obtains several RGB data respectively corresponding to several pixels to be processed through the first thread; the lossless magnification module loads several RGB data into the system memory respectively according to the data loading form through the first thread; the lossless magnification module performs data analysis and modification operations on several RGB data in the system memory respectively through the first thread to obtain several data to be read; the lossless magnification module identifies the data storage start bit of the system memory through the first thread, the lossless magnification module sequentially reads several data to be read in the system memory based on the data storage start bit through the first thread, and the lossless magnification module performs picture loading processing based on several data to be read through the first thread to obtain the first magnified picture.

[0098] Specifically, the data analysis and modification operation includes: the lossless magnification module modifies both the horizontal pixel value and the vertical pixel value of the three-color data in the RGB data according to the first pixel adjustment value through the first thread.

[0099] Specifically, the operation of loading a number of the RGB data into the system memory in the data loading form by the first thread of the lossless magnification module further includes: the lossless magnification module setting a first reference parameter value through the first thread, and the lossless magnification module performing a loading confirmation step on a number of the RGB data respectively based on the first reference parameter value through the first thread;

[0100] Specifically, the loading confirmation step includes: the lossless magnification module identifying the image width value of the picture to be magnified through the first thread; the lossless magnification module identifying the data bit value corresponding to the RGB data through the first thread; the lossless magnification module calculating the product of the image width value and the data bit value through the first thread to obtain a first byte parameter value; the lossless magnification module determining whether the first byte parameter value is a multiple of the first reference parameter value through the first thread; if so, the lossless magnification module setting the two-dimensional array parameter value of the system memory according to the first byte parameter value through the first thread, and loading the RGB data corresponding to the first byte parameter value into the system memory in the data loading form; if not, the lossless magnification module performing useless data elimination processing on the RGB data through the first thread until the first byte parameter value of the RGB data is a multiple of the first reference parameter value, the lossless magnification module setting the first byte parameter value as a qualified parameter value through the first thread; the lossless magnification module setting the two-dimensional array parameter value of the system memory according to the qualified parameter value through the first thread, and loading the RGB data corresponding to the qualified parameter value into the system memory in the data loading form.

[0101] Specifically, when performing the picture loading process based on a number of the data to be read, if the first byte parameter value corresponding to the data to be read has undergone the useless data elimination processing, the lossless magnification module performs data placeholder processing on the data to be read through the first thread, and performs the picture loading process based on the data to be read after the data placeholder processing.

[0102] Embodiment 3

[0103] This embodiment provides a computer-readable storage medium, including:

[0104] The storage medium is used to store computer software instructions for implementing the method for lossless magnification of pictures based on system memory processing described in Embodiment 1 above. It includes a program for executing the above settings for the method for lossless magnification of pictures based on system memory processing. Specifically, the executable program can be built into the system for lossless magnification of pictures based on system memory processing described in Embodiment 2. In this way, the system for lossless magnification of pictures based on system memory processing can implement the method for lossless magnification of pictures based on system memory processing described in Embodiment 1 by executing the built-in executable program.

[0105] In addition, the computer-readable storage medium of this embodiment can adopt any combination of one or more readable storage media. Among them, the readable storage medium includes systems, devices or components of electricity, light, electromagnetism, infrared rays or semiconductors, or any combination of the above.

[0106] Different from the prior art, by using a method, a system and a medium for lossless magnification of pictures based on system memory processing in this application, it is possible to magnify pictures of old photos and low-pixel compressed pictures transmitted on social software without losing pixel point information through this method. At the same time, based on the relevant optimization processing of the system memory, the duration of the lossless magnification operation will not be affected due to the too large picture format. The efficiency of picture processing is extremely high, and the picture magnification effect is good. The system for lossless magnification of pictures provides effective technical support for this method, ultimately improving the user's informatization experience and having extremely high market value and application value.

[0107] The serial numbers of the disclosed embodiments in the present invention above are only for description and do not represent the advantages or disadvantages of the embodiments.

[0108] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or a program for instructing relevant hardware to complete can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disc, etc.

[0109] The above are only the embodiments of the present invention, and thus do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A method for lossless magnification of pictures based on system memory processing, characterized in that, Including the following steps: Initial configuration step: Configure the image analysis algorithm, lossless magnification algorithm, pixel value index table, and magnification factor index table; set the picture quantity threshold and data loading form; Image analysis step: Obtain the target resolution and target size; based on the pixel value index table, the magnification factor index table, the picture quantity threshold, the target resolution, and the target size, call the image analysis algorithm to obtain the picture magnification parameters; Lossless magnification step: Perform a lossless magnification operation based on the lossless magnification algorithm, the data loading form, and the picture magnification parameters to obtain a lossless magnified picture; The pixel value index table is configured with: a number of pixel values and a number of target parameters matching the number of pixel values; the target parameters include resolution and picture size; The magnification factor index table is configured with: a number of magnification factors and a number of picture synchronous processing quantities respectively matching the number of magnification factors; The image analysis algorithm is: access the pixel value index table, confirm the first target parameter that matches both the target resolution and the target size among the number of target parameters, and call the screening algorithm to screen out the first pixel value that matches the first target parameter among the number of pixel values; Obtain the first picture and identify the initial pixel value of the first picture; Calculate the quotient of the first pixel value and the initial pixel value to obtain the first magnification factor; Calculate the difference between the first pixel value and the initial pixel value to obtain the first pixel adjustment value; Access the magnification factor index table, and call the screening algorithm to screen out the first picture synchronous processing quantity that matches the first magnification factor among the number of picture synchronous processing quantities; Compare the first picture synchronous processing quantity with the picture quantity threshold; if the first picture synchronous processing quantity reaches the picture quantity threshold, generate the first parameter, and integrate the first pixel adjustment value and the first parameter to obtain the picture magnification parameters; if the first picture synchronous processing quantity does not reach the picture quantity threshold, generate the second parameter, and integrate the first pixel adjustment value and the second parameter to obtain the picture magnification parameters; The lossless magnification operation includes: reading the picture magnification parameter; when the second parameter exists in the picture magnification parameter, setting the first picture as the picture to be magnified, and starting the first thread; performing a magnification processing step on the picture to be magnified through the first thread to obtain a first magnified picture, and setting the first magnified picture as the lossless magnified picture; when the first parameter exists in the picture magnification parameter, evenly dividing the first picture according to the first picture synchronous processing quantity to obtain a plurality of second pictures; recording the uniform division processing strategy corresponding to the plurality of second pictures, and setting the plurality of second pictures as the plurality of pictures to be magnified respectively; starting the plurality of first threads according to the first picture synchronous processing quantity; performing the magnification processing step on the plurality of pictures to be magnified through the plurality of first threads respectively to obtain a plurality of first magnified pictures; and performing uniform splicing processing on the plurality of first magnified pictures according to the uniform division processing strategy to obtain the lossless magnified picture.

2. The method for lossless magnification of pictures based on system memory processing according to claim 1, wherein: The magnification processing step includes: The first thread calls the lossless magnification algorithm based on the data loading form, the first pixel adjustment value, and the picture to be magnified. The lossless magnification algorithm is: Reading a plurality of pixels to be processed of the picture to be magnified; obtaining a plurality of RGB data respectively corresponding to the plurality of pixels to be processed; loading the plurality of RGB data into the system memory respectively according to the data loading form; Performing data analysis and modification operations on the plurality of RGB data in the system memory respectively based on the first pixel adjustment value to obtain a plurality of data to be read; identifying the data storage start bit of the system memory, sequentially reading the plurality of data to be read in the system memory based on the data storage start bit, and performing picture loading processing based on the plurality of data to be read to obtain the first magnified picture.

3. The method for lossless magnification of pictures based on system memory processing according to claim 2, wherein: The data analysis and modification operation includes: Modifying both the horizontal pixel value and the vertical pixel value of the three-color data in the RGB data according to the first pixel adjustment value.

4. The method for lossless magnification of pictures based on system memory processing according to claim 2 or 3, wherein: The step of loading the plurality of RGB data into the system memory respectively according to the data loading form further includes: Setting a first reference parameter value, and performing a loading confirmation step on the plurality of RGB data respectively based on the first reference parameter value; The loading confirmation step includes: Identifying the image width value of the picture to be magnified; identifying the data bit value corresponding to the RGB data; calculating the product of the image width value and the data bit value to obtain a first byte parameter value; Judging whether the first byte parameter value is a multiple of the first reference parameter value; If so, set the two-dimensional array parameter value of the system memory according to the first byte parameter value, and load the RGB data corresponding to the first byte parameter value into the system memory in the data loading form; If not, perform useless data elimination processing on the RGB data. When the first byte parameter value of the RGB data is a multiple of the first reference parameter value, set the first byte parameter value as the qualified parameter value; set the two-dimensional array parameter value of the system memory according to the qualified parameter value, and load the RGB data corresponding to the qualified parameter value into the system memory in the data loading form.

5. A method for lossless image magnification based on system memory processing according to claim 4, characterized in that: When performing the image loading process based on a plurality of the to-be-read data, if the first byte parameter value corresponding to the to-be-read data has undergone the useless data elimination processing, perform data placeholder processing on the to-be-read data, and perform the image loading process based on the to-be-read data after the data placeholder processing.

6. A picture lossless magnification system based on system memory processing for the picture lossless magnification method based on system memory processing according to claim 2, characterized in that, The system for lossless image magnification based on system memory processing includes: an initial configuration module, an image analysis module, and a lossless magnification module; The initial configuration module is used to configure an image analysis algorithm, a lossless magnification algorithm, a pixel value index table, and a magnification factor index table; the initial configuration module is further used to set a picture quantity threshold and a data loading form; The image analysis module is used to obtain a target resolution and a target size. The image analysis module calls the image analysis algorithm based on the pixel value index table, the magnification factor index table, the picture quantity threshold, the target resolution, and the target size to obtain image magnification parameters; The lossless magnification module is used to perform a lossless magnification operation according to the lossless magnification algorithm, the data loading form, and the image magnification parameters to obtain a lossless magnified image.

7. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the method for lossless image magnification based on system memory processing according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Image processing method and device based on convolutional neural network model

    CN110363279A

  • Faster image processing

    US20080107174A1