WO2017071475A1 - 一种图像处理方法及终端、存储介质 - Google Patents

一种图像处理方法及终端、存储介质 Download PDF

Info

Publication number
WO2017071475A1
WO2017071475A1 PCT/CN2016/101934 CN2016101934W WO2017071475A1 WO 2017071475 A1 WO2017071475 A1 WO 2017071475A1 CN 2016101934 W CN2016101934 W CN 2016101934W WO 2017071475 A1 WO2017071475 A1 WO 2017071475A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
edge
color
processing
terminal
Prior art date
Application number
PCT/CN2016/101934
Other languages
English (en)
French (fr)
Inventor
张登康
Original Assignee
努比亚技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 努比亚技术有限公司 filed Critical 努比亚技术有限公司
Publication of WO2017071475A1 publication Critical patent/WO2017071475A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects

Definitions

  • the present invention relates to image processing technologies in the field of electronic applications, and in particular, to an image processing method, a terminal, and a storage medium.
  • sketch is a kind of image stylization.
  • the sketch in real life is mainly a pencil as a tool, using lines to represent the artistic form of a person or a landscape, and a digital photo can be processed into a sketch style image by a computer.
  • terminal devices such as mobile terminals.
  • the method for generating a style image in a mobile terminal mainly has a stylized generated function in the image processing software, such as a stylized filter of a Photoshop application, and realizes stylized processing of the digital photo.
  • an embodiment of the present invention is to provide an image processing method, a terminal, and a storage medium, which can automatically generate a stylized image and improve the stylized effect of the image.
  • an embodiment of the present invention provides an image processing method, where the image processing method includes:
  • the first image and the filter image are image-mixed to generate a stylized image.
  • the collecting the first image to be processed in the photographing area includes:
  • a first image as a preview of the camera or camera is acquired in the imaging area of the lens.
  • the first image includes a specific object in the photographing area, and the object includes at least one of the following: a character, a building, and an animal.
  • the edge processing is performed on the first image to generate an edge contour image, including:
  • Color difference calculation is performed on the second image and the third image to obtain the color edge contour image.
  • the edge and color are deepened on the color edge contour image to generate a filter image, including:
  • edge and color are deepened on the color edge contour image to obtain the filter image.
  • the performing contrast processing on the first image to generate a second image includes:
  • the edge contrast of the brightest area and the darkest area in the first image is reduced, the edge contrast of the main body in the first image is improved, and the edge intensity of the main body is enlarged to obtain the
  • the second image includes:
  • the component images of the three primary colors are subjected to contrast processing, and the component images of the three primary colors after the contrast processing are synthesized to obtain the second image.
  • the performing contrast processing on the component images of the three primary colors includes:
  • the pixel value of the updated pixel is 255.
  • the method further includes:
  • the stylized image is displayed in the display area.
  • an embodiment of the present invention provides a terminal, where the terminal includes:
  • the collecting unit is configured to collect the first image to be processed in the photographing area
  • An edge processing unit configured to perform edge processing on the first image collected by the collecting unit to generate a color edge contour image
  • the deepening unit is configured to perform edge and color deepening on the color edge contour image generated by the edge processing unit to generate a filter image
  • the mixing unit is configured to perform image mixing by mixing the first image collected by the collecting unit and the filter image generated by the deepening unit processing to generate a stylized image.
  • the collecting unit is further configured to collect a first image as a preview of the camera or the camera in the imaging area of the lens.
  • the first image includes a specific object in the photographing area, and the object includes at least one of the following: a character, a building, and an animal.
  • the edge processing unit is further configured to perform contrast processing on the first image collected by the collecting unit to generate a second image, and perform smoothing processing on the second image to obtain a third image; Color difference calculation is performed on the second image and the third image to obtain the color edge contour image.
  • the deepening unit is configured to perform edge and color deepening on the color edge contour image according to the second image and the third image to obtain the filter image.
  • the edge processing unit is further configured to reduce edge contrast of the brightest area and the darkest area of the first image collected by the collecting unit, improve edge contrast of the main body in the first image, and The edge intensity of the body is enlarged to obtain the second image.
  • the edge processing unit is further configured to perform a contrast processing on the component images of the three primary colors by decomposing the first image into component images of three primary colors of red, green, and blue, and synthesize the three primary colors after the contrast processing. a component image to obtain the second image.
  • the edge processing unit is further configured to update a pixel value of the pixel when the pixel value in the three primary color component images is lower than a predetermined pixel value range;
  • the edge processing unit is further configured to update a pixel value of the pixel to a value between 0 and 255 when a pixel value in the three primary color component images is in a predetermined pixel value range;
  • the pixel value of the updated pixel is 255.
  • the terminal further includes:
  • the display unit is configured to display the stylized image in the display area after the generated stylized image is generated after being processed by the mixing unit.
  • an embodiment of the present invention provides a terminal, including a processor and a storage medium; Executable instructions are stored in the storage medium, and the executable instructions are used to execute the image processing method described above.
  • an embodiment of the present invention provides a storage medium storing executable instructions, where the executable instructions are used in the image processing method described above.
  • An embodiment of the present invention provides an image processing method, a terminal, and a storage medium, by collecting a first image to be processed in a photographing area; performing edge processing on the first image to generate a color edge contour image; and performing color edge contour image on the color edge contour image Deepening the edges and colors to generate a filter image; mixing the first image and the filter image to generate a stylized image, using the above-mentioned technical implementation scheme, since the terminal can perform real-time imaging or photography, the photo area can be The processed first image is color stylized, and the process of automatically generating a stylized image in real time by the terminal is realized, and the color edge contour extraction and color differentiation are maintained, thereby improving the stylized effect of the image.
  • FIG. 1 is a schematic structural diagram of hardware of a mobile terminal that implements 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 1 of an image processing method according to an embodiment of the present invention.
  • FIG. 4 is a flowchart 1 of an image processing method according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram 1 of an exemplary image processing effect according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram 2 of an exemplary image processing effect according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram 3 of an exemplary image processing effect according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram 4 of an exemplary picture processing effect according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram 5 of an exemplary picture processing effect according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram 6 of an exemplary picture processing effect according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram 1 of a terminal according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram 2 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.
  • PDAs personal digital assistants
  • PADs tablet computers
  • PMPs portable multimedia players
  • Mobile terminals and fixed terminals such as digital TVs, desktop computers, and the like.
  • the terminal is a mobile terminal.
  • those skilled in the art will appreciate that configurations in accordance with embodiments of the present invention can be applied to fixed type terminals in addition to components that are specifically for mobile purposes.
  • FIG. 1 is a schematic diagram showing the hardware structure of a mobile terminal embodying various embodiments of the present invention.
  • the mobile terminal 100 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 100 and a wireless communication system or network.
  • the wireless communication unit may include a broadcast receiving module 111, a mobile communication module 112, a wireless internet module 113, and a short-range communication module. At least one of 114 and location information module 115.
  • the broadcast receiving module 111 receives a broadcast signal and/or broadcast associated information from an external broadcast management server via a broadcast channel.
  • the broadcast channel can include a satellite channel and/or a terrestrial channel.
  • the broadcast management server may be a server that generates and transmits a broadcast signal and/or broadcast associated information or a server that receives a previously generated broadcast signal and/or broadcast associated information and transmits it to the terminal.
  • the broadcast signal may include a TV broadcast signal, a radio broadcast signal, a data broadcast signal, and the like.
  • the broadcast signal may further include a broadcast signal combined with a TV or radio broadcast signal.
  • the broadcast associated information may also be provided via a mobile communication network, and in this case, the broadcast associated information may be received by the mobile communication module 112.
  • the broadcast signal may exist in various forms, for example, it may exist in the form of Digital Multimedia Broadcasting (DMB) Electronic Program Guide (EPG), Digital Video Broadcasting Handheld (DVB-H) Electronic Service Guide (ESG), and the like.
  • the broadcast receiving module 111 can receive a signal broadcast by using various types of broadcast systems.
  • the broadcast receiving module 111 can use a data broadcasting system such as Multimedia Broadcast-Turround (DMB-T), Digital Multimedia Broadcast-Satellite (DMB-S), DVB-H, Forward Link Media (MediaFLO @ ), Digital broadcasting systems such as the terrestrial digital broadcasting integrated service (ISDB-T) and the like receive digital broadcasting.
  • the broadcast receiving module 111 can be constructed as various broadcast systems suitable for providing broadcast signals as well as the above-described digital broadcast system.
  • the broadcast signal and/or broadcast associated information received via the broadcast receiving module 111 may be stored in the memory 160 (or other type of storage medium).
  • the mobile communication module 112 transmits the radio signals to and/or receives radio signals from at least one of a base station (e.g., an access point, a Node B, etc.), an external terminal, and a server.
  • a base station e.g., an access point, a Node B, etc.
  • Such radio signals may include voice call signals, video call signals, or 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 wireless LAN (Wi-Fi), wireless broadband (Wibro), global microwave interconnection (Wimax), and high speed. Downlink Packet Access (HSDPA) and the like.
  • the short range communication module 114 is a module configured to support short range communication.
  • Some examples of short-range communication technology include Bluetooth TM, a radio frequency identification (RFID), infrared data association (IrDA), ultra wideband (UWB), ZigBee, etc. TM.
  • the location information module 115 is a module configured to check or acquire 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 configured to receive an audio or video signal.
  • the A/V input unit 120 may include a camera 121 and a microphone 122 that processes image data of still pictures or video obtained by the image capturing device in a video capturing mode or an image capturing mode.
  • the processed image frame can be displayed on the display unit 151.
  • the image frames processed by the camera 121 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 microphone 122 can receive sound (audio data) via a microphone in an operation mode of a telephone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound as audio data.
  • the processed audio (voice) data can be converted to a format output that can be transmitted to the mobile communication base station via the mobile communication module 112 in the case of a telephone call mode.
  • the microphone 122 can implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated during the process of receiving and transmitting audio signals.
  • the user input unit 130 may generate key input data according to a command input by the user to control various operations of the mobile terminal.
  • the user input unit 130 allows the user to input various types of information, and 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, a rocker, and the like.
  • a touch panel when the touch panel is superimposed on the display unit 151 in the form of a layer, a touch screen can be formed.
  • the sensing unit 140 detects the current state of the mobile terminal 100 (eg, the open or closed state of the mobile terminal 100), the location of the mobile terminal 100, the presence or absence of contact (ie, touch input) by the user with the mobile terminal 100, and the mobile terminal.
  • the sensing unit 140 can sense whether the slide type phone is turned on or off.
  • the sensing unit 140 can detect whether the power supply unit 190 provides power or whether the interface unit 170 is coupled to an external device.
  • Sensing unit 140 may include proximity sensor 141 which will be described below in connection with a touch screen.
  • the interface unit 170 serves as an interface through which at least one external device can connect with the mobile terminal 100.
  • the external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, and an audio input/output. (I/O) port, video I/O port, headphone port, and more.
  • the identification module may be stored to verify various information used by the user using the mobile terminal 100 and may include a User Identification Module (UIM), a Customer Identification Module (SIM), a Universal Customer Identity Module (USIM), and the like.
  • the device having the identification module may take the form of a smart card, and thus the identification device may be connected to the mobile terminal 100 via a port or other connection device.
  • the interface unit 170 can be configured to receive input from an external device (eg, data information, power, etc.) and transmit the received input to one or more components within the mobile terminal 100 or can be used at the mobile terminal and external device Transfer data between.
  • the interface unit 170 may function as a path through which power is supplied from the base to the mobile terminal 100 or may be used as a transmission of various command signals allowing input from the base to the mobile terminal 100 The path to the terminal.
  • Various types of input from the base The command signal or power can be used as a signal for identifying whether the mobile terminal is accurately mounted on the base.
  • Output unit 150 is configured to provide an output signal (eg, an audio signal, a video signal, an alarm signal, a vibration signal, etc.) in a visual, audio, and/or tactile manner.
  • the output unit 150 may include a display unit 151, an audio output module 152, an alarm unit 153, and the like.
  • the display unit 151 can display information processed in the mobile terminal 100. For example, when the mobile terminal 100 is in a phone call mode, the display unit 151 can display a user interface (UI) or a graphical user interface (GUI) related to a call or other communication (eg, text messaging, multimedia file download, etc.). When the mobile terminal 100 is in a video call mode or an image capturing mode, the display unit 151 may display a captured image and/or a received image, a UI or GUI showing a video or image and related functions, and the like.
  • UI user interface
  • GUI graphical user interface
  • the display unit 151 can function as an input device and an output device.
  • the display unit 151 may include at least one of a liquid crystal display (LCD), a thin film transistor LCD (TFT-LCD), an organic light emitting diode (OLED) display, a flexible display, a three-dimensional (3D) display, and the like.
  • LCD liquid crystal display
  • TFT-LCD thin film transistor LCD
  • OLED organic light emitting diode
  • a flexible display a three-dimensional (3D) display, and the like.
  • 3D three-dimensional
  • Some of these displays may be configured to be transparent to allow a user to view from the outside, which may be referred to as a transparent display, and a typical transparent display may be, for example, a transparent organic light emitting diode (TOLED) display or the like.
  • TOLED transparent organic light emitting diode
  • the mobile terminal 100 may include two or more display units (or other display devices), for example, the mobile terminal may include an external display unit (not shown) and an internal display unit (not shown) .
  • the touch screen can be used to detect touch input pressure as well as touch input position and touch input area.
  • the audio output module 152 may convert audio data received by the wireless communication unit 110 or stored in the memory 160 when the mobile terminal is in a call signal receiving mode, a call mode, a recording mode, a voice recognition mode, a broadcast receiving mode, and the like.
  • the audio signal is output as sound.
  • the audio output module 152 can provide audio output (eg, call signal reception sound, message reception sound, etc.) associated with a particular function performed by the mobile terminal 100.
  • Audio output Module 152 can include a speaker, a buzzer, and the like.
  • the alarm unit 153 can provide an output to notify the mobile terminal 100 of the occurrence of an event. Typical events may include call reception, message reception, key signal input, touch input, and the like. In addition to audio or video output, the alert unit 153 can provide an output in a different manner to notify of the occurrence of an event. For example, the alarm unit 153 can provide an output in the form of vibrations, and when a call, message, or some other incoming communication is received, the alarm unit 153 can provide a tactile output (ie, vibration) to notify the user of it. By providing such a tactile output, the user is able to recognize the occurrence of various events even when the user's mobile phone is in the user's pocket. The alarm unit 153 can also provide an output of the notification event occurrence via the display unit 151 or the audio output module 152.
  • the memory 160 may store a software program or the like that performs 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, and the like) that has been output or is to be output. Moreover, the memory 160 can store data regarding vibrations and audio signals of various manners that are output when a touch is applied to the touch screen.
  • the memory 160 may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), a random access memory (RAM), a static random access memory ( SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like.
  • the mobile terminal 100 can cooperate with a network storage device that performs a storage function of the memory 160 through a network connection.
  • the controller 180 typically controls the overall operation of the mobile terminal. For example, the controller 180 performs the control and processing associated with voice calls, data communications, video calls, and the like.
  • the controller 180 may include a multimedia module 181 for reproducing (or playing back) multimedia data, which may be constructed within the controller 180 or may be configured to be separate from the controller 180.
  • the controller 180 may perform a pattern recognition process to input handwriting input or picture on the touch screen The input is recognized as a character or 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 100 as shown in FIG. 1 may be configured to operate using a communication system such as a wired and wireless communication system and a satellite-based communication system that transmits data via frames or packets.
  • a communication system such as a wired and wireless communication system and a satellite-based communication system that transmits data via frames or packets.
  • Such communication systems may use different air interfaces and/or physical layers.
  • air interfaces used by communication systems include, for example, Frequency Division Multiple Access (FDMA), Time Division Multiple Access (TDMA), Code Division Multiple Access (CDMA), and Universal Mobile Telecommunications System (UMTS) (in particular, Long Term Evolution (LTE)). ), Global System for Mobile Communications (GSM), etc.
  • FDMA Frequency Division Multiple Access
  • TDMA Time Division Multiple Access
  • CDMA Code Division Multiple Access
  • UMTS Universal Mobile Telecommunications System
  • LTE Long Term Evolution
  • GSM Global System for Mobile Communications
  • the following description relates to a CDMA communication system, but such teachings are equally applicable to other types of systems.
  • a CDMA wireless communication system can include a plurality of mobile terminals 100, a plurality of base stations (BS) 270, a base station controller (BSC) 275, and a mobile switching center (MSC) 280.
  • the MSC 280 is configured to interface with a public switched telephone network (PSTN) 290.
  • PSTN public switched telephone network
  • the MSC 280 is also configured to interface with a BSC 275 that can be coupled to the BS 270 via a backhaul line.
  • the backhaul line can be constructed in accordance with any of a number of known interfaces including, for example, E1/T1, ATM, IP, PPP, Frame Relay, HDSL, ADSL, or xDSL. It will be appreciated that the system as shown in FIG. 2 can include multiple BSCs 275.
  • Each BS 270 can serve one or more partitions (or regions), 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 100 operating within the system.
  • a broadcast receiving module 111 as shown in FIG. 1 is provided at the mobile terminal 100 to receive a broadcast signal transmitted by the BT 295.
  • GPS Global Positioning System
  • FIG. 2 several Global Positioning System (GPS) satellites 300 are shown that help locate at least one of a plurality of mobile terminals 100.
  • a plurality of satellites 300 are depicted, but it is understood that useful positioning information can be obtained using any number of satellites.
  • the GPS module 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 transmission.
  • BS 270 receives reverse link signals from various mobile terminals 100.
  • Mobile terminal 100 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
  • MSC 280 interfaces with BSC 275
  • BSC 275 controls BS 270 accordingly to transmit forward link signals to mobile terminal 100.
  • An embodiment of the present invention provides an image processing method. As shown in FIG. 3, the method may include:
  • the terminal collects a first image to be processed in the photographing area.
  • the application scenario of the embodiment of the present invention may be an image to be captured collected by the terminal in a photographing area (for example, an imaging area of a lens) during an image capturing or photographing by the terminal, that is, an unprocessed image.
  • An image configured to be a preview of the camera or camera, stylizing the first image.
  • the terminal may be an electronic device having a camera or a camera function, such as a mobile phone or a tablet computer.
  • the instant stylization function of realizing imaging or photographing in the embodiment of the present invention can be realized by setting a stylized button.
  • the terminal as a mobile phone as an example, when the user uses the mobile phone to take a photo, the mobile phone can activate the camera function, and can start the stylized button set on the mobile phone display, so that the photograph taken can be processed and stylized. image.
  • the setting position of the stylized button is shape, size, and the like.
  • the basic information is not limited in the embodiment of the present invention, and can be designed according to actual needs and preferences.
  • the terminal collects a first image to be processed in the photographing area, and the first image may be an image or a picture acquired by the terminal through the camera.
  • the first image is a color image
  • the purpose of the embodiment of the present invention is to perform color stylized image processing on the first image
  • the first image collected by the terminal may have a specific object in the photographing area, such as a relatively important object, that is, a main body of the first image, or an object to be expressed in the first image.
  • a specific object in the photographing area such as a relatively important object, that is, a main body of the first image, or an object to be expressed in the first image.
  • the main body of the first image may be: a person, a building, a sea, an animal, and the like.
  • the embodiment of the present invention is not limited, but is determined according to actual shooting conditions.
  • the terminal performs edge processing on the first image to generate a color edge contour image.
  • the terminal After the terminal collects the first image to be processed in the photographing area, the terminal does not directly display the photographed first image, but performs some processing on the first image to achieve the effect desired by the user, that is, the terminal.
  • the first image is edged to highlight the body edge of the first image to generate or obtain a color edge contour image.
  • the existing method for edge processing of the first image can be applied to the embodiment of the present invention, wherein the main purpose of the edge processing of the first image is to The edge contour of the body is better reflected.
  • the first image may be edged by the following method:
  • the terminal performs contrast processing on the first image to generate a second image.
  • the terminal smoothes the second image to obtain a third image.
  • the terminal performs color difference calculation on the second image and the third image to obtain a color edge. Contour image.
  • the terminal deepens the edge and the color of the color edge contour image to generate a filter image.
  • the terminal After the terminal performs edge processing on the first image to generate a color edge contour image, the terminal has processed the color edge contour of the first image, and then preserves the color edge contour (for example, using an edge detection algorithm) while retaining the first image.
  • the difference in color in the image, that is, the edge and color of the color edge contour image is deepened, and finally the filter image is obtained.
  • the terminal may perform edge and color deepening on the color edge contour image according to the second image and the third image to generate a filter image.
  • the color image of the main image of the first image is more obvious, and the color difference of the main body in the first image is retained, so that the first can be easily detected.
  • the image of the subject in the image is more obvious, and the color difference of the main body in the first image is retained, so that the first can be easily detected.
  • the terminal mixes the first image and the filter image to generate a stylized image.
  • the terminal deepens the edge and color of the color edge contour image, and after generating the filter image, the terminal can mix the image of the first image and the filter image to generate a stylized image.
  • the terminal generates a filter image, and mixes the first image and the filter image to obtain the image after the desired first image is stylized.
  • the generation of the filter image in the embodiment of the present invention is a process of forming a stylized model.
  • the first image and the stylized model are mixed.
  • the processing of all the images is performed on the channels based on the three primary colors of R, G, and B, which will be described in detail in the following embodiments.
  • An image processing method provided by an embodiment of the present invention is obtained by collecting a photographing area
  • the first image is processed; the first image is edged to generate a color edge contour image; the edge and color are deepened on the color edge contour image to generate a filter image; and the first image and the filter image are image-mixed.
  • the stylized image is generated, and the above-mentioned technical implementation scheme is adopted. Since the terminal performs color stylization processing on the unprocessed first image of the photographing area during real-time imaging or photographing, the process of automatically generating the stylized image by the terminal in real time is realized. With color edge contour extraction and color difference retention, the stylized effect of the image is improved.
  • An embodiment of the present invention provides an image processing method. As shown in FIG. 4, the method may include:
  • the terminal collects a first image to be processed in the photographing area.
  • the application scenario of the embodiment of the present invention may be an image to be captured collected by the terminal in a photographing area (for example, an imaging area of a lens), that is, an unprocessed image, in a process of capturing or photographing the terminal.
  • a photographing area for example, an imaging area of a lens
  • the first image is previewed and the first image is stylized.
  • the terminal may be an electronic device having a camera or a camera function, such as a mobile phone or a tablet computer.
  • the instant stylization function of realizing imaging or photographing in the embodiment of the present invention can be realized by setting a stylized button.
  • the terminal as a mobile phone as an example, when the user uses the mobile phone to take a photo, the mobile phone can activate the camera function, and can start the stylized button set on the mobile phone display, so that the photograph taken can be processed and stylized. image.
  • the basic information such as the shape, the size, and the like of the setting position of the stylized button is not limited in the embodiment of the present invention, and may be designed according to actual needs and preferences.
  • the terminal collects a first image to be processed in the photographing area, and the first image may be an image or a picture acquired by the terminal through the camera.
  • the first image in the embodiment of the present invention is a color image
  • the present invention The purpose of the embodiment is to process the first image into a color stylized image.
  • the object that is more important in the image that is, the body of the first image, or the object that is to be expressed in the first image, is present in the first image acquired by the terminal.
  • the main body of the first image may be: a person, a building, a sea, an animal, and the like.
  • the embodiment of the present invention is not limited, but is determined according to actual shooting conditions.
  • the terminal performs contrast processing on the first image to generate a second image.
  • the terminal After the terminal collects the first image to be processed in the photographing area, the terminal does not directly display the photographed first image, but performs some processing on the first image to achieve the effect desired by the user, that is, the terminal.
  • the first image is edged to highlight the body edge of the first image to generate or obtain a color edge contour image.
  • the existing method for edge processing of the first image can be applied to the embodiment of the present invention, wherein the main purpose of the edge processing of the first image is to The edge contour of the body is better reflected.
  • the terminal performs contrast processing on the first image to generate a second image.
  • the terminal reduces (eg, decreases according to a predetermined amplitude) the edge contrast of the brightest region and the darkest region in the first image, improves the edge contrast of the subject in the first image, and amplifies the edge intensity of the subject (eg, according to The predetermined multiple is magnified) to generate a second image.
  • the terminal unifies the hue of the lines in the first image, so that the contrast of the color edges of the main body is reflected.
  • the processing of all the images is performed separately on the channels of the three primary colors of R, G, and B.
  • the contrast processing is performed on the first image
  • the first image is decomposed into component images of the three primary colors.
  • processing the contrast of the component images of the three primary colors after the combination processing
  • the three primary color component images result in a second image.
  • the terminal adjusts the contrast of the first image to obtain a second image.
  • the contrast adjustment in the present invention uses the formula (1):
  • T L is The lowest threshold of the pixel of the first image
  • T H is the highest threshold of the pixel of the first image
  • k is the transform coefficient
  • the values of T L , T H and k can be set according to the time requirement, which is not limited in the embodiment of the present invention.
  • the R, G, and B pixel values range from 0 to 255.
  • the terminal performs smoothing processing on the second image to obtain a third image.
  • the terminal performs contrast processing on the first image, and after generating the second image, the terminal performs smoothing processing on the second image to obtain a third image.
  • this step is mainly for smoothing the noise reduction of the second image after the contrast is removed, and removing the disordered color edges.
  • the terminal may perform Gaussian filtering on the second image to obtain a third image
  • the embodiment of the present invention may be processed by the existing Gaussian filtering technique, and thus is not described herein again.
  • the terminal performs a color difference operation on the second image and the third image to obtain a color edge contour image.
  • the terminal may perform color interpolation on the second image and the third image to obtain color edge contour information to obtain a color edge contour image.
  • the second image is subjected to a difference operation with the third image to obtain a colored edge of the outline
  • the contour image can be processed according to the following formula (2):
  • I 4 is the R, G, and B pixel values of the color edge contour image; and I 3 is represented as the R, G, and B pixel values of the third image.
  • the terminal performs edge and color deepening on the color edge contour image according to the second image and the third image to generate a filter image.
  • the terminal may deepen the edge and color of the color edge contour image according to the second image and the third image to generate a filter image.
  • the color edge contour image is adjusted according to the following formula (3) to calculate the edge to obtain a filter image:
  • I 5 is the R, G, and B pixel values of the filter image.
  • the terminal after the terminal performs edge processing on the first image to generate a color edge contour image, the terminal has processed the color edge contour of the first image, and then obtains the color edge contour while retaining the first image.
  • the difference in color that is, the edge and color of the color edge contour image is deepened, and finally the filter image is obtained.
  • the terminal mixes the first image and the filter image to generate a stylized image.
  • the terminal After the terminal generates the filter image, the terminal can mix the first image and the filter image to generate a stylized image.
  • the terminal generates a filter image, and mixes the first image and the filter image to obtain the image after the desired first image is stylized.
  • the filter image is mixed with the first image according to the following formula (4):
  • I 6 is the R, G, and B pixel values of the stylized image.
  • the generation of the filter image in the embodiment of the present invention is a process of forming a stylized model.
  • the first image and the stylized model are mixed.
  • the terminal displays the stylized image in a display area.
  • the terminal After the terminal generates the stylized image, the terminal displays the processed stylized image in the display area.
  • the terminal when the terminal performs shooting in the stylized mode, the processed stylized image is directly displayed, and therefore, the terminal can acquire the stylized image in real time.
  • FIG. 5 is a first image in the embodiment of the present invention, after contrast processing Generating a second image as shown in FIG. 6 , the mobile phone smoothing the second image to obtain a third image as shown in FIG. 7 , and performing color difference calculation on the second image and the third image by the mobile phone As shown in the color edge contour image shown in FIG. 8, the mobile phone further deepens the edge and color of the color edge contour image according to the second image and the third image, and generates a filter image as shown in FIG. 9. Finally, the mobile phone will The first image and the filter image are image blended to generate a stylized image as shown in FIG. 10, and the stylized image is displayed on the display screen.
  • FIG. 5, FIG. 6, FIG. 7, FIG. 8, FIG. 9 and FIG. 10 in the embodiment of the present invention are all pictures after the color removal.
  • the image processing method provided by the embodiment of the present invention is a color image processing, and the processing result is also colored.
  • An image processing method provided by an embodiment of the present invention collects a first image to be processed in a photographing area; performs edge processing on the first image to generate a color edge contour image;
  • the color edge contour image is used to deepen the edge and color to generate a filter image;
  • the first image and the filter image are mixed to generate a stylized image, and the above technology is used to realize the scheme, because the terminal can perform real-time camera or photography,
  • Color-stylized processing of the unprocessed first image of the photographing area realizes a process of automatically generating a stylized image in real time by the terminal, and adopts color edge contour extraction and color differentiation to maintain, thereby improving the stylization of the image. effect.
  • the embodiment of the present invention provides a terminal 1, which may include:
  • the collecting unit 10 is configured to collect a first image to be processed in the photographing area.
  • the edge processing unit 11 is configured to perform edge processing on the first image collected by the collection unit 10 to generate a color edge contour image.
  • the deepening unit 12 is configured to perform edge and color deepening on the color edge contour image generated by the edge processing unit 11 to generate a filter image.
  • the mixing unit 13 is configured to image-mix the first image collected by the acquisition unit 10 and the filter image generated by the deepening unit 12 to generate a stylized image.
  • the collecting unit 10 is further configured to collect a first image as a preview of the camera or the camera in the imaging area of the lens.
  • the edge processing unit 11 is further configured to perform contrast processing on the first image collected by the collecting unit 10 to generate a second image, and perform smoothing processing on the second image to obtain a third image. And performing color difference calculation on the second image and the third image to obtain the color edge contour image.
  • the edge processing unit 11 is further configured to reduce edge contrast of the brightest area and the darkest area of the first image collected by the collecting unit 10, and improve edge contrast of the main body in the first image. And magnifying the edge intensity of the body to generate the second image.
  • the deepening unit 12 is further configured to pass through the edge processing unit 11
  • the second image and the third image generated are used to perform edge and color deepening on the color edge contour image to generate the filter image.
  • the edge processing unit 11 is further configured to decompose the first image into component images of three primary colors of red, green, and blue, perform contrast processing on the component images of the three primary colors, and synthesize the component images of the three primary colors after the contrast processing. And obtaining the second image.
  • the pixel value of the updated pixel is 255.
  • the terminal 1 further includes: a display unit 14.
  • the display unit 14 is configured to display the stylized image in the display area after the generated stylized image is generated after being processed by the mixing unit 13 .
  • the terminal in the embodiment of the present invention may be an electronic device having a camera or a camera function, such as a mobile phone or a tablet computer.
  • the foregoing collecting unit 10, the edge processing unit 11, the deepening unit 12, and the mixing unit 13 may be implemented by a processor located on the terminal 1, specifically a central processing unit (CPU), a microprocessor (MPU), and a digital signal.
  • a processor DSP
  • FPGA field programmable gate array
  • the display unit 14 can be implemented by a light sensor
  • the terminal 1 can further include a memory, for example, the first image and its software code, the second image and its software.
  • the code, the third image and its software code, the color edge contour image and its software code, the filter image and its software code, and the stylized image and its software code can be saved in a memory, and the memory and the light sensor can pass
  • the system bus is coupled to the processor, wherein the memory is for storing executable program code, the program code includes computer operating instructions, and the memory may include high speed RAM memory, or It can also include a non-volatile memory, such as at least one disk storage.
  • the terminal collects the first image to be processed in the photographing area; performs edge processing on the first image to generate a color edge contour image; and deepens the edge and color of the color edge contour image to generate a filter.
  • Mirror image mixing the first image and the filter image to generate a stylized image, and adopting the above technical implementation scheme, the color of the unprocessed first image of the photographing area can be performed in color when the terminal performs real-time imaging or photographing.
  • the processing realizes the process of automatically generating a stylized image in real time by the terminal, and adopts color edge contour extraction and color differentiation to maintain, thereby improving the stylized effect of the image.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Image Processing (AREA)

