WO2023005818A1 - Noise image generation method and apparatus, electronic device, and storage medium - Google Patents

Noise image generation method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023005818A1
WO2023005818A1 PCT/CN2022/107258 CN2022107258W WO2023005818A1 WO 2023005818 A1 WO2023005818 A1 WO 2023005818A1 CN 2022107258 W CN2022107258 W CN 2022107258W WO 2023005818 A1 WO2023005818 A1 WO 2023005818A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
noise
target
images
network
Prior art date
Application number
PCT/CN2022/107258
Other languages
French (fr)
Chinese (zh)
Inventor
郭桦
Original Assignee
维沃移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2023005818A1 publication Critical patent/WO2023005818A1/en

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application belongs to the technical field of image processing, and in particular relates to a noise image generation method, device, electronic equipment and storage medium.
  • the noise in the noise image usually uses random noise, so that the noise image obtained by noise synthesis cannot reflect the image sensor in the real electronic device, and the noise generated during the image capture process, Therefore, the synthesized noise image is not realistic enough, thereby reducing the accuracy of the subsequent image denoising model training process.
  • the purpose of the embodiments of the present application is to provide a noise image generation method, device, electronic equipment, and storage medium, which can solve the problem that the synthesized noise image in the prior art is not realistic enough, thereby reducing the accuracy of the subsequent image noise reduction model training process question.
  • the embodiment of the present application provides a noise image generation method, the method comprising:
  • the first image is a noise-free image
  • the second image is a noisy image collected using a target image sensor
  • the noise distribution of the third image is adjusted according to the second image to obtain a noise image corresponding to the first image.
  • the embodiment of the present application provides a noise image generation device, the device includes:
  • An acquisition module configured to acquire a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
  • a determining module configured to determine a noise index value corresponding to the target image sensor
  • a noise adding module for adding noise to the first image according to the noise index value, to obtain the third image
  • the adjustment module is configured to adjust the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image.
  • an embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor, and the program or instruction is The processor implements the steps of the method described in the first aspect when executed.
  • an embodiment of the present application provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented .
  • the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect The steps of the method.
  • the third image is obtained by acquiring a noise-free first image and a noisy second image collected by the target image sensor, and then adding noise to the first image according to the noise index value corresponding to the target image sensor , and then adjust the noise distribution of the third image according to the second image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and using the target image sensor
  • the collected real noise image that is, the second image, is used to optimize the third image. Therefore, the final noise image can be more pertinent to the target image sensor, and the noise in the generated noise image is also closer to The noise of the image actually collected by the target image sensor can improve the accuracy of the subsequent training process of the image noise reduction model for the target sensor.
  • Fig. 1 is one of the flowcharts of a noise image generation method shown according to an exemplary embodiment
  • Fig. 2 is a workflow diagram of an optimized discriminant network shown according to an exemplary embodiment
  • Fig. 3 is the second flowchart of a method for generating a noise image according to an exemplary embodiment
  • Fig. 4 is the third flowchart of a method for generating a noise image according to an exemplary embodiment
  • Fig. 5 is a structural block diagram of a device for generating noise images according to an exemplary embodiment
  • Fig. 6 is a structural block diagram of an electronic device according to an exemplary embodiment
  • FIG. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • ISO International Standardization Organization
  • the present application provides a noise image generation method, which can be applied to the scene of constructing noise images.
  • the noise image generation method provided in the embodiment of the present application may be executed by a noise image generation device, or a control module used for the noise image generation method in the noise image generation device.
  • the noise image generating method performed by the noise image generating device is taken as an example to illustrate the noise image generating method provided in the embodiment of the present application.
  • Fig. 1 is a flow chart showing a method for generating a noise image according to an exemplary embodiment.
  • the method for generating a noise image may include steps 110 to 140, specifically as follows.
  • Step 110 acquiring the first image and the second image.
  • the first image may be a noise-free image, for example, a high-definition color (Red, Green, Blue, RGB) image.
  • the second image may be a noisy image collected using the target image sensor in the target electronic device, where the target image sensor may be a type of sensor that is referred to when generating a noise image in the embodiment of the present application, or may be a sensor using the noise This second image can be used to optimize the initial noisy image for the type of sensor the denoising model is trained on.
  • Both the first image and the second image can be obtained from a public dataset or a dataset captured by a target image sensor. During the acquisition process, the data can also be cleaned, and a large number of clear RGB images can be retained as the first image.
  • Step 120 determining a noise index value corresponding to the target image sensor.
  • RAW Raster Image Format
  • Step 130 adding noise to the first image according to the noise index value to obtain a third image.
  • the third image can be an initial noise image.
  • noise can be added to the RAW image corresponding to the first image.
  • the pixel value x of each pixel in the RAW image can be input
  • the output is the noise index value that needs to be added for each pixel, so as to obtain the third image, that is, the initial noise image.
  • Step 140 adjusting the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image.
  • the noise image corresponding to the first image may be a noise image closer to an actual scene, and the noise image may be used for training a noise reduction model.
  • the noise distribution of the second image can be determined first, and then the noise distribution of the third image can be adjusted according to the noise distribution of the second image, so that the noise distribution of the finally obtained noise image is the same or similar to that of the second image, thereby achieving better The purpose of being close to the noise characteristics of the actual image.
  • the neural network model in order to further improve the authenticity of the generated noise image, can be used to learn the noise distribution of the second image, and then the neural network model can be used to adjust the noise distribution of the third image to achieve The optimization process of the third image.
  • the above-mentioned third image can be optimized using an optimized discriminant network, and the function of the optimized discriminant network can be to perform domain confrontation generation between the third image and the second image, so that the noise distribution of the third image and the second image Keep as consistent as possible or similarity greater than a preset threshold in order to improve the authenticity of the generated noisy image.
  • step 140 may specifically include:
  • the feature information output by the Pth convolutional layer is input to the consecutive P deconvolutional layers in the first network, and a noise image corresponding to the first image is outputted.
  • the first network can be trained according to the second image
  • P can be a positive integer, P ⁇ 2
  • P convolution layers and P deconvolution layers can be in one-to-one correspondence
  • the input information of the first deconvolution layer can be
  • the first convolution layer can be any convolution layer in the P convolution layers
  • the first deconvolution The convolution layer may be a deconvolution layer corresponding to the first convolution layer among the P deconvolution layers, and the first deconvolution layer may be the next deconvolution layer of the second deconvolution layer.
  • the output is the optimized third image, that is, the noise image corresponding to the first image, where TransFeature tn represents the feature vector output by the deconvolution layer, w is the weight, and is connected to the previous deconvolution through a skip structure
  • the feature vector output by the convolution layer and the feature vector output by the convolution layer corresponding to the previous deconvolution layer can fully retain the detailed information of the image.
  • the workflow of the optimized network can be shown in FIG. 2
  • the optimized network 220 can include an input convolution layer 221, four convolution modules 2221-2224, and four deconvolution modules 2231 - 2234, output deconvolutional layer 222 and 4 skip connections 22311-22341.
  • the input convolution layer 221 corresponds to the output deconvolution layer 222
  • the first convolution module 2221 corresponds to the fourth deconvolution module 2234
  • the second convolution module 2222 corresponds to the third deconvolution module 2233
  • the third convolution module 2223 corresponds to the second deconvolution module 2232
  • the fourth convolution module 2224 corresponds to the first deconvolution module 2231 .
  • the first convolution layer is the input convolution layer 221, then the first deconvolution layer is the output deconvolution layer 222, and the second deconvolution layer is the fourth deconvolution module 2234; if the first convolution The stacked layer is the first convolution module 2221, the first deconvolution layer is the fourth deconvolution module 2234, the second deconvolution layer is the third deconvolution module 2233, and so on, and will not be repeated here .
  • the synthetic domain image 210 is input to four consecutive convolutional layers in the optimization network 220 through the input convolutional layer 221, and four feature information output by the four convolutional layers are obtained, specifically Yes, the first feature vector is obtained through the first convolution module 2221, the second feature vector is obtained through the second convolution module 2222, the third feature vector is obtained through the third convolution module 2223, and the fourth convolution module is obtained 2224, get the fourth eigenvector.
  • Input the first feature information to four consecutive deconvolution layers in the optimization network 220 to obtain the noise image 230 specifically, pass the fourth feature vector and the fifth feature vector obtained through the first deconvolution module 2231 through the first
  • a skip structure 22311 is connected, it is input to the second deconvolution module 2232 to obtain the sixth feature vector, and after the third feature vector and the sixth feature vector are connected through the second skip structure 22321, they are input to the third deconvolution module 2233, obtain the seventh eigenvector, connect the second eigenvector and the seventh eigenvector through the third skip structure 22331, input it to the fourth deconvolution module 2234, obtain the eighth eigenvector, and combine the first eigenvector and the first eigenvector After the eight feature vectors are connected through the fourth skip structure 22341 , they are input to the output deconvolution layer 222 to obtain the noise image 230 .
  • the third image can be optimized to obtain a noise image that is closer to the actual scene than the third image, and to improve the generated noise image. authenticity.
  • noise may be respectively added to the first image according to the multiple noise index values to obtain multiple third images, for example, M third images.
  • step 140 when the number of third images is M, step 140 may specifically include:
  • the target image may be any image in the M third images, M may be a positive integer, and M ⁇ 2.
  • the sixth image may be an image obtained after the target image is optimized through the first network.
  • the M noise images corresponding to the first image may be noise images closer to real noise distribution than the target image.
  • the first network and the second network can form a generative confrontation network.
  • the second image may be an image randomly selected from multiple RGB images with different brightnesses captured by the target image sensor, and the second image may be randomly selected multiple times during the training process.
  • the above-mentioned optimized discriminant network may be a two-stage network model, wherein the first-stage network may be an optimized network, that is, the first network; the second-stage network may be a discriminant network, that is, the second network.
  • the first network can be used to optimize the target image to generate a noise image closer to the real noise distribution, and the second network can be used to determine the difference between the first noise distribution feature corresponding to the sixth image and the second noise distribution feature corresponding to the second image. similarity value between them.
  • the first network can be trained, and when the similarity value is less than the preset threshold, the network parameters of the first network can be adjusted until the first network converges to obtain a trained first network.
  • the first network can be used to generate a noisy image that is more suitable for the actual scene.
  • the sixth image output by the optimized network still belongs to the synthetic domain image, and its noise probability distribution can be expressed by Px; the noise probability distribution of the real domain image, that is, the second image, can be expressed by Py.
  • the probability value is closer to 1
  • the discriminant network can be set in the discriminant network that when the probability value is lower than 0.5, it is considered that there is a large gap between the noise distribution between the sixth image and the second image, and the probability value is fed back to the optimization network in the first stage, and the optimization network is
  • the weight coefficients (weights) in the network will be adjusted to regenerate the optimized sixth image, and then the regenerated sixth image will be input into the discriminant network for similarity discrimination between the second image and the sixth image.
  • the workflow of the discriminant network that is, the second network, can be shown in FIG. 2.
  • the synthetic domain image 210 that is, the target image
  • the optimization network 220 the initial noise image 230 is obtained as an output. That is the sixth image.
  • the first noise distribution feature 2301 corresponding to the noise image 230 and the second noise distribution feature 2501 corresponding to the real domain image 250, that is, the second image are obtained through the continuous convolution layer 241 in the discriminant network 240, and the first The noise distribution feature 2301 and the second noise distribution feature 2501 are input to the continuous three-layer fully connected layer 242 in the discriminant network 240, and the output is to obtain the similarity value between the first noise distribution feature 2301 and the second noise distribution feature 2501, and according to The similarity is used to train the optimization network 220 to obtain a trained optimization network, so as to generate noise images that are more suitable for actual scenes.
  • the second network is used to judge the similarity between the sixth image and the second image, and then adjust the network parameters of the first network according to the result of the judgment, so that the first network can be It has the ability to optimize the image noise distribution, further improving the authenticity of the noise image generated after the first network optimization.
  • the noise image generation method may also include:
  • step 130 may include:
  • the original image file may be a RAW image.
  • the noise distribution in the RGB image is complex and difficult to deal with. In order to better handle the noise distribution, noise can be added to the RAW image.
  • a high-definition RGB image can be acquired, and then the first image is converted from the RGB image to a RAW image through an inverse image signal processing (Image Signal Processing, ISP) operation.
  • ISP Image Signal Processing
  • the RAW image can be obtained by methods such as inverse tone mapping, inverse gamma correction, and inversion of digital gain.
  • the ISP may include processes such as black level compensation, color interpolation (demosaicing), denoising, automatic white balance, and color correction.
  • inverse tone mapping is a technology used to convert a standard dynamic range (Standard Dynamic Range, SDR) source signal into a high dynamic range (High Dynamic Range, HDR) source signal, which can be applied to production or terminal equipment.
  • SDR Standard Dynamic Range
  • HDR High Dynamic Range
  • Gamma anti-correction can be a method of editing the gamma curve of the image to perform nonlinear tone editing on the image, and can detect Gamma correction is the reverse operation of gamma correction.
  • adding noise to the first image according to the noise index value may be adding noise to the RAW image, that is, the original image file, according to the noise index value.
  • the third image thus obtained may also be a RAW image, that is, an original image file. Therefore, before adjusting the noise distribution of the third image, the third image may also be converted from the original image file to an RGB image.
  • the RAW image can better reflect the noise distribution
  • the effect of noise addition can be better, and it is convenient to extract the noise distribution characteristics of the image .
  • the third image is obtained, and then according to the second
  • the second image adjusts the noise distribution of the third image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and the real noise collected by the target image sensor is used image, that is, the second image, to optimize the third image, so that the final noise image can be more pertinent to the target image sensor, and the noise in the generated noise image is also closer to the target image sensor
  • the noise of the actually collected image can improve the accuracy of the subsequent training process of the image noise reduction model for the target sensor.
  • step 120 may specifically include: steps 1201-1202, wherein:
  • Step 1201 determine a target Poisson noise index value and a target Gaussian noise index value corresponding to the target image sensor.
  • A can be the target Poisson noise index value corresponding to the target image sensor
  • B can be the target Gaussian noise index value corresponding to the target image sensor
  • x can be the first The pixel value of each pixel in the image.
  • the noise index value noiseVariance of the target image sensor corresponding to each pixel can be determined.
  • step 1201 may specifically include:
  • N photosensitivity and N Poisson noise index values corresponding to the N fourth images determine a first mapping relationship between the Poisson noise index value and the photosensitivity
  • M Poisson noise index values corresponding to the M target sensitivities are determined as target Poisson noise index values corresponding to the target image sensor.
  • the fourth image may be an image of a standard color card collected at different sensitivities by using the target image sensor, N may be a positive integer, and N ⁇ 2.
  • the M target sensitivities may be M sensitivities determined from the corresponding sensitivity range of the target image sensor, M may be a positive integer, and M ⁇ 2.
  • different shooting devices have different ISO segments.
  • the ISO value can be randomly selected or equally spaced within the ISO segment corresponding to the target image sensor.
  • Select ISO can be calculated from the analog gain and digital gain set by the target image sensor.
  • a plurality of target Poisson noise index values can be obtained, thereby generating a plurality of third images that can basically cover the sensitivity range corresponding to the target image sensor , so that multiple noise images corresponding to the first image are finally obtained, which can fully simulate the noise environment of the target image sensor with respect to Poisson noise in different scenarios.
  • step 1201 may specifically include:
  • M Gaussian noise index values corresponding to the M target sensitivities are determined as target Gaussian noise index values corresponding to the target image sensor.
  • the fifth image may be an image collected at different sensitivities using the target image sensor, the image may be a black image, K may be a positive integer, and K ⁇ 2.
  • the fifth image may be acquired by using the target image sensor to capture a black image, or may be obtained by capturing an image while blocking a lens of the target image sensor.
  • 20 all-black images can be taken under different ISO conditions, and the variance value of the pixels contained in each image in the 20 all-black images can be calculated, and the 20 variance values can be compared with the 20 all-black images
  • 10 Gaussian noise index values corresponding to 10 target sensitivities can be determined as the 10 Gaussian noise index values B corresponding to the target image sensor.
  • a plurality of target Gaussian noise index values can be obtained, thereby generating a plurality of third images that can basically cover the sensitivity range corresponding to the target image sensor, so that Finally, multiple noise images corresponding to the first image are obtained, which can fully simulate the noise environment of the target image sensor with respect to Gaussian noise in different scenes.
  • Step 1202 according to the target Poisson noise index value and the target Gaussian noise index value, calculate the noise index value corresponding to the target image sensor.
  • the noise of the Gaussian distribution and the noise of the Poisson distribution can be synthesized at the same time, making the noise distribution more diverse and further improving the authenticity of the noise image.
  • the method for generating a noise image may include steps 410-450, which will be explained in detail below.
  • Step 410 acquiring the first image and the second image.
  • a high-definition RGB image that is, the first image
  • a noisy RGB image obtained by using the target image sensor that is, the second image
  • Step 420 converting the first image into a RAW image.
  • the noise distribution in the RGB image is complex and difficult to deal with, so noise can be added on the basis of the RAW image, but it is difficult to obtain a high-definition RAW image, so you can first obtain the RGB image, and then convert the RGB image to RAW image, the specific conversion method will not be repeated here.
  • Step 430 perform noise index calibration on the sensor.
  • noiseVariance Ax+B
  • a and B are the noise index values to be calibrated
  • A can be the target Poisson noise index value
  • B can be the target Gaussian noise index value
  • x can be the RAW image
  • the pixel value of each pixel, noiseVariance may be a noise variance value corresponding to each pixel for the target image sensor, that is, a noise index value. The specific calibration process will not be repeated here.
  • Step 440 generating a third image based on the RAW image.
  • Step 450 input the third image and the second image into the optimization discriminant network.
  • the initial noise image that is, the third image
  • the second image are input into the optimization discriminant network for multiple optimization and discrimination, and a noise image closer to the actual scene can be obtained.
  • the first image and one or more noise images output by the optimized discriminant network can be used to form a noise-noise-free sample image pair for training an image denoising model corresponding to the target image sensor.
  • the third image is obtained, and then according to the second
  • the second image adjusts the noise distribution of the third image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and the real noise collected by the target image sensor is used image, that is, the second image, to optimize the third image, so that the final noise image can be more pertinent to the target image sensor, and the noise in the generated noise image is also closer to the target image sensor
  • the noise of the actually collected image can improve the accuracy of the subsequent training process of the image noise reduction model for the target sensor.
  • the present application also provides a noise image generation device.
  • the device for generating a noise image provided by the embodiment of the present application will be described in detail below with reference to FIG. 5 .
  • Fig. 5 is a structural block diagram of an apparatus for generating a noise image according to an exemplary embodiment.
  • the noise image generation device 500 may include:
  • An acquisition module 501 configured to acquire a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
  • a determining module 502 configured to determine a noise index value corresponding to the target image sensor
  • the adjusting module 504 is configured to adjust the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image.
  • the above noise image generation device 500 will be described in detail below, specifically as follows:
  • the determining module 502 may include:
  • a determination sub-module is used to determine a target Poisson noise index value and a target Gaussian noise index value corresponding to the target image sensor;
  • the calculation sub-module is used to calculate the noise index value corresponding to the target image sensor according to the target Poisson noise index value and the target Gaussian noise index value.
  • the determining submodule may include:
  • the first acquisition unit is configured to acquire N fourth images; wherein, the fourth image is an image of a standard color card collected at different sensitivities using the target image sensor, N is a positive integer, and N ⁇ 2;
  • the first calculation unit is configured to traverse the N fourth images, and respectively calculate the first pixel average value and the first pixel variance value of the pixels contained in each fourth image;
  • the second calculation unit is used to divide the first pixel variance value by the first pixel average value to obtain the Poisson noise index value corresponding to each fourth image;
  • the first relationship determination unit is configured to determine a first mapping relationship between the Poisson noise index value and the sensitivity according to the N sensitivities corresponding to the N fourth images and the N Poisson noise index values;
  • the first index determination unit is configured to determine M Poisson noise index values corresponding to M target sensitivities according to the first mapping relationship as target Poisson noise index values corresponding to the target image sensor; wherein, the M targets
  • the photosensitivity is M photosensitivity determined from the photosensitivity range corresponding to the target image sensor, M is a positive integer, and M ⁇ 2.
  • the determining submodule may also include:
  • the second acquiring unit is used to acquire K fifth images; wherein, the fifth images are images acquired by using the target image sensor at different sensitivities, K is a positive integer, and K ⁇ 2;
  • the third calculation unit is used to traverse the K fifth images, respectively calculate the second pixel variance values of the pixels contained in each fifth image, and use the second pixel variance values corresponding to the K fifth images respectively K Gaussian noise index values corresponding to the K fifth images;
  • the second relationship determination unit is configured to determine a second mapping relationship between the Gaussian noise index value and the sensitivity according to K sensitivities and K Gaussian noise index values corresponding to the K fifth images;
  • the second index determining unit is configured to determine M Gaussian noise index values corresponding to the M target sensitivities according to the second mapping relationship as target Gaussian noise index values corresponding to the target image sensor.
  • the adjustment module 504 includes:
  • the image input sub-module is used to input the target image to consecutive P convolutional layers to obtain P feature information output by the P convolutional layers;
  • the feature input submodule is used to input the feature information output by the Pth convolutional layer to the continuous P deconvolutional layers, and output the sixth image;
  • P is a positive integer, P ⁇ 2
  • P convolutional layers correspond to P deconvolutional layers one by one
  • the input information of the first deconvolutional layer is the first feature information and the first feature information output by the first convolutional layer.
  • the second feature information output by the two deconvolution layers, the first convolution layer is any convolution layer in the P convolution layers, and the first deconvolution layer is the P deconvolution layer and the first convolution layer
  • the deconvolution layer corresponding to the layer, the first deconvolution layer is the next deconvolution layer of the second deconvolution layer.
  • the adjustment module 504 may further include:
  • the target image processing sub-module is used to input the target image to the first network before inputting the third image to the P consecutive convolutional layers in the first network to obtain the P feature information output by the P convolutional layers,
  • the sixth image is outputted; wherein, the target image is any image in the M third images;
  • An acquisition submodule configured to acquire a first noise distribution feature corresponding to the sixth image, and a second noise distribution feature corresponding to the second image;
  • the feature processing sub-module is used to input the first noise distribution feature and the second noise distribution feature to the second network, and output the similarity value between the first noise distribution feature and the second noise distribution feature;
  • the adjustment sub-module is used to adjust the network parameters of the first network according to the similarity value and its corresponding loss value when the similarity value is less than the preset threshold value until the first network converges to obtain the trained first network .
  • the first image is a noise-free RGB image
  • the noise image generation device 500 may also include:
  • a conversion module 505 configured to convert the first image from an RGB image to an original image file before adding noise to the first image according to the noise index value to obtain a third image
  • Noise adding module 503 may include:
  • the noise adding submodule is used to add noise to the original image file according to the noise index value to obtain the third image
  • the conversion sub-module is used to convert the third image from the original image file to an RGB image.
  • the third image is obtained, and then according to the second
  • the second image adjusts the noise distribution of the third image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and the real noise collected by the target image sensor is used image, that is, the second image, to optimize the third image, so that the final noise image can be more pertinent to the target image sensor, and the noise in the generated noise image is also closer to the target image sensor
  • the noise of the actually collected image can improve the accuracy of the subsequent training process of the image noise reduction model for the target sensor.
  • the apparatus for generating a noise image in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant).
  • non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
  • Network Attached Storage NAS
  • personal computer personal computer, PC
  • television television
  • teller machine or self-service machine etc.
  • the noise image generation device in the embodiment of the present application may be a device with an operating system.
  • the operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
  • the noise image generating device provided in the embodiment of the present application can realize various processes realized by the method embodiments in FIG. 1 to FIG. 4 , and details are not repeated here to avoid repetition.
  • the embodiment of the present application further provides an electronic device 600, including a processor 601, a memory 602, and programs or instructions stored in the memory 602 and operable on the processor 601,
  • an electronic device 600 including a processor 601, a memory 602, and programs or instructions stored in the memory 602 and operable on the processor 601
  • the program or instruction is executed by the processor 601
  • each process of the above noise image generating method embodiment can be realized, and the same technical effect can be achieved, so in order to avoid repetition, details are not repeated here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710, etc. part.
  • the electronic device 700 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 710 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions.
  • a power supply such as a battery
  • the structure of the electronic device shown in FIG. 7 does not constitute a limitation to the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine some components, or arrange different components, and details will not be repeated here. .
  • the input unit 704 is configured to acquire a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
  • the processor 710 is configured to determine a noise index value corresponding to the target image sensor; add noise to the first image according to the noise index value to obtain a third image; adjust the noise distribution of the third image according to the second image to obtain a noise distribution similar to the first image corresponding noise image.
  • the third image is obtained, and then according to the second
  • the second image adjusts the noise distribution of the third image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and the real noise collected by the target image sensor is used image, that is, the second image, to optimize the third image, so that the final noise image can be more pertinent to the target image sensor, and the generated noise image is more realistic, which can improve subsequent image noise reduction.
  • the processor 710 is configured to determine a target Poisson noise index value and a target Gaussian noise index value corresponding to the target image sensor;
  • the noise index value corresponding to the target image sensor is calculated.
  • the input unit 704 is specifically configured to acquire N fourth images; wherein, the fourth images are images of standard color cards collected at different sensitivities using the target image sensor, N is a positive integer, and N ⁇ 2 ;
  • the processor 710 is specifically configured to traverse the N fourth images, respectively calculate the first pixel average value and the first pixel variance value of the pixels contained in each fourth image; divide the first pixel variance value by the first pixel variance value The average value of one pixel is used to obtain the Poisson noise index value corresponding to each fourth image; according to the N photosensitivity and N Poisson noise index values corresponding to the N fourth images, the Poisson noise index value and the photosensitivity index value are determined.
  • the first mapping relationship between degrees according to the first mapping relationship, determine M Poisson noise index values corresponding to M target sensitivities, as the target Poisson noise index value corresponding to the target image sensor; wherein, M
  • the target sensitivity is M sensitivity determined from the sensitivity range corresponding to the target image sensor, M is a positive integer, and M ⁇ 2.
  • the input unit 704 is also specifically configured to acquire K fifth images; wherein, the fifth images are images collected at different sensitivities using the target image sensor, K is a positive integer, and K ⁇ 2;
  • the processor 710 is specifically further configured to traverse the K fifth images, respectively calculate the second pixel variance values of the pixels contained in each fifth image, and calculate the second pixel variance values corresponding to the K fifth images respectively value as the K Gaussian noise index values corresponding to the K fifth images; according to the K sensitivities and K Gaussian noise index values corresponding to the K fifth images, determine the Gaussian noise index value and the sensitivity between the first Two mapping relationships: according to the second mapping relationship, determine M Gaussian noise index values corresponding to M target sensitivities as target Gaussian noise index values corresponding to the target image sensor.
  • the processor 710 is also specifically configured to input the third image to P consecutive convolutional layers in the first network to obtain P feature information output by the P convolutional layers; wherein, the first network is based on The second image is trained; the feature information output by the Pth convolutional layer is input to the continuous P deconvolution layers in the first network, and the output is a noise image corresponding to the first image; wherein, P is a positive integer, P ⁇ 2, P convolutional layers correspond to P deconvolutional layers one by one, the input information of the first deconvolutional layer is the first feature information output by the first convolutional layer and the output of the second deconvolutional layer
  • the second feature information, the first convolution layer is any convolution layer in the P convolution layers, and the first deconvolution layer is the deconvolution layer corresponding to the first convolution layer in the P deconvolution layers , the first deconvolution layer is the next deconvolution layer of the second deconvolution layer.
  • the processor 710 is specifically further configured to input the target image to the first network when the number of the third images is M, and output the sixth image; wherein, the target image is M third images Arbitrary image in; Obtain the first noise distribution feature corresponding to the sixth image, and the second noise distribution feature corresponding to the second image; Input the first noise distribution feature and the second noise distribution feature to the second network, output Obtaining the similarity value between the first noise distribution feature and the second noise distribution feature; in the case that the similarity value is less than a preset threshold, adjust the network parameters of the first network according to the similarity value and its corresponding loss value, Until the first network converges, the trained first network is obtained.
  • the processor 710 is also specifically configured to convert the first image from an RGB image to an original image file; add noise to the original image file according to the noise index value to obtain a third image; convert the third image from the original image file for an RGB image.
  • the noise distribution is made more diverse, and the authenticity of the noise image can be further improved.
  • the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 14041 and a microphone 7042, and the graphics processor 7041 is used for the image capture device (such as the image data of the still picture or video obtained by the camera) for processing.
  • the display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 707 includes a touch panel 7071 and other input devices 7072 .
  • the touch panel 7071 is also called a touch screen.
  • the touch panel 7071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.
  • Memory 709 may be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 710 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, user interface, application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 710 .
  • the embodiment of the present application also provides a readable storage medium, the readable storage medium stores a program or an instruction, and when the program or instruction is executed by the processor, each process of the above embodiment of the method for generating a noise image is realized, and can achieve The same technical effects are not repeated here to avoid repetition.
  • the processor is the processor in the electronic device described in the above embodiments.
  • the readable storage medium includes computer readable storage medium, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
  • the embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above embodiment of the noise image generation method Each process, and can achieve the same technical effect, in order to avoid repetition, will not repeat them here.
  • chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
  • the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

