WO2017088609A1 - Image denoising apparatus and method - Google Patents

Image denoising apparatus and method Download PDF

Info

Publication number
WO2017088609A1
WO2017088609A1 PCT/CN2016/102390 CN2016102390W WO2017088609A1 WO 2017088609 A1 WO2017088609 A1 WO 2017088609A1 CN 2016102390 W CN2016102390 W CN 2016102390W WO 2017088609 A1 WO2017088609 A1 WO 2017088609A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
component
pixel
value
difference
Prior art date
Application number
PCT/CN2016/102390
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 WO2017088609A1 publication Critical patent/WO2017088609A1/en

Links

Images

Classifications

    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20201Motion blur correction

Definitions

  • the present application relates to, but is not limited to, the field of images, and in particular, to an image denoising apparatus and method.
  • Traditional denoising algorithms include: mean, median, Gaussian filtering, bilateral filtering, and so on.
  • Bilateral filtering can preserve the edge while removing noise, but the filtering effect is not obvious when the noise is relatively large, and the calculation amount is large.
  • Mean, median, and Gaussian can filter out noise better, but it is easy to blur out the edges, and as the filter window increases, it is difficult to do real-time processing.
  • 3D (3Dimensions) denoising with motion estimation In the process of 3D denoising with motion estimation, motion estimation is first performed, then 3D denoising operation is performed, and motion estimation needs to be large. The amount of calculation, and can not guarantee 100% accuracy.
  • the present application proposes an image denoising apparatus and method, which aims to solve the technical problem that the related art has large calculation amount, poor denoising effect, and easy loss of image edge detail in the process of denoising the image.
  • An embodiment of the present invention provides an image denoising device, where the device includes:
  • a first acquiring module configured to acquire a continuous multi-frame image captured by the terminal, using one of the multi-frame images as a sample image, and the rest as a to-be-contrast image, wherein the format of the multi-frame image is RGB image format;
  • a second acquiring module configured to respectively acquire luminance values of R, G, and B components of each pixel of the sample image, and luminance values of R, G, and B components of each pixel of the image to be compared;
  • a processing module configured to: if a luminance value of R, G, and B components of each pixel of the sample image is different from a luminance value of R, G, and B components corresponding to each pixel of the image to be compared In the first preset range, according to the average value of the R component luminance value between the image to be compared and each pixel point of the sample image, the average value of the G component luminance value, and the average value of the B component luminance value are obtained. Denoised image.
  • the image denoising device further includes:
  • a calculation module configured to separately calculate a difference between a luminance value of the R, G, and B components of each pixel of the sample image and a luminance value of the R, G, and B components corresponding to each pixel of the image to be compared a value, the difference being the first difference;
  • a determining module configured to determine whether the first difference is not within the first preset range
  • Selecting a module if the first difference is not within the first preset range, selecting a preset number of pixels within a preset range of each pixel of the sample image;
  • the second acquiring module is further configured to acquire a brightness value of the R, G, and B components of the preset number of pixels;
  • the calculating module is further configured to separately calculate a difference between a luminance value of the R, G, and B components of the preset number of pixel points and a luminance value of the R, G, and B components of the sample image pixel point. Value as the second difference;
  • the processing module is further configured to: if the second difference is within the second preset range, according to the preset number of pixels corresponding to the sample in the second preset range, and the sample The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values between each pixel of the image result in a denoised image.
  • the determining module is further configured to determine whether the second difference is within a second preset range
  • the image denoising apparatus further includes a discarding module configured to discard the second difference that is not within the second preset range if the second difference is not within the second preset range Corresponding to the preset number of pixels.
  • the processing module includes:
  • a first calculating unit configured to separately calculate an average value of the obtained R component luminance values between the preset number of pixels and each pixel of the sample image, and an average value and a B component of the G component luminance values The average value of the brightness values;
  • the first processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
  • processing module further includes:
  • a determining unit configured to determine a difference between a luminance value of R, G, and B components of each pixel of the sample image and a luminance value of R, G, and B components corresponding to each pixel of the image to be compared Determining, in the first preset range, brightness values of R, G, and B components of each pixel of the image to be compared corresponding to the difference in the first preset range;
  • a second calculating unit configured to respectively calculate an average value of the R component luminance values and an average value of the G component luminance values between the to-be-compared image and the pixel image in the first preset range And the average value of the B component luminance values;
  • the second processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
  • the second acquiring module is configured to parse the sample image and the image to be compared, and acquire a luminance value, a luminance component, and a B component of an R component of each pixel in the sample image. And a brightness value of the R component of each pixel in the image to be compared, a luminance value of the G component, and a luminance value of the B component.
  • the processing module is further configured to set the preset number according to a noise level in the shooting scene.
  • the processing module is further configured to set the first preset range according to a size of ambient noise at the time of shooting.
  • the first preset range is consistent with the second preset range.
  • the processing module is further configured to display the denoised image output in a screen.
  • an embodiment of the present invention further provides an image denoising method, where the method includes the following steps:
  • the denoised image is obtained according to an average value of the R component luminance value between the pixel to be compared and each pixel point of the sample image, an average value of the G component luminance value, and an average value of the B component luminance value.
  • the step of respectively acquiring the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components of each pixel of the image to be compared further includes:
  • the image denoising method further includes:
  • the step of obtaining the denoised image by the average of the R component luminance values, the average of the G component luminance values, and the B component luminance values between each pixel point includes:
  • the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
  • the brightness value of the R, G, and B components of each pixel of the sample image is different from the brightness value of the R, G, and B components corresponding to each pixel of the image to be compared
  • the value is within the first preset range, and the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value between each pixel point of the image to be compared and the sample image according to the image to be compared
  • the steps to the denoised image include:
  • the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
  • the obtaining the luminance values of the R, G, and B components of each pixel of the sample image, and the luminance values of the R, G, and B components of each pixel of the image to be compared respectively: And parsing the sample image and the image to be compared, acquiring a luminance value of an R component, a luminance value of a G component, and a luminance value of a B component of each pixel in the sample image, and acquiring each of the to-be-compared images The luminance value of the R component of the pixel, the luminance value of the G component, and the luminance value of the B component.
  • the image denoising method further includes: setting the preset number according to a noise level in a shooting scene.
  • the image denoising method further includes: setting the first preset range according to a magnitude of ambient noise at the time of shooting.
  • the first preset range is consistent with the second preset range.
  • the image denoising method further comprises: displaying the denoised image output on a screen.
  • Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that implement the image denoising method described above when the computer executable instructions are executed.
  • the luminance values of the R, G, and B components of the sample image in the terminal are respectively obtained by comparing the luminance values of the R, G, and B components of the sample image in the terminal, when the R, G of the sample image is And the difference between the brightness value of the B component and the brightness value of the R, G, and B components of each pixel of the image to be compared is within a first preset range, according to the image to be compared and the The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values between each pixel of the sample image are obtained as denoised images.
  • FIG. 1 is a schematic structural diagram of hardware of an optional mobile terminal implementing various embodiments of the present application
  • Figure 2 is a block diagram showing the electrical structure of the camera of Figure 1;
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of an image denoising apparatus according to the present application.
  • FIG. 4 is a schematic diagram of functional modules of a second embodiment of an image denoising apparatus according to the present application.
  • FIG. 5 is a schematic flowchart diagram of a first embodiment of an image denoising method according to the present application.
  • FIG. 6 is a schematic flow chart of a second embodiment of an image denoising method according to the present application.
  • FIG. 7 is a schematic diagram of an image captured by a terminal without past noise processing according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of an image obtained by a denoising process captured by a terminal according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a terminal selecting a preset number of pixel points within a preset range of a certain pixel point of a sample image according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram showing luminance values of R components of a certain pixel point of a sample image and luminance values of R components of a preset number of pixel points according to an embodiment of the present invention.
  • the mobile terminal can be implemented in various forms.
  • the terminals described in this application may include, for example, mobile phones, smart phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablets), PMPs (Portable Multimedia Players), navigation devices, and the like.
  • Mobile terminals and fixed terminals such as digital TVs, desktop computers, and the like.
  • the terminal is a mobile terminal.
  • configurations in accordance with embodiments of the present application can be applied to fixed type terminals in addition to elements that are specifically for mobile purposes.
  • FIG. 1 is a schematic structural diagram of hardware of an optional mobile terminal implementing various embodiments of the present application.
  • the mobile terminal 100 may include an A/V (Audio/Video) input unit 120, a user input unit 130, a sensing unit 140, an output unit 150, a memory 160, an interface unit 170, a controller 180, a power supply unit 190, and the like.
  • Figure 1 illustrates a mobile terminal having various components, but it should be understood that not all illustrated components are required to be implemented. More or fewer components can be implemented instead. The elements of the mobile terminal will be described in detail below.
  • the A/V input unit 120 is for receiving an audio or video signal.
  • the A/V input unit 120 may include a camera 121 and a microphone 122 that processes image data of still pictures or video obtained by the image capturing device in a video capturing mode or an image capturing mode.
  • the processed image frame can be displayed on the display unit 151.
  • the image frames processed by the camera 121 may be stored in the memory 160 (or other storage medium), and two or more cameras 121 may be provided according to the configuration of the mobile terminal.
  • the microphone 122 can receive sound (audio data) via a microphone in an operation mode of a telephone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound as audio data.
  • the processed audio (voice) data can be converted to a format output that can be transmitted to the mobile communication base station via the mobile communication module 112 in the case of a telephone call mode.
  • the microphone 122 can implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated during the process of receiving and transmitting audio signals.
  • the user input unit 130 may generate key input data according to a command input by the user to control various operations of the mobile terminal.
  • the user input unit 130 allows the user to input various types of information, and may include a keyboard, a pot, a touch pad (eg, detecting resistance, pressure due to being touched, pressure, A touch sensitive component such as a capacitor or the like), a scroll wheel, a rocker, and the like.
  • a touch screen can be formed.
  • the sensing unit 140 detects the current state of the mobile terminal 100 (eg, the open or closed state of the mobile terminal 100), the location of the mobile terminal 100, the presence or absence of contact (ie, touch input) by the user with the mobile terminal 100, and the mobile terminal.
  • the sensing unit 140 can sense whether the slide type phone is turned on or off.
  • the sensing unit 140 can detect whether the power supply unit 190 provides power or whether the interface unit 170 is coupled to an external device.
  • the interface unit 170 serves as an interface through which at least one external device can connect with the mobile terminal 100.
  • the external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, and an audio input/output. (I/O) port, video I/O port, headphone port, and more.
  • the identification module may be stored to verify various information used by the user using the mobile terminal 100 and may include a User Identification Module (UIM), a Customer Identification Module (SIM), a Universal Customer Identity Module (USIM), and the like.
  • the device having the identification module may take the form of a smart card, and thus the identification device may be connected to the mobile terminal 100 via a port or other connection device.
  • the interface unit 170 can be configured to receive input from an external device (eg, data information, power, etc.) and transmit the received input to one or more components within the mobile terminal 100 or can be used at the mobile terminal and external device Transfer data between.
  • the interface unit 170 may function as a path through which power is supplied from the base to the mobile terminal 100 or may be used as a transmission of various command signals allowing input from the base to the mobile terminal 100 The path to the terminal.
  • Various command signals or power input from the base can be used as signals for identifying whether the mobile terminal is accurately mounted on the base.
  • Output unit 150 is configured to provide an output signal (eg, an audio signal, a video signal, an alarm signal, a vibration signal, etc.) in a visual, audio, and/or tactile manner.
  • the output unit 150 may include a display unit 151.
  • the display unit 151 can display information processed in the mobile terminal 100. For example, when the mobile terminal 100 is in the phone call mode, the display unit 151 can display a call or other communication (for example, Text messaging, multimedia file downloads, etc.) related user interface (UI) or graphical user interface (GUI). When the mobile terminal 100 is in a video call mode or an image capturing mode, the display unit 151 may display a captured image and/or a received image, a UI or GUI showing a video or image and related functions, and the like.
  • UI user interface
  • GUI graphical user interface
  • the display unit 151 can function as an input device and an output device.
  • the display unit 151 may include at least one of a liquid crystal display (LCD), a thin film transistor LCD (TFT-LCD), an organic light emitting diode (OLED) display, a flexible display, a three-dimensional (3D) display, and the like.
  • LCD liquid crystal display
  • TFT-LCD thin film transistor LCD
  • OLED organic light emitting diode
  • a flexible display a three-dimensional (3D) display, and the like.
  • 3D three-dimensional
  • Some of these displays may be configured to be transparent to allow a user to view from the outside, which may be referred to as a transparent display, and a typical transparent display may be, for example, a TOLED (Transparent Organic Light Emitting Diode) display or the like.
  • TOLED Transparent Organic Light Emitting Diode
  • the mobile terminal 100 may include two or more display units (or other display devices), for example, the mobile terminal may include an external display unit (not shown) and an internal display unit (not shown) .
  • the touch screen can be used to detect touch input pressure as well as touch input position and touch input area.
  • the memory 160 may store a software program or the like for processing and control operations performed by the controller 180, or may temporarily store data (for example, a phone book, a message, a still image, a video, etc.) that has been output or is to be output. Moreover, the memory 160 can store data regarding vibrations and audio signals of various manners that are output when a touch is applied to the touch screen.
  • the memory 160 may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), a random access memory (RAM), a static random access memory ( SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like.
  • the mobile terminal 100 can cooperate with a network storage device that performs a storage function of the memory 160 through a network connection.
  • the controller 180 typically controls the overall operation of the mobile terminal. For example, the controller 180 performs the control and processing associated with voice calls, data communications, video calls, and the like.
  • the controller 180 may include a multimedia module 181 for reproducing (or playing back) multimedia data, which may be constructed within the controller 180 or may be configured to be separate from the controller 180.
  • the controller 180 may perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image.
  • the power supply unit 190 receives external power or internal power under the control of the controller 180 and provides appropriate power required to operate each component and component.
  • the various embodiments described herein can be implemented in a computer readable medium using, for example, computer software, hardware, or any combination thereof.
  • the embodiments described herein may be through the use of application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays ( An FPGA, a processor, a controller, a microcontroller, a microprocessor, at least one of the electronic units designed to perform the functions described herein, in some cases, such an embodiment may be at the controller 180 Implemented in the middle.
  • implementations such as procedures or functions may be implemented with separate software modules that permit the execution of at least one function or operation.
  • the software code can be implemented by a software application (or program) written in any suitable programming language, which can be stored in memory 160 and executed by
  • the mobile terminal has been described in terms of its function.
  • a slide type mobile terminal among various types of mobile terminals such as a folding type, a bar type, a swing type, a slide type mobile terminal, and the like will be described as an example. Therefore, the present application can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
  • FIG. 2 is a block diagram of the electrical structure of the camera of FIG. 1.
  • the photographic lens 1211 is composed of a plurality of optical lenses for forming a subject image, and is a single focus lens or a zoom lens.
  • the photographic lens 1211 is movable in the optical axis direction under the control of the lens driver 1221, and the lens driver 1221 controls the focus position of the photographic lens 1211 in accordance with a control signal from the lens driving control circuit 1222, and can also be controlled in the case of the zoom lens. Focus distance.
  • the lens drive control circuit 1222 performs drive control of the lens driver 1221 in accordance with a control command from the microcomputer 1217.
  • An imaging element 1212 is disposed on the optical axis of the photographic lens 1211 near the position of the subject image formed by the photographic lens 1211.
  • the imaging element 1212 is for capturing an image of a subject and acquiring captured image data.
  • Photodiodes constituting each pixel are arranged two-dimensionally and in a matrix on the imaging element 1212. Each photodiode generates a photoelectric conversion current corresponding to the amount of received light, which is subjected to charge accumulation by a capacitor connected to each photodiode.
  • the front surface of each pixel is provided with a Bayer array of RGB color filters.
  • the imaging element 1212 is connected to the imaging circuit 1213.
  • the imaging circuit 1213 performs charge accumulation control and image signal readout control in the imaging element 1212, and performs waveform shaping after reducing the reset noise of the read image signal (analog image signal). Further, gain improvement or the like is performed to obtain an appropriate signal level.
  • the imaging circuit 1213 is connected to an A/D converter 1214 that performs analog-to-digital conversion on the analog image signal and outputs a digital image signal (hereinafter referred to as image data) to the bus 1227.
  • A/D converter 1214 that performs analog-to-digital conversion on the analog image signal and outputs a digital image signal (hereinafter referred to as image data) to the bus 1227.
  • the bus 1227 is a transmission path for transmitting various data read or generated inside the camera.
  • the A/D converter 1214 is connected to the bus 1227, and an image processor 1215, a JPEG processor 1216, a microcomputer 1217, a SDRAM (Synchronous Dynamic Random Access Memory) 1218, and a memory interface are also connected. (hereinafter referred to as memory I/F) 1219, LCD (Liquid Crystal Display) driver 1220.
  • memory I/F memory I/F
  • LCD Liquid Crystal Display
  • the image processor 1215 performs various kinds of images such as OB subtraction processing, white balance adjustment, color matrix calculation, gamma conversion, color difference signal processing, noise removal processing, simultaneous processing, edge processing, and the like on the image data based on the output of the imaging element 1212. deal with.
  • the JPEG processor 1216 compresses the image data read out from the SDRAM 1218 in accordance with the JPEG compression method when the image data is recorded on the recording medium 1225. Further, the JPEG processor 1216 performs decompression of JPEG image data for image reproduction display.
  • the file recorded on the recording medium 1225 is read, and after the compression processing is performed in the JPEG processor 1216, the decompressed image data is temporarily stored in the SDRAM 1218 and displayed on the LCD 1226.
  • the JPEG method is adopted as the image compression/decompression method.
  • the compression/decompression method is not limited thereto, and other compression/decompression methods such as MPEG, TIFF, and H.264 may be used.
  • the microcomputer 1217 functions as a control unit of the entire camera, and collectively controls various processing sequences of the camera.
  • the microcomputer 1217 is connected to the operation unit 1223 and the flash memory 1224.
  • the operating unit 1223 includes, but is not limited to, a physical button or a virtual button, and the entity or virtual button may be a power button, a camera button, an edit button, a dynamic image button, a reproduction button, a menu button, a cross button, an OK button, a delete button, an enlarge button
  • An operation control such as various input buttons and various input keys detects an operation state of these operation controls, and outputs the detection result to the microcomputer 1217.
  • a touch panel is provided on the front surface of the LCD 1226 as a display, and the touch position of the user is detected, and the touch position is output to the microcomputer 1217.
  • Microcomputer 1217 based on operation The detection result of the operation position of the unit 1223 performs various processing sequences corresponding to the operation of the user.
  • the flash memory 1224 stores programs for executing various processing sequences of the microcomputer 1217.
  • the microcomputer 1217 performs overall control of the camera in accordance with the program. Further, the flash memory 1224 stores various adjustment values of the camera, and the microcomputer 1217 reads out the adjustment value, and performs control of the camera in accordance with the adjustment value.
  • the SDRAM 1218 is an electrically rewritable volatile memory for temporarily storing image data or the like.
  • the SDRAM 1218 temporarily stores image data output from the A/D converter 1214 and image data processed in the image processor 1215, the JPEG processor 1216, and the like.
  • the memory interface 1219 is connected to the recording medium 1225, and performs control for writing image data and a file header attached to the image data to the recording medium 1225 and reading out from the recording medium 1225.
  • the recording medium 1225 is, for example, a recording medium such as a memory card that can be detachably attached to the camera body.
  • the recording medium 1225 is not limited thereto, and may be a hard disk or the like built in the camera body.
  • the LCD driver 1220 is connected to the LCD 1226, and stores image data processed by the image processor 1215 in the SDRAM 1218.
  • the image data stored in the SDRAM 1218 is read and displayed on the LCD 1226, or the image data stored in the JPEG processor 1216 is compressed.
  • the JPEG processor 1216 reads the compressed image data of the SDRAM 1218, decompresses it, and displays the decompressed image data through the LCD 1226.
  • the LCD 1226 is configured to display an image on the back of the camera body. However, it is not limited thereto, and various display panels (LCD 1226) such as an organic EL may be used.
  • Embodiments of the present invention provide an image denoising device.
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of an image denoising apparatus according to the present application.
  • the image denoising device includes:
  • the first obtaining module 10 is configured to acquire a continuous multi-frame image captured by the terminal, and use one of the multi-frame images as a sample image, and the rest as a to-be-contrast image, where the multi-frame image format For RGB image format;
  • the terminal When the terminal is photographing using a built-in or external camera, the terminal acquires during the shooting process a continuous multi-frame image, wherein one of the multi-frame images is used as a sample image, and an image other than the sample image is used as an image to be compared, and the sample image and the image to be compared are RGB. Image format.
  • the terminal includes, but is not limited to, a smart phone, a personal computer. In this embodiment, the terminal is a smart phone. If the smart phone captures an image in its built-in camera, it acquires four consecutive frames of images, and uses the acquired first frame image as a sample image to acquire the acquired image. The second, third, and fourth frame images are used as images to be compared.
  • the second obtaining module 20 is configured to respectively acquire luminance values of R, G, and B components of each pixel of the sample image, and luminance values of R, G, and B components of each pixel of the image to be compared;
  • the terminal acquires the sample image and the image to be compared, parsing the sample image and the image to be compared, and acquiring a luminance value and a G component of an R component of each pixel in the sample image.
  • a luminance value and a luminance value of the B component, and a luminance value of the R component of each pixel in the image to be compared, a luminance value of the G component, and a luminance value of the B component For example, when the smart phone acquires one frame of the sample image and three frames of the image to be compared, parsing the sample image to obtain a luminance value and a G component of an R component of each pixel in the sample image.
  • the brightness value and the brightness value of the B component and parsing the three images to be compared, respectively, to obtain the luminance value of the R component, the luminance value of the G component, and the B component of each pixel in the image to be compared in the first frame.
  • a brightness value obtaining a brightness value of the R component of each pixel in the image to be compared in the second frame, a brightness value of the G component, and a brightness value of the B component; obtaining each pixel in the image to be compared in the third frame
  • the processing module 30 is configured to: if the luminance values of the R, G, and B components of each pixel of the sample image are different from the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared The value is within the first preset range, and the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value between each pixel point of the image to be compared and the sample image according to the image to be compared To the image after denoising.
  • the processing module 30 includes:
  • a determining unit configured to determine a difference between a luminance value of R, G, and B components of each pixel of the sample image and a luminance value of R, G, and B components corresponding to each pixel of the image to be compared Determining, in the first preset range, brightness values of R, G, and B components of each pixel of the image to be compared corresponding to the difference in the first preset range;
  • a second calculating unit configured to respectively calculate an average value of the R component luminance values and an average value of the G component luminance values between the to-be-compared image and the pixel image in the first preset range And the average value of the B component luminance values;
  • the second processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
  • the terminal obtains the luminance value of the R component of each pixel point of the sample image and the image to be compared, the luminance value of the G component, and the luminance value of the B component, the R of each pixel of the sample image is obtained.
  • the brightness value of the component is compared with the brightness value of the R component of each pixel of the image to be compared, and the brightness value of the R component of each pixel of the sample image is obtained corresponding to each pixel of the image to be compared.
  • a difference between luminance values of the R component comparing a luminance value of a G component of each pixel of the sample image with a luminance value of a G component of each pixel of the image to be compared, to obtain the a luminance value of a G component of each pixel of the sample image corresponds to a difference between luminance values of a G component of each pixel of the image to be compared; and a luminance value of a B component of each pixel of the sample image Corresponding to the brightness value of the B component of each pixel of the image to be compared, obtaining a brightness value of the B component of each pixel of the sample image corresponding to the B component of each pixel of the image to be compared Between brightness values Value.
  • a difference between a luminance value of an R component between each pixel point of the sample image and each pixel of the image to be compared a difference between a luminance value of a G component, and a luminance value of a B component.
  • the difference between the G component luminance value and the B component luminance value is Determining, in the first preset range, a luminance value of the R component of the image to be compared corresponding to the difference of the luminance values of the R component in the first preset range, and recording the luminance value of the R0 component; Determining, according to a difference between the G component luminance values in the first preset range, a luminance value of the G component of the image to be compared, as a luminance value of the G0 component; determining to be within the first preset range The luminance value of the B component of the image to be compared corresponding to the difference of the B component luminance values is recorded as the luminance value of the B0 component.
  • the terminal calculates an average value of the luminance value of the R component of the sample image and the luminance value of the R0 component to obtain an average value of the luminance values of the R component; and calculates a luminance value of the G component of the sample image and the G0 component.
  • An average value of the luminance values, an average value of the luminance values of the G components is obtained; and a luminance value of the B component of the sample image is calculated
  • An average value of the B component luminance values is obtained as an average value of the B component luminance values.
  • the terminal uses the average value of the R component luminance values of each pixel as the average of the R component image and the G component luminance value of the denoised image as the average of the G component image and the B component luminance value of the denoised image.
  • the terminal recombines the R component image, the G component image, and the B component image of the denoised image into a new image, and the recombined new image is Noise after the image.
  • the terminal may further recombine the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value into a new pixel point, and use the new pixel point as a new image.
  • the pixel is obtained, and the new image is obtained, and the new image is the image after denoising.
  • the terminal displays the denoised image output in its screen.
  • the first preset range is determined according to the size of the ambient noise at the time of the current shooting, and may be set to be -10 to 10, or set to -20 to 20.
  • the smartphone passes the luminance value of the R component of the sample image pixel point and the R component of the corresponding pixel point in the image to be compared in the first frame a luminance value obtained by obtaining a difference between a luminance value of an R component of the pixel of the sample image and a luminance value of an R component of a corresponding pixel in the image to be compared in the first frame, denoted as R1; a luminance value of the R component of the pixel and a luminance value of the R component of the corresponding pixel in the image to be compared in the second frame, to obtain a luminance value of the R component of the pixel of the sample image and the image to be compared in the second frame
  • R2 The difference between the luminance values of the R components of the corresponding pixel points
  • the smart phone determines that the R1, R2, and R3 are in the range of -10 to 10 (in the embodiment, the first preset range takes a value of -10 to 10), that is, the R1, R2 And R3 is greater than or equal to -10 and less than or equal to 10.
  • the smart phone determines that the R1, R2, and R3 are greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the sample image pixel point, and corresponding pixel in the first frame to be compared image
  • Average of the four R components The average value between the luminance values is used as the luminance value of the R component of the new pixel corresponding to the position of the denoised image.
  • the smart phone determines that the R1 and R3 are greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the sample image pixel point, and R of the corresponding pixel in the first frame to be compared image
  • the luminance value of the component and the luminance value of the R component of the corresponding pixel point in the third frame to be compared image, the average value between the luminance values of the three R components, and the average value between the luminance values of the three R components is taken as
  • the denoised image corresponds to the luminance value of the R component of the new pixel at the location.
  • the smart phone determines that the R1 is greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the pixel of the sample image and an R component of the corresponding pixel in the image to be compared in the first frame.
  • the luminance value is an average value between the luminance values of the two R components, and the average value between the luminance values of the two R components is used as the luminance value of the R component of the new pixel corresponding to the position of the denoised image.
  • the process of processing the brightness value of the G component and the brightness value of the B component by the smart phone is similar to the process of processing the brightness value of the R component, and details are not described herein again.
  • the smart phone obtains an average value of the R component luminance values, an average value of the G component luminance values, and an average value of the B component luminance values between the sample image and each pixel of the image to be compared
  • the smart phone uses the average value of the R component luminance values of each pixel as the average of the R component image and the G component luminance value of the denoised image as the average value of the G component image and the B component luminance value of the denoised image.
  • FIG. 7 is a schematic diagram of an image obtained by a terminal without a past noise processing according to an embodiment of the present invention
  • FIG. 8 is a de-noised image taken by a terminal according to an embodiment of the present invention
  • a schematic diagram of the resulting image Comparing the above FIG. 7 with the FIG. 8, it can be seen that the sharpness is significantly improved after the image is denoised.
  • the luminance values of the R, G, and B components of the sample image in the image are respectively obtained by comparing the luminance values of the R, G, and B components of the sample image in the terminal, when the R, G, and the R of the sample image are And the difference between the brightness value of the B component and the brightness value of the R, G, and B components of each pixel of the image to be compared is within a first preset range, according to the image to be compared and the sample
  • the average of the R component luminance values between each pixel of the image, the average of the G component luminance values, and the average of the B component luminance values are obtained as denoised images.
  • the new pixel is used as the pixel of the denoised image to obtain the denoised image, which avoids the calculation amount in the image denoising process, the denoising effect is poor, and the image edge detail is easily caused.
  • the problem of loss is easily caused.
  • FIG. 4 is a schematic diagram of functional modules of a second embodiment of an image denoising apparatus according to the present application.
  • a second embodiment of the image denoising apparatus of the present application is proposed based on the first embodiment.
  • the image denoising device further includes:
  • the calculating module 40 is configured to separately calculate, between the luminance values of the R, G, and B components of each pixel of the sample image, and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared. a difference, the difference being used as a first difference;
  • the determining module 50 is configured to determine whether the first difference is not within the first preset range
  • the terminal When the terminal acquires a luminance value of an R component of each pixel of the sample image and a luminance value of an R component of each pixel of the image to be compared, the terminal calculates a pixel of the sample image.
  • the difference between the luminance value of the R component and the luminance value of the R component of the corresponding pixel in the image to be compared, and the difference is taken as the first difference of the luminance value of the R component.
  • the process of obtaining the first difference between the first difference value of the G component luminance value and the first difference value of the B component luminance value is similar to the process of obtaining the first difference value of the R component luminance value, and details are not described herein again.
  • the terminal When the terminal obtains the first difference of the R component luminance values, it is determined whether the first difference of the R component luminance values is within the first preset range.
  • the terminal acquires the luminance value of the G component of each pixel of the sample image and the luminance value of the B component and the luminance value of the G component and the luminance component of the B component of each pixel of the image to be compared, Processing of the difference between the luminance value of the G component of the sample image pixel point and the luminance value of the B component and the luminance value of the G component of the corresponding pixel in the image to be compared and the luminance value of the B component The process is similar to the difference between the luminance value of the R component of the pixel of the sample image and the luminance value of the R component of the corresponding pixel in the image to be compared.
  • the smart phone determines whether the R1, R2, and R3 are greater than or equal to -10 and less than or equal to 10.
  • the processing of the value is similar to the difference between the luminance value of the R component of the pixel of the sample image and the luminance value of the R component of the corresponding pixel in the three frames of the image to be compared, and details are not described herein again.
  • the selecting module 60 is configured to select a preset number of pixel points within a preset range of each pixel point of the sample image if the first difference is not within the first preset range;
  • the second obtaining module 20 is further configured to acquire the brightness values of the R, G, and B components of the preset number of pixels;
  • the terminal determines that the first difference of the R component luminance values is not within the first preset range, that is, the luminance value of the R component of the sample image and the luminance of the R component of the image to be compared
  • the terminal selects a preset number of pixel points within a preset range of each pixel point of the sample image, and acquires the preset Set the luminance value of the R component of the number of pixels.
  • the preset number is set according to the noise level in the shooting scene, and may be set to select a pixel point in a region such as 3*3 or 5*5, centering on the pixel point currently selected by the terminal. .
  • FIG. 9 is a schematic diagram of a terminal selecting a preset number of pixel points in a preset range of a certain pixel point of a sample image according to an embodiment of the present invention.
  • the smartphone determines that none of R1, R2, and R3 is in the range of -10 to 10, the smartphone is within 3*3 of the pixel of the sample image.
  • Selecting 8 pixel points if the smart phone is processing the brightness value of the R component at the position P22 pixel in the sample image, then selecting P11, P12, P12, P21 within the range of the P22 pixel 3*3 8 pixels of P23, P31, P32 and P33.
  • the smart phone acquires the luminance values of the R components of the eight pixel points P11, P12, P12, P21, P23, P31, P32, and P33, respectively.
  • the processing of the terminal determines that the first difference of the G component luminance value and/or the first difference of the B component luminance value is not in the range of -10 to 10, the processing of the terminal and It is determined that none of R1, R2 and R3 Similar in the range of -10 to 10, and will not be described again here.
  • the calculating module 40 is further configured to separately calculate, between the luminance values of the R, G, and B components of the preset number of pixel points and the luminance values of the R, G, and B components of the sample image pixel point. The difference, as the second difference;
  • the terminal When the terminal obtains the luminance value of the R component of the preset number of pixel points, calculating a luminance value of the R component of the preset number of pixel points and an R component of the pixel of the sample image pixel a difference between the luminance values, the difference being the second difference of the luminance values of the R component; when the terminal obtains the luminance value of the G component of the preset number of pixels, a difference between a luminance value of a G component of a preset number of pixels and a luminance value of a G component of the pixel of the sample image, and the difference is used as a second difference of the luminance value of the G component; Calculating, when the terminal obtains the brightness value of the B component of the preset number of pixel points, calculating a brightness value of the B component of the preset number of pixel points and a brightness value of the B component of the sample image pixel point The difference between the differences is taken as the second difference of the B component luminance values.
  • FIG. 10 is a schematic diagram of luminance values of a R component of a certain pixel point and a preset number of pixel points of a sample image according to an embodiment of the present invention. As can be seen from FIG.
  • the R component of the P22 pixel has a luminance value of 5
  • the R component of the P11 pixel has a luminance value of 1
  • the R component of the P12 pixel has a luminance value of 2.
  • the luminance value of the R component of the P13 pixel is 3, the luminance value of the R component of the P21 pixel is 4, the luminance value of the R component of the P23 pixel is 6, and the R component of the P31 pixel
  • the luminance value is 9, the luminance value of the R component of the P32 pixel is 8, and the luminance value of the R component of the P33 pixel is 7.
  • the processing module 30 is further configured to: if the second difference is within the second preset range, according to the preset number of pixels corresponding to the second preset range, The average value of the R component luminance value between each pixel of the sample image, the average value of the G component luminance value, and the B component luminance The average of the values gives the image after denoising.
  • processing module 30 further includes:
  • a first calculating unit configured to separately calculate an average value of the obtained R component luminance values between the preset number of pixels and each pixel of the sample image, and an average value and a B component of the G component luminance values The average value of the brightness values;
  • the first processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
  • the terminal obtains a second difference value of the R component luminance value, and determines that the second difference value of the R component luminance value is within the second preset range, acquiring the second preset range Calculating the brightness value of the R component of the preset number of pixels, and calculating the brightness value of the R component of the preset number of pixel points corresponding to the second difference of the R component luminance values.
  • An average value of the R component luminance values of each pixel point of the sample image, and an average value of the R component luminance values is used as a luminance value of the R component of the new pixel point.
  • the processing procedure of the terminal and the determining The process of the second difference of the R component luminance values in the second preset range is similar, and details are not described herein again.
  • the second preset range may be consistent with the first preset range, or may be inconsistent with the first preset range.
  • the terminal obtains the luminance value of the R component of the new pixel point, the luminance value of the G component, and the luminance value of the B component, the luminance value of the R component of the new pixel point, the luminance value of the G component, and B
  • the luminance values of the components are recombined into new pixel points, and the new pixel points are taken as the pixels of the new image to obtain the new image, which is the denoised image.
  • the smart phone determines a brightness value of an R component of the P22 pixel point and a brightness value of an R component of the P13, P21, P23, and P33 pixel points, when the second preset range is -2 to 2
  • the difference between the range of -2 and 2 corresponds to the luminance values of the R components of the P13, P21, P23, and P33 pixel points being 3, 4, 6, and 7.
  • the smart phone calculates a luminance value 5 of the R component of the P22 pixel and an R component of the P13, P21, P23, and P33 pixel points
  • the luminance values are average values of 3, 4, 6, and 7, and the average value obtained is 5, and 5 is used as the luminance value of the R component of the pixel position of the denoising image P22.
  • the smart phone obtains the luminance value of the G component of the pixel position of the denoising image P22 and the luminance value of the B component, the luminance value of the R component of the P22 position pixel point, the luminance value of the G component, and the B component
  • the luminance values are recombined into P22 position pixel points of the denoised image.
  • the smart phone obtains a complete denoised image by this method.
  • the determining module 50 is further configured to determine whether the second difference is within a second preset range
  • the image denoising apparatus further includes a discarding module configured to discard the second difference that is not within the second preset range if the second difference is not within the second preset range Corresponding to the preset number of pixels.
  • the terminal acquires the second difference value of the R component luminance value, it is determined whether the second difference value of the R component luminance value is within the second preset range. If the second difference of the R component luminance values is not within the second preset range, the terminal discards the second difference of the R component luminance values that are not within the second preset range Corresponding to the brightness value of the R component of the preset number of pixel points.
  • the smartphone determines that the difference between the luminance value of the R component of the P22 pixel and the luminance value of the R component of the P11, P12, P31, and P32 pixels is not in the range of -2 to 2, Then, the luminance values of the R components of the P11, P12, P31, and P32 pixel points are discarded, and the luminance values of the R components of the P11, P12, P31, and P32 pixel points are not calculated.
  • the processing process of the terminal and the The process in which the second difference of the R component luminance values is not within the second preset range is similar, and is not described herein again.
  • the present embodiment passes the difference between the luminance values of the R, G, and B components of each pixel point of the sample image and the luminance values of the R, G, and B components of each pixel of the image to be compared.
  • a preset number of pixel points are selected within a preset range of each pixel point of the sample image, thereby obtaining a denoised image, thereby avoiding the process of denoising the image.
  • the calculation amount is large, the denoising effect is poor, and the problem of image edge detail loss is easily caused.
  • the embodiment of the invention further provides an image denoising method.
  • FIG. 5 is a schematic flowchart diagram of a first embodiment of an image denoising method according to the present application.
  • the image denoising method includes:
  • step S10 a continuous multi-frame image captured by the terminal is acquired, and one of the multi-frame images is used as a sample image, and the rest is used as an image to be compared, wherein the format of the multi-frame image is an RGB image format;
  • the terminal When the terminal is photographing using a built-in or external camera, the terminal acquires a continuous multi-frame image during shooting, and one of the multi-frame images is taken as a sample image, and the sample image is removed.
  • the outer image is the image to be compared, and the sample image and the image to be compared are in an RGB image format.
  • the terminal includes, but is not limited to, a smart phone, a personal computer. In this embodiment, the terminal is a smart phone. If the smart phone captures an image in its built-in camera, it acquires four consecutive frames of images, and uses the acquired first frame image as a sample image to acquire the acquired image.
  • the second, third, and fourth frame images are used as images to be compared.
  • Step S20 respectively acquiring luminance values of R, G, and B components of each pixel of the sample image, and luminance values of R, G, and B components of each pixel of the image to be compared;
  • the terminal acquires the sample image and the image to be compared, parsing the sample image and the image to be compared, and acquiring a luminance value and a G component of an R component of each pixel in the sample image.
  • a luminance value and a luminance value of the B component, and a luminance value of the R component of each pixel in the image to be compared, a luminance value of the G component, and a luminance value of the B component For example, when the smart phone acquires one frame of the sample image and three frames of the image to be compared, parsing the sample image to obtain a luminance value and a G component of an R component of each pixel in the sample image.
  • the brightness value and the brightness value of the B component and parsing the three images to be compared, respectively, to obtain the luminance value of the R component, the luminance value of the G component, and the B component of each pixel in the image to be compared in the first frame.
  • a brightness value obtaining a brightness value of the R component of each pixel in the image to be compared in the second frame, a brightness value of the G component, and a brightness value of the B component; obtaining each pixel in the image to be compared in the third frame
  • Step S30 if the difference between the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared is Within a predetermined range, denoising is obtained according to an average value of the R component luminance values, an average value of the G component luminance values, and an average value of the B component luminance values between the image to be compared and each pixel point of the sample image. After the image.
  • step S30 includes:
  • the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
  • the terminal obtains the luminance value of the R component of each pixel point of the sample image and the image to be compared, the luminance value of the G component, and the luminance value of the B component, the R of each pixel of the sample image is obtained.
  • the brightness value of the component is compared with the brightness value of the R component of each pixel of the image to be compared, and the brightness value of the R component of each pixel of the sample image is obtained corresponding to each pixel of the image to be compared.
  • a difference between luminance values of the R component comparing a luminance value of a G component of each pixel of the sample image with a luminance value of a G component of each pixel of the image to be compared, to obtain the a luminance value of a G component of each pixel of the sample image corresponds to a difference between luminance values of a G component of each pixel of the image to be compared; and a luminance value of a B component of each pixel of the sample image Corresponding to the brightness value of the B component of each pixel of the image to be compared, obtaining a brightness value of the B component of each pixel of the sample image corresponding to the B component of each pixel of the image to be compared Between brightness values Value.
  • a difference between a luminance value of an R component between each pixel point of the sample image and each pixel of the image to be compared a difference between a luminance value of a G component, and a luminance value of a B component.
  • the difference between the G component luminance value and the B component luminance value is Determining, in the first preset range, a luminance value of the R component of the image to be compared corresponding to the difference of the luminance values of the R component in the first preset range, and recording the luminance value of the R0 component; Determining, according to a difference between the G component luminance values in the first preset range, a luminance value of the G component of the image to be compared, as a luminance value of the G0 component; determining to be within the first preset range The difference corresponding to the difference of the B component luminance values The luminance value of the B component of the comparison image is recorded as the luminance value of the B0 component.
  • the terminal calculates an average value of the luminance value of the R component of the sample image and the luminance value of the R0 component to obtain an average value of the luminance values of the R component; and calculates a luminance value of the G component of the sample image and the G0 component.
  • An average value of the luminance values is obtained as an average value of the luminance values of the G components; an average value of the luminance values of the B components of the sample image and the luminance values of the B0 components is calculated to obtain an average value of the luminance values of the B components.
  • the terminal uses the average value of the R component luminance values of each pixel as the average of the R component image and the G component luminance value of the denoised image as the average of the G component image and the B component luminance value of the denoised image.
  • the terminal recombines the R component image, the G component image, and the B component image of the denoised image into a new image, and the recombined new image is Noise after the image.
  • the terminal may further recombine the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value into a new pixel point, and use the new pixel point as a new image.
  • the pixel is obtained, and the new image is obtained, and the new image is the image after denoising. Further, the terminal displays the denoised image output in its screen.
  • the first preset range is determined according to the size of the ambient noise at the time of the current shooting, and may be set to be -10 to 10, or set to -20 to 20.
  • the smartphone passes the luminance value of the R component of the sample image pixel point and the R component of the corresponding pixel point in the image to be compared in the first frame a luminance value obtained by obtaining a difference between a luminance value of an R component of the pixel of the sample image and a luminance value of an R component of a corresponding pixel in the image to be compared in the first frame, denoted as R1; a luminance value of the R component of the pixel and a luminance value of the R component of the corresponding pixel in the image to be compared in the second frame, to obtain a luminance value of the R component of the pixel of the sample image and the image to be compared in the second frame
  • R2 The difference between the luminance values of the R components of the corresponding pixel points
  • the smart phone determines that the R1, R2, and R3 are in the range of -10 to 10 (in the embodiment, the first preset range takes a value of -10 to 10), that is, the R1, R2 And R3 is greater than or equal to -10 and less than or equal to 10. If the smartphone determines that the R1, R2, and R3 are both If the value is greater than or equal to -10, and less than or equal to 10, the brightness value of the R component of the sample image pixel point, the brightness value of the R component of the corresponding pixel point in the first frame to be compared image, and the second frame to be compared image are calculated.
  • the average value between the two is used as the luminance value of the R component of the new pixel corresponding to the position of the denoised image.
  • the smart phone determines that the R1 and R3 are greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the sample image pixel point, and R of the corresponding pixel in the first frame to be compared image
  • the luminance value of the component and the luminance value of the R component of the corresponding pixel point in the third frame to be compared image, the average value between the luminance values of the three R components, and the average value between the luminance values of the three R components is taken as
  • the denoised image corresponds to the luminance value of the R component of the new pixel at the location.
  • the smart phone determines that the R1 is greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the pixel of the sample image and an R component of the corresponding pixel in the image to be compared in the first frame.
  • the luminance value is an average value between the luminance values of the two R components, and the average value between the luminance values of the two R components is used as the luminance value of the R component of the new pixel corresponding to the position of the denoised image.
  • the process of processing the brightness value of the G component and the brightness value of the B component by the smart phone is similar to the process of processing the brightness value of the R component, and details are not described herein again.
  • the smart phone obtains an average value of the R component luminance values, an average value of the G component luminance values, and an average value of the B component luminance values between the sample image and each pixel of the image to be compared
  • the smart phone uses the average value of the R component luminance values of each pixel as the average of the R component image and the G component luminance value of the denoised image as the average value of the G component image and the B component luminance value of the denoised image.
  • FIG. 7 is a schematic diagram of an image obtained by a terminal without a past noise processing according to an embodiment of the present invention
  • FIG. 8 is a de-noised image taken by a terminal according to an embodiment of the present invention
  • a schematic diagram of the resulting image Comparing the above FIG. 7 with the FIG. 8, it can be seen that the sharpness is significantly improved after the image is denoised.
  • the luminance values of the R, G, and B components of the sample image in the image are respectively obtained by comparing the luminance values of the R, G, and B components of the sample image in the terminal, when the R, G, and the R of the sample image are The brightness value of the B component and the brightness of the R, G, and B components of each pixel of the image to be compared And the corresponding difference between the values is within the first preset range, according to the average value of the R component luminance values between the image to be compared and each pixel point of the sample image, the average value of the G component luminance values, and B The average of the component luminance values gives the denoised image.
  • the new pixel points are used as The method of denoising the pixel points of the image obtains the denoised image, which avoids the problem of large calculation amount, poor denoising effect, and easy loss of image edge detail in the process of denoising the image.
  • FIG. 6 is a schematic flowchart diagram of a second embodiment of an image denoising method according to the present application.
  • the second embodiment of the image denoising method of the present application is proposed based on the first embodiment of the present application.
  • the image denoising method further includes:
  • Step S40 respectively calculating a difference between a luminance value of the R, G, and B components of each pixel of the sample image and a luminance value of the R, G, and B components corresponding to each pixel of the image to be compared, Taking the difference as the first difference;
  • Step S50 determining whether the first difference is not within the first preset range
  • the terminal When the terminal acquires a luminance value of an R component of each pixel of the sample image and a luminance value of an R component of each pixel of the image to be compared, the terminal calculates a pixel of the sample image.
  • the difference between the luminance value of the R component and the luminance value of the R component of the corresponding pixel in the image to be compared, and the difference is taken as the first difference of the luminance value of the R component.
  • the process of obtaining the first difference between the first difference value of the G component luminance value and the first difference value of the B component luminance value is similar to the process of obtaining the first difference value of the R component luminance value, and details are not described herein again.
  • the terminal When the terminal obtains the first difference of the R component luminance values, it is determined whether the first difference of the R component luminance values is within the first preset range.
  • the terminal acquires the luminance value of the G component of each pixel of the sample image and the luminance value of the B component and the luminance value of the G component and the luminance component of the B component of each pixel of the image to be compared, Processing of the difference between the luminance value of the G component of the sample image pixel point and the luminance value of the B component and the luminance value of the G component of the corresponding pixel in the image to be compared and the luminance value of the B component The process is similar to the difference between the luminance value of the R component of the pixel of the sample image and the luminance value of the R component of the corresponding pixel in the image to be compared.
  • the difference R3 between the luminance values of the R components.
  • the smart phone determines whether the R1, R2, and R3 are greater than or equal to -10 and less than or equal to 10.
  • the processing of the value is similar to the difference between the luminance value of the R component of the pixel of the sample image and the luminance value of the R component of the corresponding pixel in the three frames of the image to be compared, and details are not described herein again.
  • Step S60 If the first difference is not within the first preset range, select a preset number of pixels within a preset range of each pixel of the sample image;
  • Step S70 acquiring luminance values of R, G, and B components of the preset number of pixels
  • the terminal determines that the first difference of the R component luminance values is not within the first preset range, that is, the luminance value of the R component of the sample image and the luminance of the R component of the image to be compared
  • the terminal selects a preset number of pixel points within a preset range of each pixel point of the sample image, and acquires the preset Set the luminance value of the R component of the number of pixels.
  • the preset number is set according to the noise level in the shooting scene, and may be set to select a pixel point in a region such as 3*3 or 5*5, centering on the pixel point currently selected by the terminal. .
  • FIG. 9 is a schematic diagram of a terminal selecting a preset number of pixel points in a preset range of a certain pixel point of a sample image according to an embodiment of the present invention.
  • the smartphone determines that none of R1, R2, and R3 is in the range of -10 to 10, the smartphone is within 3*3 of the pixel of the sample image.
  • Selecting 8 pixel points if the smart phone is processing the brightness value of the R component at the position P22 pixel in the sample image, then selecting P11, P12, P12, P21 within the range of the P22 pixel 3*3 8 pixels of P23, P31, P32 and P33.
  • the smart phone acquires the P11, P12, P12, and P21, respectively.
  • the processing of the terminal determines that the first difference of the G component luminance value and/or the first difference of the B component luminance value is not in the range of -10 to 10, the processing of the terminal and It is determined that the R1, R2 and R3 are not similar in the range of -10 to 10, and will not be described herein.
  • Step S80 respectively calculating a difference between a luminance value of the R, G, and B components of the preset number of pixel points and a luminance value of the R, G, and B components of the pixel of the sample image, as a second Difference
  • the terminal When the terminal obtains the luminance value of the R component of the preset number of pixel points, calculating a luminance value of the R component of the preset number of pixel points and an R component of the pixel of the sample image pixel a difference between the luminance values, the difference being the second difference of the luminance values of the R component; when the terminal obtains the luminance value of the G component of the preset number of pixels, a difference between a luminance value of a G component of a preset number of pixels and a luminance value of a G component of the pixel of the sample image, and the difference is used as a second difference of the luminance value of the G component; Calculating, when the terminal obtains the brightness value of the B component of the preset number of pixel points, calculating a brightness value of the B component of the preset number of pixel points and a brightness value of the B component of the sample image pixel point The difference between the differences is taken as the second difference of the B component luminance values.
  • FIG. 10 is a schematic diagram of luminance values of a R component of a certain pixel point and a preset number of pixel points of a sample image according to an embodiment of the present invention. As can be seen from FIG.
  • the R component of the P22 pixel has a luminance value of 5
  • the R component of the P11 pixel has a luminance value of 1
  • the R component of the P12 pixel has a luminance value of 2.
  • the luminance value of the R component of the P13 pixel is 3, the luminance value of the R component of the P21 pixel is 4, the luminance value of the R component of the P23 pixel is 6, and the R component of the P31 pixel
  • the luminance value is 9, the luminance value of the R component of the P32 pixel is 8, and the luminance value of the R component of the P33 pixel is 7.
  • Step S90 if the second difference is in the second preset range, according to the preset number of pixel points corresponding to the second preset range and each pixel of the sample image
  • the average of the R component luminance values between the points, the average of the G component luminance values, and the average of the B component luminance values are obtained as denoised images.
  • step S90 includes:
  • the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
  • the terminal obtains a second difference value of the R component luminance value, and determines that the second difference value of the R component luminance value is within the second preset range, acquiring the second preset range Calculating the brightness value of the R component of the preset number of pixels, and calculating the brightness value of the R component of the preset number of pixel points corresponding to the second difference of the R component luminance values.
  • An average value of the R component luminance values of each pixel point of the sample image, and an average value of the R component luminance values is used as a luminance value of the R component of the new pixel point.
  • the processing procedure of the terminal and the determining The process of the second difference of the R component luminance values in the second preset range is similar, and details are not described herein again.
  • the second preset range may be consistent with the first preset range, or may be inconsistent with the first preset range.
  • the terminal obtains the luminance value of the R component of the new pixel point, the luminance value of the G component, and the luminance value of the B component, the luminance value of the R component of the new pixel point, the luminance value of the G component, and B
  • the luminance values of the components are recombined into new pixel points, and the new pixel points are taken as the pixels of the new image to obtain the new image, which is the denoised image.
  • the smart phone determines a brightness value of an R component of the P22 pixel point and a brightness value of an R component of the P13, P21, P23, and P33 pixel points, when the second preset range is -2 to 2
  • the difference between the range of -2 and 2 corresponds to the luminance values of the R components of the P13, P21, P23, and P33 pixel points being 3, 4, 6, and 7.
  • the smart phone calculates a luminance value 5 of the R component of the P22 pixel and an R component of the P13, P21, P23, and P33 pixel points
  • the luminance values are average values of 3, 4, 6, and 7, and the average value obtained is 5, and 5 is used as the luminance value of the R component of the pixel position of the denoising image P22.
  • the smart phone obtains the luminance value of the G component of the pixel position of the denoising image P22 and the luminance value of the B component, the luminance value of the R component of the P22 position pixel point, the luminance value of the G component, and the B component
  • the luminance values are recombined into P22 position pixel points of the denoised image.
  • the smart phone obtains a complete denoised image by this method.
  • the image denoising method further includes:
  • the terminal acquires the second difference value of the R component luminance value, it is determined whether the second difference value of the R component luminance value is within the second preset range. If the second difference of the R component luminance values is not within the second preset range, the terminal discards the second difference of the R component luminance values that are not within the second preset range Corresponding to the brightness value of the R component of the preset number of pixel points.
  • the smartphone determines that the difference between the luminance value of the R component of the P22 pixel and the luminance value of the R component of the P11, P12, P31, and P32 pixels is not in the range of -2 to 2, Then, the luminance values of the R components of the P11, P12, P31, and P32 pixel points are discarded, and the luminance values of the R components of the P11, P12, P31, and P32 pixel points are not calculated.
  • the processing process of the terminal and the The process in which the second difference of the R component luminance values is not within the second preset range is similar, and is not described herein again.
  • the present embodiment passes the difference between the luminance values of the R, G, and B components of each pixel point of the sample image and the luminance values of the R, G, and B components of each pixel of the image to be compared.
  • a preset number of pixel points are selected within a preset range of each pixel point of the sample image, thereby obtaining a denoised image, thereby avoiding the process of denoising the image.
  • the calculation amount is large, the denoising effect is poor, and the problem of image edge detail loss is easily caused.
  • Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that implement the image denoising method described above when the computer executable instructions are executed.
  • the instructions are related to hardware (eg, a processor) that can be stored in a computer readable storage medium, such as a read only memory, a magnetic disk, or an optical disk.
  • a computer readable storage medium such as a read only memory, a magnetic disk, or an optical disk.
  • all or part of the steps of the above embodiments may be implemented using one or more integrated circuits.
  • each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function.
  • This application is not limited to any specific form of combination of hardware and software.
  • An embodiment of the present application provides an image denoising apparatus and method, which respectively denoises luminance values of R, G, and B components of an image, and then recombines luminance values of the denoised R, G, and B components into The new pixel points, the new pixel point is used as the pixel point of the denoised image to obtain the denoised image, which avoids the calculation amount in the image denoising process, the denoising effect is poor, and the image is easily caused.
  • the problem of loss of edge detail is provided.

Abstract

An image denoising method, comprising: acquiring a consecutive plurality of image frames taken by a terminal, and setting one image frame amongst the plurality of image frames as a sample image, and setting the remaining image frames as images to be compared; respectively acquiring the brightness of the R, G, and B components of every pixel point of the sample image and the brightness of the R, G, and B components of every pixel point of the images to be compared; if the difference between the brightness of the R, G, and B components of every pixel point of the sample image and the brightness of the R, G, and B components corresponding to every pixel point of the images to be compared is within a first present range, then obtaining a denoised image on the basis of the average of the brightness of the R components, the average of the brightness of the G components, and the average of the B components between the images to be compared and the sample image. The present method prevents the problem of the loss of detail at the image edges easily caused by the large amount of calculation and the poor denoising effects during an image denoising process.

Description

图像去噪装置和方法Image denoising device and method 技术领域Technical field
本申请涉及但不限于图像领域,尤其涉及一种图像去噪装置和方法。The present application relates to, but is not limited to, the field of images, and in particular, to an image denoising apparatus and method.
背景技术Background technique
随着科学技术的发展,智能手机的拍照功能也越来越完善。相对于数码相机来说,智能手机具有体积小便于携带等特性。因此,越来越多的人更热衷于使用智能手机拍照功能来记录生活中的美好瞬间。与此同时,人们对智能手机拍摄的图像质量要求也越来越高。但是如果在亮度不够的场合,智能手机所拍摄出来的图像中经常会带有一些噪声(亮度噪声加色度噪声),并且亮度越低,噪声越大,由于噪声的存在,严重的影响图像的质量。With the development of science and technology, the camera function of smart phones has become more and more perfect. Compared with digital cameras, smart phones have the characteristics of small size and portability. Therefore, more and more people are more keen to use the smart phone camera function to record the beautiful moments in life. At the same time, people are increasingly demanding image quality for smartphones. However, if the brightness is not enough, the image captured by the smartphone often has some noise (brightness noise plus chrominance noise), and the lower the brightness, the louder the noise, the serious influence on the image due to the presence of noise. quality.
传统去噪算法有:均值,中值,高斯滤波,双边滤波等等。双边滤波能在去除噪声的同时,较好的保留边缘,但是在噪声比较大的情况下滤波效果不明显,并且计算量很大,在滤波窗口增大的情况下,很难做到实时处理;均值,中值,高斯能较好的滤除噪声,但是很容易模糊掉边缘,并且随着滤波窗口的增大,也很难做到实时处理。还有可以通过带运动估计的3D(3Dimensions,三维)去噪,在使用带运动估计的3D去噪的过程中,首先要进行运动估计,然后再进行3D去噪操作,而运动估计需要很大的计算量,并且也不能保证百分之百的准确性。Traditional denoising algorithms include: mean, median, Gaussian filtering, bilateral filtering, and so on. Bilateral filtering can preserve the edge while removing noise, but the filtering effect is not obvious when the noise is relatively large, and the calculation amount is large. When the filtering window is increased, it is difficult to perform real-time processing. Mean, median, and Gaussian can filter out noise better, but it is easy to blur out the edges, and as the filter window increases, it is difficult to do real-time processing. There is also 3D (3Dimensions) denoising with motion estimation. In the process of 3D denoising with motion estimation, motion estimation is first performed, then 3D denoising operation is performed, and motion estimation needs to be large. The amount of calculation, and can not guarantee 100% accuracy.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本申请提出一种图像去噪装置和方法,旨在解决相关技术在对图像进行去噪的过程中,计算量大,去噪效果差,容易造成图像边缘细节损失的技术问题。The present application proposes an image denoising apparatus and method, which aims to solve the technical problem that the related art has large calculation amount, poor denoising effect, and easy loss of image edge detail in the process of denoising the image.
本发明实施例提供一种图像去噪装置,所述装置包括: An embodiment of the present invention provides an image denoising device, where the device includes:
第一获取模块,设置为获取终端拍摄的连续的多帧图像,将所述多帧图像中的其中一帧图像作为样本图像,其余的作为待对比图像,其中,所述多帧图像的格式为RGB图像格式;a first acquiring module, configured to acquire a continuous multi-frame image captured by the terminal, using one of the multi-frame images as a sample image, and the rest as a to-be-contrast image, wherein the format of the multi-frame image is RGB image format;
第二获取模块,设置为分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值;a second acquiring module, configured to respectively acquire luminance values of R, G, and B components of each pixel of the sample image, and luminance values of R, G, and B components of each pixel of the image to be compared;
处理模块,设置为若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。a processing module configured to: if a luminance value of R, G, and B components of each pixel of the sample image is different from a luminance value of R, G, and B components corresponding to each pixel of the image to be compared In the first preset range, according to the average value of the R component luminance value between the image to be compared and each pixel point of the sample image, the average value of the G component luminance value, and the average value of the B component luminance value are obtained. Denoised image.
可选地,所述图像去噪装置还包括:Optionally, the image denoising device further includes:
计算模块,设置为分别计算所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值,将所述差值作为第一差值;a calculation module, configured to separately calculate a difference between a luminance value of the R, G, and B components of each pixel of the sample image and a luminance value of the R, G, and B components corresponding to each pixel of the image to be compared a value, the difference being the first difference;
判断模块,设置为判断所述第一差值是否都未在第一预设范围内;a determining module, configured to determine whether the first difference is not within the first preset range;
选取模块,设置为若所述第一差值都未在所述第一预设范围内,则在所述样本图像每个像素点的预设范围内选取预设个数的像素点;Selecting a module, if the first difference is not within the first preset range, selecting a preset number of pixels within a preset range of each pixel of the sample image;
所述第二获取模块,还设置为获取所述预设个数的像素点的R、G和B分量的亮度值;The second acquiring module is further configured to acquire a brightness value of the R, G, and B components of the preset number of pixels;
所述计算模块,还设置为分别计算所述预设个数的像素点的R、G和B分量的亮度值与所述样本图像像素点的R、G和B分量的亮度值之间的差值,作为第二差值;The calculating module is further configured to separately calculate a difference between a luminance value of the R, G, and B components of the preset number of pixel points and a luminance value of the R, G, and B components of the sample image pixel point. Value as the second difference;
所述处理模块,还设置为若所述第二差值在第二预设范围内,则根据所述在第二预设范围内所对应的所述预设个数的像素点与所述样本图像的每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。The processing module is further configured to: if the second difference is within the second preset range, according to the preset number of pixels corresponding to the sample in the second preset range, and the sample The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values between each pixel of the image result in a denoised image.
可选地,所述判断模块,还设置为判断所述第二差值是否在第二预设范围内; Optionally, the determining module is further configured to determine whether the second difference is within a second preset range;
所述图像去噪装置还包括丢弃模块,设置为若所述第二差值未在所述第二预设范围内,则丢弃所述未在所述第二预设范围内的第二差值所对应的所述预设个数的像素点。The image denoising apparatus further includes a discarding module configured to discard the second difference that is not within the second preset range if the second difference is not within the second preset range Corresponding to the preset number of pixels.
可选地,所述处理模块包括:Optionally, the processing module includes:
获取单元,设置为若所述第二差值在所述第二预设范围内,则获取在所述第二预设范围内的第二差值所对应的所述预设个数的像素点的R、G和B分量的亮度值;Obtaining, if the second difference is within the second preset range, acquiring the preset number of pixels corresponding to the second difference in the second preset range Luminance values of the R, G, and B components;
第一计算单元,设置为分别计算所获取的所述预设个数的像素点与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;a first calculating unit, configured to separately calculate an average value of the obtained R component luminance values between the preset number of pixels and each pixel of the sample image, and an average value and a B component of the G component luminance values The average value of the brightness values;
第一处理单元,设置为将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The first processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
可选地,所述处理模块还包括:Optionally, the processing module further includes:
确定单元,设置为若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则确定所述差值在所述第一预设范围内所对应的所述待对比图像每个像素点的R、G和B分量的亮度值;a determining unit, configured to determine a difference between a luminance value of R, G, and B components of each pixel of the sample image and a luminance value of R, G, and B components corresponding to each pixel of the image to be compared Determining, in the first preset range, brightness values of R, G, and B components of each pixel of the image to be compared corresponding to the difference in the first preset range;
第二计算单元,设置为分别计算在所述第一预设范围内的所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;a second calculating unit, configured to respectively calculate an average value of the R component luminance values and an average value of the G component luminance values between the to-be-compared image and the pixel image in the first preset range And the average value of the B component luminance values;
第二处理单元,设置为将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The second processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
可选地,所述第二获取模块,设置为解析所述样本图像和所述待对比图像,获取所述样本图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值,获取所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值。 Optionally, the second acquiring module is configured to parse the sample image and the image to be compared, and acquire a luminance value, a luminance component, and a B component of an R component of each pixel in the sample image. And a brightness value of the R component of each pixel in the image to be compared, a luminance value of the G component, and a luminance value of the B component.
可选地,所述处理模块还设置为根据拍摄场景中的噪声大小设定所述预设个数。Optionally, the processing module is further configured to set the preset number according to a noise level in the shooting scene.
可选地,所述处理模块还设置为根据拍摄时所在环境噪声的大小设定所述第一预设范围。Optionally, the processing module is further configured to set the first preset range according to a size of ambient noise at the time of shooting.
可选地,所述第一预设范围与所述第二预设范围一致。Optionally, the first preset range is consistent with the second preset range.
可选地,所述处理模块还设置为将所述去噪后的图像输出显示在屏幕中。Optionally, the processing module is further configured to display the denoised image output in a screen.
此外,本发明实施例还提供一种图像去噪方法,所述方法包括以下步骤:In addition, an embodiment of the present invention further provides an image denoising method, where the method includes the following steps:
获取终端拍摄的连续的多帧图像,将所述多帧图像中的其中一帧图像作为样本图像,其余的作为待对比图像,其中,所述多帧图像的格式为RGB图像格式;Obtaining a continuous multi-frame image captured by the terminal, using one of the multi-frame images as a sample image, and the rest as an image to be compared, wherein the format of the multi-frame image is an RGB image format;
分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值;And acquiring, respectively, brightness values of R, G, and B components of each pixel of the sample image, and brightness values of R, G, and B components of each pixel of the image to be compared;
若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。If the difference between the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared is at the first preset In the range, the denoised image is obtained according to an average value of the R component luminance value between the pixel to be compared and each pixel point of the sample image, an average value of the G component luminance value, and an average value of the B component luminance value. .
可选地,所述分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值的步骤之后,所述图像去噪方法还包括:Optionally, the step of respectively acquiring the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components of each pixel of the image to be compared The image denoising method further includes:
分别计算所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值,将所述差值作为第一差值;Calculating, respectively, a difference between a luminance value of R, G, and B components of each pixel of the sample image and a luminance value of R, G, and B components corresponding to each pixel of the image to be compared, The difference is taken as the first difference;
判断所述第一差值是否都未在第一预设范围内;Determining whether the first difference is not within the first preset range;
若所述第一差值都未在所述第一预设范围内,则在所述样本图像每个像素点的预设范围内选取预设个数的像素点;If the first difference is not within the first preset range, selecting a preset number of pixels within a preset range of each pixel of the sample image;
获取所述预设个数的像素点的R、G和B分量的亮度值;Obtaining brightness values of R, G, and B components of the preset number of pixels;
分别计算所述预设个数的像素点的R、G和B分量的亮度值与所述样本 图像像素点的R、G和B分量的亮度值之间的差值,作为第二差值;Calculating brightness values of the R, G, and B components of the preset number of pixels and the sample respectively a difference between luminance values of R, G, and B components of an image pixel as a second difference;
若所述第二差值在第二预设范围内,则根据所述在第二预设范围内所对应的所述预设个数的像素点与所述样本图像的每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。If the second difference is within the second preset range, according to the preset number of pixels corresponding to the second preset range and each pixel of the sample image The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are obtained as denoised images.
可选地,所述分别计算所述预设个数的像素点的R、G和B分量的亮度值与所述样本图像像素点的R、G和B分量的亮度值之间的差值,作为第二差值的步骤之后,所述图像去噪方法还包括:Optionally, the calculating, respectively, a difference between a luminance value of the R, G, and B components of the preset number of pixel points and a luminance value of the R, G, and B components of the sample image pixel point, After the step of the second difference, the image denoising method further includes:
判断所述第二差值是否在第二预设范围内;Determining whether the second difference is within a second preset range;
若所述第二差值未在所述第二预设范围内,则丢弃所述未在所述第二预设范围内的第二差值所对应的所述预设个数的像素点。And if the second difference is not in the second preset range, discarding the preset number of pixel points corresponding to the second difference that is not in the second preset range.
可选地,所述若所述第二差值在第二预设范围内,则根据所述在第二预设范围内所对应的所述预设个数的像素点与所述样本图像的每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像的步骤包括:Optionally, if the second difference is in the second preset range, according to the preset number of pixel points corresponding to the sample image in the second preset range The step of obtaining the denoised image by the average of the R component luminance values, the average of the G component luminance values, and the B component luminance values between each pixel point includes:
若所述第二差值在所述第二预设范围内,则获取在所述第二预设范围内的第二差值所对应的所述预设个数的像素点的R、G和B分量的亮度值;If the second difference is within the second preset range, acquiring R, G, and the preset number of pixel points corresponding to the second difference in the second preset range The brightness value of the B component;
分别计算所获取的所述预设个数的像素点与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;Calculating, respectively, an average value of the acquired R component luminance values between the preset number of pixel points and each pixel point of the sample image, an average value of the G component luminance values, and an average value of the B component luminance values;
将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
可选地,所述若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像的步骤包括:Optionally, if the brightness value of the R, G, and B components of each pixel of the sample image is different from the brightness value of the R, G, and B components corresponding to each pixel of the image to be compared The value is within the first preset range, and the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value between each pixel point of the image to be compared and the sample image according to the image to be compared The steps to the denoised image include:
若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内, 则确定所述差值在所述第一预设范围内所对应的所述待对比图像每个像素点的R、G和B分量的亮度值;If the difference between the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared is at the first preset Within the scope, And determining, according to the difference, the luminance values of the R, G, and B components of each pixel of the image to be compared corresponding to the first preset range;
分别计算在所述第一预设范围内的所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;Calculating, respectively, an average value of the R component luminance values, an average value of the G component luminance values, and an average of the B component luminance values between the to-be-compared image in the first preset range and each pixel point of the sample image value;
将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
可选地,所述分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值,包括:解析所述样本图像和所述待对比图像,获取所述样本图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值,获取所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值。Optionally, the obtaining the luminance values of the R, G, and B components of each pixel of the sample image, and the luminance values of the R, G, and B components of each pixel of the image to be compared, respectively: And parsing the sample image and the image to be compared, acquiring a luminance value of an R component, a luminance value of a G component, and a luminance value of a B component of each pixel in the sample image, and acquiring each of the to-be-compared images The luminance value of the R component of the pixel, the luminance value of the G component, and the luminance value of the B component.
可选地,所述图像去噪方法还包括:根据拍摄场景中的噪声大小设定所述预设个数。Optionally, the image denoising method further includes: setting the preset number according to a noise level in a shooting scene.
可选地,所述图像去噪方法,还包括:根据拍摄时所在环境噪声的大小设定所述第一预设范围。Optionally, the image denoising method further includes: setting the first preset range according to a magnitude of ambient noise at the time of shooting.
可选地,所述第一预设范围与所述第二预设范围一致。Optionally, the first preset range is consistent with the second preset range.
可选地,所述图像去噪方法还包括:将所述去噪后的图像输出显示在屏幕中。Optionally, the image denoising method further comprises: displaying the denoised image output on a screen.
本发明实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述的图像去噪方法。Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that implement the image denoising method described above when the computer executable instructions are executed.
本发明实施例通过分别获取终端中的样本图像的R、G和B分量的亮度值,待对比图像每个像素点的R、G和B分量的亮度值,当所述样本图像的R、G和B分量的亮度值与所述待对比图像每个像素点的R、G和B分量的亮度值之间对应的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。通过分别对图像的R、G和B分量的亮度值进行去噪,再将去噪后的R、G和B分量的亮度值重新组合成新的 像素点,将所述新的像素点作为去噪后图像的像素点的方法得到去噪后的图像,避免了在对图像去噪过程中计算量大,去噪效果差,容易造成图像边缘细节损失的问题。In the embodiment of the present invention, the luminance values of the R, G, and B components of the sample image in the terminal are respectively obtained by comparing the luminance values of the R, G, and B components of the sample image in the terminal, when the R, G of the sample image is And the difference between the brightness value of the B component and the brightness value of the R, G, and B components of each pixel of the image to be compared is within a first preset range, according to the image to be compared and the The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values between each pixel of the sample image are obtained as denoised images. Denoising the luminance values of the R, G, and B components of the image separately, and then recombining the luminance values of the denoised R, G, and B components into new ones. Pixel point, the new pixel point is used as the pixel point of the image after denoising to obtain the denoised image, which avoids the calculation amount in the image denoising process, the denoising effect is poor, and the image edge detail is easily caused. The problem of loss.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1为实现本申请各个实施例一个可选的移动终端的硬件结构示意图;1 is a schematic structural diagram of hardware of an optional mobile terminal implementing various embodiments of the present application;
图2为图1中相机的电气结构框图;Figure 2 is a block diagram showing the electrical structure of the camera of Figure 1;
图3为本申请的图像去噪装置第一实施例的功能模块示意图;3 is a schematic diagram of functional modules of a first embodiment of an image denoising apparatus according to the present application;
图4为本申请的图像去噪装置第二实施例的功能模块示意图;4 is a schematic diagram of functional modules of a second embodiment of an image denoising apparatus according to the present application;
图5为本申请的图像去噪方法第一实施例的流程示意图;FIG. 5 is a schematic flowchart diagram of a first embodiment of an image denoising method according to the present application; FIG.
图6为本申请的图像去噪方法第二实施例的流程示意图;6 is a schematic flow chart of a second embodiment of an image denoising method according to the present application;
图7为本发明实施例中终端所拍摄的未经过去噪处理所得图像的一种示意图;FIG. 7 is a schematic diagram of an image captured by a terminal without past noise processing according to an embodiment of the present invention; FIG.
图8为本发明实施例中终端所拍摄的经过去噪处理所得图像的一种示意图;FIG. 8 is a schematic diagram of an image obtained by a denoising process captured by a terminal according to an embodiment of the present invention; FIG.
图9为本发明实施例中终端在样本图像总某个像素点的预设范围内选取预设个数的像素点的一种示意图;FIG. 9 is a schematic diagram of a terminal selecting a preset number of pixel points within a preset range of a certain pixel point of a sample image according to an embodiment of the present invention; FIG.
图10为本发明实施例中样本图像的某个像素点的R分量的亮度值和预设个数像素点的R分量的亮度值的一种示意图。FIG. 10 is a schematic diagram showing luminance values of R components of a certain pixel point of a sample image and luminance values of R components of a preset number of pixel points according to an embodiment of the present invention.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings.
本发明的实施方式Embodiments of the invention
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
现在将参考附图描述实现本申请各个实施例的移动终端。在后续的描述 中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本申请的说明,其本身并没有特定的意义。因此,“模块”与“部件”可以混合地使用。A mobile terminal implementing various embodiments of the present application will now be described with reference to the accompanying drawings. In the subsequent description The use of suffixes such as "module", "component" or "unit" for indicating an element is merely illustrative for the benefit of the present application and does not in itself have a particular meaning. Therefore, "module" and "component" can be used in combination.
移动终端可以以各种形式来实施。例如,本申请中描述的终端可以包括诸如移动电话、智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。下面,假设终端是移动终端。然而,本领域技术人员将理解的是,除了特别用于移动目的的元件之外,根据本申请的实施方式的构造也能够应用于固定类型的终端。The mobile terminal can be implemented in various forms. For example, the terminals described in this application may include, for example, mobile phones, smart phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablets), PMPs (Portable Multimedia Players), navigation devices, and the like. Mobile terminals and fixed terminals such as digital TVs, desktop computers, and the like. In the following, it is assumed that the terminal is a mobile terminal. However, those skilled in the art will appreciate that configurations in accordance with embodiments of the present application can be applied to fixed type terminals in addition to elements that are specifically for mobile purposes.
图1为实现本申请各个实施例一个可选的移动终端的硬件结构示意图。FIG. 1 is a schematic structural diagram of hardware of an optional mobile terminal implementing various embodiments of the present application.
移动终端100可以包括A/V(音频/视频)输入单元120、用户输入单元130、感测单元140、输出单元150、存储器160、接口单元170、控制器180和电源单元190等等。图1示出了具有各种组件的移动终端,但是应理解的是,并不要求实施所有示出的组件。可以替代地实施更多或更少的组件。将在下面详细描述移动终端的元件。The mobile terminal 100 may include an A/V (Audio/Video) input unit 120, a user input unit 130, a sensing unit 140, an output unit 150, a memory 160, an interface unit 170, a controller 180, a power supply unit 190, and the like. Figure 1 illustrates a mobile terminal having various components, but it should be understood that not all illustrated components are required to be implemented. More or fewer components can be implemented instead. The elements of the mobile terminal will be described in detail below.
A/V输入单元120用于接收音频或视频信号。A/V输入单元120可以包括相机121和麦克风122,相机121对在视频捕获模式或图像捕获模式中由图像捕获装置获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元151上。经相机121处理后的图像帧可以存储在存储器160(或其它存储介质)中,可以根据移动终端的构造提供两个或更多相机121。麦克风122可以在电话通话模式、记录模式、语音识别模式等等运行模式中经由麦克风接收声音(音频数据),并且能够将这样的声音处理为音频数据。处理后的音频(语音)数据可以在电话通话模式的情况下转换为可经由移动通信模块112发送到移动通信基站的格式输出。麦克风122可以实施各种类型的噪声消除(或抑制)算法以消除(或抑制)在接收和发送音频信号的过程中产生的噪声或者干扰。The A/V input unit 120 is for receiving an audio or video signal. The A/V input unit 120 may include a camera 121 and a microphone 122 that processes image data of still pictures or video obtained by the image capturing device in a video capturing mode or an image capturing mode. The processed image frame can be displayed on the display unit 151. The image frames processed by the camera 121 may be stored in the memory 160 (or other storage medium), and two or more cameras 121 may be provided according to the configuration of the mobile terminal. The microphone 122 can receive sound (audio data) via a microphone in an operation mode of a telephone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound as audio data. The processed audio (voice) data can be converted to a format output that can be transmitted to the mobile communication base station via the mobile communication module 112 in the case of a telephone call mode. The microphone 122 can implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated during the process of receiving and transmitting audio signals.
用户输入单元130可以根据用户输入的命令生成键输入数据以控制移动终端的各种操作。用户输入单元130允许用户输入各种类型的信息,并且可以包括键盘、锅仔片、触摸板(例如,检测由于被接触而导致的电阻、压力、 电容等等的变化的触敏组件)、滚轮、摇杆等等。特别地,当触摸板以层的形式叠加在显示单元151上时,可以形成触摸屏。The user input unit 130 may generate key input data according to a command input by the user to control various operations of the mobile terminal. The user input unit 130 allows the user to input various types of information, and may include a keyboard, a pot, a touch pad (eg, detecting resistance, pressure due to being touched, pressure, A touch sensitive component such as a capacitor or the like), a scroll wheel, a rocker, and the like. In particular, when the touch panel is superimposed on the display unit 151 in the form of a layer, a touch screen can be formed.
感测单元140检测移动终端100的当前状态,(例如,移动终端100的打开或关闭状态)、移动终端100的位置、用户对于移动终端100的接触(即,触摸输入)的有无、移动终端100的取向、移动终端100的加速或将速移动和方向等等,并且生成用于控制移动终端100的操作的命令或信号。例如,当移动终端100实施为滑动型移动电话时,感测单元140可以感测该滑动型电话是打开还是关闭。另外,感测单元140能够检测电源单元190是否提供电力或者接口单元170是否与外部装置耦接。The sensing unit 140 detects the current state of the mobile terminal 100 (eg, the open or closed state of the mobile terminal 100), the location of the mobile terminal 100, the presence or absence of contact (ie, touch input) by the user with the mobile terminal 100, and the mobile terminal. The orientation of 100, the acceleration of the mobile terminal 100 or the speed of movement and direction, and the like, and generates a command or signal for controlling the operation of the mobile terminal 100. For example, when the mobile terminal 100 is implemented as a slide type mobile phone, the sensing unit 140 can sense whether the slide type phone is turned on or off. In addition, the sensing unit 140 can detect whether the power supply unit 190 provides power or whether the interface unit 170 is coupled to an external device.
接口单元170用作至少一个外部装置与移动终端100连接可以通过的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。识别模块可以是存储用于验证用户使用移动终端100的各种信息并且可以包括用户识别模块(UIM)、客户识别模块(SIM)、通用客户识别模块(USIM)等等。另外,具有识别模块的装置(下面称为“识别装置”)可以采取智能卡的形式,因此,识别装置可以经由端口或其它连接装置与移动终端100连接。接口单元170可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到移动终端100内的一个或多个元件或者可以用于在移动终端和外部装置之间传输数据。The interface unit 170 serves as an interface through which at least one external device can connect with the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, and an audio input/output. (I/O) port, video I/O port, headphone port, and more. The identification module may be stored to verify various information used by the user using the mobile terminal 100 and may include a User Identification Module (UIM), a Customer Identification Module (SIM), a Universal Customer Identity Module (USIM), and the like. In addition, the device having the identification module (hereinafter referred to as "identification device") may take the form of a smart card, and thus the identification device may be connected to the mobile terminal 100 via a port or other connection device. The interface unit 170 can be configured to receive input from an external device (eg, data information, power, etc.) and transmit the received input to one or more components within the mobile terminal 100 or can be used at the mobile terminal and external device Transfer data between.
另外,当移动终端100与外部底座连接时,接口单元170可以用作允许通过其将电力从底座提供到移动终端100的路径或者可以用作允许从底座输入的各种命令信号通过其传输到移动终端的路径。从底座输入的各种命令信号或电力可以用作用于识别移动终端是否准确地安装在底座上的信号。输出单元150被构造为以视觉、音频和/或触觉方式提供输出信号(例如,音频信号、视频信号、警报信号、振动信号等等)。输出单元150可以包括显示单元151。In addition, when the mobile terminal 100 is connected to the external base, the interface unit 170 may function as a path through which power is supplied from the base to the mobile terminal 100 or may be used as a transmission of various command signals allowing input from the base to the mobile terminal 100 The path to the terminal. Various command signals or power input from the base can be used as signals for identifying whether the mobile terminal is accurately mounted on the base. Output unit 150 is configured to provide an output signal (eg, an audio signal, a video signal, an alarm signal, a vibration signal, etc.) in a visual, audio, and/or tactile manner. The output unit 150 may include a display unit 151.
显示单元151可以显示在移动终端100中处理的信息。例如,当移动终端100处于电话通话模式时,显示单元151可以显示与通话或其它通信(例如, 文本消息收发、多媒体文件下载等等)相关的用户界面(UI)或图形用户界面(GUI)。当移动终端100处于视频通话模式或者图像捕获模式时,显示单元151可以显示捕获的图像和/或接收的图像、示出视频或图像以及相关功能的UI或GUI等等。The display unit 151 can display information processed in the mobile terminal 100. For example, when the mobile terminal 100 is in the phone call mode, the display unit 151 can display a call or other communication (for example, Text messaging, multimedia file downloads, etc.) related user interface (UI) or graphical user interface (GUI). When the mobile terminal 100 is in a video call mode or an image capturing mode, the display unit 151 may display a captured image and/or a received image, a UI or GUI showing a video or image and related functions, and the like.
同时,当显示单元151和触摸板以层的形式彼此叠加以形成触摸屏时,显示单元151可以用作输入装置和输出装置。显示单元151可以包括液晶显示器(LCD)、薄膜晶体管LCD(TFT-LCD)、有机发光二极管(OLED)显示器、柔性显示器、三维(3D)显示器等等中的至少一种。这些显示器中的一些可以被构造为透明状以允许用户从外部观看,这可以称为透明显示器,典型的透明显示器可以例如为TOLED(透明有机发光二极管)显示器等等。根据特定想要的实施方式,移动终端100可以包括两个或更多显示单元(或其它显示装置),例如,移动终端可以包括外部显示单元(未示出)和内部显示单元(未示出)。触摸屏可用于检测触摸输入压力以及触摸输入位置和触摸输入面积。Meanwhile, when the display unit 151 and the touch panel are superposed on each other in the form of a layer to form a touch screen, the display unit 151 can function as an input device and an output device. The display unit 151 may include at least one of a liquid crystal display (LCD), a thin film transistor LCD (TFT-LCD), an organic light emitting diode (OLED) display, a flexible display, a three-dimensional (3D) display, and the like. Some of these displays may be configured to be transparent to allow a user to view from the outside, which may be referred to as a transparent display, and a typical transparent display may be, for example, a TOLED (Transparent Organic Light Emitting Diode) display or the like. According to a particular desired embodiment, the mobile terminal 100 may include two or more display units (or other display devices), for example, the mobile terminal may include an external display unit (not shown) and an internal display unit (not shown) . The touch screen can be used to detect touch input pressure as well as touch input position and touch input area.
存储器160可以存储由控制器180执行的处理和控制操作的软件程序等等,或者可以暂时地存储己经输出或将要输出的数据(例如,电话簿、消息、静态图像、视频等等)。而且,存储器160可以存储关于当触摸施加到触摸屏时输出的各种方式的振动和音频信号的数据。The memory 160 may store a software program or the like for processing and control operations performed by the controller 180, or may temporarily store data (for example, a phone book, a message, a still image, a video, etc.) that has been output or is to be output. Moreover, the memory 160 can store data regarding vibrations and audio signals of various manners that are output when a touch is applied to the touch screen.
存储器160可以包括至少一种类型的存储介质,所述存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等等。而且,移动终端100可以与通过网络连接执行存储器160的存储功能的网络存储装置协作。The memory 160 may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), a random access memory (RAM), a static random access memory ( SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like. Moreover, the mobile terminal 100 can cooperate with a network storage device that performs a storage function of the memory 160 through a network connection.
控制器180通常控制移动终端的总体操作。例如,控制器180执行与语音通话、数据通信、视频通话等等相关的控制和处理。另外,控制器180可以包括用于再现(或回放)多媒体数据的多媒体模块181,多媒体模块181可以构造在控制器180内,或者可以构造为与控制器180分离。控制器180可以执行模式识别处理,以将在触摸屏上执行的手写输入或者图片绘制输入识别为字符或图像。 The controller 180 typically controls the overall operation of the mobile terminal. For example, the controller 180 performs the control and processing associated with voice calls, data communications, video calls, and the like. In addition, the controller 180 may include a multimedia module 181 for reproducing (or playing back) multimedia data, which may be constructed within the controller 180 or may be configured to be separate from the controller 180. The controller 180 may perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image.
电源单元190在控制器180的控制下接收外部电力或内部电力并且提供操作每个元件和组件所需的适当的电力。The power supply unit 190 receives external power or internal power under the control of the controller 180 and provides appropriate power required to operate each component and component.
这里描述的各种实施方式可以以使用例如计算机软件、硬件或其任何组合的计算机可读介质来实施。对于硬件实施,这里描述的实施方式可以通过使用特定用途集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理装置(DSPD)、可编程逻辑装置(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器、被设计为执行这里描述的功能的电子单元中的至少一种来实施,在一些情况下,这样的实施方式可以在控制器180中实施。对于软件实施,诸如过程或功能的实施方式可以与允许执行至少一种功能或操作的单独的软件模块来实施。软件代码可以由以任何适当的编程语言编写的软件应用程序(或程序)来实施,软件代码可以存储在存储器160中并且由控制器180执行。The various embodiments described herein can be implemented in a computer readable medium using, for example, computer software, hardware, or any combination thereof. For hardware implementations, the embodiments described herein may be through the use of application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays ( An FPGA, a processor, a controller, a microcontroller, a microprocessor, at least one of the electronic units designed to perform the functions described herein, in some cases, such an embodiment may be at the controller 180 Implemented in the middle. For software implementations, implementations such as procedures or functions may be implemented with separate software modules that permit the execution of at least one function or operation. The software code can be implemented by a software application (or program) written in any suitable programming language, which can be stored in memory 160 and executed by controller 180.
至此,己经按照其功能描述了移动终端。下面,为了简要起见,将描述诸如折叠型、直板型、摆动型、滑动型移动终端等等的各种类型的移动终端中的滑动型移动终端作为示例。因此,本申请能够应用于任何类型的移动终端,并且不限于滑动型移动终端。So far, the mobile terminal has been described in terms of its function. Hereinafter, for the sake of brevity, a slide type mobile terminal among various types of mobile terminals such as a folding type, a bar type, a swing type, a slide type mobile terminal, and the like will be described as an example. Therefore, the present application can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
参照图2,图2为图1中相机的电气结构框图。2, FIG. 2 is a block diagram of the electrical structure of the camera of FIG. 1.
摄影镜头1211由用于形成被摄体像的多个光学镜头构成,为单焦点镜头或变焦镜头。摄影镜头1211在镜头驱动器1221的控制下能够在光轴方向上移动,镜头驱动器1221根据来自镜头驱动控制电路1222的控制信号,控制摄影镜头1211的焦点位置,在变焦镜头的情况下,也可控制焦点距离。镜头驱动控制电路1222按照来自微型计算机1217的控制命令进行镜头驱动器1221的驱动控制。The photographic lens 1211 is composed of a plurality of optical lenses for forming a subject image, and is a single focus lens or a zoom lens. The photographic lens 1211 is movable in the optical axis direction under the control of the lens driver 1221, and the lens driver 1221 controls the focus position of the photographic lens 1211 in accordance with a control signal from the lens driving control circuit 1222, and can also be controlled in the case of the zoom lens. Focus distance. The lens drive control circuit 1222 performs drive control of the lens driver 1221 in accordance with a control command from the microcomputer 1217.
在摄影镜头1211的光轴上、由摄影镜头1211形成的被摄体像的位置附近配置有摄像元件1212。摄像元件1212用于对被摄体像摄像并取得摄像图像数据。在摄像元件1212上二维且呈矩阵状配置有构成每个像素的光电二极管。每个光电二极管产生与受光量对应的光电转换电流,该光电转换电流由与每个光电二极管连接的电容器进行电荷蓄积。每个像素的前表面配置有拜耳排列的RGB滤色器。 An imaging element 1212 is disposed on the optical axis of the photographic lens 1211 near the position of the subject image formed by the photographic lens 1211. The imaging element 1212 is for capturing an image of a subject and acquiring captured image data. Photodiodes constituting each pixel are arranged two-dimensionally and in a matrix on the imaging element 1212. Each photodiode generates a photoelectric conversion current corresponding to the amount of received light, which is subjected to charge accumulation by a capacitor connected to each photodiode. The front surface of each pixel is provided with a Bayer array of RGB color filters.
摄像元件1212与摄像电路1213连接,该摄像电路1213在摄像元件1212中进行电荷蓄积控制和图像信号读出控制,对该读出的图像信号(模拟图像信号)降低重置噪声后进行波形整形,进而进行增益提高等以成为适当的信号电平。The imaging element 1212 is connected to the imaging circuit 1213. The imaging circuit 1213 performs charge accumulation control and image signal readout control in the imaging element 1212, and performs waveform shaping after reducing the reset noise of the read image signal (analog image signal). Further, gain improvement or the like is performed to obtain an appropriate signal level.
摄像电路1213与A/D转换器1214连接,该A/D转换器1214对模拟图像信号进行模数转换,向总线1227输出数字图像信号(以下称之为图像数据)。The imaging circuit 1213 is connected to an A/D converter 1214 that performs analog-to-digital conversion on the analog image signal and outputs a digital image signal (hereinafter referred to as image data) to the bus 1227.
总线1227是用于传送在相机的内部读出或生成的各种数据的传送路径。在总线1227连接着上述A/D转换器1214,此外还连接着图像处理器1215、JPEG处理器1216、微型计算机1217、SDRAM(Synchronous Dynamic random access memory,同步动态随机存取内存)1218、存储器接口(以下称之为存储器I/F)1219、LCD(Liquid Crystal Display,液晶显示器)驱动器1220。The bus 1227 is a transmission path for transmitting various data read or generated inside the camera. The A/D converter 1214 is connected to the bus 1227, and an image processor 1215, a JPEG processor 1216, a microcomputer 1217, a SDRAM (Synchronous Dynamic Random Access Memory) 1218, and a memory interface are also connected. (hereinafter referred to as memory I/F) 1219, LCD (Liquid Crystal Display) driver 1220.
图像处理器1215对基于摄像元件1212的输出的图像数据进行OB相减处理、白平衡调整、颜色矩阵运算、伽马转换、色差信号处理、噪声去除处理、同时化处理、边缘处理等各种图像处理。JPEG处理器1216在将图像数据记录于记录介质1225时,按照JPEG压缩方式压缩从SDRAM1218读出的图像数据。此外,JPEG处理器1216为了进行图像再现显示而进行JPEG图像数据的解压缩。进行解压缩时,读出记录在记录介质1225中的文件,在JPEG处理器1216中实施了解压缩处理后,将解压缩的图像数据暂时存储于SDRAM1218中并在LCD1226上进行显示。另外,在本实施方式中,作为图像压缩解压缩方式采用的是JPEG方式,然而压缩解压缩方式不限于此,当然可以采用MPEG、TIFF、H.264等其他的压缩解压缩方式。The image processor 1215 performs various kinds of images such as OB subtraction processing, white balance adjustment, color matrix calculation, gamma conversion, color difference signal processing, noise removal processing, simultaneous processing, edge processing, and the like on the image data based on the output of the imaging element 1212. deal with. The JPEG processor 1216 compresses the image data read out from the SDRAM 1218 in accordance with the JPEG compression method when the image data is recorded on the recording medium 1225. Further, the JPEG processor 1216 performs decompression of JPEG image data for image reproduction display. At the time of decompression, the file recorded on the recording medium 1225 is read, and after the compression processing is performed in the JPEG processor 1216, the decompressed image data is temporarily stored in the SDRAM 1218 and displayed on the LCD 1226. Further, in the present embodiment, the JPEG method is adopted as the image compression/decompression method. However, the compression/decompression method is not limited thereto, and other compression/decompression methods such as MPEG, TIFF, and H.264 may be used.
微型计算机1217发挥作为该相机整体的控制部的功能,统一控制相机的各种处理序列。微型计算机1217连接着操作单元1223和闪存1224。The microcomputer 1217 functions as a control unit of the entire camera, and collectively controls various processing sequences of the camera. The microcomputer 1217 is connected to the operation unit 1223 and the flash memory 1224.
操作单元1223包括但不限于实体按键或者虚拟按键,该实体或虚拟按键可以为电源按钮、拍照键、编辑按键、动态图像按钮、再现按钮、菜单按钮、十字键、OK按钮、删除按钮、放大按钮等各种输入按钮和各种输入键等操作控件,检测这些操作控件的操作状态,将检测结果向微型计算机1217输出。此外,在作为显示器的LCD1226的前表面设有触摸面板,检测用户的触摸位置,将该触摸位置向微型计算机1217输出。微型计算机1217根据来自操作 单元1223的操作位置的检测结果,执行与用户的操作对应的各种处理序列。The operating unit 1223 includes, but is not limited to, a physical button or a virtual button, and the entity or virtual button may be a power button, a camera button, an edit button, a dynamic image button, a reproduction button, a menu button, a cross button, an OK button, a delete button, an enlarge button An operation control such as various input buttons and various input keys detects an operation state of these operation controls, and outputs the detection result to the microcomputer 1217. Further, a touch panel is provided on the front surface of the LCD 1226 as a display, and the touch position of the user is detected, and the touch position is output to the microcomputer 1217. Microcomputer 1217 based on operation The detection result of the operation position of the unit 1223 performs various processing sequences corresponding to the operation of the user.
闪存1224存储用于执行微型计算机1217的各种处理序列的程序。微型计算机1217根据该程序进行相机整体的控制。此外,闪存1224存储相机的各种调整值,微型计算机1217读出调整值,按照该调整值进行相机的控制。The flash memory 1224 stores programs for executing various processing sequences of the microcomputer 1217. The microcomputer 1217 performs overall control of the camera in accordance with the program. Further, the flash memory 1224 stores various adjustment values of the camera, and the microcomputer 1217 reads out the adjustment value, and performs control of the camera in accordance with the adjustment value.
SDRAM1218是用于对图像数据等进行暂时存储的可电改写的易失性存储器。该SDRAM1218暂时存储从A/D转换器1214输出的图像数据和在图像处理器1215、JPEG处理器1216等中进行了处理后的图像数据。The SDRAM 1218 is an electrically rewritable volatile memory for temporarily storing image data or the like. The SDRAM 1218 temporarily stores image data output from the A/D converter 1214 and image data processed in the image processor 1215, the JPEG processor 1216, and the like.
存储器接口1219与记录介质1225连接,进行将图像数据和附加在图像数据中的文件头等数据写入记录介质1225和从记录介质1225中读出的控制。记录介质1225例如为能够在相机主体上自由拆装的存储器卡等记录介质,然而不限于此,也可以是内置在相机主体中的硬盘等。The memory interface 1219 is connected to the recording medium 1225, and performs control for writing image data and a file header attached to the image data to the recording medium 1225 and reading out from the recording medium 1225. The recording medium 1225 is, for example, a recording medium such as a memory card that can be detachably attached to the camera body. However, the recording medium 1225 is not limited thereto, and may be a hard disk or the like built in the camera body.
LCD驱动器1220与LCD1226连接,将由图像处理器1215处理后的图像数据存储于SDRAM1218,需要显示时,读取SDRAM1218存储的图像数据并在LCD1226上显示,或者,JPEG处理器1216压缩过的图像数据存储于SDRAM1218,在需要显示时,JPEG处理器1216读取SDRAM1218的压缩过的图像数据,再进行解压缩,将解压缩后的图像数据通过LCD1226进行显示。The LCD driver 1220 is connected to the LCD 1226, and stores image data processed by the image processor 1215 in the SDRAM 1218. When display is required, the image data stored in the SDRAM 1218 is read and displayed on the LCD 1226, or the image data stored in the JPEG processor 1216 is compressed. In the SDRAM 1218, when display is required, the JPEG processor 1216 reads the compressed image data of the SDRAM 1218, decompresses it, and displays the decompressed image data through the LCD 1226.
LCD1226配置在相机主体的背面进行图像显示。然而不限于此,也可以采用有机EL等各种显示面板(LCD1226)。The LCD 1226 is configured to display an image on the back of the camera body. However, it is not limited thereto, and various display panels (LCD 1226) such as an organic EL may be used.
基于上述移动终端硬件结构以及相机的电气结构示意图,提出本申请的方案。Based on the hardware structure of the above mobile terminal and the electrical structure diagram of the camera, the solution of the present application is proposed.
本发明实施例提供一种图像去噪装置。Embodiments of the present invention provide an image denoising device.
参照图3,图3为本申请的图像去噪装置第一实施例的功能模块示意图。Referring to FIG. 3, FIG. 3 is a schematic diagram of functional modules of a first embodiment of an image denoising apparatus according to the present application.
在本实施例中,所述图像去噪装置包括:In this embodiment, the image denoising device includes:
第一获取模块10,设置为获取终端拍摄的连续的多帧图像,将所述多帧图像中的其中一帧图像作为样本图像,其余的作为待对比图像,其中,所述多帧图像的格式为RGB图像格式;The first obtaining module 10 is configured to acquire a continuous multi-frame image captured by the terminal, and use one of the multi-frame images as a sample image, and the rest as a to-be-contrast image, where the multi-frame image format For RGB image format;
当终端在使用内置或者外置的摄像头拍摄时,所述终端获取在拍摄过程 中连续的多帧图像,将所述多帧图像中的其中一帧图像作为样本图像,将除所述样本图像之外的图像作为待对比图像,所述样本图像和所述待对比图像为RGB图像格式。所述终端包括但不限于智能手机、个人电脑。在本实施例中,所述终端为智能手机,如所述智能手机在其内置摄像头进行拍摄图像时,获取连续的四帧图像,将所获取的第一帧图像作为样本图像,将所获取的第二、第三和第四帧图像作为待对比图像。When the terminal is photographing using a built-in or external camera, the terminal acquires during the shooting process a continuous multi-frame image, wherein one of the multi-frame images is used as a sample image, and an image other than the sample image is used as an image to be compared, and the sample image and the image to be compared are RGB. Image format. The terminal includes, but is not limited to, a smart phone, a personal computer. In this embodiment, the terminal is a smart phone. If the smart phone captures an image in its built-in camera, it acquires four consecutive frames of images, and uses the acquired first frame image as a sample image to acquire the acquired image. The second, third, and fourth frame images are used as images to be compared.
第二获取模块20,设置为分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值;The second obtaining module 20 is configured to respectively acquire luminance values of R, G, and B components of each pixel of the sample image, and luminance values of R, G, and B components of each pixel of the image to be compared;
当所述终端获取得到所述样本图像和所述待对比图像时,解析所述样本图像和所述待对比图像,获取所述样本图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值,和获取所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值。如当所述智能手机获取得到一帧所述样本图像和三帧所述待对比图像时,解析所述样本图像,得到所述样本图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值;并分别解析三帧所述待对比图像,得到第一帧所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值;得到第二帧所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值;得到第三帧所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值。When the terminal acquires the sample image and the image to be compared, parsing the sample image and the image to be compared, and acquiring a luminance value and a G component of an R component of each pixel in the sample image. A luminance value and a luminance value of the B component, and a luminance value of the R component of each pixel in the image to be compared, a luminance value of the G component, and a luminance value of the B component. For example, when the smart phone acquires one frame of the sample image and three frames of the image to be compared, parsing the sample image to obtain a luminance value and a G component of an R component of each pixel in the sample image. The brightness value and the brightness value of the B component; and parsing the three images to be compared, respectively, to obtain the luminance value of the R component, the luminance value of the G component, and the B component of each pixel in the image to be compared in the first frame. a brightness value; obtaining a brightness value of the R component of each pixel in the image to be compared in the second frame, a brightness value of the G component, and a brightness value of the B component; obtaining each pixel in the image to be compared in the third frame The luminance value of the R component, the luminance value of the G component, and the luminance value of the B component.
处理模块30,设置为若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。The processing module 30 is configured to: if the luminance values of the R, G, and B components of each pixel of the sample image are different from the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared The value is within the first preset range, and the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value between each pixel point of the image to be compared and the sample image according to the image to be compared To the image after denoising.
可选地,所述处理模块30包括:Optionally, the processing module 30 includes:
确定单元,设置为若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则确定所述差值在所述第一预设范围内所对应的所述待对比图像每个像素点的R、G和B分量的亮度值; a determining unit, configured to determine a difference between a luminance value of R, G, and B components of each pixel of the sample image and a luminance value of R, G, and B components corresponding to each pixel of the image to be compared Determining, in the first preset range, brightness values of R, G, and B components of each pixel of the image to be compared corresponding to the difference in the first preset range;
第二计算单元,设置为分别计算在所述第一预设范围内的所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;a second calculating unit, configured to respectively calculate an average value of the R component luminance values and an average value of the G component luminance values between the to-be-compared image and the pixel image in the first preset range And the average value of the B component luminance values;
第二处理单元,设置为将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The second processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
当所述终端获得所述样本图像和所述待对比图像每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值时,将所述样本图像每个像素点的R分量的亮度值对应与所述待对比图像每个像素点的R分量的亮度值进行对比,得到所述样本图像每个像素点的R分量的亮度值对应与所述待对比图像每个像素点的R分量的亮度值之间的差值;将所述样本图像每个像素点的G分量的亮度值对应与所述待对比图像每个像素点的G分量的亮度值进行对比,得到所述样本图像每个像素点的G分量的亮度值对应与所述待对比图像每个像素点的G分量的亮度值之间的差值;将所述样本图像每个像素点的B分量的亮度值对应与所述待对比图像每个像素点的B分量的亮度值进行对比,得到所述样本图像每个像素点的B分量的亮度值对应与所述待对比图像每个像素点的B分量的亮度值之间的差值。所述终端判断所述样本图像每个像素点与所述待对比图像每个像素点之间的R分量亮度值的差值、G分量亮度值的差值和B分量亮度值的差值是否在第一预设范围内。当所述终端判定所述样本图像每个像素点与所述待对比图像每个像素点之间的R分量亮度值的差值、G分量亮度值的差值和B分量亮度值的差值在所述第一预设范围内时,确定在所述第一预设范围内R分量亮度值的差值所对应的所述待对比图像的R分量的亮度值,记为R0分量的亮度值;确定在所述第一预设范围内G分量亮度值的差值所对应的所述待对比图像的G分量的亮度值,记为G0分量的亮度值;确定在所述第一预设范围内B分量亮度值的差值所对应的所述待对比图像的B分量的亮度值,记为B0分量的亮度值。所述终端计算所述样本图像的R分量的亮度值与所述R0分量亮度值的平均值,得到R分量亮度值的平均值;计算所述样本图像的G分量的亮度值与所述G0分量亮度值的平均值,得到G分量亮度值的平均值;计算所述样本图像的B分量的亮度值 与所述B0分量亮度值的平均值,得到B分量亮度值的平均值。所述终端将每个像素点的R分量亮度值的平均值作为去噪后图像的R分量图像、G分量亮度值的平均值作为去噪后图像的G分量图像、B分量亮度值的平均值作为去噪后图像的B分量图像,所述终端将所述去噪后图像的R分量图像、G分量图像和B分量图像重新组合成新的图像,所述重新组合的新的图像即为去噪后的图像。所述终端还可以将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,将所述新的像素点作为新的图像的像素点,得到所述新的图像,所述新的图像即为去噪后的图像。进一步地,所述终端将所述去噪后的图像输出显示在其屏幕中。其中,所述第一预设范围根据当前拍摄时所在环境噪声的大小而定,如可设置为-10至10,或者设置为-20至20。When the terminal obtains the luminance value of the R component of each pixel point of the sample image and the image to be compared, the luminance value of the G component, and the luminance value of the B component, the R of each pixel of the sample image is obtained. The brightness value of the component is compared with the brightness value of the R component of each pixel of the image to be compared, and the brightness value of the R component of each pixel of the sample image is obtained corresponding to each pixel of the image to be compared. a difference between luminance values of the R component; comparing a luminance value of a G component of each pixel of the sample image with a luminance value of a G component of each pixel of the image to be compared, to obtain the a luminance value of a G component of each pixel of the sample image corresponds to a difference between luminance values of a G component of each pixel of the image to be compared; and a luminance value of a B component of each pixel of the sample image Corresponding to the brightness value of the B component of each pixel of the image to be compared, obtaining a brightness value of the B component of each pixel of the sample image corresponding to the B component of each pixel of the image to be compared Between brightness values Value. Determining, by the terminal, a difference between a luminance value of an R component between each pixel point of the sample image and each pixel of the image to be compared, a difference between a luminance value of a G component, and a luminance value of a B component. Within the first preset range. When the terminal determines that the difference between the R component luminance value between each pixel point of the sample image and each pixel point of the image to be compared, the difference between the G component luminance value and the B component luminance value is Determining, in the first preset range, a luminance value of the R component of the image to be compared corresponding to the difference of the luminance values of the R component in the first preset range, and recording the luminance value of the R0 component; Determining, according to a difference between the G component luminance values in the first preset range, a luminance value of the G component of the image to be compared, as a luminance value of the G0 component; determining to be within the first preset range The luminance value of the B component of the image to be compared corresponding to the difference of the B component luminance values is recorded as the luminance value of the B0 component. The terminal calculates an average value of the luminance value of the R component of the sample image and the luminance value of the R0 component to obtain an average value of the luminance values of the R component; and calculates a luminance value of the G component of the sample image and the G0 component. An average value of the luminance values, an average value of the luminance values of the G components is obtained; and a luminance value of the B component of the sample image is calculated An average value of the B component luminance values is obtained as an average value of the B component luminance values. The terminal uses the average value of the R component luminance values of each pixel as the average of the R component image and the G component luminance value of the denoised image as the average of the G component image and the B component luminance value of the denoised image. As a B component image of the denoised image, the terminal recombines the R component image, the G component image, and the B component image of the denoised image into a new image, and the recombined new image is Noise after the image. The terminal may further recombine the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value into a new pixel point, and use the new pixel point as a new image. The pixel is obtained, and the new image is obtained, and the new image is the image after denoising. Further, the terminal displays the denoised image output in its screen. The first preset range is determined according to the size of the ambient noise at the time of the current shooting, and may be set to be -10 to 10, or set to -20 to 20.
如所述智能手机获得所述样本图像某个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值,并获得三帧所述待对比图像中对应像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值时,所述智能手机通过所述样本图像像素点的R分量的亮度值与第一帧所述待对比图像中对应像素点的R分量的亮度值,得到所述样本图像像素点的R分量的亮度值与第一帧所述待对比图像中对应像素点的R分量的亮度值之间的差值,记为R1;通过所述样本图像像素点的R分量的亮度值与第二帧所述待对比图像中对应像素点的R分量的亮度值,得到所述样本图像像素点的R分量的亮度值与第二帧所述待对比图像中对应像素点的R分量的亮度值之间的差值,记为R2;通过所述样本图像像素点的R分量的亮度值与第三帧所述待对比图像中对应像素点的R分量的亮度值,得到所述样本图像像素点的R分量的亮度值与第三帧所述待对比图像中对应像素点的R分量的亮度值之间的差值,记为R3。所述智能手机判断所述R1、R2和R3是在-10至10的范围内(在本实施例中,所述第一预设范围取值为-10至10),即所述R1、R2和R3是否大于或者等于-10,且小于或者等于10。若所述智能手机判定所述R1、R2和R3都大于或者等于-10,且小于或者等于10,则计算所述样本图像像素点的R分量的亮度值、第一帧待对比图像中对应像素点的R分量的亮度值、第二帧待对比图像中对应像素点的R分量的亮度值和第三帧待对比图像中对应像素点的R分量的亮度值四个R分量的亮度值之间的平均值,将所述四个R分量的 亮度值之间的平均值作为去噪后的图像对应位置新的像素点的R分量的亮度值。若所述智能手机判定所述R1和R3大于或者等于-10,且小于或者等于10,则计算所述样本图像像素点的R分量的亮度值、第一帧待对比图像中对应像素点的R分量的亮度值和第三帧待对比图像中对应像素点的R分量的亮度值三个R分量的亮度值之间的平均值,将所述三个R分量的亮度值之间的平均值作为去噪后的图像对应位置新的像素点的R分量的亮度值。若所述智能手机判定所述R1大于或者等于-10,且小于或者等于10,则计算所述样本图像应像素点的R分量的亮度值和第一帧待对比图像中对应像素点的R分量的亮度值两个R分量的亮度值之间的平均值,将所述两个R分量的亮度值之间的平均值作为去噪后的图像对应位置新的像素点的R分量的亮度值。(当所述R1和R3或R2和R3或R2或R3满足所述第一预设范围时,处理过程如上,在此不再赘述)。所述智能手机对所述G分量的亮度值和B分量的亮度值的处理过程与对所述R分量的亮度值的处理过程类似,在此不再赘述。当所述智能手机得到所述样本图像与所述待对比图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值时,所述智能手机将每个像素点的R分量亮度值的平均值作为去噪后图像的R分量图像、G分量亮度值的平均值作为去噪后图像的G分量图像、B分量亮度值的平均值作为去噪后图像的B分量图像,所述智能手机将所述去噪后图像的R分量图像、G分量图像和B分量图像重新组合成新的图像,所述重新组合的新的图像即为去噪后的图像。可选地,参照图7和图8,图7为本发明实施例中终端所拍摄的未经过去噪处理所得图像的一种示意图;图8为本发明实施例中终端所拍摄的经过去噪处理所得图像的一种示意图。对比所述图7和所述图8可知,当图像经过去噪之后,清晰度明显提高。Obtaining, by the smart phone, a luminance value of a R component of a certain pixel point of the sample image, a luminance value of a G component, and a luminance value of a B component, and obtaining an R component of a corresponding pixel point in the image to be compared in three frames. a luminance value, a luminance value of the G component, and a luminance value of the B component, wherein the smartphone passes the luminance value of the R component of the sample image pixel point and the R component of the corresponding pixel point in the image to be compared in the first frame a luminance value obtained by obtaining a difference between a luminance value of an R component of the pixel of the sample image and a luminance value of an R component of a corresponding pixel in the image to be compared in the first frame, denoted as R1; a luminance value of the R component of the pixel and a luminance value of the R component of the corresponding pixel in the image to be compared in the second frame, to obtain a luminance value of the R component of the pixel of the sample image and the image to be compared in the second frame The difference between the luminance values of the R components of the corresponding pixel points, denoted as R2; the luminance value of the R component of the pixel of the sample image and the R component of the corresponding pixel in the image to be compared in the third frame Brightness value, get the sample The difference between the luminance value of the image pixel of the R component and the luminance contrast value of the third frame to be the corresponding pixel of the R component in the image, referred to as R3. The smart phone determines that the R1, R2, and R3 are in the range of -10 to 10 (in the embodiment, the first preset range takes a value of -10 to 10), that is, the R1, R2 And R3 is greater than or equal to -10 and less than or equal to 10. If the smart phone determines that the R1, R2, and R3 are greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the sample image pixel point, and corresponding pixel in the first frame to be compared image The luminance value of the R component of the point, the luminance value of the R component of the corresponding pixel in the second frame to be compared image, and the luminance value of the R component of the corresponding pixel in the third frame to be compared image, between the luminance values of the four R components Average of the four R components The average value between the luminance values is used as the luminance value of the R component of the new pixel corresponding to the position of the denoised image. If the smart phone determines that the R1 and R3 are greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the sample image pixel point, and R of the corresponding pixel in the first frame to be compared image The luminance value of the component and the luminance value of the R component of the corresponding pixel point in the third frame to be compared image, the average value between the luminance values of the three R components, and the average value between the luminance values of the three R components is taken as The denoised image corresponds to the luminance value of the R component of the new pixel at the location. If the smart phone determines that the R1 is greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the pixel of the sample image and an R component of the corresponding pixel in the image to be compared in the first frame. The luminance value is an average value between the luminance values of the two R components, and the average value between the luminance values of the two R components is used as the luminance value of the R component of the new pixel corresponding to the position of the denoised image. (When the R1 and R3 or R2 and R3 or R2 or R3 satisfy the first predetermined range, the processing is as above, and details are not described herein again). The process of processing the brightness value of the G component and the brightness value of the B component by the smart phone is similar to the process of processing the brightness value of the R component, and details are not described herein again. When the smart phone obtains an average value of the R component luminance values, an average value of the G component luminance values, and an average value of the B component luminance values between the sample image and each pixel of the image to be compared, the smart phone The mobile phone uses the average value of the R component luminance values of each pixel as the average of the R component image and the G component luminance value of the denoised image as the average value of the G component image and the B component luminance value of the denoised image. a B component image of the image after noise, the smartphone recombines the R component image, the G component image, and the B component image of the denoised image into a new image, and the recombined new image is denoising After the image. Optionally, referring to FIG. 7 and FIG. 8 , FIG. 7 is a schematic diagram of an image obtained by a terminal without a past noise processing according to an embodiment of the present invention; FIG. 8 is a de-noised image taken by a terminal according to an embodiment of the present invention; A schematic diagram of the resulting image. Comparing the above FIG. 7 with the FIG. 8, it can be seen that the sharpness is significantly improved after the image is denoised.
本实施例通过分别获取终端中的样本图像的R、G和B分量的亮度值,待对比图像每个像素点的R、G和B分量的亮度值,当所述样本图像的R、G和B分量的亮度值与所述待对比图像每个像素点的R、G和B分量的亮度值之间对应的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。通过了分别对图像的R、G和B分量的亮度值进行去噪,再将去噪后的R、G和B分量的亮度值重新组合成新的像 素点,将所述新的像素点作为去噪后图像的像素点的方法得到去噪后的图像,避免了在对图像去噪过程中计算量大,去噪效果差,容易造成图像边缘细节损失的问题。In this embodiment, the luminance values of the R, G, and B components of the sample image in the image are respectively obtained by comparing the luminance values of the R, G, and B components of the sample image in the terminal, when the R, G, and the R of the sample image are And the difference between the brightness value of the B component and the brightness value of the R, G, and B components of each pixel of the image to be compared is within a first preset range, according to the image to be compared and the sample The average of the R component luminance values between each pixel of the image, the average of the G component luminance values, and the average of the B component luminance values are obtained as denoised images. By denoising the luminance values of the R, G, and B components of the image separately, and recombining the luminance values of the denoised R, G, and B components into new images. The prime point, the new pixel is used as the pixel of the denoised image to obtain the denoised image, which avoids the calculation amount in the image denoising process, the denoising effect is poor, and the image edge detail is easily caused. The problem of loss.
参照图4,图4为本申请的图像去噪装置第二实施例的功能模块示意图,基于第一实施例提出本申请的图像去噪装置的第二实施例。Referring to FIG. 4, FIG. 4 is a schematic diagram of functional modules of a second embodiment of an image denoising apparatus according to the present application. A second embodiment of the image denoising apparatus of the present application is proposed based on the first embodiment.
在本实施例中,所述图像去噪装置还包括:In this embodiment, the image denoising device further includes:
计算模块40,设置为分别计算所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值,将所述差值作为第一差值;The calculating module 40 is configured to separately calculate, between the luminance values of the R, G, and B components of each pixel of the sample image, and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared. a difference, the difference being used as a first difference;
判断模块50,设置为判断所述第一差值是否都未在第一预设范围内;The determining module 50 is configured to determine whether the first difference is not within the first preset range;
当所述终端获取得到所述样本图像每个像素点的R分量的亮度值和所述待对比图像每个像素点的R分量的亮度值时,所述终端计算所述样本图像的像素点的R分量的亮度值与所述待对比图像中对应像素点的R分量的亮度值之间差值,并将所述差值作为R分量亮度值的第一差值。所述终端获得G分量亮度值的第一差值和B分量亮度值的第一差值的过程与获得所述R分量亮度值的第一差值过程类似,在此不再赘述。当所述终端获得所述R分量亮度值的第一差值时,判断所述R分量亮度值的第一差值是否都在第一预设范围内。当所述终端获取得到所述样本图像每个像素点的G分量的亮度值和B分量的亮度值与所述待对比图像每个像素点的G分量的亮度值和B分量的亮度值时,所述终端对所述样本图像像素点的G分量的亮度值和B分量的亮度值与所述待对比图像中对应像素点的G分量的亮度值和B分量的亮度值之间差值的处理过程,和所述终端对所述样本图像的像素点的R分量的亮度值与所述待对比图像中对应像素点的R分量的亮度值之间差值类似,在此不再赘述。如所述智能手机在计算所述样本图像像素点的R分量的亮度值和三帧所述待对比图像中对应像素点的R分量的亮度值之间的差值,得到所述样本图像像素点的R分量的亮度值和所述第一帧待对比图像中对应像素点的R分量的亮度值之间的差值R1;得到所述样本图像像素点的R分量的亮度值和所述第二帧待对比图像中对应像素点的R分量的亮度值之间的差值R2;得到所述样本图像像素点的R分量的亮度值和所述第三帧待对比图像中对应像素点的 R分量的亮度值之间的差值R3。所述智能手机判断所述R1、R2和R3是否都大于或者等于-10,且小于或者等于10。所述智能手机对所述样本图像像素点的G分量的亮度值和B分量的亮度值与三帧所述待对比图像中对应像素点的G分量的亮度值和B分量的亮度值之间差值的处理过程和所述样本图像的像素点的R分量的亮度值与三帧所述待对比图像中对应像素点的R分量的亮度值之间差值类似,在此不再赘述。When the terminal acquires a luminance value of an R component of each pixel of the sample image and a luminance value of an R component of each pixel of the image to be compared, the terminal calculates a pixel of the sample image. The difference between the luminance value of the R component and the luminance value of the R component of the corresponding pixel in the image to be compared, and the difference is taken as the first difference of the luminance value of the R component. The process of obtaining the first difference between the first difference value of the G component luminance value and the first difference value of the B component luminance value is similar to the process of obtaining the first difference value of the R component luminance value, and details are not described herein again. When the terminal obtains the first difference of the R component luminance values, it is determined whether the first difference of the R component luminance values is within the first preset range. When the terminal acquires the luminance value of the G component of each pixel of the sample image and the luminance value of the B component and the luminance value of the G component and the luminance component of the B component of each pixel of the image to be compared, Processing of the difference between the luminance value of the G component of the sample image pixel point and the luminance value of the B component and the luminance value of the G component of the corresponding pixel in the image to be compared and the luminance value of the B component The process is similar to the difference between the luminance value of the R component of the pixel of the sample image and the luminance value of the R component of the corresponding pixel in the image to be compared. And obtaining, by the smart phone, a difference between a luminance value of an R component of the pixel of the sample image and a luminance value of an R component of a corresponding pixel in three frames of the image to be compared, to obtain the sample image pixel a difference R1 between a luminance value of the R component and a luminance value of the R component of the corresponding pixel in the first frame to be compared; obtaining a luminance value of the R component of the sample image pixel and the second a difference R2 between luminance values of R components of corresponding pixel points in the image to be compared; obtaining a luminance value of the R component of the pixel of the sample image and a corresponding pixel in the image to be compared in the third frame The difference R3 between the luminance values of the R components. The smart phone determines whether the R1, R2, and R3 are greater than or equal to -10 and less than or equal to 10. The difference between the luminance value of the G component of the sample image pixel point and the luminance value of the B component and the luminance value of the G component of the corresponding pixel in the three frames of the image to be compared and the luminance value of the B component The processing of the value is similar to the difference between the luminance value of the R component of the pixel of the sample image and the luminance value of the R component of the corresponding pixel in the three frames of the image to be compared, and details are not described herein again.
选取模块60,设置为若所述第一差值都未在所述第一预设范围内,则在所述样本图像每个像素点的预设范围内选取预设个数的像素点;The selecting module 60 is configured to select a preset number of pixel points within a preset range of each pixel point of the sample image if the first difference is not within the first preset range;
所述第二获取模块20,还设置为获取所述预设个数的像素点的R、G和B分量的亮度值;The second obtaining module 20 is further configured to acquire the brightness values of the R, G, and B components of the preset number of pixels;
当所述终端判定所述R分量亮度值的第一差值都未在所述第一预设范围内,即所述样本图像的R分量的亮度值与所述待对比图像的R分量的亮度值之间的差值都未在所述第一预设范围内时,所述终端在所述样本图像每个像素点的预设范围内选取预设个数的像素点,并获取所述预设个数的像素点的R分量的亮度值。所述预设个数当视拍摄场景中的噪声大小而设定,如可以设置为以所述终端当前所选取的像素点为中心,选取3*3、或者5*5等区域中的像素点。所述终端判定所述G分量亮度值的第一差值和/或所述B分量亮度值的第一差值都未在所述第一预设范围内时,所述终端的处理过程和判定所述R分量亮度值的第一差值都未在所述第一预设范围内的类似,在此不再赘述。可选地,参照图9,图9为本发明实施例中终端在样本图像总某个像素点的预设范围内选取预设个数的像素点的一种示意图。在所述图9中,当所述智能手机判定所述R1、R2和R3都未在-10至10的范围内,则所述智能手机在所述样本图像的像素点的3*3范围内选取8个像素点,如所述智能手机正在处理所述样本图像中处于位置P22像素点的R分量的亮度值,则在所述P22像素点3*3范围内选取P11、P12、P12、P21、P23、P31、P32和P33这8个像素点。所述智能手机分别获取所述P11、P12、P12、P21、P23、P31、P32和P33这8个像素点的R分量的亮度值。当所述智能手机判定所述G分量亮度值的第一差值和/或所述B分量亮度值的第一差值都未在-10至10的范围内时,所述终端的处理过程和判定所述R1、R2和R3都未 在-10至10的范围内的类似,在此不再赘述。When the terminal determines that the first difference of the R component luminance values is not within the first preset range, that is, the luminance value of the R component of the sample image and the luminance of the R component of the image to be compared When the difference between the values is not within the first preset range, the terminal selects a preset number of pixel points within a preset range of each pixel point of the sample image, and acquires the preset Set the luminance value of the R component of the number of pixels. The preset number is set according to the noise level in the shooting scene, and may be set to select a pixel point in a region such as 3*3 or 5*5, centering on the pixel point currently selected by the terminal. . The process and determination of the terminal when the terminal determines that the first difference of the G component luminance value and/or the first difference of the B component luminance value are not within the first preset range The first difference of the R component luminance values is not similar in the first preset range, and details are not described herein again. Optionally, referring to FIG. 9, FIG. 9 is a schematic diagram of a terminal selecting a preset number of pixel points in a preset range of a certain pixel point of a sample image according to an embodiment of the present invention. In the FIG. 9, when the smartphone determines that none of R1, R2, and R3 is in the range of -10 to 10, the smartphone is within 3*3 of the pixel of the sample image. Selecting 8 pixel points, if the smart phone is processing the brightness value of the R component at the position P22 pixel in the sample image, then selecting P11, P12, P12, P21 within the range of the P22 pixel 3*3 8 pixels of P23, P31, P32 and P33. The smart phone acquires the luminance values of the R components of the eight pixel points P11, P12, P12, P21, P23, P31, P32, and P33, respectively. When the smart phone determines that the first difference of the G component luminance value and/or the first difference of the B component luminance value is not in the range of -10 to 10, the processing of the terminal and It is determined that none of R1, R2 and R3 Similar in the range of -10 to 10, and will not be described again here.
所述计算模块40,还设置为分别计算所述预设个数的像素点的R、G和B分量的亮度值与所述样本图像像素点的R、G和B分量的亮度值之间的差值,作为第二差值;The calculating module 40 is further configured to separately calculate, between the luminance values of the R, G, and B components of the preset number of pixel points and the luminance values of the R, G, and B components of the sample image pixel point. The difference, as the second difference;
当所述终端获取得到所述预设个数的像素点的R分量的亮度值时,计算所述预设个数的像素点的R分量的亮度值与所述样本图像像素点的R分量的亮度值之间的差值,将所述差值作为R分量亮度值的第二差值;当所述终端获取得到所述预设个数的像素点的G分量的亮度值时,计算所述预设个数的像素点的G分量的亮度值与所述样本图像像素点的G分量的亮度值之间的差值,将所述差值作为G分量亮度值的第二差值;当所述终端获取得到所述预设个数的像素点的B分量的亮度值时,计算所述预设个数的像素点的B分量的亮度值与所述样本图像像素点的B分量的亮度值之间的差值,将所述差值作为B分量亮度值的第二差值。如所述智能手机获取得到所述P11、P12、P12、P21、P23、P31、P32和P33这8个像素点的R分量的亮度值时,计算所述样本图像中P22像素点的R分量的亮度值与所述P11、P12、P12、P21、P23、P31、P32和P33这8个像素点的R分量的亮度值之间的差值。可选地,参照图10,所述图10为本发明实施例中样本图像的某个像素点和预设个数像素点的R分量的亮度值的一种示意图。由所述图10可知,所述P22像素点的R分量的亮度值为5,所述P11像素点的R分量的亮度值为1,所述P12像素点的R分量的亮度值为2,所述P13像素点的R分量的亮度值为3,所述P21像素点的R分量的亮度值为4,所述P23像素点的R分量的亮度值为6,所述P31像素点的R分量的亮度值为9,所述P32像素点的R分量的亮度值为8,所述P33像素点的R分量的亮度值为7。所述智能手机计算得到所述样本图像中P22像素点的R分量的亮度值与所述P11、P12、P12、P21、P23、P31、P32和P33这8个像素点的R分量的亮度值之间的差值分别为4、3、2、1、-1、-4、-3和-2。When the terminal obtains the luminance value of the R component of the preset number of pixel points, calculating a luminance value of the R component of the preset number of pixel points and an R component of the pixel of the sample image pixel a difference between the luminance values, the difference being the second difference of the luminance values of the R component; when the terminal obtains the luminance value of the G component of the preset number of pixels, a difference between a luminance value of a G component of a preset number of pixels and a luminance value of a G component of the pixel of the sample image, and the difference is used as a second difference of the luminance value of the G component; Calculating, when the terminal obtains the brightness value of the B component of the preset number of pixel points, calculating a brightness value of the B component of the preset number of pixel points and a brightness value of the B component of the sample image pixel point The difference between the differences is taken as the second difference of the B component luminance values. Calculating the R component of the P22 pixel in the sample image when the smart phone acquires the luminance values of the R components of the 8 pixels of the P11, P12, P12, P21, P23, P31, P32, and P33. The difference between the luminance value and the luminance values of the R components of the eight pixel points P11, P12, P12, P21, P23, P31, P32, and P33. Optionally, referring to FIG. 10, FIG. 10 is a schematic diagram of luminance values of a R component of a certain pixel point and a preset number of pixel points of a sample image according to an embodiment of the present invention. As can be seen from FIG. 10, the R component of the P22 pixel has a luminance value of 5, the R component of the P11 pixel has a luminance value of 1, and the R component of the P12 pixel has a luminance value of 2. The luminance value of the R component of the P13 pixel is 3, the luminance value of the R component of the P21 pixel is 4, the luminance value of the R component of the P23 pixel is 6, and the R component of the P31 pixel The luminance value is 9, the luminance value of the R component of the P32 pixel is 8, and the luminance value of the R component of the P33 pixel is 7. Calculating, by the smart phone, a luminance value of an R component of a P22 pixel in the sample image and a luminance value of an R component of the eight pixels of the P11, P12, P12, P21, P23, P31, P32, and P33 The difference between them is 4, 3, 2, 1, -1, -4, -3, and -2.
所述处理模块30,还设置为若所述第二差值在第二预设范围内,则根据所述在第二预设范围内所对应的所述预设个数的像素点与所述样本图像的每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度 值的平均值得到去噪后的图像。The processing module 30 is further configured to: if the second difference is within the second preset range, according to the preset number of pixels corresponding to the second preset range, The average value of the R component luminance value between each pixel of the sample image, the average value of the G component luminance value, and the B component luminance The average of the values gives the image after denoising.
可选地,所述处理模块30还包括:Optionally, the processing module 30 further includes:
获取单元,设置为若所述第二差值在所述第二预设范围内,则获取在所述第二预设范围内的第二差值所对应的所述预设个数的像素点的R、G和B分量的亮度值;Obtaining, if the second difference is within the second preset range, acquiring the preset number of pixels corresponding to the second difference in the second preset range Luminance values of the R, G, and B components;
第一计算单元,设置为分别计算所获取的所述预设个数的像素点与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;a first calculating unit, configured to separately calculate an average value of the obtained R component luminance values between the preset number of pixels and each pixel of the sample image, and an average value and a B component of the G component luminance values The average value of the brightness values;
第一处理单元,设置为将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The first processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
当所述终端得到所述R分量亮度值的第二差值,且判定所述R分量亮度值的第二差值在第二预设范围内时,获取所述在所述第二预设范围内的R分量亮度值的第二差值所对应的所述预设个数的像素点的R分量的亮度值,计算所获取的所述预设个数的像素点的R分量的亮度值和所述样本图像的每个像素点的R分量亮度值的平均值,将所述R分量亮度值的平均值作为新的像素点的R分量的亮度值。当所述终端判定所述G分量亮度值的第二差值和/或所述B分量亮度值的第二差值在所述第二预设范围内,所述终端的处理过程与判定所述R分量亮度值的第二差值在所述第二预设范围内的过程类似,在此不再赘述。其中,所述第二预设范围可以与所述第一预设范围一致,也可以与所述第一预设范围不一致。当所述终端得到新的像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值时,将所述新的像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值重新组合成新的像素点,将所述新的像素点作为新的图像的像素点,得到所述新的图像,所述新的图像即为去噪后的图像。如当所述第二预设范围为-2到2时,所述智能手机判定所述P22像素点的R分量的亮度值与所述P13、P21、P23和P33像素点的R分量的亮度值之间的差值在-2到2范围内,则对应获取所述P13、P21、P23和P33像素点的R分量的亮度值为3、4、6和7。所述智能手机计算所述P22像素点的R分量的亮度值5与所述P13、P21、P23和P33像素点的R分量 的亮度值为3、4、6和7的平均值,得到的平均值为5,则将5作为去噪图像P22位置像素点的R分量的亮度值。当所述智能手机得到去噪图像P22位置像素点的G分量的亮度值和B分量的亮度值时,将所述P22位置像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值重新组合成去噪图像的P22位置像素点。所述智能手机通过这种方法,得到完整的一幅去噪后的图像。When the terminal obtains a second difference value of the R component luminance value, and determines that the second difference value of the R component luminance value is within the second preset range, acquiring the second preset range Calculating the brightness value of the R component of the preset number of pixels, and calculating the brightness value of the R component of the preset number of pixel points corresponding to the second difference of the R component luminance values. An average value of the R component luminance values of each pixel point of the sample image, and an average value of the R component luminance values is used as a luminance value of the R component of the new pixel point. When the terminal determines that the second difference value of the G component luminance value and/or the second difference value of the B component luminance value is within the second preset range, the processing procedure of the terminal and the determining The process of the second difference of the R component luminance values in the second preset range is similar, and details are not described herein again. The second preset range may be consistent with the first preset range, or may be inconsistent with the first preset range. When the terminal obtains the luminance value of the R component of the new pixel point, the luminance value of the G component, and the luminance value of the B component, the luminance value of the R component of the new pixel point, the luminance value of the G component, and B The luminance values of the components are recombined into new pixel points, and the new pixel points are taken as the pixels of the new image to obtain the new image, which is the denoised image. The smart phone determines a brightness value of an R component of the P22 pixel point and a brightness value of an R component of the P13, P21, P23, and P33 pixel points, when the second preset range is -2 to 2 The difference between the range of -2 and 2 corresponds to the luminance values of the R components of the P13, P21, P23, and P33 pixel points being 3, 4, 6, and 7. The smart phone calculates a luminance value 5 of the R component of the P22 pixel and an R component of the P13, P21, P23, and P33 pixel points The luminance values are average values of 3, 4, 6, and 7, and the average value obtained is 5, and 5 is used as the luminance value of the R component of the pixel position of the denoising image P22. When the smart phone obtains the luminance value of the G component of the pixel position of the denoising image P22 and the luminance value of the B component, the luminance value of the R component of the P22 position pixel point, the luminance value of the G component, and the B component The luminance values are recombined into P22 position pixel points of the denoised image. The smart phone obtains a complete denoised image by this method.
更进一步地,所述判断模块50,还设置为判断所述第二差值是否在第二预设范围内;Further, the determining module 50 is further configured to determine whether the second difference is within a second preset range;
所述图像去噪装置还包括丢弃模块,设置为若所述第二差值未在所述第二预设范围内,则丢弃所述未在所述第二预设范围内的第二差值所对应的所述预设个数的像素点。The image denoising apparatus further includes a discarding module configured to discard the second difference that is not within the second preset range if the second difference is not within the second preset range Corresponding to the preset number of pixels.
当所述终端获取得到所述R分量亮度值的第二差值时,判断所述R分量亮度值的第二差值是否在所述第二预设范围内。若所述R分量亮度值的第二差值未在所述第二预设范围内,所述终端则丢弃所述未在所述第二预设范围内的R分量亮度值的第二差值所对应的所述预设个数的像素点的R分量的亮度值。如所述智能手机判定所述P22像素点的R分量的亮度值与所述P11、P12、P31和P32像素点的R分量的亮度值之间的差值未在-2到2范围内时,则丢弃所述P11、P12、P31和P32像素点的R分量的亮度值,不对所述P11、P12、P31和P32像素点的R分量的亮度值进行计算。当所述终端判定所述G分量亮度值的第二差值和/或所述B分量亮度值的第二差值未在所述第二预设范围内,所述终端的处理过程与所述R分量亮度值的第二差值未在所述第二预设范围内的过程类似,在此不再赘述。When the terminal acquires the second difference value of the R component luminance value, it is determined whether the second difference value of the R component luminance value is within the second preset range. If the second difference of the R component luminance values is not within the second preset range, the terminal discards the second difference of the R component luminance values that are not within the second preset range Corresponding to the brightness value of the R component of the preset number of pixel points. If the smartphone determines that the difference between the luminance value of the R component of the P22 pixel and the luminance value of the R component of the P11, P12, P31, and P32 pixels is not in the range of -2 to 2, Then, the luminance values of the R components of the P11, P12, P31, and P32 pixel points are discarded, and the luminance values of the R components of the P11, P12, P31, and P32 pixel points are not calculated. When the terminal determines that the second difference value of the G component luminance value and/or the second difference value of the B component luminance value is not within the second preset range, the processing process of the terminal and the The process in which the second difference of the R component luminance values is not within the second preset range is similar, and is not described herein again.
本实施例通过当所述样本图像每个像素点的R、G和B分量的亮度值对应与所述待对比图像每个像素点的R、G和B分量的亮度值之间的差值都未在第一预设范围内时,在所述样本图像每个像素点的预设范围内选取预设个数的像素点,从而得到去噪后的图像,避免了在对图像去噪过程中计算量大,去噪效果差,容易造成图像边缘细节损失的问题。The present embodiment passes the difference between the luminance values of the R, G, and B components of each pixel point of the sample image and the luminance values of the R, G, and B components of each pixel of the image to be compared. When not in the first preset range, a preset number of pixel points are selected within a preset range of each pixel point of the sample image, thereby obtaining a denoised image, thereby avoiding the process of denoising the image. The calculation amount is large, the denoising effect is poor, and the problem of image edge detail loss is easily caused.
本发明实施例进一步提供一种图像去噪方法。The embodiment of the invention further provides an image denoising method.
参照图5,图5为本申请的图像去噪方法第一实施例的流程示意图。 Referring to FIG. 5, FIG. 5 is a schematic flowchart diagram of a first embodiment of an image denoising method according to the present application.
在本实施例中,所述图像去噪方法包括:In this embodiment, the image denoising method includes:
步骤S10,获取终端拍摄的连续的多帧图像,将所述多帧图像中的其中一帧图像作为样本图像,其余的作为待对比图像,其中,所述多帧图像的格式为RGB图像格式;In step S10, a continuous multi-frame image captured by the terminal is acquired, and one of the multi-frame images is used as a sample image, and the rest is used as an image to be compared, wherein the format of the multi-frame image is an RGB image format;
当终端在使用内置或者外置的摄像头拍摄时,所述终端获取在拍摄过程中连续的多帧图像,将所述多帧图像中的其中一帧图像作为样本图像,将除所述样本图像之外的图像作为待对比图像,所述样本图像和所述待对比图像为RGB图像格式。所述终端包括但不限于智能手机、个人电脑。在本实施例中,所述终端为智能手机,如所述智能手机在其内置摄像头进行拍摄图像时,获取连续的四帧图像,将所获取的第一帧图像作为样本图像,将所获取的第二、第三和第四帧图像作为待对比图像。When the terminal is photographing using a built-in or external camera, the terminal acquires a continuous multi-frame image during shooting, and one of the multi-frame images is taken as a sample image, and the sample image is removed. The outer image is the image to be compared, and the sample image and the image to be compared are in an RGB image format. The terminal includes, but is not limited to, a smart phone, a personal computer. In this embodiment, the terminal is a smart phone. If the smart phone captures an image in its built-in camera, it acquires four consecutive frames of images, and uses the acquired first frame image as a sample image to acquire the acquired image. The second, third, and fourth frame images are used as images to be compared.
步骤S20,分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值;Step S20, respectively acquiring luminance values of R, G, and B components of each pixel of the sample image, and luminance values of R, G, and B components of each pixel of the image to be compared;
当所述终端获取得到所述样本图像和所述待对比图像时,解析所述样本图像和所述待对比图像,获取所述样本图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值,和获取所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值。如当所述智能手机获取得到一帧所述样本图像和三帧所述待对比图像时,解析所述样本图像,得到所述样本图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值;并分别解析三帧所述待对比图像,得到第一帧所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值;得到第二帧所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值;得到第三帧所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值。When the terminal acquires the sample image and the image to be compared, parsing the sample image and the image to be compared, and acquiring a luminance value and a G component of an R component of each pixel in the sample image. A luminance value and a luminance value of the B component, and a luminance value of the R component of each pixel in the image to be compared, a luminance value of the G component, and a luminance value of the B component. For example, when the smart phone acquires one frame of the sample image and three frames of the image to be compared, parsing the sample image to obtain a luminance value and a G component of an R component of each pixel in the sample image. The brightness value and the brightness value of the B component; and parsing the three images to be compared, respectively, to obtain the luminance value of the R component, the luminance value of the G component, and the B component of each pixel in the image to be compared in the first frame. a brightness value; obtaining a brightness value of the R component of each pixel in the image to be compared in the second frame, a brightness value of the G component, and a brightness value of the B component; obtaining each pixel in the image to be compared in the third frame The luminance value of the R component, the luminance value of the G component, and the luminance value of the B component.
步骤S30,若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。 Step S30, if the difference between the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared is Within a predetermined range, denoising is obtained according to an average value of the R component luminance values, an average value of the G component luminance values, and an average value of the B component luminance values between the image to be compared and each pixel point of the sample image. After the image.
进一步地,所述步骤S30包括:Further, the step S30 includes:
若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则确定所述差值在所述第一预设范围内所对应的所述待对比图像每个像素点的R、G和B分量的亮度值;If the difference between the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared is at the first preset And determining, in the range, the brightness values of the R, G, and B components of each pixel of the image to be compared corresponding to the difference in the first preset range;
分别计算在所述第一预设范围内的所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;Calculating, respectively, an average value of the R component luminance values, an average value of the G component luminance values, and an average of the B component luminance values between the to-be-compared image in the first preset range and each pixel point of the sample image value;
将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
当所述终端获得所述样本图像和所述待对比图像每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值时,将所述样本图像每个像素点的R分量的亮度值对应与所述待对比图像每个像素点的R分量的亮度值进行对比,得到所述样本图像每个像素点的R分量的亮度值对应与所述待对比图像每个像素点的R分量的亮度值之间的差值;将所述样本图像每个像素点的G分量的亮度值对应与所述待对比图像每个像素点的G分量的亮度值进行对比,得到所述样本图像每个像素点的G分量的亮度值对应与所述待对比图像每个像素点的G分量的亮度值之间的差值;将所述样本图像每个像素点的B分量的亮度值对应与所述待对比图像每个像素点的B分量的亮度值进行对比,得到所述样本图像每个像素点的B分量的亮度值对应与所述待对比图像每个像素点的B分量的亮度值之间的差值。所述终端判断所述样本图像每个像素点与所述待对比图像每个像素点之间的R分量亮度值的差值、G分量亮度值的差值和B分量亮度值的差值是否在第一预设范围内。当所述终端判定所述样本图像每个像素点与所述待对比图像每个像素点之间的R分量亮度值的差值、G分量亮度值的差值和B分量亮度值的差值在所述第一预设范围内时,确定在所述第一预设范围内R分量亮度值的差值所对应的所述待对比图像的R分量的亮度值,记为R0分量的亮度值;确定在所述第一预设范围内G分量亮度值的差值所对应的所述待对比图像的G分量的亮度值,记为G0分量的亮度值;确定在所述第一预设范围内B分量亮度值的差值所对应的所述待 对比图像的B分量的亮度值,记为B0分量的亮度值。所述终端计算所述样本图像的R分量的亮度值与所述R0分量亮度值的平均值,得到R分量亮度值的平均值;计算所述样本图像的G分量的亮度值与所述G0分量亮度值的平均值,得到G分量亮度值的平均值;计算所述样本图像的B分量的亮度值与所述B0分量亮度值的平均值,得到B分量亮度值的平均值。所述终端将每个像素点的R分量亮度值的平均值作为去噪后图像的R分量图像、G分量亮度值的平均值作为去噪后图像的G分量图像、B分量亮度值的平均值作为去噪后图像的B分量图像,所述终端将所述去噪后图像的R分量图像、G分量图像和B分量图像重新组合成新的图像,所述重新组合的新的图像即为去噪后的图像。所述终端还可以将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,将所述新的像素点作为新的图像的像素点,得到所述新的图像,所述新的图像即为去噪后的图像。进一步地,所述终端将所述去噪后的图像输出显示在其屏幕中。其中,所述第一预设范围根据当前拍摄时所在环境噪声的大小而定,如可设置为-10至10,或者设置为-20至20。When the terminal obtains the luminance value of the R component of each pixel point of the sample image and the image to be compared, the luminance value of the G component, and the luminance value of the B component, the R of each pixel of the sample image is obtained. The brightness value of the component is compared with the brightness value of the R component of each pixel of the image to be compared, and the brightness value of the R component of each pixel of the sample image is obtained corresponding to each pixel of the image to be compared. a difference between luminance values of the R component; comparing a luminance value of a G component of each pixel of the sample image with a luminance value of a G component of each pixel of the image to be compared, to obtain the a luminance value of a G component of each pixel of the sample image corresponds to a difference between luminance values of a G component of each pixel of the image to be compared; and a luminance value of a B component of each pixel of the sample image Corresponding to the brightness value of the B component of each pixel of the image to be compared, obtaining a brightness value of the B component of each pixel of the sample image corresponding to the B component of each pixel of the image to be compared Between brightness values Value. Determining, by the terminal, a difference between a luminance value of an R component between each pixel point of the sample image and each pixel of the image to be compared, a difference between a luminance value of a G component, and a luminance value of a B component. Within the first preset range. When the terminal determines that the difference between the R component luminance value between each pixel point of the sample image and each pixel point of the image to be compared, the difference between the G component luminance value and the B component luminance value is Determining, in the first preset range, a luminance value of the R component of the image to be compared corresponding to the difference of the luminance values of the R component in the first preset range, and recording the luminance value of the R0 component; Determining, according to a difference between the G component luminance values in the first preset range, a luminance value of the G component of the image to be compared, as a luminance value of the G0 component; determining to be within the first preset range The difference corresponding to the difference of the B component luminance values The luminance value of the B component of the comparison image is recorded as the luminance value of the B0 component. The terminal calculates an average value of the luminance value of the R component of the sample image and the luminance value of the R0 component to obtain an average value of the luminance values of the R component; and calculates a luminance value of the G component of the sample image and the G0 component. An average value of the luminance values is obtained as an average value of the luminance values of the G components; an average value of the luminance values of the B components of the sample image and the luminance values of the B0 components is calculated to obtain an average value of the luminance values of the B components. The terminal uses the average value of the R component luminance values of each pixel as the average of the R component image and the G component luminance value of the denoised image as the average of the G component image and the B component luminance value of the denoised image. As a B component image of the denoised image, the terminal recombines the R component image, the G component image, and the B component image of the denoised image into a new image, and the recombined new image is Noise after the image. The terminal may further recombine the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value into a new pixel point, and use the new pixel point as a new image. The pixel is obtained, and the new image is obtained, and the new image is the image after denoising. Further, the terminal displays the denoised image output in its screen. The first preset range is determined according to the size of the ambient noise at the time of the current shooting, and may be set to be -10 to 10, or set to -20 to 20.
如所述智能手机获得所述样本图像某个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值,并获得三帧所述待对比图像中对应像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值时,所述智能手机通过所述样本图像像素点的R分量的亮度值与第一帧所述待对比图像中对应像素点的R分量的亮度值,得到所述样本图像像素点的R分量的亮度值与第一帧所述待对比图像中对应像素点的R分量的亮度值之间的差值,记为R1;通过所述样本图像像素点的R分量的亮度值与第二帧所述待对比图像中对应像素点的R分量的亮度值,得到所述样本图像像素点的R分量的亮度值与第二帧所述待对比图像中对应像素点的R分量的亮度值之间的差值,记为R2;通过所述样本图像像素点的R分量的亮度值与第三帧所述待对比图像中对应像素点的R分量的亮度值,得到所述样本图像像素点的R分量的亮度值与第三帧所述待对比图像中对应像素点的R分量的亮度值之间的差值,记为R3。所述智能手机判断所述R1、R2和R3是在-10至10的范围内(在本实施例中,所述第一预设范围取值为-10至10),即所述R1、R2和R3是否大于或者等于-10,且小于或者等于10。若所述智能手机判定所述R1、R2和R3都 大于或者等于-10,且小于或者等于10,则计算所述样本图像像素点的R分量的亮度值、第一帧待对比图像中对应像素点的R分量的亮度值、第二帧待对比图像中对应像素点的R分量的亮度值和第三帧待对比图像中对应像素点的R分量的亮度值四个R分量的亮度值之间的平均值,将所述四个R分量的亮度值之间的平均值作为去噪后的图像对应位置新的像素点的R分量的亮度值。若所述智能手机判定所述R1和R3大于或者等于-10,且小于或者等于10,则计算所述样本图像像素点的R分量的亮度值、第一帧待对比图像中对应像素点的R分量的亮度值和第三帧待对比图像中对应像素点的R分量的亮度值三个R分量的亮度值之间的平均值,将所述三个R分量的亮度值之间的平均值作为去噪后的图像对应位置新的像素点的R分量的亮度值。若所述智能手机判定所述R1大于或者等于-10,且小于或者等于10,则计算所述样本图像应像素点的R分量的亮度值和第一帧待对比图像中对应像素点的R分量的亮度值两个R分量的亮度值之间的平均值,将所述两个R分量的亮度值之间的平均值作为去噪后的图像对应位置新的像素点的R分量的亮度值。(当所述R1和R3或R2和R3或R2或R3满足所述第一预设范围时,处理过程如上,在此不再赘述)。所述智能手机对所述G分量的亮度值和B分量的亮度值的处理过程与对所述R分量的亮度值的处理过程类似,在此不再赘述。当所述智能手机得到所述样本图像与所述待对比图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值时,所述智能手机将每个像素点的R分量亮度值的平均值作为去噪后图像的R分量图像、G分量亮度值的平均值作为去噪后图像的G分量图像、B分量亮度值的平均值作为去噪后图像的B分量图像,所述智能手机将所述去噪后图像的R分量图像、G分量图像和B分量图像重新组合成新的图像,所述重新组合的新的图像即为去噪后的图像。可选地,参照图7和图8,图7为本发明实施例中终端所拍摄的未经过去噪处理所得图像的一种示意图;图8为本发明实施例中终端所拍摄的经过去噪处理所得图像的一种示意图。对比所述图7和所述图8可知,当图像经过去噪之后,清晰度明显提高。Obtaining, by the smart phone, a luminance value of a R component of a certain pixel point of the sample image, a luminance value of a G component, and a luminance value of a B component, and obtaining an R component of a corresponding pixel point in the image to be compared in three frames. a luminance value, a luminance value of the G component, and a luminance value of the B component, wherein the smartphone passes the luminance value of the R component of the sample image pixel point and the R component of the corresponding pixel point in the image to be compared in the first frame a luminance value obtained by obtaining a difference between a luminance value of an R component of the pixel of the sample image and a luminance value of an R component of a corresponding pixel in the image to be compared in the first frame, denoted as R1; a luminance value of the R component of the pixel and a luminance value of the R component of the corresponding pixel in the image to be compared in the second frame, to obtain a luminance value of the R component of the pixel of the sample image and the image to be compared in the second frame The difference between the luminance values of the R components of the corresponding pixel points, denoted as R2; the luminance value of the R component of the pixel of the sample image and the R component of the corresponding pixel in the image to be compared in the third frame Brightness value, get the sample The difference between the luminance value of the image pixel of the R component and the luminance contrast value of the third frame to be the corresponding pixel of the R component in the image, referred to as R3. The smart phone determines that the R1, R2, and R3 are in the range of -10 to 10 (in the embodiment, the first preset range takes a value of -10 to 10), that is, the R1, R2 And R3 is greater than or equal to -10 and less than or equal to 10. If the smartphone determines that the R1, R2, and R3 are both If the value is greater than or equal to -10, and less than or equal to 10, the brightness value of the R component of the sample image pixel point, the brightness value of the R component of the corresponding pixel point in the first frame to be compared image, and the second frame to be compared image are calculated. The luminance value of the R component of the corresponding pixel and the luminance value of the R component of the corresponding pixel in the third frame to be compared image, the average value between the luminance values of the four R components, and the luminance values of the four R components The average value between the two is used as the luminance value of the R component of the new pixel corresponding to the position of the denoised image. If the smart phone determines that the R1 and R3 are greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the sample image pixel point, and R of the corresponding pixel in the first frame to be compared image The luminance value of the component and the luminance value of the R component of the corresponding pixel point in the third frame to be compared image, the average value between the luminance values of the three R components, and the average value between the luminance values of the three R components is taken as The denoised image corresponds to the luminance value of the R component of the new pixel at the location. If the smart phone determines that the R1 is greater than or equal to -10 and less than or equal to 10, calculating a luminance value of the R component of the pixel of the sample image and an R component of the corresponding pixel in the image to be compared in the first frame. The luminance value is an average value between the luminance values of the two R components, and the average value between the luminance values of the two R components is used as the luminance value of the R component of the new pixel corresponding to the position of the denoised image. (When the R1 and R3 or R2 and R3 or R2 or R3 satisfy the first predetermined range, the processing is as above, and details are not described herein again). The process of processing the brightness value of the G component and the brightness value of the B component by the smart phone is similar to the process of processing the brightness value of the R component, and details are not described herein again. When the smart phone obtains an average value of the R component luminance values, an average value of the G component luminance values, and an average value of the B component luminance values between the sample image and each pixel of the image to be compared, the smart phone The mobile phone uses the average value of the R component luminance values of each pixel as the average of the R component image and the G component luminance value of the denoised image as the average value of the G component image and the B component luminance value of the denoised image. a B component image of the image after noise, the smartphone recombines the R component image, the G component image, and the B component image of the denoised image into a new image, and the recombined new image is denoising After the image. Optionally, referring to FIG. 7 and FIG. 8 , FIG. 7 is a schematic diagram of an image obtained by a terminal without a past noise processing according to an embodiment of the present invention; FIG. 8 is a de-noised image taken by a terminal according to an embodiment of the present invention; A schematic diagram of the resulting image. Comparing the above FIG. 7 with the FIG. 8, it can be seen that the sharpness is significantly improved after the image is denoised.
本实施例通过分别获取终端中的样本图像的R、G和B分量的亮度值,待对比图像每个像素点的R、G和B分量的亮度值,当所述样本图像的R、G和B分量的亮度值与所述待对比图像每个像素点的R、G和B分量的亮度 值之间对应的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。通过了分别对图像的R、G和B分量的亮度值进行去噪,再将去噪后的R、G和B分量的亮度值重新组合成新的像素点,将所述新的像素点作为去噪后图像的像素点的方法得到去噪后的图像,避免了在对图像去噪过程中计算量大,去噪效果差,容易造成图像边缘细节损失的问题。In this embodiment, the luminance values of the R, G, and B components of the sample image in the image are respectively obtained by comparing the luminance values of the R, G, and B components of the sample image in the terminal, when the R, G, and the R of the sample image are The brightness value of the B component and the brightness of the R, G, and B components of each pixel of the image to be compared And the corresponding difference between the values is within the first preset range, according to the average value of the R component luminance values between the image to be compared and each pixel point of the sample image, the average value of the G component luminance values, and B The average of the component luminance values gives the denoised image. By denoising the luminance values of the R, G, and B components of the image respectively, and recombining the luminance values of the denoised R, G, and B components into new pixel points, the new pixel points are used as The method of denoising the pixel points of the image obtains the denoised image, which avoids the problem of large calculation amount, poor denoising effect, and easy loss of image edge detail in the process of denoising the image.
参照图6,图6为本申请的图像去噪方法第二实施例的流程示意图,基于本申请的第一实施例提出本申请的图像去噪方法第二实施例。Referring to FIG. 6, FIG. 6 is a schematic flowchart diagram of a second embodiment of an image denoising method according to the present application. The second embodiment of the image denoising method of the present application is proposed based on the first embodiment of the present application.
在本实施例中,所述图像去噪方法还包括:In this embodiment, the image denoising method further includes:
步骤S40,分别计算所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值,将所述差值作为第一差值;Step S40, respectively calculating a difference between a luminance value of the R, G, and B components of each pixel of the sample image and a luminance value of the R, G, and B components corresponding to each pixel of the image to be compared, Taking the difference as the first difference;
步骤S50,判断所述第一差值是否都未在第一预设范围内;Step S50, determining whether the first difference is not within the first preset range;
当所述终端获取得到所述样本图像每个像素点的R分量的亮度值和所述待对比图像每个像素点的R分量的亮度值时,所述终端计算所述样本图像的像素点的R分量的亮度值与所述待对比图像中对应像素点的R分量的亮度值之间差值,并将所述差值作为R分量亮度值的第一差值。所述终端获得G分量亮度值的第一差值和B分量亮度值的第一差值的过程与获得所述R分量亮度值的第一差值过程类似,在此不再赘述。当所述终端获得所述R分量亮度值的第一差值时,判断所述R分量亮度值的第一差值是否都在第一预设范围内。当所述终端获取得到所述样本图像每个像素点的G分量的亮度值和B分量的亮度值与所述待对比图像每个像素点的G分量的亮度值和B分量的亮度值时,所述终端对所述样本图像像素点的G分量的亮度值和B分量的亮度值与所述待对比图像中对应像素点的G分量的亮度值和B分量的亮度值之间差值的处理过程,和所述终端对所述样本图像的像素点的R分量的亮度值与所述待对比图像中对应像素点的R分量的亮度值之间差值类似,在此不再赘述。如所述智能手机在计算所述样本图像像素点的R分量的亮度值和三帧所述待对比图像中对应像素点的R分量的亮度值之间的差值,得到所述样本图像像 素点的R分量的亮度值和所述第一帧待对比图像中对应像素点的R分量的亮度值之间的差值R1;得到所述样本图像像素点的R分量的亮度值和所述第二帧待对比图像中对应像素点的R分量的亮度值之间的差值R2;得到所述样本图像像素点的R分量的亮度值和所述第三帧待对比图像中对应像素点的R分量的亮度值之间的差值R3。所述智能手机判断所述R1、R2和R3是否都大于或者等于-10,且小于或者等于10。所述智能手机对所述样本图像像素点的G分量的亮度值和B分量的亮度值与三帧所述待对比图像中对应像素点的G分量的亮度值和B分量的亮度值之间差值的处理过程和所述样本图像的像素点的R分量的亮度值与三帧所述待对比图像中对应像素点的R分量的亮度值之间差值类似,在此不再赘述。When the terminal acquires a luminance value of an R component of each pixel of the sample image and a luminance value of an R component of each pixel of the image to be compared, the terminal calculates a pixel of the sample image. The difference between the luminance value of the R component and the luminance value of the R component of the corresponding pixel in the image to be compared, and the difference is taken as the first difference of the luminance value of the R component. The process of obtaining the first difference between the first difference value of the G component luminance value and the first difference value of the B component luminance value is similar to the process of obtaining the first difference value of the R component luminance value, and details are not described herein again. When the terminal obtains the first difference of the R component luminance values, it is determined whether the first difference of the R component luminance values is within the first preset range. When the terminal acquires the luminance value of the G component of each pixel of the sample image and the luminance value of the B component and the luminance value of the G component and the luminance component of the B component of each pixel of the image to be compared, Processing of the difference between the luminance value of the G component of the sample image pixel point and the luminance value of the B component and the luminance value of the G component of the corresponding pixel in the image to be compared and the luminance value of the B component The process is similar to the difference between the luminance value of the R component of the pixel of the sample image and the luminance value of the R component of the corresponding pixel in the image to be compared. Obtaining, by the smart phone, a difference between a luminance value of an R component of a pixel of the sample image and a luminance value of an R component of a corresponding pixel in three frames of the image to be compared, to obtain the sample image image a difference R1 between a luminance value of the R component of the prime point and a luminance value of the R component of the corresponding pixel in the first frame to be compared; obtaining a luminance value of the R component of the pixel of the sample image and the a difference R2 between luminance values of R components of corresponding pixel points in the second frame to be compared; obtaining a luminance value of the R component of the pixel of the sample image and a corresponding pixel in the third frame to be compared image The difference R3 between the luminance values of the R components. The smart phone determines whether the R1, R2, and R3 are greater than or equal to -10 and less than or equal to 10. The difference between the luminance value of the G component of the sample image pixel point and the luminance value of the B component and the luminance value of the G component of the corresponding pixel in the three frames of the image to be compared and the luminance value of the B component The processing of the value is similar to the difference between the luminance value of the R component of the pixel of the sample image and the luminance value of the R component of the corresponding pixel in the three frames of the image to be compared, and details are not described herein again.
步骤S60,若所述第一差值都未在所述第一预设范围内,则在所述样本图像每个像素点的预设范围内选取预设个数的像素点;Step S60: If the first difference is not within the first preset range, select a preset number of pixels within a preset range of each pixel of the sample image;
步骤S70,获取所述预设个数的像素点的R、G和B分量的亮度值;Step S70, acquiring luminance values of R, G, and B components of the preset number of pixels;
当所述终端判定所述R分量亮度值的第一差值都未在所述第一预设范围内,即所述样本图像的R分量的亮度值与所述待对比图像的R分量的亮度值之间的差值都未在所述第一预设范围内时,所述终端在所述样本图像每个像素点的预设范围内选取预设个数的像素点,并获取所述预设个数的像素点的R分量的亮度值。所述预设个数当视拍摄场景中的噪声大小而设定,如可以设置为以所述终端当前所选取的像素点为中心,选取3*3、或者5*5等区域中的像素点。所述终端判定所述G分量亮度值的第一差值和/或所述B分量亮度值的第一差值都未在所述第一预设范围内时,所述终端的处理过程和判定所述R分量亮度值的第一差值都未在所述第一预设范围内的类似,在此不再赘述。可选地,参照图9,图9为本发明实施例中终端在样本图像总某个像素点的预设范围内选取预设个数的像素点的一种示意图。在所述图9中,当所述智能手机判定所述R1、R2和R3都未在-10至10的范围内,则所述智能手机在所述样本图像的像素点的3*3范围内选取8个像素点,如所述智能手机正在处理所述样本图像中处于位置P22像素点的R分量的亮度值,则在所述P22像素点3*3范围内选取P11、P12、P12、P21、P23、P31、P32和P33这8个像素点。所述智能手机分别获取所述P11、P12、P12、P21、 P23、P31、P32和P33这8个像素点的R分量的亮度值。当所述智能手机判定所述G分量亮度值的第一差值和/或所述B分量亮度值的第一差值都未在-10至10的范围内时,所述终端的处理过程和判定所述R1、R2和R3都未在-10至10的范围内的类似,在此不再赘述。When the terminal determines that the first difference of the R component luminance values is not within the first preset range, that is, the luminance value of the R component of the sample image and the luminance of the R component of the image to be compared When the difference between the values is not within the first preset range, the terminal selects a preset number of pixel points within a preset range of each pixel point of the sample image, and acquires the preset Set the luminance value of the R component of the number of pixels. The preset number is set according to the noise level in the shooting scene, and may be set to select a pixel point in a region such as 3*3 or 5*5, centering on the pixel point currently selected by the terminal. . The process and determination of the terminal when the terminal determines that the first difference of the G component luminance value and/or the first difference of the B component luminance value are not within the first preset range The first difference of the R component luminance values is not similar in the first preset range, and details are not described herein again. Optionally, referring to FIG. 9, FIG. 9 is a schematic diagram of a terminal selecting a preset number of pixel points in a preset range of a certain pixel point of a sample image according to an embodiment of the present invention. In the FIG. 9, when the smartphone determines that none of R1, R2, and R3 is in the range of -10 to 10, the smartphone is within 3*3 of the pixel of the sample image. Selecting 8 pixel points, if the smart phone is processing the brightness value of the R component at the position P22 pixel in the sample image, then selecting P11, P12, P12, P21 within the range of the P22 pixel 3*3 8 pixels of P23, P31, P32 and P33. The smart phone acquires the P11, P12, P12, and P21, respectively. The luminance values of the R components of the eight pixel points P23, P31, P32, and P33. When the smart phone determines that the first difference of the G component luminance value and/or the first difference of the B component luminance value is not in the range of -10 to 10, the processing of the terminal and It is determined that the R1, R2 and R3 are not similar in the range of -10 to 10, and will not be described herein.
步骤S80,分别计算所述预设个数的像素点的R、G和B分量的亮度值与所述样本图像像素点的R、G和B分量的亮度值之间的差值,作为第二差值;Step S80, respectively calculating a difference between a luminance value of the R, G, and B components of the preset number of pixel points and a luminance value of the R, G, and B components of the pixel of the sample image, as a second Difference
当所述终端获取得到所述预设个数的像素点的R分量的亮度值时,计算所述预设个数的像素点的R分量的亮度值与所述样本图像像素点的R分量的亮度值之间的差值,将所述差值作为R分量亮度值的第二差值;当所述终端获取得到所述预设个数的像素点的G分量的亮度值时,计算所述预设个数的像素点的G分量的亮度值与所述样本图像像素点的G分量的亮度值之间的差值,将所述差值作为G分量亮度值的第二差值;当所述终端获取得到所述预设个数的像素点的B分量的亮度值时,计算所述预设个数的像素点的B分量的亮度值与所述样本图像像素点的B分量的亮度值之间的差值,将所述差值作为B分量亮度值的第二差值。如所述智能手机获取得到所述P11、P12、P12、P21、P23、P31、P32和P33这8个像素点的R分量的亮度值时,计算所述样本图像中P22像素点的R分量的亮度值与所述P11、P12、P12、P21、P23、P31、P32和P33这8个像素点的R分量的亮度值之间的差值。可选地,参照图10,所述图10为本发明实施例中样本图像的某个像素点和预设个数像素点的R分量的亮度值的一种示意图。由所述图10可知,所述P22像素点的R分量的亮度值为5,所述P11像素点的R分量的亮度值为1,所述P12像素点的R分量的亮度值为2,所述P13像素点的R分量的亮度值为3,所述P21像素点的R分量的亮度值为4,所述P23像素点的R分量的亮度值为6,所述P31像素点的R分量的亮度值为9,所述P32像素点的R分量的亮度值为8,所述P33像素点的R分量的亮度值为7。所述智能手机计算得到所述样本图像中P22像素点的R分量的亮度值与所述P11、P12、P12、P21、P23、P31、P32和P33这8个像素点的R分量的亮度值之间的差值分别为4、3、2、1、-1、-4、-3和-2。 When the terminal obtains the luminance value of the R component of the preset number of pixel points, calculating a luminance value of the R component of the preset number of pixel points and an R component of the pixel of the sample image pixel a difference between the luminance values, the difference being the second difference of the luminance values of the R component; when the terminal obtains the luminance value of the G component of the preset number of pixels, a difference between a luminance value of a G component of a preset number of pixels and a luminance value of a G component of the pixel of the sample image, and the difference is used as a second difference of the luminance value of the G component; Calculating, when the terminal obtains the brightness value of the B component of the preset number of pixel points, calculating a brightness value of the B component of the preset number of pixel points and a brightness value of the B component of the sample image pixel point The difference between the differences is taken as the second difference of the B component luminance values. Calculating the R component of the P22 pixel in the sample image when the smart phone acquires the luminance values of the R components of the 8 pixels of the P11, P12, P12, P21, P23, P31, P32, and P33. The difference between the luminance value and the luminance values of the R components of the eight pixel points P11, P12, P12, P21, P23, P31, P32, and P33. Optionally, referring to FIG. 10, FIG. 10 is a schematic diagram of luminance values of a R component of a certain pixel point and a preset number of pixel points of a sample image according to an embodiment of the present invention. As can be seen from FIG. 10, the R component of the P22 pixel has a luminance value of 5, the R component of the P11 pixel has a luminance value of 1, and the R component of the P12 pixel has a luminance value of 2. The luminance value of the R component of the P13 pixel is 3, the luminance value of the R component of the P21 pixel is 4, the luminance value of the R component of the P23 pixel is 6, and the R component of the P31 pixel The luminance value is 9, the luminance value of the R component of the P32 pixel is 8, and the luminance value of the R component of the P33 pixel is 7. Calculating, by the smart phone, a luminance value of an R component of a P22 pixel in the sample image and a luminance value of an R component of the eight pixels of the P11, P12, P12, P21, P23, P31, P32, and P33 The difference between them is 4, 3, 2, 1, -1, -4, -3, and -2.
步骤S90,若所述第二差值在第二预设范围内,则根据所述在第二预设范围内所对应的所述预设个数的像素点与所述样本图像的每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。Step S90, if the second difference is in the second preset range, according to the preset number of pixel points corresponding to the second preset range and each pixel of the sample image The average of the R component luminance values between the points, the average of the G component luminance values, and the average of the B component luminance values are obtained as denoised images.
进一步地,所述步骤S90包括:Further, the step S90 includes:
若所述第二差值在所述第二预设范围内,则获取在所述第二预设范围内的第二差值所对应的所述预设个数的像素点的R、G和B分量的亮度值;If the second difference is within the second preset range, acquiring R, G, and the preset number of pixel points corresponding to the second difference in the second preset range The brightness value of the B component;
分别计算所获取的所述预设个数的像素点与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;Calculating, respectively, an average value of the acquired R component luminance values between the preset number of pixel points and each pixel point of the sample image, an average value of the G component luminance values, and an average value of the B component luminance values;
将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
当所述终端得到所述R分量亮度值的第二差值,且判定所述R分量亮度值的第二差值在第二预设范围内时,获取所述在所述第二预设范围内的R分量亮度值的第二差值所对应的所述预设个数的像素点的R分量的亮度值,计算所获取的所述预设个数的像素点的R分量的亮度值和所述样本图像的每个像素点的R分量亮度值的平均值,将所述R分量亮度值的平均值作为新的像素点的R分量的亮度值。当所述终端判定所述G分量亮度值的第二差值和/或所述B分量亮度值的第二差值在所述第二预设范围内,所述终端的处理过程与判定所述R分量亮度值的第二差值在所述第二预设范围内的过程类似,在此不再赘述。其中,所述第二预设范围可以与所述第一预设范围一致,也可以与所述第一预设范围不一致。当所述终端得到新的像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值时,将所述新的像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值重新组合成新的像素点,将所述新的像素点作为新的图像的像素点,得到所述新的图像,所述新的图像即为去噪后的图像。如当所述第二预设范围为-2到2时,所述智能手机判定所述P22像素点的R分量的亮度值与所述P13、P21、P23和P33像素点的R分量的亮度值之间的差值在-2到2范围内,则对应获取所述P13、P21、P23和P33像素点的R分量的亮度值为3、4、6和7。所述智能手机计算所述P22像素点的R分量的亮度值5与所述P13、P21、P23和P33像素点的R分量 的亮度值为3、4、6和7的平均值,得到的平均值为5,则将5作为去噪图像P22位置像素点的R分量的亮度值。当所述智能手机得到去噪图像P22位置像素点的G分量的亮度值和B分量的亮度值时,将所述P22位置像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值重新组合成去噪图像的P22位置像素点。所述智能手机通过这种方法,得到完整的一幅去噪后的图像。When the terminal obtains a second difference value of the R component luminance value, and determines that the second difference value of the R component luminance value is within the second preset range, acquiring the second preset range Calculating the brightness value of the R component of the preset number of pixels, and calculating the brightness value of the R component of the preset number of pixel points corresponding to the second difference of the R component luminance values. An average value of the R component luminance values of each pixel point of the sample image, and an average value of the R component luminance values is used as a luminance value of the R component of the new pixel point. When the terminal determines that the second difference value of the G component luminance value and/or the second difference value of the B component luminance value is within the second preset range, the processing procedure of the terminal and the determining The process of the second difference of the R component luminance values in the second preset range is similar, and details are not described herein again. The second preset range may be consistent with the first preset range, or may be inconsistent with the first preset range. When the terminal obtains the luminance value of the R component of the new pixel point, the luminance value of the G component, and the luminance value of the B component, the luminance value of the R component of the new pixel point, the luminance value of the G component, and B The luminance values of the components are recombined into new pixel points, and the new pixel points are taken as the pixels of the new image to obtain the new image, which is the denoised image. The smart phone determines a brightness value of an R component of the P22 pixel point and a brightness value of an R component of the P13, P21, P23, and P33 pixel points, when the second preset range is -2 to 2 The difference between the range of -2 and 2 corresponds to the luminance values of the R components of the P13, P21, P23, and P33 pixel points being 3, 4, 6, and 7. The smart phone calculates a luminance value 5 of the R component of the P22 pixel and an R component of the P13, P21, P23, and P33 pixel points The luminance values are average values of 3, 4, 6, and 7, and the average value obtained is 5, and 5 is used as the luminance value of the R component of the pixel position of the denoising image P22. When the smart phone obtains the luminance value of the G component of the pixel position of the denoising image P22 and the luminance value of the B component, the luminance value of the R component of the P22 position pixel point, the luminance value of the G component, and the B component The luminance values are recombined into P22 position pixel points of the denoised image. The smart phone obtains a complete denoised image by this method.
更进一步地,所述图像去噪方法还包括:Further, the image denoising method further includes:
判断所述第二差值是否在第二预设范围内;Determining whether the second difference is within a second preset range;
若所述第二差值未在所述第二预设范围内,则丢弃所述未在所述第二预设范围内的第二差值所对应的所述预设个数的像素点。And if the second difference is not in the second preset range, discarding the preset number of pixel points corresponding to the second difference that is not in the second preset range.
当所述终端获取得到所述R分量亮度值的第二差值时,判断所述R分量亮度值的第二差值是否在所述第二预设范围内。若所述R分量亮度值的第二差值未在所述第二预设范围内,所述终端则丢弃所述未在所述第二预设范围内的R分量亮度值的第二差值所对应的所述预设个数的像素点的R分量的亮度值。如所述智能手机判定所述P22像素点的R分量的亮度值与所述P11、P12、P31和P32像素点的R分量的亮度值之间的差值未在-2到2范围内时,则丢弃所述P11、P12、P31和P32像素点的R分量的亮度值,不对所述P11、P12、P31和P32像素点的R分量的亮度值进行计算。当所述终端判定所述G分量亮度值的第二差值和/或所述B分量亮度值的第二差值未在所述第二预设范围内,所述终端的处理过程与所述R分量亮度值的第二差值未在所述第二预设范围内的过程类似,在此不再赘述。When the terminal acquires the second difference value of the R component luminance value, it is determined whether the second difference value of the R component luminance value is within the second preset range. If the second difference of the R component luminance values is not within the second preset range, the terminal discards the second difference of the R component luminance values that are not within the second preset range Corresponding to the brightness value of the R component of the preset number of pixel points. If the smartphone determines that the difference between the luminance value of the R component of the P22 pixel and the luminance value of the R component of the P11, P12, P31, and P32 pixels is not in the range of -2 to 2, Then, the luminance values of the R components of the P11, P12, P31, and P32 pixel points are discarded, and the luminance values of the R components of the P11, P12, P31, and P32 pixel points are not calculated. When the terminal determines that the second difference value of the G component luminance value and/or the second difference value of the B component luminance value is not within the second preset range, the processing process of the terminal and the The process in which the second difference of the R component luminance values is not within the second preset range is similar, and is not described herein again.
本实施例通过当所述样本图像每个像素点的R、G和B分量的亮度值对应与所述待对比图像每个像素点的R、G和B分量的亮度值之间的差值都未在第一预设范围内时,在所述样本图像每个像素点的预设范围内选取预设个数的像素点,从而得到去噪后的图像,避免了在对图像去噪过程中计算量大,去噪效果差,容易造成图像边缘细节损失的问题。The present embodiment passes the difference between the luminance values of the R, G, and B components of each pixel point of the sample image and the luminance values of the R, G, and B components of each pixel of the image to be compared. When not in the first preset range, a preset number of pixel points are selected within a preset range of each pixel point of the sample image, thereby obtaining a denoised image, thereby avoiding the process of denoising the image. The calculation amount is large, the denoising effect is poor, and the problem of image edge detail loss is easily caused.
本发明实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述的图像去噪方法。Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that implement the image denoising method described above when the computer executable instructions are executed.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本申请不限于任何特定形式的硬件和软件的结合。One of ordinary skill in the art will appreciate that all or part of the steps in the above methods may be passed through the program. The instructions are related to hardware (eg, a processor) that can be stored in a computer readable storage medium, such as a read only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps of the above embodiments may be implemented using one or more integrated circuits. Correspondingly, each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function. This application is not limited to any specific form of combination of hardware and software.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.
工业实用性Industrial applicability
本申请实施例提供一种图像去噪装置和方法,通过分别对图像的R、G和B分量的亮度值进行去噪,再将去噪后的R、G和B分量的亮度值重新组合成新的像素点,将所述新的像素点作为去噪后图像的像素点的方法得到去噪后的图像,避免了在对图像去噪过程中计算量大,去噪效果差,容易造成图像边缘细节损失的问题。 An embodiment of the present application provides an image denoising apparatus and method, which respectively denoises luminance values of R, G, and B components of an image, and then recombines luminance values of the denoised R, G, and B components into The new pixel points, the new pixel point is used as the pixel point of the denoised image to obtain the denoised image, which avoids the calculation amount in the image denoising process, the denoising effect is poor, and the image is easily caused. The problem of loss of edge detail.

Claims (20)

  1. 一种图像去噪装置,包括:An image denoising device comprising:
    第一获取模块,设置为获取终端拍摄的连续的多帧图像,将所述多帧图像中的其中一帧图像作为样本图像,其余的作为待对比图像,其中,所述多帧图像的格式为RGB图像格式;a first acquiring module, configured to acquire a continuous multi-frame image captured by the terminal, using one of the multi-frame images as a sample image, and the rest as a to-be-contrast image, wherein the format of the multi-frame image is RGB image format;
    第二获取模块,设置为分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值;a second acquiring module, configured to respectively acquire luminance values of R, G, and B components of each pixel of the sample image, and luminance values of R, G, and B components of each pixel of the image to be compared;
    处理模块,设置为若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。a processing module configured to: if a luminance value of R, G, and B components of each pixel of the sample image is different from a luminance value of R, G, and B components corresponding to each pixel of the image to be compared In the first preset range, according to the average value of the R component luminance value between the image to be compared and each pixel point of the sample image, the average value of the G component luminance value, and the average value of the B component luminance value are obtained. Denoised image.
  2. 如权利要求1所述的图像去噪装置,所述图像去噪装置还包括:The image denoising apparatus according to claim 1, wherein the image denoising apparatus further comprises:
    计算模块,设置为分别计算所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值,将所述差值作为第一差值;a calculation module, configured to separately calculate a difference between a luminance value of the R, G, and B components of each pixel of the sample image and a luminance value of the R, G, and B components corresponding to each pixel of the image to be compared a value, the difference being the first difference;
    判断模块,设置为判断所述第一差值是否都未在第一预设范围内;a determining module, configured to determine whether the first difference is not within the first preset range;
    选取模块,设置为若所述第一差值都未在所述第一预设范围内,则在所述样本图像每个像素点的预设范围内选取预设个数的像素点;Selecting a module, if the first difference is not within the first preset range, selecting a preset number of pixels within a preset range of each pixel of the sample image;
    所述第二获取模块,还设置为获取所述预设个数的像素点的R、G和B分量的亮度值;The second acquiring module is further configured to acquire a brightness value of the R, G, and B components of the preset number of pixels;
    所述计算模块,还设置为分别计算所述预设个数的像素点的R、G和B分量的亮度值与所述样本图像像素点的R、G和B分量的亮度值之间的差值,作为第二差值;The calculating module is further configured to separately calculate a difference between a luminance value of the R, G, and B components of the preset number of pixel points and a luminance value of the R, G, and B components of the sample image pixel point. Value as the second difference;
    所述处理模块,还设置为若所述第二差值在第二预设范围内,则根据所述在第二预设范围内所对应的所述预设个数的像素点与所述样本图像的每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。 The processing module is further configured to: if the second difference is within the second preset range, according to the preset number of pixels corresponding to the sample in the second preset range, and the sample The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values between each pixel of the image result in a denoised image.
  3. 如权利要求2所述的图像去噪装置,其中,所述判断模块,还设置为判断所述第二差值是否在第二预设范围内;The image denoising apparatus according to claim 2, wherein the determining module is further configured to determine whether the second difference is within a second preset range;
    所述图像去噪装置还包括丢弃模块,设置为若所述第二差值未在所述第二预设范围内,则丢弃所述未在所述第二预设范围内的第二差值所对应的所述预设个数的像素点。The image denoising apparatus further includes a discarding module configured to discard the second difference that is not within the second preset range if the second difference is not within the second preset range Corresponding to the preset number of pixels.
  4. 如权利要求2所述的图像去噪装置,其中,所述处理模块包括:The image denoising apparatus according to claim 2, wherein said processing module comprises:
    获取单元,设置为若所述第二差值在所述第二预设范围内,则获取在所述第二预设范围内的第二差值所对应的所述预设个数的像素点的R、G和B分量的亮度值;Obtaining, if the second difference is within the second preset range, acquiring the preset number of pixels corresponding to the second difference in the second preset range Luminance values of the R, G, and B components;
    第一计算单元,设置为分别计算所获取的所述预设个数的像素点与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;a first calculating unit, configured to separately calculate an average value of the obtained R component luminance values between the preset number of pixels and each pixel of the sample image, and an average value and a B component of the G component luminance values The average value of the brightness values;
    第一处理单元,设置为将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The first processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
  5. 如权利要求1至4任一项所述的图像去噪装置,其中,所述处理模块还包括:The image denoising apparatus according to any one of claims 1 to 4, wherein the processing module further comprises:
    确定单元,设置为若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则确定所述差值在所述第一预设范围内所对应的所述待对比图像每个像素点的R、G和B分量的亮度值;a determining unit, configured to determine a difference between a luminance value of R, G, and B components of each pixel of the sample image and a luminance value of R, G, and B components corresponding to each pixel of the image to be compared Determining, in the first preset range, brightness values of R, G, and B components of each pixel of the image to be compared corresponding to the difference in the first preset range;
    第二计算单元,设置为分别计算在所述第一预设范围内的所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;a second calculating unit, configured to respectively calculate an average value of the R component luminance values and an average value of the G component luminance values between the to-be-compared image and the pixel image in the first preset range And the average value of the B component luminance values;
    第二处理单元,设置为将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The second processing unit is configured to recombine the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values into new pixel points to obtain a denoised image.
  6. 如权利要求1所述的图像去噪装置,其中,所述第二获取模块,设 置为解析所述样本图像和所述待对比图像,获取所述样本图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值,获取所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值。The image denoising apparatus according to claim 1, wherein said second acquisition module is provided And the brightness value of the R component of each pixel in the sample image, the brightness value of the G component, and the brightness value of the B component are acquired, and the image to be compared is obtained. The luminance value of the R component of each pixel, the luminance value of the G component, and the luminance value of the B component.
  7. 如权利要求2至4任一项所述的图像去噪装置,其中,所述处理模块还设置为根据拍摄场景中的噪声大小设定所述预设个数。The image denoising apparatus according to any one of claims 2 to 4, wherein the processing module is further configured to set the preset number according to a noise level in a shooting scene.
  8. 如权利要求1所述的图像去噪装置,其中,所述处理模块还设置为根据拍摄时所在环境噪声的大小设定所述第一预设范围。The image denoising apparatus according to claim 1, wherein the processing module is further configured to set the first preset range according to a magnitude of ambient noise at the time of shooting.
  9. 如权利要求2所述的图像去噪装置,其中,所述第一预设范围与所述第二预设范围一致。The image denoising device according to claim 2, wherein the first preset range is consistent with the second preset range.
  10. 如权利要求1所述的图像去噪装置,其中,所述处理模块还设置为将所述去噪后的图像输出显示在屏幕中。The image denoising apparatus according to claim 1, wherein said processing module is further arranged to display said denoised image output in a screen.
  11. 一种图像去噪方法,包括以下步骤:An image denoising method includes the following steps:
    获取终端拍摄的连续的多帧图像,将所述多帧图像中的其中一帧图像作为样本图像,其余的作为待对比图像,其中,所述多帧图像的格式为RGB图像格式;Obtaining a continuous multi-frame image captured by the terminal, using one of the multi-frame images as a sample image, and the rest as an image to be compared, wherein the format of the multi-frame image is an RGB image format;
    分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值;And acquiring, respectively, brightness values of R, G, and B components of each pixel of the sample image, and brightness values of R, G, and B components of each pixel of the image to be compared;
    若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。If the difference between the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared is at the first preset In the range, the denoised image is obtained according to an average value of the R component luminance value between the pixel to be compared and each pixel point of the sample image, an average value of the G component luminance value, and an average value of the B component luminance value. .
  12. 如权利要求11所述的图像去噪方法,其中,所述分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值的步骤之后,所述图像去噪方法还包括:The image denoising method according to claim 11, wherein said respectively acquiring luminance values of R, G, and B components of each pixel of said sample image, and R of each pixel of said image to be compared After the step of luminance values of the G and B components, the image denoising method further includes:
    分别计算所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值,将所述差值作为第一差值;Calculating, respectively, a difference between a luminance value of R, G, and B components of each pixel of the sample image and a luminance value of R, G, and B components corresponding to each pixel of the image to be compared, The difference is taken as the first difference;
    判断所述第一差值是否都未在第一预设范围内; Determining whether the first difference is not within the first preset range;
    若所述第一差值都未在所述第一预设范围内,则在所述样本图像每个像素点的预设范围内选取预设个数的像素点;If the first difference is not within the first preset range, selecting a preset number of pixels within a preset range of each pixel of the sample image;
    获取所述预设个数的像素点的R、G和B分量的亮度值;Obtaining brightness values of R, G, and B components of the preset number of pixels;
    分别计算所述预设个数的像素点的R、G和B分量的亮度值与所述样本图像像素点的R、G和B分量的亮度值之间的差值,作为第二差值;Calculating, respectively, a difference between a luminance value of the R, G, and B components of the preset number of pixel points and a luminance value of the R, G, and B components of the pixel of the sample image as a second difference;
    若所述第二差值在第二预设范围内,则根据所述在第二预设范围内所对应的所述预设个数的像素点与所述样本图像的每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像。If the second difference is within the second preset range, according to the preset number of pixels corresponding to the second preset range and each pixel of the sample image The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are obtained as denoised images.
  13. 如权利要求12所述的图像去噪方法,其中,所述分别计算所述预设个数的像素点的R、G和B分量的亮度值与所述样本图像像素点的R、G和B分量的亮度值之间的差值,作为第二差值的步骤之后,所述图像去噪方法还包括:The image denoising method according to claim 12, wherein said calculating a luminance value of said R, G, and B components of said preset number of pixel points and R, G, and B of said sample image pixel point, respectively After the step of using the difference between the luminance values of the components as the second difference, the image denoising method further includes:
    判断所述第二差值是否在第二预设范围内;Determining whether the second difference is within a second preset range;
    若所述第二差值未在所述第二预设范围内,则丢弃所述未在所述第二预设范围内的第二差值所对应的所述预设个数的像素点。And if the second difference is not in the second preset range, discarding the preset number of pixel points corresponding to the second difference that is not in the second preset range.
  14. 如权利要求12所述的图像去噪方法,其中,所述若所述第二差值在第二预设范围内,则根据所述在第二预设范围内所对应的所述预设个数的像素点与所述样本图像的每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像的步骤包括:The image denoising method according to claim 12, wherein, if the second difference is within a second preset range, the preset is corresponding to the second preset range The step of obtaining the denoised image by the average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values between the pixel points of the number of pixels and the pixel of the sample image includes:
    若所述第二差值在所述第二预设范围内,则获取在所述第二预设范围内的第二差值所对应的所述预设个数的像素点的R、G和B分量的亮度值;If the second difference is within the second preset range, acquiring R, G, and the preset number of pixel points corresponding to the second difference in the second preset range The brightness value of the B component;
    分别计算所获取的所述预设个数的像素点与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;Calculating, respectively, an average value of the acquired R component luminance values between the preset number of pixel points and each pixel point of the sample image, an average value of the G component luminance values, and an average value of the B component luminance values;
    将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
  15. 如权利要求11至14任一项所述的图像去噪方法,其中,所述若所 述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则根据所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值得到去噪后的图像的步骤包括:The image denoising method according to any one of claims 11 to 14, wherein said The difference between the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared is within a first preset range. And obtaining, according to the average value of the R component luminance value, the average value of the G component luminance value, and the average value of the B component luminance value between the pixel to be compared and the pixel image of the sample image, the step of obtaining the denoised image. include:
    若所述样本图像每个像素点的R、G和B分量的亮度值与所述待对比图像每个像素点对应的R、G和B分量的亮度值之间的差值在第一预设范围内,则确定所述差值在所述第一预设范围内所对应的所述待对比图像每个像素点的R、G和B分量的亮度值;If the difference between the luminance values of the R, G, and B components of each pixel of the sample image and the luminance values of the R, G, and B components corresponding to each pixel of the image to be compared is at the first preset And determining, in the range, the brightness values of the R, G, and B components of each pixel of the image to be compared corresponding to the difference in the first preset range;
    分别计算在所述第一预设范围内的所述待对比图像与所述样本图像每个像素点之间R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值;Calculating, respectively, an average value of the R component luminance values, an average value of the G component luminance values, and an average of the B component luminance values between the to-be-compared image in the first preset range and each pixel point of the sample image value;
    将所述R分量亮度值的平均值、G分量亮度值的平均值和B分量亮度值的平均值重新组合成新的像素点,以得到去噪后的图像。The average of the R component luminance values, the average of the G component luminance values, and the average of the B component luminance values are recombined into new pixel points to obtain a denoised image.
  16. 如权利要求11所述的图像去噪方法,其中,所述分别获取所述样本图像每个像素点的R、G和B分量的亮度值,和所述待对比图像每个像素点的R、G和B分量的亮度值,包括:解析所述样本图像和所述待对比图像,获取所述样本图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值,获取所述待对比图像中每个像素点的R分量的亮度值、G分量的亮度值和B分量的亮度值。The image denoising method according to claim 11, wherein said respectively acquiring luminance values of R, G, and B components of each pixel of said sample image, and R of each pixel of said image to be compared The luminance values of the G and B components include: parsing the sample image and the image to be compared, acquiring a luminance value of an R component, a luminance value of a G component, and a luminance value of a B component of each pixel in the sample image. And acquiring a luminance value of the R component of each pixel in the image to be compared, a luminance value of the G component, and a luminance value of the B component.
  17. 如权利要求12至14任一项所述的图像去噪方法,所述图像去噪方法还包括:根据拍摄场景中的噪声大小设定所述预设个数。The image denoising method according to any one of claims 12 to 14, wherein the image denoising method further comprises: setting the preset number according to a noise level in a shooting scene.
  18. 如权利要求11所述的图像去噪方法,所述图像去噪方法还包括:根据拍摄时所在环境噪声的大小设定所述第一预设范围。The image denoising method according to claim 11, wherein the image denoising method further comprises: setting the first preset range according to a magnitude of ambient noise at the time of shooting.
  19. 如权利要求12所述的图像去噪方法,其中,所述第一预设范围与所述第二预设范围一致。The image denoising method according to claim 12, wherein the first preset range is consistent with the second preset range.
  20. 如权利要求11所述的图像去噪方法,所述图像去噪方法还包括:将所述去噪后的图像输出显示在屏幕中。 The image denoising method according to claim 11, wherein the image denoising method further comprises: displaying the denoised image output in a screen.
PCT/CN2016/102390 2015-11-27 2016-10-18 Image denoising apparatus and method WO2017088609A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510864687.8 2015-11-27
CN201510864687.8A CN105513021B (en) 2015-11-27 2015-11-27 Image denoising device and method

Publications (1)

Publication Number Publication Date
WO2017088609A1 true WO2017088609A1 (en) 2017-06-01

Family

ID=55720979

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/102390 WO2017088609A1 (en) 2015-11-27 2016-10-18 Image denoising apparatus and method

Country Status (2)

Country Link
CN (1) CN105513021B (en)
WO (1) WO2017088609A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105491358B (en) * 2015-11-26 2018-11-16 努比亚技术有限公司 A kind of image processing method and device, terminal
CN105513021B (en) * 2015-11-27 2019-07-12 努比亚技术有限公司 Image denoising device and method
CN107220951A (en) * 2017-05-31 2017-09-29 广东欧珀移动通信有限公司 Facial image noise-reduction method, device, storage medium and computer equipment
CN107230192B (en) 2017-05-31 2020-07-21 Oppo广东移动通信有限公司 Image processing method, image processing device, computer-readable storage medium and mobile terminal
CN108053369A (en) * 2017-11-27 2018-05-18 努比亚技术有限公司 A kind of method of image procossing, equipment and storage medium
CN108769525B (en) * 2018-06-12 2021-04-09 广州视源电子科技股份有限公司 Image adjusting method, device, equipment and storage medium
CN109363630B (en) * 2018-09-03 2021-08-27 浙江大华技术股份有限公司 Vital sign information measuring method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060038899A1 (en) * 2004-08-23 2006-02-23 Fuji Photo Film Co., Ltd. Noise reduction apparatus, method and program
CN103020908A (en) * 2012-12-05 2013-04-03 华为技术有限公司 Image denoising method and device
CN104123699A (en) * 2013-04-26 2014-10-29 富士通株式会社 Method of reducing image noise and device
CN105513021A (en) * 2015-11-27 2016-04-20 努比亚技术有限公司 Image noise reduction device and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008119480A2 (en) * 2007-03-31 2008-10-09 Sony Deutschland Gmbh Noise reduction method and unit for an image frame
JP5445363B2 (en) * 2010-07-08 2014-03-19 株式会社リコー Image processing apparatus, image processing method, and image processing program
CN102843519A (en) * 2011-06-23 2012-12-26 鸿富锦精密工业(深圳)有限公司 Image processing system and method
CN104915940A (en) * 2015-06-03 2015-09-16 厦门美图之家科技有限公司 Alignment-based image denoising method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060038899A1 (en) * 2004-08-23 2006-02-23 Fuji Photo Film Co., Ltd. Noise reduction apparatus, method and program
CN103020908A (en) * 2012-12-05 2013-04-03 华为技术有限公司 Image denoising method and device
CN104123699A (en) * 2013-04-26 2014-10-29 富士通株式会社 Method of reducing image noise and device
CN105513021A (en) * 2015-11-27 2016-04-20 努比亚技术有限公司 Image noise reduction device and method

Also Published As

Publication number Publication date
CN105513021A (en) 2016-04-20
CN105513021B (en) 2019-07-12

Similar Documents

Publication Publication Date Title
WO2017088609A1 (en) Image denoising apparatus and method
JP6803982B2 (en) Optical imaging method and equipment
WO2017107629A1 (en) Mobile terminal, data transmission system and shooting method of mobile terminal
US10827140B2 (en) Photographing method for terminal and terminal
WO2017071559A1 (en) Image processing apparatus and method
WO2017054704A1 (en) Method and device for generating video image
WO2017124899A1 (en) Information processing method, apparatus and electronic device
KR20160016068A (en) Method for generating image and electronic device thereof
WO2017088564A1 (en) Image processing method, device, terminal, and storage medium
WO2017088568A1 (en) Image processing method and apparatus, terminal and storage medium
WO2017114088A1 (en) Automatic white balance method and device, terminal, and storage medium
WO2017088662A1 (en) Focusing method and device
WO2015180683A1 (en) Mobile terminal, method and device for setting image pickup parameters, and computer storage medium
WO2017054677A1 (en) Mobile terminal photographing system and mobile terminal photographing method
CN105472246A (en) Photographing device and method
US20130120635A1 (en) Subject detecting method and apparatus, and digital photographing apparatus
CN113452898A (en) Photographing method and device
WO2018076941A1 (en) Method and device for implementing panoramic photographing
CN105763810A (en) Photographing device and method based on human eyes
KR102082365B1 (en) Method for image processing and an electronic device thereof
JPWO2020158070A1 (en) Imaging device, imaging method, and program
WO2018219304A1 (en) Picture processing method and apparatus, computer readable storage medium, and electronic device
WO2019064757A1 (en) Image pickup device, image pickup method and program
CN105426081B (en) Interface switching device and method of mobile terminal
US20230014272A1 (en) Image processing method and apparatus

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: 16867835

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16867835

Country of ref document: EP

Kind code of ref document: A1