WO2017071542A1 - 图像处理方法及装置 - Google Patents

图像处理方法及装置 Download PDF

Info

Publication number
WO2017071542A1
WO2017071542A1 PCT/CN2016/103071 CN2016103071W WO2017071542A1 WO 2017071542 A1 WO2017071542 A1 WO 2017071542A1 CN 2016103071 W CN2016103071 W CN 2016103071W WO 2017071542 A1 WO2017071542 A1 WO 2017071542A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame image
image
current frame
offset
block
Prior art date
Application number
PCT/CN2016/103071
Other languages
English (en)
French (fr)
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 WO2017071542A1 publication Critical patent/WO2017071542A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/76Circuitry for compensating brightness variation in the scene by influencing the image signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/81Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/60Noise processing, e.g. detecting, correcting, reducing or removing noise

Definitions

  • the present application relates to, but is not limited to, the field of image processing technology, and more particularly to an image processing method and apparatus.
  • the camera function of mobile phones has become more and more perfect. Due to its small size and portability, more and more people are more enthusiastic about using mobile phone camera functions to record the beautiful moments in life. People's image quality requirements for mobile phones are getting higher and higher.
  • the related art mobile phone photograph has the following defects: in the case where the brightness is insufficient, the image often has some noise (brightness noise plus chromatic noise), and the lower the brightness, the larger the noise. The presence of these noises seriously affects the visual quality of the image.
  • This paper proposes an image processing method and device, which can improve the image quality of the mobile phone.
  • An embodiment of the present invention provides an image processing apparatus, including:
  • the acquiring module is configured to: obtain an image data stream captured by the mobile terminal, and extract consecutive two frames of images from the image data stream as a reference frame image and a current frame image;
  • the conversion module is configured to: perform color space conversion from RGB to YCbCr on the reference frame image and the current frame image respectively;
  • an estimation module configured to: perform motion estimation between the reference frame image and the current frame image based on the Y component, and acquire an inter-frame motion offset of the current frame image relative to the reference frame image;
  • a panning module configured to: perform a translation of a corresponding block of the YCbCr component according to an inter-frame motion offset of the current frame image relative to the reference frame image;
  • the denoising module is configured to: perform a averaging denoising operation on the corresponding block of the YCbCr component of the reference frame image after the YCbCr component of the current frame image is translated;
  • the conversion module is further configured to: convert the denoised current frame image from YCbCr to RGB color space conversion.
  • the estimating module is configured to:
  • the reference frame image and the current frame image are subjected to fine motion estimation between frames based on the Y component.
  • the estimating module is configured to perform coarse motion estimation between the reference frame image and the current frame image based on the Y component, including: selecting, for the reference frame image, an image block of a predetermined area size, which is recorded as an ROI. 1; searching for the same image block ROI 2 as the ROI 1 in the predetermined area on the current frame image; calculating the position coordinate information of the ROI 2 on the Y component and the position coordinate information of the ROI 1 on the Y component to obtain the ROI 2 The offset from ROI 1 and uses this offset as the offset of the current frame image relative to the reference frame image.
  • the offset of the current frame image relative to the reference frame image includes an offset in a horizontal direction and an offset in a vertical direction.
  • the estimating module is configured to search for the same image block ROI 2 as the ROI 1 in the predetermined area on the current frame image, including: searching for the image block ROI 2 having the same size as the ROI 1 on the current frame image, Wherein, the size of the search area is larger than the size of the ROI 1; edge detection is performed on the image blocks ROI 1 and ROI 2 respectively, and the edge detection result is obtained; and whether the image blocks ROI 1 and ROI 2 are the same according to the edge detection result, if the same, the same is obtained.
  • the same image block ROI 2 of the ROI 1 is described; if not, the image block ROI 2 in the current frame image is moved to the next position, and edge detection is continued to acquire the same image block ROI 2 as the ROI 1.
  • the estimating module is configured to: calculate edge detection results of the image blocks ROI 1 and ROI 2, and obtain a sum of absolute values of corresponding pixel differences; if the sum of absolute values of the corresponding pixel differences is less than or equal to If the threshold is set, it is determined that the image blocks ROI 1 and ROI 2 are the same; if it is greater than the preset threshold, it is determined that the image blocks ROI 1 and ROI 2 are different.
  • the estimating module is configured to: perform the image blocks ROI 1 and ROI 2 separately Edge detection, the edge detection results include: looping through each pixel in the block, using the Sobel operator for edge detection, respectively calculating the sum of the horizontal and vertical gradients of each point to obtain the gradient of each point.
  • the estimating module is configured to perform a search in a clockwise direction from a center pixel of the distance ROI 1 from near to far.
  • the estimating module is configured to: perform, according to a result of the coarse motion estimation, the fine motion estimation between the reference frame image and the current frame image based on the Y component, including: according to the offset of the ROI2 relative to the ROI 1 Performing a translational calibration on the current frame image to obtain a frame image Y_mid after the translational calibration; dividing the reference frame image into one or more image blocks of a predetermined size; and for each image block in the reference frame image, respectively in the frame image Y_mid Finding a matching block; calculating an offset of each image block in the reference frame image in the frame image Y_mid according to the position of the matching block; according to the offset of each image block in the frame image Y_mid, and The offset of the ROI 2 from the ROI 1 is obtained, and the relative offset of each image block is obtained as the inter-frame motion offset of the current frame image with respect to the reference frame image.
  • the panning module is configured to: when the current frame image is translated by the corresponding block of the YCbCr component according to the interframe motion shift amount of the current frame image relative to the reference frame image, the translation size is A negative value of the relative offset of an image block.
  • An embodiment of the present invention further provides an image processing method, including:
  • Corresponding block that translates the YCbCr component of the current frame image, corresponding to the reference frame image The corresponding blocks of the YCbCr component are subjected to an average denoising operation;
  • the denoised current frame image is converted from YCbCr to RGB color space.
  • the step of performing motion estimation between the reference frame image and the current frame image based on the Y component, and acquiring an inter-frame motion offset of the current frame image relative to the reference frame image includes:
  • the reference frame image and the current frame image are subjected to fine motion estimation between frames based on the Y component.
  • the step of performing coarse motion estimation between the reference frame image and the current frame image based on the Y component includes:
  • an image block of a predetermined area size is selected and recorded as ROI 1;
  • the position coordinate information of the ROI 2 on the Y component and the position coordinate information of the ROI 1 on the Y component are calculated, and the offset of the ROI 2 from the ROI 1 is obtained, and the offset is used as the current frame image relative to the reference frame.
  • the offset of the image is used as the current frame image relative to the reference frame.
  • the offset of the current frame image relative to the reference frame image includes an offset in a horizontal direction and an offset in a vertical direction.
  • the step of searching for the same image block ROI 2 as the ROI 1 in the predetermined area on the current frame image comprises:
  • the determining, according to the edge detection result, whether the image blocks ROI 1 and ROI 2 are the same include:
  • performing edge detection on the image blocks ROI 1 and ROI 2 respectively, and obtaining edge detection results include:
  • searching is performed in a clockwise direction from the center pixel of the distance ROI 1 from near to far.
  • the step of performing fine motion estimation between the reference frame image and the current frame image based on the Y component based on the result of the coarse motion estimation comprises:
  • the translated size is each image block.
  • Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that are implemented when executed by a processor.
  • An image processing method and apparatus based on a 3D (inter-frame) image processing method, obtains an offset of a whole image by calculating an offset of a corresponding image block in two images before and after;
  • the latter frame is moved to the corresponding position by the method of translation, and corresponding image processing technology is performed to achieve the effect of noise reduction;
  • the calculation amount is small, the cost is low, and the algorithm is easy to understand.
  • the effect is good, and the image of the mobile phone can be processed in real time, which greatly improves the quality of the photograph.
  • FIG. 1 is a schematic structural diagram of hardware of a mobile terminal that implements an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a wireless communication system of the mobile terminal shown in FIG. 1;
  • FIG. 3 is a block diagram showing an alternative embodiment of an image processing apparatus of the present invention.
  • FIG. 4 is a schematic diagram of image blocks in two adjacent image regions in an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of calculating a pixel point direction gradient when performing image block edge detection according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram showing a sequence of searching for an image block in a current frame image in an embodiment of the present invention
  • Figure 7 is an original view of an embodiment of the present invention.
  • Figure 8 is an image of the original image of Figure 7 after two frames of denoising
  • Figure 9 is a schematic view showing another structure of the image processing apparatus of the present invention.
  • FIG. 10 is a schematic flow chart of an alternative embodiment of an image processing method according to the present invention.
  • the terminal involved in the embodiment of the present invention may be a mobile terminal.
  • the mobile terminal can be implemented in a variety of forms.
  • the terminals described herein 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 invention can be applied to fixed type terminals in addition to components that are specifically for mobile purposes.
  • FIG. 1 is a schematic structural diagram of hardware of a mobile terminal that implements an embodiment of the present invention.
  • the mobile terminal 100 may include a wireless communication unit 110, 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, and a power supply unit 190. and many more.
  • 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.
  • Wireless communication unit 110 typically includes one or more components that permit radio communication between mobile terminal 100 and a wireless communication system or network.
  • the wireless communication unit may include at least one of a broadcast receiving module 111, a mobile communication module 112, a wireless internet module 113, a short-range communication module 114, and a location information module 115.
  • the broadcast receiving module 111 receives a broadcast signal and/or broadcast associated information from an external broadcast management server via a broadcast channel.
  • the broadcast channel can include a satellite channel and/or a terrestrial channel.
  • the broadcast management server may be a server that generates and transmits a broadcast signal and/or broadcast associated information or a server that receives a previously generated broadcast signal and/or broadcast associated information and transmits it to the terminal.
  • the broadcast signal may include a TV broadcast signal, a radio broadcast signal, a data broadcast signal, and the like.
  • the broadcast signal may further include a broadcast signal combined with a TV or radio broadcast signal.
  • the broadcast associated information may also be provided via a mobile communication network, and in this case, the broadcast associated information may be received by the mobile communication module 112.
  • the broadcast signal may exist in various forms, for example, it may exist in the form of Digital Multimedia Broadcasting (DMB) Electronic Program Guide (EPG), Digital Video Broadcasting Handheld (DVB-H) Electronic Service Guide (ESG), and the like.
  • the broadcast receiving module 111 can receive a signal broadcast by using a plurality of types of broadcast systems.
  • the broadcast receiving module 111 can use forward link media (MediaFLO) by using, for example, multimedia broadcast-terrestrial (DMB-T), digital multimedia broadcast-satellite (DMB-S), digital video broadcast-handheld (DVB-H)
  • MediaFLO forward link media
  • DMB-T multimedia broadcast-terrestrial
  • DMB-S digital multimedia broadcast-satellite
  • DVD-H digital video broadcast-handheld
  • the digital broadcasting system of the @ data broadcasting system
  • the terrestrial digital broadcasting integrated service (ISDB-T) and the like receives digital broadcasting.
  • the broadcast receiving module 111 can be constructed as a broadcast system suitable for providing a broadcast signal as well as the above-described digital broadcast system.
  • the broadcast signal and/or broadcast associated information received via the broadcast receiving module 111 may be stored in the memory 160 (or other type of storage medium).
  • the mobile communication module 112 transmits the radio signals to and/or receives radio signals from at least one of a base station (e.g., an access point, a Node B, etc.), an external terminal, and a server.
  • a base station e.g., an access point, a Node B, etc.
  • Such radio signals may include voice call signals, video call signals, or multiple types of data transmitted and/or received in accordance with text and/or multimedia messages.
  • the wireless internet module 113 supports wireless internet access of the mobile terminal.
  • the module can be internally or externally coupled to the terminal.
  • the wireless Internet access technologies involved in the module may include WLAN (Wireless LAN) (Wi-Fi), Wibro (Wireless Broadband), Wimax (Worldwide Interoperability for Microwave Access), HSDPA (High Speed Downlink Packet Access), etc. .
  • the short range communication module 114 is configured to support short range communication.
  • Some examples of short-range communication technology include Bluetooth TM, a radio frequency identification (RFID), infrared data association (IrDA), ultra wideband (UWB), ZigBee, etc. TM.
  • the location information module 115 is configured to check or obtain location information of the mobile terminal.
  • a typical example of a location information module is GPS (Global Positioning System).
  • GPS Global Positioning System
  • the GPS module 115 calculates distance information and accurate time information from three or more satellites and applies triangulation to the calculated information to accurately calculate three-dimensional current position information based on longitude, latitude, and altitude.
  • the method for calculating position and time information uses three satellites and corrects the calculated position and time information errors by using another satellite.
  • the GPS module 115 is capable of calculating speed information by continuously calculating current position information in real time.
  • the A/V input unit 120 is arranged to receive 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 can be stored in the memory In 160 (or other storage medium) or transmitted via the wireless communication unit 110, 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 may pass 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 the operation 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, a touch sensitive component that detects changes in resistance, pressure, capacitance, etc. due to contact), a scroll wheel , rocker, etc.
  • 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.
  • Sensing unit 140 may include proximity sensor 141 which will be described below in connection with a touch screen.
  • 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 a variety of 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 Identification Module (USIM), and the like.
  • UIM User Identification Module
  • SIM Customer Identification Module
  • USB Universal Customer Identification Module
  • 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 the received input is transmitted to one or more components within the mobile terminal 100 or may be arranged to transfer data between the mobile terminal and an external device.
  • 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 plurality of command signals allowed to be input from the base to be transmitted to the mobile The path to the terminal.
  • a variety of command signals or power input from the base can be used as a signal 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, an audio output module 152, an alarm unit 153, and the like.
  • the display unit 151 can display information processed in the mobile terminal 100. For example, when the mobile terminal 100 is in a phone call mode, the display unit 151 can display a user interface (UI) or a graphical user interface (GUI) related to a call or other communication (eg, text messaging, multimedia file download, etc.). 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 set to detect touch input pressure as well as touch input position and touch input area.
  • the audio output module 152 may convert audio data received by the wireless communication unit 110 or stored in the memory 160 when the mobile terminal is in a call signal receiving mode, a call mode, a recording mode, a voice recognition mode, a broadcast receiving mode, and the like.
  • the audio signal is output as sound.
  • the audio output module 152 can provide audio output (eg, call signal reception sound, message reception sound, etc.) associated with a particular function performed by the mobile terminal 100.
  • the audio output module 152 can To include speakers, buzzers, and more.
  • the alarm unit 153 can provide an output to notify the mobile terminal 100 of the occurrence of an event. Typical events may include call reception, message reception, key signal input, touch input, and the like. In addition to audio or video output, the alert unit 153 can provide an output in a different manner to notify of the occurrence of an event. For example, the alarm unit 153 can provide an output in the form of vibrations, and when a call, message, or some other incoming communication is received, the alarm unit 153 can provide a tactile output (ie, vibration) to notify the user of it. By providing such a tactile output, the user is able to recognize the occurrence of an event even when the user's mobile phone is in the user's pocket. The alarm unit 153 can also provide an output of the notification event occurrence via the display unit 151 or the audio output module 152.
  • 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 may store data regarding vibration 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.
  • Embodiments described herein may be implemented using, for example, computer software, hardware, or any combination thereof.
  • the computer readable medium is implemented.
  • 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
  • the mobile terminal has been described in terms of its function.
  • a slide type mobile terminal among a plurality of 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 embodiment of the present invention can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
  • the mobile terminal 100 as shown in FIG. 1 may be configured to operate using a communication system such as a wired and wireless communication system and a satellite-based communication system that transmits data via frames or packets.
  • a communication system such as a wired and wireless communication system and a satellite-based communication system that transmits data via frames or packets.
  • a communication system in which a mobile terminal is operable according to an embodiment of the present invention will now be described with reference to FIG.
  • Such communication systems may use different air interfaces and/or physical layers.
  • air interfaces used by communication systems include, for example, Frequency Division Multiple Access (FDMA), Time Division Multiple Access (TDMA), Code Division Multiple Access (CDMA), and Universal Mobile Telecommunications System (UMTS) (in particular, Long Term Evolution (LTE)). ), Global System for Mobile Communications (GSM), etc.
  • FDMA Frequency Division Multiple Access
  • TDMA Time Division Multiple Access
  • CDMA Code Division Multiple Access
  • UMTS Universal Mobile Telecommunications System
  • LTE Long Term Evolution
  • GSM Global System for Mobile Communications
  • the following description relates to a CDMA communication system, but such teachings are equally applicable to other types of systems.
  • a CDMA wireless communication system can include a plurality of mobile terminals 100, a plurality of base stations (BS) 270, a base station controller (BSC) 275, and a mobile switching center (MSC) 280.
  • the MSC 280 is configured to interface with a public switched telephone network (PSTN) 290.
  • PSTN public switched telephone network
  • the MSC 280 is also configured to interface with a BSC 275 that can be coupled to the base station 270 via a backhaul line.
  • the backhaul line can be constructed in accordance with any of a number of known interfaces including, for example, E1/T1, ATM, IP, PPP, Frame Relay, HDSL, ADSL, or xDSL. It will be appreciated that the system as shown in FIG. 2 can include multiple BSCs 275.
  • Each BS 270 can serve one or more partitions (or regions), each of which is covered by a multi-directional antenna or an antenna directed to a particular direction radially away from the BS 270. Alternatively, each partition may be covered by two or more antennas for diversity reception. Each BS 270 can be configured to support multiple frequency allocations, and each frequency allocation has a particular frequency spectrum (eg, 1.25 MHz, 5 MHz, etc.).
  • BS 270 may also be referred to as a Base Transceiver Subsystem (BTS) or other equivalent terminology.
  • BTS Base Transceiver Subsystem
  • the term "base station” can be used to generally refer to a single BSC 275 and at least one BS 270.
  • a base station can also be referred to as a "cell station.”
  • multiple partitions of a particular BS 270 may be referred to as multiple cellular stations.
  • a broadcast transmitter (BT) 295 transmits a broadcast signal to the mobile terminal 100 operating within the system.
  • a broadcast receiving module 111 as shown in FIG. 1 is provided at the mobile terminal 100 to receive a broadcast signal transmitted by the BT 295.
  • GPS Global Positioning System
  • the satellite 300 helps locate at least one of the plurality of mobile terminals 100.
  • a plurality of satellites 300 are depicted, but it is understood that useful positioning information can be obtained using any number of satellites.
  • the GPS module 115 as shown in Figure 1 is typically configured to cooperate with the satellite 300 to obtain desired positioning information. Instead of GPS tracking technology or in addition to GPS tracking technology, other techniques that can track the location of the mobile terminal can be used. Additionally, at least one GPS satellite 300 can selectively or additionally process satellite DMB transmissions.
  • the BS 270 receives a reverse link signal from the mobile terminal 100.
  • Mobile terminal 100 typically participates in calls, messaging, and other types of communications.
  • Each reverse link signal received by a particular base station 270 is processed within a particular BS 270.
  • the obtained data is forwarded to the relevant BSC 275.
  • the BSC provides call resource allocation and coordinated mobility management functions including a soft handoff procedure between the BSs 270.
  • the BSC 275 also routes the received data to the MSC 280, which provides additional routing services for interfacing with the PSTN 290.
  • PSTN 290 interfaces with MSC 280, which forms an interface with BSC 275, and BSC 275 controls BS 270 accordingly to transmit forward link signals to mobile terminal 100.
  • the present application proposes a solution that can eliminate the disadvantages of poor denoising effect in the related art, and easily cause loss of edge details, so that the final photographing of the picture has a better visual effect.
  • an embodiment of the present invention provides an image processing apparatus, including: an obtaining module 201, a converting module 202, an estimating module 203, a panning module 204, and a denoising module 205, wherein:
  • the obtaining module 201 is configured to: obtain an image data stream captured by the mobile terminal, and extract consecutive two frames of images from the image data stream as a reference frame image and a current frame image;
  • the conversion module 202 is configured to: perform color space conversion from RGB to YCbCr on the reference frame image and the current frame image respectively;
  • the estimation module 203 is configured to: perform motion estimation between frames on the reference frame image and the current frame image based on the Y component, and acquire an interframe motion offset of the current frame image relative to the reference frame image;
  • the panning module 204 is configured to: perform a translation of a corresponding block of the YCbCr component according to an interframe motion shift amount of the current frame image relative to the reference frame image;
  • the denoising module 205 is configured to: perform a averaging denoising operation on the corresponding block of the YCbCr component of the reference frame image after the YCbCr component of the current frame image is translated;
  • the conversion module 202 is further configured to: convert the denoised current frame image into a color space conversion from YCbCr to RGB.
  • the estimating module 203 is configured to: perform motion estimation between frames on the reference frame image and the current frame image based on the Y component, and acquire an interframe motion offset of the current frame image relative to the reference frame image, including :
  • the reference frame image and the current frame image are subjected to fine motion estimation between frames based on the Y component.
  • the estimating module 203 is configured to: perform coarse motion estimation between frames on the reference frame image and the current frame image based on the Y component, and: select, for the reference frame image, an image block of a predetermined area size, and record it as ROI 1 Searching for the same image block ROI 2 as the ROI 1 in the predetermined area on the current frame image; calculating the position coordinate information of the ROI 2 on the Y component and the position coordinate information of the ROI 1 on the Y component to obtain the ROI 2 relative The offset of ROI 1 and uses this offset as the offset of the current frame image relative to the reference frame image.
  • the offset of the current frame image relative to the reference frame image includes an offset in a horizontal direction and an offset in a vertical direction.
  • the estimating module 203 is configured to: search for the same image block ROI 2 as the ROI 1 in the predetermined area on the current frame image, including: searching for the image block ROI 2 having the same size as the ROI 1 on the current frame image, wherein, searching The size of the area is greater than the size of the ROI 1; the edge detection is performed on the image blocks ROI 1 and ROI2 respectively, and the edge detection result is obtained; whether the image blocks ROI 1 and ROI 2 are the same according to the edge detection result, if they are the same, the same is obtained as the ROI 1 Image block ROI 2; if not, move the image block ROI 2 in the current frame image to the next position, and continue edge detection to acquire the same image block ROI 2 as the ROI 1.
  • the estimation module 203 is configured to: calculate edge detection results of the image blocks ROI 1 and ROI 2, and obtain a sum of absolute values of corresponding pixel differences; if the sum of absolute values of the corresponding pixel differences is less than or equal to a preset threshold Then, it is judged that the image blocks ROI 1 and ROI 2 are the same; if it is larger than the preset threshold, it is judged that the image blocks ROI 1 and ROI 2 are different.
  • the estimating module 203 is configured to: perform edge detection on the image blocks ROI 1 and ROI 2 respectively, and obtain edge detection results, including: looping through each pixel in the block, and performing edge detection by using a Sobel operator; The sum of the horizontal and vertical gradients of each point is calculated separately to obtain the gradient of each point.
  • the estimation module 203 is configured to search in a clockwise direction from the center pixel of the distance ROI 1 from near to far.
  • the estimating module 203 is configured to: perform fine motion estimation between the reference frame image and the current frame image based on the Y component based on the result of the rough motion estimation, including: according to the offset of the ROI 2 relative to the ROI 1 ,
  • the current frame image is panned and calibrated to obtain a frame image Y_mid after panning calibration; the reference frame image is divided into one or more image blocks of predetermined size; Searching for a matching block in the frame image Y_mid for each image block; calculating an offset of each image block in the reference frame image in the frame image Y_mid according to the position of the matching block;
  • the offset of the block in the frame image Y_mid and the offset of the ROI 2 relative to the ROI 1 obtain a relative offset of each image block as an interframe motion shift of the current frame image relative to the reference frame image the amount.
  • the panning module 204 is configured to: when the current frame image is translated by the corresponding block of the YCbCr component according to the interframe motion shift amount of the current frame image relative to the reference frame image, the translated size is each image block. The negative value of the relative offset.
  • a reference frame image previously frame
  • a current frame image possibly due to a hand
  • the two images are respectively subjected to color space conversion, that is, from RGB space to YCbCr space.
  • the RGB space and the YCbCr space are color spaces, wherein, in the RGB space, R, G, and B respectively refer to three color components of red, green, and blue.
  • R, G, and B respectively refer to three color components of red, green, and blue.
  • YCbCr space Y refers to the luminance component
  • Cb refers to the blue chrominance component
  • Cr refers to the red chrominance component.
  • the conversion relationship can be as follows:
  • the reference frame image and the current frame image are subjected to inter-frame motion estimation based on the Y component, and an inter-frame motion offset of the current frame image with respect to the reference frame image is acquired.
  • the motion estimation in the embodiment of the present invention is divided into two steps: one, performing rough motion estimation on the entire frame image; and second, on the basis of rough estimation, Fine motion estimation.
  • the frame estimation signal is performed on the reference frame image and the current frame image based on the Y component.
  • the reference frame image and the current frame image are subjected to fine motion estimation between frames based on the Y component.
  • the rough motion estimation between the reference frame image and the current frame image based on the Y component includes:
  • an image block of a predetermined area size is selected and recorded as ROI 1;
  • the position coordinate information of the ROI 2 on the Y component and the position coordinate information of the ROI 1 on the Y component are calculated, and the offset of the ROI 2 from the ROI 1 is obtained, and the offset is used as the current frame image relative to the reference frame.
  • the offset of the image is used as the current frame image relative to the reference frame.
  • the fine motion estimation between the reference frame image and the current frame image based on the Y component includes:
  • the relative offset of each image block is obtained according to the offset of each image block in the frame image Y_mid and the offset of the ROI 2 relative to the ROI 1.
  • the average of the offset of one or several blocks in the image is roughly estimated as the offset of the entire image, and one block is taken as an example for description.
  • an image block of a certain area size is selected as ROI 1; then, in a certain area on the dither frame Y2, the same image block ROI 2 as the ROI 1 is searched; position coordinate information of the ROI 2 on Y2 is searched.
  • the position coordinate information of the ROI 1 on Y1 is calculated, and the offset of the ROI 2 with respect to the ROI 1 is obtained, and this offset is taken as the offset of img2 with respect to img1.
  • the implementation is as follows:
  • a Select ROI 1.
  • a certain size area around the center point Y1 (h, w) of the Y1 focus area is taken as ROI 1.
  • the size can be 101*101, 201*201, or other sizes.
  • b Search for the same image block ROI 2 as ROI 1 on Y2 (the same size as ROI 1).
  • the size of the search area on Y2 is 103*103, 105*105 or 203*203, 205*205 around Y2(h, w), or other size areas, and the size of the area is larger than the size of ROI 1, as shown in FIG.
  • the block block in Y1 is the reference block; the large block block in Y2 is the search area size, and the small block block is the same size as the block block on Y1.
  • c block similarity criterion. Edge detection is performed on the block blocks of the same size as ROI 1 in ROI 1 and Y2 in Y1, and then the two block edge detection results are calculated, and the sum of the absolute values of the corresponding pixel differences is taken; if the sum is less than or equal to a certain
  • the preset threshold is considered to be the same for both blocks. If it is greater than the preset threshold, the block block (that is, the small block) of the same size as ROI 1 in Y2 is moved to the next position, and the method calculation is continued.
  • the edge detection method is as follows:
  • sobel Sobel
  • edge detection the sobel operator model is as follows:
  • the X-direction gradient and the Y-direction gradient are respectively calculated, that is, as shown in FIG. 5, the pixel P22 point X direction and Y direction gradient are respectively:
  • d The search order is made. Far from the center pixel distance of ROI 1 (from near and far), clockwise.
  • the search sequence is shown in Figure 6.
  • the maximum 2 pixels (pixels) of the upper and lower sides of the offset are taken as an example (the actual implementation will be larger than two pixels, generally set to 7.), where 0 represents the center point of the ROI 1 block.
  • the position of 1 means that the center point of the block moves to the right by one pixel, 2 represents the position of moving down one pixel, and so on.
  • the offset of this block is taken as the offset of the entire image.
  • f Perform a translational calibration of Y2 according to the offset to obtain Y_mid.
  • Y_mid is basically different from Y1. Fine adjustments are then made so that the pixels between the two frames can be precisely aligned.
  • the implementation is as follows:
  • the search range for finding similar blocks is smaller than that of the rough estimation, and can be set to be within 2 pixels of the top, bottom, left, and right.
  • the translation size is the negative of the offset calculated above.
  • the corresponding block after the Y2Cb2Cr2 component of the current frame image Y2 is translated is subjected to an averaging denoising operation corresponding to the corresponding block of the Y1Cb1Cr1 component of the reference frame image Y1; the current frame image after denoising is performed from YCbCr to RGB Color space conversion.
  • FIG. 7 is an original diagram
  • FIG. 8 is an image after two-frame denoising processing.
  • the offset of the corresponding image is obtained by calculating the offset of the corresponding image block in the two frames before and after; then the next frame is translated by panning.
  • Method move to the corresponding location and perform corresponding image processing techniques to achieve the drop
  • the effect of noise compared with the related art mobile phone denoising method, the calculation amount is small, the cost is low, the algorithm is easy to understand, the effect is good, and the mobile phone image can be processed in real time, which greatly improves the photographing quality of the photo.
  • FIG. 9 As a hardware operating environment, another structure of the image processing apparatus described in the above embodiments may be as shown in FIG. 9.
  • FIG. 9 is another schematic structural diagram of an image processing apparatus according to an embodiment of the present invention.
  • the image processing apparatus 300 may include a transmitting apparatus 3001, at least one communication bus 3002, at least one processor 3003, such as a CPU, a receiving apparatus 3004, a memory 3005, and at least one network interface 3006.
  • the communication bus 3002 is arranged to implement connection communication between these components.
  • the network interface 3006 can optionally include a standard wireless interface (such as a WI-FI interface, a Bluetooth interface, an infrared interface, etc.).
  • the memory 3005 may be a high-speed RAM (Random Access Memory), or may be a non-volatile memory, such as at least one disk storage.
  • the memory 3005 may optionally be at least one remote from the foregoing processor.
  • a storage system of 3003; a memory 3005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an image processing program.
  • the processor 3003 calls the image processing program in the memory 3005 to implement the following operations:
  • corresponding blocks corresponding to the YCbCr component of the reference frame image are subjected to an average denoising operation by translating the corresponding block of the YCbCr component of the current frame image;
  • the denoised current frame image is converted from YCbCr to RGB color space.
  • the processor 3003 calls the image processing program in the memory 3005 to further implement the following operations:
  • the reference frame image and the current frame image are subjected to fine motion estimation between frames based on the Y component.
  • the processor 3003 calls the image processing program in the memory 3005 to further implement the following operations:
  • an image block of a predetermined area size is selected and recorded as ROI 1;
  • the position coordinate information of the ROI 2 on the Y component and the position coordinate information of the ROI 1 on the Y component are calculated, and the offset of the ROI 2 from the ROI 1 is obtained, and the offset is used as the current frame image relative to the reference frame.
  • the offset of the image is used as the current frame image relative to the reference frame.
  • the processor 3003 calls the image processing program in the memory 3005 to further implement the following operations:
  • the processor 3003 invokes a map in the memory 3005.
  • a map in the memory 3005. can also achieve the following operations:
  • the relative offset of each image block is obtained according to the offset of each image block in the frame image Y_mid and the offset of the ROI 2 relative to the ROI 1.
  • the offset of the corresponding image is obtained by calculating the offset of the corresponding image block in the two frames before and after; then the next frame is translated by panning.
  • the method moves to the corresponding position and performs corresponding image processing technology to achieve the effect of noise reduction; compared with the related art mobile phone denoising method, the calculation amount is small, the cost is low, the algorithm is easy to understand, the effect is good, and the real-time effect can be
  • the processing of the mobile phone image greatly improves the quality of the photo shooting.
  • an optional embodiment of the present invention provides an image processing method, including:
  • Step S101 Acquire an image data stream captured by the mobile terminal, and extract consecutive two frames of images from the image data stream as a reference frame image and a current frame image, respectively;
  • Step S102 performing color space conversion from RGB to YCbCr on the reference frame image and the current frame image, respectively;
  • Color space conversion is performed on the two images, that is, from RGB space to YCbCr space.
  • the conversion relationship can be as follows:
  • Step S103 performing motion estimation between frames on the reference frame image and the current frame image based on the Y component, and acquiring an inter-frame motion offset of the current frame image relative to the reference frame image;
  • the motion estimation in the embodiment of the present invention is divided into two steps: one, performing rough motion estimation on the entire frame image; and second, on the basis of rough estimation, Fine motion estimation.
  • performing motion estimation between the reference frame image and the current frame image based on the Y component includes:
  • the reference frame image and the current frame image are subjected to fine motion estimation between frames based on the Y component.
  • the rough motion estimation between the reference frame image and the current frame image based on the Y component includes:
  • an image block of a predetermined area size is selected and recorded as ROI 1;
  • the position coordinate information of the ROI 2 on the Y component and the position coordinate information of the ROI 1 on the Y component are calculated, and the offset of the ROI 2 from the ROI 1 is obtained, and the offset is used as the current frame image relative to the reference frame.
  • the offset of the image is used as the current frame image relative to the reference frame.
  • the fine motion estimation between the reference frame image and the current frame image based on the Y component includes:
  • the average of the offset of one or several blocks in the image is roughly estimated as the offset of the entire image, and one block is taken as an example for description.
  • an image block of a certain area size is selected as ROI 1; then, in a certain area on the dither frame Y2, the same image block ROI 2 as the ROI 1 is searched; position coordinate information of the ROI 2 on Y2 is searched.
  • the position coordinate information of the ROI 1 on Y1 is calculated, and the offset of the ROI 2 with respect to the ROI 1 is obtained, and this offset is taken as the offset of img2 with respect to img1.
  • the implementation is as follows:
  • a Select ROI 1.
  • a certain size area around the center point Y1 (h, w) of the Y1 focus area is taken as ROI 1.
  • the size can be 101*101, 201*201, or other sizes.
  • b Search for the same image block ROI 2 as ROI 1 on Y2 (the same size as ROI 1).
  • the size of the search area on Y2 is 103*103, 105*105 or 203*203, 205*205 around Y2(h, w), or other size areas, and the size of the area is larger than the size of ROI 1, as shown in FIG.
  • the block block in Y1 is the reference block; the large block block in Y2 is the search area size, and the small block block is the same size as the block block on Y1.
  • c block similarity criterion. Edge detection is performed on the block blocks of the same size as ROI 1 in ROI 1 and Y2 in Y1, and then the two block edge detection results are calculated, and the sum of the absolute values of the corresponding pixel differences is taken; if the sum is less than or equal to a certain
  • the preset threshold is considered to be the same for both blocks. If it is greater than the preset threshold, the block block (that is, the small block) of the same size as ROI 1 in Y2 is moved to the next position, and the method calculation is continued.
  • the edge detection method is as follows:
  • sobel operator is used for edge detection.
  • the sobel operator model is as follows:
  • the X-direction gradient and the Y-direction gradient are respectively calculated, that is, as shown in FIG. 5, the pixel P22 point X direction and Y direction gradient are respectively:
  • d The search order is made. Far from the center pixel distance of ROI 1 (from near and far), clockwise.
  • the search sequence is as shown in FIG. 6 , taking the offset of the upper and lower left and right pixels as an example (the implementation will be larger than two pixels, generally set to 7.), where 0 represents the position corresponding to the center point of the ROI 1 block, 1 The center point of the block is shifted to the right by one pixel, 2 is the position of moving down one pixel, and so on.
  • the offset of this block is taken as the offset of the entire image.
  • f Perform a translational calibration of Y2 according to the offset to obtain Y_mid.
  • Y_mid is basically different from Y1. Fine adjustments are then made so that the pixels between the two frames can be precisely aligned.
  • the implementation is as follows:
  • the search range for finding similar blocks is smaller than that of the rough estimation, and can be set to be within 2 pixels of the top, bottom, left, and right.
  • Step S104 Perform, according to the inter-frame motion offset of the current frame image relative to the reference frame image, the current frame image to perform a translation of the corresponding block of the YCbCr component;
  • the corresponding block of Y2Cb2Cr2 of the current frame image Y2 is translated according to the offset.
  • the translation size is the negative of the offset calculated above.
  • Step S105 the corresponding block after the YCbCr component of the current frame image is translated, corresponding to the corresponding block of the YCbCr component of the reference frame image, performing an average denoising operation;
  • Step S106 performing a color space conversion from YCbCr to RGB on the denoised current frame image.
  • FIG. 7 is an original diagram
  • FIG. 8 is an image after two-frame denoising processing.
  • the offset of the corresponding image is obtained by calculating the offset of the corresponding image block in the two frames before and after; then the next frame is translated by panning.
  • the method moves to the corresponding position and performs corresponding image processing technology to achieve the effect of noise reduction; compared with the related art mobile phone denoising method, the calculation amount is small, the cost is low, the algorithm is easy to understand, the effect is good, and the real-time effect can be
  • the processing of the mobile phone image greatly improves the quality of the photo shooting.
  • the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions, which are implemented when the computer executable instructions are executed by the processor.
  • the technical solution of the embodiment of the present invention may be embodied in the form of a software product stored in a storage medium (such as a ROM/RAM, a magnetic disk, an optical disk), and includes a plurality of instructions for making
  • a terminal device which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc. performs the method described in the embodiments of the present invention.
  • An image processing method and apparatus based on a 3D (inter-frame) image processing method, obtains an offset of a whole image by calculating an offset of a corresponding image block in two images before and after;
  • the latter frame is moved to the corresponding position by the method of translation, and corresponding image processing technology is performed to achieve the effect of noise reduction;
  • the calculation amount is small, the cost is low, and the algorithm is easy to understand.
  • the effect is good, and the image of the mobile phone can be processed in real time, which greatly improves the quality of the photograph.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

