WO2017206655A1 - Image processing method, terminal, and computer storage medium - Google Patents

Image processing method, terminal, and computer storage medium Download PDF

Info

Publication number
WO2017206655A1
WO2017206655A1 PCT/CN2017/082935 CN2017082935W WO2017206655A1 WO 2017206655 A1 WO2017206655 A1 WO 2017206655A1 CN 2017082935 W CN2017082935 W CN 2017082935W WO 2017206655 A1 WO2017206655 A1 WO 2017206655A1
Authority
WO
WIPO (PCT)
Prior art keywords
raw
image
raw data
file
unit
Prior art date
Application number
PCT/CN2017/082935
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 WO2017206655A1 publication Critical patent/WO2017206655A1/en

Links

Images

Classifications

    • 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/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/646Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters

Definitions

  • the present invention relates to image processing technologies in the field of information processing, and in particular, to an image processing method, a terminal, and a computer storage medium.
  • the imaged image loses the scene information in the image of the compressed jpg format, the image quality is deteriorated, and the imaged image is passed.
  • the adjustment of the color and the brightness may be caused by the deterioration of the image quality, resulting in a poor secondary adjustment effect.
  • the embodiments of the present invention are expected to provide an image processing method, a terminal, and a computer storage medium to solve the problem of poor image effect caused by the existing secondary image processing.
  • Image post processing is performed on the image file of the RAW.
  • An obtaining unit configured to acquire raw RAW data of an image to be processed
  • a calculating unit configured to calculate a key shooting parameter in the original RAW data acquired by the acquiring unit according to a preset policy
  • a writing unit configured to write the key shooting parameters calculated by the calculating unit and the original RAW data acquired by the acquiring unit into a RAW file according to a preset encoding specification
  • a generating unit configured to open the RAW file written by the writing unit by using a third-party application, to generate an RAW image file
  • the processing unit is configured to perform image post-processing on the image file of the RAW generated by the generating unit.
  • the embodiment of the invention further provides a terminal, including:
  • a memory configured to store computer stored programs
  • a processor coupled to the memory, configured to perform the following operations by executing the computer program:
  • Image post processing is performed on the image file of the RAW.
  • a fourth aspect of the embodiments of the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer program, and after the computer program is executed by the processor, the image processing method described above can be implemented.
  • Embodiments of the present invention provide an image processing method, a terminal, and a computer storage medium, by acquiring original RAW data of an image to be processed; calculating key shooting parameters in the original RAW data according to a preset strategy; and selecting key shooting parameters and original RAW
  • the data is written into the RAW file according to the preset encoding specification; the third-party application is used to open the RAW file to generate the RAW image file; and the image processing of the RAW image file is post-processed.
  • the third-party application can parse the RAW file, so that the RAW file can be subjected to development processing to obtain a RAW image file.
  • the third-party application here processes the RAW image file, and the RAW image file retains the image information more completely than the processed image that has been processed once, so that the secondary processing can be reduced because of the loss.
  • the problem of poor image effect caused by image information on the other hand, relative to the processing of the processed image, it is possible to reduce that some parameters of the image have been processed once, and the processing that may occur when processing again is excessively displayed, thereby The problem of poor image processing caused by repeated processing of the same parameter is reduced, so that the image processing effect can be improved from at least these two aspects, and therefore, the third-party application can post-process the image without being concerned about the image quality being reduced and more free. Adjusting the color and brightness of the image has achieved the best image processing effect, thus improving the image rendering effect of the image processing.
  • FIG. 1 is a schematic structural diagram of hardware of an optional terminal for implementing various embodiments of the present invention
  • 2 is a communication system that the mobile terminal of the present invention can operate
  • FIG. 3 is a flowchart of an image processing method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a pixel arrangement manner according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of CMOS photon sensing according to an embodiment of the present invention.
  • FIG. 6 is an image diagram of an exemplary original RAW data according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a data structure of a TIFF according to an embodiment of the present disclosure.
  • FIG. 8 is an exemplary RAW file data flow according to an embodiment of the present invention.
  • FIG. 9 is an image diagram of an exemplary third-party processed RAW file according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram 1 of a terminal according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram 2 of a terminal according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram 3 of a terminal according to an embodiment of the present invention.
  • the focus obtaining apparatus may be a terminal, such as a computer or a mobile terminal, and the like, which can use a browser.
  • the mobile terminal can be implemented in various forms.
  • the terminals described in the present invention may include, for example, mobile phones, smart phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), 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.
  • the configuration according to an embodiment of the present invention can also be applied to a terminal of a fixed type.
  • FIG. 1 is a schematic diagram showing the hardware structure of an optional mobile terminal that implements various embodiments of the present invention.
  • the mobile terminal 1 may include a wireless communication unit 110, an audio/video (A/V) 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 1 and a wireless communication system or network.
  • the wireless communication unit can include at least one of the mobile communication module 112, the wireless internet module 113, the short-range communication module 114, and the location information module 115.
  • 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 various 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 a module for supporting 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 a module for checking or acquiring location information of the mobile terminal.
  • a typical example of a location information module is a Global Positioning System (GPS) module.
  • GPS Global Positioning System
  • the GPS module 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. Further, the GPS module can calculate the speed information by continuously calculating the current position information in real time.
  • 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 that processes image data of still pictures or video obtained by an 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) or transmitted via the wireless communication unit 110, and two or more cameras 121 may be provided according to the configuration of the mobile terminal.
  • 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, 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 1 (eg, the open or closed state of the mobile terminal 1), the location of the mobile terminal 1, the presence or absence of contact (ie, touch input) by the user with the mobile terminal 1, and the mobile terminal.
  • the orientation of 1, the acceleration or deceleration movement and direction of the mobile terminal 1, and the like, and generates a command or signal for controlling the operation of the mobile terminal 1.
  • 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 a connection through which at least one external device is connected to the mobile terminal 1 mouth.
  • 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 1 and may include a User Identification Module (UIM), a Customer Identification Module (SIM), a Universal Customer Identification 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 1 via a port or other connection device.
  • the interface unit 170 can be configured to receive input (eg, data information, power, etc.) from an external device and transmit the received input to one or more components within the mobile terminal 1 or can be used in 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 1 or may be used as a variety of command signals allowed to be input from the base to be transmitted to the mobile 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 and the like.
  • the display unit 151 can display information processed in the mobile terminal 1. For example, when the mobile terminal 1 is in the 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 1 is in the video call mode or the 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 liquid crystal At least one of a 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 At least one of a 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 1 may comprise two or more display units (or other display devices), for example, the mobile terminal may comprise 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 1 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 the various components and components.
  • 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 invention can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
  • the mobile terminal 1 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.
  • 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 may include a plurality of mobile terminals 1, a plurality of base stations (BS) 270, a base station controller (BSC) 275, and a mobile switching center (MSC) 280.
  • MSC 280 It 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 BS 270 via a backhaul line.
  • the backhaul line can be constructed in accordance with any of a number of well 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 may include multiple BSCs 2750.
  • Each BS 270 can serve one or more partitions (or regions), with each partition covered by a multi-directional antenna or an antenna pointing in 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 mean a single BSC 275 and at least one BS 270.
  • a base station can also be referred to as a "cell station.”
  • each partition 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 1 operating within the system.
  • BT broadcast transmitter
  • GPS Global Positioning System
  • 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 which is the location information module 115 shown in Figure 1, is typically configured to cooperate with the satellite 300 to obtain the 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 reverse link signals from various mobile terminals 1.
  • the mobile terminal 1 typically participates in calls, messaging, and other types of communications.
  • Each reverse link signal received by a particular BS 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 1.
  • An image processing method provided by an embodiment of the present invention is as shown in FIG. 3, and the method may include:
  • the acquisition of the raw RAW data of the image to be processed by the terminal is realized by an image sensor provided in the terminal.
  • the image sensor may include a charge coupled device (CCD) image sensor and a Color Filter Array (CMOS) filter element of a complementary metal oxide semiconductor (CMOS) image sensor.
  • the image sensor is a two-dimensional matrix composed of photosensitive elements densely arranged in two directions, forming a Bayer mode RGB pixel dot arrangement, and the common ones are (a) and (b) shown in FIG. , (c), (d) Four Bayer patterns are arranged in such a way that each CCD corresponds to one pixel. Among them, R induces red light, G senses green light, B induces blue light, and in Bayer mode, G is twice as large as R and B (because human eyes are more sensitive to green).
  • each CCD or CMOS in the above two-dimensional matrix is only used to sense the energy of photons, and each CCD or CMOS generates a corresponding proportion of charges due to the intensity of incoming light, and each CCD or CMOS will Charge information is collected and amplified and stored, for example
  • the CMOS sensor photon shown in the CMOS photon sensing diagram shown in FIG. 5 finally stores the corresponding proportion of charge (the block shown in FIG. 5), and the RAW record is the charge value of each pixel position, which is not recorded.
  • Any color information, that is: the original RAW data of the image to be processed is just a grayscale file.
  • the original RAW data when presented in the form of an image, there is no color for one grayscale image mode.
  • the image formed by the original RAW data can be seen as black and white. And there is also a mosaic phenomenon.
  • the operation of the terminal to process an image in the embodiment of the present invention may be understood as an image processing application in the terminal to process the image to be processed.
  • the terminal After the terminal acquires the original RAW data of the image to be processed, the terminal stores the scene information of the image to be processed in the original RAW data, and the terminal calculates the key shooting parameters of the original RAW data according to the scene information and the preset strategy.
  • the terminal calculates at least one of a white balance gain parameter and a color transformation matrix parameter of the original RAW data according to the preset policy.
  • white balance is a very important concept of image processing.
  • the so-called white balance (English name is White Balance) is the restoration of white objects.
  • the feeling of the same color is basically the same under different light. For example, when the morning sun rises, look at a white object and feel it is white; Under the dim light of the night, the white object was seen and it was still white. This is because human beings have adapted to the color reduction of objects in different light rays during their growth from birth.
  • a photographing terminal or a terminal having a photographing function such as a digital camera, there is no human eye adaptability. In different light, the digital camera will cause color reduction distortion of the digital camera due to the imbalance of the CCD output.
  • the user habitually thinks that the sunlight is white, the color temperature of the direct sunlight is about 5200K, and the color temperature of the incandescent lamp is about 3000K.
  • Traditional phase When the machine's daylight film is taken, the incandescent light is yellowish and reddish because the color temperature is too low. Therefore, when the color temperature of the spot light is lower than the color temperature set by the camera, it tends to be yellowish and reddish. When the color temperature of the spot light is higher than the camera setting, it will be bluish.
  • Typical white balance adjustments may include: automatic white balance, tungsten white balance, fluorescent white balance, indoor white balance, manual adjustment.
  • the preset policy may be an algorithm for calculating a gain parameter or a color transformation matrix of the white balance, and the implementation manner of the embodiment of the present invention is not limited.
  • the key shooting parameters in the original RAW data may further include: a width, a height, a pixel number, a black level of the image to be processed, a rotation parameter of the image capturing camera corresponding to the RAW data, and the like, wherein the rotation
  • the parameters may include: a rotation direction and a rotation angle, etc., and may be used for subsequent third-party applications to perform rotation correction on the image according to the rotation parameter.
  • the white balance parameter and the color transformation matrix parameters are important (the white balance gain parameter is used to adjust the white balance parameter) because these two parameters affect the normal color resolution of the original RAW data.
  • the color conversion matrix and the black level of each fixed sensor are fixed, and the white balance parameter is automatically calculated according to the scene.
  • the key shooting parameters such as Rgain, Ggain, Bgain or color conversion matrix parameters required for the RAW data are written to the original RAW data. In, form a RAW file.
  • the terminal of the embodiment of the present invention performs the key shooting parameters and the original RAW data required for the RAW file according to the uniformly parsable encoding format. Encapsulation, that is, the terminal writes key shooting parameters and raw RAW data into a RAW file according to a preset encoding specification.
  • the terminal writes the key shooting parameters and the original RAW data into the RAW file according to the Digital Negative (DNG) encoding specification.
  • DNG Digital Negative
  • DNG is mainly extended on the basis of the TIFF format, and the basic format of the encoding is basically defined in TIFF or TIFF/EP.
  • the three keywords in the TIFF file format are: Image File Header (IFH); Image File Directory (IFD) and Directory Entry (DE).
  • Figure 7 shows the data structure of TIFF. The following is based on the data structure of TIFF.
  • each image starts with an 8-byte IFH, which points to the first IFD.
  • the IFD contains various information about the image and also contains a pointer to the actual image data.
  • Byte 0-1 Byte order flag, value is II or MM. II indicates that the small byte is first, also known as little-endian. MM means that the big byte is in front and becomes big-endian again.
  • TIFF The flag of TIFF is generally 42, indicating that the image is in tiff format.
  • Byte 4-7 The offset of the first IFD. Can be anywhere, but must be at the boundary of a word, that is, it must be an integer multiple of 2.
  • IFD is the most important data structure in the TIF diagram. It contains the most important information in a TIF file.
  • a TIF map may have multiple IFDs. This means that there are multiple images in the file, and each IFD identifies the basics of one image. Attributes.
  • the IFD structure contains three types of members.
  • the Directory Entry Count indicates how many directory entries are in the structure. The next is the sequence of N linearly arranged DE sequences. The final is an offset that identifies the next file directory relative to The location at the beginning of the file, of course, if the TIF file contains only one image, then there is only one IFD, obviously, this offset is equal to 0;
  • a DE is an attribute of an image. For example, the size, resolution, compression of the image, the number of rows and columns of pixels, one pixel is represented by several bits (1 bit represents black and white, 8 bits represent 256 colors, etc.).
  • the above white balance parameter is a value in the attribute, where: the tag member is the number of the attribute, and in the image file directory, it is arranged in ascending order. We can read these numbers and then look up the appropriate meaning in the official white paper on TIF format. Attributes are represented by data, and type is the type that represents the data. A total of 12 bytes per DE:
  • Byte 4-7 The number of lenghts. The type and number can be used to determine the number of bytes that the data storing this TAG needs to occupy.
  • valueOffset is the offset of the variable value represented by the attribute identified by the tag relative to the beginning of the file. If the number of bytes occupied is less than 4, then the value is stored in the valueOffset, there is no need to point to another place. If there are more than 4, then the pointer to the actual data is stored here.
  • the terminal writes the original RAW data and the key shooting parameters into the RAW file according to the preset DNG encoding specification, and assumes that the RAW data is image data of one image to be processed, and key shooting parameters.
  • the data stream of the RAW file written by the terminal is as shown in FIG. Among them, since the RAW data is the image data of one image to be processed, there is only one IFD in FIG. 8, and the key shooting parameters are eight, and therefore, there are eight DEs in FIG.
  • the number of DEs can be set to N, that is, DE0, DE1, DE2, ... DEN. In the embodiment of the present invention, the number of DEs can be set according to actual needs. In addition, the eight DEs in FIG. 8 , that is, DE0, DE1, DE2, . . . , DE7 are only exemplified, and the number of DEs in the embodiment of the present invention is not specifically limited.
  • S104 Open a RAW file by using a third-party application to generate an RAW image file.
  • the terminal After the terminal writes the key shooting parameters and the original RAW data into the RAW file according to the preset encoding specification, when the user wants to use the third-party application on the terminal to process the image to be processed, the terminal can open the RAW file by using the third-party application.
  • a RAW image file is generated to continue processing the RAW image file.
  • the terminal parses the key shooting parameters in the RAW file by using a third-party application; in the third-party application, the original RAW data is adjusted according to the parsed key shooting parameters to generate a RAW image file.
  • the third-party application herein may be any one of image processing applications, and in the present embodiment, the third-party application may be an application other than an image application running by a camera that forms the RAW data.
  • the third-party application in the embodiment of the present invention is a third-party image processing application in the terminal.
  • the terminal uses a third party to open the RAW file to generate a RAW image file. It is a bright, high-quality image that is larger than the original RAW image.
  • the original RAW data of the image captured by one image processing application can be used by another image processing application of different encoding modes, and the unused image of the RAW data in the same terminal is realized. Handling sharing in the application improves the efficiency and applicability of image processing.
  • the image post-processing of the RAW image file by the terminal may be: the third party in the terminal or the terminal performs at least one of color, contrast, and brightness of the image file of the RAW.
  • the effect of the image to be processed after the RAW file is opened by the terminal through a third-party application is as shown in FIG. 9.
  • a third-party application such as a PS (Photoshop) application
  • An image processing method provided by an embodiment of the present invention obtains original RAW data of an image to be processed; calculates key shooting parameters in the original RAW data according to a preset strategy; and records the key shooting parameters and the original RAW data according to a preset encoding
  • the specification is written into the RAW file; the third-party application is used to open the RAW file to generate the RAW image file; and the image processing of the RAW image file is post-processed.
  • the third-party application can parse the RAW file, so that the RAW file can be developed to obtain the RAW image file, since the RAW image file is directly generated and adopted in the third-party application.
  • the image is post-processed as an object, and the degradation of the RAW file data is small. Therefore, when the third-party application performs post-processing on the image, the color and brightness of the image can be more freely adjusted without worrying about the degradation of the image quality. Good image processing effect, thus improving the image rendering effect of image processing.
  • an embodiment of the present invention provides a terminal 1, which may include:
  • the obtaining unit 10 is configured to acquire raw RAW data of the image to be processed.
  • the calculating unit 11 is configured to calculate key shooting parameters in the original RAW data acquired by the acquiring unit 10 according to a preset policy.
  • the writing unit 12 is configured to write the key shooting parameters calculated by the calculating unit 11 and the original RAW data acquired by the obtaining unit 10 into a RAW file according to a preset encoding specification.
  • a generating unit 13 configured to open the writing unit 12 by using a third-party application RAW file, which generates RAW image files.
  • the processing unit 14 is configured to perform image post-processing on the image file of the RAW generated by the generating unit 13.
  • the calculating unit 11 is configured to calculate at least one of a gain parameter and a color transformation matrix parameter of the white balance of the original RAW data acquired by the acquiring unit 10 according to a preset policy.
  • the calculating unit 11 is further configured to calculate, according to a preset policy, a width, a height, a pixel number of bits, a black balance parameter, and a camera that forms the RAW data corresponding to the original RAW data.
  • a preset policy a width, a height, a pixel number of bits, a black balance parameter, and a camera that forms the RAW data corresponding to the original RAW data.
  • One or more of the rotation parameters is further configured to calculate, according to a preset policy, a width, a height, a pixel number of bits, a black balance parameter, and a camera that forms the RAW data corresponding to the original RAW data.
  • the terminal 1 further includes: a parsing unit 15 .
  • the parsing unit 15 is configured to parse key shooting parameters in the RAW file calculated by the calculating unit 11 by using the third-party application.
  • the generating unit 13 is configured to adjust, in the third-party application, the original written by the writing unit 12 according to the key shooting parameters parsed by the parsing unit 15 from the writing unit 12 RAW data, generating an image file of the RAW.
  • the writing unit 12 is configured to write the key shooting parameters calculated by the calculating unit 11 and the original RAW data acquired by the acquiring unit 10 into a RAW file according to a DNG encoding specification.
  • the processing unit 14 is configured to perform at least one of color, contrast, and brightness of the image on the image file of the RAW generated by the generating unit 13 .
  • the terminal in the embodiment of the present invention may be an electronic device such as a mobile phone, a tablet, or a camera, which has a shooting function and an image processing function, and is not limited in the embodiment of the present invention.
  • the above-mentioned obtaining unit 10, computing unit 11, writing unit 12, generating unit 13, processing unit 14, and parsing unit 15 may be implemented by a processor 16 located on the terminal 1, specifically for the center.
  • processor 16 located on the terminal 1, specifically for the center.
  • processor CPU
  • MPU microprocessor
  • DSP digital signal Implemented by a processor
  • FPGA field programmable gate array
  • the terminal 1 may further include a storage medium 17, which may be connected to the processor 16 via a system bus 18, wherein the storage medium 17 is used for storage
  • Program code may be executable, the program code including computer operating instructions, storage medium 17 may include high speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
  • a terminal provided by the embodiment of the present invention acquires original RAW data of an image to be processed; calculates key shooting parameters in the original RAW data according to a preset strategy; and records the key shooting parameters and the original RAW data according to a preset encoding
  • the specification is written into the RAW file; the third-party application is used to open the RAW file to generate the RAW image file; and the image processing of the RAW image file is post-processed.
  • the third-party application can parse the RAW file, so that the RAW file can be developed and processed to obtain a RAW image file, which is directly generated and used in the third-party application of the terminal.
  • the image file is used as an object for post-processing, and the degradation of the RAW file data is small. Therefore, when the third-party application performs post-processing on the image, the color and brightness of the image can be more freely adjusted without worrying about the degradation of the image quality. Achieve the best image processing effect, thereby improving the image rendering effect of image processing.
  • the embodiment of the invention further provides a terminal, which may be a mobile phone, a tablet computer, a dedicated camera or a storable memory, configured to store a computer storage program.
  • a terminal which may be a mobile phone, a tablet computer, a dedicated camera or a storable memory, configured to store a computer storage program.
  • a processor coupled to the memory, configured to perform the following operations by executing the computer program:
  • Image post processing is performed on the image file of the RAW.
  • the processor is further configured to calculate at least one of a white balance gain parameter and a color transformation matrix parameter of the original RAW data according to a preset policy.
  • the processor is further configured to
  • the processor is configured to parse key shooting parameters in the RAW file by using the third-party application;
  • the image file of the RAW is generated based on the adjusted original RAW data.
  • the processor is configured to write the key shooting parameters and the raw RAW data into a RAW file according to a digital news gathering DNG encoding specification.
  • the processor is configured to perform at least one of color, contrast, and brightness of the image on the RAW image file.
  • the processor herein can be a central processing unit, a microprocessor, a digital signal processor, an application processor, or become one or more of an array.
  • the memory may be various memories such as a random access memory, a read only memory, a flash memory, and the like.
  • the processor and the memory may be connected by a bus, where the bus may include an integrated circuit (IIC) bus or a peripheral interconnect standard (PCI) bus.
  • IIC integrated circuit
  • PCI peripheral interconnect standard
  • the embodiment of the present invention provides a computer storage medium, where the computer storage medium stores a computer program, and after the computer program is executed by the processor, the image processing method provided by any one of the foregoing technical solutions can be implemented.
  • the computer storage medium can be a random storage medium, a read-only storage medium, a flash memory or a mobile hard disk, or the like.
  • the computer storage medium is a non-transitory storage medium.
  • the RAW image file is generated based on the original RAW data and the key shooting parameters, and the RAW image file is post-processed, so that the image is processed relative to the already processed image.
  • the processing of the file can reduce the problem of poor image processing caused by the post-processing caused by the change of the image caused by the original processing, and improve the image processing quality.
  • the solution provided by the embodiment of the present invention can realize the above solution by setting a computer program in the processing device, and is industrially simple and widely used.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

