Image noise reduction method and device
By performing block processing and fitting calculation on the image, the problem of poor retention of detailed information of the image noise reduction method in the prior art is solved, and a high-quality image noise reduction effect is achieved.
Patent Information
- Application Number
- CN202411608269.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, the image noise reduction method in the signal processing direction has poor retention of details, which can easily lead to image blur.
By chunking the image to be denoised, the initial pixel value of each block in each row and column is read, the fitting function is obtained, the row calibration pixel value and column calibration pixel value are calculated, and the target pixel value is finally calculated based on these values to obtain the noise-reduced image.
Effectively retain the detailed information of the noise-reducing image to avoid image blurring, and solve the problem of poor retention of detailed information in the prior art.
Smart Images

Figure CN119515720A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an image noise reduction method and device. Background Art
[0002] Current image denoising methods in the field of signal processing, such as smoothing images by calculating the average and median of pixels in a neighborhood, or convolving images with Gaussian kernels, have problems such as poor retention of detail information and easy image blur. Summary of the invention
[0003] In view of this, the embodiments of the present application provide an image denoising method, device, electronic device and computer-readable storage medium to solve the problem that the image denoising method in the signal processing direction in the prior art has poor detail information retention and easily causes image blur.
[0004] According to a first aspect of an embodiment of the present application, a method for image denoising is provided, comprising: obtaining an image to be denoised, and performing block processing on the image; reading the initial pixel value of each block in each row on the image, fitting the serial number and the initial pixel value of each block in each row, and obtaining a fitting function corresponding to the row; substituting the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; reading the initial pixel value of each block in each column on the image, fitting the serial number and the initial pixel value of each block in each column, and obtaining a fitting function corresponding to the column; substituting the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; calculating the target pixel value of each block according to the initial pixel value, the row calibration pixel value and the column calibration pixel value of each block, and obtaining a target image after image denoising.
[0005] According to a second aspect of an embodiment of the present application, an image denoising device is provided, comprising: an acquisition module configured to acquire an image to be denoised and perform block processing on the image; a first fitting module configured to read the initial pixel value of each block in each row on the image, fit the serial number and the initial pixel value of each block in each row, and obtain a fitting function corresponding to the row; a first calculation module configured to substitute the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; and a second fitting module configured to obtain a pixel value of each block in the row by substituting the serial number of each block in the row into the fitting function corresponding to the row. The first module is configured to read the initial pixel value of each block in each column on the image, fit the serial number and the initial pixel value of each block in each column, and obtain the fitting function corresponding to the column; the second calculation module is configured to substitute the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; the third calculation module is configured to calculate the target pixel value of each block according to the initial pixel value, row calibration pixel value and column calibration pixel value of each block to obtain the target image after image denoising.
[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0007] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects: acquiring an image to be denoised and performing block processing on the image; reading the initial pixel value of each block in each row on the image, fitting the serial number and initial pixel value of each block in each row, and obtaining a fitting function corresponding to the row; substituting the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; reading the initial pixel value of each block in each column on the image, fitting the serial number and initial pixel value of each block in each column, and obtaining a fitting function corresponding to the column; substituting the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; calculating the target pixel value of each block according to the initial pixel value, row calibration pixel value and column calibration pixel value of each block, and obtaining a target image after image denoising. The above-mentioned technical means can solve the problem that the image denoising method in the signal processing direction in the prior art has poor detail information retention and easily causes image blur, and then use the signal processing method to retain the detail information of the denoised image and avoid image blur. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 It is a flowchart of an image noise reduction method provided in an embodiment of the present application;
[0011] Figure 2 is a flow chart of another image noise reduction method provided in an embodiment of the present application;
[0012] Figure 3 is a structural schematic diagram of an image noise reduction device provided in an embodiment of the present application;
[0013] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0014] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0015] An image noise reduction method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0016] Figure 1 It is a flowchart of an image noise reduction method provided in an embodiment of the present application. Figure 1 The image noise reduction method can be executed by a computer or a server, or software on the computer or the server. Figure 1 As shown, the image denoising method comprises:
[0017] S101, obtaining an image to be denoised, and performing block processing on the image;
[0018] S102, reading the initial pixel value of each block in each row on the image, fitting the sequence number and the initial pixel value of each block in each row to obtain a fitting function corresponding to the row;
[0019] S103, substituting the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row;
[0020] S104, reading the initial pixel value of each block in each column on the image, fitting the sequence number and the initial pixel value of each block in each column to obtain a fitting function corresponding to the column;
[0021] S105, substituting the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column;
[0022] S106, calculating the target pixel value of each block according to the initial pixel value, the row calibration pixel value and the column calibration pixel value of each block, so as to obtain the target image after image noise reduction.
[0023] Block processing is to divide the image into a preset number of blocks. It is assumed that the image is divided into three rows and three columns with a total of nine blocks. The initial pixel values of the three blocks in the first row, the initial pixel values of the three blocks in the second row, and the initial pixel values of the three blocks in the third row are read on the image. The serial numbers and initial pixel values of each block in the first row, the second row, and the third row are fitted respectively to obtain the fitting function corresponding to each row. The serial numbers of the three blocks in the first row are respectively substituted into the fitting function corresponding to the first row to calculate the row calibration pixel value of each block in the first row. The calculation of the row calibration pixel value of each block in the second row and the third row is similar to the calculation of the row calibration pixel value of each block in the first row.
[0024] Read the initial pixel values of the three blocks in the first column, the initial pixel values of the three blocks in the second column, and the initial pixel values of the three blocks in the third column on the image. Perform column fitting on the serial numbers and initial pixel values of each block in the first column, the second column, and the third column, respectively, to obtain the fitting function corresponding to each column. Substitute the serial numbers of the three blocks in the first column into the fitting function corresponding to the first column, respectively, to calculate the column calibration pixel value of each block in the first column. Calculate the column calibration pixel value of each block in the second column and the third column, similar to calculating the column calibration pixel value of each block in the first column. Each block has three values: initial pixel value, row calibration pixel value, and column calibration pixel value. According to the initial pixel value, row calibration pixel value, and column calibration pixel value of each block, calculate the target pixel value of each block, and then obtain the target image after image denoising.
[0025] According to the technical solution provided in the embodiment of the present application, an image to be denoised is obtained, and the image is processed in blocks; the initial pixel value of each block in each row is read on the image, and the serial number and initial pixel value of each block in each row are fitted to obtain a fitting function corresponding to the row; the serial number of each block in each row is substituted into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; the initial pixel value of each block in each column is read on the image, and the serial number and initial pixel value of each block in each column are fitted to obtain a fitting function corresponding to the column; the serial number of each block in each column is substituted into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; the target pixel value of each block is calculated based on the initial pixel value, row calibration pixel value and column calibration pixel value of each block to obtain a target image after image denoising. The above-mentioned technical means can solve the problem that the image denoising method in the signal processing direction in the prior art has poor detail information retention and easily causes image blur, and then use the signal processing method to retain the detail information of the denoised image and avoid image blur.
[0026] In an optional embodiment: an image to be denoised is acquired, and the image is processed in blocks; for each block: an initial pixel value of each pixel point in each row is read on the block, and the serial number and the initial pixel value of each pixel point in the block are fitted to obtain a fitting function corresponding to the block; the serial number of each pixel point in the block is substituted into the fitting function corresponding to the block to calculate the row calibration pixel value of each pixel point in the block; an initial pixel value of each pixel point in each column is read on the block, and the serial number and the initial pixel value of each pixel point in the block are fitted to obtain a fitting function corresponding to the block; the serial number of each pixel point in the block is substituted into the fitting function corresponding to the block to calculate the column calibration pixel value of each pixel point in the block; a target pixel value of each pixel point in the block is calculated based on the initial pixel value, the row calibration pixel value and the column calibration pixel value of each pixel point in the block to obtain a target image after image denoising.
[0027] In an optional embodiment: when there is a lot of noise or in order to reduce the amount of calculation, a sub-block method can be used to calibrate pixels. For each block:
[0028] Process by row: read the initial pixel value of each pixel, divide the pixels of a row into several adjacent groups, calculate the pixel average value of each group, use the column number of the central pixel of each group as the serial number of the group, fit the serial number and pixel average value of each group in each row, and obtain the fitting function corresponding to the row; substitute the column number of each pixel in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each pixel in the row;
[0029] Process by column: read the initial pixel value of each pixel, divide the pixels in a column into several adjacent groups, calculate the pixel average value of each group, use the row number of the central pixel of each group as the group number, fit the group numbers and pixel average values of each group in each column, and obtain the fitting function corresponding to the column; substitute the column number of each pixel in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each pixel in the column.
[0030] Furthermore, the serial numbers and initial pixel values of each block in each row are fitted to obtain a fitting function corresponding to the row, including: for each row: taking the serial numbers of each block in the row as independent variables, taking the initial pixel values of each block in the row as dependent variables, performing linear fitting on the serial numbers and initial pixel values of each block in the row to obtain a fitting function corresponding to the row.
[0031] That is to say, the serial number of each block in the row is taken as the independent variable x, and the initial pixel value of each block in the row is taken as the dependent variable y. The serial number and initial pixel value of each block in the row are linearly fitted to obtain the linear fitting function corresponding to the row.
[0032] Furthermore, the serial numbers and initial pixel values of each block in each column are fitted to obtain a fitting function corresponding to the column, including: for each column: taking the serial numbers of each block in the column as independent variables, taking the initial pixel values of each block in the column as dependent variables, and performing linear fitting on the serial numbers and initial pixel values of each block in the column to obtain a fitting function corresponding to the column.
[0033] That is to say, the serial number of each block in the column is taken as the independent variable x, and the initial pixel value of each block in the column is taken as the dependent variable y. The serial number and initial pixel value of each block in the column are linearly fitted to obtain the linear fitting function corresponding to the column.
[0034] Furthermore, according to the initial pixel values, row calibration pixel values and column calibration pixel values of each block, the target pixel values of each block are calculated to obtain the target image after image denoising, including: determining the row noise variation range between rows and the column noise variation range between columns on the image; determining the target weight based on the row noise variation range and the column noise variation range; determining the reference value for image denoising based on the brightness value of a preset area of the image; and calculating the target pixel value of each block according to the reference value, the target weight and the initial pixel values, row calibration pixel values and column calibration pixel values of each block to obtain the target image after image denoising.
[0035] The noise amplitude value of each row can be calculated, and then the difference between the noise amplitude values of every two adjacent rows is calculated, and then the average value of all the differences is calculated as the row noise variation amplitude. The noise amplitude value of each column can be calculated, and then the difference between the noise amplitude values of every two adjacent columns is calculated, and then the average value of all the differences is calculated as the column noise variation amplitude. The ratio of the row noise variation amplitude to the column noise variation amplitude can be used as the target weight. The preset multiple of the brightness value of the area of the preset size at the center of the image can be used as the reference value for image noise reduction. The target pixel value of each block is calculated based on the reference value, the target weight, and the initial pixel value, row calibration pixel value, and column calibration pixel value of each block.
[0036] Furthermore, the target pixel value P of each block is calculated according to the following formula:
[0037] P = P1 + L - (v*P2 + b*P3);
[0038] Among them, P1, P2, and P3 are the initial pixel value, row calibration pixel value, and column calibration pixel value of the block respectively, v and b are the weight of the row calibration pixel value and the weight of the column calibration pixel value in the target weight, and L is the baseline value for image denoising.
[0039] Furthermore, the serial numbers and initial pixel values of each block in each row are fitted to obtain a fitting function corresponding to the row, including: determining the row noise variation amplitude between rows on the image; determining the highest order of the independent variable in the fitting function based on the row noise variation amplitude; fitting the serial numbers and initial pixel values of each block in each row the highest number of times to obtain a fitting function corresponding to the row.
[0040] In order to further improve the correct expression of the relationship between the serial number and the initial pixel value of each block by the fitting function, the highest number of different independent variables can be determined based on the different row noise change amplitudes. For example, if the highest number is 3, the serial number and initial pixel value of each block in each row are fitted with the highest number of times, and the fitting function corresponding to the row is a univariate cubic function.
[0041] In an optional embodiment, when the row noise change amplitude is less than the first amplitude, the maximum number of independent variables in the fitting function is determined to be once; when the row noise change amplitude is greater than or equal to the first amplitude but less than the second amplitude, the maximum number of independent variables in the fitting function is determined to be twice; when the row noise change amplitude is greater than or equal to the second amplitude but less than the third amplitude, the maximum number of independent variables in the fitting function is determined to be three times.
[0042] Furthermore, the serial numbers and initial pixel values of each block in each column are fitted to obtain a fitting function corresponding to the column, including: determining the column noise variation amplitude between the columns on the image; determining the highest order of the independent variable in the fitting function based on the column noise variation amplitude; fitting the serial numbers and initial pixel values of each block in each column the highest number of times to obtain a fitting function corresponding to the column.
[0043] In order to further improve the correct expression of the relationship between the serial number and the initial pixel value of each block by the fitting function, the highest number of different independent variables can be determined based on the different column noise change amplitudes. For example, if the highest number is 3, the serial number and initial pixel value of each block in each column are fitted with the highest number of columns, and the fitting function corresponding to the column is a univariate cubic function.
[0044] In an optional embodiment, when the column noise variation amplitude is less than the first amplitude, the maximum number of independent variables in the fitting function is determined to be one; when the column noise variation amplitude is greater than or equal to the first amplitude but less than the second amplitude, the maximum number of independent variables in the fitting function is determined to be two; when the column noise variation amplitude is greater than or equal to the second amplitude but less than the third amplitude, the maximum number of independent variables in the fitting function is determined to be three.
[0045] Figure 2 FIG. 1 is a flow chart of another image noise reduction method provided in an embodiment of the present application. Figure 2 As shown, the method includes:
[0046] S201, obtaining an image to be denoised, and performing block processing on the image;
[0047] S202, reading the initial pixel value of each block in each row on the image, and determining the row noise variation amplitude between rows on the image;
[0048] S203, determining the highest order of the independent variable in the fitting function based on the row noise variation amplitude;
[0049] S204, performing the highest number of fittings on the serial numbers and initial pixel values of each block in each row to obtain a fitting function corresponding to the row;
[0050] S205, substituting the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row;
[0051] S206, reading the initial pixel value of each block in each column on the image, and determining the column noise variation amplitude between the columns on the image;
[0052] S207, determining the highest order of the independent variable in the fitting function based on the column noise variation amplitude;
[0053] S208, performing the highest number of fits on the serial numbers and initial pixel values of each block in each column to obtain a fitting function corresponding to the column;
[0054] S209, substituting the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column;
[0055] S210, determining a target weight based on a row noise variation range and a column noise variation range;
[0056] S211, determining a reference value for image noise reduction based on a brightness value of a preset area of the image;
[0057] S212, calculating the target pixel value of each block according to the reference value, the target weight, and the initial pixel value, the row calibration pixel value, and the column calibration pixel value of each block to obtain a target image after image denoising.
[0058] According to the technical solution provided in the embodiment of the present application, an image to be denoised is obtained, and the image is processed in blocks; the initial pixel value of each block in each row is read on the image, and the serial number and initial pixel value of each block in each row are fitted to obtain a fitting function corresponding to the row; the serial number of each block in each row is substituted into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; the initial pixel value of each block in each column is read on the image, and the serial number and initial pixel value of each block in each column are fitted to obtain a fitting function corresponding to the column; the serial number of each block in each column is substituted into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; the target pixel value of each block is calculated based on the initial pixel value, row calibration pixel value and column calibration pixel value of each block to obtain a target image after image denoising. The above-mentioned technical means can solve the problem that the image denoising method in the signal processing direction in the prior art has poor detail information retention and easily causes image blur, and then use the signal processing method to retain the detail information of the denoised image and avoid image blur.
[0059] Before the image is divided into blocks, it is determined whether the image is a color image. If the image is a color image, the image is converted into a grayscale image.
[0060] In an alternative embodiment, the image data is read and, if it is a color image, is converted into a grayscale image;
[0061] The data of the grayscale image is as follows:
[0062]
[0063]
[0064] Divide the grayscale image into blocks P1, P2, ... According to the distribution characteristics of the background noise, determine the size of the block to ensure that the noise change of each block is smooth. The following figure is an example of dividing an image into 9 blocks, where each grid represents a block.
[0065] P1 P2 P3 P4 P5 P6 P7 P8 P9
[0066] For each file, calibration parameters are obtained in horizontal and vertical directions respectively;
[0067] Take image block P1 as an example, where each grid represents a pixel in P1.
[0068] …… …… …… …… …… P1(i,1) P1(i,2) P1(i,3) …… P1(i,N) …… …… …… …… …… …… …… …… …… ……
[0069] Each small piece of image is a small piece of data:
[0070] Column 1 Column 2 Column j Row 1 P1(1,1) P1(1,2) … P1(1,i) … P1(1,N) 185 189 … 187 … … i-th row P1(i,1) P1(i,2) … P1(i,j) … P1(i,N) 176 179 … 179 … … 179 182 … 180 … …
[0071] Taking the initial pixel value of each block in reading as an example, the calculation method of calibration parameters is:
[0072] Read a row of data, for example, the image data of the i-th row:
[0073] Y=[P1(i,1),P1(i,2),P1(i,3),…,P1(i,N)]
[0074] Because when doing least squares fitting, you need to specify the data on the x-axis and the y-axis.
[0075] Assuming that the image data is very stable and the amount of computation is not limited, the data on the x-axis can be taken as columns, X = [1, 2, …j, …N].
[0076] Y is the value of each pixel, Y = [P1(i,1), P1(i,2), P(i,3),…, P1(i,N)].
[0077] If there are many subtle noises in the original data, you can take the average of a group of adjacent data (several pixels) and assign the average value to Y.
[0078] Y=[P1(1),P1(2),P(3),……,P1(N)], where each point is the average of an adjacent group;
[0079] X=[1,2,…j,…N], where j is the label of the group.
[0080] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0081] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0082] Figure 3 Schematic diagram of an image noise reduction device provided in an embodiment of the present application. Figure 3 As shown, the image noise reduction device comprises:
[0083] The acquisition module 301 is configured to acquire the image to be denoised and perform block processing on the image;
[0084] The first fitting module 302 is configured to read the initial pixel value of each block in each row on the image, and fit the sequence number and the initial pixel value of each block in each row to obtain a fitting function corresponding to the row;
[0085] A first calculation module 303 is configured to substitute the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row;
[0086] The second fitting module 304 is configured to read the initial pixel value of each block in each column on the image, and fit the sequence number and the initial pixel value of each block in each column to obtain a fitting function corresponding to the column;
[0087] The second calculation module 305 is configured to substitute the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column;
[0088] The third calculation module 306 is configured to calculate the target pixel value of each block according to the initial pixel value, the row calibration pixel value and the column calibration pixel value of each block to obtain the target image after image noise reduction.
[0089] According to the technical solution provided in the embodiment of the present application, an image to be denoised is obtained, and the image is processed in blocks; the initial pixel value of each block in each row is read on the image, and the serial number and initial pixel value of each block in each row are fitted to obtain a fitting function corresponding to the row; the serial number of each block in each row is substituted into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; the initial pixel value of each block in each column is read on the image, and the serial number and initial pixel value of each block in each column are fitted to obtain a fitting function corresponding to the column; the serial number of each block in each column is substituted into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; the target pixel value of each block is calculated based on the initial pixel value, row calibration pixel value and column calibration pixel value of each block to obtain a target image after image denoising. The above-mentioned technical means can solve the problem that the image denoising method in the signal processing direction in the prior art has poor detail information retention and easily causes image blur, and then use the signal processing method to retain the detail information of the denoised image and avoid image blur.
[0090] In some embodiments, the first fitting module 302 is also configured to, for each row: use the serial numbers of each block in the row as independent variables, the initial pixel values of each block in the row as dependent variables, perform linear fitting on the serial numbers and initial pixel values of each block in the row, and obtain the fitting function corresponding to the row.
[0091] In some embodiments, the second fitting module 304 is also configured to, for each column: use the serial numbers of each block in the column as independent variables, the initial pixel values of each block in the column as dependent variables, perform linear fitting on the serial numbers and initial pixel values of each block in the column, and obtain a fitting function corresponding to the column.
[0092] In some embodiments, the third calculation module 306 is further configured to determine the row noise variation amplitude between rows and the column noise variation amplitude between columns on the image; determine the target weight based on the row noise variation amplitude and the column noise variation amplitude; determine the reference value for image noise reduction based on the brightness value of a preset area of the image; calculate the target pixel value of each block based on the reference value, the target weight, and the initial pixel value, the row calibration pixel value, and the column calibration pixel value of each block to obtain a target image after image noise reduction.
[0093] In some embodiments, the third calculation module 306 is further configured to calculate the target pixel value P of each block according to the following formula:
[0094] P = P1 + L - (v*P2 + b*P3);
[0095] Among them, P1, P2, and P3 are the initial pixel value, row calibration pixel value, and column calibration pixel value of the block respectively, v and b are the weight of the row calibration pixel value and the weight of the column calibration pixel value in the target weight, and L is the baseline value for image denoising.
[0096] In some embodiments, the first fitting module 302 is further configured to determine the row noise variation amplitude between rows on the image; determine the highest order of the independent variable in the fitting function based on the row noise variation amplitude; and perform the highest number of fittings on the serial numbers and initial pixel values of each block in each row to obtain the fitting function corresponding to the row.
[0097] In some embodiments, the second fitting module 304 is further configured to, when the row noise variation amplitude is less than the first amplitude, determine the maximum number of independent variables in the fitting function to be one; when the row noise variation amplitude is greater than or equal to the first amplitude but less than the second amplitude, determine the maximum number of independent variables in the fitting function to be two; when the row noise variation amplitude is greater than or equal to the second amplitude but less than the third amplitude, determine the maximum number of independent variables in the fitting function to be three.
[0098] In some embodiments, the second fitting module 304 is further configured to determine the column noise variation amplitude between columns on the image; determine the highest order of the independent variable in the fitting function based on the column noise variation amplitude; and perform the highest number of fittings on the serial numbers and initial pixel values of each block in each column to obtain the fitting function corresponding to the column.
[0099] In some embodiments, the second fitting module 304 is further configured to, when the column noise variation amplitude is less than the first amplitude, determine the maximum number of independent variables in the fitting function to be one; when the column noise variation amplitude is greater than or equal to the first amplitude but less than the second amplitude, determine the maximum number of independent variables in the fitting function to be two; when the column noise variation amplitude is greater than or equal to the second amplitude but less than the third amplitude, determine the maximum number of independent variables in the fitting function to be three.
[0100] In some embodiments, the third computing module 306 is further configured to obtain an image to be denoised and perform block processing on the image; read the initial pixel value of each block in each row on the image, and determine the row noise variation range between rows on the image; determine the highest order of independent variables in the fitting function based on the row noise variation range; perform the highest number of fittings on the serial number and initial pixel value of each block in each row to obtain the fitting function corresponding to the row; substitute the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; read the initial pixel value of each block in each column on the image, and determine the column noise variation range between columns on the image; The invention relates to a method for reducing noise of an image by a plurality of pixels of a pixel, wherein the pixel values of the pixel blocks in the image are adjusted by a plurality of pixels of a plurality of pixels. The method comprises the following steps: first, determining a noise reduction amplitude of the image and determining a maximum number of times of the independent variable in the fitting function based on the column noise variation amplitude; performing a maximum number of fitting on the serial number and the initial pixel value of each block in each column to obtain a fitting function corresponding to the column; substituting the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; determining a target weight based on the row noise variation amplitude and the column noise variation amplitude; determining a reference value for image denoising based on a brightness value of a preset area of the image; and calculating a target pixel value of each block according to the reference value, the target weight, and the initial pixel value, the row calibration pixel value, and the column calibration pixel value of each block to obtain a target image after image denoising.
[0101] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0102] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0103] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.
[0104] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0105] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.
[0106] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0107] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0108] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical feature diagrams therein. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An image denoising method, characterized in that: include: Acquire an image to be denoised, and perform block processing on the image; Reading the initial pixel value of each block in each row on the image, fitting the serial number and the initial pixel value of each block in each row to obtain a fitting function corresponding to the row; Substitute the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; Reading the initial pixel value of each block in each column on the image, fitting the serial number and the initial pixel value of each block in each column to obtain a fitting function corresponding to the column; Substitute the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; According to the initial pixel value, the row calibration pixel value and the column calibration pixel value of each block, the target pixel value of each block is calculated to obtain the target image after the image noise reduction.
2. The method according to claim 1, characterized in that Fit the serial number and initial pixel value of each block in each row to obtain the fitting function corresponding to the row, including: For each row: The serial numbers of each block in the row are taken as independent variables, the initial pixel values of each block in the row are taken as dependent variables, and linear fitting is performed on the serial numbers and initial pixel values of each block in the row to obtain the fitting function corresponding to the row.
3. The method according to claim 1, characterized in that Fit the serial number and initial pixel value of each block in each column to obtain the fitting function corresponding to the column, including: For each column: The serial number of each block in the column is taken as the independent variable, the initial pixel value of each block in the column is taken as the dependent variable, and the serial number and initial pixel value of each block in the column are linearly fitted to obtain the fitting function corresponding to the column.
4. The method according to claim 1, characterized in that: Calculating target pixel values of each block according to the initial pixel values, row calibration pixel values, and column calibration pixel values of each block to obtain the target image after the image denoising, including: Determining the row noise variation between rows and the column noise variation between columns on the image; Determining a target weight based on the row noise variation amplitude and the column noise variation amplitude; Determining a reference value for noise reduction of the image based on a brightness value of a preset area of the image; The target pixel value of each block is calculated according to the reference value, the target weight, and the initial pixel value, row calibration pixel value, and column calibration pixel value of each block to obtain the target image after the image denoising.
5. The method according to claim 4, characterized in that The target pixel value P of each block is calculated according to the following formula: P = P1 + L - (v*P2 + b*P3); Among them, P1, P2, and P3 are the initial pixel value, row calibration pixel value, and column calibration pixel value of the block respectively, v and b are the weights of the row calibration pixel value and the column calibration pixel value in the target weight, and L is the baseline value for image denoising.
6. The method according to claim 1, characterized in that Fit the serial number and initial pixel value of each block in each row to obtain the fitting function corresponding to the row, including: Determining a row noise variation amplitude between rows on the image; Determining the highest order of the independent variable in the fitting function based on the row noise variation amplitude; The highest number of fits is performed on the serial numbers and initial pixel values of each block in each row to obtain a fitting function corresponding to the row.
7. The method according to claim 1, characterized in that Fit the serial number and initial pixel value of each block in each column to obtain the fitting function corresponding to the column, including: determining, on the image, a column noise variation magnitude between columns; Determining the highest order of the independent variable in the fitting function based on the magnitude of the column noise variation; The highest number of fittings is performed on the serial numbers and initial pixel values of each block in each column to obtain a fitting function corresponding to the column.
8. An image noise reduction device, characterized in that: include: An acquisition module is configured to acquire an image to be denoised and perform block processing on the image; A first fitting module is configured to read the initial pixel value of each block in each row on the image, and fit the sequence number and the initial pixel value of each block in each row to obtain a fitting function corresponding to the row; A first calculation module is configured to substitute the serial number of each block in each row into the fitting function corresponding to the row to calculate the row calibration pixel value of each block in the row; A second fitting module is configured to read the initial pixel value of each block in each column on the image, and fit the sequence number and the initial pixel value of each block in each column to obtain a fitting function corresponding to the column; A second calculation module is configured to substitute the serial number of each block in each column into the fitting function corresponding to the column to calculate the column calibration pixel value of each block in the column; The third calculation module is configured to calculate the target pixel value of each block according to the initial pixel value, row calibration pixel value and column calibration pixel value of each block to obtain the target image after the image noise reduction.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.