Abstract

本发明实施例公开了一种图像处理方法,包括:采集拍照区域中待处理的第一图像;对第一图像进行边缘化处理,生成彩色边缘轮廓图像;对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;将第一图像和滤镜图像进行图像混合,生成风格化图像。本发明实施例还同时公开了一种终端和存储介质。

Description

一种图像处理方法及终端、存储介质 技术领域
本发明涉及电子应用领域中的图像处理技术,尤其涉及一种图像处理方法及终端、存储介质。
背景技术
近年来,利用计算机对数码照片进行处理,将图像的纹理进行简化以突出想要表达的某些特征,生成各种风格图像这一数字媒体技术已经得到广泛的应用。例如:素描是图像风格化的一种,现实生活中的素描主要是以铅笔为工具,用线条来表现人物或风景的艺术形式,通过计算机可以将数码照片处理为素描风格图像。随着技术的发展,将对数码照片的处理逐渐应用在了终端设备(如:移动终端)上。
现有技术中,移动终端中生成风格图像的方法主要是在图片处理软件中有风格化生成的功能,如Photoshop应用的风格化滤镜,实现数码照片的风格化处理。
然而,数码照片通过Photoshop自带的风格化滤镜组里的滤镜生成的风格化效果都不如人意,对真实的数码照片要进行复杂的设计来生成,而且需要一定美术基础,因此,一般用户使用时,会出现设计耗时、效果差且无法满足自动生成的需求。
发明内容
为解决上述技术问题,本发明实施例期望提供一种图像处理方法及终端、存储介质,能够自动生成风格化图像,且提高了图像的风格化效果。
本发明的技术方案是这样实现的:
第一方面,本发明实施例提供一种图像处理方法,所述图像处理方法包括:
采集拍照区域中待处理的第一图像;
对所述第一图像进行边缘化处理,生成彩色边缘轮廓图像;
对所述彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;
将所述第一图像和所述滤镜图像进行图像混合,生成风格化图像。
上述方案中,所述采集拍照区域中待处理的第一图像,包括:
在镜头的成像区域采集到作为摄像或照相的预览的第一图像。
上述方案中,所述第一图像包括所述拍照区域中的特定对象,所述对象包括以下至少之一;人物、建筑和动物。
上述方案中,所述对所述第一图像进行边缘化处理,生成边缘轮廓图像,包括:
对所述第一图像进行对比度处理,生成第二图像;
将所述第二图像进行平滑处理,得到第三图像;
对所述第二图像和所述第三图像进行色彩差值运算,得到所述彩色边缘轮廓图像。
上述方案中,所述对所述彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像,包括:
根据所述第二图像和所述第三图像,对所述彩色边缘轮廓图像进行边缘和色彩的深化,得到所述滤镜图像。
上述方案中,所述对所述第一图像进行对比度处理,生成第二图像,包括:
降低所述第一图像中最亮区域和最暗区域的边缘对比度,提高所述第一图像中主体的边缘对比度,并对所述主体的边缘强度进行放大,得到所述第二图像。
上述方案中,所述降低所述第一图像中最亮区域和最暗区域的边缘对比度,提高所述第一图像中主体的边缘对比度,并对所述主体的边缘强度进行放大,得到所述第二图像,包括:
对于所述第一图像分解为红、绿、蓝三基色的分量图像,对所述三基色的分量图像进行对比度处理,合成对比度处理后三基色的分量图像,得到所述第二图像。
上述方案中,所述对所述三基色的分量图像进行对比度处理,包括:
当所述三基色分量图像中的像素值低于预定像素值范围时,更新所述像素的像素值为0;
当所述三基色分量图像中的像素值处于预定像素值范围时,更新所述像素的像素值为0至255之间的值;
当所述三基色分量图像中的像素值高于预定像素值范围时,更新所述像素的像素值为255。
上述方案中,所述生成风格化图像之后,所述方法还包括:
在显示区域显示所述风格化图像。
第二方面,本发明实施例提供一种终端,所述终端包括:
采集单元,配置为采集拍照区域中待处理的第一图像;
边缘处理单元,配置为对所述采集单元采集的所述第一图像进行边缘化处理,生成彩色边缘轮廓图像;
所述深化单元,配置为对经过所述边缘处理单元处理后生成的所述彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;
混合单元,配置为将所述采集单元采集的所述第一图像和经过所述深化单元处理后生成的所述滤镜图像进行图像混合,生成风格化图像。
上述方案中,所述采集单元,还配置为在镜头的成像区域采集到作为摄像或照相的预览的第一图像。
上述方案中,所述第一图像包括所述拍照区域中的特定对象,所述对象包括以下至少之一;人物、建筑和动物。
上述方案中,所述边缘处理单元,还配置为对所述采集单元采集的所述第一图像进行对比度处理,生成第二图像;将所述第二图像进行平滑处理,得到第三图像;以及对所述第二图像和所述第三图像进行色彩差值运算,得到所述彩色边缘轮廓图像。
上述方案中,所述深化单元,配置为根据所述第二图像和所述第三图像,对所述彩色边缘轮廓图像进行边缘和色彩的深化,得到所述滤镜图像。
上述方案中,所述边缘处理单元,还配置为降低所述采集单元采集的所述第一图像中最亮区域和最暗区域的边缘对比度,提高所述第一图像中主体的边缘对比度,并对所述主体的边缘强度进行放大,得到所述第二图像。
上述方案中,所述边缘处理单元,还配置为对于所述第一图像分解为红、绿、蓝三基色的分量图像,对所述三基色的分量图像进行对比度处理,合成对比度处理后三基色的分量图像,得到所述第二图像。
上述方案中,所述边缘处理单元,还配置为当所述三基色分量图像中的像素值低于预定像素值范围时,更新所述像素的像素值为0;
所述边缘处理单元,还配置为当所述三基色分量图像中的像素值处于预定像素值范围时,更新所述像素的像素值为0至255之间的值;
当所述三基色分量图像中的像素值高于预定像素值范围时,更新所述像素的像素值为255。
上述方案中,所述终端还包括:
显示单元,配置为经过所述混合单元处理后生成所述生成风格化图像之后,在显示区域显示所述风格化图像。
第三方面,本发明实施例提供一种终端,包括处理器和存储介质;所 述存储介质中存储有可执行指令,所述可执行指令用于执行上述的图像处理方法。
第四方面,本发明实施例提供一种存储介质,存储有可执行指令,所述可执行指令用于上述的图像处理方法。
本发明实施例提供了一种图像处理方法及终端、存储介质,通过采集拍照区域中待处理的第一图像;对第一图像进行边缘化处理,生成彩色边缘轮廓图像;对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;将第一图像和滤镜图像进行图像混合,生成风格化图像,采用上述技术实现方案,由于终端在进行实时摄像或照相时,可以对拍照区域的未处理的第一图像进行彩色风格化的处理,实现了终端实时自动生成风格化图像的过程,且采用彩色边缘轮廓提取和色彩差异化保持,因此,提高了图像的风格化的效果。
附图说明
图1为实现本发明各个实施例的移动终端的硬件结构示意;
图2为本发明的移动终端能够操作的通信系统;
图3为本发明实施例提供的一种图像处理方法的流程图一;
图4为本发明实施例提供的一种图像处理方法的流程图一;
图5为本发明实施例提供的示例性的图片处理效果示意图一;
图6为本发明实施例提供的示例性的图片处理效果示意图二;
图7为本发明实施例提供的示例性的图片处理效果示意图三;
图8为本发明实施例提供的示例性的图片处理效果示意图四;
图9为本发明实施例提供的示例性的图片处理效果示意图五;
图10为本发明实施例提供的示例性的图片处理效果示意图六;
图11为本发明实施例提供的一种终端的结构示意图一;
图12为本发明实施例提供的一种终端的结构示意图二。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
现在将参考附图描述实现本发明各个实施例的移动终端。在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身并没有特定的意义。因此,“模块”与“部件”可以混合地使用。
需要说明的是,本发明实施例提供的一种焦点获取装置可以为终端,例如计算机或移动终端等可以使用浏览器的电子设备。
其中,移动终端可以以各种形式来实施。例如,本发明中描述的终端可以包括诸如移动电话、智能电话、笔记本电脑、数字广播接收器、个人数字助理(PDA)、平板电脑(PAD)、便携式多媒体播放器(PMP)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。下面,假设终端是移动终端。然而,本领域技术人员将理解的是,除了特别用于移动目的的元件之外,根据本发明的实施方式的构造也能够应用于固定类型的终端。
图1为实现本发明各个实施例的移动终端的硬件结构示意。
移动终端100可以包括无线通信单元110、音频/视频(A/V)输入单元120、用户输入单元130、感测单元140、输出单元150、存储器160、接口单元170、控制器180和电源单元190等等。图1示出了具有各种组件的移动终端,但是应理解的是,并不要求实施所有示出的组件。可以替代地实施更多或更少的组件。将在下面详细描述移动终端的元件。
无线通信单元110通常包括一个或多个组件,其允许移动终端100与无线通信系统或网络之间的无线电通信。例如,无线通信单元可以包括广播接收模块111、移动通信模块112、无线互联网模块113、短程通信模块 114和位置信息模块115中的至少一个。
广播接收模块111经由广播信道从外部广播管理服务器接收广播信号和/或广播相关信息。广播信道可以包括卫星信道和/或地面信道。广播管理服务器可以是生成并发送广播信号和/或广播相关信息的服务器或者接收之前生成的广播信号和/或广播相关信息并且将其发送给终端的服务器。广播信号可以包括TV广播信号、无线电广播信号、数据广播信号等等。而且,广播信号可以进一步包括与TV或无线电广播信号组合的广播信号。广播相关信息也可以经由移动通信网络提供,并且在该情况下,广播相关信息可以由移动通信模块112来接收。广播信号可以以各种形式存在,例如,其可以以数字多媒体广播(DMB)的电子节目指南(EPG)、数字视频广播手持(DVB-H)的电子服务指南(ESG)等等的形式而存在。广播接收模块111可以通过使用各种类型的广播系统接收信号广播。特别地,广播接收模块111可以通过使用诸如多媒体广播-地面(DMB-T)、数字多媒体广播-卫星(DMB-S)、DVB-H、前向链路媒体(MediaFLO@)的数据广播系统、地面数字广播综合服务(ISDB-T)等等的数字广播系统接收数字广播。广播接收模块111可以被构造为适合提供广播信号的各种广播系统以及上述数字广播系统。经由广播接收模块111接收的广播信号和/或广播相关信息可以存储在存储器160(或者其它类型的存储介质)中。
移动通信模块112将无线电信号发送到基站(例如,接入点、节点B等等)、外部终端以及服务器中的至少一个和/或从其接收无线电信号。这样的无线电信号可以包括语音通话信号、视频通话信号、或者根据文本和/或多媒体消息发送和/或接收的各种类型的数据。
无线互联网模块113支持移动终端的无线互联网接入。该模块可以内部或外部地耦接到终端。该模块所涉及的无线互联网接入技术可以包括无线LAN(Wi-Fi)、无线宽带(Wibro)、全球微波互联接入(Wimax)、高速 下行链路分组接入(HSDPA)等等。
短程通信模块114是配置为支持短程通信的模块。短程通信技术的一些示例包括蓝牙TM、射频识别(RFID)、红外数据协会(IrDA)、超宽带(UWB)、紫蜂TM等等。
位置信息模块115是配置为检查或获取移动终端的位置信息的模块。位置信息模块的典型示例是全球定位系统(GPS)模块。根据当前的技术,GPS模块计算来自三个或更多卫星的距离信息和准确的时间信息并且对于计算的信息应用三角测量法,从而根据经度、纬度和高度准确地计算三维当前位置信息。当前,用于计算位置和时间信息的方法使用三颗卫星并且通过使用另外的一颗卫星校正计算出的位置和时间信息的误差。此外,GPS模块能够通过实时地连续计算当前位置信息来计算速度信息。
A/V输入单元120配置为接收音频或视频信号。A/V输入单元120可以包括相机121和麦克风122,相机121对在视频捕获模式或图像捕获模式中由图像捕获装置获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元151上。经相机121处理后的图像帧可以存储在存储器160(或其它存储介质)中或者经由无线通信单元110进行发送,可以根据移动终端的构造提供两个或更多相机121。麦克风122可以在电话通话模式、记录模式、语音识别模式等等运行模式中经由麦克风接收声音(音频数据),并且能够将这样的声音处理为音频数据。处理后的音频(语音)数据可以在电话通话模式的情况下转换为可经由移动通信模块112发送到移动通信基站的格式输出。麦克风122可以实施各种类型的噪声消除(或抑制)算法以消除(或抑制)在接收和发送音频信号的过程中产生的噪声或者干扰。
用户输入单元130可以根据用户输入的命令生成键输入数据以控制移动终端的各种操作。用户输入单元130允许用户输入各种类型的信息,并 且可以包括键盘、锅仔片、触摸板(例如,检测由于被接触而导致的电阻、压力、电容等等的变化的触敏组件)、滚轮、摇杆等等。特别地,当触摸板以层的形式叠加在显示单元151上时,可以形成触摸屏。
感测单元140检测移动终端100的当前状态,(例如,移动终端100的打开或关闭状态)、移动终端100的位置、用户对于移动终端100的接触(即,触摸输入)的有无、移动终端100的取向、移动终端100的加速或减速移动和方向等等,并且生成用于控制移动终端100的操作的命令或信号。例如,当移动终端100实施为滑动型移动电话时,感测单元140可以感测该滑动型电话是打开还是关闭。另外,感测单元140能够检测电源单元190是否提供电力或者接口单元170是否与外部装置耦接。感测单元140可以包括接近传感器141将在下面结合触摸屏来对此进行描述。
接口单元170用作至少一个外部装置与移动终端100连接可以通过的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。识别模块可以是存储用于验证用户使用移动终端100的各种信息并且可以包括用户识别模块(UIM)、客户识别模块(SIM)、通用客户识别模块(USIM)等等。另外,具有识别模块的装置(下面称为“识别装置”)可以采取智能卡的形式,因此,识别装置可以经由端口或其它连接装置与移动终端100连接。接口单元170可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到移动终端100内的一个或多个元件或者可以用于在移动终端和外部装置之间传输数据。
另外,当移动终端100与外部底座连接时,接口单元170可以用作允许通过其将电力从底座提供到移动终端100的路径或者可以用作允许从底座输入的各种命令信号通过其传输到移动终端的路径。从底座输入的各种 命令信号或电力可以用作用于识别移动终端是否准确地安装在底座上的信号。输出单元150被构造为以视觉、音频和/或触觉方式提供输出信号(例如,音频信号、视频信号、警报信号、振动信号等等)。输出单元150可以包括显示单元151、音频输出模块152、警报单元153等等。
显示单元151可以显示在移动终端100中处理的信息。例如,当移动终端100处于电话通话模式时,显示单元151可以显示与通话或其它通信(例如,文本消息收发、多媒体文件下载等等)相关的用户界面(UI)或图形用户界面(GUI)。当移动终端100处于视频通话模式或者图像捕获模式时,显示单元151可以显示捕获的图像和/或接收的图像、示出视频或图像以及相关功能的UI或GUI等等。
同时,当显示单元151和触摸板以层的形式彼此叠加以形成触摸屏时,显示单元151可以用作输入装置和输出装置。显示单元151可以包括液晶显示器(LCD)、薄膜晶体管LCD(TFT-LCD)、有机发光二极管(OLED)显示器、柔性显示器、三维(3D)显示器等等中的至少一种。这些显示器中的一些可以被构造为透明状,以允许用户从外部观看,这可以称为透明显示器,典型的透明显示器可以例如为透明有机发光二极管(TOLED)显示器等等。根据特定想要的实施方式,移动终端100可以包括两个或更多显示单元(或其它显示装置),例如,移动终端可以包括外部显示单元(未示出)和内部显示单元(未示出)。触摸屏可用于检测触摸输入压力以及触摸输入位置和触摸输入面积。
音频输出模块152可以在移动终端处于呼叫信号接收模式、通话模式、记录模式、语音识别模式、广播接收模式等等模式下时,将无线通信单元110接收的或者在存储器160中存储的音频数据转换音频信号并且输出为声音。而且,音频输出模块152可以提供与移动终端100执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出 模块152可以包括扬声器、蜂鸣器等等。
警报单元153可以提供输出以将事件的发生通知给移动终端100。典型的事件可以包括呼叫接收、消息接收、键信号输入、触摸输入等等。除了音频或视频输出之外,警报单元153可以以不同的方式提供输出以通知事件的发生。例如,警报单元153可以以振动的形式提供输出,当接收到呼叫、消息或一些其它进入通信(incoming communication)时,警报单元153可以提供触觉输出(即,振动)以将其通知给用户。通过提供这样的触觉输出,即使在用户的移动电话处于用户的口袋中时,用户也能够识别出各种事件的发生。警报单元153也可以经由显示单元151或音频输出模块152提供通知事件的发生的输出。
存储器160可以存储由控制器180执行的处理和控制操作的软件程序等等,或者可以暂时地存储已经输出或将要输出的数据(例如,电话簿、消息、静态图像、视频等等)。而且,存储器160可以存储关于当触摸施加到触摸屏时输出的各种方式的振动和音频信号的数据。
存储器160可以包括至少一种类型的存储介质,所述存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等等。而且,移动终端100可以与通过网络连接执行存储器160的存储功能的网络存储装置协作。
控制器180通常控制移动终端的总体操作。例如,控制器180执行与语音通话、数据通信、视频通话等等相关的控制和处理。另外,控制器180可以包括用于再现(或回放)多媒体数据的多媒体模块181,多媒体模块181可以构造在控制器180内,或者可以构造为与控制器180分离。控制器180可以执行模式识别处理,以将在触摸屏上执行的手写输入或者图片绘制 输入识别为字符或图像。
电源单元190在控制器180的控制下接收外部电力或内部电力并且提供操作各元件和组件所需的适当的电力。
这里描述的各种实施方式可以以使用例如计算机软件、硬件或其任何组合的计算机可读介质来实施。对于硬件实施,这里描述的实施方式可以通过使用特定用途集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理装置(DSPD)、可编程逻辑装置(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器、被设计为执行这里描述的功能的电子单元中的至少一种来实施,在一些情况下,这样的实施方式可以在控制器180中实施。对于软件实施,诸如过程或功能的实施方式可以与允许执行至少一种功能或操作的单独的软件模块来实施。软件代码可以由以任何适当的编程语言编写的软件应用程序(或程序)来实施,软件代码可以存储在存储器160中并且由控制器180执行。
至此,已经按照其功能描述了移动终端。下面,为了简要起见,将描述诸如折叠型、直板型、摆动型、滑动型移动终端等等的各种类型的移动终端中的滑动型移动终端作为示例。因此,本发明能够应用于任何类型的移动终端,并且不限于滑动型移动终端。
如图1中所示的移动终端100可以被构造为利用经由帧或分组发送数据的诸如有线和无线通信系统以及基于卫星的通信系统来操作。
现在将参考图2描述其中根据本发明的移动终端能够操作的通信系统。
这样的通信系统可以使用不同的空中接口和/或物理层。例如,由通信系统使用的空中接口包括例如频分多址(FDMA)、时分多址(TDMA)、码分多址(CDMA)和通用移动通信系统(UMTS)(特别地,长期演进(LTE))、全球移动通信系统(GSM)等等。作为非限制性示例,下面的描述涉及CDMA通信系统,但是这样的教导同样适用于其它类型的系统。
参考图2,CDMA无线通信系统可以包括多个移动终端100、多个基站(BS)270、基站控制器(BSC)275和移动交换中心(MSC)280。MSC 280被构造为与公共电话交换网络(PSTN)290形成接口。MSC 280还被构造为与可以经由回程线路耦接到BS 270的BSC 275形成接口。回程线路可以根据若干已知的接口中的任一种来构造,所述接口包括例如E1/T1、ATM,IP、PPP、帧中继、HDSL、ADSL或xDSL。将理解的是,如图2中所示的系统可以包括多个BSC 275。
每个BS 270可以服务一个或多个分区(或区域),由多向天线或指向特定方向的天线覆盖的每个分区放射状地远离BS 270。或者,每个分区可以由用于分集接收的两个或更多天线覆盖。每个BS 270可以被构造为支持多个频率分配,并且每个频率分配具有特定频谱(例如,1.25MHz,5MHz等等)。
分区与频率分配的交叉可以被称为CDMA信道。BS 270也可以被称为基站收发器子系统(BTS)或者其它等效术语。在这样的情况下,术语“基站”可以用于笼统地表示单个BSC 275和至少一个BS 270。基站也可以被称为“蜂窝站”。或者,特定BS 270的各分区可以被称为多个蜂窝站。
如图2中所示,广播发射器(BT)295将广播信号发送给在系统内操作的移动终端100。如图1中所示的广播接收模块111被设置在移动终端100处以接收由BT295发送的广播信号。在图2中,示出了几个全球定位系统(GPS)卫星300,卫星300帮助定位多个移动终端100中的至少一个。
在图2中,描绘了多个卫星300,但是理解的是,可以利用任何数目的卫星获得有用的定位信息。作为图1中所示的位置信息模块115的GPS模块通常被构造为与卫星300配合以获得想要的定位信息。替代GPS跟踪技术或者在GPS跟踪技术之外,可以使用可以跟踪移动终端的位置的其它技术。另外,至少一个GPS卫星300可以选择性地或者额外地处理卫星DMB 传输。
作为无线通信系统的一个典型操作,BS 270接收来自各种移动终端100的反向链路信号。移动终端100通常参与通话、消息收发和其它类型的通信。特定BS 270接收的每个反向链路信号被在特定BS 270内进行处理。获得的数据被转发给相关的BSC 275。BSC提供通话资源分配和包括BS 270之间的软切换过程的协调的移动管理功能。BSC 275还将接收到的数据路由到MSC 280,其提供用于与PSTN 290形成接口的额外的路由服务。类似地,PSTN 290与MSC 280形成接口,MSC 280与BSC 275形成接口,并且BSC275相应地控制BS 270以将正向链路信号发送到移动终端100。
基于上述移动终端硬件结构以及通信系统,提出本发明方法各个实施例。
实施例一
本发明实施例提供一种图像处理方法,如图3所示,该方法可以包括:
S101、终端采集拍照区域中待处理的第一图像。
需要说明的是,本发明实施例的应用场景可以是在终端进行摄像或照相的过程中,终端在拍照区域(例如,镜头的成像区域)采集到的待拍摄的图像,即未处理过的第一图像,配置为作为摄像或照相的预览,对这个第一图像进行风格化处理。
在本发明实施例中,终端可以为手机、平板电脑等具有摄像或照相功能的电子设备。
需要说明的是,本发明实施例中实现摄像或照相的即时性风格化功能,可以通过设置好的风格化按钮来实现。以终端为手机为例进行说明,用户在使用手机进行照相时,该手机启动照相功能后,可以启动在手机显示器上设置好的风格化按钮,这样拍出的照片就可以是处理好的风格化图像。
优选地,在本发明实施例中,风格化按钮的设置位置即形状、大小等 基本信息,本发明实施例并不作限制,可以根据实际的需要和喜好进行设计。
例如,终端采集拍照区域中待处理的第一图像,该第一图像可以为终端通过摄像头获取的图像或画面。
需要说明的是,在本发明实施例中的第一图像为彩色图像,本发明实施例的目的是对第一图像进行彩色风格化图像的处理。
可以理解的是,在终端的拍摄的过程中,通过对原始的第一图像做风格化处理,使得终端显现的拍摄风格多样化,于是,提升了用户的体验感。
优选地,终端采集的第一图像中会存在拍照区域中特定的对象如比较重要的物体,即第一图像的主体,或者说是第一图像中想要表达的物体。
可选的,第一图像的主体可以为:人物、建筑、大海、动物等等,本发明实施例并不作限制,而是根据实际拍摄情况来决定的。
S102、终端对第一图像进行边缘化处理,生成彩色边缘轮廓图像。
终端采集拍照区域中待处理的第一图像之后,该终端并不是将拍摄到的第一图像直接显示使用,而是会对该第一图像进行一些处理,达到用户想要的效果,即该终端对该第一图像进行边缘化处理,将第一图像的主体边缘突出,生成或者得到彩色边缘轮廓图像。
需要说明的是,现有的对第一图像的边缘化处理的方法都可以应用到本发明实施例中来,其中,对第一图像的边缘化处理的主要目的是为了将第一图像中的主体的边缘轮廓更好地体现出来。
其中,本发明实施例中可以通过下面的方法对第一图像进行边缘化处理:
(1)、终端对第一图像进行对比度处理,生成第二图像。
(2)、终端将第二图像进行平滑处理,得到第三图像。
(3)、终端对第二图像和第三图像进行色彩差值运算,得到彩色边缘 轮廓图像。
优选地,(1)、(2)和(3)的实现过程和事例将在后续的实施例中进行详细地说明。
S103、终端对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像。
终端对第一图像进行边缘化处理,生成彩色边缘轮廓图像之后,终端就已经处理得到第一图像的彩色边缘轮廓,然后在检测彩色边缘轮廓(例如,使用边缘检测算法)的同时,保留第一图像中的色彩的差异性,即对彩色边缘轮廓图像进行边缘和色彩的深化,最后得到滤镜图像。
例如,终端可以根据第二图像和第三图像,对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像。
需要说明的是,滤镜图像与第一图像相比,第一图像的主体的彩色边缘轮廓更明显,且保留了留第一图像中主体的色彩的差异性,因此,可以轻易检测到第一图像中的主体的影像。
S104、终端将第一图像和滤镜图像进行图像混合,生成风格化图像。
终端对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像之后,该终端可以将第一图像和滤镜图像进行图像混合,生成风格化图像。
需要说明的是,终端生成了滤镜图像,将第一图像与滤镜图像混合,就可以得到想要的风格化第一图像后的图像了。
可以理解的是,本发明实施例中的滤镜图像的生成是风格化模型的形成过程,想要将第一图像风格化,就要将第一图像和风格化模型进行混合来实现。
优选地,在本发明实施例中,对所有图像的处理都是基于R、G、B三基色的通道上进行的处理,将在后续实施例中进行详细的说明。
本发明实施例所提供的一种图像处理方法,通过采集拍照区域中待处 理的第一图像;对第一图像进行边缘化处理,生成彩色边缘轮廓图像;对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;将第一图像和滤镜图像进行图像混合,生成风格化图像,采用上述技术实现方案,由于终端在进行实时摄像或照相时,可以对拍照区域的未处理的第一图像进行彩色风格化的处理,实现了终端实时自动生成风格化图像的过程,且采用彩色边缘轮廓提取和色彩差异化保持,因此,提高了图像的风格化的效果。
实施例二
本发明实施例提供一种图像处理方法,如图4所示,该方法可以包括:
S201、终端采集拍照区域中待处理的第一图像。
需要说明的是,本发明实施例的应用场景可以是在终端进行摄像或照相的过程中,终端在拍照区域(例如,镜头的成像区域)采集到的待拍摄的图像,即未处理过的、预览到的第一图像,对这个第一图像进行风格化处理。
在本发明实施例中,终端可以为手机、平板电脑等具有摄像或照相功能的电子设备。
需要说明的是,本发明实施例中实现摄像或照相的即时性风格化功能,可以通过设置好的风格化按钮来实现。以终端为手机为例进行说明,用户在使用手机进行照相时,该手机启动照相功能后,可以启动在手机显示器上设置好的风格化按钮,这样拍出的照片就可以是处理好的风格化图像。
优选地,在本发明实施例中,风格化按钮的设置位置即形状、大小等基本信息,本发明实施例并不作限制,可以根据实际的需要和喜好进行设计。
例如,终端采集拍照区域中待处理的第一图像,该第一图像可以为终端通过摄像头获取的图像或画面。
需要说明的是,在本发明实施例中的第一图像为彩色图像,本发明实 施例的目的是对第一图像进行彩色风格化图像的处理。
可以理解的是,在终端的拍摄的过程中,通过对原始的第一图像做风格化处理,使得终端显现的拍摄风格多样化,于是,提升了用户的体验感。
优选地,终端采集的第一图像中会存在这个图像中比较重要的物体,即第一图像的主体,或者说是第一图像中想要表达的物体。
可选的,第一图像的主体可以为:人物、建筑、大海、动物等等,本发明实施例并不作限制,而是根据实际拍摄情况来决定的。
S202、终端对第一图像进行对比度处理,生成第二图像。
终端采集拍照区域中待处理的第一图像之后,该终端并不是将拍摄到的第一图像直接显示使用,而是会对该第一图像进行一些处理,达到用户想要的效果,即该终端对该第一图像进行边缘化处理,将第一图像的主体边缘突出,生成或者得到彩色边缘轮廓图像。
需要说明的是,现有的对第一图像的边缘化处理的方法都可以应用到本发明实施例中来,其中,对第一图像的边缘化处理的主要目的是为了将第一图像中的主体的边缘轮廓更好地体现出来。
在本发明实施例中,首先终端对第一图像进行对比度处理,生成第二图像。
例如,终端降低(例如,按照既定幅度降低)第一图像中最亮区域和最暗区域的边缘对比度,提高该第一图像中主体的边缘对比度,并对主体的边缘强度进行放大(例如,按照既定倍数放大),从而生成第二图像。
需要说明的是,终端将第一图像中的颜色相近线条的色调统一,这样就将主体的彩色边缘的对比度体现了出来。
在本发明实施例中,对所有图像的处理都是基于R、G、B三基色的通道上分别进行的处理,对第一图像进行对比度处理时,将第一图像分解为三基色的分量图像,对三基色的分量图像的对比度进行处理,合并处理后 三基色分量图像得到第二图像。
例如,终端对第一图像进行对比度调整,得到第二图像本发明中对比度的调整采用公式(1):
Figure PCTCN2016101934-appb-000001
其中,I1为第一图像中像素点对应的R、G、B任意颜色通道的像素值;I2为第二图像中像素点对应R、G、B任意颜色通道的像素值;TL为第一图像的像素最低阈值;TH为第一图像的像素最高阈值;k为变换系数;TL、TH以及k的值可根据时间需要进行设置,本发明实施例不作限制。
可选的,k=2.0,TL=64,TH=192。
可选的,R、G、B像素值的取值范围为0-255。
S203、终端将第二图像进行平滑处理,得到第三图像。
终端对第一图像进行对比度处理,生成第二图像之后,该终端将第二图像进行平滑处理,得到第三图像。
需要说明的是,这个步骤主要是对提高对比度后的第二图像进行平滑降噪的作用,去除掉杂乱的彩色边缘。
例如,终端可以对第二图像进行高斯滤波,得到第三图像,可以通过现有的高斯滤波的技术对本发明实施例进行处理,故在此不再敖述。
S204、终端对第二图像和第三图像进行色彩差值运算,得到彩色边缘轮廓图像。
终端将第二图像进行平滑处理,得到第三图像之后,该终端可以对第二图像和第三图像进行色彩插值运算,获取彩色边缘轮廓信息,得到彩色边缘轮廓图像。
例如,第二图像与第三图像进行差值运算,获取得到轮廓的彩色边缘 轮廓图像,可以根据如下公式(2)进行处理:
I4=abs(I2-I3)         (2)
其中,I4为彩色边缘轮廓图像的R、G、B像素值;将I3表示为第三图像的R、G、B像素值。
S205、终端根据第二图像和第三图像,对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像。
终端得到彩色边缘轮廓图像之后,该终端可以根据第二图像和第三图像,对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像。
例如,根据如下公式(3)对彩色边缘轮廓图像进行调整计算边缘,得到滤镜图像:
I5=255*I2/(I3+I4)          (3)
其中,I5为滤镜图像的R、G、B像素值。
需要说明的是,终端对第一图像进行边缘化处理,生成彩色边缘轮廓图像之后,终端就已经将第一图像的彩色边缘轮廓处理得到了,然后在获取彩色边缘轮廓的同时,保留第一图像中的色彩的差异性,即对彩色边缘轮廓图像进行边缘和色彩的深化,最后得到滤镜图像。其中,滤镜图像与第一图像相比,第一图像的主体的彩色边缘轮廓更明显,且保留了留第一图像中主体的色彩的差异性,因此,可以明显地看出第一图像中的主体的影像了。
S206、终端将第一图像和滤镜图像进行图像混合,生成风格化图像。
终端生成滤镜图像之后,该终端可以将第一图像和滤镜图像进行图像混合,生成风格化图像。
需要说明的是,终端生成了滤镜图像,将第一图像与滤镜图像混合,就可以得到想要的风格化第一图像后的图像了。
例如,本发明中,滤镜图像与第一图像进行混合可以根据如下的公式 (4):
I6=255-I1*I5/255          (4)
其中,I6为风格化图像的R、G、B像素值。
可以理解的是,本发明实施例中的滤镜图像的生成是风格化模型的形成过程,想要将第一图像风格化,就要将第一图像和风格化模型进行混合来实现。
S207、终端在显示区域显示所述风格化图像。
终端生成风格化图像之后,该终端会在显示区域内显示处理好的风格化图像。
可以理解的是,终端在风格化模式下,进行拍摄时,直接显示的是处理好的风格化图像,因此,终端可以实时地进行风格化图像的获取。
下面通过一个例子来说明本发明实施例提供的图像处理方法。
假设使用手机进行拍照,在该手机的预览区域(显示屏)看到的是一栋建筑的风景画,如图5所示,图5为本发明实施例中的第一图像,经过对比度处理后,生成图6所示的第二图像,该手机将第二图像进行平滑处理,得到如图7所示的第三图像,以及该手机对第二图像和第三图像进行色彩差值运算,得到如图8所示的彩色边缘轮廓图像,然后,手机根据第二图像和第三图像,对彩色边缘轮廓图像进行边缘和色彩的深化,生成如图9所示的滤镜图像,最后,手机将第一图像和滤镜图像进行图像混合,生成如图10所示风格化图像,并将该风格化图像在显示屏上显示出来。
需要说明的是,根据专利撰写的附图要求,本发明实施例中的图5、图6、图7、图8、图9和图10都是去色之后的图片。但是,采用本发明实施例提供的图像处理方法是对彩色图像的处理,处理的结果也是彩色的。
本发明实施例所提供的一种图像处理方法,通过采集拍照区域中待处理的第一图像;对第一图像进行边缘化处理,生成彩色边缘轮廓图像;对 彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;将第一图像和滤镜图像进行图像混合,生成风格化图像,采用上述技术实现方案,由于终端在进行实时摄像或照相时,可以对拍照区域的未处理的第一图像进行彩色风格化的处理,实现了终端实时自动生成风格化图像的过程,且采用彩色边缘轮廓提取和色彩差异化保持,因此,提高了图像的风格化的效果。
实施例三
如图11所示,本发明实施例提供了一种终端1,该终端1可以包括:
采集单元10,配置为采集拍照区域中待处理的第一图像。
边缘处理单元11,配置为对所述采集单元10采集的所述第一图像进行边缘化处理,生成彩色边缘轮廓图像。
所述深化单元12,配置为对经过所述边缘处理单元11处理后生成的所述彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像。
混合单元13,配置为将所述采集单元10采集的所述第一图像和经过所述深化单元12处理后生成的所述滤镜图像进行图像混合,生成风格化图像。
可选的,所述采集单元10,还配置为在镜头的成像区域采集到作为摄像或照相的预览的第一图像。
可选的,所述边缘处理单元11,还配置为对所述采集单元10采集的所述第一图像进行对比度处理,生成第二图像;将所述第二图像进行平滑处理,得到第三图像;以及对所述第二图像和所述第三图像进行色彩差值运算,得到所述彩色边缘轮廓图像。
可选的,所述边缘处理单元11,还配置为降低所述采集单元10采集的所述第一图像中最亮区域和最暗区域的边缘对比度,提高所述第一图像中主体的边缘对比度,并对所述主体的边缘强度进行放大,从而生成所述第二图像。
可选的,所述深化单元12,还配置为根据经过所述边缘处理单元11处 理后生成的所述第二图像和所述第三图像,对所述彩色边缘轮廓图像进行边缘和色彩的深化,生成所述滤镜图像。
所述边缘处理单元11,还配置为对于所述第一图像分解为红、绿、蓝三基色的分量图像,对所述三基色的分量图像进行对比度处理,合成对比度处理后三基色的分量图像,得到所述第二图像。例如,
当所述三基色分量图像中的像素值低于预定像素值范围时,更新所述像素的像素值为0;
当所述三基色分量图像中的像素值处于预定像素值范围时,更新所述像素的像素值为0至255之间的值;
当所述三基色分量图像中的像素值高于预定像素值范围时,更新所述像素的像素值为255。
可选的,如图12所示,所述终端1还包括:显示单元14。
所述显示单元14,配置为经过所述混合单元13处理后生成所述生成风格化图像之后,在显示区域显示所述风格化图像。
可选的,本发明实施例中的终端可以为终端可以为手机、平板电脑等具有摄像或照相功能的电子设备。
在实际应用中,上述采集单元10、边缘处理单元11、深化单元12以及混合单元13可由位于终端1上的处理器实现,具体为中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)或现场可编程门阵列(FPGA)等实现,显示单元14可以由光传感器实现,终端1中还可以包括存储器,例如,第一图像及其软件代码、第二图像及其软件代码、第三图像及其软件代码、彩色边缘轮廓图像及其软件代码、滤镜图像及其软件代码,以及风格化图像及其软件代码可以保存在存储器中,该存储器、光传感器器均可以通过系统总线与处理器连接,其中,存储器用于存储可执行程序代码,该程序代码包括计算机操作指令,存储器可能包含高速RAM存储器,也可 能还包括非易失性存储器,例如,至少一个磁盘存储器。
本发明实施例所提供的终端,通过采集拍照区域中待处理的第一图像;对第一图像进行边缘化处理,生成彩色边缘轮廓图像;对彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;将第一图像和滤镜图像进行图像混合,生成风格化图像,采用上述技术实现方案,由于终端在进行实时摄像或照相时,可以对拍照区域的未处理的第一图像进行彩色风格化的处理,实现了终端实时自动生成风格化图像的过程,且采用彩色边缘轮廓提取和色彩差异化保持,因此,提高了图像的风格化的效果。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。