An image processing method, comprising: obtaining RAW data of an image to be processed; calculating a key photographing parameter in the RAW data according to a preset strategy; writing the key photographing parameter and the RAW data into an RAW file according to a preset coding standard; opening the RAW file using a third-party application and generating a RAW image file; and performing image post-processing on the RAW image file. Also disclosed are a terminal and a computer storage medium.

Description

图像处理方法、终端和计算机存储介质Image processing method, terminal and computer storage medium
本申请基于申请号为201610367533.2、申请日为2016年05月30日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is filed on the basis of the Chinese Patent Application No. PCT Application No.
技术领域Technical field
本发明涉及信息处理领域中的图像处理技术,尤其涉及一种图像处理方法、终端和计算机存储介质。The present invention relates to image processing technologies in the field of information processing, and in particular, to an image processing method, a terminal, and a computer storage medium.
背景技术Background technique
随着电子科技的不断发展,具有拍摄功能的终端尤其是摄像设备的发展也是突飞猛进,从而使得用户对摄像设备的图像质量(例如,色彩真实度)的要求也越来越高。With the continuous development of electronic technology, the development of terminals with shooting functions, especially camera devices, is also advancing rapidly, so that users have higher and higher requirements on the image quality (for example, color realism) of the camera device.
当前技术中,对于经过摄像设备拍摄出的图像由于温差或光照等等原因,在成像后需要进行相应的参数调节(二次处理),来使得图像更逼真、色彩更真实。In the current technology, for images taken by the imaging device due to temperature difference or illumination, etc., corresponding parameter adjustment (secondary processing) is required after imaging to make the image more realistic and the color more realistic.
然而,采用当前技术的图像处理方法,由于已成像的图像在经过压缩后的jpg等格式的图像中损失了场景信息,因此,造成的画质劣化会较多,这样,将已成像的图像经过二次处理时,对色彩和亮度进行的调节会由于画质降低,造成二次调节的效果较差。However, with the current image processing method, since the imaged image loses the scene information in the image of the compressed jpg format, the image quality is deteriorated, and the imaged image is passed. When the secondary processing is performed, the adjustment of the color and the brightness may be caused by the deterioration of the image quality, resulting in a poor secondary adjustment effect.
发明内容Summary of the invention
本发明实施例期望提供一种图像处理方法、终端和计算机存储介质,以解决现有二次图像处理导致的图像效果差的问题。The embodiments of the present invention are expected to provide an image processing method, a terminal, and a computer storage medium to solve the problem of poor image effect caused by the existing secondary image processing.
本发明实施例的技术方案是这样实现的: The technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供的一种图像处理方法,包括:An image processing method provided by an embodiment of the present invention includes:
获取待处理图像的原始RAW数据;Obtaining raw RAW data of the image to be processed;
根据预设策略,计算所述原始RAW数据中的关键拍摄参数;Calculating key shooting parameters in the original RAW data according to a preset strategy;
将所述关键拍摄参数和所述原始RAW数据按照预设编码规范写入RAW文件中;Writing the key shooting parameters and the original RAW data into a RAW file according to a preset encoding specification;
利用第三方应用打开所述RAW文件,生成RAW的图像文件;Opening the RAW file with a third-party application to generate a RAW image file;
对所述RAW的图像文件进行图像后期处理。Image post processing is performed on the image file of the RAW.
本发明实施例提供的一种终端,包括:A terminal provided by an embodiment of the present invention includes:
获取单元,配置为获取待处理图像的原始RAW数据;An obtaining unit configured to acquire raw RAW data of an image to be processed;
计算单元,配置为根据预设策略,计算所述获取单元获取的所述原始RAW数据中的关键拍摄参数;a calculating unit, configured to calculate a key shooting parameter in the original RAW data acquired by the acquiring unit according to a preset policy;
写入单元,配置为将所述计算单元计算的所述关键拍摄参数和所述获取单元获取的所述原始RAW数据按照预设编码规范写入RAW文件中;a writing unit configured to write the key shooting parameters calculated by the calculating unit and the original RAW data acquired by the acquiring unit into a RAW file according to a preset encoding specification;
生成单元,配置为利用第三方应用打开所述写入单元写好的所述RAW文件,生成RAW的图像文件;a generating unit, configured to open the RAW file written by the writing unit by using a third-party application, to generate an RAW image file;
处理单元,配置为对所述生成单元生成的所述RAW的图像文件进行图像后期处理。The processing unit is configured to perform image post-processing on the image file of the RAW generated by the generating unit.
本发明实施例还提供一种终端,包括:The embodiment of the invention further provides a terminal, including:
存储器,配置为存储计算机存储程序,a memory configured to store computer stored programs,
处理器,与所述存储器连接,配置为通过执行所述计算机程序,执行以下操作:A processor, coupled to the memory, configured to perform the following operations by executing the computer program:
获取待处理图像的原始RAW数据;Obtaining raw RAW data of the image to be processed;
根据预设策略,计算所述原始RAW数据中的关键拍摄参数;Calculating key shooting parameters in the original RAW data according to a preset strategy;
将所述关键拍摄参数和所述原始RAW数据按照预设编码规范写入RAW文件中; Writing the key shooting parameters and the original RAW data into a RAW file according to a preset encoding specification;
利用第三方应用打开所述RAW文件,生成RAW的图像文件;Opening the RAW file with a third-party application to generate a RAW image file;
对所述RAW的图像文件进行图像后期处理。Image post processing is performed on the image file of the RAW.
本发明实施例第四方面还提供一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序被处理器执行之后,能够实现上述的图像处理方法。A fourth aspect of the embodiments of the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer program, and after the computer program is executed by the processor, the image processing method described above can be implemented.
本发明实施例提供了一种图像处理方法、终端和计算机存储介质,通过获取待处理图像的原始RAW数据;根据预设策略,计算原始RAW数据中的关键拍摄参数;将关键拍摄参数和原始RAW数据按照预设编码规范写入RAW文件中;利用第三方应用打开RAW文件,生成RAW的图像文件;对RAW的图像文件进行图像后期处理。采用上述技术实现方案,由于对原始RAW数据进行统一编码使得第三方应用可以解析RAW文件,从而可以对RAW文件进行显像处理得到RAW图像文件。一方面,这里的第三方应用处理的是RAW图像文件,相对于进行过一次图像处理的已处理图像,RAW图像文件更完整的保留了图像信息,从而进行二次处理时,能够减少因为丢失的图像信息导致的图像效果差的问题,另一方面,相对于对已处理的图像进行再次处理,可以减少图像的某些参数已经进行过了一次处理,再次处理时可能出现的处理过度显现,从而减少重复处理同一个参数导致的图像效果差的问题,故可以从至少这两个方面提升图像处理效果,因此,在该第三方应用对图像进行后期处理时可以无需担心画质降低而更自由的调节图像的色彩和亮度,已达到最好的图像处理效果,从而提高图像处理的画面呈现效果。Embodiments of the present invention provide an image processing method, a terminal, and a computer storage medium, by acquiring original RAW data of an image to be processed; calculating key shooting parameters in the original RAW data according to a preset strategy; and selecting key shooting parameters and original RAW The data is written into the RAW file according to the preset encoding specification; the third-party application is used to open the RAW file to generate the RAW image file; and the image processing of the RAW image file is post-processed. With the above technical implementation scheme, since the original RAW data is uniformly encoded, the third-party application can parse the RAW file, so that the RAW file can be subjected to development processing to obtain a RAW image file. On the one hand, the third-party application here processes the RAW image file, and the RAW image file retains the image information more completely than the processed image that has been processed once, so that the secondary processing can be reduced because of the loss. The problem of poor image effect caused by image information, on the other hand, relative to the processing of the processed image, it is possible to reduce that some parameters of the image have been processed once, and the processing that may occur when processing again is excessively displayed, thereby The problem of poor image processing caused by repeated processing of the same parameter is reduced, so that the image processing effect can be improved from at least these two aspects, and therefore, the third-party application can post-process the image without being worried about the image quality being reduced and more free. Adjusting the color and brightness of the image has achieved the best image processing effect, thus improving the image rendering effect of the image processing.
附图说明DRAWINGS
图1为实现本发明各个实施例一种可选的终端的硬件结构示意图;1 is a schematic structural diagram of hardware of an optional terminal for implementing various embodiments of the present invention;
图2为本发明的移动终端能够操作的通信系统;2 is a communication system that the mobile terminal of the present invention can operate;
图3为本发明实施例提供的一种图像处理方法的流程图; FIG. 3 is a flowchart of an image processing method according to an embodiment of the present invention;
图4为本发明实施例提供的像素排列方式的结构示意图;4 is a schematic structural diagram of a pixel arrangement manner according to an embodiment of the present invention;
图5为本发明实施例提供的CMOS光子感应示意图;FIG. 5 is a schematic diagram of CMOS photon sensing according to an embodiment of the present invention; FIG.
图6为本发明实施例提供的示例性的原始RAW数据成像图;FIG. 6 is an image diagram of an exemplary original RAW data according to an embodiment of the present invention; FIG.
图7为本发明实施例提供的TIFF的数据结构示意图;FIG. 7 is a schematic diagram of a data structure of a TIFF according to an embodiment of the present disclosure;
图8为本发明实施例提供的示例性的RAW文件数据流;FIG. 8 is an exemplary RAW file data flow according to an embodiment of the present invention;
图9为本发明实施例提供的示例性的经过第三方处理后的RAW文件据成像图;FIG. 9 is an image diagram of an exemplary third-party processed RAW file according to an embodiment of the present invention; FIG.
图10为本发明实施例提供的一种终端的结构示意图一;FIG. 10 is a schematic structural diagram 1 of a terminal according to an embodiment of the present disclosure;
图11为本发明实施例提供的一种终端的结构示意图二;FIG. 11 is a schematic structural diagram 2 of a terminal according to an embodiment of the present disclosure;
图12为本发明实施例提供的一种终端的结构示意图三。FIG. 12 is a schematic structural diagram 3 of a terminal according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is understood that the preferred embodiments described below are only used to illustrate and explain the present invention, and are not intended to limit this invention.
现在将参考附图描述实现本发明各个实施例的移动终端。在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身并没有特定的意义。因此,“模块”与“部件”可以混合地使用。A mobile terminal embodying various embodiments of the present invention will now be described with reference to the accompanying drawings. In the following description, the use of suffixes such as "module", "component" or "unit" for indicating an element is merely an explanation for facilitating the present invention, and does not have a specific meaning per se. Therefore, "module" and "component" can be used in combination.
需要说明的是,本发明实施例提供的一种焦点获取装置可以为终端,例如计算机或移动终端等可以使用浏览器的电子设备。It should be noted that the focus obtaining apparatus provided by the embodiment of the present invention may be a terminal, such as a computer or a mobile terminal, and the like, which can use a browser.
其中,移动终端可以以各种形式来实施。例如,本发明中描述的终端可以包括诸如移动电话、智能电话、笔记本电脑、数字广播接收器、个人数字助理(PDA)、平板电脑(PAD)、便携式多媒体播放器(PMP)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。下面,假设终端是移动终端。然而,本领域技术人员将理解的是,除了特别用于 移动目的的元件之外,根据本发明的实施方式的构造也能够应用于固定类型的终端。Among them, the mobile terminal can be implemented in various forms. For example, the terminals described in the present invention may include, for example, mobile phones, smart phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), 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 in addition to being specifically used In addition to the components of the mobile purpose, the configuration according to an embodiment of the present invention can also be applied to a terminal of a fixed type.
图1为实现本发明各个实施例一种可选的移动终端的硬件结构示意。FIG. 1 is a schematic diagram showing the hardware structure of an optional mobile terminal that implements various embodiments of the present invention.
移动终端1可以包括无线通信单元110、音频/视频(A/V)输入单元120、用户输入单元130、感测单元140、输出单元150、存储器160、接口单元170、控制器180和电源单元190等等。图1示出了具有各种组件的移动终端,但是应理解的是,并不要求实施所有示出的组件。可以替代地实施更多或更少的组件。将在下面详细描述移动终端的元件。The mobile terminal 1 may include a wireless communication unit 110, an audio/video (A/V) 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.
无线通信单元110通常包括一个或多个组件,其允许移动终端1与无线通信系统或网络之间的无线电通信。例如,无线通信单元可以包括移动通信模块112、无线互联网模块113、短程通信模块114和位置信息模块115中的至少一个。 Wireless communication unit 110 typically includes one or more components that permit radio communication between mobile terminal 1 and a wireless communication system or network. For example, the wireless communication unit can include at least one of the mobile communication module 112, the wireless internet module 113, the short-range communication module 114, and the location information module 115.
移动通信模块112将无线电信号发送到基站(例如,接入点、节点B等等)、外部终端以及服务器中的至少一个和/或从其接收无线电信号。这样的无线电信号可以包括语音通话信号、视频通话信号、或者根据文本和/或多媒体消息发送和/或接收的各种类型的数据。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. Such radio signals may include voice call signals, video call signals, or various types of data transmitted and/or received in accordance with text and/or multimedia messages.
无线互联网模块113支持移动终端的无线互联网接入。该模块可以内部或外部地耦接到终端。该模块所涉及的无线互联网接入技术可以包括WLAN(无线LAN)(Wi-Fi)、Wibro(无线宽带)、Wimax(全球微波互联接入)、HSDPA(高速下行链路分组接入)等等。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. .
短程通信模块114是用于支持短程通信的模块。短程通信技术的一些示例包括蓝牙TM、射频识别(RFID)、红外数据协会(IrDA)、超宽带(UWB)、紫蜂TM等等。The short range communication module 114 is a module for supporting 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.
位置信息模块115是用于检查或获取移动终端的位置信息的模块。位置信息模块的典型示例是全球定位系统(GPS)模块。根据当前的技术, GPS模块计算来自三个或更多卫星的距离信息和准确的时间信息并且对于计算的信息应用三角测量法,从而根据经度、纬度和高度准确地计算三维当前位置信息。当前,用于计算位置和时间信息的方法使用三颗卫星并且通过使用另外的一颗卫星校正计算出的位置和时间信息的误差。此外,GPS模块能够通过实时地连续计算当前位置信息来计算速度信息。The location information module 115 is a module for checking or acquiring location information of the mobile terminal. A typical example of a location information module is a Global Positioning System (GPS) module. According to current technology, The GPS module 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. Currently, the method for calculating position and time information uses three satellites and corrects the calculated position and time information errors by using another satellite. Further, the GPS module can calculate the speed information by continuously calculating the current position information in real time.
A/V输入单元120用于接收音频或视频信号。A/V输入单元120可以包括相机121,相机121对在视频捕获模式或图像捕获模式中由图像捕获装置获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元151上。经相机121处理后的图像帧可以存储在存储器160(或其它存储介质)中或者经由无线通信单元110进行发送,可以根据移动终端的构造提供两个或更多相机121。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 that processes image data of still pictures or video obtained by an 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) or transmitted via the wireless communication unit 110, and two or more cameras 121 may be provided according to the configuration of the mobile terminal.
用户输入单元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, a touch sensitive component that detects changes in resistance, pressure, capacitance, etc. due to contact), a scroll wheel , rocker, etc. 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检测移动终端1的当前状态,(例如,移动终端1的打开或关闭状态)、移动终端1的位置、用户对于移动终端1的接触(即,触摸输入)的有无、移动终端1的取向、移动终端1的加速或减速移动和方向等等,并且生成用于控制移动终端1的操作的命令或信号。例如,当移动终端1实施为滑动型移动电话时,感测单元140可以感测该滑动型电话是打开还是关闭。另外,感测单元140能够检测电源单元190是否提供电力或者接口单元170是否与外部装置耦接。感测单元140可以包括接近传感器141将在下面结合触摸屏来对此进行描述。The sensing unit 140 detects the current state of the mobile terminal 1 (eg, the open or closed state of the mobile terminal 1), the location of the mobile terminal 1, the presence or absence of contact (ie, touch input) by the user with the mobile terminal 1, and the mobile terminal. The orientation of 1, the acceleration or deceleration movement and direction of the mobile terminal 1, and the like, and generates a command or signal for controlling the operation of the mobile terminal 1. For example, when the mobile terminal 1 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. Sensing unit 140 may include proximity sensor 141 which will be described below in connection with a touch screen.
接口单元170用作至少一个外部装置与移动终端1连接可以通过的接 口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。识别模块可以是存储用于验证用户使用移动终端1的各种信息并且可以包括用户识别模块(UIM)、客户识别模块(SIM)、通用客户识别模块(USIM)等等。另外,具有识别模块的装置(下面称为“识别装置”)可以采取智能卡的形式,因此,识别装置可以经由端口或其它连接装置与移动终端1连接。接口单元170可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到移动终端1内的一个或多个元件或者可以用于在移动终端和外部装置之间传输数据。The interface unit 170 serves as a connection through which at least one external device is connected to the mobile terminal 1 mouth. 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 1 and may include a User Identification Module (UIM), a Customer Identification Module (SIM), a Universal Customer Identification 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 1 via a port or other connection device. The interface unit 170 can be configured to receive input (eg, data information, power, etc.) from an external device and transmit the received input to one or more components within the mobile terminal 1 or can be used in the mobile terminal and external device Transfer data between.
另外,当移动终端1与外部底座连接时,接口单元170可以用作允许通过其将电力从底座提供到移动终端1的路径或者可以用作允许从底座输入的各种命令信号通过其传输到移动终端的路径。从底座输入的各种命令信号或电力可以用作用于识别移动终端是否准确地安装在底座上的信号。输出单元150被构造为以视觉、音频和/或触觉方式提供输出信号(例如,音频信号、视频信号、警报信号、振动信号等等)。输出单元150可以包括显示单元151等等。In addition, when the mobile terminal 1 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 1 or may be used as a variety of command signals allowed to be input from the base to be transmitted to the mobile 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 and the like.
显示单元151可以显示在移动终端1中处理的信息。例如,当移动终端1处于电话通话模式时,显示单元151可以显示与通话或其它通信(例如,文本消息收发、多媒体文件下载等等)相关的用户界面(UI)或图形用户界面(GUI)。当移动终端1处于视频通话模式或者图像捕获模式时,显示单元151可以显示捕获的图像和/或接收的图像、示出视频或图像以及相关功能的UI或GUI等等。The display unit 151 can display information processed in the mobile terminal 1. For example, when the mobile terminal 1 is in the 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 1 is in the video call mode or the 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(透明有机发光二极管)显示器等等。根据特定想要的实施方式,移动终端1可以包括两个或更多显示单元(或其它显示装置),例如,移动终端可以包括外部显示单元(未示出)和内部显示单元(未示出)。触摸屏可用于检测触摸输入压力以及触摸输入位置和触摸输入面积。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 liquid crystal At least one of a 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 1 may comprise two or more display units (or other display devices), for example, the mobile terminal may comprise 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)、磁性存储器、磁盘、光盘等等。而且,移动终端1可以与通过网络连接执行存储器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 1 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 the various components and components.
这里描述的各种实施方式可以以使用例如计算机软件、硬件或其任何组合的计算机可读介质来实施。对于硬件实施,这里描述的实施方式可以通过使用特定用途集成电路(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 invention can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
如图1中所示的移动终端1可以被构造为利用经由帧或分组发送数据的诸如有线和无线通信系统以及基于卫星的通信系统来操作。The mobile terminal 1 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.
现在将参考图2描述其中根据本发明的移动终端能够操作的通信系统。A communication system in which a mobile terminal according to the present invention can be operated will now be described with reference to FIG.
这样的通信系统可以使用不同的空中接口和/或物理层。例如,由通信系统使用的空中接口包括例如频分多址(FDMA)、时分多址(TDMA)、码分多址(CDMA)和通用移动通信系统(UMTS)(特别地,长期演进(LTE))、全球移动通信系统(GSM)等等。作为非限制性示例,下面的描述涉及CDMA通信系统,但是这样的教导同样适用于其它类型的系统。Such communication systems may use different air interfaces and/or physical layers. For example, 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. As a non-limiting example, the following description relates to a CDMA communication system, but such teachings are equally applicable to other types of systems.
参考图2,CDMA无线通信系统可以包括多个移动终端1、多个基站(BS)270、基站控制器(BSC)275和移动交换中心(MSC)280。MSC 280 被构造为与公共电话交换网络(PSTN)290形成接口。MSC 280还被构造为与可以经由回程线路耦接到BS 270的BSC 275形成接口。回程线路可以根据若干己知的接口中的任一种来构造,所述接口包括例如E1/T1、ATM,IP、PPP、帧中继、HDSL、ADSL或xDSL。将理解的是,如图2中所示的系统可以包括多个BSC 2750。Referring to FIG. 2, a CDMA wireless communication system may include a plurality of mobile terminals 1, a plurality of base stations (BS) 270, a base station controller (BSC) 275, and a mobile switching center (MSC) 280. MSC 280 It is configured to interface with a public switched telephone network (PSTN) 290. The MSC 280 is also configured to interface with a BSC 275 that can be coupled to the BS 270 via a backhaul line. The backhaul line can be constructed in accordance with any of a number of well 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 may include multiple BSCs 2750.
每个BS 270可以服务一个或多个分区(或区域),由多向天线或指向特定方向的天线覆盖的每个分区放射状地远离BS 270。或者,每个分区可以由用于分集接收的两个或更多天线覆盖。每个BS 270可以被构造为支持多个频率分配,并且每个频率分配具有特定频谱(例如,1.25MHz,5MHz等等)。Each BS 270 can serve one or more partitions (or regions), with each partition covered by a multi-directional antenna or an antenna pointing in 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.).
分区与频率分配的交叉可以被称为CDMA信道。BS 270也可以被称为基站收发器子系统(BTS)或者其它等效术语。在这样的情况下,术语“基站”可以用于笼统地表示单个BSC 275和至少一个BS 270。基站也可以被称为“蜂窝站”。或者,特定BS 270的各分区可以被称为多个蜂窝站。The intersection of partitioning and frequency allocation can be referred to as a CDMA channel. BS 270 may also be referred to as a Base Transceiver Subsystem (BTS) or other equivalent terminology. In such a case, the term "base station" can be used to generally mean a single BSC 275 and at least one BS 270. A base station can also be referred to as a "cell station." Alternatively, each partition of a particular BS 270 may be referred to as multiple cellular stations.
如图2中所示,广播发射器(BT)295将广播信号发送给在系统内操作的移动终端1。在图2中,示出了几个全球定位系统(GPS)卫星300,卫星300帮助定位多个移动终端1中的至少一个。As shown in FIG. 2, a broadcast transmitter (BT) 295 transmits a broadcast signal to the mobile terminal 1 operating within the system. In FIG. 2, several Global Positioning System (GPS) satellites 300 are shown that help locate at least one of a plurality of mobile terminals 1.
在图2中,描绘了多个卫星300,但是理解的是,可以利用任何数目的卫星获得有用的定位信息。作为图1中所示的位置信息模块115的GPS模块通常被构造为与卫星300配合以获得想要的定位信息。替代GPS跟踪技术或者在GPS跟踪技术之外,可以使用可以跟踪移动终端的位置的其它技术。另外,至少一个GPS卫星300可以选择性地或者额外地处理卫星DMB传输。In Figure 2, 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, which is the location information module 115 shown in Figure 1, is typically configured to cooperate with the satellite 300 to obtain the 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.
作为无线通信系统的一个典型操作,BS 270接收来自各种移动终端1的反向链路信号。移动终端1通常参与通话、消息收发和其它类型的通信。 特定BS 270接收的每个反向链路信号被在特定BS 270内进行处理。获得的数据被转发给相关的BSC 275。BSC提供通话资源分配和包括BS 270之间的软切换过程的协调的移动管理功能。BSC 275还将接收到的数据路由到MSC 280,其提供用于与PSTN 290形成接口的额外的路由服务。类似地,PSTN 290与MSC 280形成接口,MSC与BSC 275形成接口,并且BSC 275相应地控制BS 270以将正向链路信号发送到移动终端1。As a typical operation of a wireless communication system, the BS 270 receives reverse link signals from various mobile terminals 1. The mobile terminal 1 typically participates in calls, messaging, and other types of communications. Each reverse link signal received by a particular BS 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. Similarly, 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 1.
基于上述移动终端硬件结构以及通信系统,提出本发明方法各个实施例。Based on the above-described mobile terminal hardware structure and communication system, various embodiments of the method of the present invention are proposed.
实施例一 Embodiment 1
本发明实施例提供的一种图像处理方法,如图3所示,该方法可以包括:An image processing method provided by an embodiment of the present invention is as shown in FIG. 3, and the method may include:
S101、获取待处理图像的原始RAW数据。S101. Acquire original RAW data of an image to be processed.
需要说明的是,在使用终端进行图像拍摄的过程中,终端对待处理图像的原始RAW数据的获取是通过设置在终端中的图像传感器实现的。It should be noted that, in the process of image capturing using the terminal, the acquisition of the raw RAW data of the image to be processed by the terminal is realized by an image sensor provided in the terminal.
其中,图像传感器可以包括:电荷耦合元件(CCD,Charge-coupled Device)图像传感器、互补金属氧化物半导体(CMOS,Complementary Metal Oxide Semiconductor)图像传感器的Color Filter Array(CFA彩色滤镜阵列)元件。可选地,上述图像传感器由横竖两个方向密集排列的感光元件组成的一个二维矩阵,构成一种Bayer模式的RGB像素点排列,常见的有图4所示的(a)、(b)、(c)、(d)4种Bayer模式的排列方式,每个CCD就对应一个像素。其中,R感应红光、G感应绿光、B感应蓝光,而在Bayer模式中G是R和B的两倍(因为人类的眼睛对绿色更敏感)。The image sensor may include a charge coupled device (CCD) image sensor and a Color Filter Array (CMOS) filter element of a complementary metal oxide semiconductor (CMOS) image sensor. Optionally, the image sensor is a two-dimensional matrix composed of photosensitive elements densely arranged in two directions, forming a Bayer mode RGB pixel dot arrangement, and the common ones are (a) and (b) shown in FIG. , (c), (d) Four Bayer patterns are arranged in such a way that each CCD corresponds to one pixel. Among them, R induces red light, G senses green light, B induces blue light, and in Bayer mode, G is twice as large as R and B (because human eyes are more sensitive to green).
需要说明的是,在上述二维矩阵内的每个CCD或CMOS只是用来感受光子的能量,每个CCD或CMOS中由于进入光线的强度而产生对应比例的电荷,每个CCD或CMOS将这些电荷信息汇集并经过放大并储存起来,例 如,如图5所示的CMOS光子感应示意图所示CMOS感应光子最后存储对应比例的电荷(图5中所示的方块),而RAW纪录的就是每个像素位置的电荷值,它是没有记录任何的颜色信息的,也就是说:待处理图像的原始RAW数据只是灰度文件而已。It should be noted that each CCD or CMOS in the above two-dimensional matrix is only used to sense the energy of photons, and each CCD or CMOS generates a corresponding proportion of charges due to the intensity of incoming light, and each CCD or CMOS will Charge information is collected and amplified and stored, for example For example, the CMOS sensor photon shown in the CMOS photon sensing diagram shown in FIG. 5 finally stores the corresponding proportion of charge (the block shown in FIG. 5), and the RAW record is the charge value of each pixel position, which is not recorded. Any color information, that is: the original RAW data of the image to be processed is just a grayscale file.
示例性的,原始RAW数据以图像形式呈现时则为一个灰度图像模式没有颜色的,如图6所示的原始RAW数据形成的图像中可以看到原始的RAW数据形成的图像是黑白色,并且还有马赛克现象出现。Exemplarily, when the original RAW data is presented in the form of an image, there is no color for one grayscale image mode. In the image formed by the original RAW data as shown in FIG. 6, the image formed by the original RAW data can be seen as black and white. And there is also a mosaic phenomenon.
需要说明的是,本发明实施例中的终端对待处理图像的操作可以理解为终端中的一个图像处理应用对待处理图像的处理。It should be noted that the operation of the terminal to process an image in the embodiment of the present invention may be understood as an image processing application in the terminal to process the image to be processed.
S102、根据预设策略,计算原始RAW数据中的关键拍摄参数。S102. Calculate key shooting parameters in the original RAW data according to a preset strategy.
终端获取待处理图像的原始RAW数据之后,由于原始RAW数据中保存有待处理图像的场景信息,该终端根据这些场景信息和预设策略,计算原始RAW数据的关键拍摄参数。After the terminal acquires the original RAW data of the image to be processed, the terminal stores the scene information of the image to be processed in the original RAW data, and the terminal calculates the key shooting parameters of the original RAW data according to the scene information and the preset strategy.
可选地,终端根据预设策略,计算原始RAW数据的白平衡的增益参数、颜色变换矩阵参数中的至少一个。Optionally, the terminal calculates at least one of a white balance gain parameter and a color transformation matrix parameter of the original RAW data according to the preset policy.
其中,白平衡是图像处理的一个极重要概念。所谓白平衡(英文名称为White Balance),就是对白色物体的还原。当用户用肉眼观看这大千世界时,在不同的光线下,对相同的颜色的感觉基本是相同的,比如在早晨旭日初升时,看一个白色的物体,感到它是白的;而用户在夜晚昏暗的灯光下,看到的白色物体,感到它仍然是白的。这是由于人类从出生以后的成长过程中,人的大脑已经对不同光线下的物体的彩色还原有了适应性。但是,作为拍摄终端或具有拍摄功能的终端,如数码相机,可没有人眼的适应性。在不同的光线下,数码相机会由于CCD输出的不平衡性,造成数码相机彩色还原失真。一般情况下,用户习惯性地认为太阳光是白色的,已知直射日光的色温是5200K左右,白炽灯的色温是3000K左右。用传统相 机的日光片拍摄时,白炽灯光由于色温太低,所以偏黄偏红。所以通常现场光线的色温低于相机设定的色温时,往往偏黄偏红,现场光线的色温高于相机设定时,就会偏蓝。Among them, white balance is a very important concept of image processing. The so-called white balance (English name is White Balance) is the restoration of white objects. When the user views the world in the naked eye, the feeling of the same color is basically the same under different light. For example, when the morning sun rises, look at a white object and feel it is white; Under the dim light of the night, the white object was seen and it was still white. This is because human beings have adapted to the color reduction of objects in different light rays during their growth from birth. However, as a photographing terminal or a terminal having a photographing function, such as a digital camera, there is no human eye adaptability. In different light, the digital camera will cause color reduction distortion of the digital camera due to the imbalance of the CCD output. Under normal circumstances, the user habitually thinks that the sunlight is white, the color temperature of the direct sunlight is about 5200K, and the color temperature of the incandescent lamp is about 3000K. Traditional phase When the machine's daylight film is taken, the incandescent light is yellowish and reddish because the color temperature is too low. Therefore, when the color temperature of the spot light is lower than the color temperature set by the camera, it tends to be yellowish and reddish. When the color temperature of the spot light is higher than the camera setting, it will be bluish.
为了解决不同色温下,引起的白色漂移现象。由于白色对色温变化的响应最大,通常用白色来作为调整的基色。通常的白平衡调节可以包括:自动白平衡、钨光白平衡、荧光白平衡、室内白平衡、手动调节。In order to solve the white drift phenomenon caused by different color temperatures. Since white responds most to changes in color temperature, white is often used as the primary color of the adjustment. Typical white balance adjustments may include: automatic white balance, tungsten white balance, fluorescent white balance, indoor white balance, manual adjustment.
需要说明的是,预设策略可以为计算白平衡的增益参数或颜色变换矩阵的算法,可选地实现形式本发明实施例不作限制。It should be noted that the preset policy may be an algorithm for calculating a gain parameter or a color transformation matrix of the white balance, and the implementation manner of the embodiment of the present invention is not limited.
可选地,原始RAW数据中的关键拍摄参数还可以包括:待处理图像的宽度、高度、像素位数、黑电平和所述RAW数据对应的图像拍摄相机的旋转参数等,其中,所述旋转参数可包括:旋转方向及旋转角度等,可用于后续第三方应用根据所述旋转参数对图像进行旋转校正。但是,白平衡参数和颜色变换矩阵参数比较重要(白平衡的增益参数用来调整白平衡参数的),因为上述这两个参数会影响原始RAW数据的正常颜色解析。对于上述参数的计算,本发明实施例中对于每个固定的传感器(sensor)颜色变换矩阵以及黑电平都是固定的,白平衡参数依据场景自动算出。Optionally, the key shooting parameters in the original RAW data may further include: a width, a height, a pixel number, a black level of the image to be processed, a rotation parameter of the image capturing camera corresponding to the RAW data, and the like, wherein the rotation The parameters may include: a rotation direction and a rotation angle, etc., and may be used for subsequent third-party applications to perform rotation correction on the image according to the rotation parameter. However, the white balance parameter and the color transformation matrix parameters are important (the white balance gain parameter is used to adjust the white balance parameter) because these two parameters affect the normal color resolution of the original RAW data. For the calculation of the above parameters, in the embodiment of the present invention, the color conversion matrix and the black level of each fixed sensor are fixed, and the white balance parameter is automatically calculated according to the scene.
需要说明的是,终端完成图像的自动白平衡调整或颜色变换调整等后,RAW数据所需要的白平衡参数为Rgain、Ggain、Bgain或颜色变换矩阵参数等关键拍摄参数会写入到原始RAW数据中,形成RAW文件。It should be noted that after the terminal completes the automatic white balance adjustment or color conversion adjustment of the image, the key shooting parameters such as Rgain, Ggain, Bgain or color conversion matrix parameters required for the RAW data are written to the original RAW data. In, form a RAW file.
S103、将关键拍摄参数和原始RAW数据按照预设编码规范写入RAW文件中。S103. Write key shooting parameters and original RAW data into the RAW file according to a preset encoding specification.
需要说明的是,由于终端中的不同的图像处理应用对RAW格式的文件的解析方式或编码方式的不同,由一个图像处理应用编码的RAW文件有可能不能被另一个图像处理应用解析,因此,本发明实施例的终端将RAW文件所需的关键拍摄参数和原始RAW数据按照可统一解析的编码格式进行 封装,即该终端将关键拍摄参数和原始RAW数据按照预设编码规范写入RAW文件中。It should be noted that, because different image processing applications in the terminal have different parsing methods or encoding methods for files in the RAW format, the RAW file encoded by one image processing application may not be parsed by another image processing application. The terminal of the embodiment of the present invention performs the key shooting parameters and the original RAW data required for the RAW file according to the uniformly parsable encoding format. Encapsulation, that is, the terminal writes key shooting parameters and raw RAW data into a RAW file according to a preset encoding specification.
可选地,终端将关键拍摄参数和原始RAW数据按照数字新闻采集(DNG,Digital Negative)编码规范写入RAW文件中。Optionally, the terminal writes the key shooting parameters and the original RAW data into the RAW file according to the Digital Negative (DNG) encoding specification.
需要说明的是,DNG主要是在TIFF格式的基础上进行扩展,编码基本格式基本上都定义在TIFF或者TIFF/EP中。其中,TIFF文件格式中的三个关键词是:图像文件头Image File Header(IFH);图像文件目录Image File Directory(IFD)和目录项Directory Entry(DE)。如图7所示为TIFF的数据结构示意图。下面以TIFF的数据结构为基础进行说明。It should be noted that DNG is mainly extended on the basis of the TIFF format, and the basic format of the encoding is basically defined in TIFF or TIFF/EP. Among them, the three keywords in the TIFF file format are: Image File Header (IFH); Image File Directory (IFD) and Directory Entry (DE). Figure 7 shows the data structure of TIFF. The following is based on the data structure of TIFF.
需要说明的是,每一幅图像是以8字节的IFH开始的,这个IFH指向了第一个IFD,IFD包含了图像的各种信息,同时也包含了一个指向实际图像数据的指针。It should be noted that each image starts with an 8-byte IFH, which points to the first IFD. The IFD contains various information about the image and also contains a pointer to the actual image data.
其中,(1)、IFH的构成Among them, (1), the composition of IFH
Byte 0-1:字节顺序标志位,值为II或者MM。II表示小字节在前,又称为little-endian。MM表示大字节在前,又成为big-endian。Byte 0-1: Byte order flag, value is II or MM. II indicates that the small byte is first, also known as little-endian. MM means that the big byte is in front and becomes big-endian again.
Byte 2-3:TIFF的标志位,一般都是42,表示该图像为tiff格式。Byte 2-3: The flag of TIFF is generally 42, indicating that the image is in tiff format.
Byte 4-7:第一个IFD的偏移量。可以在任意位置,但必须是在一个字的边界,也就是说必须是2的整数倍。Byte 4-7: The offset of the first IFD. Can be anywhere, but must be at the boundary of a word, that is, it must be an integer multiple of 2.
(2)、IFD的构成(0代表此IFD的起始位置)(2), the composition of the IFD (0 represents the starting position of this IFD)
IFD是TIF图中最重要的数据结构,它包含了一个TIF文件中最重要的信息,一个TIF图可能有多个IFD,这说明文件中有多个图像,每个IFD标识1个图像的基本属性。IFD结构中包含了三类成员,Directory Entry Count指出该结构里面有多少个目录入口;接下来就是N个线性排列的DE序列,数量不定;最后就是一个偏移量,标识下一个文件目录相对于文件开始处的位置,当然,如果该TIF文件只包含了一幅图像,那么就只有一 个IFD,显然,这个偏移量就等于0;IFD is the most important data structure in the TIF diagram. It contains the most important information in a TIF file. A TIF map may have multiple IFDs. This means that there are multiple images in the file, and each IFD identifies the basics of one image. Attributes. The IFD structure contains three types of members. The Directory Entry Count indicates how many directory entries are in the structure. The next is the sequence of N linearly arranged DE sequences. The final is an offset that identifies the next file directory relative to The location at the beginning of the file, of course, if the TIF file contains only one image, then there is only one IFD, obviously, this offset is equal to 0;
Byte 0-1:表示此IFD包含了多少个DE,假设数目为nByte 0-1: Indicates how many DEs are included in this IFD, assuming the number is n
Byte 2-(n*12+1):n个DEByte 2-(n*12+1): n DE
Byte(n*12+2)-(n*12+5):下一个IFD的偏移量,如果没有则置为0。Byte(n*12+2)-(n*12+5): The offset of the next IFD, if not set to 0.
(3)、DE的构成(3), the composition of DE
一个DE就是一幅图像的某一个属性。例如图像的大小、分辨率、是否压缩、像素的行列数、一个像素由几位表示(1位代表黑白两色,8位代表256色等等)等。上述的白平衡参数就该属性中一个值,其中:tag成员是该属性的编号,在图像文件目录中,它是按照升序排列的。我们可以通过读这些编号,然后到TIF格式官方白皮书中查找相应的含义。属性是用数据来表示的,那么type就是代表着该数据的类型。每个DE共12个字节:A DE is an attribute of an image. For example, the size, resolution, compression of the image, the number of rows and columns of pixels, one pixel is represented by several bits (1 bit represents black and white, 8 bits represent 256 colors, etc.). The above white balance parameter is a value in the attribute, where: the tag member is the number of the attribute, and in the image file directory, it is arranged in ascending order. We can read these numbers and then look up the appropriate meaning in the official white paper on TIF format. Attributes are represented by data, and type is the type that represents the data. A total of 12 bytes per DE:
Byte 0-1:此TAG的唯一标识Byte 0-1: Unique identifier of this TAG
Byte 2-3:type数据类型。Byte 2-3: type data type.
Byte 4-7:lenghts数量。通过类型和数量可以确定存储此TAG的数据需要占据的字节数。Byte 4-7: The number of lenghts. The type and number can be used to determine the number of bytes that the data storing this TAG needs to occupy.
Byte 8-11:valueOffset是tag标识的属性代表的变量值相对文件开始处的偏移量。如果占用的字节数少于4,那么该值就存放在valueOffset中即可,没必要再另外指向一个地方了。如果超过4个,则这里存放的是指向实际数据的指针。Byte 8-11: valueOffset is the offset of the variable value represented by the attribute identified by the tag relative to the beginning of the file. If the number of bytes occupied is less than 4, then the value is stored in the valueOffset, there is no need to point to another place. If there are more than 4, then the pointer to the actual data is stored here.
因此,示例性的,根据上述TIFF文件格式的方式,终端将原始RAW数据和关键拍摄参数按照预设DNG编码规范写入RAW文件,假设RAW数据为1个待处理图像的图像数据,关键拍摄参数为8个,则终端写好的RAW文件的数据流如图8所示。其中,由于RAW数据为1个待处理图像的图像数据,因此,图8中只有一个IFD,而关键拍摄参数为8个,因此,图8中有8个DE。 Therefore, exemplarily, according to the above TIFF file format, the terminal writes the original RAW data and the key shooting parameters into the RAW file according to the preset DNG encoding specification, and assumes that the RAW data is image data of one image to be processed, and key shooting parameters. As for 8, the data stream of the RAW file written by the terminal is as shown in FIG. Among them, since the RAW data is the image data of one image to be processed, there is only one IFD in FIG. 8, and the key shooting parameters are eight, and therefore, there are eight DEs in FIG.
需要说明的是,DE的个数设置可以为N个,即DE0、DE1、DE2…DEN,本发明实施例可以根据实际需要设置DE的个数。另外,图8中的8个DE,即DE0、DE1、DE2…DE7仅是举例说明,本发明实施例对DE的个数设置不做具体限定。It should be noted that the number of DEs can be set to N, that is, DE0, DE1, DE2, ... DEN. In the embodiment of the present invention, the number of DEs can be set according to actual needs. In addition, the eight DEs in FIG. 8 , that is, DE0, DE1, DE2, . . . , DE7 are only exemplified, and the number of DEs in the embodiment of the present invention is not specifically limited.
S104、利用第三方应用打开RAW文件,生成RAW的图像文件。S104. Open a RAW file by using a third-party application to generate an RAW image file.
S105、对RAW的图像文件进行图像后期处理。S105. Perform image post-processing on the image file of the RAW.
终端将关键拍摄参数和原始RAW数据按照预设编码规范写入RAW文件中之后,当用户想使用该终端上的第三方应用处理待处理图像时,该终端就可以利用第三方应用打开RAW文件,生成RAW的图像文件,从而对该RAW图像文件进行继续处理。After the terminal writes the key shooting parameters and the original RAW data into the RAW file according to the preset encoding specification, when the user wants to use the third-party application on the terminal to process the image to be processed, the terminal can open the RAW file by using the third-party application. A RAW image file is generated to continue processing the RAW image file.
可选地,终端利用第三方应用对所述RAW文件中的关键拍摄参数进行解析;在第三方应用中,根据解析后的关键拍摄参数调整原始RAW数据,生成RAW的图像文件。这里的第三方应用可为任意一个图像处理应用,在本实施例中所述第三方应用可为独立于拍摄形成所述RAW数据的相机所运行的图像应用以外的应用。Optionally, the terminal parses the key shooting parameters in the RAW file by using a third-party application; in the third-party application, the original RAW data is adjusted according to the parsed key shooting parameters to generate a RAW image file. The third-party application herein may be any one of image processing applications, and in the present embodiment, the third-party application may be an application other than an image application running by a camera that forms the RAW data.
需要说明的是,本发明实施例中的第三方应用为终端中的第三方的图像处理应用。It should be noted that the third-party application in the embodiment of the present invention is a third-party image processing application in the terminal.
需要说明的是,由于RAW文件中包括了原始RAW数据(即待处理图像的图像数据)和关键拍摄参数(包括表征颜色的参数),因此,终端利用第三方打开RAW文件,生成RAW的图像文件是比原始RAW图像色彩鲜明、高质量的图像。It should be noted that since the RAW file includes the original RAW data (ie, the image data of the image to be processed) and the key shooting parameters (including the parameters for characterizing the color), the terminal uses a third party to open the RAW file to generate a RAW image file. It is a bright, high-quality image that is larger than the original RAW image.
可以理解的是,在一个终端中的不同应用中,一个图像处理应用拍摄的图像的原始RAW数据可以被不同编码方式的另一个图像处理应用使用,实现了RAW数据在同一个终端中的不用图像处理应用中的共享,提高了图像处理的效率和适用性。 It can be understood that in different applications in one terminal, the original RAW data of the image captured by one image processing application can be used by another image processing application of different encoding modes, and the unused image of the RAW data in the same terminal is realized. Handling sharing in the application improves the efficiency and applicability of image processing.
可选地,终端对RAW的图像文件进行图像后期处理可以为:终端或终端中的第三方对RAW的图像文件进行图像的色彩、对比度和亮度中的至少一种处理。Optionally, the image post-processing of the RAW image file by the terminal may be: the third party in the terminal or the terminal performs at least one of color, contrast, and brightness of the image file of the RAW.
示例性的,终端通过第三方应用,如PS(Photoshop)应用,对RAW文件打开后的待处理图像的效果如图9所示。Exemplarily, the effect of the image to be processed after the RAW file is opened by the terminal through a third-party application, such as a PS (Photoshop) application, is as shown in FIG. 9.
本发明实施例所提供的一种图像处理方法,通过获取待处理图像的原始RAW数据;根据预设策略,计算原始RAW数据中的关键拍摄参数;将关键拍摄参数和原始RAW数据按照预设编码规范写入RAW文件中;利用第三方应用打开RAW文件,生成RAW的图像文件;对RAW的图像文件进行图像后期处理。采用上述技术实现方案,由于对原始RAW数据进行统一编码使得第三方应用可以解析RAW文件,从而可以对RAW文件进行显像处理得到RAW图像文件,由于在第三方应用中直接生成并采用RAW图像文件作为图像进行后期处理的对象,且RAW文件数据的劣化较小,因此,在该第三方应用对图像进行后期处理时可以无需担心画质降低而更自由的调节图像的色彩和亮度,已达到最好的图像处理效果,从而提高图像处理的画面呈现效果。An image processing method provided by an embodiment of the present invention obtains original RAW data of an image to be processed; calculates key shooting parameters in the original RAW data according to a preset strategy; and records the key shooting parameters and the original RAW data according to a preset encoding The specification is written into the RAW file; the third-party application is used to open the RAW file to generate the RAW image file; and the image processing of the RAW image file is post-processed. With the above technical implementation scheme, since the original RAW data is uniformly encoded, the third-party application can parse the RAW file, so that the RAW file can be developed to obtain the RAW image file, since the RAW image file is directly generated and adopted in the third-party application. The image is post-processed as an object, and the degradation of the RAW file data is small. Therefore, when the third-party application performs post-processing on the image, the color and brightness of the image can be more freely adjusted without worrying about the degradation of the image quality. Good image processing effect, thus improving the image rendering effect of image processing.
实施例二 Embodiment 2
如图10所示,本发明实施例提供了一种终端1,该终端1可以包括:As shown in FIG. 10, an embodiment of the present invention provides a terminal 1, which may include:
获取单元10,配置为获取待处理图像的原始RAW数据。The obtaining unit 10 is configured to acquire raw RAW data of the image to be processed.
计算单元11,配置为根据预设策略,计算所述获取单元10获取的所述原始RAW数据中的关键拍摄参数。The calculating unit 11 is configured to calculate key shooting parameters in the original RAW data acquired by the acquiring unit 10 according to a preset policy.
写入单元12,配置为将所述计算单元11计算的所述关键拍摄参数和所述获取单元10获取的所述原始RAW数据按照预设编码规范写入RAW文件中。The writing unit 12 is configured to write the key shooting parameters calculated by the calculating unit 11 and the original RAW data acquired by the obtaining unit 10 into a RAW file according to a preset encoding specification.
生成单元13,配置为利用第三方应用打开所述写入单元12写好的所述 RAW文件,生成RAW的图像文件。a generating unit 13 configured to open the writing unit 12 by using a third-party application RAW file, which generates RAW image files.
处理单元14,配置为对所述生成单元13生成的所述RAW的图像文件进行图像后期处理。The processing unit 14 is configured to perform image post-processing on the image file of the RAW generated by the generating unit 13.
可选的,所述计算单元11,配置为根据预设策略,计算所述获取单元10获取的所述原始RAW数据的白平衡的增益参数、颜色变换矩阵参数中的至少一个。Optionally, the calculating unit 11 is configured to calculate at least one of a gain parameter and a color transformation matrix parameter of the white balance of the original RAW data acquired by the acquiring unit 10 according to a preset policy.
在一些实施例中,所述计算单元11,还配置为根据预设策略,计算所述原始RAW数据对应的图像的宽度、高度、像素位数、黑平衡参数及拍摄形成所述RAW数据的相机的旋转参数中的一个或多个。In some embodiments, the calculating unit 11 is further configured to calculate, according to a preset policy, a width, a height, a pixel number of bits, a black balance parameter, and a camera that forms the RAW data corresponding to the original RAW data. One or more of the rotation parameters.
可选的,如图11所示,所述终端1还包括:解析单元15。Optionally, as shown in FIG. 11 , the terminal 1 further includes: a parsing unit 15 .
所述解析单元15,配置为利用所述第三方应用对所述计算单元11计算出的所述RAW文件中的关键拍摄参数进行解析。The parsing unit 15 is configured to parse key shooting parameters in the RAW file calculated by the calculating unit 11 by using the third-party application.
所述生成单元13,配置为在所述第三方应用中,根据所述解析单元15从所述写入单元12解析出的所述关键拍摄参数调整所述写入单元12写入的所述原始RAW数据,生成所述RAW的图像文件。The generating unit 13 is configured to adjust, in the third-party application, the original written by the writing unit 12 according to the key shooting parameters parsed by the parsing unit 15 from the writing unit 12 RAW data, generating an image file of the RAW.
可选的,所述写入单元12,配置为将所述计算单元11计算的所述关键拍摄参数和所述获取单元10获取的所述原始RAW数据按照DNG编码规范写入RAW文件中。Optionally, the writing unit 12 is configured to write the key shooting parameters calculated by the calculating unit 11 and the original RAW data acquired by the acquiring unit 10 into a RAW file according to a DNG encoding specification.
可选的,所述处理单元14,配置为对所述生成单元13生成的所述RAW的图像文件进行图像的色彩、对比度和亮度中的至少一种处理。Optionally, the processing unit 14 is configured to perform at least one of color, contrast, and brightness of the image on the image file of the RAW generated by the generating unit 13 .
可选的,本发明实施例中的终端可以为具有拍摄功能和图像处理功能的手机、平板和相机等电子设备,本发明实施例不作限制。Optionally, the terminal in the embodiment of the present invention may be an electronic device such as a mobile phone, a tablet, or a camera, which has a shooting function and an image processing function, and is not limited in the embodiment of the present invention.
如图12所示,在实际应用中,上述获取单元10、计算单元11、写入单元12、生成单元13、处理单元14和解析单元15可由位于终端1上的处理器16实现,具体为中央处理器(CPU)、微处理器(MPU)、数字信号处 理器(DSP)或现场可编程门阵列(FPGA)等实现,该终端1还可以包括存储介质17,该存储介质17可以通过系统总线18与处理器16连接,其中,存储介质17用于存储可执行程序代码,该程序代码包括计算机操作指令,存储介质17可能包含高速RAM存储器,也可能还包括非易失性存储器,例如,至少一个磁盘存储器。As shown in FIG. 12, in an actual application, the above-mentioned obtaining unit 10, computing unit 11, writing unit 12, generating unit 13, processing unit 14, and parsing unit 15 may be implemented by a processor 16 located on the terminal 1, specifically for the center. Processor (CPU), microprocessor (MPU), digital signal Implemented by a processor (DSP) or a field programmable gate array (FPGA), etc., the terminal 1 may further include a storage medium 17, which may be connected to the processor 16 via a system bus 18, wherein the storage medium 17 is used for storage Program code may be executable, the program code including computer operating instructions, storage medium 17 may include high speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
本发明实施例所提供的一种终端,该终端通过获取待处理图像的原始RAW数据;根据预设策略,计算原始RAW数据中的关键拍摄参数;将关键拍摄参数和原始RAW数据按照预设编码规范写入RAW文件中;利用第三方应用打开RAW文件,生成RAW的图像文件;对RAW的图像文件进行图像后期处理。采用上述技术实现方案,由于对原始RAW数据进行统一编码使得第三方应用可以解析RAW文件,从而可以对RAW文件进行显像处理得到RAW图像文件,由于在终端的第三方应用中直接生成并采用RAW图像文件作为图像进行后期处理的对象,且RAW文件数据的劣化较小,因此,在该第三方应用对图像进行后期处理时可以无需担心画质降低而更自由的调节图像的色彩和亮度,已达到最好的图像处理效果,从而提高图像处理的画面呈现效果。A terminal provided by the embodiment of the present invention, the terminal acquires original RAW data of an image to be processed; calculates key shooting parameters in the original RAW data according to a preset strategy; and records the key shooting parameters and the original RAW data according to a preset encoding The specification is written into the RAW file; the third-party application is used to open the RAW file to generate the RAW image file; and the image processing of the RAW image file is post-processed. With the above technical implementation scheme, since the original RAW data is uniformly encoded, the third-party application can parse the RAW file, so that the RAW file can be developed and processed to obtain a RAW image file, which is directly generated and used in the third-party application of the terminal. The image file is used as an object for post-processing, and the degradation of the RAW file data is small. Therefore, when the third-party application performs post-processing on the image, the color and brightness of the image can be more freely adjusted without worrying about the degradation of the image quality. Achieve the best image processing effect, thereby improving the image rendering effect of image processing.
本发明实施例还提供一种终端,该终端可为手机、平板电脑、专用相机或可存储器,配置为存储计算机存储程序,The embodiment of the invention further provides a terminal, which may be a mobile phone, a tablet computer, a dedicated camera or a storable memory, configured to store a computer storage program.
处理器,与所述存储器连接,配置为通过执行所述计算机程序,执行以下操作:A processor, coupled to the memory, configured to perform the following operations by executing the computer program:
获取待处理图像的原始RAW数据;Obtaining raw RAW data of the image to be processed;
根据预设策略,计算所述原始RAW数据中的关键拍摄参数;Calculating key shooting parameters in the original RAW data according to a preset strategy;
将所述关键拍摄参数和所述原始RAW数据按照预设编码规范写入RAW文件中;Writing the key shooting parameters and the original RAW data into a RAW file according to a preset encoding specification;
利用第三方应用打开所述RAW文件,生成RAW的图像文件; Opening the RAW file with a third-party application to generate a RAW image file;
对所述RAW的图像文件进行图像后期处理。Image post processing is performed on the image file of the RAW.
可选地,所述处理器,还配置为根据预设策略,计算所述原始RAW数据的白平衡的增益参数、颜色变换矩阵参数中的至少一个。Optionally, the processor is further configured to calculate at least one of a white balance gain parameter and a color transformation matrix parameter of the original RAW data according to a preset policy.
可选地,所述处理器,还配置为Optionally, the processor is further configured to
根据预设策略,计算所述原始RAW数据对应的图像的宽度、高度、像素位数、黑平衡参数及拍摄形成所述RAW数据的相机的旋转参数中的一个或多个。And calculating one or more of a width, a height, a pixel number of bits, a black balance parameter, and a rotation parameter of a camera that forms the RAW data corresponding to the original RAW data according to a preset strategy.
可选地,所述处理器,配置为利用所述第三方应用对所述RAW文件中的关键拍摄参数进行解析;Optionally, the processor is configured to parse key shooting parameters in the RAW file by using the third-party application;
在所述第三方应用中,根据解析后的所述关键拍摄参数调整所述原始RAW数据;In the third-party application, adjusting the original RAW data according to the parsed key shooting parameters;
基于调整后的所述原始RAW数据,生成所述RAW的图像文件。The image file of the RAW is generated based on the adjusted original RAW data.
可选地,所述处理器,配置为将所述关键拍摄参数和所述原始RAW数据按照数字新闻采集DNG编码规范写入RAW文件中。Optionally, the processor is configured to write the key shooting parameters and the raw RAW data into a RAW file according to a digital news gathering DNG encoding specification.
可选地,所述处理器,配置为对所述RAW的图像文件进行图像的色彩、对比度和亮度中的至少一种处理。Optionally, the processor is configured to perform at least one of color, contrast, and brightness of the image on the RAW image file.
这里的处理器可为中央处理器、微处理器、数字信号处理器、应用处理器或变成阵列中的一个或多个。The processor herein can be a central processing unit, a microprocessor, a digital signal processor, an application processor, or become one or more of an array.
所述存储器可为随机存储器、只读存储器、闪存存储器等各种存储器。The memory may be various memories such as a random access memory, a read only memory, a flash memory, and the like.
所述处理器与所述存储器之间,可以通过总线连接,这里的总线可包括:集成电路(IIC)总线或外设互连标准(PCI)总线。The processor and the memory may be connected by a bus, where the bus may include an integrated circuit (IIC) bus or a peripheral interconnect standard (PCI) bus.
本发明实施例提供一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序被处理器执行之后,能够实现前述任意一个技术方案提供的所述图像处理方法。所述计算机存储介质可为随机存储介质、只读存储介质、闪存或移动硬盘等。 The embodiment of the present invention provides a computer storage medium, where the computer storage medium stores a computer program, and after the computer program is executed by the processor, the image processing method provided by any one of the foregoing technical solutions can be implemented. The computer storage medium can be a random storage medium, a read-only storage medium, a flash memory or a mobile hard disk, or the like.
可选地,所述计算机存储介质为非瞬间存储介质。Optionally, the computer storage medium is a non-transitory storage medium.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. The modifications made in accordance with the principles of the present invention are understood to fall within the scope of the present invention.
工业实用性Industrial applicability
本发明实施例公开的技术方案,在进行图像处理之前,会基于原始RAW数据及关键拍摄参数,生成RAW的图像文件,是对RAW的图像文件进行后期处理,这样的话相对于已经处理过的图像文件进行处理,可以减少原始处理导致的图像发生变化之后导致的本次的后期处理导致的图像处理差的问题,提升了图像处理质量。本发明实施例提供的方案,可以通过在处理设备中设置计算机程序来实现上述方案,在工业上实现简便及使用范围广的特点。 According to the technical solution disclosed in the embodiment of the present invention, before the image processing, the RAW image file is generated based on the original RAW data and the key shooting parameters, and the RAW image file is post-processed, so that the image is processed relative to the already processed image. The processing of the file can reduce the problem of poor image processing caused by the post-processing caused by the change of the image caused by the original processing, and improve the image processing quality. The solution provided by the embodiment of the present invention can realize the above solution by setting a computer program in the processing device, and is industrially simple and widely used.

