CN114666513A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN114666513A
CN114666513A CN202210195755.6A CN202210195755A CN114666513A CN 114666513 A CN114666513 A CN 114666513A CN 202210195755 A CN202210195755 A CN 202210195755A CN 114666513 A CN114666513 A CN 114666513A
Authority
CN
China
Prior art keywords
image
images
frames
processing
focal length
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.)
Granted
Application number
CN202210195755.6A
Other languages
Chinese (zh)
Other versions
CN114666513B (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202210195755.6A priority Critical patent/CN114666513B/en
Publication of CN114666513A publication Critical patent/CN114666513A/en
Application granted granted Critical
Publication of CN114666513B publication Critical patent/CN114666513B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/2625Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects for obtaining an image which is composed of images from a temporal image sequence, e.g. for a stroboscopic effect
    • 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/67Focus control based on electronic image sensor signals
    • H04N23/675Focus control based on electronic image sensor signals comprising setting of focusing regions
    • 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/67Focus control based on electronic image sensor signals
    • H04N23/676Bracketing for image capture at varying focusing conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/2628Alteration of picture size, shape, position or orientation, e.g. zooming, rotation, rolling, perspective, translation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing

Abstract

The application discloses an image processing method and device, and belongs to the technical field of image processing. The method comprises the following steps: acquiring N frames of images of a target object through N focal lengths, wherein each focal length corresponds to one frame of image, and N is an integer greater than 1; performing rotary focusing processing on M frames of images in the N frames of images, wherein the M frames of images are images with focal lengths between a first focal length and a preset rotary focusing focal length, the first focal length is the focal length of the image with the maximum definition in the N frames of images, the first focal length is smaller than the preset rotary focusing focal length, and M is an integer smaller than or equal to N; and carrying out image processing on the M frames of images after the focusing processing to obtain a target image.

Description

Image processing method and device
Technical Field
The present application belongs to the field of image processing technology, and in particular, relates to an image processing method and apparatus.
Background
At present, when a user shoots through an electronic device, the electronic device can perform a focusing effect simulation on a shot image, and in the related art, the electronic device can perform central radiation blurring processing on the shot image so that the shot image achieves a focusing effect.
However, in the above method, since the blurring process of the central radiation is formed based on the change of the focal length within a time period, the process is continuous, and the gradual change process of the focal length from clear to blurred is difficult to achieve a natural transition in the current algorithm, so that the display effect of the in-focus image shot by the electronic device is poor.
Disclosure of Invention
The embodiment of the application aims to provide an image processing method and device, which can solve the problem of poor display effect of a rotary-focus image shot by electronic equipment.
In a first aspect, an embodiment of the present application provides an image processing method, including: acquiring N frames of images of a target object through N focal lengths, wherein each focal length corresponds to one frame of image, and N is an integer greater than 1; performing rotary focusing processing on M frame images in the N frame images, wherein the M frame images are images with focal lengths between a first focal length and a preset rotary focusing focal length, the first focal length is the focal length of the image with the maximum definition in the N frame images, the first focal length is smaller than the preset rotary focusing focal length, and M is an integer smaller than or equal to N; and carrying out image processing on the M frames of images after the focusing processing to obtain a target image.
In a second aspect, an embodiment of the present application provides an image processing apparatus, including: the device comprises an acquisition module and a processing module. The acquisition module is used for acquiring N frames of images of the target object through N focal lengths, each focal length corresponds to one frame of image, and N is an integer greater than 1. The processing module is used for performing rotary focusing processing on M frames of images in the N frames of images, wherein the M frames of images are images with focal lengths between a first focal length and a preset rotary focusing focal length, the first focal length is the focal length of the image with the maximum definition in the N frames of images, the first focal length is smaller than the preset rotary focusing focal length, and M is an integer smaller than or equal to N; and performing image processing on the M frames of images after the focusing processing to obtain a target image.
In a third aspect, embodiments of the present application provide an electronic device, which includes a processor and a memory, where the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product, stored on a storage medium, for execution by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, because the electronic device collects the N frames of images of the target object through the N focal lengths, it can be understood that the larger the focal length is, the smaller the shooting range is, and the lower the image definition is, that is, the image from clear to fuzzy and from integral to local is obtained in the N frames of images obtained by the electronic device, so that after the electronic device performs the rotary focusing processing on the M frames of images in the N frames of images within the preset focal length range, a more natural gradual change process from clear to fuzzy can be obtained, and the problem that in the related art, the electronic device simulates a single image and the existing rotary focusing effect is unnatural is solved, so that the image effect of the electronic device in shooting the rotary focusing image is improved.
Drawings
Fig. 1 is a flowchart of an image processing method provided in an embodiment of the present application;
fig. 2 is a schematic diagram of an image processing method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
fig. 4 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present disclosure;
fig. 5 is a second schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The image processing method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
At present, when a user uses an electronic device to shoot, if the user needs to obtain an image with a certain shooting effect, the image shot by the user may be processed by some application programs to obtain the shooting effect required by the user, for example, when the user needs to obtain an image with a rotary-focus shooting effect, the user may simulate the rotary-focus effect of a layer of the shot image in an image editing application program to obtain the rotary-focus effect required by the user. It should be noted that the zoom-in is a shooting skill in photography, and during the shooting process, a user can rotate the lens (i.e. adjust the focal length), so that an image with explosive effect can be obtained due to the continuous zoom change of the lens and the continuous exposure during the imaging process.
However, in the above method, the effect of the zoom in achieved through simulation of the image editing application program is often different from the effect of the zoom in image captured by the electronic device (for example, a digital camera), that is, the blurring effect may not be natural enough, and thus, the image capturing effect of the electronic device is poor.
In the embodiment of the application, the electronic device can acquire N frames of images of the target object through N focal lengths, then perform focusing processing on M frames of images in the N frames of images between the first focal length and the preset focal length, and perform image processing on the M frames of images after the focusing processing to obtain the target image. In the scheme, the electronic equipment collects the N frames of images of the target object through the N focal lengths, so that the larger the focal length is, the smaller the shooting range is, and the lower the image definition is, namely, the N frames of images obtained by the electronic equipment are from clear to fuzzy and from integral to local images, therefore, after the electronic equipment carries out rotary focusing processing on the M frames of images in the N frames of images within the preset focal length range, a natural gradual change process from clear to fuzzy can be obtained, the problem that in the related technology, the electronic equipment simulates a single image and the existing rotary focusing effect is unnatural is solved, and the image effect of the rotary focusing images shot by the electronic equipment is improved.
An embodiment of the present application provides an image processing method, and fig. 1 shows a flowchart of an image processing method provided in an embodiment of the present application. As shown in fig. 1, the image processing method provided in the embodiment of the present application may include steps 201 to 203 described below.
Step 201, the electronic device acquires N frames of images of the target object through N focal lengths.
In this embodiment, each of the N focal lengths corresponds to one of the N frames of images, and N is an integer greater than 1.
In the embodiment of the application, when the electronic device displays a shooting preview interface, a user may trigger the electronic device to acquire N frames of images of a target object through N focal lengths in a camera by using touch input, specific gesture input, or combination key input (for example, combination input of a power key and a volume key) to a shooting control, so that the electronic device may perform focus rotation processing on the N frames of images.
It should be noted that the above-mentioned shooting is performed by the user at the same position, so that the electronic device can obtain a plurality of image sets with different focal lengths at the same position through N focal lengths, that is, N frames of images obtained by the electronic device are image sets from clear to blurred and from whole to local at the same position.
Alternatively, in this embodiment, the target object may be a human, an animal, a plant, or an object. The specific method can be determined according to actual use requirements, and the embodiment of the invention is not limited.
Optionally, in this embodiment of the present application, the step 201 may be specifically implemented by the following steps 201a and 201 b.
Step 201a, the electronic device receives a first input of a target object by a user.
Optionally, in this embodiment of the application, the first input may be a click input, a long-press input, a sliding input, a preset trajectory input, or the like; or the first input may be input by a user to a physical key or a combination of physical keys. The specific method can be determined according to actual use requirements, and the embodiment of the invention is not limited.
Step 201b, the electronic device responds to the first input, and shoots the target object through each of the N focal lengths to obtain N frames of images corresponding to the N focal lengths respectively.
It can be understood that, for each of the N frames of images, after receiving the first input, the electronic device may capture the target object with one of the N focal lengths, resulting in one frame of image, so as to obtain the N frames of images.
Optionally, in this embodiment of the application, the electronic device may respectively shoot the target object sequentially through the N focal lengths according to a second order to obtain N frames of images, where the second order is any one of: the magnitude order of the N focal lengths, and the order of the N focal lengths set by the user.
Optionally, in this embodiment of the application, the electronic device may include a plurality of cameras, and the electronic device may capture the target object through the N cameras by using the N focal lengths to obtain N frames of images, where each camera corresponds to one of the N focal lengths.
Optionally, in this embodiment of the application, the electronic device may sequentially shoot the target object through the N cameras by using the N focal lengths according to the second order to obtain N frames of images; or, the electronic device may capture the target object by using N focal lengths through N cameras at the same time, so as to obtain N frames of images.
Optionally, in this embodiment of the application, a user may perform touch input, specific gesture input, or combination key input (for example, combination input of a power key and a volume key) on the video recording control in the camera preview interface, so that the electronic device performs video recording on the target object through N focal lengths in the camera to obtain N frames of images; alternatively, the electronic device may preset N focal lengths, so that when the user performs shooting, the electronic device may perform continuous shooting (i.e., continuous shooting) on the target object through the preset focal lengths to obtain N frames of images.
Optionally, in this embodiment of the application, when the electronic device photographs the target object through the N focal lengths, the electronic device may store each piece of focal length information in the N focal lengths into one frame of image corresponding to each of the N focal lengths; or after shooting is completed, the electronic device may save the focal length information to the electronic device in a file storage manner.
Optionally, in an embodiment of the present application, the focal length information includes at least one of: shooting distance, shooting range and shooting definition.
For example, after a user clicks a shooting control on a shooting preview interface, the electronic device may shoot a target object from a current focal length to a maximum focal length (i.e., N focal lengths) supported by a camera, and store focal length information of the N focal lengths into one frame of image corresponding to each focal length, so that after the shooting is completed, the electronic device may obtain N frames of frame images with different focal lengths at the same position and focal length information corresponding to each frame of image.
In the embodiment of the application, electronic equipment shoots target object through N focuses to obtain N frame image, then through later stage simulation and stack, obtain comparatively natural burnt image soon, avoided electronic equipment to simulate the sola image, and the unnatural problem of burnt effect soon that exists, so, promoted the image effect that electronic equipment shot and revolved burnt image soon.
Step 202, the electronic device performs a focus rotation process on M frames of images among the N frames of images.
In an embodiment of the application, the M-frame image is an image whose focal length is between a first focal length and a preset in-focus focal length, the first focal length is a focal length of an image with a maximum definition in the N-frame image, the first focal length is smaller than the preset in-focus focal length, and M is an integer smaller than or equal to N.
Optionally, in the embodiment of the present application, the electronic device may receive, in the shooting preview interface, a second input to the target object by the user, so that the electronic device may perform focusing processing on the target object, and record current clearly-focused focal length information, thereby determining a first focal length from the current clearly-focused focal length information; or, after the shooting is completed, the electronic device may determine a focal distance corresponding to one frame of image with the highest image definition from the N frames of images as the first focal distance.
Optionally, in this embodiment of the present application, the second input may be any one of: click input, long-press input, slide input, preset trajectory input, or the like. The specific method can be determined according to actual use requirements, and the embodiment of the invention is not limited.
Optionally, in this embodiment of the application, the preset focal length may be a maximum default focal length of the electronic device, a focal length set by a user, or a focal length determined by the electronic device according to image sharpness.
Alternatively, in this embodiment of the present application, the step 202 may be specifically implemented by the following steps 202a to 202 c.
Step 202a, the electronic device determines M-1 first areas from the M-1 frame image according to the target image area in the image corresponding to the first focal length.
In the embodiment of the present application, each of the M-1 first regions is an image region corresponding to a target image region in one frame of image in the M-1 frame of image, and the M-1 frame of image is an image other than an image corresponding to the first focal length in the M frame of image.
In the embodiment of the application, the electronic device can determine the target image area in the image corresponding to the first focal length, so that M-1 first areas are determined from the M-1 frame image between the first focal length and the preset focal length through the mapping relation.
Optionally, in this embodiment of the application, the electronic device may determine a central region or an edge region in the image corresponding to the first focal length as a target image region; or the electronic device may determine a region designated by the user as the target image region.
For example, as shown in fig. 2, assuming that there is one focal length F3 between the first focal length F1 and the preset focal length F2, and the focal length F3 corresponds to one frame image, the electronic device may determine a central region in the image corresponding to the first focal length F1 as a target image region (a region indicated by a dotted line in fig. 2), so that the electronic device may determine a first region at the same position as the target image region from the one frame image corresponding to the focal length F3 according to the target image region.
Step 202b, the electronic device performs weight configuration on the M regions respectively through the M target weight values.
In this embodiment of the present application, each of the M target weight values is respectively used to indicate the definition of one of M regions, where the M regions include a target image region and M-1 first regions.
In the embodiment of the application, after the electronic device determines the target image area and the M-1 first areas, the electronic device may perform weight configuration on the target image area and the M-1 first areas, so that the electronic device may perform the focus rotation processing on the M-frame image according to the weights of the target image area and the M-1 first areas.
Optionally, in this embodiment of the application, the target weight value may be preset by the electronic device, or set by the user according to a requirement of the user.
Optionally, in this embodiment of the present application, the target weight value may be used to indicate a rotation speed of the electronic device when performing the focus rotation processing on the M frames of images.
Step 202c, the electronic device performs focus rotation processing on the M frames of images according to the M target weight values.
In the embodiment of the application, the electronic device can perform the focus rotation processing on the M frames of images based on a preset algorithm according to the M target weight values.
It can be understood that the electronic device may configure the M target weight values differently, so that the image effect of the obtained M frames of images is also different.
Optionally, in this embodiment of the application, after the electronic device performs the focus rotation processing on the M frames of images according to the M target weight values, the user may adjust the M target weight values of the M frames of images, so that the electronic device obtains different image effects.
Illustratively, 100 frames of images exist between the first focal length and the preset focal length, the electronic device records the 100 frames of images as P0 to P100, and respectively configures weights as W0 to W100 for the 100 frames of images, and assuming that the electronic device performs blurring processing on each frame of the 100 frames of images, the weight corresponding to the ith frame of image Pi is Wi, so that Pi is blurred with intensity of 100% -Wi/sum (W), and the image after blurring processing is recorded as P' i, where sum (W) represents the sum of the weights from W0 to W100.
In the embodiment of the application, after the electronic equipment determines the target image area and the M-1 first areas, the electronic equipment can simulate different focusing methods through different configuration weights so as to obtain different focusing effects, and thus, the flexibility of shooting the focusing images by the electronic equipment is improved.
Optionally, in this embodiment of the present application, before the step 202b, the image processing method provided in this embodiment of the present application further includes the following steps 301 and 302.
Step 301, the electronic device performs cropping processing on the image corresponding to the first focal length to obtain a target image area, and performs cropping processing on each frame of image in the M-1 frames of images to obtain M-1 first areas.
In the embodiment of the application, after the electronic device determines the target image area and the M-1 first areas, the electronic device may crop the target image area and the M-1 first areas to extract the target image area and the M-1 first areas, so that the electronic device may perform size enlargement processing on the target image area and the M-1 first areas.
And step 302, respectively carrying out size amplification processing on the target image area and the M-1 first areas to obtain an image with the size matched with the initial size of the M frames of images.
In the embodiment of the application, the electronic device may perform size enlargement processing on the target image area and the M-1 first areas obtained by the cropping processing to obtain an image with the same initial size as that of the M-frame image, so that the electronic device may perform focus rotation processing on the enlarged target image area and the M-1 first areas to obtain the target image.
In the embodiment of the application, after the electronic equipment cuts the M frames of images to obtain the target image area and the M-1 first areas, the target image area and the M-1 first areas are respectively amplified to the images with the same initial size as that of the M frames of images, so that the electronic equipment performs the rotary focusing processing through the amplified target image area and the M-1 first areas, a more natural gradient process from clear to fuzzy can be obtained, and thus, the image effect of the electronic equipment for shooting the rotary focusing images is improved.
And step 203, the electronic equipment performs image processing on the M frames of images after the focusing processing to obtain a target image.
In the embodiment of the application, the electronic device may perform superposition processing on the M frames of images after the focus rotation processing in a layer form to obtain a target image.
Alternatively, in this embodiment of the application, the step 203 may be specifically implemented by the following steps 203a and 203 b.
And step 203a, the electronic device performs rotation processing on the M frames of images after the focus rotation processing to obtain M frames of images after the rotation processing.
In the embodiment of the application, the electronic device can rotate the M frames of images after the focus processing through the target rotation angle according to the focus ratio difference.
Optionally, in this embodiment of the application, the electronic device may perform rotation processing on the M frames of images after the focus rotation processing clockwise; or the rotation process is performed counterclockwise.
Optionally, in this embodiment of the application, the target rotation angle may be a default of the electronic device; or set by the user.
Optionally, in this embodiment of the application, when the electronic device performs rotation processing on the M frames of images, the rotation angle of each frame of image in the M frames of images may be partially the same, completely the same, or completely different.
For example, assuming that there are 3 different focal lengths between the first focal length and the preset focal length, and the 3 different focal lengths correspond to 3 frames of images, the electronic device may use the image corresponding to the first focal length as a reference point, rotate the image corresponding to the second focal length by 10 degrees compared to the reference point, rotate the image corresponding to the third focal length by 20 degrees compared to the reference point, and rotate the image corresponding to the fourth focal length by 30 degrees compared to the reference point, that is, the electronic device may rotate the corresponding angle according to a difference between the focal length existing between the first focal length and the preset focal length and the focal length of the first focal length.
And step 203b, the electronic device performs image superposition processing on the M frames of images after the rotation processing to obtain a target image.
In the embodiment of the application, the electronic device may perform superposition processing on the M frames of images after rotation processing in a layer form to obtain a target image.
In the embodiment of the application, the electronic equipment can rotate according to the M frames of images after the rotary focusing processing, so that target images with different rotary focusing effects are obtained, and thus, the flexibility of the image effect shot by the electronic equipment is improved.
Alternatively, in this embodiment of the application, the step 203 may be specifically implemented by the step 203c described below.
And step 203c, the electronic device performs image superposition processing on the M frames of images after the focusing processing according to the first sequence to obtain a target image.
In an embodiment of the present application, the first order is any one of: the acquisition sequence of the M frames of images, the sequence of the M frames of images after being adjusted by a user, and the sequence determined according to the focal length of the M frames of images.
The embodiment of the application provides an image processing method, wherein an electronic device can acquire N frames of images of a target object through N focal lengths, then perform rotary focusing on M frames of images in the N frames of images between a first focal length and a preset focal length, and perform image processing on the M frames of images after the rotary focusing to obtain the target image. In the scheme, the electronic equipment collects the N frames of images of the target object through the N focal lengths, so that the larger the focal length is, the smaller the shooting range is, and the lower the image definition is, namely, the N frames of images obtained by the electronic equipment are from clear to fuzzy and from integral to local images, therefore, after the electronic equipment carries out rotary focusing processing on the M frames of images in the N frames of images within the preset focal length range, a natural gradual change process from clear to fuzzy can be obtained, the problem that in the related technology, the electronic equipment simulates a single image and the existing rotary focusing effect is unnatural is solved, and the image effect of the rotary focusing images shot by the electronic equipment is improved.
In the image processing method provided in the embodiment of the present application, the execution subject may be an image processing apparatus. In the embodiment of the present application, an image processing apparatus is taken as an example to execute an image processing method, and the image processing apparatus provided in the embodiment of the present application is described.
Fig. 3 shows a schematic diagram of a possible structure of the image processing apparatus according to the embodiment of the present application. As shown in fig. 3, the image processing apparatus 70 may include: an acquisition module 71 and a processing module 72.
The acquisition module 71 is configured to acquire N frames of images of the target object through N focal lengths, where each focal length corresponds to one frame of image, and N is an integer greater than 1. A processing module 72, configured to perform a rotary focus processing on M frames of images in the N frames of images, where the M frames of images are images with focal lengths between a first focal length and a preset rotary focus focal length, the first focal length is a focal length of an image with the largest definition in the N frames of images, the first focal length is smaller than the preset rotary focus focal length, and M is an integer smaller than or equal to N; and performing image processing on the M frames of images after the rotary focusing processing to obtain a target image.
In a possible implementation manner, the acquisition module 71 is specifically configured to receive a first input of a target object from a user; and responding to the first input, and shooting the target object through each of the N focal lengths to obtain N frames of images corresponding to the N focal lengths respectively.
In a possible implementation manner, the processing module 72 is specifically configured to determine M-1 first regions from the M-1 frame image according to a target image region in the image corresponding to the first focal length, where each first region is an image region corresponding to the target image region in one frame image of the M-1 frame image, and the M-1 frame image is an image other than the image corresponding to the first focal length in the M frame image; respectively carrying out weight configuration on the M areas through M target weight values, wherein each target weight value is respectively used for indicating the definition of one of the M areas, and the M areas comprise a target image area and M-1 first areas; and performing focus rotation processing on the M frames of images according to the M target weight values.
In a possible implementation manner, the image processing apparatus provided by the embodiment of the application further includes a cropping module and an enlarging module. And a cropping module, configured to perform cropping processing on the image corresponding to the first focal length to obtain target image areas before the processing module 72 performs weight configuration on the M areas respectively through the M target weight values, and perform cropping processing on each frame of image in the M-1 frame of image to obtain the M-1 first areas. And the amplifying module is used for respectively carrying out size amplification processing on the target image area and the M-1 first areas to obtain an image with the size matched with the initial size of the M frames of images.
In a possible implementation manner, the processing module 72 is specifically configured to perform rotation processing on the M frames of images after the focus rotation processing to obtain M frames of images after the rotation processing; and carrying out image superposition processing on the M frames of images after the rotation processing to obtain a target image.
In a possible implementation manner, the processing module 72 is specifically configured to perform image superposition processing on the M frames of images after the focus rotation processing according to a first order to obtain a target image; wherein the first order is any one of: the acquisition sequence of the M frames of images, the sequence of the M frames of images after being adjusted by a user, and the sequence determined according to the focal length of the M frames of images.
The embodiment of the application provides an image processing device, because image processing device gathers the N frame image of target object through N focus, can understand, the focus is bigger, the shooting range is smaller, the image definition is lower, namely it is from clear to fuzzy in the N frame image that image processing device obtained, from whole to local image, thereby image processing device carries out the focus process after the focus is revolved to M frame image in the N frame image in presetting the focus range, can obtain comparatively natural gradual change process from clear to fuzzy, in having avoided the correlation technique, electronic equipment simulates the single image, and the unnatural problem of the focus effect that exists revolves, so, the image effect that image processing device shoots the focus image has been promoted.
The image processing apparatus in the embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in an electronic device. The device can be mobile electronic equipment or non-mobile electronic equipment. The Mobile electronic Device may be, for example, a Mobile phone, a tablet computer, a notebook computer, a palm computer, an in-vehicle electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a server, a Network Attached Storage (Network Attached Storage, NAS), a Television (TV), an assistant, or a self-service machine, and the embodiments of the present application are not limited in particular.
The image processing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android operating system (Android), an iOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
The image processing apparatus provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to fig. 3, and is not described herein again to avoid repetition.
Optionally, as shown in fig. 4, an electronic device 90 is further provided in the embodiment of the present application, and includes a processor 91 and a memory 92, where the memory 92 stores a program or an instruction that can be executed on the processor 91, and when the program or the instruction is executed by the processor 91, the steps of the embodiment of the image processing method are implemented, and the same technical effects can be achieved, and are not described again to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 5 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 100 includes, but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.
Those skilled in the art will appreciate that the electronic device 100 may further comprise a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 5 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 110 is configured to acquire N frames of images of the target object through N focal lengths, where each focal length corresponds to one frame of image, and N is an integer greater than 1; performing rotary focusing processing on M frame images in the N frame images, wherein the M frame images are images with focal lengths between a first focal length and a preset rotary focusing focal length, the first focal length is the focal length of the image with the maximum definition in the N frame images, the first focal length is smaller than the preset rotary focusing focal length, and M is an integer smaller than or equal to N; and carrying out image processing on the M frames of images after the focusing processing to obtain a target image.
The embodiment of the application provides an electronic device, because electronic device gathers the N frame image of target object through N focus, can understand, the focus is bigger, the shooting range is smaller, the image definition is lower, namely it is from clear to fuzzy in the N frame image that electronic device obtained, from whole to local image, thereby electronic device revolves the focus after handling to M frame image in the N frame image in presetting the focus range, can obtain comparatively natural gradient process from clear to fuzzy, in having avoided the correlation technique, electronic device simulates the monosheet image, and the unnatural problem of the burnt effect of revolving that exists, so, the image effect that electronic device shoots the burnt image of revolving has been promoted.
Optionally, in this embodiment of the application, the user input unit 107 is configured to receive a first input of the target object by the user. The processor 110 is specifically configured to, in response to the first input, respectively capture a target object through each of the N focal lengths, so as to obtain N frames of images respectively corresponding to the N focal lengths.
Optionally, in this embodiment of the present application, the processor 110 is configured to determine M-1 first regions from an M-1 frame image according to a target image region in an image corresponding to a first focal length, where each first region is an image region corresponding to the target image region in one frame image in the M-1 frame image, and the M-1 frame image is an image other than the image corresponding to the first focal length in the M frame image; respectively carrying out weight configuration on the M areas through M target weight values, wherein each target weight value is respectively used for indicating the definition of one of the M areas, and the M areas comprise a target image area and M-1 first areas; and performing focus rotation processing on the M frames of images according to the M target weight values.
Optionally, in this embodiment of the present application, the processor 110 is further configured to perform cropping processing on an image corresponding to the first focal length to obtain target image areas before performing weight configuration on the M areas respectively through the M target weight values, and perform cropping processing on each frame of image in the M-1 frame of image to obtain M-1 first areas; and respectively carrying out size amplification processing on the target image area and the M-1 first areas to obtain an image with the size matched with the initial size of the M frames of images.
Optionally, in this embodiment of the application, the processor 110 is specifically configured to perform rotation processing on the M frames of images after the focus rotation processing, so as to obtain M frames of images after the rotation processing; and carrying out image superposition processing on the M frames of images after the rotation processing to obtain a target image.
Optionally, in this embodiment of the application, the processor 110 is specifically configured to perform image superposition processing on the M frames of images after the focus rotation processing according to a first order to obtain a target image; wherein the first order is any one of: the method comprises the steps of acquiring the M frames of images, adjusting the M frames of images by a user, and determining the sequence according to the focal length of the M frames of images.
The electronic device provided by the embodiment of the application can realize each process realized by the method embodiment, and can achieve the same technical effect, and for avoiding repetition, the details are not repeated here.
The beneficial effects of the various implementation manners in this embodiment may specifically refer to the beneficial effects of the corresponding implementation manners in the above method embodiments, and are not described herein again to avoid repetition.
It should be understood that, in the embodiment of the present application, the input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the Graphics Processing Unit 1041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. 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, an organic light emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also referred to as a touch screen. The touch panel 1071 may include two parts of a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a first storage area storing a program or an instruction and a second storage area storing data, wherein the first storage area may store an operating system, an application program or an instruction (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, memory 109 may include volatile memory or non-volatile memory, or memory 109 may include both volatile and non-volatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous Link DRAM (SLDRAM), and a Direct Memory bus RAM (DRRAM). Memory 109 in the embodiments of the subject application includes, but is not limited to, these and any other suitable types of memory.
Processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor, which mainly handles operations related to the operating system, user interface, application programs, etc., and a modem processor, which mainly handles wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements the processes of the foregoing method embodiments, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the foregoing method embodiments, and can achieve the same technical effect, and in order to avoid repetition, the details are not repeated here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
Embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the foregoing embodiments of the image processing method, and achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
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. Further, it should be noted that the scope of the methods and apparatuses in the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions recited, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. An image processing method, characterized in that the method comprises:
acquiring N frames of images of a target object through N focal lengths, wherein each focal length corresponds to one frame of image, and N is an integer greater than 1;
performing rotary focusing processing on M frame images in the N frame images, wherein the M frame images are images with focal lengths between a first focal length and a preset rotary focusing focal length, the first focal length is the focal length of an image with the maximum definition in the N frame images, the first focal length is smaller than the preset rotary focusing focal length, and M is an integer smaller than or equal to N;
and carrying out image processing on the M frames of images after the focusing processing to obtain a target image.
2. The method of claim 1, wherein said acquiring N frames of images of a target object through N focal lengths comprises:
receiving a first input of the target object by a user;
and responding to the first input, and shooting the target object through each of the N focal lengths to obtain the N frames of images corresponding to the N focal lengths respectively.
3. The method according to claim 1 or 2, wherein the performing of the focus rotation processing on the M frames of the N frames of images comprises:
determining M-1 first regions from an M-1 frame image according to a target image region in an image corresponding to the first focal length, wherein each first region is an image region corresponding to the target image region in one frame image in the M-1 frame image, and the M-1 frame image is an image except for the image corresponding to the first focal length in the M frame image;
respectively carrying out weight configuration on M areas through M target weight values, wherein each target weight value is respectively used for indicating the definition of one of the M areas, and the M areas comprise the target image area and the M-1 first areas;
and performing focus rotation processing on the M frames of images according to the M target weight values.
4. The method according to claim 3, wherein before the configuring the weights of the M regions by the M target weight values, the method further comprises:
cutting the image corresponding to the first focal length to obtain the target image area, and respectively cutting each frame of image in the M-1 frame of image to obtain M-1 first areas;
and respectively carrying out size amplification processing on the target image area and the M-1 first areas to obtain an image with the size matched with the initial size of the M frame image.
5. The method according to claim 1, wherein the image processing the M-frame image after the focus rotation processing to obtain a target image comprises:
rotating the M frames of images after the focusing processing to obtain the M frames of images after the rotating processing;
and performing image superposition processing on the M frames of images after the rotation processing to obtain the target image.
6. The method according to claim 1 or 5, wherein the image processing the M frames of images after the focus rotation processing to obtain a target image comprises:
according to a first sequence, carrying out image superposition processing on the M frames of images after the rotary focusing processing to obtain the target image;
wherein the first order is any one of: the acquisition sequence of the M frames of images, the sequence of the M frames of images after being adjusted by a user, and the sequence determined according to the focal length of the M frames of images.
7. An image processing apparatus characterized by comprising: the device comprises an acquisition module and a processing module;
the acquisition module is used for acquiring N frames of images of a target object through N focal lengths, each focal length corresponds to one frame of image, and N is an integer greater than 1;
the processing module is configured to perform rotary focus processing on M frame images in the N frame images, where the M frame images are images whose focal lengths are located between a first focal length and a preset rotary focus focal length, the first focal length is a focal length of an image with the largest definition in the N frame images, the first focal length is smaller than the preset rotary focus focal length, and M is an integer smaller than or equal to N; and performing image processing on the M frames of images after the rotary focusing processing to obtain a target image.
8. The apparatus according to claim 7, wherein the acquisition module is specifically configured to receive a first input of the target object from a user; and responding to the first input, and shooting the target object through each of the N focal lengths to obtain the N frames of images corresponding to the N focal lengths respectively.
9. The apparatus according to claim 7 or 8, wherein the processing module is specifically configured to determine M-1 first regions from M-1 frame images according to a target image region in an image corresponding to the first focal length, where each first region is an image region corresponding to the target image region in one frame image in the M-1 frame images, and the M-1 frame image is an image other than the image corresponding to the first focal length in the M frame images; respectively carrying out weight configuration on M regions through M target weight values, wherein each target weight value is respectively used for indicating the definition of one region in the M regions, and the M regions comprise the target image region and the M-1 first regions; and performing focus rotation processing on the M frames of images according to the M target weight values.
10. The apparatus of claim 9, wherein the image processing apparatus further comprises a cropping module and a magnification module;
the cropping module is configured to crop an image corresponding to the first focal length to obtain the target image area before the processing module performs weight configuration on M areas respectively according to M target weight values, and crop each frame of image in the M-1 frame of image to obtain the M-1 first areas;
and the amplifying module is used for respectively carrying out size amplification processing on the target image area and the M-1 first areas to obtain an image with the size matched with the initial size of the M frame image.
11. The apparatus according to claim 7, wherein the processing module is specifically configured to perform rotation processing on the M frames of images after the focus rotation processing to obtain the M frames of images after the rotation processing; and performing image superposition processing on the M frames of images after the rotation processing to obtain the target image.
12. The apparatus according to claim 7 or 11, wherein the processing module is specifically configured to perform image superposition processing on the M frame images after the focus rotation processing according to a first order to obtain the target image;
wherein the first order is any one of: the acquisition sequence of the M frames of images, the sequence of the M frames of images after being adjusted by a user, and the sequence determined according to the focal length of the M frames of images.
CN202210195755.6A 2022-03-01 2022-03-01 Image processing method and device Active CN114666513B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210195755.6A CN114666513B (en) 2022-03-01 2022-03-01 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210195755.6A CN114666513B (en) 2022-03-01 2022-03-01 Image processing method and device

Publications (2)

Publication Number Publication Date
CN114666513A true CN114666513A (en) 2022-06-24
CN114666513B CN114666513B (en) 2024-02-02

Family

ID=82027453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210195755.6A Active CN114666513B (en) 2022-03-01 2022-03-01 Image processing method and device

Country Status (1)

Country Link
CN (1) CN114666513B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101297545A (en) * 2005-10-28 2008-10-29 株式会社尼康 Imaging device, image processing device, and program
CN101656817A (en) * 2008-08-19 2010-02-24 株式会社理光 Image processing apparatus, image processing process and image processing procedures
CN105594194A (en) * 2013-10-01 2016-05-18 奥林巴斯株式会社 Image display device and image display method
CN109981984A (en) * 2019-03-26 2019-07-05 努比亚技术有限公司 A kind of image processing method, terminal and computer readable storage medium
JP2019197186A (en) * 2018-05-11 2019-11-14 キヤノン株式会社 Imaging device, control method, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101297545A (en) * 2005-10-28 2008-10-29 株式会社尼康 Imaging device, image processing device, and program
CN101656817A (en) * 2008-08-19 2010-02-24 株式会社理光 Image processing apparatus, image processing process and image processing procedures
CN105594194A (en) * 2013-10-01 2016-05-18 奥林巴斯株式会社 Image display device and image display method
JP2019197186A (en) * 2018-05-11 2019-11-14 キヤノン株式会社 Imaging device, control method, and program
CN109981984A (en) * 2019-03-26 2019-07-05 努比亚技术有限公司 A kind of image processing method, terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN114666513B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
WO2018166069A1 (en) Photographing preview method, graphical user interface, and terminal
CN112887609B (en) Shooting method and device, electronic equipment and storage medium
CN104853091A (en) Picture taking method and mobile terminal
CN112637500B (en) Image processing method and device
CN112887617B (en) Shooting method and device and electronic equipment
CN112954193B (en) Shooting method, shooting device, electronic equipment and medium
CN113014798A (en) Image display method and device and electronic equipment
CN113473004A (en) Shooting method and device
CN112738397A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN114125179B (en) Shooting method and device
CN111405185A (en) Zoom control method and device for camera, electronic equipment and storage medium
CN114390197A (en) Shooting method and device, electronic equipment and readable storage medium
CN112839166A (en) Shooting method and device and electronic equipment
CN114125297B (en) Video shooting method, device, electronic equipment and storage medium
CN112887624B (en) Shooting method and device and electronic equipment
CN114666513B (en) Image processing method and device
CN115499589A (en) Shooting method, shooting device, electronic equipment and medium
CN114390206A (en) Shooting method and device and electronic equipment
CN114245018A (en) Image shooting method and device
CN114245017A (en) Shooting method and device and electronic equipment
CN112399092A (en) Shooting method and device and electronic equipment
CN112887611A (en) Image processing method, device, equipment and storage medium
CN114157810B (en) Shooting method, shooting device, electronic equipment and medium
CN114222069B (en) Shooting method, shooting device and electronic equipment
CN115134536B (en) Shooting method and device thereof

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