Claims (20)

  1. 一种图像处理方法,所述图像处理方法包括:
    采集拍照区域中待处理的第一图像;
    对所述第一图像进行边缘化处理,生成彩色边缘轮廓图像;
    对所述彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;
    将所述第一图像和所述滤镜图像进行图像混合,生成风格化图像。
  2. 根据权利要求1所述的图像处理方法,其中,所述采集拍照区域中待处理的第一图像,包括:
    在镜头的成像区域采集到作为摄像或照相的预览的第一图像。
  3. 根据权利要求1所述的图像处理方法,其中,
    所述第一图像包括所述拍照区域中的特定对象,所述对象包括以下至少之一;人物、建筑和动物。
  4. 根据权利要求1所述的图像处理方法,其中,所述对所述第一图像进行边缘化处理,生成边缘轮廓图像,包括:
    对所述第一图像进行对比度处理,生成第二图像;
    将所述第二图像进行平滑处理,得到第三图像;
    对所述第二图像和所述第三图像进行色彩差值运算,得到所述彩色边缘轮廓图像。
  5. 根据权利要求4所述的图像处理方法,其中,所述对所述彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像,包括:
    根据所述第二图像和所述第三图像,对所述彩色边缘轮廓图像进行边缘和色彩的深化,得到所述滤镜图像。
  6. 根据权利要求4所述的图像处理方法,其中,所述对所述第一图像进行对比度处理,生成第二图像,包括:
    降低所述第一图像中最亮区域和最暗区域的边缘对比度,提高所述第 一图像中主体的边缘对比度,并对所述主体的边缘强度进行放大,得到所述第二图像。
  7. 根据权利要求6所述的图像处理方法,其中,所述降低所述第一图像中最亮区域和最暗区域的边缘对比度,提高所述第一图像中主体的边缘对比度,并对所述主体的边缘强度进行放大,得到所述第二图像,包括:
    对于所述第一图像分解为红、绿、蓝三基色的分量图像,对所述三基色的分量图像进行对比度处理,合成对比度处理后三基色的分量图像,得到所述第二图像。
  8. 根据权利要求7所述的图像处理方法,其中,所述对所述三基色的分量图像进行对比度处理,包括:
    当所述三基色分量图像中的像素值低于预定像素值范围时,更新所述像素的像素值为0;
    当所述三基色分量图像中的像素值处于预定像素值范围时,更新所述像素的像素值为0至255之间的值;
    当所述三基色分量图像中的像素值高于预定像素值范围时,更新所述像素的像素值为255。
  9. 根据权利要求1所述的图像处理方法,其中,所述生成风格化图像之后,所述方法还包括:
    在显示区域显示所述风格化图像。
  10. 一种终端,所述终端包括:
    采集单元,配置为采集拍照区域中待处理的第一图像;
    边缘处理单元,配置为对所述采集单元采集的所述第一图像进行边缘化处理,生成彩色边缘轮廓图像;
    所述深化单元,配置为对经过所述边缘处理单元处理后生成的所述彩色边缘轮廓图像进行边缘和色彩的深化,生成滤镜图像;
    混合单元,配置为将所述采集单元采集的所述第一图像和经过所述深化单元处理后生成的所述滤镜图像进行图像混合,生成风格化图像。
  11. 根据权利要求10所述的终端,其中,
    所述采集单元,还配置为在镜头的成像区域采集到作为摄像或照相的预览的第一图像。
  12. 根据权利要求10所述的终端,其中,
    所述第一图像包括所述拍照区域中的特定对象,所述对象包括以下至少之一;人物、建筑和动物。
  13. 根据权利要求10所述的终端,其中,
    所述边缘处理单元,还配置为对所述采集单元采集的所述第一图像进行对比度处理,生成第二图像;将所述第二图像进行平滑处理,得到第三图像;以及对所述第二图像和所述第三图像进行色彩差值运算,得到所述彩色边缘轮廓图像。
  14. 根据权利要求13所述的终端,其中,
    所述深化单元,配置为根据所述第二图像和所述第三图像,对所述彩色边缘轮廓图像进行边缘和色彩的深化,得到所述滤镜图像。
  15. 根据权利要求13所述的终端,其中,
    所述边缘处理单元,还配置为降低所述采集单元采集的所述第一图像中最亮区域和最暗区域的边缘对比度,提高所述第一图像中主体的边缘对比度,并对所述主体的边缘强度进行放大,得到所述第二图像。
  16. 根据权利要求15所述的终端,其中,
    所述边缘处理单元,还配置为对于所述第一图像分解为红、绿、蓝三基色的分量图像,对所述三基色的分量图像进行对比度处理,合成对比度处理后三基色的分量图像,得到所述第二图像。
  17. 根据权利要求16所述的终端,其中,
    所述边缘处理单元,还配置为当所述三基色分量图像中的像素值低于预定像素值范围时,更新所述像素的像素值为0;
    所述边缘处理单元,还配置为当所述三基色分量图像中的像素值处于预定像素值范围时,更新所述像素的像素值为0至255之间的值;
    当所述三基色分量图像中的像素值高于预定像素值范围时,更新所述像素的像素值为255。
  18. 根据权利要求10所述的终端,其中,所述终端还包括:
    所述显示单元,配置为经过所述混合单元处理后生成所述生成风格化图像之后,在显示区域显示所述风格化图像。
  19. 一种终端,包括处理器和存储介质;所述存储介质中存储有可执行指令,所述可执行指令用于执行权利要求1至9任一项所述的图像处理方法。
  20. 一种存储介质,存储有可执行指令,所述可执行指令用于执行权利要求1至9任一项所述的图像处理方法。
PCT/CN2016/101934 2015-10-29 2016-10-12 一种图像处理方法及终端、存储介质 WO2017071475A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510716450.5A CN105227865B (zh) 2015-10-29 2015-10-29 一种图像处理方法及终端
CN201510716450.5 2015-10-29

Publications (1)

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

Family

ID=54996514

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/101934 WO2017071475A1 (zh) 2015-10-29 2016-10-12 一种图像处理方法及终端、存储介质

Country Status (2)

Country Link
CN (1) CN105227865B (zh)
WO (1) WO2017071475A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227865B (zh) * 2015-10-29 2019-04-26 努比亚技术有限公司 一种图像处理方法及终端
CN106341610A (zh) * 2016-11-25 2017-01-18 广东欧珀移动通信有限公司 拍照方法及移动终端
CN107122108B (zh) * 2017-04-27 2020-10-16 腾讯科技(深圳)有限公司 一种图片编辑方法及装置
CN107590792B (zh) * 2017-09-30 2020-09-01 努比亚技术有限公司 呈现gnd滤镜分界线的方法、设备及计算机可存储介质
CN107784629B (zh) * 2017-11-24 2021-10-15 努比亚技术有限公司 全景照片滤镜处理方法及移动终端
CN108108696B (zh) * 2017-12-22 2020-11-20 歌尔科技有限公司 一种安全防护方法、装置及系统
CN110827191A (zh) * 2018-08-08 2020-02-21 Oppo广东移动通信有限公司 图像处理方法和装置、存储介质、电子设备
CN110956679B (zh) * 2018-09-26 2023-07-14 Oppo广东移动通信有限公司 图像处理方法和装置、电子设备、计算机可读存储介质
CN111028137B (zh) * 2018-10-10 2023-08-15 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备和计算机可读存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009005273A (ja) * 2007-06-25 2009-01-08 Fujifilm Corp 撮像装置、画像処理装置、撮像方法、及び画像処理方法
CN102663766A (zh) * 2012-05-04 2012-09-12 云南大学 一种基于非真实感的艺术插画效果绘制方法
CN103021002A (zh) * 2011-09-27 2013-04-03 康佳集团股份有限公司 彩色素描图像生成方法
CN103093417A (zh) * 2013-01-30 2013-05-08 深圳深讯和科技有限公司 生成水彩画风格图像的方法及装置
CN103093437A (zh) * 2013-01-30 2013-05-08 深圳深讯和科技有限公司 生成铅笔画风格图像的方法及装置
CN103455974A (zh) * 2013-05-24 2013-12-18 厦门美图网科技有限公司 一种图像素描风格化的处理方法
CN103778655A (zh) * 2014-01-28 2014-05-07 西安理工大学 一种基于自适应水墨扩散的彩色自然图像计算艺术化方法
CN103914863A (zh) * 2014-03-10 2014-07-09 西藏民族学院 一种彩色图像抽象化绘制方法
CN105227865A (zh) * 2015-10-29 2016-01-06 努比亚技术有限公司 一种图像处理方法及终端

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101540055B (zh) * 2009-04-13 2011-05-04 浙江大学 面向在线实时应用的卡通风格化方法
CN102074025B (zh) * 2009-11-23 2013-01-23 中国移动通信集团公司 一种图像风格化绘制方法及装置
CN102013107B (zh) * 2010-09-06 2013-12-18 浙江大学 一种基于非线性滤波的选择性图像风格化方法
CN102663806B (zh) * 2012-03-02 2014-12-10 西安交通大学 基于艺术视觉的图像卡通风格化渲染方法

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009005273A (ja) * 2007-06-25 2009-01-08 Fujifilm Corp 撮像装置、画像処理装置、撮像方法、及び画像処理方法
CN103021002A (zh) * 2011-09-27 2013-04-03 康佳集团股份有限公司 彩色素描图像生成方法
CN102663766A (zh) * 2012-05-04 2012-09-12 云南大学 一种基于非真实感的艺术插画效果绘制方法
CN103093417A (zh) * 2013-01-30 2013-05-08 深圳深讯和科技有限公司 生成水彩画风格图像的方法及装置
CN103093437A (zh) * 2013-01-30 2013-05-08 深圳深讯和科技有限公司 生成铅笔画风格图像的方法及装置
CN103455974A (zh) * 2013-05-24 2013-12-18 厦门美图网科技有限公司 一种图像素描风格化的处理方法
CN103778655A (zh) * 2014-01-28 2014-05-07 西安理工大学 一种基于自适应水墨扩散的彩色自然图像计算艺术化方法
CN103914863A (zh) * 2014-03-10 2014-07-09 西藏民族学院 一种彩色图像抽象化绘制方法
CN105227865A (zh) * 2015-10-29 2016-01-06 努比亚技术有限公司 一种图像处理方法及终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU, YOUQUAN ET AL.: "Line Enhanced Image Abstraction for Building Images", JOURNAL OF COMPUTER-AIDED DESIGN & COMPUTER GRAPHICS, vol. 25, no. 9, 30 September 2013 (2013-09-30) *