Claims (20)

  1. 一种图像处理方法,包括:An image processing method comprising:
    获取待处理图像的原始RAW数据;Obtaining raw RAW data of the image to be processed;
    根据预设策略,计算所述原始RAW数据中的关键拍摄参数;Calculating key shooting parameters in the original RAW data according to a preset strategy;
    将所述关键拍摄参数和所述原始RAW数据按照预设编码规范写入RAW文件中;Writing the key shooting parameters and the original RAW data into a RAW file according to a preset encoding specification;
    利用第三方应用打开所述RAW文件,生成RAW的图像文件;Opening the RAW file with a third-party application to generate a RAW image file;
    对所述RAW的图像文件进行图像后期处理。Image post processing is performed on the image file of the RAW.
  2. 根据权利要求1所述的方法,其中,所述根据预设策略,计算所述原始RAW数据中的关键拍摄参数,包括:The method according to claim 1, wherein the calculating the key shooting parameters in the original RAW data according to a preset policy comprises:
    根据预设策略,计算所述原始RAW数据的白平衡的增益参数、颜色变换矩阵参数中的至少一个。At least one of a gain parameter and a color transformation matrix parameter of the white balance of the original RAW data is calculated according to a preset strategy.
  3. 根据权利要求2所述的方法,其中,The method of claim 2, wherein
    所述根据预设策略,计算所述原始RAW数据中的关键拍摄参数,还包括:The calculating the key shooting parameters in the original RAW data according to the preset policy further includes:
    根据预设策略,计算所述原始RAW数据对应的图像的宽度、高度、像素位数、黑平衡参数及拍摄形成所述RAW数据的相机的旋转参数中的一个或多个。And calculating one or more of a width, a height, a pixel number of bits, a black balance parameter, and a rotation parameter of a camera that forms the RAW data corresponding to the original RAW data according to a preset strategy.
  4. 根据权利要求1所述的方法,其中,所述利用第三方应用打开所述RAW文件,生成RAW的图像文件,包括:The method of claim 1, wherein the opening the RAW file by using a third-party application to generate an image file of the RAW comprises:
    利用所述第三方应用对所述RAW文件中的关键拍摄参数进行解析;Parsing key shooting parameters in the RAW file with the third party application;
    在所述第三方应用中,根据解析后的所述关键拍摄参数调整所述原始RAW数据;In the third-party application, adjusting the original RAW data according to the parsed key shooting parameters;
    基于调整后的所述原始RAW数据,生成所述RAW的图像文件。The image file of the RAW is generated based on the adjusted original RAW data.
  5. 根据权利要求1所述的方法,其中,所述将所述关键拍摄参数和所 述原始RAW数据按照预设编码规范写入RAW文件中,包括:The method of claim 1 wherein said key capture parameters and said The original RAW data is written into the RAW file according to the preset encoding specification, including:
    将所述关键拍摄参数和所述原始RAW数据按照数字新闻采集DNG编码规范写入RAW文件中。The key shooting parameters and the raw RAW data are written into the RAW file according to the digital news gathering DNG encoding specification.
  6. 根据权利要求1所述的方法,其中,所述对所述RAW的图像文件进行图像后期处理,包括:The method according to claim 1, wherein said performing image post-processing on said image file of said RAW comprises:
    对所述RAW的图像文件进行图像的色彩、对比度和亮度中的至少一种处理。At least one of color, contrast, and brightness of the image is performed on the image file of the RAW.
  7. 一种终端,包括:A terminal comprising:
    获取单元,配置为获取待处理图像的原始RAW数据;An obtaining unit configured to acquire raw RAW data of an image to be processed;
    计算单元,配置为根据预设策略,计算所述获取单元获取的所述原始RAW数据中的关键拍摄参数;a calculating unit, configured to calculate a key shooting parameter in the original RAW data acquired by the acquiring unit according to a preset policy;
    写入单元,配置为将所述计算单元计算的所述关键拍摄参数和所述获取单元获取的所述原始RAW数据按照预设编码规范写入RAW文件中;a writing unit configured to write the key shooting parameters calculated by the calculating unit and the original RAW data acquired by the acquiring unit into a RAW file according to a preset encoding specification;
    生成单元,配置为利用第三方应用打开所述写入单元写好的所述RAW文件,生成RAW的图像文件;a generating unit, configured to open the RAW file written by the writing unit by using a third-party application, to generate an RAW image file;
    处理单元,配置为对所述生成单元生成的所述RAW的图像文件进行图像后期处理。The processing unit is configured to perform image post-processing on the image file of the RAW generated by the generating unit.
  8. 根据权利要求7所述的终端,其中,The terminal according to claim 7, wherein
    所述计算单元,配置为根据预设策略,计算所述获取单元获取的所述原始RAW数据的白平衡的增益参数、颜色变换矩阵参数中的至少一个。The calculating unit is configured to calculate at least one of a gain parameter and a color transformation matrix parameter of the white balance of the original RAW data acquired by the acquiring unit according to a preset policy.
  9. 根据权利要求8所述的终端,其中,The terminal according to claim 8, wherein
    所述计算单元,配置为根据预设策略,计算所述原始RAW数据对应的图像的宽度、高度、像素位数、黑平衡参数及拍摄形成所述RAW数据的相机的旋转参数中的一个或多个。The calculating unit is configured to calculate, according to a preset policy, one or more of a width, a height, a pixel number, a black balance parameter, and a rotation parameter of a camera that forms the RAW data corresponding to the original RAW data. One.
  10. 根据权利要求8所述的终端,其中,所述终端还包括:解析单元; The terminal according to claim 8, wherein the terminal further comprises: a parsing unit;
    所述解析单元,配置为所述第三方应用对所述计算单元计算出的所述RAW文件中的关键拍摄参数进行解析;The parsing unit is configured to parse, by the third-party application, key shooting parameters in the RAW file calculated by the calculating unit;
    所述生成单元,配置为在所述第三方应用中,根据所述解析单元从所述写入单元解析出的所述关键拍摄参数调整所述写入单元写入的所述原始RAW数据;基于调整后的所述原始RAW数据,生成所述RAW的图像文件。The generating unit is configured to, in the third-party application, adjust the original RAW data written by the writing unit according to the key shooting parameter parsed by the parsing unit from the writing unit; The adjusted raw RAW data is generated to generate an image file of the RAW.
  11. 根据权利要求8所述的终端,其中,The terminal according to claim 8, wherein
    所述写入单元,配置为将所述计算单元计算的所述关键拍摄参数和所述获取单元获取的所述原始RAW数据按照数字新闻采集DNG编码规范写入RAW文件中。The writing unit is configured to write the key shooting parameters calculated by the calculating unit and the original RAW data acquired by the acquiring unit into a RAW file according to a digital news gathering DNG encoding specification.
  12. 根据权利要求7所述的终端,其中,The terminal according to claim 7, wherein
    所述处理单元,配置为对所述生成单元生成的所述RAW的图像文件进行图像的色彩、对比度和亮度中的至少一种处理。The processing unit is configured to perform at least one of color, contrast, and brightness of the image on the image file of the RAW generated by the generating unit.
  13. 一种终端,包括:A terminal comprising:
    存储器,配置为存储计算机存储程序,a memory configured to store computer stored programs,
    处理器,与所述存储器连接,配置为通过执行所述计算机程序,执行以下操作:A processor, coupled to the memory, configured to perform the following operations by executing the computer program:
    获取待处理图像的原始RAW数据;Obtaining raw RAW data of the image to be processed;
    根据预设策略,计算所述原始RAW数据中的关键拍摄参数;Calculating key shooting parameters in the original RAW data according to a preset strategy;
    将所述关键拍摄参数和所述原始RAW数据按照预设编码规范写入RAW文件中;Writing the key shooting parameters and the original RAW data into a RAW file according to a preset encoding specification;
    利用第三方应用打开所述RAW文件,生成RAW的图像文件;Opening the RAW file with a third-party application to generate a RAW image file;
    对所述RAW的图像文件进行图像后期处理。Image post processing is performed on the image file of the RAW.
  14. 根据权利要求13所述的终端,其特征在于,The terminal of claim 13 wherein:
    所述处理器,还配置为根据预设策略,计算所述原始RAW数据的白平 衡的增益参数、颜色变换矩阵参数中的至少一个。The processor is further configured to calculate a white level of the original RAW data according to a preset policy At least one of a gain parameter and a color transformation matrix parameter.
  15. 根据权利要求14所述的终端,其中,The terminal according to claim 14, wherein
    所述处理器,还配置为The processor is further configured to
    根据预设策略,计算所述原始RAW数据对应的图像的宽度、高度、像素位数、黑平衡参数及拍摄形成所述RAW数据的相机的旋转参数中的一个或多个。And calculating one or more of a width, a height, a pixel number of bits, a black balance parameter, and a rotation parameter of a camera that forms the RAW data corresponding to the original RAW data according to a preset strategy.
  16. 根据权利要求13所述的终端,其中,所述处理器,配置为利用所述第三方应用对所述RAW文件中的关键拍摄参数进行解析;The terminal according to claim 13, wherein the processor is configured to parse key shooting parameters in the RAW file by using the third party application;
    在所述第三方应用中,根据解析后的所述关键拍摄参数调整所述原始RAW数据;In the third-party application, adjusting the original RAW data according to the parsed key shooting parameters;
    基于调整后的所述原始RAW数据,生成所述RAW的图像文件。The image file of the RAW is generated based on the adjusted original RAW data.
  17. 根据权利要求13所述的终端,其中,所述处理器,配置为将所述关键拍摄参数和所述原始RAW数据按照数字新闻采集DNG编码规范写入RAW文件中。The terminal of claim 13, wherein the processor is configured to write the key capture parameters and the raw RAW data into a RAW file in accordance with a digital news gathering DNG encoding specification.
  18. 根据权利要求13所述的终端,其中,所述处理器,配置为对所述RAW的图像文件进行图像的色彩、对比度和亮度中的至少一种处理。The terminal of claim 13, wherein the processor is configured to perform at least one of color, contrast, and brightness of the image on the RAW image file.
  19. 一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序被处理器执行之后,能够实现权利要求1至6任一项所述的方法。A computer storage medium storing a computer program, the computer program being executable by a processor, capable of implementing the method of any one of claims 1 to 6.
  20. 根据权利要求19所述的计算机存储介质,所述计算机存储介质为非瞬间存储介质。 The computer storage medium of claim 19, the computer storage medium being a non-transitory storage medium.