Abstract

A noise image generation method and apparatus, an electronic device, and a storage medium, relating to the technical field of image processing. The noise image generation method comprises: obtaining a first image and a second image (110), wherein the first image is a noiseless image, and the second image is a noisy image acquired by using a target image sensor; determining a noise indicator value corresponding to the target image sensor (120); adding noise to the first image according to the noise indicator value to obtain a third image (130); and adjusting the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image (140).

Description

噪声图像生成方法、装置、电子设备及存储介质Noise image generation method, device, electronic equipment and storage medium
相关申请的交叉引用Cross References to Related Applications
本申请要求享有于2021年07月28日提交的名称为“噪声图像生成方法、装置、电子设备及存储介质”的中国专利申请202110854815.6的优先权,该申请的全部内容通过引用并入本文中。This application claims priority to the Chinese patent application 202110854815.6 entitled "Noise Image Generation Method, Device, Electronic Equipment, and Storage Medium" filed on July 28, 2021, the entire content of which is incorporated herein by reference.
技术领域technical field
本申请属于图像处理技术领域,具体涉及一种噪声图像生成方法、装置、电子设备及存储介质。The present application belongs to the technical field of image processing, and in particular relates to a noise image generation method, device, electronic equipment and storage medium.
背景技术Background technique
随着用户对图像质量要求的提高,电子设备拍摄得到的含有噪声的图像越来越不能满足用户的需求,由此,需要对拍摄得到的图像进行进一步降噪处理。With the improvement of users' requirements on image quality, images containing noise captured by electronic devices cannot meet the needs of users more and more. Therefore, it is necessary to perform further noise reduction processing on the captured images.
在使用传统学习及深度学习等相关人工智能算法进行图像降噪的过程中,通常需要获取或构造噪声-无噪声的样本图像对,以使用这些样本图像对训练图像降噪模型。In the process of image denoising using traditional learning and deep learning and other related artificial intelligence algorithms, it is usually necessary to obtain or construct noise-noise-free sample image pairs to use these sample image pairs to train image denoising models.
现有在构造训练样本时,噪声图像中的噪声通常使用的是随机噪声,使得经噪声合成得到的噪声图像无法反映出真实的电子设备中的图像传感器,在图像拍摄过程中所产生的噪声,因此,导致合成得到的噪声图像不够真实,从而降低后续图像降噪模型训练过程的准确性。At present, when constructing training samples, the noise in the noise image usually uses random noise, so that the noise image obtained by noise synthesis cannot reflect the image sensor in the real electronic device, and the noise generated during the image capture process, Therefore, the synthesized noise image is not realistic enough, thereby reducing the accuracy of the subsequent image denoising model training process.
发明内容Contents of the invention
本申请实施例的目的是提供一种噪声图像生成方法、装置、电子设备及存储介质,能够解决现有技术中合成得到的噪声图像不够真实,从而降低后续图像降噪模型训练过程的准确性的问题。The purpose of the embodiments of the present application is to provide a noise image generation method, device, electronic equipment, and storage medium, which can solve the problem that the synthesized noise image in the prior art is not realistic enough, thereby reducing the accuracy of the subsequent image noise reduction model training process question.
第一方面,本申请实施例提供了一种噪声图像生成方法,该方法包括:In the first aspect, the embodiment of the present application provides a noise image generation method, the method comprising:
获取第一图像和第二图像;其中,第一图像为无噪声的图像,第二图像为使用目标图像传感器采集的有噪声的图像;Acquiring a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
确定与目标图像传感器对应的噪声指标值;determining a noise index value corresponding to the target image sensor;
根据噪声指标值为第一图像添加噪声,得到第三图像;adding noise to the first image according to the noise index value to obtain a third image;
根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像。The noise distribution of the third image is adjusted according to the second image to obtain a noise image corresponding to the first image.
第二方面,本申请实施例提供了一种噪声图像生成装置,该装置包括:In the second aspect, the embodiment of the present application provides a noise image generation device, the device includes:
获取模块,用于获取第一图像和第二图像;其中,第一图像为无噪声的图像,第二图像为使用目标图像传感器采集的有噪声的图像;An acquisition module, configured to acquire a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
确定模块,用于确定与目标图像传感器对应的噪声指标值;A determining module, configured to determine a noise index value corresponding to the target image sensor;
噪声添加模块,用于根据噪声指标值为第一图像添加噪声,得到第三图像;A noise adding module, for adding noise to the first image according to the noise index value, to obtain the third image;
调整模块,用于根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像。The adjustment module is configured to adjust the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。In a third aspect, an embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor, and the program or instruction is The processor implements the steps of the method described in the first aspect when executed.
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented .
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法的步骤。In the fifth aspect, the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect The steps of the method.
在本申请实施例中,通过获取无噪声的第一图像和目标图像传感器采集的有噪声的第二图像,然后根据与目标图像传感器对应的噪声指标值为第一图像添加噪声,得到第三图像,再根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像,由于第三图像是针对目标图像传感器对应的噪声指标值生成的有噪声的图像,且利用目标图像传感器采集 的真实噪声图像,也即第二图像,来优化第三图像,因此,可以使最终得到的噪声图像能够对目标图像传感器具有更强的针对性,生成的噪声图像中的噪声,也更加贴近该目标图像传感器真实采集的图像的噪声,从而可以提高后续针对该目标传感器的图像降噪模型的训练过程的准确性。In the embodiment of the present application, the third image is obtained by acquiring a noise-free first image and a noisy second image collected by the target image sensor, and then adding noise to the first image according to the noise index value corresponding to the target image sensor , and then adjust the noise distribution of the third image according to the second image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and using the target image sensor The collected real noise image, that is, the second image, is used to optimize the third image. Therefore, the final noise image can be more pertinent to the target image sensor, and the noise in the generated noise image is also closer to The noise of the image actually collected by the target image sensor can improve the accuracy of the subsequent training process of the image noise reduction model for the target sensor.
附图说明Description of drawings
图1是根据一示例性实施例示出的一种噪声图像生成方法的流程图之一;Fig. 1 is one of the flowcharts of a noise image generation method shown according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种优化判别网络的工作流程图;Fig. 2 is a workflow diagram of an optimized discriminant network shown according to an exemplary embodiment;
图3是根据一示例性实施例示出的一种噪声图像生成方法的流程图之二;Fig. 3 is the second flowchart of a method for generating a noise image according to an exemplary embodiment;
图4是根据一示例性实施例示出的一种噪声图像生成方法的流程图之三;Fig. 4 is the third flowchart of a method for generating a noise image according to an exemplary embodiment;
图5是根据一示例性实施例示出的一种噪声图像生成装置的结构框图;Fig. 5 is a structural block diagram of a device for generating noise images according to an exemplary embodiment;
图6是根据一示例性实施例示出的一种电子设备的结构框图;Fig. 6 is a structural block diagram of an electronic device according to an exemplary embodiment;
图7为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will clearly describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific sequence or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application can be practiced in sequences other than those illustrated or described herein, and that references to "first," "second," etc. distinguish Objects are generally of one type, and the number of objects is not limited. For example, there may be one or more first objects. In addition, "and/or" in the specification and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的噪声图像生成方法、装置、电子设备及存储介质进行详细地说明。The noise image generating method, device, electronic device, and storage medium provided by the embodiments of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.
由于相机直出的图像普遍含有噪声,而且相机的感光度(International Standardization Organization,ISO)越高,拍摄得到的图像中的噪声越严重,因此,需要对图像进行降噪处理,这里,ISO是衡量传统相机感光速度的国际统一指标。Because the images straight out of the camera generally contain noise, and the higher the camera’s sensitivity (International Standardization Organization, ISO), the more serious the noise in the captured image, therefore, the image needs to be denoised. Here, ISO is a measure of The international uniform index of traditional camera photosensitive speed.
在使用传统学习及深度学习等相关人工智能算法进行图像降噪的过程中,均需要获取或构造噪声-无噪声的样本图像对,以使用这些样本图像对训练图像降噪模型。In the process of image denoising using traditional learning and deep learning and other related artificial intelligence algorithms, it is necessary to obtain or construct noise-noise-free sample image pairs to use these sample image pairs to train image denoising models.
本申请提供了一种噪声图像生成方法,可应用于对噪声图像进行构造的场景中。The present application provides a noise image generation method, which can be applied to the scene of constructing noise images.
另外,本申请实施例提供的噪声图像生成方法,执行主体可以为噪声图像生成装置,或者该噪声图像生成装置中的用于噪声图像生成方法的控制模块。本申请实施例中以噪声图像生成装置执行噪声图像生成方法为例,说明本申请实施例提供的噪声图像生成方法。In addition, the noise image generation method provided in the embodiment of the present application may be executed by a noise image generation device, or a control module used for the noise image generation method in the noise image generation device. In the embodiment of the present application, the noise image generating method performed by the noise image generating device is taken as an example to illustrate the noise image generating method provided in the embodiment of the present application.
图1是根据一示例性实施例示出的一种噪声图像生成方法的流程图。Fig. 1 is a flow chart showing a method for generating a noise image according to an exemplary embodiment.
如图1所示,该噪声图像生成方法可以包括步骤110至步骤140,具体如下所示。As shown in FIG. 1 , the method for generating a noise image may include steps 110 to 140, specifically as follows.
步骤110,获取第一图像和第二图像。 Step 110, acquiring the first image and the second image.
本申请实施例中,第一图像可以为无噪声的图像,例如:高清的彩色(Red,Green,Blue,RGB)图像。第二图像可以为使用目标电子设备中的目标图像传感器,采集的有噪声的图像,其中,目标图像传感器可以为本申请实施例生成噪声图像时所参考的一类传感器,还可以为使用该噪声图像进行训练的降噪模型所针对的一类传感器,该第二图像可用于优化初始噪声图像。第一图像和第二图像均可以从公开数据集或使用目标图像传感器拍摄的数据集中获取,在获取的过程中还可以清洗数据,保留大量清晰的RGB图像,作为第一图像,另外,还可以使用具有目标图像传感器的电子设备拍摄得到的多个不同亮度的RGB图像,并从中选取一个作为第二图像。In this embodiment of the present application, the first image may be a noise-free image, for example, a high-definition color (Red, Green, Blue, RGB) image. The second image may be a noisy image collected using the target image sensor in the target electronic device, where the target image sensor may be a type of sensor that is referred to when generating a noise image in the embodiment of the present application, or may be a sensor using the noise This second image can be used to optimize the initial noisy image for the type of sensor the denoising model is trained on. Both the first image and the second image can be obtained from a public dataset or a dataset captured by a target image sensor. During the acquisition process, the data can also be cleaned, and a large number of clear RGB images can be retained as the first image. In addition, you can also Using the electronic device with the target image sensor to shoot a plurality of RGB images with different luminances, and selecting one of them as the second image.
步骤120,确定与目标图像传感器对应的噪声指标值。 Step 120, determining a noise index value corresponding to the target image sensor.
这里,由于不同的图像传感器具有不同的噪声指标值,因此,需要针对不同的图像传感器确定其对应的噪声指标值。噪声指标值可以是能够衡量目标图像传感器噪声程度的值,可以用noiseVariance=Ax+B表示,其中noiseVariance可以为噪声指标值,x可以为第一图像对应的原始(RAWImage Format,RAW)图像中每个像素点的像素值,A和B均可以为参数,A可以是一种噪声的参数,B可以是另一种噪声的参数。因此,确定A和B即可确定第一图像中每个像素点需要添加的噪声指标值。Here, since different image sensors have different noise index values, corresponding noise index values need to be determined for different image sensors. Noise index value can be the value that can measure target image sensor noise degree, can represent with noiseVariance=Ax+B, wherein noiseVariance can be noise index value, x can be each in the original (RAWImage Format, RAW) image corresponding to the first image The pixel value of a pixel point, A and B can be parameters, A can be a parameter of one noise, and B can be a parameter of another noise. Therefore, by determining A and B, the noise index value that needs to be added for each pixel in the first image can be determined.
步骤130,根据噪声指标值为第一图像添加噪声,得到第三图像。 Step 130, adding noise to the first image according to the noise index value to obtain a third image.
这里,第三图像可以为初始噪声图像,为了更好地为第一图像添加噪声,可以在第一图像对应的RAW图像上添加噪声,具体可以将RAW图像中每个像素点的像素值x输入上述噪声模型noiseVariance=Ax+B中,输出得到每个像素点需要添加的噪声指标值,从而得到第三图像,也即初始噪声图像。Here, the third image can be an initial noise image. In order to better add noise to the first image, noise can be added to the RAW image corresponding to the first image. Specifically, the pixel value x of each pixel in the RAW image can be input In the above noise model noiseVariance=Ax+B, the output is the noise index value that needs to be added for each pixel, so as to obtain the third image, that is, the initial noise image.
步骤140,根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像。 Step 140, adjusting the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image.
这里,与第一图像对应的噪声图像可以为更贴近实际场景的噪声图像,该噪声图像可用于对降噪模型的训练。Here, the noise image corresponding to the first image may be a noise image closer to an actual scene, and the noise image may be used for training a noise reduction model.
示例性地,可先确定第二图像的噪声分布,进而根据第二图像的噪声分布调整第三图像的噪声分布,使最终得到的噪声图像与第二图像的噪声分布相同或相近,从而达到更贴近实际图像的噪声特征的目的。Exemplarily, the noise distribution of the second image can be determined first, and then the noise distribution of the third image can be adjusted according to the noise distribution of the second image, so that the noise distribution of the finally obtained noise image is the same or similar to that of the second image, thereby achieving better The purpose of being close to the noise characteristics of the actual image.
在一种可选的实施方式中,为了进一步提高生成的噪声图像的真实性,可利用神经网络模型学习第二图像的噪声分布,进而利用该神经网络模型调整第三图像的噪声分布,实现对第三图像的优化过程。具体的,可以使用优化判别网络对上述第三图像进行优化,该优化判别网络的作用可以是在第三图像与第二图像之间进行域对抗生成,使第三图像与第二图像的噪声分布尽可能保持一致或相似度大于预设阈值,以便提高生成的噪声图像的真实性。In an optional implementation, in order to further improve the authenticity of the generated noise image, the neural network model can be used to learn the noise distribution of the second image, and then the neural network model can be used to adjust the noise distribution of the third image to achieve The optimization process of the third image. Specifically, the above-mentioned third image can be optimized using an optimized discriminant network, and the function of the optimized discriminant network can be to perform domain confrontation generation between the third image and the second image, so that the noise distribution of the third image and the second image Keep as consistent as possible or similarity greater than a preset threshold in order to improve the authenticity of the generated noisy image.
基于此,上述步骤140具体可以包括:Based on this, the above-mentioned step 140 may specifically include:
将第三图像输入至第一网络中连续的P个卷积层,得到P个卷积层输出的P个特征信息;Inputting the third image to P consecutive convolutional layers in the first network to obtain P feature information output by the P convolutional layers;
将第P个卷积层输出的特征信息输入至第一网络中连续的P个反卷积层,输出得到与第一图像对应的噪声图像。The feature information output by the Pth convolutional layer is input to the consecutive P deconvolutional layers in the first network, and a noise image corresponding to the first image is outputted.
这里,第一网络可以根据第二图像训练得到,P可以为正整数,P≥2,P个卷积层与P个反卷积层可以一一对应,第一反卷积层的输入信息可以为第一卷积层输出的第一特征信息和第二反卷积层输出的第二特征信息,第一卷积层可以为P个卷积层中的任一卷积层,第一反卷积层为可以P个反卷积层中与第一卷积层对应的反卷积层,第一反卷积层可以为第二反卷积层的下一个反卷积层。Here, the first network can be trained according to the second image, P can be a positive integer, P≥2, P convolution layers and P deconvolution layers can be in one-to-one correspondence, and the input information of the first deconvolution layer can be For the first feature information output by the first convolution layer and the second feature information output by the second deconvolution layer, the first convolution layer can be any convolution layer in the P convolution layers, and the first deconvolution The convolution layer may be a deconvolution layer corresponding to the first convolution layer among the P deconvolution layers, and the first deconvolution layer may be the next deconvolution layer of the second deconvolution layer.
具体的,可以将第三图像输入第一网络中连续的P个卷积层,目标图像经过每个卷积操作中的矩阵运算Feature n=w n(w n-1(…(w 1x+b 1))+b n-1)+b n,都可以输出对应的特征向量,其中,Feature n表示第n个卷积模块,也即卷积层,输出的特征向量,w为权重。将上一反卷积层输出的特征向量以及与上一反卷积层对应的卷积层输出的特征向量通过跳跃结构连接后,输入下一反卷积层,经过每个反卷积操作中的矩阵运算TransFeature tn
Figure PCTCN2022107258-appb-000001
后,输出得到经过优化处理后的第三图像,也即与第一图像对应的噪声图像,其中,TransFeature tn表示反卷积层输出的特征向量,w为权重,通过跳跃结构连接上一反卷积层输出的特征向量以及与上一反卷积层对应的卷积层输出的特征向量可以充分保留图像的细节信息。
Specifically, the third image can be input into consecutive P convolutional layers in the first network, and the target image undergoes matrix operations in each convolution operation Feature n =w n (w n-1 (...(w 1 x+ b 1 ))+b n-1 )+b n can output the corresponding feature vector, where Feature n represents the nth convolution module, that is, the convolution layer, the output feature vector, and w is the weight. After the feature vector output by the previous deconvolution layer and the feature vector output by the convolution layer corresponding to the previous deconvolution layer are connected through the skip structure, they are input to the next deconvolution layer, and after each deconvolution operation The matrix operation TransFeature tn =
Figure PCTCN2022107258-appb-000001
Finally, the output is the optimized third image, that is, the noise image corresponding to the first image, where TransFeature tn represents the feature vector output by the deconvolution layer, w is the weight, and is connected to the previous deconvolution through a skip structure The feature vector output by the convolution layer and the feature vector output by the convolution layer corresponding to the previous deconvolution layer can fully retain the detailed information of the image.
在一个具体例子中,优化网络也即第一网络的工作流程可以如图2所示,优化网络220可以包括输入卷积层221、4个卷积模块2221-2224、4个反卷积模块2231-2234、输出反卷积层222和4个跳跃连接22311-22341。其中,输入卷积层221与输出反卷积层222相对应,第一卷积模块2221与第四反卷积模块2234相对应,第二卷积模块2222与第三反卷积模块2233相对应,第三卷积模块2223与第二反卷积模块2232相对应,第四卷积模块2224与第一反卷积模块2231相对应。也即,若第一卷积层为输入卷积层221,则第一反卷积层为输出反卷积层222,第二反卷积层为第四反卷积 模块2234;若第一卷积层为第一卷积模块2221,则第一反卷积层为第四反卷积模块2234,第二反卷积层为第三反卷积模块2233,以此类推,在此不再赘述。In a specific example, the workflow of the optimized network, that is, the first network, can be shown in FIG. 2 , and the optimized network 220 can include an input convolution layer 221, four convolution modules 2221-2224, and four deconvolution modules 2231 - 2234, output deconvolutional layer 222 and 4 skip connections 22311-22341. Wherein, the input convolution layer 221 corresponds to the output deconvolution layer 222, the first convolution module 2221 corresponds to the fourth deconvolution module 2234, and the second convolution module 2222 corresponds to the third deconvolution module 2233 , the third convolution module 2223 corresponds to the second deconvolution module 2232 , and the fourth convolution module 2224 corresponds to the first deconvolution module 2231 . That is, if the first convolution layer is the input convolution layer 221, then the first deconvolution layer is the output deconvolution layer 222, and the second deconvolution layer is the fourth deconvolution module 2234; if the first convolution The stacked layer is the first convolution module 2221, the first deconvolution layer is the fourth deconvolution module 2234, the second deconvolution layer is the third deconvolution module 2233, and so on, and will not be repeated here .
示例性地,将合成域图像210,也即第三图像,通过输入卷积层221输入至优化网络220中连续的4个卷积层,得到4个卷积层输出的4个特征信息,具体的,经过第一卷积模块2221,得到第一特征向量,经过第二卷积模块2222,得到第二特征向量,经过第三卷积模块2223,得到第三特征向量,经过第四卷积模块2224,得到第四特征向量。将第一特征信息输入至优化网络220中连续的4个反卷积层,得到噪声图像230,具体的,将第四特征向量与经过第一反卷积模块2231得到的第五特征向量通过第一跳跃结构22311连接后,输入至第二反卷积模块2232,得到第六特征向量,将第三特征向量与第六特征向量通过第二跳跃结构22321连接后,输入至第三反卷积模块2233,得到第七特征向量,将第二特征向量与第七特征向量通过第三跳跃结构22331连接后,输入至第四反卷积模块2234,得到第八特征向量,将第一特征向量与第八特征向量通过第四跳跃结构22341连接后,输入至输出反卷积层222,得到噪声图像230。Exemplarily, the synthetic domain image 210, that is, the third image, is input to four consecutive convolutional layers in the optimization network 220 through the input convolutional layer 221, and four feature information output by the four convolutional layers are obtained, specifically Yes, the first feature vector is obtained through the first convolution module 2221, the second feature vector is obtained through the second convolution module 2222, the third feature vector is obtained through the third convolution module 2223, and the fourth convolution module is obtained 2224, get the fourth eigenvector. Input the first feature information to four consecutive deconvolution layers in the optimization network 220 to obtain the noise image 230, specifically, pass the fourth feature vector and the fifth feature vector obtained through the first deconvolution module 2231 through the first After a skip structure 22311 is connected, it is input to the second deconvolution module 2232 to obtain the sixth feature vector, and after the third feature vector and the sixth feature vector are connected through the second skip structure 22321, they are input to the third deconvolution module 2233, obtain the seventh eigenvector, connect the second eigenvector and the seventh eigenvector through the third skip structure 22331, input it to the fourth deconvolution module 2234, obtain the eighth eigenvector, and combine the first eigenvector and the first eigenvector After the eight feature vectors are connected through the fourth skip structure 22341 , they are input to the output deconvolution layer 222 to obtain the noise image 230 .
如此,通过第一网络中连续的P个卷积层和反卷积层,以及跳跃结构,对第三图像进行优化,可以得到比第三图像更贴近实际场景的噪声图像,提高生成的噪声图像的真实性。In this way, through the continuous P convolutional layers and deconvolutional layers in the first network, and the skip structure, the third image can be optimized to obtain a noise image that is closer to the actual scene than the third image, and to improve the generated noise image. authenticity.
另外,由于与目标图像传感器对应的噪声指标值可能有多个,因此,可根据多个噪声指标值分别为第一图像添加噪声,得到多个第三图像,例如M个第三图像。In addition, since there may be multiple noise index values corresponding to the target image sensor, noise may be respectively added to the first image according to the multiple noise index values to obtain multiple third images, for example, M third images.
针对上述第一网络的训练过程,在一种可选的实施方式中,在第三图像的数量为M个的情况下,步骤140具体可以包括:Regarding the training process of the above-mentioned first network, in an optional implementation manner, when the number of third images is M, step 140 may specifically include:
将目标图像输入至第一网络,输出得到第六图像;input the target image to the first network, and output the sixth image;
获取与第六图像对应的第一噪声分布特征,以及与第二图像对应的第二噪声分布特征;acquiring a first noise distribution feature corresponding to the sixth image, and a second noise distribution feature corresponding to the second image;
将第一噪声分布特征和第二噪声分布特征输入至第二网络,输出得到第一噪声分布特征与第二噪声分布特征之间的相似度值;Inputting the first noise distribution feature and the second noise distribution feature to the second network, and outputting the similarity value between the first noise distribution feature and the second noise distribution feature;
在相似度值小于预设阈值的情况下,根据相似度值及其对应的损失值,调整第一网络的网络参数,直至第一网络收敛,得到经训练的第一网络。When the similarity value is less than the preset threshold, adjust the network parameters of the first network according to the similarity value and the corresponding loss value until the first network converges to obtain a trained first network.
这里,目标图像可以为M个第三图像中的任意图像,M可以为正整数,且M≥2。第六图像可以为目标图像经过第一网络优化后得到的图像。与第一图像对应的M个噪声图像可以是比目标图像更贴近真实噪声分布的噪声图像。第一网络和第二网络可以组成生成对抗网络。第二图像可以是从目标图像传感器拍摄得到的多个不同亮度的RGB图像中随机选取的图像,训练过程中可以多次随机选取第二图像。Here, the target image may be any image in the M third images, M may be a positive integer, and M≥2. The sixth image may be an image obtained after the target image is optimized through the first network. The M noise images corresponding to the first image may be noise images closer to real noise distribution than the target image. The first network and the second network can form a generative confrontation network. The second image may be an image randomly selected from multiple RGB images with different brightnesses captured by the target image sensor, and the second image may be randomly selected multiple times during the training process.
示例性地,上述优化判别网络可以是两段式网络模型,其中,第一段网络可以为优化网络,也即第一网络;第二段网络可以为判别网络,也即第二网络。该第一网络可用于对目标图像进行优化,生成更贴近真实噪声分布的噪声图像,第二网络可用于确定第六图像对应的第一噪声分布特征和第二图像对应的第二噪声分布特征之间的相似度值。在此,可以对第一网络进行训练,在相似度值小于预设阈值的情况下,可以调整第一网络的网络参数,直至第一网络收敛,得到经训练的第一网络,该经训练的第一网络可用于生成更贴合实际场景的噪声图像。Exemplarily, the above-mentioned optimized discriminant network may be a two-stage network model, wherein the first-stage network may be an optimized network, that is, the first network; the second-stage network may be a discriminant network, that is, the second network. The first network can be used to optimize the target image to generate a noise image closer to the real noise distribution, and the second network can be used to determine the difference between the first noise distribution feature corresponding to the sixth image and the second noise distribution feature corresponding to the second image. similarity value between them. Here, the first network can be trained, and when the similarity value is less than the preset threshold, the network parameters of the first network can be adjusted until the first network converges to obtain a trained first network. The first network can be used to generate a noisy image that is more suitable for the actual scene.
除此之外,优化网络输出的第六图像仍然属于合成域图像,其噪声的概率分布可以用Px表示;真实域图像,也即第二图像,的噪声概率分布可以用Py表示。将这两类图像输入判别网络,通过连续的卷积层输出特征向量(feature map),最后将特征向量输入连续的三层全连接层,最终输出位于区间[0,1]内的一个概率值,该概率值表示合成域与真实域图像间的相似度,当概率值越接近于1则表示两张图像的噪声分布更相似,当概率值越接近0,则表示两张图像的噪声分布差距较大。In addition, the sixth image output by the optimized network still belongs to the synthetic domain image, and its noise probability distribution can be expressed by Px; the noise probability distribution of the real domain image, that is, the second image, can be expressed by Py. Input the two types of images into the discriminant network, output the feature vector (feature map) through the continuous convolutional layer, and finally input the feature vector into the continuous three-layer fully connected layer, and finally output a probability value in the interval [0, 1] , the probability value represents the similarity between the synthetic domain and the real domain image. When the probability value is closer to 1, it means that the noise distribution of the two images is more similar. When the probability value is closer to 0, it means that the noise distribution of the two images is different. larger.
另外,可以在判别网络中设置当概率值低于0.5时,认为第六图像与第二图像之间的噪声分布有较大差距,将概率值反馈给第一阶段中的优化网络,优化网络即会调节网络中的权重系数(weights),重新生成优化后的第六图像,继而将重新生成的第六图像输入到判别网络中再进行第二图像和第六图像之间的相似度判别。具体的,权重调节可通过求解概率损失对权重的偏导数来确定,例如通过更新w^new=Δw+w^old的方式来进 行权重调节和训练,直到训练收敛得到最终模型,也即经训练的第一网络。In addition, it can be set in the discriminant network that when the probability value is lower than 0.5, it is considered that there is a large gap between the noise distribution between the sixth image and the second image, and the probability value is fed back to the optimization network in the first stage, and the optimization network is The weight coefficients (weights) in the network will be adjusted to regenerate the optimized sixth image, and then the regenerated sixth image will be input into the discriminant network for similarity discrimination between the second image and the sixth image. Specifically, the weight adjustment can be determined by solving the partial derivative of the probability loss to the weight, for example, by updating w^new=Δw+w^old to perform weight adjustment and training until the training converges to obtain the final model, that is, after training first network.
在一个具体例子中,判别网络也即第二网络的工作流程可以如图2所示,首先将合成域图像210,也即目标图像,输入至优化网络220,输出得到初始的噪声图像230,也即第六图像。通过判别网络240中连续的卷积层241获取与噪声图像230对应的第一噪声分布特征2301,以及与真实域图像250也即第二图像对应的第二噪声分布特征2501,并将该第一噪声分布特征2301和第二噪声分布特征2501输入至判别网络240中连续的三层全连接层242,输出得到第一噪声分布特征2301与第二噪声分布特征2501之间的相似度值,并根据该相似度对优化网络220进行训练,得到经训练的优化网络,以便生成更贴合实际场景的噪声图像。In a specific example, the workflow of the discriminant network, that is, the second network, can be shown in FIG. 2. First, the synthetic domain image 210, that is, the target image, is input to the optimization network 220, and the initial noise image 230 is obtained as an output. That is the sixth image. The first noise distribution feature 2301 corresponding to the noise image 230 and the second noise distribution feature 2501 corresponding to the real domain image 250, that is, the second image are obtained through the continuous convolution layer 241 in the discriminant network 240, and the first The noise distribution feature 2301 and the second noise distribution feature 2501 are input to the continuous three-layer fully connected layer 242 in the discriminant network 240, and the output is to obtain the similarity value between the first noise distribution feature 2301 and the second noise distribution feature 2501, and according to The similarity is used to train the optimization network 220 to obtain a trained optimization network, so as to generate noise images that are more suitable for actual scenes.
如此,通过在训练第一网络的过程中,利用第二网络对第六图像与第二图像之间的相似度进行判别,进而根据判别结果调整第一网络的网络参数,从而能够使第一网络具备优化图像噪声分布的能力,进一步提高经第一网络优化后生成的噪声图像的真实性。In this way, during the process of training the first network, the second network is used to judge the similarity between the sixth image and the second image, and then adjust the network parameters of the first network according to the result of the judgment, so that the first network can be It has the ability to optimize the image noise distribution, further improving the authenticity of the noise image generated after the first network optimization.
此外,在一种可选的实施方式中,在第一图像为无噪声的RGB图像的情况下,在步骤130之前,该噪声图像生成方法还可以包括:In addition, in an optional implementation manner, in the case where the first image is a noise-free RGB image, before step 130, the noise image generation method may also include:
将第一图像由RGB图像转换为原始图像文件;Convert the first image from an RGB image to an original image file;
基于此,上述步骤130可以包括:Based on this, the above step 130 may include:
根据噪声指标值为原始图像文件添加噪声,得到第三图像;adding noise to the original image file according to the noise index value to obtain a third image;
将第三图像由原始图像文件转换为RGB图像。Convert the third image from the raw image file to an RGB image.
这里,原始图像文件可以为RAW图像。RGB图像中的噪声分布较复杂,难以处理,为了更好的处理噪声分布,可以在RAW图像上添加噪声。Here, the original image file may be a RAW image. The noise distribution in the RGB image is complex and difficult to deal with. In order to better handle the noise distribution, noise can be added to the RAW image.
示例性地,在获取第一图像时可以获取高清的RGB图,再将第一图像由RGB图像通过反图像信号处理(Image Signal Processing,ISP)的操作,转换为RAW图像。具体的,例如可以通过逆色调映射、伽玛反矫正及反转数字增益等方法得到RAW图像。这里,ISP可以包括:黑电平补偿、颜色插值(去马赛克)、去噪、自动白平衡、色彩校正等流程。其中,逆色调映射是一种用来将标准动态范围(Standard Dynamic Range,SDR)源信号转换为高动态范围(High Dynamic Range,HDR)源信号的技术,可以 应用于生产端或终端设备,在一定程度上实现对现有SDR节目的HDR“还原”及向上兼容;伽玛反矫正可以是对图像的伽玛曲线进行编辑,以对图像进行非线性色调编辑的方法,可以检出图像信号中的深色部分和浅色部分,并使两者比例增大,从而提高图像对比度效果,伽玛反矫正是伽玛矫正的反向操作。Exemplarily, when acquiring the first image, a high-definition RGB image can be acquired, and then the first image is converted from the RGB image to a RAW image through an inverse image signal processing (Image Signal Processing, ISP) operation. Specifically, for example, the RAW image can be obtained by methods such as inverse tone mapping, inverse gamma correction, and inversion of digital gain. Here, the ISP may include processes such as black level compensation, color interpolation (demosaicing), denoising, automatic white balance, and color correction. Among them, inverse tone mapping is a technology used to convert a standard dynamic range (Standard Dynamic Range, SDR) source signal into a high dynamic range (High Dynamic Range, HDR) source signal, which can be applied to production or terminal equipment. To a certain extent, HDR "restoration" and upward compatibility of existing SDR programs can be realized; Gamma anti-correction can be a method of editing the gamma curve of the image to perform nonlinear tone editing on the image, and can detect Gamma correction is the reverse operation of gamma correction.
基于此,根据噪声指标值为第一图像添加噪声可以是根据噪声指标值为RAW图像,也即原始图像文件,添加噪声。由此得到的第三图像也可以是RAW图像,也即原始图像文件,因此,在调整第三图像的噪声分布之前,还可以将第三图像由原始图像文件转换为RGB图像。Based on this, adding noise to the first image according to the noise index value may be adding noise to the RAW image, that is, the original image file, according to the noise index value. The third image thus obtained may also be a RAW image, that is, an original image file. Therefore, before adjusting the noise distribution of the third image, the third image may also be converted from the original image file to an RGB image.
这样,由于RAW图像能够更好地反映噪声分布情况,因此,通过将第一图像由RGB图像转换为RAW图像,再进行噪声添加,可以使噪声添加的效果更好,便于提取图像的噪声分布特征。In this way, since the RAW image can better reflect the noise distribution, by converting the first image from an RGB image to a RAW image, and then adding noise, the effect of noise addition can be better, and it is convenient to extract the noise distribution characteristics of the image .
由此,通过获取无噪声的第一图像和目标图像传感器采集的有噪声的第二图像,然后根据与目标图像传感器对应的噪声指标值为第一图像添加噪声,得到第三图像,再根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像,由于第三图像是针对目标图像传感器对应的噪声指标值生成的有噪声的图像,且利用目标图像传感器采集的真实噪声图像,也即第二图像,来优化第三图像,因此,可以使最终得到的噪声图像能够对目标图像传感器具有更强的针对性,生成的噪声图像中的噪声,也更加贴近该目标图像传感器真实采集的图像的噪声,从而可以提高后续针对该目标传感器的图像降噪模型的训练过程的准确性。Thus, by acquiring the noise-free first image and the noisy second image collected by the target image sensor, and then adding noise to the first image according to the noise index value corresponding to the target image sensor, the third image is obtained, and then according to the second The second image adjusts the noise distribution of the third image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and the real noise collected by the target image sensor is used image, that is, the second image, to optimize the third image, so that the final noise image can be more pertinent to the target image sensor, and the noise in the generated noise image is also closer to the target image sensor The noise of the actually collected image can improve the accuracy of the subsequent training process of the image noise reduction model for the target sensor.
基于上述步骤110-140,在一种可能的实施例中,如图3所示,步骤120具体可以包括:步骤1201-1202,其中:Based on the above steps 110-140, in a possible embodiment, as shown in FIG. 3, step 120 may specifically include: steps 1201-1202, wherein:
步骤1201,确定与目标图像传感器对应的目标泊松噪声指标值和目标高斯噪声指标值。 Step 1201, determine a target Poisson noise index value and a target Gaussian noise index value corresponding to the target image sensor.
这里,关于噪声指标值noiseVariance=Ax+B,其中,A可以是与目标图像传感器对应的目标泊松噪声指标值,B可以是与目标图像传感器对应的目标高斯噪声指标值,x可以是第一图像中每个像素点的像素值。Here, regarding the noise index value noiseVariance=Ax+B, A can be the target Poisson noise index value corresponding to the target image sensor, B can be the target Gaussian noise index value corresponding to the target image sensor, and x can be the first The pixel value of each pixel in the image.
示例性地,在确定目标泊松噪声指标值A和目标高斯噪声指标值B的 情况下,便可以确定每个像素点对应的目标图像传感器的噪声指标值noiseVariance。Exemplarily, in the case of determining the target Poisson noise index value A and the target Gaussian noise index value B, the noise index value noiseVariance of the target image sensor corresponding to each pixel can be determined.
基于此,在一种可选的实施方式中,步骤1201具体可以包括:Based on this, in an optional implementation manner, step 1201 may specifically include:
获取N个第四图像;Acquire N fourth images;
遍历N个第四图像,分别计算每个第四图像中包含的像素点的第一像素平均值和第一像素方差值;Traversing the N fourth images, respectively calculating the first pixel average value and the first pixel variance value of the pixels contained in each fourth image;
将第一像素方差值除以第一像素平均值,得到与每个第四图像对应的泊松噪声指标值;Dividing the first pixel variance value by the first pixel average value to obtain a Poisson noise index value corresponding to each fourth image;
根据与N个第四图像对应的N个感光度以及N个泊松噪声指标值,确定泊松噪声指标值与感光度之间的第一映射关系;According to the N photosensitivity and N Poisson noise index values corresponding to the N fourth images, determine a first mapping relationship between the Poisson noise index value and the photosensitivity;
根据第一映射关系,确定与M个目标感光度对应的M个泊松噪声指标值,作为与目标图像传感器对应的目标泊松噪声指标值。According to the first mapping relationship, M Poisson noise index values corresponding to the M target sensitivities are determined as target Poisson noise index values corresponding to the target image sensor.
这里,第四图像可以为使用目标图像传感器在不同感光度下采集的标准色卡的图像,N可以为正整数,且N≥2。M个目标感光度可以为从目标图像传感器对应的感光度区间中确定的M个感光度,M可以为正整数,且M≥2。Here, the fourth image may be an image of a standard color card collected at different sensitivities by using the target image sensor, N may be a positive integer, and N≧2. The M target sensitivities may be M sensitivities determined from the corresponding sensitivity range of the target image sensor, M may be a positive integer, and M≥2.
在一个具体例子中,不同的拍摄设备具有不同的ISO分段,为了使生成的噪声图像更贴近真实场景,可以在与目标图像传感器对应的ISO分段内,对ISO值进行随机选取或等间隔选取,ISO可以由目标图像传感器设置的模拟增益和数字增益计算得到。在不同ISO条件下拍摄24色卡图像,计算24色卡图像中每张图像包含的像素点的平均值和方差值,将每个方差值除以平均值,得到与10张24色卡图像对应的10个泊松噪声指标值,基于最大似然估计算法,根据与10张24色卡图像分别对应的10个感光度以及10个泊松噪声指标值,确定泊松噪声指标值与感光度之间的映射关系A=a0·ISO+a1,其中,a0和a1均可以为目标图像传感器的参数,根据该映射关系,可以确定与随机选取的5个目标感光度对应的5个泊松噪声指标值,作为与目标图像传感器对应的5个目标泊松噪声指标值A。In a specific example, different shooting devices have different ISO segments. In order to make the generated noise image closer to the real scene, the ISO value can be randomly selected or equally spaced within the ISO segment corresponding to the target image sensor. Select, ISO can be calculated from the analog gain and digital gain set by the target image sensor. Shoot 24-color card images under different ISO conditions, calculate the average value and variance value of the pixels contained in each image in the 24-color card image, divide each variance value by the average value, and get the same as 10 24-color card images The 10 Poisson noise index values corresponding to the image are based on the maximum likelihood estimation algorithm, and the Poisson noise index value and the photosensitive The mapping relationship A=a0·ISO+a1 between degrees, wherein, a0 and a1 can be the parameters of the target image sensor, according to the mapping relationship, can determine the 5 Poissons corresponding to the 5 randomly selected target sensitivities Noise index values, as five target Poisson noise index values A corresponding to the target image sensor.
如此,通过确定泊松噪声指标值与感光度之间的第一映射关系,可以得到多个目标泊松噪声指标值,从而生成能够基本覆盖目标图像传感器对 应的感光度区间的多个第三图像,使得最终得到与第一图像对应的多个噪声图像,能够充分模拟目标图像传感器在不同场景下关于泊松噪声的噪声环境。In this way, by determining the first mapping relationship between the Poisson noise index value and the sensitivity, a plurality of target Poisson noise index values can be obtained, thereby generating a plurality of third images that can basically cover the sensitivity range corresponding to the target image sensor , so that multiple noise images corresponding to the first image are finally obtained, which can fully simulate the noise environment of the target image sensor with respect to Poisson noise in different scenarios.
此外,在一种可选的实施方式中,步骤1201具体还可以包括:In addition, in an optional implementation manner, step 1201 may specifically include:
获取K个第五图像;Acquire K fifth images;
遍历K个第五图像,分别计算每个图像中包含的像素点的第二像素方差值,将与K个第五图像分别对应的第二像素方差值作为与K个第五图像对应的K个高斯噪声指标值;Traverse the K fifth images, respectively calculate the second pixel variance values of the pixels contained in each image, and use the second pixel variance values corresponding to the K fifth images as corresponding to the K fifth images K Gaussian noise index values;
基于最大似然估计算法,根据与K个第五图像对应的K个感光度以及K个高斯噪声指标值,确定高斯噪声指标值与感光度之间的第二映射关系;Based on the maximum likelihood estimation algorithm, according to K sensitivities and K Gaussian noise index values corresponding to the K fifth images, determine a second mapping relationship between the Gaussian noise index value and the sensitivity;
根据第二映射关系,确定与M个目标感光度对应的M个高斯噪声指标值,作为与目标图像传感器对应的目标高斯噪声指标值。According to the second mapping relationship, M Gaussian noise index values corresponding to the M target sensitivities are determined as target Gaussian noise index values corresponding to the target image sensor.
这里,第五图像可以为使用目标图像传感器在不同感光度下采集的图像,该图像可以是黑图,K可以为正整数,且K≥2。具体的,第五图像可通过使用目标图像传感器拍摄黑色图像获取,也可以通过遮挡目标图像传感器的镜头的情况下进行图像拍摄得到。Here, the fifth image may be an image collected at different sensitivities using the target image sensor, the image may be a black image, K may be a positive integer, and K≧2. Specifically, the fifth image may be acquired by using the target image sensor to capture a black image, or may be obtained by capturing an image while blocking a lens of the target image sensor.
在一个具体例子中,可以在不同ISO条件下拍摄20张全黑图像,计算20张全黑图像中每张图像包含的像素点的方差值,将20个方差值作为与20张全黑图像对应的20个高斯噪声指标值,基于最大似然估计算法,确定高斯噪声指标值与感光度之间的映射关系B=b0·ISO·ISO+b1·ISO,其中,b0和b1均可以为目标图像传感器的参数,根据该映射关系,可以确定与10个目标感光度对应的10个高斯噪声指标值,作为与目标图像传感器对应的10个高斯噪声指标值B。In a specific example, 20 all-black images can be taken under different ISO conditions, and the variance value of the pixels contained in each image in the 20 all-black images can be calculated, and the 20 variance values can be compared with the 20 all-black images For the 20 Gaussian noise index values corresponding to the image, based on the maximum likelihood estimation algorithm, determine the mapping relationship between the Gaussian noise index value and the sensitivity B=b0·ISO·ISO+b1·ISO, where both b0 and b1 can be For the parameters of the target image sensor, according to the mapping relationship, 10 Gaussian noise index values corresponding to 10 target sensitivities can be determined as the 10 Gaussian noise index values B corresponding to the target image sensor.
如此,通过确定高斯噪声指标值与感光度之间的第二映射关系,可以得到多个目标高斯噪声指标值,从而生成能够基本覆盖目标图像传感器对应的感光度区间的多个第三图像,使得最终得到与第一图像对应的多个噪声图像,能够充分模拟目标图像传感器在不同场景下关于高斯噪声的噪声环境。In this way, by determining the second mapping relationship between the Gaussian noise index value and the sensitivity, a plurality of target Gaussian noise index values can be obtained, thereby generating a plurality of third images that can basically cover the sensitivity range corresponding to the target image sensor, so that Finally, multiple noise images corresponding to the first image are obtained, which can fully simulate the noise environment of the target image sensor with respect to Gaussian noise in different scenes.
步骤1202,根据目标泊松噪声指标值和目标高斯噪声指标值,计算得 到与目标图像传感器对应的噪声指标值。 Step 1202, according to the target Poisson noise index value and the target Gaussian noise index value, calculate the noise index value corresponding to the target image sensor.
在一个具体例子中,根据多个目标泊松噪声指标值A和多个目标高斯噪声指标值B,即可计算得到与目标图像传感器对应的噪声指标值noiseVariance=Ax+B。In a specific example, according to multiple target Poisson noise index values A and multiple target Gaussian noise index values B, the noise index value noiseVariance=Ax+B corresponding to the target image sensor can be calculated.
如此,通过上述过程,可以同时合成高斯分布的噪声及泊松分布的噪声,使噪声分布更加多样性,进一步提升噪声图像的真实性。In this way, through the above process, the noise of the Gaussian distribution and the noise of the Poisson distribution can be synthesized at the same time, making the noise distribution more diverse and further improving the authenticity of the noise image.
为了更好地描述整个方案,基于上述各实施例,举一个具体例子,如图4所示,该噪声图像生成方法可以包括步骤410-450,下面对此进行详细解释。In order to better describe the whole solution, based on the foregoing embodiments, a specific example is given, as shown in FIG. 4 , the method for generating a noise image may include steps 410-450, which will be explained in detail below.
步骤410,获取第一图像和第二图像。 Step 410, acquiring the first image and the second image.
这里,可以获取高清的RGB图像,也即第一图像,和使用目标图像传感器拍摄得到的带噪声的RGB图像,也即第二图像。Here, a high-definition RGB image, that is, the first image, and a noisy RGB image obtained by using the target image sensor, that is, the second image may be acquired.
步骤420,将第一图像转换为RAW图像。 Step 420, converting the first image into a RAW image.
这里,RGB图像中的噪声分布较复杂,难以处理,因此可以在RAW图像的基础上进行噪声添加,但是高清的RAW图像获取比较困难,因此,可以先获取RGB图像,再将RGB图像转换为RAW图像,具体转换方法在此不再赘述。Here, the noise distribution in the RGB image is complex and difficult to deal with, so noise can be added on the basis of the RAW image, but it is difficult to obtain a high-definition RAW image, so you can first obtain the RGB image, and then convert the RGB image to RAW image, the specific conversion method will not be repeated here.
步骤430,对传感器进行噪声指标值的标定。 Step 430, perform noise index calibration on the sensor.
这里,由于不同的传感器具有不同的噪声强度,因此,需要针对不同的传感器标定其噪声指标值。噪声模型可以用noiseVariance=Ax+B表示,其中,A和B即为需要标定的噪声指标值,A可以为目标泊松噪声指标值,B可以为目标高斯噪声指标值,x可以为RAW图像中每个像素点的像素值,noiseVariance可以为针对目标图像传感器的与每个像素点对应的噪声方差值,也即噪声指标值。具体标定过程在此不再赘述。Here, since different sensors have different noise intensities, it is necessary to calibrate their noise index values for different sensors. The noise model can be represented by noiseVariance=Ax+B, where A and B are the noise index values to be calibrated, A can be the target Poisson noise index value, B can be the target Gaussian noise index value, and x can be the RAW image The pixel value of each pixel, noiseVariance may be a noise variance value corresponding to each pixel for the target image sensor, that is, a noise index value. The specific calibration process will not be repeated here.
步骤440,基于RAW图像生成第三图像。 Step 440, generating a third image based on the RAW image.
这里,基于RAW图像进行噪声添加,更易于处理噪声分布。Here, adding noise based on the RAW image makes it easier to handle the noise distribution.
步骤450,将第三图像与第二图像输入优化判别网络。 Step 450, input the third image and the second image into the optimization discriminant network.
这里,将初始噪声图像,也即第三图像,和第二图像输入优化判别网络进行多次优化和判别,可以得到更贴近实际场景的噪声图像。当然,可 以将第一图像与优化判别网络输出的一个或多个噪声图像,组成噪声-无噪声的样本图像对,用于对与目标图像传感器对应的图像降噪模型进行训练。Here, the initial noise image, that is, the third image, and the second image are input into the optimization discriminant network for multiple optimization and discrimination, and a noise image closer to the actual scene can be obtained. Of course, the first image and one or more noise images output by the optimized discriminant network can be used to form a noise-noise-free sample image pair for training an image denoising model corresponding to the target image sensor.
由此,通过获取无噪声的第一图像和目标图像传感器采集的有噪声的第二图像,然后根据与目标图像传感器对应的噪声指标值为第一图像添加噪声,得到第三图像,再根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像,由于第三图像是针对目标图像传感器对应的噪声指标值生成的有噪声的图像,且利用目标图像传感器采集的真实噪声图像,也即第二图像,来优化第三图像,因此,可以使最终得到的噪声图像能够对目标图像传感器具有更强的针对性,生成的噪声图像中的噪声,也更加贴近该目标图像传感器真实采集的图像的噪声,从而可以提高后续针对该目标传感器的图像降噪模型的训练过程的准确性。Thus, by acquiring the noise-free first image and the noisy second image collected by the target image sensor, and then adding noise to the first image according to the noise index value corresponding to the target image sensor, the third image is obtained, and then according to the second The second image adjusts the noise distribution of the third image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and the real noise collected by the target image sensor is used image, that is, the second image, to optimize the third image, so that the final noise image can be more pertinent to the target image sensor, and the noise in the generated noise image is also closer to the target image sensor The noise of the actually collected image can improve the accuracy of the subsequent training process of the image noise reduction model for the target sensor.
基于相同的发明构思,本申请还提供了一种噪声图像生成装置。下面结合图5对本申请实施例提供的噪声图像生成装置进行详细说明。Based on the same inventive concept, the present application also provides a noise image generation device. The device for generating a noise image provided by the embodiment of the present application will be described in detail below with reference to FIG. 5 .
图5是根据一示例性实施例示出的一种噪声图像生成装置的结构框图。Fig. 5 is a structural block diagram of an apparatus for generating a noise image according to an exemplary embodiment.
如图5所示,噪声图像生成装置500可以包括:As shown in Figure 5, the noise image generation device 500 may include:
获取模块501,用于获取第一图像和第二图像;其中,第一图像为无噪声的图像,第二图像为使用目标图像传感器采集的有噪声的图像;An acquisition module 501, configured to acquire a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
确定模块502,用于确定与目标图像传感器对应的噪声指标值;A determining module 502, configured to determine a noise index value corresponding to the target image sensor;
噪声添加模块503,用于根据噪声指标值为第一图像添加噪声,得到第三图像; Noise adding module 503, for adding noise to the first image according to the noise index value, to obtain the third image;
调整模块504,用于根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像。The adjusting module 504 is configured to adjust the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image.
下面对上述噪声图像生成装置500进行详细说明,具体如下所示:The above noise image generation device 500 will be described in detail below, specifically as follows:
在其中一个实施例中,确定模块502可以包括:In one of the embodiments, the determining module 502 may include:
确定子模块,用于确定与目标图像传感器对应的目标泊松噪声指标值和目标高斯噪声指标值;A determination sub-module is used to determine a target Poisson noise index value and a target Gaussian noise index value corresponding to the target image sensor;
计算子模块,用于根据目标泊松噪声指标值和目标高斯噪声指标值,计算得到与目标图像传感器对应的噪声指标值。The calculation sub-module is used to calculate the noise index value corresponding to the target image sensor according to the target Poisson noise index value and the target Gaussian noise index value.
在其中一个实施例中,确定子模块可以包括:In one of the embodiments, the determining submodule may include:
第一获取单元,用于获取N个第四图像;其中,第四图像为使用目标图像传感器在不同感光度下采集的标准色卡的图像,N为正整数,且N≥2;The first acquisition unit is configured to acquire N fourth images; wherein, the fourth image is an image of a standard color card collected at different sensitivities using the target image sensor, N is a positive integer, and N≥2;
第一计算单元,用于遍历N个第四图像,分别计算每个第四图像中包含的像素点的第一像素平均值和第一像素方差值;The first calculation unit is configured to traverse the N fourth images, and respectively calculate the first pixel average value and the first pixel variance value of the pixels contained in each fourth image;
第二计算单元,用于将第一像素方差值除以第一像素平均值,得到与每个第四图像对应的泊松噪声指标值;The second calculation unit is used to divide the first pixel variance value by the first pixel average value to obtain the Poisson noise index value corresponding to each fourth image;
第一关系确定单元,用于根据与N个第四图像对应的N个感光度以及N个泊松噪声指标值,确定泊松噪声指标值与感光度之间的第一映射关系;The first relationship determination unit is configured to determine a first mapping relationship between the Poisson noise index value and the sensitivity according to the N sensitivities corresponding to the N fourth images and the N Poisson noise index values;
第一指标确定单元,用于根据第一映射关系,确定与M个目标感光度对应的M个泊松噪声指标值,作为与目标图像传感器对应的目标泊松噪声指标值;其中,M个目标感光度为从目标图像传感器对应的感光度区间中确定的M个感光度,M为正整数,且M≥2。The first index determination unit is configured to determine M Poisson noise index values corresponding to M target sensitivities according to the first mapping relationship as target Poisson noise index values corresponding to the target image sensor; wherein, the M targets The photosensitivity is M photosensitivity determined from the photosensitivity range corresponding to the target image sensor, M is a positive integer, and M≥2.
在其中一个实施例中,确定子模块还可以包括:In one of the embodiments, the determining submodule may also include:
第二获取单元,用于获取K个第五图像;其中,第五图像为使用目标图像传感器在不同感光度下采集的图像,K为正整数,且K≥2;The second acquiring unit is used to acquire K fifth images; wherein, the fifth images are images acquired by using the target image sensor at different sensitivities, K is a positive integer, and K≥2;
第三计算单元,用于遍历K个第五图像,分别计算每个第五图像中包含的像素点的第二像素方差值,将与K个第五图像分别对应的第二像素方差值作为与K个第五图像对应的K个高斯噪声指标值;The third calculation unit is used to traverse the K fifth images, respectively calculate the second pixel variance values of the pixels contained in each fifth image, and use the second pixel variance values corresponding to the K fifth images respectively K Gaussian noise index values corresponding to the K fifth images;
第二关系确定单元,用于根据与K个第五图像对应的K个感光度以及K个高斯噪声指标值,确定高斯噪声指标值与感光度之间的第二映射关系;The second relationship determination unit is configured to determine a second mapping relationship between the Gaussian noise index value and the sensitivity according to K sensitivities and K Gaussian noise index values corresponding to the K fifth images;
第二指标确定单元,用于根据第二映射关系,确定与M个目标感光度对应的M个高斯噪声指标值,作为与目标图像传感器对应的目标高斯噪声指标值。The second index determining unit is configured to determine M Gaussian noise index values corresponding to the M target sensitivities according to the second mapping relationship as target Gaussian noise index values corresponding to the target image sensor.
在其中一个实施例中,调整模块504包括:In one of the embodiments, the adjustment module 504 includes:
图像输入子模块,用于将目标图像输入至连续的P个卷积层,得到P个卷积层输出的P个特征信息;The image input sub-module is used to input the target image to consecutive P convolutional layers to obtain P feature information output by the P convolutional layers;
特征输入子模块,用于将第P个卷积层输出的特征信息输入至连续的P个反卷积层,输出得到第六图像;The feature input submodule is used to input the feature information output by the Pth convolutional layer to the continuous P deconvolutional layers, and output the sixth image;
其中,P为正整数,P≥2,P个卷积层与P个反卷积层一一对应,第一反卷积层的输入信息为第一卷积层输出的第一特征信息和第二反卷积层输出的第二特征信息,第一卷积层为P个卷积层中的任一卷积层,第一反卷积层为P个反卷积层中与第一卷积层对应的反卷积层,第一反卷积层为第二反卷积层的下一个反卷积层。Among them, P is a positive integer, P≥2, P convolutional layers correspond to P deconvolutional layers one by one, and the input information of the first deconvolutional layer is the first feature information and the first feature information output by the first convolutional layer. The second feature information output by the two deconvolution layers, the first convolution layer is any convolution layer in the P convolution layers, and the first deconvolution layer is the P deconvolution layer and the first convolution layer The deconvolution layer corresponding to the layer, the first deconvolution layer is the next deconvolution layer of the second deconvolution layer.
在其中一个实施例中,在第三图像的数量为M个的情况下,调整模块504还可以包括:In one of the embodiments, when the number of third images is M, the adjustment module 504 may further include:
目标图像处理子模块,用于在将第三图像输入至第一网络中连续的P个卷积层,得到P个卷积层输出的P个特征信息之前,将目标图像输入至第一网络,输出得到第六图像;其中,目标图像为M个第三图像中的任意图像;The target image processing sub-module is used to input the target image to the first network before inputting the third image to the P consecutive convolutional layers in the first network to obtain the P feature information output by the P convolutional layers, The sixth image is outputted; wherein, the target image is any image in the M third images;
获取子模块,用于获取与第六图像对应的第一噪声分布特征,以及与第二图像对应的第二噪声分布特征;An acquisition submodule, configured to acquire a first noise distribution feature corresponding to the sixth image, and a second noise distribution feature corresponding to the second image;
特征处理子模块,用于将第一噪声分布特征和第二噪声分布特征输入至第二网络,输出得到第一噪声分布特征与第二噪声分布特征之间的相似度值;The feature processing sub-module is used to input the first noise distribution feature and the second noise distribution feature to the second network, and output the similarity value between the first noise distribution feature and the second noise distribution feature;
调整子模块,用于在相似度值小于预设阈值的情况下,根据相似度值及其对应的损失值,调整第一网络的网络参数,直至第一网络收敛,得到经训练的第一网络。The adjustment sub-module is used to adjust the network parameters of the first network according to the similarity value and its corresponding loss value when the similarity value is less than the preset threshold value until the first network converges to obtain the trained first network .
在其中一个实施例中,第一图像为无噪声的RGB图像;In one of the embodiments, the first image is a noise-free RGB image;
该噪声图像生成装置500还可以包括:The noise image generation device 500 may also include:
转换模块505,用于在根据所述噪声指标值为所述第一图像添加噪声,得到第三图像之前,将第一图像由RGB图像转换为原始图像文件;A conversion module 505, configured to convert the first image from an RGB image to an original image file before adding noise to the first image according to the noise index value to obtain a third image;
噪声添加模块503可以包括: Noise adding module 503 may include:
噪声添加子模块,用于根据噪声指标值为原始图像文件添加噪声,得到第三图像;The noise adding submodule is used to add noise to the original image file according to the noise index value to obtain the third image;
转换子模块,用于将第三图像由原始图像文件转换为RGB图像。The conversion sub-module is used to convert the third image from the original image file to an RGB image.
由此,通过获取无噪声的第一图像和目标图像传感器采集的有噪声的第二图像,然后根据与目标图像传感器对应的噪声指标值为第一图像添加 噪声,得到第三图像,再根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像,由于第三图像是针对目标图像传感器对应的噪声指标值生成的有噪声的图像,且利用目标图像传感器采集的真实噪声图像,也即第二图像,来优化第三图像,因此,可以使最终得到的噪声图像能够对目标图像传感器具有更强的针对性,生成的噪声图像中的噪声,也更加贴近该目标图像传感器真实采集的图像的噪声,从而可以提高后续针对该目标传感器的图像降噪模型的训练过程的准确性。Thus, by acquiring the noise-free first image and the noisy second image collected by the target image sensor, and then adding noise to the first image according to the noise index value corresponding to the target image sensor, the third image is obtained, and then according to the second The second image adjusts the noise distribution of the third image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and the real noise collected by the target image sensor is used image, that is, the second image, to optimize the third image, so that the final noise image can be more pertinent to the target image sensor, and the noise in the generated noise image is also closer to the target image sensor The noise of the actually collected image can improve the accuracy of the subsequent training process of the image noise reduction model for the target sensor.
本申请实施例中的噪声图像生成装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The apparatus for generating a noise image in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant). assistant, PDA), etc., non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
本申请实施例中的噪声图像生成装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The noise image generation device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
本申请实施例提供的噪声图像生成装置能够实现图1至图4的方法实施例实现的各个过程,为避免重复,这里不再赘述。The noise image generating device provided in the embodiment of the present application can realize various processes realized by the method embodiments in FIG. 1 to FIG. 4 , and details are not repeated here to avoid repetition.
可选地,如图6所示,本申请实施例还提供一种电子设备600,包括处理器601,存储器602,存储在存储器602上并可在所述处理器601上运行的程序或指令,该程序或指令被处理器601执行时实现上述噪声图像生成方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG. 6 , the embodiment of the present application further provides an electronic device 600, including a processor 601, a memory 602, and programs or instructions stored in the memory 602 and operable on the processor 601, When the program or instruction is executed by the processor 601, each process of the above noise image generating method embodiment can be realized, and the same technical effect can be achieved, so in order to avoid repetition, details are not repeated here.
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图7为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
该电子设备700包括但不限于:射频单元701、网络模块702、音频输出单元703、输入单元704、传感器705、显示单元706、用户输入单元707、接口单元708、存储器709、以及处理器710等部件。The electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710, etc. part.
本领域技术人员可以理解,电子设备700还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器710逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图7中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 700 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 710 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions. The structure of the electronic device shown in FIG. 7 does not constitute a limitation to the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine some components, or arrange different components, and details will not be repeated here. .
其中,输入单元704,用于获取第一图像和第二图像;其中,第一图像为无噪声的图像,第二图像为使用目标图像传感器采集的有噪声的图像;Wherein, the input unit 704 is configured to acquire a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
处理器710,用于确定与目标图像传感器对应的噪声指标值;根据噪声指标值为第一图像添加噪声,得到第三图像;根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像。The processor 710 is configured to determine a noise index value corresponding to the target image sensor; add noise to the first image according to the noise index value to obtain a third image; adjust the noise distribution of the third image according to the second image to obtain a noise distribution similar to the first image corresponding noise image.
由此,通过获取无噪声的第一图像和目标图像传感器采集的有噪声的第二图像,然后根据与目标图像传感器对应的噪声指标值为第一图像添加噪声,得到第三图像,再根据第二图像调整第三图像的噪声分布,得到与第一图像对应的噪声图像,由于第三图像是针对目标图像传感器对应的噪声指标值生成的有噪声的图像,且利用目标图像传感器采集的真实噪声图像,也即第二图像,来优化第三图像,因此,可以使最终得到的噪声图像能够对目标图像传感器具有更强的针对性,生成的噪声图像也更加真实,从而可以提高后续图像降噪模型训练过程的准确性。Thus, by acquiring the noise-free first image and the noisy second image collected by the target image sensor, and then adding noise to the first image according to the noise index value corresponding to the target image sensor, the third image is obtained, and then according to the second The second image adjusts the noise distribution of the third image to obtain the noise image corresponding to the first image, because the third image is a noisy image generated for the noise index value corresponding to the target image sensor, and the real noise collected by the target image sensor is used image, that is, the second image, to optimize the third image, so that the final noise image can be more pertinent to the target image sensor, and the generated noise image is more realistic, which can improve subsequent image noise reduction. The accuracy of the model training process.
可选的,处理器710,用于确定与目标图像传感器对应的目标泊松噪声指标值和目标高斯噪声指标值;Optionally, the processor 710 is configured to determine a target Poisson noise index value and a target Gaussian noise index value corresponding to the target image sensor;
根据目标泊松噪声指标值和目标高斯噪声指标值,计算得到与目标图像传感器对应的噪声指标值。According to the target Poisson noise index value and the target Gaussian noise index value, the noise index value corresponding to the target image sensor is calculated.
可选的,输入单元704,具体用于获取N个第四图像;其中,第四图像为使用目标图像传感器在不同感光度下采集的标准色卡的图像,N为正整数,且N≥2;Optionally, the input unit 704 is specifically configured to acquire N fourth images; wherein, the fourth images are images of standard color cards collected at different sensitivities using the target image sensor, N is a positive integer, and N≥2 ;
处理器710,具体用于遍历N个第四图像,分别计算每个第四图像中包含的像素点的第一像素平均值和第一像素方差值;将第一像素方差值除以第一像素平均值,得到与每个第四图像对应的泊松噪声指标值;根据与N个第四图像对应的N个感光度以及N个泊松噪声指标值,确定泊松噪声指标值与感光度之间的第一映射关系;根据第一映射关系,确定与M个目标感光度对应的M个泊松噪声指标值,作为与目标图像传感器对应的目标泊松噪声指标值;其中,M个目标感光度为从目标图像传感器对应的感光度区间中确定的M个感光度,M为正整数,且M≥2。The processor 710 is specifically configured to traverse the N fourth images, respectively calculate the first pixel average value and the first pixel variance value of the pixels contained in each fourth image; divide the first pixel variance value by the first pixel variance value The average value of one pixel is used to obtain the Poisson noise index value corresponding to each fourth image; according to the N photosensitivity and N Poisson noise index values corresponding to the N fourth images, the Poisson noise index value and the photosensitivity index value are determined. The first mapping relationship between degrees; according to the first mapping relationship, determine M Poisson noise index values corresponding to M target sensitivities, as the target Poisson noise index value corresponding to the target image sensor; wherein, M The target sensitivity is M sensitivity determined from the sensitivity range corresponding to the target image sensor, M is a positive integer, and M≥2.
可选的,输入单元704,具体还用于获取K个第五图像;其中,第五图像为使用目标图像传感器在不同感光度下采集的图像,K为正整数,且K≥2;Optionally, the input unit 704 is also specifically configured to acquire K fifth images; wherein, the fifth images are images collected at different sensitivities using the target image sensor, K is a positive integer, and K≥2;
处理器710,具体还用于遍历K个第五图像,分别计算每个第五图像中包含的像素点的第二像素方差值,将与K个第五图像分别对应的第二像素方差值作为与K个第五图像对应的K个高斯噪声指标值;根据与K个第五图像对应的K个感光度以及K个高斯噪声指标值,确定高斯噪声指标值与感光度之间的第二映射关系;根据第二映射关系,确定与M个目标感光度对应的M个高斯噪声指标值,作为与目标图像传感器对应的目标高斯噪声指标值。The processor 710 is specifically further configured to traverse the K fifth images, respectively calculate the second pixel variance values of the pixels contained in each fifth image, and calculate the second pixel variance values corresponding to the K fifth images respectively value as the K Gaussian noise index values corresponding to the K fifth images; according to the K sensitivities and K Gaussian noise index values corresponding to the K fifth images, determine the Gaussian noise index value and the sensitivity between the first Two mapping relationships: according to the second mapping relationship, determine M Gaussian noise index values corresponding to M target sensitivities as target Gaussian noise index values corresponding to the target image sensor.
可选的,处理器710,具体还用于将第三图像输入至第一网络中连续的P个卷积层,得到P个卷积层输出的P个特征信息;其中,第一网络为根据第二图像训练得到;将第P个卷积层输出的特征信息输入至第一网络中连续的P个反卷积层,输出得到与第一图像对应的噪声图像;其中,P为正整数,P≥2,P个卷积层与P个反卷积层一一对应,第一反卷积层的输入信息为第一卷积层输出的第一特征信息和第二反卷积层输出的第二特征信息,第一卷积层为P个卷积层中的任一卷积层,第一反卷积层为P个反卷积层中与第一卷积层对应的反卷积层,第一反卷积层为第二反卷积层的下一个反卷积层。Optionally, the processor 710 is also specifically configured to input the third image to P consecutive convolutional layers in the first network to obtain P feature information output by the P convolutional layers; wherein, the first network is based on The second image is trained; the feature information output by the Pth convolutional layer is input to the continuous P deconvolution layers in the first network, and the output is a noise image corresponding to the first image; wherein, P is a positive integer, P≥2, P convolutional layers correspond to P deconvolutional layers one by one, the input information of the first deconvolutional layer is the first feature information output by the first convolutional layer and the output of the second deconvolutional layer The second feature information, the first convolution layer is any convolution layer in the P convolution layers, and the first deconvolution layer is the deconvolution layer corresponding to the first convolution layer in the P deconvolution layers , the first deconvolution layer is the next deconvolution layer of the second deconvolution layer.
可选的,处理器710,具体还用于在第三图像的数量为M个的情况下,将目标图像输入至第一网络,输出得到第六图像;其中,目标图像为M个 第三图像中的任意图像;获取与第六图像对应的第一噪声分布特征,以及与第二图像对应的第二噪声分布特征;将第一噪声分布特征和第二噪声分布特征输入至第二网络,输出得到第一噪声分布特征与第二噪声分布特征之间的相似度值;在相似度值小于预设阈值的情况下,根据相似度值及其对应的损失值,调整第一网络的网络参数,直至第一网络收敛,得到经训练的第一网络。Optionally, the processor 710 is specifically further configured to input the target image to the first network when the number of the third images is M, and output the sixth image; wherein, the target image is M third images Arbitrary image in; Obtain the first noise distribution feature corresponding to the sixth image, and the second noise distribution feature corresponding to the second image; Input the first noise distribution feature and the second noise distribution feature to the second network, output Obtaining the similarity value between the first noise distribution feature and the second noise distribution feature; in the case that the similarity value is less than a preset threshold, adjust the network parameters of the first network according to the similarity value and its corresponding loss value, Until the first network converges, the trained first network is obtained.
可选的,处理器710,具体还用于将第一图像由RGB图像转换为原始图像文件;根据噪声指标值为原始图像文件添加噪声,得到第三图像;将第三图像由原始图像文件转换为RGB图像。Optionally, the processor 710 is also specifically configured to convert the first image from an RGB image to an original image file; add noise to the original image file according to the noise index value to obtain a third image; convert the third image from the original image file for an RGB image.
由此,通过同时合成高斯分布的噪声及泊松分布的噪声,使噪声分布更加多样性,可以进一步提升噪声图像的真实性。Therefore, by synthesizing the noise of Gaussian distribution and the noise of Poisson distribution at the same time, the noise distribution is made more diverse, and the authenticity of the noise image can be further improved.
应理解的是,本申请实施例中,输入单元704可以包括图形处理器(Graphics Processing Unit,GPU)14041和麦克风7042,图形处理器7041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元706可包括显示面板7061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板7061。用户输入单元707包括触控面板7071以及其他输入设备7072。触控面板7071,也称为触摸屏。触控面板7071可包括触摸检测装置和触摸控制器两个部分。其他输入设备7072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器709可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器710可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器710中。It should be understood that, in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 14041 and a microphone 7042, and the graphics processor 7041 is used for the image capture device ( Such as the image data of the still picture or video obtained by the camera) for processing. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes a touch panel 7071 and other input devices 7072 . The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts, a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here. Memory 709 may be used to store software programs as well as various data, including but not limited to application programs and operating systems. The processor 710 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, user interface, application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 710 .
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述噪声图像生成方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a readable storage medium, the readable storage medium stores a program or an instruction, and when the program or instruction is executed by the processor, each process of the above embodiment of the method for generating a noise image is realized, and can achieve The same technical effects are not repeated here to avoid repetition.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述 可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer readable storage medium, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述噪声图像生成方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above embodiment of the noise image generation method Each process, and can achieve the same technical effect, in order to avoid repetition, will not repeat them here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of computer software products, which are stored in a storage medium (such as ROM/RAM, magnetic disk, etc.) , optical disc), including several instructions to enable a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于 上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.

Claims (17)

  1. 一种噪声图像生成方法,包括:A noise image generation method, comprising:
    获取第一图像和第二图像;其中,所述第一图像为无噪声的图像,第二图像为使用目标图像传感器采集的有噪声的图像;Acquiring a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
    确定与所述目标图像传感器对应的噪声指标值;determining a noise index value corresponding to the target image sensor;
    根据所述噪声指标值为所述第一图像添加噪声,得到第三图像;adding noise to the first image according to the noise index value to obtain a third image;
    根据所述第二图像调整所述第三图像的噪声分布,得到与所述第一图像对应的噪声图像。adjusting the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image.
  2. 根据权利要求1所述的方法,其中,所述确定与所述目标图像传感器对应的噪声指标值,包括:The method according to claim 1, wherein said determining the noise index value corresponding to the target image sensor comprises:
    确定与所述目标图像传感器对应的目标泊松噪声指标值和目标高斯噪声指标值;determining a target Poisson noise index value and a target Gaussian noise index value corresponding to the target image sensor;
    根据所述目标泊松噪声指标值和所述目标高斯噪声指标值,计算得到与所述目标图像传感器对应的噪声指标值。A noise index value corresponding to the target image sensor is calculated according to the target Poisson noise index value and the target Gaussian noise index value.
  3. 根据权利要求2所述的方法,其中,所述确定与所述目标图像传感器对应的目标泊松噪声指标值,包括:The method according to claim 2, wherein said determining the target Poisson noise index value corresponding to the target image sensor comprises:
    获取N个第四图像;其中,所述第四图像为使用所述目标图像传感器在不同感光度下采集的标准色卡的图像,N为正整数,且N≥2;Acquiring N fourth images; wherein, the fourth image is an image of a standard color card collected at different sensitivities using the target image sensor, N is a positive integer, and N≥2;
    遍历所述N个第四图像,分别计算每个第四图像中包含的像素点的第一像素平均值和第一像素方差值;Traversing the N fourth images, respectively calculating the first pixel average value and the first pixel variance value of the pixels contained in each fourth image;
    将所述第一像素方差值除以所述第一像素平均值,得到与每个第四图像对应的泊松噪声指标值;Dividing the first pixel variance value by the first pixel average value to obtain a Poisson noise index value corresponding to each fourth image;
    根据与所述N个第四图像对应的N个感光度以及N个泊松噪声指标值,确定所述泊松噪声指标值与所述感光度之间的第一映射关系;determining a first mapping relationship between the Poisson noise index value and the sensitivity according to the N sensitivities and N Poisson noise index values corresponding to the N fourth images;
    根据所述第一映射关系,确定与M个目标感光度对应的M个泊松噪声指标值,作为与所述目标图像传感器对应的目标泊松噪声指标值;其中,所述M个目标感光度为从所述目标图像传感器对应的感光度区间中确定的M个感光度,M为正整数,且M≥2。According to the first mapping relationship, determine M Poisson noise index values corresponding to M target sensitivities as target Poisson noise index values corresponding to the target image sensor; wherein, the M target sensitivities are M photosensitivity determined from the photosensitivity range corresponding to the target image sensor, M is a positive integer, and M≥2.
  4. 根据权利要求2所述的方法,其中,所述确定与所述目标图像传感 器对应的目标高斯噪声指标值,包括:The method according to claim 2, wherein said determination of a target Gaussian noise index value corresponding to said target image sensor comprises:
    获取K个第五图像;其中,所述第五图像为使用所述目标图像传感器在不同感光度下采集的图像,K为正整数,且K≥2;Acquiring K fifth images; wherein, the fifth images are images collected at different sensitivities using the target image sensor, K is a positive integer, and K≥2;
    遍历所述K个第五图像,分别计算每个第五图像中包含的像素点的第二像素方差值,将与所述K个第五图像分别对应的第二像素方差值作为与所述K个第五图像对应的K个高斯噪声指标值;Traverse the K fifth images, respectively calculate the second pixel variance values of the pixels contained in each fifth image, and use the second pixel variance values corresponding to the K fifth images as the K Gaussian noise index values corresponding to the K fifth images;
    根据与所述K个第五图像对应的K个感光度以及所述K个高斯噪声指标值,确定所述高斯噪声指标值与所述感光度之间的第二映射关系;determining a second mapping relationship between the Gaussian noise index value and the sensitivity according to the K sensitivities corresponding to the K fifth images and the K Gaussian noise index values;
    根据所述第二映射关系,确定与M个目标感光度对应的M个高斯噪声指标值,作为与所述目标图像传感器对应的目标高斯噪声指标值。According to the second mapping relationship, M number of Gaussian noise index values corresponding to M target sensitivities are determined as target Gaussian noise index values corresponding to the target image sensor.
  5. 根据权利要求1所述的方法,其中,所述根据所述第二图像调整所述第三图像的噪声分布,得到与所述第一图像对应的噪声图像,包括:The method according to claim 1, wherein said adjusting the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image comprises:
    将所述第三图像输入至第一网络中连续的P个卷积层,得到P个卷积层输出的P个特征信息;其中,所述第一网络为根据所述第二图像训练得到;The third image is input to P consecutive convolutional layers in the first network to obtain P feature information output by the P convolutional layers; wherein, the first network is obtained according to the training of the second image;
    将第P个卷积层输出的特征信息输入至所述第一网络中连续的P个反卷积层,输出得到与所述第一图像对应的噪声图像;The feature information output by the Pth convolutional layer is input to the continuous P deconvolutional layers in the first network, and the noise image corresponding to the first image is obtained by outputting;
    其中,P为正整数,P≥2,所述P个卷积层与所述P个反卷积层一一对应,第一反卷积层的输入信息为第一卷积层输出的第一特征信息和第二反卷积层输出的第二特征信息,所述第一卷积层为所述P个卷积层中的任一卷积层,所述第一反卷积层为所述P个反卷积层中与所述第一卷积层对应的反卷积层,所述第一反卷积层为所述第二反卷积层的下一个反卷积层。Wherein, P is a positive integer, P≥2, and the P convolution layers correspond to the P deconvolution layers one by one, and the input information of the first deconvolution layer is the first output of the first convolution layer. Feature information and the second feature information output by the second deconvolution layer, the first convolution layer is any convolution layer in the P convolution layers, and the first deconvolution layer is the A deconvolution layer corresponding to the first deconvolution layer among the P deconvolution layers, the first deconvolution layer being the next deconvolution layer of the second deconvolution layer.
  6. 根据权利要求5所述的方法,其中,在所述第三图像的数量为M个的情况下,在将所述第三图像输入至第一网络中连续的P个卷积层,得到P个卷积层输出的P个特征信息之前,所述方法还包括:The method according to claim 5, wherein, when the number of the third images is M, when the third images are input to the P consecutive convolutional layers in the first network, P Before the P feature information output by the convolutional layer, the method also includes:
    将目标图像输入至所述第一网络,输出得到第六图像;其中,所述目标图像为M个所述第三图像中的任意图像;Inputting the target image into the first network, and outputting a sixth image; wherein, the target image is any image in the M third images;
    获取与所述第六图像对应的第一噪声分布特征,以及与所述第二图像对应的第二噪声分布特征;acquiring a first noise distribution feature corresponding to the sixth image, and a second noise distribution feature corresponding to the second image;
    将所述第一噪声分布特征和所述第二噪声分布特征输入至第二网络,输出得到所述第一噪声分布特征与所述第二噪声分布特征之间的相似度值;inputting the first noise distribution feature and the second noise distribution feature into a second network, and outputting a similarity value between the first noise distribution feature and the second noise distribution feature;
    在所述相似度值小于预设阈值的情况下,根据所述相似度值及其对应的损失值,调整所述第一网络的网络参数,直至所述第一网络收敛,得到经训练的第一网络。When the similarity value is less than a preset threshold, according to the similarity value and its corresponding loss value, adjust the network parameters of the first network until the first network converges to obtain the trained first network. a network.
  7. 一种噪声图像生成装置,包括:A noise image generation device, comprising:
    获取模块,用于获取第一图像和第二图像;其中,所述第一图像为无噪声的图像,第二图像为使用目标图像传感器采集的有噪声的图像;An acquisition module, configured to acquire a first image and a second image; wherein, the first image is a noise-free image, and the second image is a noisy image collected using a target image sensor;
    确定模块,用于确定与所述目标图像传感器对应的噪声指标值;A determining module, configured to determine a noise index value corresponding to the target image sensor;
    噪声添加模块,用于根据所述噪声指标值为所述第一图像添加噪声,得到第三图像;A noise adding module, configured to add noise to the first image according to the noise index value to obtain a third image;
    调整模块,用于根据所述第二图像调整所述第三图像的噪声分布,得到与所述第一图像对应的噪声图像。An adjustment module, configured to adjust the noise distribution of the third image according to the second image to obtain a noise image corresponding to the first image.
  8. 根据权利要求7所述的装置,其中,所述确定模块包括:The device according to claim 7, wherein the determining module comprises:
    确定子模块,用于确定与所述目标图像传感器对应的目标泊松噪声指标值和目标高斯噪声指标值;A determining submodule, configured to determine a target Poisson noise index value and a target Gaussian noise index value corresponding to the target image sensor;
    计算子模块,用于根据所述目标泊松噪声指标值和所述目标高斯噪声指标值,计算得到与所述目标图像传感器对应的噪声指标值。The calculation sub-module is used to calculate the noise index value corresponding to the target image sensor according to the target Poisson noise index value and the target Gaussian noise index value.
  9. 根据权利要求8所述的装置,其中,所述确定子模块包括:The device according to claim 8, wherein the determination submodule comprises:
    第一获取单元,用于获取N个第四图像;其中,所述第四图像为使用所述目标图像传感器在不同感光度下采集的标准色卡的图像,N为正整数,且N≥2;The first acquisition unit is configured to acquire N fourth images; wherein, the fourth images are images of standard color cards collected at different sensitivities using the target image sensor, N is a positive integer, and N≥2 ;
    第一计算单元,用于遍历所述N个第四图像,分别计算每个第四图像中包含的像素点的第一像素平均值和第一像素方差值;The first calculation unit is configured to traverse the N fourth images, and respectively calculate the first pixel average value and the first pixel variance value of the pixels contained in each fourth image;
    第二计算单元,用于将所述第一像素方差值除以所述第一像素平均值,得到与每个第四图像对应的泊松噪声指标值;A second calculation unit, configured to divide the first pixel variance value by the first pixel average value to obtain a Poisson noise index value corresponding to each fourth image;
    第一关系确定单元,用于根据与所述N个第四图像对应的N个感光度以及N个泊松噪声指标值,确定所述泊松噪声指标值与所述感光度之间的第一映射关系;The first relationship determination unit is configured to determine the first relationship between the Poisson noise index value and the sensitivity according to the N sensitivities and N Poisson noise index values corresponding to the N fourth images. Mapping relations;
    第一指标确定单元,用于根据所述第一映射关系,确定与M个目标感光度对应的M个泊松噪声指标值,作为与所述目标图像传感器对应的目标泊松噪声指标值;其中,所述M个目标感光度为从所述目标图像传感器对应的感光度区间中确定的M个感光度,M为正整数,且M≥2。The first index determination unit is configured to determine M Poisson noise index values corresponding to M target sensitivities according to the first mapping relationship, as target Poisson noise index values corresponding to the target image sensor; wherein , the M target sensitivities are M sensitivities determined from the sensitivity range corresponding to the target image sensor, M is a positive integer, and M≥2.
  10. 根据权利要求8所述的装置,其中,所述确定子模块包括:The device according to claim 8, wherein the determination submodule comprises:
    第二获取单元,用于获取K个第五图像;其中,所述第五图像为使用所述目标图像传感器在不同感光度下采集的图像,K为正整数,且K≥2;The second acquisition unit is configured to acquire K fifth images; wherein, the fifth images are images acquired by using the target image sensor at different sensitivities, K is a positive integer, and K≥2;
    第三计算单元,用于遍历所述K个第五图像,分别计算每个第五图像中包含的像素点的第二像素方差值,将与所述K个第五图像分别对应的第二像素方差值作为与所述K个第五图像对应的K个高斯噪声指标值;The third calculation unit is configured to traverse the K fifth images, respectively calculate the second pixel variance values of the pixels contained in each fifth image, and use the second pixel variance values corresponding to the K fifth images respectively The pixel variance value is used as K Gaussian noise index values corresponding to the K fifth images;
    第二关系确定单元,用于基于最大似然估计算法,根据与所述K个第五图像对应的K个感光度以及所述K个高斯噪声指标值,确定所述高斯噪声指标值与所述感光度之间的第二映射关系;The second relationship determination unit is configured to determine the relationship between the Gaussian noise index value and the K sensitivities corresponding to the K fifth images and the K Gaussian noise index values based on a maximum likelihood estimation algorithm. a second mapping relationship between sensitivities;
    第二指标确定单元,用于根据所述第二映射关系,确定与M个目标感光度对应的M个高斯噪声指标值,作为与所述目标图像传感器对应的目标高斯噪声指标值。The second index determination unit is configured to determine M Gaussian noise index values corresponding to the M target sensitivities according to the second mapping relationship as target Gaussian noise index values corresponding to the target image sensor.
  11. 根据权利要求7所述的装置,其中,所述调整模块包括:The device according to claim 7, wherein the adjustment module comprises:
    图像输入子模块,用于将所述目标图像输入至连续的P个卷积层,得到P个卷积层输出的P个特征信息;An image input sub-module, configured to input the target image to consecutive P convolutional layers to obtain P feature information output by the P convolutional layers;
    特征输入子模块,用于将第P个卷积层输出的特征信息输入至连续的P个反卷积层,输出得到所述第六图像;The feature input submodule is used to input the feature information output by the Pth convolutional layer to the continuous P deconvolutional layers, and output the sixth image;
    其中,P为正整数,P≥2,所述P个卷积层与所述P个反卷积层一一对应,第一反卷积层的输入信息为第一卷积层输出的第一特征信息和第二反卷积层输出的第二特征信息,所述第一卷积层为所述P个卷积层中的任一卷积层,所述第一反卷积层为所述P个反卷积层中与所述第一卷积层对应的反卷积层,所述第一反卷积层为所述第二反卷积层的下一个反卷积层。Wherein, P is a positive integer, P≥2, and the P convolution layers correspond to the P deconvolution layers one by one, and the input information of the first deconvolution layer is the first output of the first convolution layer. Feature information and the second feature information output by the second deconvolution layer, the first convolution layer is any convolution layer in the P convolution layers, and the first deconvolution layer is the A deconvolution layer corresponding to the first deconvolution layer among the P deconvolution layers, the first deconvolution layer being the next deconvolution layer of the second deconvolution layer.
  12. 根据权利要求11所述的装置,其中,在所述第三图像的数量为M个的情况下,所述调整模块还包括:The device according to claim 11, wherein, when the number of the third images is M, the adjustment module further includes:
    目标图像处理子模块,用于在将所述第三图像输入至第一网络中连续 的P个卷积层,得到P个卷积层输出的P个特征信息之前,将目标图像输入至所述第一网络,输出得到第六图像;其中,所述目标图像为M个所述第三图像中的任意图像;The target image processing sub-module is used to input the target image to the P consecutive convolutional layers in the first network before obtaining the P feature information output by the P convolutional layers. The first network is output to obtain a sixth image; wherein, the target image is any image in the M third images;
    获取子模块,用于获取与所述第六图像对应的第一噪声分布特征,以及与所述第二图像对应的第二噪声分布特征;An acquisition submodule, configured to acquire a first noise distribution feature corresponding to the sixth image, and a second noise distribution feature corresponding to the second image;
    特征处理子模块,用于将所述第一噪声分布特征和所述第二噪声分布特征输入至第二网络,输出得到所述第一噪声分布特征与所述第二噪声分布特征之间的相似度值;A feature processing sub-module, configured to input the first noise distribution feature and the second noise distribution feature to a second network, and output the similarity between the first noise distribution feature and the second noise distribution feature degree value;
    调整子模块,用于在所述相似度值小于预设阈值的情况下,根据所述相似度值及其对应的损失值,调整所述第一网络的网络参数,直至所述第一网络收敛,得到经训练的第一网络。An adjustment submodule, configured to adjust network parameters of the first network according to the similarity value and its corresponding loss value when the similarity value is less than a preset threshold until the first network converges , to obtain the trained first network.
  13. 一种电子设备,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-6任一项所述的噪声图像生成方法的步骤。An electronic device, comprising a processor, a memory, and a program or instruction stored on the memory and operable on the processor, when the program or instruction is executed by the processor, claims 1-6 are realized The steps of any one of the noisy image generating methods.
  14. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-6任一项所述的噪声图像生成方法的步骤。A readable storage medium, storing programs or instructions on the readable storage medium, and implementing the steps of the method for generating noise images according to any one of claims 1-6 when the programs or instructions are executed by a processor.
  15. 一种电子设备,被配置为用于执行如权利要求1-6中任一项所述的噪声图像生成方法的步骤。An electronic device configured to execute the steps of the method for generating a noise image according to any one of claims 1-6.
  16. 一种计算机程序产品,所述计算机程序产品被处理器执行以实现如权利要求1-6中任一项所述的噪声图像生成方法的步骤。A computer program product, the computer program product is executed by a processor to implement the steps of the method for generating a noise image according to any one of claims 1-6.
  17. 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-6中任一项所述的噪声图像生成方法的步骤。A chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, the processor is used to run a program or an instruction, and realize the noise as described in any one of claims 1-6 Steps of the image generation method.