本文公布一种图像处理方法及装置,其装置包括获取模块,设置为:获取移动终端拍摄的图像数据流,从图像数据流中提取连续的前后两帧图像分别作为参考帧图像和当前帧图像;转换模块,设置为:分别对参考帧图像和当前帧图像进行色彩空间转换;估计模块,设置为:对参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量;平移模块,设置为:将当前帧图像进行YCbCr分量相应块的平移;去噪模块,设置为:将当前帧图像平移后的相应块,对应与参考帧图像的相应块进行取平均去噪操作;转换模块,还设置为:将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。

Description

图像处理方法及装置 技术领域
本申请涉及但不限于图像处理技术领域,尤指一种图像处理方法及装置。
背景技术
随着手机技术的发展,手机的拍照功能越来越完善。由于其体积小便于携带等特性,越来越多的人更热衷于使用手机拍照功能来记录生活中的美好瞬间,人们对手机拍摄的图像质量要求也越来越高。但是相关技术的手机拍照存在以下缺陷:在亮度不够的场合,图像中经常会带有一些噪声(亮度噪声加色度噪声),并且亮度越低,噪声越大。这些噪声的存在,严重影响图像的视觉质量。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本文提出一种图像处理方法及装置,可以提高手机拍摄的图像质量。
本发明实施例提供一种图像处理装置,包括:
获取模块,设置为:获取移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像分别作为参考帧图像和当前帧图像;
转换模块,设置为:分别对所述参考帧图像和当前帧图像进行从RGB到YCbCr的色彩空间转换;
估计模块,设置为:对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量;
平移模块,设置为:根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移;
去噪模块,设置为:将当前帧图像的YCbCr分量平移后的相应块,对应与所述参考帧图像的YCbCr分量相应块进行取平均去噪操作;
所述转换模块,还设置为:将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
可选地,所述估计模块设置为:
对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计;
基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计。
可选地,所述估计模块设置为:对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计,包括:对于参考帧图像,选取预定区域大小的图像块,记为ROI 1;在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2;将ROI 2在Y分量上的位置坐标信息与ROI 1在Y分量上的位置坐标信息进行计算,得到ROI 2相对ROI 1的偏移量,并将此偏移量作为当前帧图像相对于参考帧图像的偏移量。
可选地,所述当前帧图像相对于参考帧图像的偏移量包括水平方向的偏移量和垂直方向的偏移量。
可选地,所述估计模块设置为:在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2,包括:在当前帧图像上搜寻与ROI 1大小相同的图像块ROI 2,其中,搜寻区域大小大于ROI 1大小;分别对图像块ROI 1和ROI 2进行边缘检测,得到边缘检测结果;根据边缘检测结果判断图像块ROI 1和ROI 2是否相同,若相同,则得到与所述ROI 1相同的图像块ROI 2;若不相同,则移动当前帧图像中的图像块ROI 2至下一个位置,继续进行边缘检测,以获取与所述ROI 1相同的图像块ROI 2。
可选地,所述估计模块设置为:对图像块ROI 1和ROI 2的边缘检测结果进行计算,取对应像素差的绝对值之和;如果所述对应像素差的绝对值之和小于等于预设的阈值,则判断图像块ROI 1和ROI 2相同;如果大于预设的阈值,则判断图像块ROI 1和ROI 2不相同。
可选地,所述估计模块设置为:所述分别对图像块ROI 1和ROI 2进行 边缘检测,得到边缘检测结果包括:循环遍历块中每一像素点,利用索贝尔算子进行边缘检测,分别计算每个点水平方向梯度和垂直方向梯度之和,得到每个点的梯度。
可选地,所述估计模块设置为:以距离ROI 1中心像素由近及远,顺时针方向进行搜寻。
可选地,所述估计模块设置为:基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计,包括:根据ROI2相对ROI 1的偏移量,对当前帧图像进行平移校准,得到平移校准后的帧图像Y_mid;将参考帧图像分成一个或多个预定大小的图像块;对参考帧图像中每一图像块,分别在所述帧图像Y_mid中寻找匹配块;根据所述匹配块的位置计算参考帧图像中每一图像块在帧图像Y_mid中的偏移量;根据所述每一图像块在帧图像Y_mid中的偏移量,以及所述ROI 2相对ROI 1的偏移量,得到每一图像块的相对偏移量,作为当前帧图像相对于参考帧图像的帧间运动偏移量。
可选地,所述平移模块,设置为:根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移时,所平移的大小为每一图像块的相对偏移量的负值。
本发明实施例还提出一种图像处理方法,包括:
获取移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像分别作为参考帧图像和当前帧图像;
分别对所述参考帧图像和当前帧图像进行从RGB到YCbCr的色彩空间转换;
对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量;
根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移;
将当前帧图像的YCbCr分量平移后的相应块,对应与所述参考帧图像 的YCbCr分量相应块进行取平均去噪操作;
将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
可选地,所述对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量的步骤包括:
对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计;
基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计。
可选地,所述对参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计的步骤包括:
对于参考帧图像,选取预定区域大小的图像块,记为ROI 1;
在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2;
将ROI 2在Y分量上的位置坐标信息与ROI 1在Y分量上的位置坐标信息进行计算,得到ROI 2相对ROI 1的偏移量,并将此偏移量作为当前帧图像相对于参考帧图像的偏移量。
可选地,所述当前帧图像相对于参考帧图像的偏移量包括水平方向的偏移量和垂直方向的偏移量。
可选地,所述在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2的步骤包括:
在当前帧图像上搜寻与ROI 1大小相同的图像块ROI 2,其中,搜寻区域大小大于ROI 1大小;
分别对图像块ROI 1和ROI 2进行边缘检测,得到边缘检测结果;
根据边缘检测结果判断图像块ROI 1和ROI 2是否相同,若相同,则得到与所述ROI 1相同的图像块ROI 2;若不相同,则移动当前帧图像中的图像块ROI 2至下一个位置,继续进行边缘检测,以获取与所述ROI 1相同的图像块ROI 2。
可选地,所述根据边缘检测结果判断图像块ROI 1和ROI 2是否相同, 包括:
对图像块ROI 1和ROI 2的边缘检测结果进行计算,取对应像素差的绝对值之和;如果所述对应像素差的绝对值之和小于等于预设的阈值,则判断图像块ROI 1和ROI 2相同;如果大于预设的阈值,则判断图像块ROI 1和ROI 2不相同。
可选地,所述分别对图像块ROI 1和ROI 2进行边缘检测,得到边缘检测结果包括:
循环遍历块中每一像素点,利用索贝尔算子进行边缘检测,分别计算每个点水平方向梯度和垂直方向梯度之和,得到每个点的梯度。
可选地,所述在当前帧图像上搜寻与ROI 1大小相同的图像块ROI 2的步骤中,以距离ROI 1中心像素由近及远,顺时针方向进行搜寻。
可选地,所述基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计的步骤包括:
根据ROI 2相对ROI 1的偏移量,对当前帧图像进行平移校准,得到平移校准后的帧图像Y_mid;
将参考帧图像分成一个或多个预定大小的图像块;
对参考帧图像中每一图像块,分别在所述帧图像Y_mid中寻找匹配块;
根据所述匹配块的位置计算参考帧图像中每一图像块在帧图像Y_mid中的偏移量;
根据所述每一图像块在帧图像Y_mid中的偏移量,以及所述ROI 2相对ROI 1的偏移量,得到每一图像块的相对偏移量,作为当前帧图像相对于参考帧图像的帧间运动偏移量。
可选地,所述根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移的步骤中,所平移的大小为每一图像块的相对偏移量的负值。
本发明实施例还提出一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现上述方法。
本发明实施例提出的一种图像处理方法及装置,基于3D(帧间)图像处理方法,通过计算前后两帧图像中对应图像块的偏移量,来得到整幅图像的偏移量;然后将后面一帧通过平移的方法,移动到相应位置并进行相应图像处理技术,以达到降噪的效果;相较于相关技术的手机去噪的方法,计算量小,成本低,算法易于理解,效果好,且能实时对手机图像进行处理,极大的提高了照片的拍摄质量。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1是实现本发明实施例的移动终端的硬件结构示意图;
图2是如图1所示的移动终端的无线通信系统示意图;
图3是本发明图像处理装置可选实施例的模块示意图;
图4是本发明实施例中相邻两帧图像区域中图像块的示意图;
图5是本发明实施例中进行图像块边缘检测时像素点方向梯度计算示意图;
图6是本发明实施例中在当前帧图像中搜寻图像块的顺序示意图;
图7是本发明实施例中的一种原图;
图8是图7中的原图进行两帧去噪处理后的图像;
图9是本发明图像处理装置的另一种结构示意图;
图10是本发明图像处理方法可选实施例的流程示意图。
本发明的实施方式
应当理解,此处所描述的实施例仅仅用以解释本申请,并不用于限定本申请。
本发明实施例所涉及的终端可以为移动终端。
现在将参考附图描述实现本发明实施例的移动终端。在后续的描述中, 使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明实施例的说明,其本身并没有特定的意义。因此,"模块"与"部件"可以混合地使用。
移动终端可以以多种形式来实施。例如,本文中描述的终端可以包括诸如移动电话、智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。下面,假设终端是移动终端。然而,本领域技术人员将理解的是,除了特别用于移动目的的元件之外,根据本发明的实施方式的构造也能够应用于固定类型的终端。
图1为实现本发明实施例的移动终端的硬件结构示意图。
移动终端100可以包括无线通信单元110、A/V(音频/视频)输入单元120、用户输入单元130、感测单元140、输出单元150、存储器160、接口单元170、控制器180和电源单元190等等。图1示出了具有多种组件的移动终端,但是应理解的是,并不要求实施所有示出的组件。可以替代地实施更多或更少的组件。将在下面详细描述移动终端的元件。
无线通信单元110通常包括一个或多个组件,其允许移动终端100与无线通信系统或网络之间的无线电通信。例如,无线通信单元可以包括广播接收模块111、移动通信模块112、无线互联网模块113、短程通信模块114和位置信息模块115中的至少一个。
广播接收模块111经由广播信道从外部广播管理服务器接收广播信号和/或广播相关信息。广播信道可以包括卫星信道和/或地面信道。广播管理服务器可以是生成并发送广播信号和/或广播相关信息的服务器或者接收之前生成的广播信号和/或广播相关信息并且将其发送给终端的服务器。广播信号可以包括TV广播信号、无线电广播信号、数据广播信号等等。而且,广播信号可以进一步包括与TV或无线电广播信号组合的广播信号。广播相关信息也可以经由移动通信网络提供,并且在该情况下,广播相关信息可以由移动通信模块112来接收。广播信号可以以多种形式存在,例如,其可以以数字多媒体广播(DMB)的电子节目指南(EPG)、数字视频广播手持(DVB-H)的电子服务指南(ESG)等等的形式而存在。广播接收模块111可以通过使用多 种类型的广播系统接收信号广播。特别地,广播接收模块111可以通过使用诸如多媒体广播-地面(DMB-T)、数字多媒体广播-卫星(DMB-S)、数字视频广播-手持(DVB-H),前向链路媒体(MediaFLO@)的数据广播系统、地面数字广播综合服务(ISDB-T)等等的数字广播系统接收数字广播。广播接收模块111可以被构造为适合提供广播信号的广播系统以及上述数字广播系统。经由广播接收模块111接收的广播信号和/或广播相关信息可以存储在存储器160(或者其它类型的存储介质)中。
移动通信模块112将无线电信号发送到基站(例如,接入点、节点B等等)、外部终端以及服务器中的至少一个和/或从其接收无线电信号。这样的无线电信号可以包括语音通话信号、视频通话信号、或者根据文本和/或多媒体消息发送和/或接收的多种类型的数据。
无线互联网模块113支持移动终端的无线互联网接入。该模块可以内部或外部地耦接到终端。该模块所涉及的无线互联网接入技术可以包括WLAN(无线LAN)(Wi-Fi)、Wibro(无线宽带)、Wimax(全球微波互联接入)、HSDPA(高速下行链路分组接入)等等。
短程通信模块114设置为支持短程通信。短程通信技术的一些示例包括蓝牙TM、射频识别(RFID)、红外数据协会(IrDA)、超宽带(UWB)、紫蜂TM等等。
位置信息模块115设置为检查或获取移动终端的位置信息。位置信息模块的典型示例是GPS(全球定位系统)。根据当前的技术,GPS模块115计算来自三个或更多卫星的距离信息和准确的时间信息并且对于计算的信息应用三角测量法,从而根据经度、纬度和高度准确地计算三维当前位置信息。当前,用于计算位置和时间信息的方法使用三颗卫星并且通过使用另外的一颗卫星校正计算出的位置和时间信息的误差。此外,GPS模块115能够通过实时地连续计算当前位置信息来计算速度信息。
A/V输入单元120设置为接收音频或视频信号。A/V输入单元120可以包括相机121和麦克风122,相机121对在视频捕获模式或图像捕获模式中由图像捕获装置获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元151上。经相机121处理后的图像帧可以存储在存储器 160(或其它存储介质)中或者经由无线通信单元110进行发送,可以根据移动终端的构造提供两个或更多相机121。麦克风122可以在电话通话模式、记录模式、语音识别模式等等运行模式中经由麦克风接收声音(音频数据),并且能够将这样的声音处理为音频数据。处理后的音频(语音)数据可以在电话通话模式的情况下转换为可经由移动通信模块112发送到移动通信基站的格式输出。麦克风122可以通过噪声消除(或抑制)算法以消除(或抑制)在接收和发送音频信号的过程中产生的噪声或者干扰。
用户输入单元130可以根据用户输入的命令生成键输入数据以控制移动终端的操作。用户输入单元130允许用户输入多种类型的信息,并且可以包括键盘、锅仔片、触摸板(例如,检测由于被接触而导致的电阻、压力、电容等等的变化的触敏组件)、滚轮、摇杆等等。特别地,当触摸板以层的形式叠加在显示单元151上时,可以形成触摸屏。
感测单元140检测移动终端100的当前状态,(例如,移动终端100的打开或关闭状态)、移动终端100的位置、用户对于移动终端100的接触(即,触摸输入)的有无、移动终端100的取向、移动终端100的加速或减速移动和方向等等,并且生成用于控制移动终端100的操作的命令或信号。例如,当移动终端100实施为滑动型移动电话时,感测单元140可以感测该滑动型电话是打开还是关闭。另外,感测单元140能够检测电源单元190是否提供电力或者接口单元170是否与外部装置耦接。感测单元140可以包括接近传感器141将在下面结合触摸屏来对此进行描述。
接口单元170用作至少一个外部装置与移动终端100连接可以通过的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。识别模块可以是存储用于验证用户使用移动终端100的多种信息并且可以包括用户识别模块(UIM)、客户识别模块(SIM)、通用客户识别模块(USIM)等等。另外,具有识别模块的装置(下面称为"识别装置")可以采取智能卡的形式,因此,识别装置可以经由端口或其它连接装置与移动终端100连接。接口单元170可以设置为接收来自外部装置的输入(例如,数据信息、电力等等) 并且将接收到的输入传输到移动终端100内的一个或多个元件或者可以设置为在移动终端和外部装置之间传输数据。
另外,当移动终端100与外部底座连接时,接口单元170可以用作允许通过其将电力从底座提供到移动终端100的路径或者可以用作允许从底座输入的多种命令信号通过其传输到移动终端的路径。从底座输入的多种命令信号或电力可以用作用于识别移动终端是否准确地安装在底座上的信号。输出单元150被构造为以视觉、音频和/或触觉方式提供输出信号(例如,音频信号、视频信号、警报信号、振动信号等等)。输出单元150可以包括显示单元151、音频输出模块152、警报单元153等等。
显示单元151可以显示在移动终端100中处理的信息。例如,当移动终端100处于电话通话模式时,显示单元151可以显示与通话或其它通信(例如,文本消息收发、多媒体文件下载等等)相关的用户界面(UI)或图形用户界面(GUI)。当移动终端100处于视频通话模式或者图像捕获模式时,显示单元151可以显示捕获的图像和/或接收的图像、示出视频或图像以及相关功能的UI或GUI等等。
同时,当显示单元151和触摸板以层的形式彼此叠加以形成触摸屏时,显示单元151可以用作输入装置和输出装置。显示单元151可以包括液晶显示器(LCD)、薄膜晶体管LCD(TFT-LCD)、有机发光二极管(OLED)显示器、柔性显示器、三维(3D)显示器等等中的至少一种。这些显示器中的一些可以被构造为透明状以允许用户从外部观看,这可以称为透明显示器,典型的透明显示器可以例如为TOLED(透明有机发光二极管)显示器等等。根据特定想要的实施方式,移动终端100可以包括两个或更多显示单元(或其它显示装置),例如,移动终端可以包括外部显示单元(未示出)和内部显示单元(未示出)。触摸屏可设置为检测触摸输入压力以及触摸输入位置和触摸输入面积。
音频输出模块152可以在移动终端处于呼叫信号接收模式、通话模式、记录模式、语音识别模式、广播接收模式等等模式下时,将无线通信单元110接收的或者在存储器160中存储的音频数据转换音频信号并且输出为声音。而且,音频输出模块152可以提供与移动终端100执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出模块152可 以包括扬声器、蜂鸣器等等。
警报单元153可以提供输出以将事件的发生通知给移动终端100。典型的事件可以包括呼叫接收、消息接收、键信号输入、触摸输入等等。除了音频或视频输出之外,警报单元153可以以不同的方式提供输出以通知事件的发生。例如,警报单元153可以以振动的形式提供输出,当接收到呼叫、消息或一些其它进入通信(incomingcommunication)时,警报单元153可以提供触觉输出(即,振动)以将其通知给用户。通过提供这样的触觉输出,即使在用户的移动电话处于用户的口袋中时,用户也能够识别出事件的发生。警报单元153也可以经由显示单元151或音频输出模块152提供通知事件的发生的输出。
存储器160可以存储由控制器180执行的处理和控制操作的软件程序等等,或者可以暂时地存储己经输出或将要输出的数据(例如,电话簿、消息、静态图像、视频等等)。而且,存储器160可以存储关于当触摸施加到触摸屏时输出的多种方式的振动和音频信号的数据。
存储器160可以包括至少一种类型的存储介质,所述存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等等。而且,移动终端100可以与通过网络连接执行存储器160的存储功能的网络存储装置协作。
控制器180通常控制移动终端的总体操作。例如,控制器180执行与语音通话、数据通信、视频通话等等相关的控制和处理。另外,控制器180可以包括用于再现(或回放)多媒体数据的多媒体模块181,多媒体模块181可以构造在控制器180内,或者可以构造为与控制器180分离。控制器180可以执行模式识别处理,以将在触摸屏上执行的手写输入或者图片绘制输入识别为字符或图像。
电源单元190在控制器180的控制下接收外部电力或内部电力并且提供操作每个元件和组件所需的适当的电力。
这里描述的实施方式可以以使用例如计算机软件、硬件或其任何组合的 计算机可读介质来实施。对于硬件实施,这里描述的实施方式可以通过使用特定用途集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理装置(DSPD)、可编程逻辑装置(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器、被设计为执行这里描述的功能的电子单元中的至少一种来实施,在一些情况下,这样的实施方式可以在控制器180中实施。对于软件实施,诸如过程或功能的实施方式可以与允许执行至少一种功能或操作的单独的软件模块来实施。软件代码可以由以任何适当的编程语言编写的软件应用程序(或程序)来实施,软件代码可以存储在存储器160中并且由控制器180执行。
至此,己经按照其功能描述了移动终端。下面,为了简要起见,将描述诸如折叠型、直板型、摆动型、滑动型移动终端等等的多种类型的移动终端中的滑动型移动终端作为示例。因此,本发明实施例能够应用于任何类型的移动终端,并且不限于滑动型移动终端。
如图1中所示的移动终端100可以被构造为利用经由帧或分组发送数据的诸如有线和无线通信系统以及基于卫星的通信系统来操作。
现在将参考图2描述其中根据本发明实施例的移动终端能够操作的通信系统。
这样的通信系统可以使用不同的空中接口和/或物理层。例如,由通信系统使用的空中接口包括例如频分多址(FDMA)、时分多址(TDMA)、码分多址(CDMA)和通用移动通信系统(UMTS)(特别地,长期演进(LTE))、全球移动通信系统(GSM)等等。作为非限制性示例,下面的描述涉及CDMA通信系统,但是这样的教导同样适用于其它类型的系统。
参考图2,CDMA无线通信系统可以包括多个移动终端100、多个基站(BS)270、基站控制器(BSC)275和移动交换中心(MSC)280。MSC280被构造为与公共电话交换网络(PSTN)290形成接口。MSC280还被构造为与可以经由回程线路耦接到基站270的BSC275形成接口。回程线路可以根据多个己知的接口中的任一种来构造,所述接口包括例如E1/T1、ATM,IP、PPP、帧中继、HDSL、ADSL或xDSL。将理解的是,如图2中所示的系统可以包括多个BSC275。
每个BS270可以服务一个或多个分区(或区域),由多向天线或指向特定方向的天线覆盖的每个分区放射状地远离BS270。或者,每个分区可以由用于分集接收的两个或更多天线覆盖。每个BS270可以被构造为支持多个频率分配,并且每个频率分配具有特定频谱(例如,1.25MHz,5MHz等等)。
分区与频率分配的交叉可以被称为CDMA信道。BS270也可以被称为基站收发器子系统(BTS)或者其它等效术语。在这样的情况下,术语"基站"可以用于笼统地表示单个BSC275和至少一个BS270。基站也可以被称为"蜂窝站"。或者,特定BS270的多个分区可以被称为多个蜂窝站。
如图2中所示,广播发射器(BT)295将广播信号发送给在系统内操作的移动终端100。如图1中所示的广播接收模块111被设置在移动终端100处以接收由BT295发送的广播信号。在图2中,示出了几个全球定位系统(GPS)卫星300。卫星300帮助定位多个移动终端100中的至少一个。
在图2中,描绘了多个卫星300,但是理解的是,可以利用任何数目的卫星获得有用的定位信息。如图1中所示的GPS模块115通常被构造为与卫星300配合以获得想要的定位信息。替代GPS跟踪技术或者在GPS跟踪技术之外,可以使用可以跟踪移动终端的位置的其它技术。另外,至少一个GPS卫星300可以选择性地或者额外地处理卫星DMB传输。
作为无线通信系统的一个典型操作,BS270接收来自移动终端100的反向链路信号。移动终端100通常参与通话、消息收发和其它类型的通信。特定基站270接收的每个反向链路信号被在特定BS270内进行处理。获得的数据被转发给相关的BSC275。BSC提供通话资源分配和包括BS270之间的软切换过程的协调的移动管理功能。BSC275还将接收到的数据路由到MSC280,其提供用于与PSTN290形成接口的额外的路由服务。类似地,PSTN290与MSC280形成接口,MSC与BSC275形成接口,并且BSC275相应地控制BS270以将正向链路信号发送到移动终端100。
基于上述移动终端硬件结构以及通信系统,提出本发明实施例。
由于相关技术的手机拍照,在亮度不够的场合,图像中经常会带有一些噪声(亮度噪声加色度噪声),并且亮度越低,噪声越大。这些噪声的存在,严重影响图像的视觉质量。
为此,本申请提出一种解决方案,可以消除相关技术中去噪效果差,容易造成边缘细节的损失等缺点,使最终拍照得到图片有更好的视觉效果。
如图3所示,本发明实施例提出一种图像处理装置,包括:获取模块201、转换模块202、估计模块203、平移模块204及去噪模块205,其中:
获取模块201,设置为:获取移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像分别作为参考帧图像和当前帧图像;
转换模块202,设置为:分别对所述参考帧图像和当前帧图像进行从RGB到YCbCr的色彩空间转换;
估计模块203,设置为:对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量;
平移模块204,设置为:根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移;
去噪模块205,设置为:将当前帧图像的YCbCr分量平移后的相应块,对应与所述参考帧图像的YCbCr分量相应块进行取平均去噪操作;
所述转换模块202,还设置为:将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
可选地,所述估计模块203设置为:对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量,包括:
对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计;
基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计。
其中,所述估计模块203设置为:对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计,包括:对于参考帧图像,选取预定区域大小的图像块,记为ROI 1;在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2;将ROI 2在Y分量上的位置坐标信息与ROI 1在Y分量上的位置坐标信息进行计算,得到ROI 2相对ROI 1的偏移量,并将此偏移量作为当前帧图像相对于参考帧图像的偏移量。
可选地,所述当前帧图像相对于参考帧图像的偏移量包括水平方向的偏移量和垂直方向的偏移量。
所述估计模块203设置为:在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2,包括:在当前帧图像上搜寻与ROI 1大小相同的图像块ROI 2,其中,搜寻区域大小大于ROI 1大小;分别对图像块ROI 1和ROI2进行边缘检测,得到边缘检测结果;根据边缘检测结果判断图像块ROI 1和ROI 2是否相同,若相同,则得到与所述ROI 1相同的图像块ROI 2;若不相同,则移动当前帧图像中的图像块ROI 2至下一个位置,继续进行边缘检测,以获取与所述ROI 1相同的图像块ROI 2。所述估计模块203设置为:对图像块ROI 1和ROI 2的边缘检测结果进行计算,取对应像素差的绝对值之和;如果所述对应像素差的绝对值之和小于等于预设的阈值,则判断图像块ROI 1和ROI 2相同;如果大于预设的阈值,则判断图像块ROI 1和ROI2不相同。
所述估计模块203设置为:所述分别对图像块ROI 1和ROI 2进行边缘检测,得到边缘检测结果包括:循环遍历块中每一像素点,利用索贝尔(sobel)算子进行边缘检测,分别计算每个点水平方向梯度和垂直方向梯度之和,得到每个点的梯度。
所述估计模块203设置为:以距离ROI 1中心像素由近及远,顺时针方向进行搜寻。
所述估计模块203设置为:基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计,包括:根据ROI 2相对ROI 1的偏移量,对当前帧图像进行平移校准,得到平移校准后的帧图像Y_mid;将参考帧图像分成一个或多个预定大小的图像块;对参考帧图像 中每一图像块,分别在所述帧图像Y_mid中寻找匹配块;根据所述匹配块的位置计算参考帧图像中每一图像块在帧图像Y_mid中的偏移量;根据所述每一图像块在帧图像Y_mid中的偏移量,以及所述ROI 2相对ROI 1的偏移量,得到每一图像块的相对偏移量,作为当前帧图像相对于参考帧图像的帧间运动偏移量。
所述平移模块204,设置为:根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移时,所平移的大小为每一图像块的相对偏移量的负值。
以下对本实施例方案进行阐述:
首先,获取手机等移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像img1和img2,分别作为参考帧图像(前一帧)和当前帧图像(有可能由于手抖而有一定偏移的帧)。
然后,分别对两幅图片进行色彩空间转换,即从RGB空间转换到YCbCr空间。其中,RGB空间和YCbCr空间均为色彩空间,其中,RGB空间中,R、G、B分别指红、绿、蓝三个颜色分量。YCbCr空间中,Y是指亮度分量,Cb指蓝色色度分量,Cr指红色色度分量。
转换关系可以如下:
Figure PCTCN2016103071-appb-000001
之后,对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量。
由于两帧图像中,不同位置处的像素的偏移量不同,故本发明实施例运动估计分两步:一,对整帧图像进行粗略运动估计;二,在粗略估计的基础上,再进行精细的运动估计。
即对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计包 括:
对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计;
基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计。
其中,对参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计的包括:
对于参考帧图像,选取预定区域大小的图像块,记为ROI 1;
在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2;
将ROI 2在Y分量上的位置坐标信息与ROI 1在Y分量上的位置坐标信息进行计算,得到ROI 2相对ROI 1的偏移量,并将此偏移量作为当前帧图像相对于参考帧图像的偏移量。
基于粗略运动估计的结果,对参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计包括:
根据ROI 2相对ROI 1的偏移量,对当前帧图像进行平移校准,得到平移校准后的帧图像Y_mid;
将参考帧图像分成一个或多个预定大小的图像块;
对参考帧图像中每一图像块,分别在所述帧图像Y_mid中寻找匹配块;
根据所述匹配块的位置计算参考帧图像中每一图像块在帧图像Y_mid中的偏移量;
根据所述每一图像块在帧图像Y_mid中的偏移量,以及所述ROI 2相对ROI 1的偏移量,得到每一图像块的相对偏移量。
实际实施如下:
粗略估计:
把图像中某一个或几个块的偏移量的平均作为整个图像的偏移量进行粗略估计,以一个块为例进行说明。
对参考帧Y1,选取其一定区域大小的图像块,记为ROI 1;然后在抖动帧Y2上一定区域内,搜寻与ROI 1相同的图像块ROI 2;将ROI 2在Y2上的位置坐标信息与ROI 1在Y1上的位置坐标信息进行计算,得到ROI 2相对ROI 1的偏移量,将此偏移量作为img2相对于img1的偏移量。
此处得到两个方向的偏移量:
一、Y2相对于Y1的水平方向的偏移量,即X方向偏移量;
二、Y2相对于Y1的垂直方向的偏移量,即Y方向偏移量。
实施如下:
a:选取ROI 1。将Y1对焦区域中心点Y1(h,w)周围一定大小区域作为ROI 1。大小可以为101*101,201*201,或者其他大小。
b:在Y2上搜寻与ROI 1相同的图像块ROI 2(大小与ROI 1相同)。Y2上搜寻区域大小为Y2(h,w)周围103*103,105*105或者203*203,205*205,抑或其他大小区域,区域大小大于ROI 1的大小,如图4所示。
图4中,Y1中的方框块为参考块;Y2中的大方框块为搜寻区域大小,小方框块为与Y1上方框块大小相同。
c:块相似准则。分别对Y1中ROI 1和Y2中与ROI 1大小相同的方框块进行边缘检测,然后将两个块边缘检测结果进行计算,取对应像素差的绝对值之和;如果此和小于等于某一预设的阈值,则认为两个块相同,如果大于预设的阈值,则移动Y2中与ROI 1大小相同的方框块(即小方框块)至下一个位置,继续此方法计算。
其中,边缘检测方法如下:
此处用sobel(索贝尔)算子进行边缘检测,sobel算子模型如下:
Figure PCTCN2016103071-appb-000002
利用sobel算子,分别计算X方向梯度和Y方向梯度,即如图5所示,像素P22点X方向和Y方向梯度分别为:
Grad_x=abs(-1*p11+1*P13-2*p21+2*P23-1*p31+1*P33) ;
Grad_y=abs(-1*p11+1*p31-2*p12+2*p32-1*p13+1*p33);
根据X和Y方向梯度,最终P22点梯度为:
Grad=Grad_x+Grad_y;
循环遍历块中每一像素点,可得到每个点的梯度。当然此处也可用其他边缘算法。
d:搜寻顺序制定。以距离ROI 1中心像素距离远近(由近及远),顺时针方向。
搜寻顺序如图6所示,以偏移上下左右最大2个pixel(像素)为例(实际实施时会比两个像素大,一般设为7。),其中0代表与ROI 1块中心点对应的位置,1代表块中心点向右移动一个pixel,2代表向下移动一个pixel的位置,其他依次类推。
e:计算偏移量。在此记录ROI 1中心像素点的位置坐标(h1,w1),同时记录在Y2中计算得到的与ROI 1相同的块ROI 2的中心像素坐标(h2,w2),由此得到Y2中与ROI 1相同的块ROI 2相对于ROI 1的偏移量为:
Figure PCTCN2016103071-appb-000003
由于只要存在移动就是整幅图像帧的移动,故将此块的偏移量,当作整幅图像的偏移量。
f:根据偏移量对Y2进行平移校准,得到Y_mid。此时Y_mid基本和Y1相差很小。接下来进行精细调节,以使两帧之间像素可以精确对准。
精细估计:
实施如下:
a:将参考帧图像Y1分成一定大小的块,例如16*16,32*32或者其他大小的块,如果图像大小为256*256,块的大小为32*32,则图像的总块数为256/32*256/32=64块。
b:对Y1中的每一个块,分别在Y_mid中寻找其匹配块,实际实施和粗略调节中寻找相似块相同。只不过经过了粗略估计,此时寻找相似块的搜索范围要比粗略估计时的小,基本可以设定为周围上下左右2个pixel范围内。
c:经过上步,可以得到Y1中的每个块在Y_mid的位置,据此可以计算每一个块的偏移量Δxi,Δyi,与粗略估计中的偏移量相结合,就可以得到每个块的相对偏移量
Figure PCTCN2016103071-appb-000004
之后,根据偏移量对当前帧图像Y2的Y2Cb2Cr2相应块进行平移。平移大小为上面计算得到的偏移量的负值。
最后,将当前帧图像Y2的Y2Cb2Cr2分量平移后的相应块,对应与所述参考帧图像Y1的Y1Cb1Cr1分量相应块进行取平均去噪操作;将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
实例可参照图7及图8所示,图7为原图,图8为两帧去噪处理后的图像。
本实施例通过上述方案,基于3D(帧间)图像处理方法,通过计算前后两帧图像中对应图像块的偏移量,来得到整幅图像的偏移量;然后将后面一帧通过平移的方法,移动到相应位置并进行相应图像处理技术,以达到降 噪的效果;相较于相关技术的手机去噪的方法,计算量小,成本低,算法易于理解,效果好,且能实时对手机图像进行处理,极大的提高了照片的拍摄质量。
可选地,作为一种硬件运行环境,上述实施例所述的图像处理装置的另一种结构可以如图9所示。
如图9所示,为本发明实施例提供的图像处理装置的另一种结构示意图。该图像处理装置300可以包括:发送装置3001,至少一个通讯总线3002,至少一个处理器3003,例如CPU,接收装置3004,存储器3005,至少一个网络接口3006。其中,通信总线3002设置为:实现这些组件之间的连接通信。其中,网络接口3006可选的可以包括标准的无线接口(如WI-FI接口、蓝牙接口、红外接口等)。存储器3005可以是高速RAM(Random Access Memory,随机存储器),也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器,存储器3005可选的还可以是至少一个位于远离前述处理器3003的存储系统;作为一种计算机存储介质的存储器3005中可以包括操作系统、网络通信模块、用户接口模块、图像处理程序。
所述处理器3003调用存储器3005中的图像处理程序可以实现如下操作:
获取移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像分别作为参考帧图像和当前帧图像;
分别对所述参考帧图像和当前帧图像进行从RGB到YCbCr的色彩空间转换;
对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量;
根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移;
将当前帧图像的YCbCr分量平移后的相应块,对应与所述参考帧图像的YCbCr分量相应块进行取平均去噪操作;
将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
可选地,在一种实施方式中,所述处理器3003调用存储器3005中的图像处理程序还可以实现如下操作:
对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计;
基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计。
可选地,在一种实施方式中,所述处理器3003调用存储器3005中的图像处理程序还可以实现如下操作:
对于参考帧图像,选取预定区域大小的图像块,记为ROI 1;
在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2;
将ROI 2在Y分量上的位置坐标信息与ROI 1在Y分量上的位置坐标信息进行计算,得到ROI 2相对ROI 1的偏移量,并将此偏移量作为当前帧图像相对于参考帧图像的偏移量。
可选地,在一种实施方式中,所述处理器3003调用存储器3005中的图像处理程序还可以实现如下操作:
在当前帧图像上搜寻与ROI 1大小相同的图像块ROI 2,其中,搜寻区域大小大于ROI 1大小;
分别对图像块ROI 1和ROI 2进行边缘检测,得到边缘检测结果;
根据边缘检测结果判断图像块ROI 1和ROI 2是否相同,若相同,则得到与所述ROI 1相同的图像块ROI 2;若不相同,则移动当前帧图像中的图像块ROI 2至下一个位置,继续进行边缘检测,以获取与所述ROI 1相同的图像块ROI 2。
可选地,在一种实施方式中,所述处理器3003调用存储器3005中的图 像处理程序还可以实现如下操作:
根据ROI 2相对ROI 1的偏移量,对当前帧图像进行平移校准,得到平移校准后的帧图像Y_mid;
将参考帧图像分成一个或多个预定大小的图像块;
对参考帧图像中每一图像块,分别在所述帧图像Y_mid中寻找匹配块;
根据所述匹配块的位置计算参考帧图像中每一图像块在帧图像Y_mid中的偏移量;
根据所述每一图像块在帧图像Y_mid中的偏移量,以及所述ROI 2相对ROI 1的偏移量,得到每一图像块的相对偏移量。
本实施例通过上述方案,基于3D(帧间)图像处理方法,通过计算前后两帧图像中对应图像块的偏移量,来得到整幅图像的偏移量;然后将后面一帧通过平移的方法,移动到相应位置并进行相应图像处理技术,以达到降噪的效果;相较于相关技术的手机去噪的方法,计算量小,成本低,算法易于理解,效果好,且能实时对手机图像进行处理,极大的提高了照片的拍摄质量。
如图10所示,本发明可选实施例提出一种图像处理方法,包括:
步骤S101,获取移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像分别作为参考帧图像和当前帧图像;
获取手机等移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像img1和img2,分别作为参考帧图像(前一帧)和当前帧图像(有可能由于手抖而有一定偏移的帧)。
步骤S102,分别对所述参考帧图像和当前帧图像进行从RGB到YCbCr的色彩空间转换;
分别对两幅图片进行色彩空间转换,即从RGB空间转换到YCbCr空间。
转换关系可以如下:
Figure PCTCN2016103071-appb-000005
步骤S103,对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量;
由于两帧图像中,不同位置处的像素的偏移量不同,故本发明实施例运动估计分两步:一,对整帧图像进行粗略运动估计;二,在粗略估计的基础上,再进行精细的运动估计。
即对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计包括:
对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计;
基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计。
其中,对参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计的包括:
对于参考帧图像,选取预定区域大小的图像块,记为ROI 1;
在当前帧图像上预定区域内,搜寻与ROI 1相同的图像块ROI 2;
将ROI 2在Y分量上的位置坐标信息与ROI 1在Y分量上的位置坐标信息进行计算,得到ROI 2相对ROI 1的偏移量,并将此偏移量作为当前帧图像相对于参考帧图像的偏移量。
基于粗略运动估计的结果,对参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计包括:
根据ROI 2相对ROI 1的偏移量,对当前帧图像进行平移校准,得到平移校准后的帧图像Y_mid;
将参考帧图像分成一个或多个预定大小的图像块;
对参考帧图像中每一图像块,分别在所述帧图像Y_mid中寻找匹配块;
根据所述匹配块的位置计算参考帧图像中每一图像块在帧图像Y_mid中的偏移量;
根据所述每一图像块在帧图像Y_mid中的偏移量,以及所述ROI 2相对ROI 1的偏移量,得到每一图像块的相对偏移量,作为当前帧图像相对于参考帧图像的帧间运动偏移量。
实际实施如下:
粗略估计:
把图像中某一个或几个块的偏移量的平均作为整个图像的偏移量进行粗略估计,以一个块为例进行说明。
对参考帧Y1,选取其一定区域大小的图像块,记为ROI 1;然后在抖动帧Y2上一定区域内,搜寻与ROI 1相同的图像块ROI 2;将ROI 2在Y2上的位置坐标信息与ROI 1在Y1上的位置坐标信息进行计算,得到ROI 2相对ROI 1的偏移量,将此偏移量作为img2相对于img1的偏移量。
此处得到两个方向的偏移量:
一、Y2相对于Y1的水平方向的偏移量,即X方向偏移量;
二、Y2相对于Y1的垂直方向的偏移量,即Y方向偏移量。
实施如下:
a:选取ROI 1。将Y1对焦区域中心点Y1(h,w)周围一定大小区域作为ROI 1。大小可以为101*101,201*201,或者其他大小。
b:在Y2上搜寻与ROI 1相同的图像块ROI 2(大小与ROI 1相同)。Y2上搜寻区域大小为Y2(h,w)周围103*103,105*105或者203*203,205*205,抑或其他大小区域,区域大小大于ROI 1的大小,如图4所示。
图4中,Y1中的方框块为参考块;Y2中的大方框块为搜寻区域大小,小方框块为与Y1上方框块大小相同。
c:块相似准则。分别对Y1中ROI 1和Y2中与ROI 1大小相同的方框块进行边缘检测,然后将两个块边缘检测结果进行计算,取对应像素差的绝对值之和;如果此和小于等于某一预设的阈值,则认为两个块相同,如果大于预设的阈值,则移动Y2中与ROI 1大小相同的方框块(即小方框块)至下一个位置,继续此方法计算。
其中,边缘检测方法如下:
此处用sobel算子进行边缘检测,sobel算子模型如下:
Figure PCTCN2016103071-appb-000006
利用sobel算子,分别计算X方向梯度和Y方向梯度,即如图5所示,像素P22点X方向和Y方向梯度分别为:
Grad_x=abs(-1*p11+1*P13-2*p21+2*P23-1*p31+1*P33);
Grad_y=abs(-1*p11+1*p31-2*p12+2*p32-1*p13+1*p33);
根据X和Y方向梯度,最终P22点梯度为:
Grad=Grad_x+Grad_y;
循环遍历块中每一像素点,可得到每个点的梯度。当然此处也可用其他边缘算法。
d:搜寻顺序制定。以距离ROI 1中心像素距离远近(由近及远),顺时针方向。
搜寻顺序如图6所示,以偏移上下左右最大2个pixel为例(实施时会比两个像素大,一般设为7。),其中0代表与ROI 1块中心点对应的位置,1代表块中心点向右移动一个pixel,2代表向下移动一个pixel的位置,其他依次类推。
e:计算偏移量。在此记录ROI 1中心像素点的位置坐标(h1,w1),同时记录在Y2中计算得到的与ROI 1相同的块ROI 2的中心像素坐标(h2,w2),由此得到Y2中与ROI 1相同的块ROI 2相对于ROI 1的偏移量为:
Figure PCTCN2016103071-appb-000007
由于只要存在移动就是整幅图像帧的移动,故将此块的偏移量,当作整幅图像的偏移量。
f:根据偏移量对Y2进行平移校准,得到Y_mid。此时Y_mid基本和Y1相差很小。接下来进行精细调节,以使两帧之间像素可以精确对准。
精细估计:
实施如下:
a:将参考帧图像Y1分成一定大小的块,例如16*16,32*32或者其他大小的块,如果图像大小为256*256,块的大小为32*32,则图像的总块数为256/32*256/32=64块。
b:对Y1中的每一个块,分别在Y_mid中寻找其匹配块,实际实施和粗略调节中寻找相似块相同。只不过经过了粗略估计,此时寻找相似块的搜索范围要比粗略估计时的小,基本可以设定为周围上下左右2个pixel范围内。
c:经过上步,可以得到Y1中的每个块在Y_mid的位置,据此可以计算每一个块的偏移量Δxi,Δyi,与粗略估计中的偏移量相结合,就可以得到 每个块的相对偏移量
Figure PCTCN2016103071-appb-000008
步骤S104,根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移;
根据偏移量对当前帧图像Y2的Y2Cb2Cr2相应块进行平移。平移大小为上面计算得到的偏移量的负值。
步骤S105,将当前帧图像的YCbCr分量平移后的相应块,对应与所述参考帧图像的YCbCr分量相应块进行取平均去噪操作;
步骤S106,将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
将当前帧图像Y2的Y2Cb2Cr2分量平移后的相应块,对应与所述参考帧图像Y1的Y1Cb1Cr1分量相应块进行取平均去噪操作;最后将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
实例可参照图7及图8所示,图7为原图,图8为两帧去噪处理后的图像。
本实施例通过上述方案,基于3D(帧间)图像处理方法,通过计算前后两帧图像中对应图像块的偏移量,来得到整幅图像的偏移量;然后将后面一帧通过平移的方法,移动到相应位置并进行相应图像处理技术,以达到降噪的效果;相较于相关技术的手机去噪的方法,计算量小,成本低,算法易于理解,效果好,且能实时对手机图像进行处理,极大的提高了照片的拍摄质量。
本发明实施例还提出一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现上述图像处理方法。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变 体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明实施例的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括多个指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明实施例所述的方法。
以上仅为本发明的可选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请保护范围内。
工业实用性
本发明实施例提出的一种图像处理方法及装置,基于3D(帧间)图像处理方法,通过计算前后两帧图像中对应图像块的偏移量,来得到整幅图像的偏移量;然后将后面一帧通过平移的方法,移动到相应位置并进行相应图像处理技术,以达到降噪的效果;相较于相关技术的手机去噪的方法,计算量小,成本低,算法易于理解,效果好,且能实时对手机图像进行处理,极大的提高了照片的拍摄质量。

Claims (20)

  1. 一种图像处理装置,包括:
    获取模块,设置为:获取移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像分别作为参考帧图像和当前帧图像;
    转换模块,设置为:分别对所述参考帧图像和当前帧图像进行从RGB到YCbCr的色彩空间转换;
    估计模块,设置为:对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量;
    平移模块,设置为:根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移;
    去噪模块,设置为:将当前帧图像的YCbCr分量平移后的相应块,对应与所述参考帧图像的YCbCr分量相应块进行取平均去噪操作;
    所述转换模块,还设置为:将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
  2. 根据权利要求1所述的装置,其中,所述估计模块设置为:
    对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计;
    基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计。
  3. 根据权利要求2所述的装置,其中,所述估计模块设置为:对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计,包括:对于参考帧图像,选取预定区域大小的图像块,记为ROI1;在当前帧图像上预定区域内,搜寻与ROI1相同的图像块ROI2;将ROI2在Y分量上的位置坐标信息与ROI1在Y分量上的位置坐标信息进行计算,得到ROI2相对ROI1的偏移量,并将此偏移量作为当前帧图像相对于参考帧图像的偏移量。
  4. 根据权利要求3所述的装置,其中,
    所述当前帧图像相对于参考帧图像的偏移量包括水平方向的偏移量和垂直方向的偏移量。
  5. 根据权利要求3所述的装置,其中,所述估计模块设置为:在当前帧图像上预定区域内,搜寻与ROI1相同的图像块ROI2,包括:在当前帧图像上搜寻与ROI1大小相同的图像块ROI2,其中,搜寻区域大小大于ROI1大小;分别对图像块ROI1和ROI2进行边缘检测,得到边缘检测结果;根据边缘检测结果判断图像块ROI1和ROI2是否相同,若相同,则得到与所述ROI1相同的图像块ROI2;若不相同,则移动当前帧图像中的图像块ROI2至下一个位置,继续进行边缘检测,以获取与所述ROI1相同的图像块ROI2。
  6. 根据权利要求5所述的装置,其中,所述估计模块设置为:对图像块ROI1和ROI2的边缘检测结果进行计算,取对应像素差的绝对值之和;如果所述对应像素差的绝对值之和小于等于预设的阈值,则判断图像块ROI1和ROI2相同;如果大于预设的阈值,则判断图像块ROI1和ROI2不相同。
  7. 根据权利要求5所述的装置,其中,所述估计模块设置为:所述分别对图像块ROI1和ROI2进行边缘检测,得到边缘检测结果包括:循环遍历块中每一像素点,利用索贝尔算子进行边缘检测,分别计算每个点水平方向梯度和垂直方向梯度之和,得到每个点的梯度。
  8. 根据权利要求5所述的装置,其中,所述估计模块设置为:以距离ROI1中心像素由近及远,顺时针方向进行搜寻。
  9. 根据权利要求3所述的装置,其中,所述估计模块设置为:基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计,包括:根据ROI2相对ROI1的偏移量,对当前帧图像进行平移校准,得到平移校准后的帧图像Y_mid;将参考帧图像分成一个或多个预定大小的图像块;对参考帧图像中每一图像块,分别在所述帧图像Y_mid中寻找匹配块;根据所述匹配块的位置计算参考帧图像中每一图像块在帧图像Y_mid中的偏移量;根据所述每一图像块在帧图像Y_mid中的偏移量,以及所述ROI2相对ROI1的偏移量,得到每一图像块的相对偏移量,作为当前帧图像相对于参考帧图像的帧间运动偏移量。
  10. 根据权利要求9所述的装置,其中,所述平移模块,设置为:根据 所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移时,所平移的大小为每一图像块的相对偏移量的负值。
  11. 一种图像处理方法,包括:
    获取移动终端拍摄的图像数据流,从所述图像数据流中提取连续的前后两帧图像分别作为参考帧图像和当前帧图像;
    分别对所述参考帧图像和当前帧图像进行从RGB到YCbCr的色彩空间转换;
    对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量;
    根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移;
    将当前帧图像的YCbCr分量平移后的相应块,对应与所述参考帧图像的YCbCr分量相应块进行取平均去噪操作;
    将去噪后的当前帧图像进行从YCbCr到RGB的色彩空间转换。
  12. 根据权利要求11所述的方法,其中,所述对所述参考帧图像和当前帧图像基于Y分量进行帧间的运动估计,获取当前帧图像相对于参考帧图像的帧间运动偏移量的步骤包括:
    对所述参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计;
    基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计。
  13. 根据权利要求12所述的方法,其中,所述对参考帧图像和当前帧图像基于Y分量进行帧间的粗略运动估计的步骤包括:
    对于参考帧图像,选取预定区域大小的图像块,记为ROI1;
    在当前帧图像上预定区域内,搜寻与ROI1相同的图像块ROI2;
    将ROI2在Y分量上的位置坐标信息与ROI1在Y分量上的位置坐标信息进行计算,得到ROI2相对ROI1的偏移量,并将此偏移量作为当前帧 图像相对于参考帧图像的偏移量。
  14. 根据权利要求13所述的方法,其中,
    所述当前帧图像相对于参考帧图像的偏移量包括水平方向的偏移量和垂直方向的偏移量。
  15. 根据权利要求13所述的方法,其中,所述在当前帧图像上预定区域内,搜寻与ROI1相同的图像块ROI2的步骤包括:
    在当前帧图像上搜寻与ROI1大小相同的图像块ROI2,其中,搜寻区域大小大于ROI1大小;
    分别对图像块ROI1和ROI2进行边缘检测,得到边缘检测结果;
    根据边缘检测结果判断图像块ROI1和ROI2是否相同,若相同,则得到与所述ROI1相同的图像块ROI2;若不相同,则移动当前帧图像中的图像块ROI2至下一个位置,继续进行边缘检测,以获取与所述ROI1相同的图像块ROI2。
  16. 根据权利要求15所述的方法,其中,所述根据边缘检测结果判断图像块ROI1和ROI2是否相同,包括:
    对图像块ROI1和ROI2的边缘检测结果进行计算,取对应像素差的绝对值之和;如果所述对应像素差的绝对值之和小于等于预设的阈值,则判断图像块ROI1和ROI2相同;如果大于预设的阈值,则判断图像块ROI1和ROI2不相同。
  17. 根据权利要求15所述的方法,其中,所述分别对图像块ROI1和ROI2进行边缘检测,得到边缘检测结果包括:
    循环遍历块中每一像素点,利用索贝尔算子进行边缘检测,分别计算每个点水平方向梯度和垂直方向梯度之和,得到每个点的梯度。
  18. 根据权利要求15所述的方法,其中,所述在当前帧图像上搜寻与ROI1大小相同的图像块ROI2的步骤中,以距离ROI1中心像素由近及远,顺时针方向进行搜寻。
  19. 根据权利要求13所述的方法,其中,所述基于粗略运动估计的结果,对所述参考帧图像和当前帧图像基于Y分量进行帧间的精细运动估计 的步骤包括:
    根据ROI2相对ROI1的偏移量,对当前帧图像进行平移校准,得到平移校准后的帧图像Y_mid;
    将参考帧图像分成一个或多个预定大小的图像块;
    对参考帧图像中每一图像块,分别在所述帧图像Y_mid中寻找匹配块;
    根据所述匹配块的位置计算参考帧图像中每一图像块在帧图像Y_mid中的偏移量;
    根据所述每一图像块在帧图像Y_mid中的偏移量,以及所述ROI2相对ROI1的偏移量,得到每一图像块的相对偏移量,作为当前帧图像相对于参考帧图像的帧间运动偏移量。
  20. 根据权利要求19所述的方法,其中,所述根据所述当前帧图像相对于参考帧图像的帧间运动偏移量,将当前帧图像进行YCbCr分量相应块的平移的步骤中,所平移的大小为每一图像块的相对偏移量的负值。
PCT/CN2016/103071 2015-10-26 2016-10-24 图像处理方法及装置 WO2017071542A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510703741.0A CN105306787A (zh) 2015-10-26 2015-10-26 图像处理方法及装置
CN201510703741.0 2015-10-26

Publications (1)

Publication Number Publication Date
WO2017071542A1 true WO2017071542A1 (zh) 2017-05-04

Family

ID=55203501

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/103071 WO2017071542A1 (zh) 2015-10-26 2016-10-24 图像处理方法及装置

Country Status (2)

Country Link
CN (1) CN105306787A (zh)
WO (1) WO2017071542A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110782501A (zh) * 2019-09-09 2020-02-11 西安万像电子科技有限公司 图像处理方法及装置
CN115426525A (zh) * 2022-09-05 2022-12-02 北京拙河科技有限公司 一种基于高速动帧联动图像拆分方法及装置

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105306787A (zh) * 2015-10-26 2016-02-03 努比亚技术有限公司 图像处理方法及装置
CN108665410B (zh) * 2017-03-31 2021-11-26 杭州海康威视数字技术股份有限公司 一种图像超分辨率重构方法、装置及系统
CN107172322B (zh) * 2017-06-16 2020-02-18 北京飞识科技有限公司 一种视频降噪方法和装置
CN109859126B (zh) 2019-01-17 2021-02-02 浙江大华技术股份有限公司 一种视频降噪方法、装置、电子设备及存储介质
CN112906589B (zh) * 2021-03-01 2023-05-26 天地伟业技术有限公司 一种基于帧间作差法的mems面内动态特性分析方法

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1471321A (zh) * 2003-07-14 2004-01-28 大唐微电子技术有限公司 基于运动估计的小波视频编解码方法
CN1595433A (zh) * 2004-06-25 2005-03-16 东软飞利浦医疗设备系统有限责任公司 基于运动检测图像的递归降噪方法
CN101312500A (zh) * 2007-05-23 2008-11-26 索尼株式会社 图像处理方法和图像处理装置
JP2010108205A (ja) * 2008-10-30 2010-05-13 Hitachi Ltd 超解像画像作成方法
US20130128061A1 (en) * 2011-11-22 2013-05-23 Altek Corporation Image processing apparatus and processing method thereof
CN103606132A (zh) * 2013-10-31 2014-02-26 西安电子科技大学 基于空域和时域联合滤波的多帧数字图像去噪方法
CN103905746A (zh) * 2012-12-28 2014-07-02 清华大学 亚像素级图像偏移定位及叠加方法和装置以及视频设备
CN105306787A (zh) * 2015-10-26 2016-02-03 努比亚技术有限公司 图像处理方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI274297B (en) * 2004-11-19 2007-02-21 Aiptek Int Inc Method for deciding partition types of macro block

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1471321A (zh) * 2003-07-14 2004-01-28 大唐微电子技术有限公司 基于运动估计的小波视频编解码方法
CN1595433A (zh) * 2004-06-25 2005-03-16 东软飞利浦医疗设备系统有限责任公司 基于运动检测图像的递归降噪方法
CN101312500A (zh) * 2007-05-23 2008-11-26 索尼株式会社 图像处理方法和图像处理装置
JP2010108205A (ja) * 2008-10-30 2010-05-13 Hitachi Ltd 超解像画像作成方法
US20130128061A1 (en) * 2011-11-22 2013-05-23 Altek Corporation Image processing apparatus and processing method thereof
CN103905746A (zh) * 2012-12-28 2014-07-02 清华大学 亚像素级图像偏移定位及叠加方法和装置以及视频设备
CN103606132A (zh) * 2013-10-31 2014-02-26 西安电子科技大学 基于空域和时域联合滤波的多帧数字图像去噪方法
CN105306787A (zh) * 2015-10-26 2016-02-03 努比亚技术有限公司 图像处理方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110782501A (zh) * 2019-09-09 2020-02-11 西安万像电子科技有限公司 图像处理方法及装置
CN110782501B (zh) * 2019-09-09 2024-02-23 西安万像电子科技有限公司 图像处理方法及装置
CN115426525A (zh) * 2022-09-05 2022-12-02 北京拙河科技有限公司 一种基于高速动帧联动图像拆分方法及装置

Also Published As

Publication number Publication date
CN105306787A (zh) 2016-02-03

Similar Documents

Publication Publication Date Title
WO2018019124A1 (zh) 一种图像处理方法及电子设备、存储介质
CN106454121B (zh) 双摄像头拍照方法及装置
WO2017071542A1 (zh) 图像处理方法及装置
WO2017067526A1 (zh) 图像增强方法及移动终端
WO2017050115A1 (zh) 一种图像合成方法和装置
US8780258B2 (en) Mobile terminal and method for generating an out-of-focus image
WO2017045650A1 (zh) 一种图片处理方法及终端
WO2016180325A1 (zh) 图像处理方法及装置
WO2017016511A1 (zh) 一种图像处理方法及装置、终端
CN106909274B (zh) 一种图像显示方法和装置
WO2017020836A1 (zh) 一种虚化处理深度图像的装置和方法
CN106713716B (zh) 一种双摄像头的拍摄控制方法和装置
CN105956999B (zh) 缩略图生成装置和方法
WO2017071476A1 (zh) 一种图像合成方法和装置、存储介质
WO2017071475A1 (zh) 一种图像处理方法及终端、存储介质
WO2018076938A1 (zh) 图像处理装置及方法和计算机存储介质
WO2017041714A1 (zh) 一种获取rgb数据的方法和装置
WO2018019128A1 (zh) 一种夜景图像的处理方法和移动终端
WO2017206657A1 (zh) 一种图像处理方法、装置、移动终端及计算机存储介质
WO2017088618A1 (zh) 图片合成方法及装置
WO2018050014A1 (zh) 对焦方法及拍照设备、存储介质
WO2017206656A1 (zh) 一种图像处理方法及终端、计算机存储介质
WO2017088629A1 (zh) 去除图像彩色噪声的方法及装置、移动终端、存储介质
WO2017045647A1 (zh) 一种处理图像的移动终端和方法
WO2017067523A1 (zh) 图像处理方法、装置及移动终端

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

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

Country of ref document: EP

Kind code of ref document: A1