PCT/CN2017/082935 2016-05-30 2017-05-03 Image processing method, terminal, and computer storage medium WO2017206655A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610367533.2 2016-05-30
CN201610367533.2A CN105979235A (en) 2016-05-30 2016-05-30 Image processing method and terminal

Publications (1)

Publication Number Publication Date
WO2017206655A1 true WO2017206655A1 (en) 2017-12-07

Family

ID=56956191

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/082935 WO2017206655A1 (en) 2016-05-30 2017-05-03 Image processing method, terminal, and computer storage medium

Country Status (2)

Country Link
CN (1) CN105979235A (en)
WO (1) WO2017206655A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105979235A (en) * 2016-05-30 2016-09-28 努比亚技术有限公司 Image processing method and terminal
CN108965846A (en) * 2018-09-07 2018-12-07 晶晨半导体(上海)股份有限公司 Adjust method, system and the display of white balance
CN109963083B (en) * 2019-04-10 2021-09-24 Oppo广东移动通信有限公司 Image processor, image processing method, photographing device, and electronic apparatus
CN110062161B (en) * 2019-04-10 2021-06-25 Oppo广东移动通信有限公司 Image processor, image processing method, photographing device, and electronic apparatus
CN113837937A (en) * 2020-06-24 2021-12-24 Oppo广东移动通信有限公司 Multimedia processing chip, electronic equipment image fusion method and image cutting method
CN114979500B (en) * 2021-02-26 2023-08-08 Oppo广东移动通信有限公司 Image processing method, image processing apparatus, electronic device, and readable storage medium
WO2023050413A1 (en) * 2021-09-30 2023-04-06 深圳传音控股股份有限公司 Image processing method, intelligent terminal, and storage medium
CN114168079B (en) * 2021-12-09 2023-08-22 深圳软牛科技有限公司 Method, device and related component for identifying tiff type data deleted from disk

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6515698B1 (en) * 1989-07-18 2003-02-04 Canon Kabushiki Kaisha Image recording apparatus
CN1484447A (en) * 2002-08-09 2004-03-24 ������������ʽ���� Canera equipment and image process method
CN1708092A (en) * 2004-06-10 2005-12-14 奥林巴斯株式会社 Image recording apparatus, image recording method, image processing apparatus, image processing method and image processing system
CN1929535A (en) * 2005-09-07 2007-03-14 索尼株式会社 Imaging apparatus, image processing apparatus, image processing method, and computer program
CN105979235A (en) * 2016-05-30 2016-09-28 努比亚技术有限公司 Image processing method and terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4935049B2 (en) * 2005-10-27 2012-05-23 セイコーエプソン株式会社 Image processing apparatus, image processing method, and image processing program
US8286102B1 (en) * 2010-05-27 2012-10-09 Adobe Systems Incorporated System and method for image processing using multi-touch gestures

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6515698B1 (en) * 1989-07-18 2003-02-04 Canon Kabushiki Kaisha Image recording apparatus
CN1484447A (en) * 2002-08-09 2004-03-24 ������������ʽ���� Canera equipment and image process method
CN1708092A (en) * 2004-06-10 2005-12-14 奥林巴斯株式会社 Image recording apparatus, image recording method, image processing apparatus, image processing method and image processing system
CN1929535A (en) * 2005-09-07 2007-03-14 索尼株式会社 Imaging apparatus, image processing apparatus, image processing method, and computer program
CN105979235A (en) * 2016-05-30 2016-09-28 努比亚技术有限公司 Image processing method and terminal