PCT/CN2022/107258 2021-07-28 2022-07-22 Noise image generation method and apparatus, electronic device, and storage medium WO2023005818A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110854815.6A CN113538223A (en) 2021-07-28 2021-07-28 Noise image generation method, noise image generation device, electronic device, and storage medium
CN202110854815.6 2021-07-28

Publications (1)

Publication Number Publication Date
WO2023005818A1 true WO2023005818A1 (en) 2023-02-02

Family

ID=78121145

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/107258 WO2023005818A1 (en) 2021-07-28 2022-07-22 Noise image generation method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN113538223A (en)
WO (1) WO2023005818A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113538223A (en) * 2021-07-28 2021-10-22 维沃移动通信有限公司 Noise image generation method, noise image generation device, electronic device, and storage medium
CN114494080A (en) * 2022-03-28 2022-05-13 英特灵达信息技术(深圳)有限公司 Image generation method and device, electronic equipment and storage medium
CN116051449B (en) * 2022-08-11 2023-10-24 荣耀终端有限公司 Image noise estimation method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109636746A (en) * 2018-11-30 2019-04-16 上海皓桦科技股份有限公司 Picture noise removes system, method and apparatus
CN111861930A (en) * 2020-07-27 2020-10-30 京东方科技集团股份有限公司 Image denoising method and device, electronic equipment and image hyper-resolution denoising method
CN112785660A (en) * 2019-11-07 2021-05-11 多普顿股份公司 Method and apparatus for steganographic processing and compression of image data
CN112950503A (en) * 2021-02-26 2021-06-11 北京小米松果电子有限公司 Training sample generation method and device and truth value image generation method and device
CN113538223A (en) * 2021-07-28 2021-10-22 维沃移动通信有限公司 Noise image generation method, noise image generation device, electronic device, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109636746A (en) * 2018-11-30 2019-04-16 上海皓桦科技股份有限公司 Picture noise removes system, method and apparatus
CN112785660A (en) * 2019-11-07 2021-05-11 多普顿股份公司 Method and apparatus for steganographic processing and compression of image data
CN111861930A (en) * 2020-07-27 2020-10-30 京东方科技集团股份有限公司 Image denoising method and device, electronic equipment and image hyper-resolution denoising method
CN112950503A (en) * 2021-02-26 2021-06-11 北京小米松果电子有限公司 Training sample generation method and device and truth value image generation method and device
CN113538223A (en) * 2021-07-28 2021-10-22 维沃移动通信有限公司 Noise image generation method, noise image generation device, electronic device, and storage medium