Also Published As

Publication number Publication date
CN105227865B (zh) 2019-04-26
CN105227865A (zh) 2016-01-06

Similar Documents

Publication Publication Date Title
WO2017071475A1 (zh) 一种图像处理方法及终端、存储介质
WO2017050115A1 (zh) 一种图像合成方法和装置
CN106454121B (zh) 双摄像头拍照方法及装置
WO2018019124A1 (zh) 一种图像处理方法及电子设备、存储介质
WO2017067526A1 (zh) 图像增强方法及移动终端
WO2017045650A1 (zh) 一种图片处理方法及终端
WO2018076935A1 (zh) 图像虚化处理方法、装置、移动终端和计算机存储介质
US8780258B2 (en) Mobile terminal and method for generating an out-of-focus image
CN106909274B (zh) 一种图像显示方法和装置
WO2017071476A1 (zh) 一种图像合成方法和装置、存储介质
WO2017016511A1 (zh) 一种图像处理方法及装置、终端
WO2016180325A1 (zh) 图像处理方法及装置
WO2017020836A1 (zh) 一种虚化处理深度图像的装置和方法
WO2018076938A1 (zh) 图像处理装置及方法和计算机存储介质
WO2017071542A1 (zh) 图像处理方法及装置
WO2018019128A1 (zh) 一种夜景图像的处理方法和移动终端
WO2017045647A1 (zh) 一种处理图像的移动终端和方法
CN106534619A (zh) 一种调整对焦区域的方法、装置和终端
WO2017067523A1 (zh) 图像处理方法、装置及移动终端
WO2017041714A1 (zh) 一种获取rgb数据的方法和装置
WO2017071469A1 (zh) 一种移动终端和图像拍摄方法、计算机存储介质
CN106851125B (zh) 一种移动终端及多重曝光拍摄方法
CN106911881B (zh) 一种基于双摄像头的动态照片拍摄装置、方法和终端
WO2017071532A1 (zh) 一种自拍合影的方法和装置
CN105959551A (zh) 一种拍摄装置及方法、移动终端

Legal Events

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

Ref document number: 16858911

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16858911

Country of ref document: EP

Kind code of ref document: A1