Ultrahigh-definition image up-down sampling method and system based on Haar wavelet
The Haar wavelet-based image up- and down-sampling method efficiently recovers lost high-frequency information, addressing smoothing and aliasing issues while maintaining low complexity and achieving high-quality, fast image processing.
Patent Information
- Application Number
- CN202411054433.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-12-03
AI Technical Summary
Existing image up- and down-sampling techniques face issues such as excessive smoothing and loss of texture and edge information during up-sampling, and aliasing effects during down-sampling, while also requiring high computational complexity and time for complex image data processing.
An ultra-high-definition image up- and down-sampling method using Haar wavelet transforms, involving downsampling, Haar wavelet matrix construction, and inverse Haar wavelet transform to recover lost high-frequency information and achieve efficient reconstruction.
The method maintains low computational complexity and achieves fast, accurate sampling with improved texture recovery and noise reduction, outperforming traditional methods in quality and reducing processing time by up to 1/10th.
Smart Images

Figure CN119071511A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image sampling technology, and in particular to an ultra-high-definition image up- and down-sampling method and system based on Haar wavelet. Background Art
[0002] Image upsampling and downsampling are basic operations in image processing. They are used to adjust the resolution of the image to meet different application requirements. Upsampling increases the number of pixels in the image to increase the resolution, making the image more delicate and richer in details. Downsampling reduces the resolution by reducing the number of pixels in the image, and is often used for image compression and simplified processing.
[0003] Although existing up- and down-sampling techniques have shown good performance in many scenarios, they still face some challenges and problems when processing complex image data. First, during the up-sampling process, traditional interpolation methods such as bilinear interpolation and bicubic interpolation may lead to excessive smoothing of the image and loss of important texture and edge information. This not only affects the visual effect of the image, but may also have a negative impact on subsequent image analysis and recognition tasks. Secondly, during the down-sampling process, simple sub-sampling methods are prone to introduce aliasing effects, resulting in jagged and distorted images. Although the use of complex filters for pre-processing can reduce these problems, it often increases computational complexity and processing time. Existing up- and down-sampling algorithms often require a lot of computing resources and time when processing these large amounts of data.
[0004] In view of the shortcomings of the existing technology, the present invention proposes an ultra-high-definition image up- and down-sampling method and system based on Haar wavelet, which improves the sampling quality of the image through an efficient calculation method while maintaining low calculation complexity to meet the needs of real-time processing. Summary of the invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide an ultra-high-definition image up- and down-sampling method and system based on Haar wavelet with more ideal texture information recovery and better noise reduction effect, thereby achieving the purpose of fast and accurate sampling of ultra-high-definition images and solving the problem of maintaining low computational complexity while also having image sampling quality.
[0006] The object of the present invention is achieved by the following technical scheme: an ultra-high-definition image up-sampling method based on Haar wavelet, comprising:
[0007] Get the original image;
[0008] Downsample the original image on average to obtain downsampled pixel values;
[0009] Obtain the Haar wavelet matrix based on the downsampled pixel values;
[0010] The Haar wavelet matrix is subjected to inverse Haar wavelet transform to obtain an up-sampling matrix, thereby obtaining an up-sampled reconstruction value;
[0011] An ultra-high-definition lossless image corresponding to the original image is obtained according to the upsampled reconstructed value.
[0012] Furthermore, the original image is averagely downsampled to obtain downsampled pixel values.
[0013] Furthermore, the step of obtaining a Haar wavelet matrix according to the downsampled pixel values and obtaining high-frequency information of downsampled reconstruction according to the Haar wavelet matrix includes:
[0014] First, select 4 pixels on the original image to form the matrix X;
[0015]
[0016] a, b, c and d represent the selection of 4 pixels on the original image;
[0017] Perform Haar decomposition on the rows of matrix X to obtain the second matrix X tmp , the expression of the second matrix is as follows:
[0018]
[0019] For the second matrix X tmp The columns of are decomposed by Haar to obtain the third matrix Y. The expression of the third matrix Y is as follows:
[0020] The Haar wavelet matrix X' is obtained by the third matrix Y and the down-sampled pixel values. The expression of the Haar wavelet matrix X' is as follows:
[0021]
[0022] Further, the obtaining of the Haar wavelet matrix X' through the third matrix Y and the down-sampled pixel values includes:
[0023] Obtain a low frequency value A, a first high frequency value B, a second high frequency value C and a third high frequency value D from the third matrix Y; the low frequency value A represents low frequency information, and the first high frequency value B, the second high frequency value C and the third high frequency value D all represent high frequency information lost in average downsampling;
[0024] The expression of the low frequency value A is:
[0025]
[0026] The expression of the first high frequency value B is:
[0027]
[0028] The expression of the second high frequency value C is:
[0029]
[0030] The expression of the third high frequency value D is:
[0031]
[0032] The Haar wavelet matrix is obtained by the low frequency value A, the first high frequency value B, the second high frequency value C and the third high frequency value D. The Haar wavelet matrix X' is expressed as follows:
[0033]
[0034] Further, obtaining the Haar wavelet matrix through the third matrix Y and the down-sampled pixel values also includes:
[0035] Select a pixel point l on the downsampled pixel value after the original image is averaged downsampled, and use the point as the center point to be upsampled. The pixel point l is the low-frequency value A in the Haar wavelet matrix X';
[0036] Get the surrounding pixels with pixel l as the center point;
[0037] Constructing a first virtual point, a second virtual point, a third virtual point and a fourth virtual point through pixel point 1 and surrounding adjacent pixels;
[0038] The first high frequency value B, the second high frequency value C and the third high frequency value D reconstructed by the first virtual point, the second virtual point, the third virtual point and the fourth virtual point; the expressions for calculating the reconstructed first high frequency value B, the second high frequency value C and the third high frequency value D are respectively:
[0039]
[0040] Where:
[0041] a_w: first virtual point;
[0042] b_w: second virtual point;
[0043] c_w: third virtual point;
[0044] d_w: fourth virtual point;
[0045] The Haar wavelet matrix X' is obtained by the low frequency value A, the first high frequency value B, the second high frequency value C and the third high frequency value D. The expression of the Haar wavelet matrix X' is:
[0046]
[0047] Further, the first high frequency value B, the second high frequency value C and the third high frequency value D reconstructed by the first virtual point, the second virtual point, the third virtual point and the fourth virtual point further include: calculating the first high frequency value B, the second high frequency value C and the third high frequency value D by the intensity factor λ; the expressions of the first high frequency value B, the second high frequency value C and the third high frequency value D calculated by the intensity factor λ are respectively as follows:
[0048]
[0049] Further, the Haar wavelet matrix is subjected to an inverse Haar wavelet transform to obtain an up-sampling matrix, thereby obtaining an up-sampled reconstruction value, including:
[0050] a=A+B+C+D
[0051] b=2(A+B)-a=A+BCD
[0052] c=2(A+C)-a=A-B+CD
[0053] d=2(A+D)-a=AB-C+D.
[0054] The present invention also provides a system for up-sampling and down-sampling of ultra-high-definition images based on Haar wavelets, characterized in that it comprises: an acquisition module, a down-sampling module, a Haar wavelet module, an inverse wavelet transform module and a restoration module;
[0055] The acquisition module is used to acquire the original image to be processed;
[0056] The downsampling module is used to perform average downsampling on the original image to obtain downsampled pixel values;
[0057] The Haar wavelet module is used to obtain a Haar wavelet matrix according to the downsampled pixel values;
[0058] The inverse wavelet transform module is used to perform inverse Haar wavelet transform on the Haar wavelet matrix to obtain up-sampled reconstruction values;
[0059] The restoration module is used to restore the original image according to the up-sampled reconstruction value to obtain a lossless image.
[0060] The present invention has the following advantages:
[0061] (1) The present invention downsamples the image first and then upsamples it, and controls the loss and recovery of information by combining the Haar wavelet transform idea with a specific and efficient calculation method;
[0062] (2) The present invention adopts an efficient calculation method through Haar decomposition and Haar inverse transform, which is relatively simple to calculate and has low complexity. It can achieve less than 1 / 10 of the time consumption of bicubic interpolation while ensuring the average quality is close to that of bicubic interpolation, thereby improving performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a diagram of the method steps of the present invention;
[0064] Figure 2 is a schematic diagram of pixel l and adjacent pixels;
[0065] Figure 3 The following is a comparison chart of the test results. DETAILED DESCRIPTION
[0066] The present invention is further described below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following description.
[0067] It should be noted that the directions or positional relationships indicated by "left", "right", etc. are based on the directions or positional relationships shown in the accompanying drawings, or are the directions or positional relationships in which the inventive product is usually placed when in use, or are the directions or positional relationships commonly understood by those skilled in the art. Such terms are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.
[0068] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions in the embodiments may be combined with each other.
[0069] First aspect
[0070] like Figure 1 As shown, the present invention proposes an ultra-high-definition image up- and down-sampling method based on Haar wavelet, including S1 to S4.
[0071] The object of the present invention is achieved by the following technical scheme: an ultra-high-definition up-down sampling method based on Haar wavelet, comprising:
[0072] S1, obtain the original image;
[0073] S2, performing average downsampling on the original image to obtain downsampled pixel values;
[0074] S3, obtaining a Haar wavelet matrix according to the downsampled pixel values, and obtaining high-frequency information of downsampling reconstruction according to the Haar wavelet matrix, where the high-frequency information is a first high-frequency value B, a second high-frequency value C, and a third high-frequency value D lost in the average downsampling;
[0075] S301, first select 4 pixels on the original image to form a matrix X;
[0076]
[0077] Where:
[0078] a, b, c and d represent the selection of 4 pixels on the original image;
[0079] S302, perform Haar decomposition on the rows of matrix X to obtain a second matrix X tmp , the second matrix X tmp The expression is as follows:
[0080]
[0081] S303, for the second matrix X tmp The columns of are decomposed by Haar to obtain the third matrix Y. The expression of the third matrix Y is as follows:
[0082]
[0083] S304, obtaining a low frequency value A, a first high frequency value B, a second high frequency value C and a third high frequency value D from the third matrix Y;
[0084] The expression of the low frequency value A is:
[0085]
[0086] The expression of the first high frequency value B is:
[0087]
[0088] The expression of the second high frequency value C is:
[0089]
[0090] The expression of the third high frequency value D is:
[0091]
[0092] The low frequency value A represents the low frequency information, and the first high frequency value B, the second high frequency value C and the third high frequency value D all represent the high frequency information lost in the average downsampling;
[0093] S305. The Haar wavelet matrix after Haar decomposition is obtained by this transformation. The expression of the Haar wavelet matrix X' is as follows:
[0094]
[0095] After average downsampling, the low-frequency value A of the Haar wavelet transform is obtained. The high-frequency information represented by the remaining first high-frequency value B, the second high-frequency value C and the third high-frequency value D is lost in the process of average downsampling. At this time, the original image cannot be restored losslessly. Therefore, the present invention refers to the idea of Haar wavelet and obtains the third matrix Y through Haar decomposition, thereby constructing the high-frequency information to obtain the lost high-frequency information of B, C, and D.
[0096] In some specific embodiments, see Figure 2 , obtain the low frequency value A, the first high frequency value B, the second high frequency value C and the third high frequency value D from the third matrix Y; construct the four values of the low frequency value A, the first high frequency value B, the second high frequency value C and the third high frequency value D to obtain the first high frequency value B, the second high frequency value C and the third high frequency value D in the reconstructed high frequency component;
[0097] S341, selecting a pixel point l on the downsampled pixel value after average downsampling of the original image, and taking the point as the center point to be upsampled, the pixel point l is the low-frequency value A in the Haar wavelet matrix X';
[0098] A=1;
[0099] Where:
[0100] A: low frequency value;
[0101] l: pixel;
[0102] S342: Acquire horizontally adjacent and vertically adjacent pixel points with pixel point l as the center point, wherein the adjacent pixel points include: a first pixel point m and a second pixel point n horizontally adjacent to pixel point l; a third pixel point y and a fourth pixel point q vertically adjacent to pixel point l;
[0103] S343: constructing a first virtual point a_w, a second virtual point b_w, a third virtual point c_w and a fourth virtual point d_w through the pixel point l and the pixel points of the horizontally adjacent and vertically adjacent pixels;
[0104] The expression of the first virtual point a_w is:
[0105] a_w=(m+y+l) / 3;
[0106] Where:
[0107] a_w: first virtual point;
[0108] m: first pixel;
[0109] y: the third pixel;
[0110] The expression of the second virtual point b_w is:
[0111] b_w=(y+l+n) / 3;
[0112] Where:
[0113] b_w: second virtual point;
[0114] n: the second pixel;
[0115] The expression of the third virtual point c_w is:
[0116] c_w=(m+l+q) / 3;
[0117] Where:
[0118] c_w: third virtual point;
[0119] q: the fourth pixel;
[0120] The expression of d_w is:
[0121] d_w=(l+n+q) / 3;
[0122] Where:
[0123] d_w: fourth virtual point;
[0124] S344, reconstructing the first high frequency value B, the second high frequency value C and the third high frequency value D through the first virtual point a_w, the second virtual point b_w, the third virtual point c_w and the fourth virtual point d_w; the expressions of the first high frequency value B, the second high frequency value C and the third high frequency value D are respectively:
[0125]
[0126] S345, calculating the first high frequency value B, the second high frequency value C and the third high frequency value D by the intensity factor λ; the expressions for calculating the first high frequency value B, the second high frequency value C and the third high frequency value D are respectively as follows:
[0127]
[0128] Where: intensity factor λ = 1;
[0129] S4, applying Haar wavelet inverse transform to the Haar wavelet matrix to obtain up-sampled reconstruction values;
[0130] a=A+B+C+D
[0131] b=2(A+B)-a=A+BCD
[0132] c=2(A+C)-a=A-B+CD
[0133] d=2(A+D)-a=AB-C+D.
[0134] S4. Obtain an ultra-high-definition lossless image corresponding to the original image according to the upsampled reconstruction value.
[0135] The original image is losslessly restored according to the upsampled reconstruction value to obtain a lossless image. The present invention provides a lossless restoration method that is fast and easy to calculate and is implemented by an inverse Haar transform. The inverse Haar transform requires a matrix, and the high-frequency values of the matrix are lost during average downsampling. Therefore, virtual first high-frequency values B, second high-frequency values C and third high-frequency values D are reconstructed here to replace the real high-frequency values for inverse transformation. In general, reconstruction is the ultimate goal, and the high-frequency information, namely the first high-frequency value B, the second high-frequency value C and the third high-frequency value D, are the data needed to restore the original image.
[0136] Second aspect
[0137] The present invention also provides a system for up-sampling and down-sampling of ultra-high-definition images based on Haar wavelets, characterized in that it comprises: an acquisition module, a down-sampling module, a Haar wavelet module, an inverse wavelet transform module and a restoration module;
[0138] The acquisition module is used to acquire the original image to be processed;
[0139] The downsampling module is used to perform average downsampling on the original image to obtain downsampled pixel values;
[0140] The Haar wavelet module is used to obtain a Haar wavelet matrix according to the downsampled pixel values;
[0141] The inverse wavelet transform module is used to perform inverse Haar wavelet transform on the Haar wavelet matrix to obtain up-sampled reconstruction values;
[0142] The restoration module is used to restore the original image according to the upsampled reconstruction value to obtain an ultra-high-definition lossless image.
[0143] See also Figure 3 , Figure 3 The first column is the tested image, the second column is the resolution. This experiment tested 4k images and 8k images. The third column is the image format. The next three columns are the most mainstream upsampling methods: neighbor interpolation, bilinear interpolation, and bicubic interpolation. The first column of each is the PSNR after upsampling, and the second column is the time spent on upsampling. The Haar-base behind it is the result of our patented method. The last two columns are the comparison between our method and the bilinear and bicubic interpolation methods. The first column is the PSNR gain of our method, and the second column is the time saved.
[0144] The ultra-high-definition image up- and down-sampling method based on Haar wavelet proposed in the present invention is tested on an ultra-high-definition test picture and compared with three common up-sampling algorithms, namely nearest neighbor interpolation, bilinear interpolation and bicubic interpolation. It can be seen that the present invention has a quality advantage, and the objective quality PSNR is better than that of the bilinear interpolation method and slightly lower than that of the bicubic interpolation method, where λ=1.
[0145] However, the calculation of the present invention is relatively simple and of low complexity, and can be realized in a time consumption of less than 1 / 10 of that of bicubic interpolation while ensuring an average quality close to that of bicubic interpolation.
[0146] The above embodiments only express preferred implementation modes, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention.
Claims
1. The ultra-high-definition image up-sampling and down-sampling method based on Haar wavelet is characterized by: include: Get the original image; Downsample the original image on average to obtain downsampled pixel values; Obtain the Haar wavelet matrix based on the downsampled pixel values; The Haar wavelet matrix is subjected to inverse Haar wavelet transform to obtain the upsampled reconstruction value; An ultra-high-definition lossless image corresponding to the original image is obtained according to the upsampled reconstructed value.
2. The method for ultra-high-definition image up-sampling and down-sampling based on Haar wavelet according to claim 1, characterized in that: The step of obtaining a Haar wavelet matrix according to the downsampled pixel values includes: Select 4 pixels on the original image to form the matrix X. The expression of the matrix X is as follows; Where: a, b, c and d represent the selection of 4 pixels on the original image; Perform Haar decomposition on all rows of matrix X to obtain the second matrix X tmp , the second matrix X tmp The expression is as follows: For the second matrix X tmp The columns of the matrix are decomposed by Haar to obtain the third matrix Y. The expression of the third matrix Y is The Haar wavelet matrix is obtained by the third matrix Y and the downsampled pixel values.
3. The method for ultra-high-definition image up-sampling and down-sampling based on Haar wavelet according to claim 2, characterized in that: The method of obtaining the Haar wavelet matrix through the third matrix Y and the down-sampled pixel values includes: Obtain a low frequency value A, a first high frequency value B, a second high frequency value C and a third high frequency value D from the third matrix Y; The expression of the low frequency value A is: The expression of the first high frequency value B is: The expression of the second high frequency value C is: The expression of the third high frequency value D is: The Haar wavelet matrix is obtained by the low frequency value A, the first high frequency value B, the second high frequency value C and the third high frequency value D. The Haar wavelet matrix X' is expressed as follows:
4. The method for ultra-high-definition image up-sampling and down-sampling based on Haar wavelet according to claim 3, characterized in that: The method of obtaining the Haar wavelet matrix through the third matrix Y and the down-sampled pixel values also includes: Select a pixel point l on the downsampled pixel value after average downsampling of the original image, and use the point as the center point to be upsampled. The pixel point l is the low-frequency value A in the Haar wavelet matrix X'; Get the horizontally adjacent and vertically adjacent pixels with pixel l as the center point; Construct a first virtual point, a second virtual point, a third virtual point and a fourth virtual point through pixel point l and pixel points of horizontally adjacent and vertically adjacent pixels; The first high frequency value B, the second high frequency value C and the third high frequency value D are reconstructed by the first virtual point, the second virtual point, the third virtual point and the fourth virtual point; the expressions for calculating the first high frequency value B, the second high frequency value C and the third high frequency value D of the reconstruction are respectively: Where: a_w: first virtual point; b_w: second virtual point; c_w: third virtual point; d_w: fourth virtual point; The Haar wavelet matrix X' is obtained by the low frequency value A, the first high frequency value B, the second high frequency value C and the third high frequency value D. The expression of the Haar wavelet matrix X' is:
5. The method for ultra-high-definition image up-sampling and down-sampling based on Haar wavelet according to claim 4, characterized in that: The method of reconstructing the first high frequency value B, the second high frequency value C and the third high frequency value D through the first virtual point, the second virtual point, the third virtual point and the fourth virtual point also includes: calculating the first high frequency value B, the second high frequency value C and the third high frequency value D through the intensity factor λ; and calculating the expressions of the first high frequency value B, the second high frequency value C and the third high frequency value D respectively:
6. The method for ultra-high-definition image up-sampling and down-sampling based on Haar wavelet according to claim 4 or claim 5, characterized in that: The method of using an inverse Haar wavelet transform on the Haar wavelet matrix to obtain an upsampled reconstruction value includes: a=A+B+C+D b=2(A+B)-a=A+BCD c=2(A+C)-a=A-B+CD d=2(A+D)-a=AB-C+D.
7. A system for upsampling and downsampling ultra-high-definition images based on Haar wavelets, characterized in that: include: Acquisition module, downsampling module, Haar wavelet module, inverse wavelet transform module and restoration module; The acquisition module is used to acquire the original image to be processed; The downsampling module is used to perform average downsampling on the original image to obtain downsampled pixel values; The Haar wavelet module is used to obtain a Haar wavelet matrix according to the downsampled pixel values; The inverse wavelet transform module is used to perform inverse Haar wavelet transform on the Haar wavelet matrix to obtain up-sampled reconstruction values; The restoration module is used to restore the original image according to the upsampled reconstruction value to obtain an ultra-high-definition lossless image.