Also Published As

Publication number Publication date
CN105979235A (en) 2016-09-28

Similar Documents

Publication Publication Date Title
WO2017206655A1 (en) Image processing method, terminal, and computer storage medium
CN112150399B (en) Image enhancement method based on wide dynamic range and electronic equipment
US10827140B2 (en) Photographing method for terminal and terminal
WO2017071559A1 (en) Image processing apparatus and method
WO2018019124A1 (en) Image processing method and electronic device and storage medium
US8994845B2 (en) System and method of adjusting a camera based on image data
WO2017050115A1 (en) Image synthesis method
WO2017206657A1 (en) Image processing method and device, mobile terminal, and computer storage medium
KR20160016068A (en) Method for generating image and electronic device thereof
WO2017206656A1 (en) Image processing method, terminal, and computer storage medium
WO2017045647A1 (en) Method and mobile terminal for processing image
CN110430357B (en) Image shooting method and electronic equipment
WO2017071475A1 (en) Image processing method, and terminal and storage medium
WO2017185870A1 (en) Light supplement apparatus and method for photographing, and storage medium
WO2017071542A1 (en) Image processing method and apparatus
CN106534619A (en) Method and apparatus for adjusting focusing area, and terminal
WO2017067523A1 (en) Image processing method, device and mobile terminal
US20240119566A1 (en) Image processing method and apparatus, and electronic device
WO2017088680A1 (en) Image processing apparatus and method
CN106954020B (en) A kind of image processing method and terminal
WO2018050080A1 (en) Mobile terminal, picture processing method and computer storage medium
CN107071263A (en) A kind of image processing method and terminal
CN112995467A (en) Image processing method, mobile terminal and storage medium
US10778903B2 (en) Imaging apparatus, imaging method, and program
CN112449112B (en) Camera white balance adjusting method, mobile terminal and computer readable storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 17805600

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.04.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17805600

Country of ref document: EP

Kind code of ref document: A1