Also Published As

Publication number Publication date
CN113538223A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
Ren et al. Gated fusion network for single image dehazing
WO2023005818A1 (en) Noise image generation method and apparatus, electronic device, and storage medium
CN108304755B (en) Training method and device of neural network model for image processing
CN108702496B (en) System and method for real-time tone mapping
US9344690B2 (en) Image demosaicing
CA2790539C (en) Use of noise-optimized selection criteria to calculate scene white points
MXPA04006931A (en) System and process for generating high dynamic range images from multiple exposures of a moving scene.
Huang et al. Towards low light enhancement with raw images
Liu et al. Single nighttime image dehazing based on image decomposition
CN111047543A (en) Image enhancement method, device and storage medium
US10580122B2 (en) Method and system for image enhancement
CN113822830B (en) Multi-exposure image fusion method based on depth perception enhancement
WO2022133194A1 (en) Deep perceptual image enhancement
JP2021179833A (en) Information processor, method for processing information, and program
CN111415304A (en) Underwater vision enhancement method and device based on cascade deep network
WO2023086194A1 (en) High dynamic range view synthesis from noisy raw images
CN111429371B (en) Image processing method and device and terminal equipment
WO2023011280A1 (en) Image noise degree estimation method and apparatus, and electronic device and storage medium
JP2021189527A (en) Information processing device, information processing method, and program
WO2023001110A1 (en) Neural network training method and apparatus, and electronic device
CN116980549A (en) Video frame processing method, device, computer equipment and storage medium
JP2006140952A (en) Image processor and image processing method
CN112232125A (en) Key point detection method and key point detection model training method
CN114764771A (en) Image quality evaluation method, device, equipment, chip and storage medium
CN115082357B (en) Video denoising data set generation method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22848423

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE