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

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

Info

Publication number
CN107948530B
CN107948530B CN201711464646.5A CN201711464646A CN107948530B CN 107948530 B CN107948530 B CN 107948530B CN 201711464646 A CN201711464646 A CN 201711464646A CN 107948530 B CN107948530 B CN 107948530B
Authority
CN
China
Prior art keywords
filter
area
image
determining
touch operation
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201711464646.5A
Other languages
Chinese (zh)
Other versions
CN107948530A (en
Inventor
樊聿聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201711464646.5A priority Critical patent/CN107948530B/en
Publication of CN107948530A publication Critical patent/CN107948530A/en
Application granted granted Critical
Publication of CN107948530B publication Critical patent/CN107948530B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces

Landscapes

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

Abstract

The embodiment of the invention discloses an image processing method, wherein the method comprises the following steps: determining first position information of a first area in a preview image and a first filter parameter adopted by the first area; acquiring a filter parameter set adopted during filter processing, wherein the filter parameter set comprises the first filter parameter; when a shooting instruction is received, filter processing is respectively carried out on the preview images by using filter parameters in the filter parameter set to obtain at least two corresponding frames of images; and performing superposition processing on the at least two frames of images according to the first position information and the first filter parameter to obtain a target image. The embodiment of the invention also discloses a terminal and a computer readable storage medium. By implementing the scheme, the pictures with different filter effects can be obtained by taking pictures once, and the operation process is extremely simple and convenient, so that the image processing efficiency is improved.

Description

Image processing method, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of terminal technologies, and in particular, to an image processing method, a terminal, and a computer-readable storage medium.
Background
With the development of mobile communication technology, especially the popularization and application of mobile networks and intelligent terminals, the field of mobile internet is developed rapidly. At present, the function of the intelligent terminal is not simply used for meeting the mutual contact of people, and is an important mobile personal entertainment terminal in daily life.
Nowadays, the photographing function becomes an indispensable function of the intelligent terminal, and people can record wonderful moments anytime and anywhere. In order to meet the requirement of a user on the diversification of the shot pictures, a filter effect is added in the shooting function of the mobile terminal, so that the user can select different shooting effects when shooting. In practical applications, the filter effect can be many kinds, such as black and white, tone, fading, nostalgic, time-of-year, stamp, etc. When the mobile terminal is used for photographing, one filter effect can be selected in advance, and when photographing is completed, a photographed picture corresponding to the filter effect can be generated.
However, in the existing mobile terminal photographing process, only one picture with one filter effect can be obtained in one photographing process, if a picture with different filter effects is to be obtained, multiple photographing processes or processing of auxiliary third-party software need to be executed to obtain the picture, and the operation process is complicated and the processing efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention are expected to provide an image processing method, a terminal, and a computer-readable storage medium, so as to solve the technical problem that multiple times of shooting or third-party software is required to obtain pictures with different filter effects simultaneously in the prior art, obtain pictures with different filter effects simultaneously through one-time shooting, and improve image processing efficiency due to a very simple operation process.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides an image processing method, where the method includes:
determining first position information of a first area in a preview image and a first filter parameter adopted by the first area;
acquiring a filter parameter set adopted during filter processing, wherein the filter parameter set at least comprises the first filter parameter;
when a shooting instruction is received, filter processing is respectively carried out on the preview images by using filter parameters in the filter parameter set to obtain at least two corresponding frames of images;
and performing superposition processing on the at least two frames of images according to the first position information and the first filter parameter to obtain a target image.
In a second aspect, an embodiment of the present invention provides a terminal, where the terminal at least includes: a memory, a communication bus, and a processor, wherein:
the memory is used for storing an image processing program;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the image processing program stored in the memory so as to realize the following steps:
determining first position information of a first area in a preview image and a first filter parameter adopted by the first area;
acquiring a filter parameter set adopted during filter processing, wherein the filter parameter set at least comprises the first filter parameter;
when a shooting instruction is received, filter processing is respectively carried out on the preview images by using filter parameters in the filter parameter set to obtain at least two corresponding frames of images;
and performing superposition processing on the at least two frames of images according to the first position information and the first filter parameter to obtain a target image.
In a third aspect, the present invention provides a computer-readable storage medium, on which an image processing program is stored, and when the image processing program is executed by a processor, the image processing program implements the steps of the image processing method as described above.
The embodiment of the invention provides an image processing method, a terminal and a computer readable storage medium, wherein first position information of a first area in a preview image and a first filter parameter adopted by the first area are determined; then acquiring a filter parameter set adopted during filter processing, wherein the filter parameter set comprises the first filter parameter; when a shooting instruction is received, filter processing is respectively carried out on the preview images by using filter parameters in the filter parameter set to obtain at least two corresponding frames of images; and finally, overlapping the at least two frames of images according to the first position information and the first filter parameter to obtain a target image. Therefore, pictures with different filter effects can be obtained through one-time photographing, the operation process is extremely simple and convenient, and the image processing efficiency is improved.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention;
fig. 2 is a diagram of a communication network system architecture according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an implementation flow of an image processing method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart illustrating an implementation of an image processing method according to an embodiment of the present invention;
FIG. 5 is a schematic interface diagram of a preview image according to an embodiment of the present invention;
FIG. 6 is a schematic interface diagram of a first filter image corresponding to a first filter parameter according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of an interface of a second filter image corresponding to a second filter parameter according to an embodiment of the present disclosure;
FIG. 8 is a schematic interface diagram of a target image with two filter effects according to an embodiment of the present invention;
FIG. 9 is a schematic interface diagram of a target image with three filter effects according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the Radio Frequency unit 101 may be configured to receive and transmit signals during a message transmission or call, specifically, receive downlink information of a base station and then process the received downlink information to the processor 110, and transmit uplink data to the base station, in General, the Radio Frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like, and in addition, the Radio Frequency unit 101 may further communicate with a network and other devices through wireless communication, and the wireless communication may use any communication standard or protocol, including, but not limited to, GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access ), TD-SCDMA (Synchronous Time Division Multiple Access, Code Division Multiple Access, Time Division Multiple Access, etc., TDD — Time Division Multiple Access, L Time Division Multiple Access, etc.
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a liquid Crystal Display (L acquired Crystal Display, L CD), an Organic light-Emitting Diode (O L ED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, the communication Network system is L TE system of universal mobile telecommunications technology, and the L TE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and charging functions Entity) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although L TE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to L TE system, but also applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
An embodiment of the present invention provides an image processing method, and fig. 3 is a schematic diagram illustrating an implementation flow of the image processing method provided in the embodiment of the present invention, as shown in fig. 3, the method includes the following steps:
step S301, determining first position information of a first area in a preview image and a first filter parameter adopted by the first area;
here, the step S301 may be implemented by a terminal, and further, the terminal may be a mobile terminal, for example, a mobile terminal with a wireless communication capability, such as a mobile phone (mobile phone) with a touch function, a Personal Digital Assistant (PDA), a tablet computer, a notebook computer, and the like, and the mobile terminal includes at least one camera, and may also include more than one camera. When the mobile terminal includes at least two cameras, the at least two cameras may be disposed at one side of the mobile terminal or at both sides. For example, the front side of the mobile terminal, that is, the plane on which the display screen of the mobile terminal is located, may be provided with at least one camera, and the back side of the mobile terminal, that is, the opposite side to the plane on which the display screen of the mobile terminal is located, may also be provided with at least one camera.
In this embodiment, the type of the camera is not limited, and the camera may be a standard camera, or may be a wide-angle camera, a telephoto camera, a black-and-white camera, and the like, and when there are at least two cameras on one side of the terminal, the at least two cameras may be the same camera or different cameras. For example, the at least two cameras may both be standard cameras, or one of the at least two cameras on the back side of the terminal may be a standard camera and the others are not standard cameras.
The preview image refers to an image acquired after the focusing of the user is finished. In this embodiment, the shape of the first area is not limited, and the first area may be a triangle, a rectangle, a square, a circle, or even a pentagram. The first location information of the first area is used to represent location information of the first area in the preview image, and when the first area is a triangle or a polygon, the first location information may be coordinate information of a vertex of the first area on a screen corresponding to the terminal. For example, when the first region is a square, the first position information may be coordinate information of four vertices of the square. When the first region is a circle, the first position information may include coordinate information of a center of the circle and a radius.
A filter is a special image effect processing technique. In general, the filters perform calculations and transformations on the attributes of the pixels in the image, such as color, brightness, saturation, contrast, hue, distribution, arrangement, etc., following a certain program algorithm, resulting in special effects on the image. In general, different filter effects can be brought by adopting different filter parameters, and it can be considered that different filter effects correspond to different filter parameters. The first filter parameter is determined according to the filter effect selected by the user, and the first filter parameter may be a filter parameter corresponding to a black-and-white filter effect, may be a filter parameter corresponding to a sketch filter effect, and the like.
In this embodiment, the first region may be one, two or more, and when more than one first region is included, the first filter parameters of the respective first regions may be the same or different. That is, when there are N first regions, there may be M first filter parameters, where N is a natural number greater than or equal to 1, and M is a natural number less than or equal to N.
Step S302, filter parameters adopted when the preview image is subjected to filter processing are obtained.
Here, the step S302 may be implemented by a terminal. The filter parameters at least comprise the first filter parameters.
It should be noted that, in this embodiment and other embodiments, an area excluding the first area in the preview image is referred to as a background area, and when the background area is not subjected to filter processing, the filter parameters only include the first filter parameter; if the background area needs to be subjected to filter processing, the filter parameters not only include first filter parameters, but also include second filter parameters, wherein the second filter parameters are filter parameters adopted when the background area is subjected to filter processing.
Suppose there are N first regions and M first filter parameters, where N is a natural number greater than or equal to 1, M is a natural number less than or equal to N when one first region corresponds to only one first filter parameter, and M is not necessarily less than N when one first region corresponds to two or more first filter parameters.
And step S303, when a shooting instruction is received, respectively carrying out filter processing on the preview image by using filter parameters in the filter parameter set to obtain at least two corresponding frames of images.
Here, the step S303 may be implemented by a terminal. The set of filter parameters includes at least one first filter parameter. In this embodiment, if the filter parameter set includes only one first filter parameter and does not include a second filter parameter, two frames of images need to be continuously captured, where one frame of image is a preview image without filter processing, that is, a background image in other embodiments, and the other frame of image is a first filter image obtained by performing filter processing on the preview image according to the first filter parameter.
If the filter parameter set comprises two first filter parameters and one second filter parameter, three frames of images need to be continuously shot, wherein one frame of image is a second filter image obtained by performing filter processing on the preview image according to the second filter parameter, namely a background image in other embodiments, and the two frames of images are two frames of first filter images obtained by performing filter processing on the preview image according to the two first filter parameters respectively.
And step S304, performing superposition processing on the at least two frames of images according to the first position information and the first filter parameter to obtain a target image.
Here, the step S304 may be implemented by a terminal. The at least two frames of images are superposed according to the first position information and the first filter parameter, in the actual implementation process, the first filter image corresponding to the first filter parameter can be subjected to image matting, the corresponding first image area is extracted according to the first position information, then the background image is subjected to image matting, the image area corresponding to the first position information is replaced by the first image area from the background image, therefore, an image with partial filter effect can be obtained in one shooting process, and when a plurality of first areas exist, different filter parameters can be adopted for different first areas, so that different filter effects are achieved, and images with different filter effects can be obtained in one shooting process.
In an image processing method provided by an embodiment of the present invention, first position information of a first area in a preview image and a first filter parameter adopted by the first area are determined; then acquiring a filter parameter set adopted during filter processing, wherein the filter parameter set comprises the first filter parameter; when a shooting instruction is received, respectively utilizing the filter parameter sets to carry out filter processing on the preview image to obtain at least two corresponding frames of images; and finally, overlapping the at least two frames of images according to the first position information and the first filter parameter to obtain a target image. Therefore, pictures with different filter effects can be obtained through one-time photographing, the operation process is extremely simple and convenient, and the image processing efficiency is improved.
Based on the foregoing embodiments, an embodiment of the present invention further provides an image processing method, and fig. 4 is a schematic flow chart illustrating an implementation of the image processing method according to the embodiment of the present invention, as shown in fig. 4, the method includes the following steps:
in step S401, the terminal obtains an operation instruction sent by the user to start the camera application.
Here, in the present embodiment, the user may start the camera application in various ways, for example: the camera application can be started by clicking a camera application icon of the terminal, and can also be realized by pressing a touch operation area on the side of the terminal, namely, the terminal acquires an operation instruction of starting the camera application by a user, and the operation instruction comprises the following steps: the method comprises the steps of obtaining touch operation received by a preset touch operation area on the side edge of a terminal, and determining a control instruction corresponding to the touch operation; and when the control instruction is to start the camera application, starting the camera application. In addition, the camera application can be started through voice, gestures and the like. The above listed trigger modes for starting the camera application are only exemplary, and those skilled in the art can utilize the technical idea of the present invention, and other trigger modes for starting the camera application according to their specific requirements are within the protection scope of the present invention, and are not exhaustive here.
And S402, starting a camera by the terminal based on the operation instruction, and controlling the camera to acquire a preview image.
It should be noted that the preview image is an image acquired after focusing is completed, wherein the preview image may be acquired through automatic focusing after a terminal starts a camera, or acquired after focusing is completed according to a touch operation performed by a user.
In step S403, the terminal determines whether a first touch operation for determining the first area is received.
Here, the first region may be a region where filter processing is performed in the preview image. The touch operation is set in advance by a developer of the image processing method provided by the embodiment, and can also be set by a user according to the operation habit of the user. The touch operation may be a pressing operation or a sliding operation forming a closed area, for example, a user makes a circle on the screen.
If a first touch operation for determining the first area is received, entering step S404; if the first touch operation is not determined to be received, the process proceeds to step S405.
Step S404, the terminal determines the first area according to the first touch operation, and acquires position information of the first area.
Here, determining the first area according to the first touch operation may be implemented by:
step S4041, acquiring second position information of the first touch operation;
here, when the first touch operation is a press operation, the second position information may be coordinate information on a screen on which the press operation is performed; when the first touch operation is a sliding operation forming a closed area, the second position information may be track position information applied to the screen by the sliding operation.
Step S4042, determining a second area according to the second position information;
here, when the first touch operation is a pressing operation, determining that the second area is a circle centered on the second position information and having a preset value as a radius may be determined as the second area in the implementation process according to the second position information; when the first touch operation is a sliding operation, the second area may be determined directly according to the second position information (trajectory position information of the sliding operation).
Step S4043, determining whether a second touch operation for adjusting the second area is received;
here, the second touch operation may also be a pressing operation or a sliding operation. If the second touch operation is received, it indicates that the user needs to adjust the second area, and then step S4044 is performed; if the second touch operation is not received, it indicates that the user does not need to adjust the second area, and then the process proceeds to step S4045.
Step S4044, if a second touch operation for adjusting the second area is received, determining a first area according to the second touch operation;
here, when the second touch operation is a press operation, the second touch operation should be an operation within the second area. Determining that the first area can be obtained by first obtaining the pressing pressure degree and the pressing time of the second touch operation according to the second touch operation, and judging whether the pressing pressure degree is greater than a first preset threshold value or not; if yes, generating an amplification instruction, wherein the amplification instruction is used for amplifying the second area, and the larger the pressing force degree is, the larger the amplification factor of the second area is, the smaller the pressing force degree is, and the smaller the amplification factor of the second area is. Judging whether the pressing time is greater than a second preset threshold value or not; if yes, judging whether the average value of the pressing force degrees in the pressing time is in a first preset range or not; if so, generating a reduction instruction, wherein the reduction instruction is used for reducing the second region, and the larger the average value is, the faster the reduction speed of the second region is, and the smaller the average value is, the smaller the reduction speed of the second region is.
When the second touch operation is a sliding operation, the second touch operation may be a sliding operation performed by a user with two fingers. Determining the first area according to the second touch operation may be to first obtain an action distance and an action direction of the second touch operation, determine, if the action direction is outward, a magnification factor for the second area according to the action distance, and magnify the second area by the magnification factor to obtain the first area; and if the action direction is inward, determining the reduction multiple of the second area according to the action distance, and reducing the second area by the reduction multiple to obtain the first area.
Step S4045, if the second touch operation is not received, determine the second area as the first area.
Step S405, the terminal acquires a preset default region, and determines the location information of the default region as the first location information.
Here, the default area may be set by a developer of the image processing method provided by this embodiment, and may be set by a user according to a photographing habit of the user. In other embodiments, the default area may be a focusing area, and may also be an area where the focusing area extends a certain distance outward, and so on.
Step S406, the terminal outputs filter parameters which can be adopted by the first area.
Here, after the position information of the first area is determined, if a touch operation of the user for adjusting the first area is not received within a preset time period, the user is considered to have selected the first area, and at this time, filter parameters that can be adopted by the first area may be output.
Step S407, the terminal determines a first filter parameter adopted by the first area according to a third touch operation of the user for selecting the filter parameter.
Here, the user may select one first filter parameter for one first region, and may also select two or more first filter parameters for one first region. When there are a plurality of first regions, the first filter parameters of the respective first regions may be the same or different.
Step S408, the terminal acquires a filter parameter set adopted when the preview image is subjected to filter processing.
Here, at least the first filter parameter is included in the set of filter parameters. After determining the first filter parameter used in the first area, the terminal may output a second filter parameter that can be used in a background area other than the first area, or certainly, may not perform filter processing on the background area, where the second filter parameter is empty. In other embodiments, the first filter parameter may be empty, and the second filter parameter may not be empty, so that the filter processing is performed on the area outside the first area, and the filter processing is not performed on the first area. It is clear that in either case the second filter parameter cannot be the same as the first filter parameter.
The first filter parameter and the second filter parameter constitute the set of filter parameters.
And step S409, when a shooting instruction is received, the terminal respectively carries out filter processing on the preview image by using filter parameters in the filter parameter set to obtain at least two frames of images.
Here, it is assumed that the first filter parameter and the second filter parameter are included in the filter parameter set in the present embodiment. The first filter parameter is a filter parameter corresponding to the nostalgic filter effect, and the second filter parameter is a filter parameter corresponding to the sketch filter effect. Fig. 5 is an interface schematic diagram of a preview image according to an embodiment of the present invention, and filter processing is performed on the preview image according to a first filter parameter and a second filter parameter, so as to obtain a corresponding first filter image and a corresponding second filter image, where fig. 6 is an interface schematic diagram of the first filter image corresponding to the first filter parameter in the embodiment of the present invention, and fig. 7 is an interface schematic diagram of the second filter image corresponding to the second filter parameter in the embodiment of the present invention.
Step S410, the terminal acquires a first filter image corresponding to the first filter parameter.
Step S411, the terminal determines a third area in the first filter image corresponding to the first position information.
Here, in the present embodiment, it is assumed that there are two first regions, and there are two third regions accordingly. As shown in fig. 6, 601 and 602 are the third regions. And the two first regions adopt the same first filter parameters, so that two frames of images are obtained in the present embodiment.
Step S412, the terminal acquires a background image.
Here, the background image is an image excluding the first filter image from the at least two frame images. In this embodiment, the background image is the second filter image, that is, the image shown in fig. 7.
Step S413, the terminal replaces a fourth region corresponding to the first position information in the background image with the third region to obtain a target image.
Here, as shown in fig. 7, 701 and 702 are two fourth regions corresponding to the first position information, and replacing the fourth regions with the third regions, that is, 701 and 702 in fig. 7 with 601 and 602 in fig. 6, results in an image as shown in fig. 8, where 801 and 802 in fig. 8 have the same filter effect as 601 and 602, and the regions other than 801 and 802 have the same filter effect as in fig. 7.
In other embodiments, two first regions may be selected, the first filter parameters used in the first regions are different, and the background image uses the second filter parameters, so that three frames of images need to be spliced to obtain a target image with three filter effects, fig. 9 is an interface schematic diagram of the target image with three filter effects according to the embodiment of the present invention, as shown in fig. 9, the target image includes two first regions 901 and 902, and the filter effects of the two first regions are different.
In other embodiments, before the step of determining the first region in the preview image and the first filter parameter adopted by the first region, the method further comprises:
step 51, when the function of self-defining filter effect is started, outputting prompt information for setting a default area and default filter parameters;
here, when the function of the user-defined filter effect is started, the output prompt information for setting the default region and the default filter parameters already includes the default region and the default filter parameters that are set in advance by the developer of the image processing method of the embodiment, for the user to refer to, for example, the focusing region is set as the default region, the default filter parameters are filter parameters corresponding to the nostalgic filter effect, the background is not to perform filter processing, that is, the filter parameters of the background are empty.
The user can adopt the set default area and default filter parameters, or can set the default area and default filter parameters by himself.
And step 52, determining a default area and default filter parameters according to the fourth touch operation of the user.
Here, in the implementation process, a confirmation button may be provided in the prompt information box, and when a touch operation of the user in the area corresponding to the confirmation button is received, the user is considered to have confirmed the default area and the default filter parameter, and at this time, the user may be considered to have received a fourth touch operation, so as to obtain the default area and the default filter parameter.
In the image processing method provided by this embodiment, the terminal starts a camera based on the operation instruction, and controls the camera to acquire a preview image; if a first touch operation for selecting the first area is received, determining the first area according to the first touch operation and acquiring first position information of the first area; if the first touch operation is not received, acquiring a preset default area, determining the position information of the default area as the first position information, outputting filter parameters which can be adopted by the first area, and determining the first filter parameters which are adopted by the first area according to a third touch operation of selecting the filter parameters by a user; then acquiring a filter parameter set adopted when the preview image is subjected to filter processing, wherein the filter parameter set at least comprises the first filter parameter; when a shooting instruction is received, filter processing is respectively carried out on the preview images by using filter parameters in the filter parameter set to obtain at least two frames of images; acquiring a first filter image corresponding to the first filter parameter; determining a third area in the first filter image corresponding to the first position information; and acquiring a background image, and finally replacing a fourth area corresponding to the first position information in the background image with the third area to obtain a target image. Therefore, pictures with different filter effects can be obtained through one-time photographing, the operation process is extremely simple and convenient, and the image processing efficiency is improved. In addition, in the embodiment, a plurality of first areas can be provided, and the filter parameters of the first areas can be different, so that the interest of photographing is further improved.
An embodiment of the present invention provides a terminal, fig. 10 is a schematic view of a composition structure of a terminal according to an embodiment of the present invention, and as shown in fig. 10, the terminal 1000 at least includes: memory 1001, communication bus 1002, and processor 1003, wherein:
the memory 1001 is used for storing an image processing program;
the communication bus 1002 is used for realizing connection communication between the processor and the memory;
the processor 1003 is configured to execute the image processing program stored in the memory to implement the following steps:
determining first position information of a first area in a preview image and a first filter parameter adopted by the first area;
acquiring a filter parameter set adopted during filter processing, wherein the filter parameter set comprises the first filter parameter;
when a shooting instruction is received, respectively carrying out filter processing on the preview images by using filter parameters in the filter parameter set to obtain at least two corresponding frames of images;
and performing superposition processing on the at least two frames of images according to the first position information and the first filter parameter to obtain a target image.
In other embodiments, the determining the first position information of the first region in the preview image and the first filter parameter adopted by the first region includes:
judging whether a first touch operation for determining the first area is received or not;
if the first touch operation is received, determining the first area according to the first touch operation;
and acquiring the position information of the first area.
In other embodiments, the determining first position information of a first region in a preview image and a first filter parameter adopted by the first region further includes:
if the first touch operation is not received, acquiring a preset default area;
determining the location information of the default area as the first location information.
It should be noted that the description of the terminal embodiment is similar to the description of the method embodiment, and has similar beneficial effects to the method embodiment, and therefore, the description is not repeated. For technical details not disclosed in the terminal embodiments of the present invention, reference is made to the description of the method embodiments of the present invention for understanding.
An embodiment of the present invention provides a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of:
determining first position information of a first area in a preview image and a first filter parameter adopted by the first area;
acquiring a filter parameter set adopted during filter processing, wherein the filter parameter set comprises the first filter parameter;
when a shooting instruction is received, respectively carrying out filter processing on the preview images by using filter parameters in the filter parameter set to obtain at least two corresponding frames of images;
and performing superposition processing on the at least two frames of images according to the first position information and the first filter parameter to obtain a target image.
It should be noted that one or more programs in the embodiments of the present invention may be image processing programs used in image processing in other embodiments.
It should be noted that the description of the computer-readable storage medium is similar to the description of the method embodiment, and has similar beneficial effects to the method embodiment, and therefore, the description is not repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium of the present invention, reference is made to the description of the embodiments of the method of the present invention.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method described in the embodiments of the present invention.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. An image processing method, characterized in that the method comprises:
determining a first filter parameter adopted by a first area in a preview image, wherein the first area comprises at least one area;
judging whether a first touch operation for determining the first area is received or not;
if the first touch operation is received, determining the first area according to the first touch operation;
acquiring first position information of the first area;
acquiring a filter parameter set adopted when the preview image is subjected to filter processing, wherein the filter parameter set at least comprises the first filter parameter;
when a shooting instruction is received, filter processing is respectively carried out on the preview images by using filter parameters in the filter parameter set to obtain at least two frames of images;
acquiring a first filter image corresponding to the first filter parameter;
determining a third area in the first filter image corresponding to the first position information;
acquiring a background image, wherein the background image is an image except for a first filter image in the at least two frames of images;
and replacing a fourth area corresponding to the first position information in the background image with the third area to obtain a target image.
2. The method of claim 1, wherein determining first location information for a first region in the preview image and first filter parameters to be used for the first region further comprises:
if the first touch operation is not received, acquiring a preset default area;
determining the location information of the default area as the first location information.
3. The method as claimed in claim 1, wherein the determining the first area according to the first touch operation if the first touch operation selecting the first area is received comprises:
if the first touch operation is received, second position information of the first touch operation is obtained;
determining a second area according to the second position information;
if a second touch operation for adjusting the second area is received, determining the first area according to the second touch operation;
and if the second touch operation is not received, determining the second area as the first area.
4. The method of any of claims 2 or 3, wherein determining the first location information for the first region and the first filter parameters employed by the first region in the preview image further comprises:
outputting filter parameters which can be adopted by the first area;
and determining a first filter parameter adopted by the first area according to a third touch operation of selecting the filter parameter by the user.
5. A method according to any one of claims 1 to 3, wherein prior to the step of determining a first region in a preview image and first filter parameters to be used by the first region, the method further comprises:
when the function of self-defining the filter effect is started, outputting prompt information for setting a default area and default filter parameters;
and determining a default area and default filter parameters according to the fourth touch operation of the user.
6. A terminal, characterized in that the terminal comprises at least: a memory, a communication bus, and a processor, wherein:
the memory is used for storing an image processing program;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the image processing program stored in the memory so as to realize the following steps:
determining a first filter parameter adopted by a first area in a preview image, wherein the first area comprises at least one area;
judging whether a first touch operation for determining the first area is received or not;
if the first touch operation is received, determining the first area according to the first touch operation;
acquiring first position information of the first area;
acquiring a filter parameter set adopted during filter processing, wherein the filter parameter set at least comprises the first filter parameter;
when a shooting instruction is received, filter processing is respectively carried out on the preview images by using filter parameters in the filter parameter set to obtain at least two corresponding frames of images;
acquiring a first filter image corresponding to the first filter parameter;
determining a third area in the first filter image corresponding to the first position information;
acquiring a background image, wherein the background image is an image except for a first filter image in the at least two frames of images;
and replacing a fourth area corresponding to the first position information in the background image with the third area to obtain a target image.
7. A computer-readable storage medium having stored thereon an image processing program which, when executed by a processor, implements the steps of the image processing method as claimed in any one of claims 1 to 5.
CN201711464646.5A 2017-12-28 2017-12-28 Image processing method, terminal and computer readable storage medium Active CN107948530B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711464646.5A CN107948530B (en) 2017-12-28 2017-12-28 Image processing method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711464646.5A CN107948530B (en) 2017-12-28 2017-12-28 Image processing method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107948530A CN107948530A (en) 2018-04-20
CN107948530B true CN107948530B (en) 2020-07-28

Family

ID=61940725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711464646.5A Active CN107948530B (en) 2017-12-28 2017-12-28 Image processing method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107948530B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109523465B (en) * 2018-11-21 2023-06-23 维沃移动通信有限公司 Filter processing method and terminal
CN109462727B (en) * 2018-11-23 2022-01-25 维沃移动通信有限公司 Filter adjusting method and mobile terminal
CN109785226B (en) * 2018-12-28 2023-11-17 维沃移动通信有限公司 Image processing method and device and terminal equipment
CN109993711A (en) * 2019-03-25 2019-07-09 维沃移动通信有限公司 A kind of image processing method and terminal device
CN110598027B (en) * 2019-09-10 2022-09-02 Oppo广东移动通信有限公司 Image processing effect display method and device, electronic equipment and storage medium
CN110599394A (en) * 2019-09-12 2019-12-20 北京字节跳动网络技术有限公司 Method and device for processing pictures in online presentation, storage medium and equipment
CN113794834B (en) * 2021-08-25 2023-08-08 维沃移动通信(杭州)有限公司 Image processing method and device and electronic equipment
CN113744414B (en) * 2021-09-06 2022-06-28 北京百度网讯科技有限公司 Image processing method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357451A (en) * 2015-12-04 2016-02-24 Tcl集团股份有限公司 Image processing method and apparatus based on filter special efficacies
CN105554364A (en) * 2015-07-30 2016-05-04 宇龙计算机通信科技(深圳)有限公司 Image processing method and terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101469763B1 (en) * 2013-06-24 2014-12-05 (주)리얼스마트 Terminal and method for reading data using filterset and auto scaling process
CN103795925A (en) * 2014-02-08 2014-05-14 厦门美图网科技有限公司 Interactive main-and-auxiliary-picture real-time rendering photographing method
CN105825494B (en) * 2015-08-31 2019-01-29 维沃移动通信有限公司 A kind of image processing method and mobile terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554364A (en) * 2015-07-30 2016-05-04 宇龙计算机通信科技(深圳)有限公司 Image processing method and terminal
CN105357451A (en) * 2015-12-04 2016-02-24 Tcl集团股份有限公司 Image processing method and apparatus based on filter special efficacies

Also Published As

Publication number Publication date
CN107948530A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
CN107948530B (en) Image processing method, terminal and computer readable storage medium
CN108900790B (en) Video image processing method, mobile terminal and computer readable storage medium
CN107959795B (en) Information acquisition method, information acquisition equipment and computer readable storage medium
CN111935402B (en) Picture shooting method, terminal device and computer readable storage medium
CN110086993B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
CN109068167B (en) Screen recording interaction method, mobile terminal, wearable device and storage medium
CN107133939A (en) A kind of picture synthesis method, equipment and computer-readable recording medium
CN111885307B (en) Depth-of-field shooting method and device and computer readable storage medium
CN108459799B (en) Picture processing method, mobile terminal and computer readable storage medium
CN113179369B (en) Shot picture display method, mobile terminal and storage medium
CN108055463A (en) Image processing method, terminal and storage medium
CN109120858B (en) Image shooting method, device, equipment and storage medium
CN111866388B (en) Multiple exposure shooting method, equipment and computer readable storage medium
CN108184052A (en) A kind of method of video record, mobile terminal and computer readable storage medium
CN109672822A (en) A kind of method for processing video frequency of mobile terminal, mobile terminal and storage medium
CN112511741A (en) Image processing method, mobile terminal and computer storage medium
CN107241504B (en) Image processing method, mobile terminal and computer readable storage medium
CN112367443A (en) Photographing method, mobile terminal and computer-readable storage medium
CN111324407A (en) Animation display method, terminal and computer readable storage medium
CN108282608B (en) Multi-region focusing method, mobile terminal and computer readable storage medium
CN112135060B (en) Focusing processing method, mobile terminal and computer storage medium
CN107395971B (en) Image acquisition method, image acquisition equipment and computer-readable storage medium
CN112965680A (en) Screen projection method, screen projection initiating device and storage medium
CN112135045A (en) Video processing method, mobile terminal and computer storage medium
CN112153305A (en) Camera starting method, mobile terminal and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant