Image processing method and device, mobile terminal, and storage medium
By employing multiple blurring algorithms on mobile devices that adapt to shooting conditions, the solution addresses inconsistent shallow depth of field effects, enhancing imaging quality and user experience.
Patent Information
- Application Number
- JP2022157535
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-06-20
- Filing Date
- 2022-09-30
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-09-30
AI Technical Summary
Mobile devices struggle to achieve consistent shallow depth of field effects in various photographic environments due to inconsistent image recognition, leading to poor imaging quality and failure to meet user needs.
Implement multiple preset blurring algorithms on mobile terminals that simulate optical lens effects, allowing for the selection or automatic determination of a target blurring algorithm based on shooting environment parameters, including focal length, ambient light brightness, subject detection, and light spot detection, to enhance image processing.
The solution enables accurate simulation of various optical lens effects in different shooting scenes, improving imaging quality and user experience by meeting user needs in diverse scenarios, reducing learning costs, and enhancing operational efficiency.
Smart Images

Figure 0007550825000010 
Figure 0007550825000009 
Figure 0007550825000012
Abstract
Description
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority to Chinese Patent Application No. "2022107018091", filed on June 20, 2022, the entire contents of which are incorporated herein by reference. [Technical field]
[0002] The present disclosure relates to the field of image processing technology, and in particular to an image processing method and apparatus, a mobile terminal, and a storage medium. [Background technology]
[0003] With the development of electronic imaging technology, people rely more and more on mobile devices to take pictures, and the requirements for the shooting effect of mobile devices are becoming higher and higher. The shallow depth of field effect refers to the image effect where only the area around the focus point is clear and the scenery before and after is blurred. The shallow depth of field effect can highlight the subject very well, and is widely used in portrait, close-up and other shooting modes. Summary of the Invention
[0004] To improve the imaging quality of an image, the embodiments of the present disclosure provide an image processing method, an apparatus, a mobile terminal, and a storage medium.
[0005] According to a first aspect, an embodiment of the present disclosure comprises: obtaining a lens effect command and determining a target blur algorithm from a plurality of preset blur algorithms based on the lens effect command, the blur algorithm being an algorithm for simulating an optical lens effect; and blurring the image to be processed based on the target blurring algorithm to obtain a target image.
[0006] In some embodiments, the step of obtaining the lens effect instructions comprises: Acquiring current shooting environment parameters in response to the mobile terminal turning on an optical lens mode, the shooting environment parameters including at least one of a focal length parameter, an ambient light brightness parameter, a subject detection parameter, and a light spot detection parameter; and determining the lens effect instructions based on the current shooting environment parameters.
[0007] In some embodiments, determining the lens effect instructions based on the current filming environment parameters comprises: The method includes determining a lens effect command corresponding to a target optical lens effect based on a relationship between at least one parameter included in the shooting environment parameters and a corresponding preset condition.
[0008] In some embodiments, the step of determining a lens effect command corresponding to a target optical lens effect based on a relationship between at least one parameter included in the shooting environment parameters and a corresponding preset condition includes: determining, in response to the focal length parameter satisfying a first preset condition, that an instruction corresponding to a non-blurring effect is the lens effect instruction; determining that the lens effect command is an instruction corresponding to a soft focus blur effect in response to the ambient light brightness parameter satisfying a second preset condition; determining that an instruction corresponding to a black and white blur effect is the lens effect instruction in response to the subject detection parameter satisfying a third preset condition; In response to the light spot detection parameters satisfying a fourth preset condition, determining that the command corresponding to a focus rotation blur effect is the lens effect command; and determining that an instruction corresponding to a reference blur effect is the lens effect instruction in response to the focal length parameter not satisfying a first preset condition, the ambient light brightness parameter not satisfying a second preset condition, the subject detection parameter not satisfying a third preset condition, and the light spot detection parameter not satisfying a fourth preset condition.
[0009] In some embodiments, the optical lensing effect includes: At least one of a no blur effect, a soft focus blur effect, a black and white blur effect, a focus rotation blur effect and a reference blur effect is included.
[0010] In some embodiments, the step of obtaining lens effect instructions comprises: In response to the mobile terminal turning on an optical lens mode, outputting a selection interface displaying an optical lens effect; receiving a user input command from a user at the selection interface, and generating a corresponding lens effect command based on the user input command.
[0011] In some embodiments, when the target blur algorithm is a reference blur algorithm, blurring the image to be processed based on the target blur algorithm to obtain a target image comprises: performing image division on the image to be processed to obtain at least two blur layers; filtering each blurred layer respectively to obtain a blurred result layer; and fusing the blurred result layers of each blur layer to obtain the target image.
[0012] In some embodiments, when the target blur algorithm is a focus rotation blur algorithm, the step of blurring the image to be processed based on the target blur algorithm to obtain a target image includes the steps of: performing image division on the image to be processed to obtain a light spot layer and a background layer; filtering the background layer to obtain a background result layer, and filtering the light spot layer according to a preset vignetting mask layer to obtain a light spot result layer; and fusing the background result layer and the light spot result layer to obtain the target image.
[0013] In some embodiments, when the target blurring algorithm is a black and white blurring algorithm, the step of blurring the image to be processed based on the target blurring algorithm to obtain a target image includes the steps of: converting the image to be processed from a color image to a black and white image; performing image segmentation on the monochrome image to obtain at least two blur layers; Filtering each blurred layer individually to obtain a blurred result layer; and fusing the blurred result layers of each blur layer to obtain the target image.
[0014] In some embodiments, when the target blurring algorithm is a soft focus blurring algorithm, blurring the image to be processed based on the target blurring algorithm to obtain a target image comprises: performing image division on the image to be processed to obtain at least two blur layers; filtering each blurred layer respectively to obtain a blurred result layer; Fusing the blurred result layers of each blur layer to obtain an intermediate image; and performing highlight enhancement processing on the intermediate image to obtain the target image.
[0015] In some embodiments, an exemplary image processing method of the present disclosure includes: acquiring processing data of an image to be processed in a first blur algorithm process corresponding to the first optical lens effect in response to the mobile terminal turning on an optical lens mode and switching from a first optical lens effect to a second optical lens effect; and performing image processing on the target image using a second blurring algorithm corresponding to the second optical lens effect based on the processing data.
[0016] According to a second aspect, an embodiment of the present disclosure comprises: an acquisition module for acquiring a lens effect command, and determining a target blur algorithm from a plurality of preset blur algorithms according to the lens effect command, the blur algorithm being an algorithm for simulating an optical lens effect; and a blurring processing module for blurring a processing target image based on the target blurring algorithm to obtain a target image.
[0017] In some embodiments, the acquisition module comprises: In response to the mobile terminal turning on an optical lens mode, obtain current shooting environment parameters, the shooting environment parameters including at least one of a focal length parameter, an ambient light brightness parameter, a subject detection parameter, and a light point detection parameter; The lens effect command is configured to determine the lens effect command based on the current shooting environment parameters.
[0018] In some embodiments, the acquisition module comprises: The apparatus is configured to determine a lens effect command corresponding to a target optical lens effect based on a relationship between at least one parameter included in the shooting environment parameters and a corresponding preset condition.
[0019] In some embodiments, the acquisition module comprises: determining that an instruction corresponding to a non-blur effect is the lens effect instruction in response to the focal length parameter satisfying a first preset condition; determining that the lens effect command is an instruction corresponding to a soft focus blur effect in response to the ambient light brightness parameter satisfying a second preset condition; In response to the subject detection parameter satisfying a third preset condition, determining that an instruction corresponding to a black and white blur effect is the lens effect instruction; In response to the light spot detection parameters satisfying a fourth preset condition, determining that the command corresponding to a focus rotation blur effect is the lens effect command; and configured to determine that a command corresponding to a reference blur effect is the lens effect command in response to the focal length parameter not satisfying a first preset condition, the ambient light brightness parameter not satisfying a second preset condition, the subject detection parameter not satisfying a third preset condition, and the light spot detection parameter not satisfying a fourth preset condition.
[0020] In some embodiments, the optical lensing effect includes: At least one of a no blur effect, a soft focus blur effect, a black and white blur effect, a focus rotation blur effect and a reference blur effect is included.
[0021] In some embodiments, the acquisition module comprises: In response to the mobile terminal turning on an optical lens mode, outputting a selection interface displaying an optical lens effect; The lens effect control unit is configured to receive a user input command from a user at the selection interface, and generate a corresponding lens effect command based on the user input command.
[0022] In some embodiments, the blur processing module further comprises: Performing image division on the image to be processed to obtain at least two blur layers; Filter each blur layer individually to get the blur result layer, The blurred result layers of each blur layer are blended to obtain the target image.
[0023] In some embodiments, the blur processing module further comprises: Performing image division on the image to be processed to obtain a light spot layer and a background layer; Filtering the background layer to obtain a background result layer; and filtering the light spot layer according to a preset vignetting mask layer to obtain a light spot result layer; The background result layer and the light spot result layer are merged to obtain the target image.
[0024] In some embodiments, the blur processing module further comprises: converting the image to be processed from a color image to a black and white image; performing image segmentation on the monochrome image to obtain at least two blur layers; Filter each blur layer individually to get the blur result layer, The blurred result layers of each blur layer are blended to obtain the target image.
[0025] In some embodiments, the blur processing module further comprises: Performing image division on the image to be processed to obtain at least two blur layers; Filter each blur layer individually to get the blur result layer, Fusing the blurred result layers of each blur layer to obtain an intermediate image; The intermediate image is subjected to highlight enhancement processing to obtain the target image.
[0026] In some embodiments, the blur processing module further comprises: In response to the mobile terminal turning on an optical lens mode and switching from a first optical lens effect to a second optical lens effect, acquiring processing data of an image to be processed in processing of a first blur algorithm corresponding to the first optical lens effect; The apparatus is configured to perform image processing on the target image using a second blurring algorithm corresponding to the second optical lens effect based on the processing data.
[0027] According to a third aspect, an embodiment of the present disclosure provides a mobile terminal, the mobile terminal comprising: A processor; and a memory for storing computer instructions, The computer instructions are adapted for the processor to execute the image processing method according to any of the embodiments of the first aspect.
[0028] According to a fourth aspect, an embodiment of the present disclosure provides a storage medium having computer instructions stored thereon, the computer instructions being adapted for a computer to execute the image processing method according to any of the embodiments of the first aspect. Effect of the Invention
[0029] The image processing method of the embodiment of the present disclosure includes the steps of obtaining a lens effect command, determining a target blur algorithm from a plurality of pre-set blur algorithms according to the lens effect command, and blurring the image to be processed according to the target blur algorithm to obtain a target image. In the embodiment of the present disclosure, since a plurality of blur algorithms are pre-set in the mobile terminal, different blur algorithms are used for processing according to different shooting scenes, and various optical lens effects can be accurately simulated in various shooting scenes, improving the imaging quality of the image, meeting the shooting needs of users in various scenes, and improving the shooting experience of the user. [Brief description of the drawings]
[0030] In order to more clearly describe certain embodiments of the present disclosure or technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used to describe the certain embodiments or prior art, and obviously, the drawings in the following description are some embodiments of the present disclosure, and those skilled in the art can obtain other drawings from these drawings without creative efforts.
[0031] [Figure 1] 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. [Diagram 2] 3A-3C are exemplary diagrams of target images of image processing methods according to some embodiments of the present disclosure. [Diagram 3] 3A-3C are exemplary diagrams of target images of image processing methods according to some embodiments of the present disclosure. [Figure 4] 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. [Diagram 5] FIG. 1 is a principle diagram of an image processing method according to some embodiments of the present disclosure. [Figure 6] 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. [Figure 7] 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. [Figure 8] 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. [Figure 9] 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. [Figure 10] 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. [Figure 11] 1 is a flowchart of an image processing method according to some embodiments of the present disclosure. [Figure 12] FIG. 1 is a structural block diagram of an image processing device according to some embodiments of the present disclosure. [Figure 13] FIG. 2 is a structural block diagram of a mobile terminal according to some embodiments of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0032] The technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings, and obviously, the described embodiments are only a part of the embodiments of the present disclosure, and are not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative efforts fall within the scope of protection of the present disclosure. It should be noted that the technical features included in the different embodiments of the present disclosure described below can be combined with each other as long as they are not inconsistent with each other.
[0033] Nowadays, the demand for taking photos using mobile devices is increasing, and people expect the photos taken by mobile devices to have the same effect as professional cameras. However, due to the limited volume and weight of mobile devices, the sensor and aperture of the camera system cannot be compared to professional cameras. Therefore, each mobile device manufacturer provides users with a special "portrait mode" or "large aperture mode", the principle of which is to simulate the imaging effect of professional cameras through software algorithms.
[0034] Depth of field is a concept in the field of imaging that refers to the range of the image that can be clearly seen by the naked eye on an image, and shallow depth of field refers to the effect that only the area around the focus point is clear and the scenery in front and behind is blurred. The shallow depth of field effect can highlight the subject very well, so it is widely used in the "Portrait mode" shooting mode.
[0035] In related technologies, mobile terminals often only provide users with a "portrait mode", and when a user selects the portrait mode to take a photo, the system can use a pre-set algorithm to process the collected image and achieve a shallow depth of field shooting effect, highlighting the portrait or subject and blurring the remaining background.
[0036] However, the inventor of this case found that for different shooting environments, the effect of shallow depth of field often results in inconsistent image recognition. For example, in a portrait shooting scene with good lighting and no large highlight areas, a user can get a better image effect by blurring the background other than the portrait. On the other hand, in a portrait shooting scene with dark light and many light spots, the same algorithm will reduce the brightness and contrast of the light spot area, resulting in poor photo quality. In addition, for example, in a backlit portrait shooting scene, where there are many highlight areas in the image, the same algorithm will cause problems such as the whole image being white and the portrait area being too dark, resulting in poor imaging quality.
[0037] It can be seen from this that in the related art, the blurring algorithm of the mobile terminal cannot perform focused image processing for different shooting scenes, and the shooting effect is poor in some scenes, which makes it difficult to meet the shooting needs of users. In the related art, the shooting effect of the shallow depth of field of the mobile terminal is not good, which makes it difficult to meet the needs of users.
[0038] Based on the above deficiencies, the embodiments of the present disclosure provide an image processing method, an apparatus, a mobile terminal and a storage medium, aiming to improve the imaging quality of images with shallow depth of field effect on a mobile terminal and meet the photography needs of users.
[0039] First, the technical solution of the present disclosure is related to image processing, and when portrait images are described in the text, all portrait images are obtained from the personal consent of the person being photographed. In addition, in the following embodiments of the present disclosure, blurring is performed on all face regions described for the purpose of protecting personal privacy. However, in the actual application process of the technical solution of the present disclosure, it is not necessary to perform blurring on the face region. Those skilled in the art can understand this, and the details will not be repeated in the present disclosure.
[0040] It should be noted that in the embodiments below of this disclosure, unless otherwise specified, other images can be color images, i.e., images including R (red), G (green), and B (blue) channels, and in order to meet format requirements, the images in the following embodiments are uniformly presented as grayscale images and will not be repeated in this disclosure.
[0041] According to a first aspect, an embodiment of the present disclosure provides an image processing method, which is applicable to a mobile terminal, and the mobile terminal of the embodiment of the present disclosure may be any type of device suitable for implementation, such as a smartphone, a tablet computer, a handheld computer, etc., but the present disclosure is not limited thereto.
[0042] As shown in FIG. 1, in some embodiments, the exemplary image processing method of the present disclosure includes the following steps S110 to S120.
[0043] In S110, a lens effect command is obtained, and a target blur algorithm is determined from a plurality of preset blur algorithms according to the lens effect command.
[0044] In S120, the image to be processed is blurred based on a target blurring algorithm to obtain a target image.
[0045] Note that the image processing method of the embodiment of the present disclosure is mainly targeted at images with a shallow depth of field effect, and the most important process for the shallow depth of field effect is image blurring.
[0046] In the embodiment of the present disclosure, multiple blur algorithms are preset in the mobile terminal according to the imaging environment. The blur algorithm refers to a software algorithm that performs image processing on the image to be processed, and the blur algorithm can be preprogrammed and cached in the memory of the mobile terminal, so that when the image to be processed is to be blurred, the cached blur algorithm can be called to perform image processing and obtain the target image.
[0047] The blur algorithm in the embodiment of the present disclosure is a software algorithm for simulating optical lens effects. Optical lens effects refer to some unique effects exhibited by professional camera lenses. For example, an image captured with a focus rotation lens will show a focus rotation blur effect, which refers to the effect of light spots at the out-of-focus edge being compressed into a non-circular shape due to defects in the structure of the optical lens itself. Also, for example, an image captured with a soft focus lens will show a soft focus blur effect, which refers to the image effect that the soft focus lens uses intentionally designed spherical aberration to make the subject clear and soft. Also, for example, a black and white image captured with a black and white lens will show a black and white blur effect, with higher contrast, the light and dark layers of the image being more prominent, and the image has a cinematic quality.
[0048] Therefore, in the embodiment of the present disclosure, a number of pre-defined blurring algorithms are used to simulate the various optical lens effects mentioned above, so that the image can have texture comparable to that of a professional camera. The specific algorithm processing process is described below.
[0049] In the embodiment of the present disclosure, the number of blur algorithms preset in the mobile terminal can be set according to specific requirements, which is not limited in the present disclosure.For example, in one example, when the mobile terminal captures an image with a shallow depth of field, it can provide four optical lens effects to the user, including a reference blur effect, a focus rotation blur effect, a soft focus blur effect, and a black and white blur effect, and each optical lens effect corresponds to a blur algorithm, that is, in this example, the mobile terminal has four blur algorithms preset.
[0050] Since multiple blurring algorithms are preset in the mobile terminal, when processing one or more images to be processed, it is necessary to determine a target blurring algorithm from the multiple blurring algorithms, and the target blurring algorithm is also an algorithm for performing image processing on the images to be processed.
[0051] In the embodiment of the present disclosure, the target blur algorithm can be determined from a plurality of blur algorithms based on the acquired lens effect command. In some embodiments, the lens effect command can be a command generated based on a user input command, i.e., the blur algorithm is selected by the user. In other embodiments, the lens effect command can be a command determined based on the current shooting environment parameters, i.e., the blur algorithm is automatically determined and selected by the system. The present disclosure will be described in the following embodiments, but will not be described in detail here.
[0052] After the target blurring algorithm is determined, the image to be processed can be blurred using the target blurring algorithm to obtain the target image.
[0053] In an embodiment of the present disclosure, the image to be processed refers to an image that needs to be blurred, and may be an image collected by an image collection device of a mobile terminal, for example, the image to be processed may be an image captured by a camera of a smartphone and received by the mobile terminal from another device, for example, the smartphone can receive the image to be processed sent from an external device, and the mobile terminal may download the image via a network, but the present disclosure is not limited thereto.
[0054] The image to be processed may be a color image, and a color image as described in the embodiments of the present disclosure refers to an image in which each pixel of the image is composed of R (red), G (green), and B (green) components, that is, the image to be processed has three color channels: R, G, and B.
[0055] For example, in one example, the image to be processed may be an image collected by a smartphone via a camera module, after a target blurring algorithm is determined, the target blurring algorithm can be used to blur the collected image to be processed to obtain a blurred target image.
[0056] Taking the above example as an example, when a mobile terminal captures an image with a shallow depth of field, four blur algorithms are preset, including a reference blur algorithm, a focus rotation blur algorithm, a soft focus blur algorithm, and a black and white blur algorithm. As a result, when a user captures a portrait with good lighting and no large highlight area, the reference blur algorithm can be used for processing; when a user captures a backlit portrait, the soft focus blur algorithm can be used for processing; when a user captures a night scene and there are many portraits with light spots, the focus rotation blur algorithm can be used for processing.
[0057] As can be seen from the above, in the embodiment of the present disclosure, multiple blurring algorithms are pre-configured in the mobile terminal, and different blurring algorithms are used for processing according to different shooting scenes, so as to accurately simulate different optical lens effects in different shooting scenes, improve the imaging quality of the image, meet the shooting needs of users in different scenes, and improve the shooting experience of the user.
[0058] For convenience of description, the following embodiments of the present disclosure take the following blur algorithms preset in the mobile terminal as examples: a reference blur algorithm, a soft focus blur algorithm, a focus rotation blur algorithm, and a black and white blur algorithm. However, those skilled in the art can understand that the method of the present disclosure is not limited to the four blur algorithms in the above examples, and may be any other blur algorithm suitable for implementation, and the present disclosure is not limited thereto.
[0059] 2 and 3 are diagrams showing the effects of the four blurring algorithms in the above example. Below, in combination with FIG. 2 and FIG. 3, the effects of the blurring algorithms and the application environment will be briefly described.
[0060] As shown in (a) of FIG. 2, this is an example of an image processed by the reference blur algorithm. As can be seen, in a portrait shooting scene with good lighting and no large highlight areas, the reference blur algorithm can better preserve background details and color information, and at the same time, the portrait in the foreground is more prominent, improving the overall image effect.
[0061] As shown in Figure 2(b), this is an example of an image processed by the soft focus blur algorithm. As can be seen, in a backlit portrait scene, by emphasizing the highlight areas, the whole image becomes more delicate and soft, and to avoid problems such as the portrait being too dark, by brightening the portrait, the portrait can be made to stand out more.
[0062] As shown in (a) of FIG. 3, this example is an example of an image processed by the focus rotation blur algorithm. As can be seen, in a night scene, there are many light spots in the image background, and the light spot area can maintain good brightness and contrast, and can effectively highlight the portrait in the foreground without being blurred together with the background, so that the atmosphere of the portrait image can be improved.
[0063] As shown in (b) of FIG. 3, this example is an example of an image processed by a black and white blur algorithm, and black and white blur is often not suitable for portrait shooting scenes, but is suitable for landscape shooting. Referring to this example, there is a suitable light and dark layer between the foreground object and the background object, which can improve the cinematic feeling of the image.
[0064] The effect of each blurring algorithm has been illustrated above in combination with exemplary figures, but the principle process of each blurring algorithm will be described separately in the following embodiments of the present disclosure and will not be described here.
[0065] In some embodiments, the target blur algorithm for the image to be processed may be freely selected by the user, as will be described below in conjunction with the embodiment of FIG.
[0066] As shown in FIG. 4, in some embodiments, in the exemplary image processing method of the present disclosure, the step of obtaining a lens effect instruction includes the following steps S410 to S420.
[0067] In S410, in response to the mobile terminal turning on the optical lens mode, a selection interface displaying an optical lens effect is output.
[0068] At S420, a user input command is received from a user at the selection interface, and a corresponding lens effect command is generated based on the user input command.
[0069] It should be noted that, although the method of the embodiment of the present disclosure is mainly targeted at a shooting scene having a shallow depth of field effect, a user does not always expect to capture an image having a shallow depth of field effect when taking a photo. Therefore, in the embodiment of the present disclosure, a button or gesture command for enabling the shallow depth of field effect may be set on the mobile terminal.
[0070] For example, in one example, as shown in Fig. 5(a), a button 110 is provided on the shooting interface 100 of the mobile terminal, and by clicking the button 110, a user can turn on the optical lens mode, i.e., enter the shooting mode with shallow depth of field effect. A text bubble 120 can also be set near the button 110, and the text bubble can be marked with relevant prompt information such as "click to open the master lens", which will not be repeated in this disclosure.
[0071] After the user clicks the button 110, it means that the mobile terminal turns on the optical lens mode, and at this time, the output display interface is as shown in Fig. 5(b), that is, a selection interface displaying each blur effect is output in the preview interface, for example, in the above example, four tabs, "Standard", "Rotational focus", "Soft focus", and "Black and white", can be output, and each tab can also display a schematic diagram of the corresponding optical lens.
[0072] After the user clicks on a specific tab in the selection interface, the mobile terminal can receive a user input command, where the user input command indicates the optical lens effect selected by the user, so that the mobile terminal can determine a corresponding target optical lens effect based on the user input command, and generate a lens effect command corresponding to the target optical lens effect.
[0073] For example, in one example, when a user clicks on the “Focus Rotation” tab of the interface shown in FIG. 5B, the mobile terminal can determine the focus rotation blur effect corresponding to the “Focus Rotation” tab as the target optical lens effect, and generate a lens effect command corresponding to the focus rotation blur effect. The display interface can be switched to that shown in FIG. 5C, and the focal length of the lens corresponding to the focus rotation blur effect can be displayed in the preview interface.
[0074] In other embodiments, the user can also turn on the optical lens mode using a preset gesture command, which may be any gesture operation, such as double-clicking, touch swiping, long pressing, etc., but the present disclosure is not limited thereto, and thus, it is not necessary to set the button 110 on the display interface. Those skilled in the art can understand and fully realize this, so it will not be repeated in the present disclosure.
[0075] In the above example of FIG. 5, the camera's shooting interface 100 is set with a button 110 for turning on the optical lens mode. In some embodiments, the button 110 can be set on the desktop of the mobile terminal, that is, the user can directly open the camera application by clicking the button 110 on the desktop without opening the camera application. In other embodiments, each tab of the optical lens effect can be set on the desktop of the mobile terminal, for example, four tabs of "reference", "focus rotation", "soft focus" and "black and white" are set on the desktop of the mobile terminal, and the user can directly open the camera application by clicking the tab on the desktop and select the corresponding optical lens effect to take a photo. Those skilled in the art can understand and fully realize it based on the related art, so it will not be repeated in this disclosure.
[0076] As can be seen from the above, in the embodiment of the present disclosure, a plurality of blurring algorithms are preset in the mobile terminal, and different blurring algorithms are used for processing according to different shooting scenes, so that various optical lens effects can be accurately simulated in various shooting scenes, and the image pickup quality can be improved to meet the user's shooting needs in various scenes. In addition, the user can freely select the blurring algorithm, so that the user's shooting operability can be improved and the user's shooting experience can be improved.
[0077] In the above embodiment, the user needs to manually select the desired optical lens effect from multiple optical lens effects, but some users do not have professional camera knowledge and expect to get a good image effect when shooting randomly, so the user cannot select a suitable blur algorithm according to the current shooting scene, resulting in unpredictable imaging effects.
[0078] Thus, in some embodiments of the present disclosure, a mobile terminal can automatically select a target optical lens effect based on current shooting environment parameters without the need for a user to manually select it, which is described below in conjunction with the embodiment of FIG. 6.
[0079] As shown in FIG. 6, in some embodiments, in the exemplary image processing method of the present disclosure, the step of obtaining a lens effect instruction includes the following steps S610 to S620.
[0080] In S610, in response to the mobile terminal turning on the optical lens mode, the current shooting environment parameters are acquired.
[0081] In S620, the lens effect instructions are determined based on the current shooting environment parameters.
[0082] As described above, the method in the embodiment of the present disclosure is mainly aimed at the shooting scene with shallow depth of field effect, but the user does not always expect to capture an image with shallow depth of field effect when taking a photo. Therefore, in the embodiment of the present disclosure, a button or gesture instruction for enabling the shallow depth of field effect may be set in the mobile terminal. For example, as shown in FIG. 5, the optical lens mode is turned on via the button 110 of the display interface, which is not repeated in the present disclosure.
[0083] After the optical lens mode is turned on, the user indicates that he / she expects to blur the image to be processed, so that the system can obtain the shooting environment parameters of the current shooting and determine a target blur algorithm from multiple blur algorithms based on the shooting environment parameters.
[0084] The shooting environment parameters represent relevant parameters that affect the imaging effect, for example, in some embodiments, the shooting environment parameters may include a focal length parameter, an ambient light brightness parameter, a subject detection parameter, and a light point detection parameter.
[0085] It can be understood that the focal length parameter indicates the distance between the object and the mobile terminal, and if the distance of the object exceeds the focal length of the lens, it means that the distance of the object is too far away and it is difficult to express the blur effect. Therefore, in some embodiments, a corresponding focal length threshold can be preset based on the lens structure, and the focal length parameter of the current shooting scene can be compared with the focal length threshold to determine whether the current focal length parameter meets the preset condition.
[0086] It can be understood that the ambient light brightness parameter represents the intensity of the ambient light of the current shooting, the brightness of the ambient light directly affects the imaging mass of the image, and different blurring algorithms need to be used according to the ambient light brightness parameter. Therefore, in some embodiments, a corresponding ambient light brightness threshold can be preset, and the ambient light brightness parameter of the current shooting scene can be compared and judged to determine whether the ambient light brightness parameter meets the preset condition.
[0087] The subject detection parameter indicates whether a preset subject is included in the current field of view, for example, the preset subject may be a human body, and a human body detection method can be used to determine whether a human body is included in the current field of view of the camera. Note that, since the blur algorithms used in portrait images and non-portrait images are different, in some embodiments, the subject detection parameter can be used to determine whether a human body is included in the current field of view, and whether the subject detection parameter satisfies a preset condition.
[0088] The light spot detection parameter indicates the proportion of high brightness areas in the current shooting scene, and the light spot may be, for example, an area formed by lamplight or glass reflection. In addition, since a scene with many light spots and a scene with few light spots need to use different blurring algorithms, in some embodiments, a threshold value of the range of light spots is preset, and the light spot detection parameter of the current shooting scene is compared with the light spot range threshold value to determine whether the current light spot detection parameter meets the preset condition.
[0089] Of course, those skilled in the art will appreciate that the shooting environment parameters of the present disclosure are not limited to the above examples, and may be any other parameters suitable for implementation as long as the parameters are capable of determining changes in the shooting environment, but the present disclosure is not limited thereto.
[0090] In an embodiment of the present disclosure, a target optical lens effect can be determined based on a relationship between at least one parameter included in the shooting environment parameters and a corresponding preset condition, and a corresponding lens effect command can be generated based on the target optical lens effect.
[0091] For example, in some embodiments, in response to the focal length parameter satisfying a first preset condition, it is determined that the instruction corresponding to a no-blur effect is a lens effect instruction.
[0092] Specifically, in this embodiment, a corresponding focal length threshold can be preset according to the characteristics of the lens, and the specific data of the focal length threshold is not limited by the embodiment of the present disclosure. For example, for a conventional mobile phone lens, the focal length threshold can be set to 5m.
[0093] When taking a picture with a mobile phone lens, the focal distance between the subject currently being photographed and the mobile phone lens can be detected to obtain a focal distance parameter. This disclosure does not limit the distance detection method, and can be realized using any existing distance detection method such as a depth sensor, a focus AF value, etc., which will not be repeated in this disclosure.
[0094] If the current focal length parameter exceeds the focal length threshold, it is determined that the focal length parameter meets the first preset condition, which means that the current object is too far from the lens, and the accuracy of the depth calculation drops sharply, and the processing effect of the blurring algorithm drops.Therefore, in this case, there is no need to perform blurring. That is, it can be determined that no blurring is performed on the image to be processed, and the corresponding lens effect command can be empty.
[0095] For example, in some embodiments, in response to the ambient light brightness parameter satisfying a second preset condition, it is determined that the instruction corresponding to a soft focus blur effect is a lens effect instruction.
[0096] Specifically, in this embodiment, a corresponding ambient light brightness threshold can be preset, and when a mobile terminal is used to take a photo, the ambient light brightness parameter of the current shooting scene can be detected. This disclosure does not limit the ambient light brightness detection method, and can be implemented by existing ambient light detection methods such as an ambient light sensor, which will not be repeated in this disclosure.
[0097] If the current ambient light brightness parameter exceeds the ambient light brightness threshold, it is determined that the ambient light brightness parameter meets a second preset condition, which means that the ambient light intensity of the current scene is high, thereby determining that the soft focus blur effect is the target optical lens effect and the command corresponding to the soft focus blur effect is the target blur command.
[0098] For example, in some embodiments, in response to the subject detection parameters satisfying a third preset condition, it is determined that the instruction corresponding to a black and white blur effect is the lens effect instruction.
[0099] Specifically, in this embodiment, a subject is detected in the field of view of the current image capture, and it is possible to determine whether or not a preset subject is included in the current field of view. For example, it is possible to determine whether or not a human body is included in the current field of view by human body detection, face detection, or the like.
[0100] If the field of view of the current shooting does not include the preset subject, it is determined that the subject detection parameters meet the third preset condition, which means that the current shooting is not a shooting of the preset subject, so that it can be determined that the black and white blur effect is the target optical lens effect and the command corresponding to the black and white blur effect is the target blur command.
[0101] For example, in some embodiments, in response to the light spot detection parameters satisfying a fourth preset condition, it is determined that the command corresponding to the focus rotation blur effect is a lens effect command.
[0102] Specifically, in this embodiment, the corresponding light spot range threshold can be preset, and when a mobile terminal is used to take a photo, the light spot detection parameters of the current shooting scene can be detected. This disclosure does not limit the light spot detection method, and can be implemented by known light spot detection methods such as brightness threshold division, pixel ability estimation, etc., which will not be repeated in this disclosure.
[0103] When the current light spot detection parameters exceed the light spot range threshold, it is determined that the light spot detection parameters meet the fourth preset condition, which means that there are many light spot areas in the current scene, so that it can be determined that in this case, the focus rotation blur effect is the target optical lens effect, and the command corresponding to the focus rotation blur effect is the target blur command.
[0104] For example, in some embodiments, if all the above parameters do not satisfy the corresponding preset conditions, i.e., the focal length parameter does not satisfy the first preset condition, the ambient light brightness parameter does not satisfy the second preset condition, the subject detection parameter does not satisfy the third preset condition, and the light spot detection parameter does not satisfy the fourth preset condition, it can be determined that the reference blur effect is the target optical lens effect, and the command corresponding to the reference blur effect is the target blur command.
[0105] Through the above process, the mobile terminal determines a target optical lens effect and generates a corresponding lens effect command. After the lens effect command is determined, the mobile terminal can determine a target blurring algorithm based on the lens effect command, and blur the image to be processed using the target blurring algorithm to obtain the target image.
[0106] As can be seen from the above, a plurality of blurring algorithms are preset in the mobile terminal, so that different blurring algorithms are used for processing according to different shooting scenes, and various optical lens effects can be accurately simulated in various shooting scenes, so as to improve the image pickup quality, meet the user's shooting needs in various scenes, and improve the user's shooting experience. The mobile terminal can automatically select an appropriate blurring algorithm based on the current shooting environment parameters, and does not need the user to manually select it, so that the blurring process can be realized without the user's perception, reducing the user's learning cost and improving the usage experience.
[0107] As shown in FIG. 7, in some embodiments, when the target blurring algorithm is a reference blurring algorithm, the step of blurring the image to be processed based on the target blurring algorithm to obtain the target image includes the following steps S710 to S730.
[0108] In S710, image division is performed on the image to be processed to obtain at least two blur layers.
[0109] At S720, each blurred layer is filtered respectively to obtain a blurred result layer.
[0110] In S730, the blurred result layers of each blur layer are blended to obtain a target image.
[0111] In an embodiment of the present disclosure, the image to be processed refers to an image that requires blurring, and the image to be processed includes multiple different blur regions, and multiple blur layers can be obtained by splitting each blur region into a separate blur layer.
[0112] For example, in one example, the image to be processed is a portrait image, the portrait image may include a portrait region that does not need blurring and a blur target region that needs blurring, and the blur target region may include background regions with different depths of field. In an embodiment of the present disclosure, the blur target region may be subjected to image segmentation based on an image segmentation technique, and the background regions with different depths of field may be separately segmented to form multiple blur layers.
[0113] After obtaining multiple blur layers, each blur layer can be filtered respectively. Since the process of image filtering is a process of blurring an image, and different blur layers may be suitable for different blur effects, in the embodiment of the present disclosure, each blur layer can be subjected to different filtering processes to obtain a corresponding blur result layer.
[0114] After obtaining the blurred result layer corresponding to each blur layer, each blurred result layer can be fused to obtain the final target image, for example, each blurred result layer is fused first, and then fused with the portrait area that does not need to be blurred to obtain the target image.
[0115] The above points that have not been described in detail can be fully realized by those skilled in the art by referring to the relevant technologies, and therefore will not be repeated in the present disclosure.
[0116] As can be seen from the above, in the embodiment of the present disclosure, the image to be processed is divided into multiple blur layers, each blur layer is filtered respectively, and then the target image is obtained by fusion, so as to provide appropriate filtering effects for each blur layer, improve the blur effect of each blur layer, and improve the imaging quality.
[0117] As shown in FIG. 8, in some embodiments, when the target blurring algorithm is a focus rotation blurring algorithm, the step of blurring the image to be processed based on the target blurring algorithm to obtain the target image includes the following steps S810 to S830.
[0118] In S810, image division is performed on the image to be processed to obtain a light spot layer and a background layer.
[0119] In S820, the background layer is filtered to obtain a background result layer, and the light spot layer is filtered according to a preset vignetting mask layer to obtain a light spot result layer.
[0120] In S830, the background result layer and the light spot result layer are fused to obtain a target image.
[0121] In the embodiment of the present disclosure, based on the above, an image to be processed is divided into a non-blurred layer that does not require blurring and a blur target layer that requires blurring. Then, the light spot area of the blur target layer is further divided to obtain a light spot layer corresponding to the light spot area and a background layer corresponding to the background area other than the light spot area. The blur target area can include a light spot area formed by the reflection of light or glass, and a background area other than the light spot area.
[0122] It should be noted that the focus rotation blur algorithm mainly performs a blurring process on the light spot layer that is different from other algorithms. Therefore, in the embodiment of the present disclosure, for example, Gaussian filtering can be performed on the background layer to obtain a background result layer. As for the light spot layer, the light spot layer can be filtered based on a preset vignetting mask layer to obtain a light spot result layer.
[0123] Vignetting is an imaging characteristic of a light spot, and the purpose of the vignetting mask layer is to simulate the enhancement of the vignetting effect on the light spot layer by a software algorithm, so that the light spot has a more atmospheric effect. For example, in one example, the light spot can be changed to a crescent shape, a heart shape, etc., to add atmosphere to the foreground portrait. Those skilled in the art can understand this, and the details will not be repeated in this disclosure.
[0124] After the background result layer and the light spot result layer are obtained, they can be fused together and processed with the portrait area that does not need blurring to obtain the target image.
[0125] As can be seen from the above, in the embodiment of the present disclosure, a vignetting effect is added to the image light point based on the vignetting mask layer, so that the image can simulate the imaging effect of a focus rotation lens and improve the imaging atmosphere.
[0126] As shown in FIG. 9, in some embodiments, when the target blurring algorithm is a black and white blurring algorithm, the step of blurring the image to be processed based on the target blurring algorithm to obtain the target image includes the following steps S910 to S940.
[0127] In S910, the image to be processed is converted from a color image to a black and white image.
[0128] In S920, image segmentation is performed on the black and white image to obtain at least two blur layers.
[0129] In S930, each blurred layer is filtered respectively to obtain a blurred result layer.
[0130] In S940, the blurred result layers of each blur layer are blended to obtain a target image.
[0131] The embodiment of the present disclosure differs from the embodiment of Fig. 7 in that the image to be processed must be converted from a color image to a black-and-white image before the image to be processed is blurred. There are multiple ways to convert the image to a black-and-white image from a color image, such as discarding color channels, converting the image mode to a grayscale mode, adjusting hue / saturation parameters, and the present disclosure is not limited thereto.
[0132] After color conversion of the image to be processed, blurring processing can be performed on the image to be processed to obtain a target image, with reference to the embodiment of FIG. 7 above, which will not be repeated in this disclosure.
[0133] In some embodiments, after the target image is obtained, a black and white filter can be added to the target image to further enhance the gradation effect of the target image and improve image quality.
[0134] As can be seen from the above, in the embodiment of the present disclosure, the blur effect of a black and white image is realized by dividing the image to be processed into multiple blur layers, filtering each blur layer respectively, and then obtaining the target image by fusion, so as to provide an appropriate filtering effect for each blur layer, improve the blur effect of each blur layer, make the image simulate the imaging effect of a black and white lens, and improve the imaging mass.
[0135] As shown in FIG. 10, in some embodiments, when the target blur algorithm is a soft focus blur algorithm, the step of blurring the image to be processed based on the target blur algorithm to obtain the target image includes the following steps S1010 to S1040.
[0136] In S1010, image division is performed on the image to be processed to obtain at least two blur layers.
[0137] In S1020, each blurred layer is filtered respectively to obtain a blurred result layer.
[0138] In S1030, the blurred result layers of each blur layer are blended to obtain an intermediate image.
[0139] In S1040, highlight emphasis processing is performed on the intermediate image to obtain the target image.
[0140] In the embodiment of the present disclosure, steps S1010 to S1030 may be the same as the embodiment of Fig. 7 described above, and will not be described in detail in the present disclosure. The differences are as follows: when performing soft focus blurring, after each blur result layer is fused to obtain an intermediate image, a highlight enhancement process is further performed on the intermediate image to brighten the portrait, making the whole image more delicate and soft, avoiding problems such as the portrait being too dark, and making the portrait more prominent.
[0141] As can be seen from the above, in the embodiment of the present disclosure, the image to be processed is divided into multiple blur layers, each blur layer is filtered respectively, and then the target image is obtained by fusion, so that each blur layer can be provided with a suitable filtering effect, the blur effect of each blur layer can be improved, the image can simulate the imaging effect of a soft focus lens, and the imaging quality can be improved. In addition, the highlight enhancement process is performed on the image to brighten the portrait, so that the whole image is more delicate and soft, and the portrait can be more prominent, avoiding problems such as being too dark.
[0142] In addition, in the embodiments of the present disclosure, the images to be processed may be images collected in real time by a mobile terminal or images in an album of the mobile terminal, and the methods of the above embodiments of the present disclosure may also be used to post-process the images in the album, so that the images have the texture of a professional optical lens.
[0143] In this scene, for example, when a user wants to try each optical lens effect and switches from a first optical lens effect to a second optical lens effect, the first blurring algorithm corresponding to the first optical lens effect can be switched to a second blurring algorithm corresponding to the second optical lens effect, and the second blurring algorithm corresponding to the second optical lens effect can be used to perform image processing on the image to be processed, thereby meeting the user's needs.
[0144] In addition, in the above scene, the mobile terminal can improve the operation speed by performing effect processing on the second optical lens based on the processing data corresponding to the first optical lens effect. Hereinafter, it will be described in combination with the embodiment of FIG.
[0145] As shown in FIG. 11, in some embodiments, the exemplary image processing method of the present disclosure further includes the following steps S1110 to S1120.
[0146] In S1110, in response to the mobile terminal turning on the optical lens mode and switching from the first optical lens effect to the second optical lens effect, processing data of an image to be processed in processing of a first blur algorithm corresponding to the first optical lens effect is obtained.
[0147] In S1120, image processing is performed on the processing target image using a second blurring algorithm corresponding to a second optical lens effect based on the processing data.
[0148] Based on the foregoing, when turning on the optical lens mode, the mobile terminal can output a tab for the user to select an optical lens effect, whereby after the user selects an optical lens effect, the mobile terminal can process the image to be processed based on a blur algorithm corresponding to the optical lens effect to obtain a target image. In an embodiment of the present disclosure, the optical lens effect is defined as a "first optical lens effect", and the corresponding blur algorithm is a "first blur algorithm".
[0149] In some embodiments, for example, if a user is not satisfied with the image presented by the first optical lens effect and switches the first optical lens effect to a second optical lens effect, re-processing the image based on a second blur algorithm corresponding to the second optical lens effect is computationally intensive and time consuming.
[0150] As can be seen from the above algorithm process, different optical lenses often use the same steps or parameters when processing an image, such as spot detection, image division, layer filtering, etc. Therefore, in the embodiment of the present disclosure, some or all of the processing data in the processing process of the first blurring algorithm can be reused to perform the processing of the second blurring algorithm.
[0151] For example, when switching from the first optical lens effect to the second optical lens effect, the first blurring algorithm obtains processing data when processing the image to be processed, and the processing data may include, for example, light spot detection data, image division data, filtering processing data, etc. As a result, when the image to be processed is processed by the second blurring algorithm, it is not necessary to perform image division, filtering calculation, etc. again, and it is sufficient to perform calculations directly based on the processing data obtained by the first blurring algorithm, thereby reducing the amount of calculation.
[0152] For example, in one example, the first optical lens effect is a focus rotation blur effect, and the second optical lens effect is a soft focus blur effect, and when switching from the first optical lens effect to the second optical lens effect, the image processing time can be shortened by performing the calculation of the soft focus blur directly based on the data such as the light spot layer, the background layer, the filter image, etc. obtained in the process of the focus rotation blur algorithm.
[0153] As can be seen from the above, in an embodiment of the present disclosure, when switching optical lens effects, the next image processing can be performed based on the data of the previous image processing, thereby reducing the amount of calculation in the image processing, shortening the image processing time, and improving efficiency.
[0154] According to a second aspect, an embodiment of the present disclosure provides an image processing device, which is applicable to a mobile terminal, and the mobile terminal of the embodiment of the present disclosure may be any type of device suitable for implementation, such as a smartphone, a tablet computer, a handheld computer, etc., but the present disclosure is not limited thereto.
[0155] As shown in FIG. 12, in some embodiments, an exemplary image processing device of the present disclosure includes: An acquisition module 10 for acquiring a lens effect command and determining a target blur algorithm from a plurality of preset blur algorithms according to the lens effect command, the blur algorithm being an algorithm for simulating an optical lens effect; and a blur processing module 20 for blurring the image to be processed based on a target blur algorithm to obtain a target image.
[0156] As can be seen from the above, in the embodiment of the present disclosure, multiple blurring algorithms are pre-configured in the mobile terminal, and different blurring algorithms are used for processing different shooting scenes, so that different optical lens effects can be accurately simulated in different shooting scenes, improving the imaging quality of the image, meeting the shooting needs of users in different scenes, and improving the shooting experience of the user.
[0157] In some embodiments, the acquisition module 10 comprises: In response to the mobile terminal turning on the optical lens mode, the mobile terminal is configured to obtain current shooting environment parameters, the shooting environment parameters including at least one of a focal length parameter, an ambient light brightness parameter, a subject detection parameter, and a light spot detection parameter, and to determine a lens effect command based on the current shooting environment parameters.
[0158] In some embodiments, the acquisition module 10 comprises: The lens effect command corresponding to the target optical lens effect is determined based on a relationship between at least one parameter included in the shooting environment parameters and a corresponding preset condition.
[0159] In some embodiments, the acquisition module 10 comprises: determining, in response to the focal length parameter satisfying a first preset condition, that the instruction corresponding to a non-blurring effect is a lens effect instruction; In response to the ambient light brightness parameter satisfying a second preset condition, determine that the instruction corresponding to a soft focus blur effect is a lens effect instruction; In response to the subject detection parameter satisfying a third preset condition, determining that the command corresponding to the black and white blur effect is a lens effect command; In response to the light spot detection parameters satisfying a fourth preset condition, determine that the command corresponding to the focus rotation blur effect is a lens effect command; and configured to determine that the command corresponding to the reference blur effect is a lens effect command in response to the focal length parameter not satisfying a first preset condition, the ambient light brightness parameter not satisfying a second preset condition, the subject detection parameter not satisfying a third preset condition, and the light spot detection parameter not satisfying a fourth preset condition.
[0160] In some embodiments, the optical lensing effect includes: At least one of a no blur effect, a soft focus blur effect, a black and white blur effect, a focus rotation blur effect and a reference blur effect is included.
[0161] As can be seen from the above, multiple blur algorithms are preset in the mobile terminal, so that different blur algorithms are used for processing according to different shooting scenes, and various optical lens effects can be accurately simulated in various shooting scenes, improving the image pickup quality, meeting the user's shooting needs in various scenes, and improving the user's shooting experience. In addition, the user can automatically select an appropriate blur algorithm based on the current shooting environment parameters, and does not need to manually select it, so that the blur processing can be realized without the user's perception, reducing the user's learning cost and improving the user's usage experience.
[0162] In some embodiments, the acquisition module 10 comprises: In response to the mobile terminal turning on the optical lens mode, outputting a selection interface displaying an optical lens effect; It is configured to receive a user input command from a user at the selection interface, and generate a corresponding lens effect command based on the user input command.
[0163] As can be seen from the above, in the embodiment of the present disclosure, a plurality of blurring algorithms are preset in the mobile terminal, so that different blurring algorithms are used for processing according to different shooting scenes, and various optical lens effects can be accurately simulated in various shooting scenes, so as to improve the image pickup quality and meet the user's shooting needs in various scenes. In addition, the user can freely select the blurring algorithm, so as to improve the user's shooting operability and improve the user's shooting experience.
[0164] In some embodiments, the blur processing module 20: Perform image division on the image to be processed to obtain at least two blur layers, Filter each blur layer individually to get the blur result layer, The blurred result layers of each blur layer are blended to obtain a target image.
[0165] As can be seen from the above, in the embodiment of the present disclosure, the image to be processed is divided into multiple blur layers, each blur layer is filtered respectively, and then the target image is obtained by fusion, so as to provide appropriate filtering effects for each blur layer, improve the blur effect of each blur layer, and improve the imaging quality.
[0166] In some embodiments, the blur processing module 20: The image to be processed is divided into a light spot layer and a background layer. Filter the background layer to obtain a background result layer; and filter the light spot layer according to the preset vignetting mask layer to obtain a light spot result layer; The background result layer and the light spot result layer are configured to be fused to obtain a target image.
[0167] As can be seen from the above, in the embodiment of the present disclosure, a vignetting effect is added to the image light point based on the vignetting mask layer, so that the image can simulate the imaging effect of a focus rotation lens and improve the imaging atmosphere.
[0168] In some embodiments, the blur processing module 20: Convert the image to be processed from a color image to a black and white image, Perform image segmentation on the black and white image to obtain at least two blur layers, Filter each blur layer individually to get the blur result layer, The blurred result layers of each blur layer are blended to obtain a target image.
[0169] As can be seen from the above, in the embodiment of the present disclosure, the blur effect of a black-and-white image is realized by dividing the image to be processed into multiple blur layers, filtering each blur layer respectively, and then obtaining the target image by fusion, so as to provide a suitable filtering effect for each blur layer, improve the blur effect of each blur layer, and improve the imaging effect and imaging mass of the black-and-white lens used to simulate the image.
[0170] In some embodiments, the blur processing module 20: Perform image division on the image to be processed to obtain at least two blur layers, Filter each blur layer individually to get the blur result layer, The blurred result layers of each blur layer are blended to obtain an intermediate image. The intermediate image is subjected to highlight enhancement processing to obtain a target image.
[0171] As can be seen from the above, in the embodiment of the present disclosure, the image to be processed is divided into multiple blur layers, each blur layer is filtered respectively, and then the target image is obtained by fusion, so that each blur layer can be provided with a suitable filtering effect, the blur effect of each blur layer can be improved, the image can simulate the imaging effect of a soft focus lens, and the imaging quality can be improved. In addition, the highlight enhancement process is performed on the image to brighten the portrait, so that the whole image is more delicate and soft, and the portrait can be more prominent, avoiding problems such as being too dark.
[0172] In some embodiments, the blur processing module 20 further comprises: In response to the mobile terminal turning on an optical lens mode and switching from a first optical lens effect to a second optical lens effect, acquiring processing data of an image to be processed in processing of a first blur algorithm corresponding to the first optical lens effect; The apparatus is configured to perform image processing on the target image using a second blurring algorithm corresponding to the second optical lens effect based on the processing data.
[0173] As can be seen from the above, in an embodiment of the present disclosure, when switching optical lens effects, the next image processing can be performed based on the data of the previous image processing, thereby reducing the amount of calculation in the image processing, shortening the image processing time, and improving efficiency.
[0174] According to a third aspect, an embodiment of the present disclosure provides a mobile terminal, the mobile terminal comprising: A processor; and a memory for storing computer instructions, The computer instructions are adapted for use by a processor to carry out the image processing method according to any of the embodiments of the first aspect.
[0175] According to a fourth aspect, an embodiment of the present disclosure provides a storage medium having computer instructions stored thereon, comprising: The computer instructions are used to cause a computer to carry out the image processing method according to any of the embodiments of the first aspect.
[0176] FIG. 13 is a structural block diagram showing a mobile terminal in some embodiments of the present disclosure. Hereinafter, in combination with FIG. 13, the relevant principles of the mobile terminal and the storage medium in some embodiments of the present disclosure will be described.
[0177] Referring to FIG. 13 , a mobile terminal 1800 may include at least one selected from the group consisting of a processing component 1802, a memory 1804, a power component 1806, a multimedia component 1808, an audio component 1810, an input / output (I / O) interface 1812, a sensor component 1816, and a communication component 1818.
[0178] The processing component 1802 generally controls the overall operation of the mobile terminal 1800, such as operations related to display, telephone calls, data communications, camera operation, and recording operations. The processing component 1802 may include at least one processor 1820 for executing instructions. The processing component 1802 may also include at least one module to facilitate interaction with other components. For example, the processing component 1802 may include a multimedia module to facilitate interaction with the multimedia component 1808. The processing component 1802 may also read executable instructions from memory to implement associated functions of the mobile terminal.
[0179] Memory 1804 is arranged to store various data to support operation of mobile terminal 1800. Such data may include, for example, instructions for operating any application or method on mobile terminal 1800, contact data, phone book data, messages, images, videos, etc. Memory 1804 may be implemented with any type of volatile or non-volatile memory, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk, or any combination thereof.
[0180] The power component 1806 is for providing power to the various components of the mobile terminal 1800 and may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the mobile terminal 1800.
[0181] Multimedia component 1808 may include a screen that provides an output interface between the mobile terminal 1800 and a user. In some embodiments, multimedia component 1808 includes a front camera and / or a rear camera. When mobile terminal 1800 is in an operational mode, such as a photo mode or a video mode, at least one of the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera may have a fixed optical lens system or may have a focal length and optical zoom capability.
[0182] The audio component 1810 is configured to input and / or output audio signals. For example, the audio component 1810 includes a microphone (MiC) that is configured to receive external audio signals when the mobile terminal 1800 is in an operation mode such as a call mode, a record mode, or a voice recognition mode. The received audio signals may be further stored in the memory 1804 or transmitted via the communication component 1818. In some embodiments, the audio component 1810 further comprises a speaker for outputting audio signals.
[0183] The I / O interface 1812 is for providing an interface between the processing component 1802 and a peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may be at least one of, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0184] The sensor component 1816 may include at least one sensor that evaluates various conditions for the mobile terminal 1800. For example, the sensor component 1816 may detect an on or off state of the mobile terminal 1800, the relative position of a component, such as the display and keypad of the mobile terminal 1800, and may detect a change in the position of the mobile terminal 1800 or one of its components, whether a user is touching the mobile terminal 1800, the orientation or acceleration / deceleration of the mobile terminal 1800, and a temperature change of the mobile terminal 1800. The sensor component 1816 may include a proximity sensor that is positioned to detect nearby objects in the absence of any physical contact. The sensor component 1816 may include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 1816 may further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0185] The communication component 1818 is arranged to facilitate wireless or wired communication between the mobile terminal 1800 and other equipment. The mobile terminal 1800 can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, or 6G, or a combination thereof. In one exemplary embodiment, the communication component 1818 receives a broadcast signal or information related to a broadcast from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 1818 may further include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented by Radio Frequency Identification Device (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0186] In an exemplary embodiment, the mobile terminal 1800 may be implemented with one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic devices to perform the methods described above.
[0187] Obviously, the above embodiment is merely an example for clear description, and is not intended to limit the embodiment. Those skilled in the art can make other different forms of modifications or modifications based on the above description. It is not necessary and cannot be possible to cover all implementations here. However, obvious modifications or modifications derived therefrom still fall within the scope of protection of the present disclosure.
Claims
1. obtaining a lens effect command; and determining a target blur algorithm from a plurality of preset blur algorithms based on the lens effect command, the blur algorithm being an algorithm for simulating an optical lens effect; Blurring the image to be processed based on the target blurring algorithm to obtain a target image; The step of obtaining the lens effect instruction includes: Acquiring current shooting environment parameters in response to the mobile terminal turning on an optical lens mode, the shooting environment parameters including at least one of a focal length parameter, an ambient light brightness parameter, a subject detection parameter, and a light spot detection parameter; determining, in response to the focal length parameter satisfying a first preset condition, that an instruction corresponding to a non-blurring effect is the lens effect instruction; determining that the lens effect command is an instruction corresponding to a soft focus blur effect in response to the ambient light brightness parameter satisfying a second preset condition; determining that an instruction corresponding to a black and white blur effect is the lens effect instruction in response to the subject detection parameter satisfying a third preset condition; determining that the command corresponding to a focus rotation blur effect is the lens effect command in response to the light spot detection parameters satisfying a fourth preset condition; determining that an instruction corresponding to a reference blur effect is the lens effect instruction in response to the focal length parameter not satisfying a first preset condition, the ambient light brightness parameter not satisfying a second preset condition, the subject detection parameter not satisfying a third preset condition, and the light spot detection parameter not satisfying a fourth preset condition.
13. An image processing method comprising:
2. In response to a mobile terminal turning on an optical lens mode and switching from a first optical lens effect to a second optical lens effect, acquiring processing data of an image to be processed in processing a first blur algorithm corresponding to the first optical lens effect; and performing image processing on the target image using a second blurring algorithm corresponding to the second optical lens effect based on the processing data.
2. The image processing method according to claim 1.
3. The optical lens effect includes: At least one of a no-blur effect, a soft-focus blur effect, a black-and-white blur effect, a focus rotation blur effect, and a reference blur effect is included; 2. The image processing method according to claim 1.
4. The step of obtaining the lens effect instruction includes: In response to the mobile terminal turning on the optical lens mode, outputting a selection interface displaying an optical lens effect; receiving a user input command from a user at the selection interface; and generating a corresponding lens effect command based on the user input command.
2. The image processing method according to claim 1.
5. When the target blur algorithm is a reference blur algorithm, the step of blurring the image to be processed based on the target blur algorithm to obtain a target image includes: performing image division on the image to be processed to obtain at least two blur layers; filtering each blurred layer respectively to obtain a blurred result layer; and fusing the blurred result layers of each blur layer to obtain the target image.
5. The image processing method according to claim 1,
6. When the target blurring algorithm is a focus rotation blurring algorithm, the step of blurring the image to be processed according to the target blurring algorithm to obtain a target image includes: performing image division on the image to be processed to obtain a light spot layer and a background layer; filtering the background layer to obtain a background result layer, and filtering the light spot layer according to a preset vignetting mask layer to obtain a light spot result layer; Fusing the background result layer and the light spot result layer to obtain the target image.
5. The image processing method according to claim 1,
7. When the target blurring algorithm is a black-and-white blurring algorithm, the step of blurring the image to be processed according to the target blurring algorithm to obtain a target image includes: converting the image to be processed from a color image to a black and white image; performing image segmentation on the monochrome image to obtain at least two blur layers; filtering each blurred layer respectively to obtain a blurred result layer; and fusing the blurred result layers of each blur layer to obtain the target image.
5. The image processing method according to claim 1,
8. When the target blurring algorithm is a soft focus blurring algorithm, the step of blurring the image to be processed based on the target blurring algorithm to obtain a target image includes: performing image division on the image to be processed to obtain at least two blur layers; filtering each blurred layer respectively to obtain a blurred result layer; Fusing the blurred result layers of each blur layer to obtain an intermediate image; performing highlight enhancement processing on the intermediate image to obtain the target image; 5. The image processing method according to claim 1,
9. an acquisition module for acquiring a lens effect command, and determining a target blur algorithm from a plurality of preset blur algorithms according to the lens effect command, the blur algorithm being an algorithm for simulating an optical lens effect; a blur processing module for blurring the image to be processed based on the target blur algorithm to obtain a target image; The acquisition module further comprises: In response to the mobile terminal turning on an optical lens mode, obtain current shooting environment parameters, the shooting environment parameters including at least one of a focal length parameter, an ambient light brightness parameter, a subject detection parameter, and a light spot detection parameter; determining that an instruction corresponding to a non-blurring effect is the lens effect instruction in response to the focal length parameter satisfying a first preset condition; determining that the lens effect instruction corresponds to a soft focus blur effect in response to the ambient light brightness parameter satisfying a second preset condition; determining that an instruction corresponding to a black and white blur effect is the lens effect instruction in response to the subject detection parameter satisfying a third preset condition; In response to the light spot detection parameters satisfying a fourth preset condition, determining that the command corresponding to a focus rotation blur effect is the lens effect command; configured to determine that an instruction corresponding to a reference blur effect is the lens effect instruction in response to the focal length parameter not satisfying a first preset condition, the ambient light brightness parameter not satisfying a second preset condition, the subject detection parameter not satisfying a third preset condition, and the light spot detection parameter not satisfying a fourth preset condition.
13. An image processing device comprising:
10. A mobile terminal, A processor; and a memory for storing computer instructions, The computer instructions are used by the processor to execute the image processing method according to any one of claims 1 to 4. A mobile terminal characterized by:
11. A storage medium on which computer instructions are stored, comprising: The computer instructions are used to cause a computer to execute the image processing method according to any one of claims 1 to 4. A storage medium comprising:
Citation Information
Patent Citations
Imaging apparatus
JP2009200900A
Image processing apparatus and image processing method
JP2009218708A
Imaging apparatus, image reproducing apparatus, and image processing apparatus
JP2012160863A
Image processing apparatus, image processing method, and program
JP2016039563A
