CN114666513B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN114666513B
CN114666513B CN202210195755.6A CN202210195755A CN114666513B CN 114666513 B CN114666513 B CN 114666513B CN 202210195755 A CN202210195755 A CN 202210195755A CN 114666513 B CN114666513 B CN 114666513B
Authority
CN
China
Prior art keywords
image
images
processing
frame
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.)
Active
Application number
CN202210195755.6A
Other languages
Chinese (zh)
Other versions
CN114666513A (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

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: n frames of images of the target object are acquired through N focal lengths, 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 rotation Jiao Jiaoju, the first focal length is the focal length of the image with the largest definition in the N frames of images, the first focal length is smaller than the preset rotation Jiao Jiaoju, and M is an integer smaller than or equal to N; and performing image processing on the M frame images subjected to the focusing processing to obtain target images.

Description

Image processing method and device
Technical Field
The application belongs to the technical field of image processing, and particularly relates to an image processing method and device.
Background
Currently, when a user shoots through an electronic device, the electronic device can simulate a rotary focus effect 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 the rotary focus effect.
However, in the above method, because the blurring process of the center radiation is formed based on the change of the focal segment in a time period, the process is continuous, and the gradual change process from clear to blurring of the focal segment is difficult to achieve a more natural transition in the current algorithm, so that the display effect of the rotary focus image shot by the electronic equipment is poor.
Disclosure of Invention
The embodiment of the application aims to provide an image processing method and device, which can solve the problem that a rotary focus image shot by electronic equipment is poor in display effect.
In a first aspect, an embodiment of the present application provides an image processing method, including: n frames of images of the target object are acquired through N focal lengths, each focal length corresponds to one frame of image, and N is an integer greater than 1; performing rotation focus 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 rotation Jiao Jiaoju, the first focal length is the focal length of the image with the largest definition in the N frames of images, the first focal length is smaller than the preset rotation Jiao Jiaoju, and M is an integer smaller than or equal to N; and performing image processing on the M frame images subjected to the focusing processing to obtain target images.
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 respectively, and N is an integer larger than 1. The processing module is used for 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 rotation Jiao Jiaoju, the first focal length is the focal length of the image with the largest definition in the N frame images, the first focal length is smaller than the preset rotation Jiao Jiaoju, and M is an integer smaller than or equal to N; and performing image processing on the M frame images subjected to the focusing processing to obtain target images.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, as the electronic device collects the N frame 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, the lower the image definition is, that is, the image from clear to fuzzy in the N frame images obtained by the electronic device is, from integral to local, so that after the electronic device performs the rotary focusing processing on the M frame images in the N frame images within the preset focal length range, the more natural gradual change process from clear to fuzzy can be obtained, the problem that in the related art, the electronic device simulates a single image and the existing rotary focusing effect is unnatural is avoided, and the image effect of the rotary focusing image shot by the electronic device 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 according to an embodiment of the present application;
fig. 3 is a schematic structural view of an image processing apparatus according to an embodiment of the present application;
fig. 4 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application;
fig. 5 is a second schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The image processing method provided by the embodiment of the application is described in detail below by means of specific embodiments and application scenes thereof with reference to the accompanying drawings.
Currently, when a user uses an electronic device to shoot, if the user needs to obtain an image with a certain shooting effect, the user can process the image shot by the user through some application programs to obtain the shooting effect required by the user, for example, when the user needs to obtain the image with a rotary focus shooting effect, the user can perform the rotary focus effect simulation of the image layer on the shot image in the image editing application program to obtain the rotary focus effect required by the user. It should be noted that, in the shooting process, a user may rotate (i.e., adjust a focal length) a lens, so that an image with an explosive effect may be obtained due to continuous zoom change and continuous exposure of the lens during imaging, and this shooting technique may also be referred to as "zoom out".
However, in the above method, the effect of the rotation focus achieved by the simulation of the image editing application often deviates from the effect of the rotation focus image captured by the electronic device (for example, a digital camera), that is, the blurring effect may be insufficient, and thus, the image effect of the rotation focus image captured by the electronic device is poor.
In the embodiment of the application, the electronic device may collect N frame images of the target object through N focal lengths, then perform a rotary focus processing on M frame images in the N frame images between the first focal length and the preset focal length, and perform image processing on the M frame images after the rotary focus processing, so as to obtain the target image. In the scheme, as the electronic equipment collects the N frames of images of the target object through N focal lengths, it can be understood that the larger the focal length is, the smaller the shooting range is, 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, so that after the electronic equipment carries out the rotary focusing processing on the M frames of images in the N frames of images within the preset focal length range, the more natural gradual change process from clear to fuzzy can be obtained, the problem that in the related art, the electronic equipment simulates a single image and the existing rotary focusing effect is unnatural is avoided, and the image effect of the rotary focusing image 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 the image processing method provided in the embodiment of the present application. As shown in fig. 1, the image processing method provided in the embodiment of the present application may include the following steps 201 to 203.
Step 201, the electronic device acquires N frames of images of the target object through N focal lengths.
In this embodiment of the present application, each of the N focal lengths corresponds to one frame of image of the N frames of images, where N is an integer greater than 1.
In this embodiment of the present invention, when the electronic device displays the shooting preview interface, the user may trigger the electronic device to acquire N frame images of the target object through N focal lengths in the camera by performing touch input, specific gesture input, or combined key input (for example, combined input of a power key and a volume key) on the shooting control, so that the electronic device may perform a rotational focus processing on the N frame images.
It should be noted that, the shooting is performed on the same target object by the user at the same position, so the electronic device can obtain a plurality of image sets with different focal lengths at the same position through N focal lengths, that is, the N frame images obtained by the electronic device are clear to fuzzy image sets from whole to local at the same position.
Alternatively, in the embodiment of the present application, the target object may be a human, an animal, a plant, or an object. The specific requirements can be determined according to actual use, and the embodiment of the invention is not limited.
Alternatively, in the embodiment of the present application, the above 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 from a user.
Optionally, in the embodiment of the present application, the first input may be a click input, a long press input, a slide input, a preset track input, or the like; or the first input may be a user input to a physical key, or a combination of physical keys. The specific requirements can be determined according to actual use, and the embodiment of the invention is not limited.
In step 201b, the electronic device responds to the first input, and photographs the target object through each focal length of the N focal lengths, so as to obtain N frames of images corresponding to the N focal lengths.
It can be appreciated that, for each of the N frames of images, after receiving the first input, the electronic device may take a photograph of the target object with one of the N focal lengths, to obtain a frame of image, so as to obtain the N frames of images.
Optionally, in this embodiment of the present application, the electronic device may sequentially photograph the target object through N focal lengths according to a second order, to obtain N frames of images, where the second order is any one of the following: the size sequence of the N focal lengths and the sequence of the N focal lengths set by a user.
Optionally, in this embodiment of the present application, the electronic device may include a plurality of cameras, and the electronic device may capture, through N cameras, the target object with N focal lengths, to obtain N frames of images, where each camera corresponds to one focal length of the N focal lengths respectively.
Optionally, in the embodiment of the present application, the electronic device may sequentially take, according to the second order, the target object with N focal lengths by using N cameras, to obtain N frames of images; or, the electronic device can shoot the target object through N cameras by adopting N focal lengths at the same time to obtain N frames of images.
Optionally, in the embodiment of the present application, a user may perform touch input, specific gesture input, or combined key input (for example, combined input of a power key and a volume key) on a video recording control in a camera preview interface, so that the electronic device performs video recording on a target object through N focal lengths in a camera to obtain N frames of images; or, 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, so as to obtain N frames of images.
Optionally, in the embodiment of the present application, when the electronic device shoots the target object through N focal lengths, the electronic device may store information of each focal length of the N focal lengths into a frame image corresponding to each focal length of the N focal lengths; or after shooting is completed, the electronic device can store the focal length information into the electronic device in a file storage mode.
Optionally, in an embodiment of the present application, the focal length information includes at least one of the following: shooting distance, shooting range, and shooting definition.
After the user clicks the shooting control on the shooting preview interface, the electronic device may shoot the target object from the current focal length to the maximum focal length supported by the camera (i.e., N focal lengths), and store the focal length information of the N focal lengths into a frame image corresponding to each focal length, so that after shooting is completed, the electronic device may obtain N frame images of different focal lengths in the same position and focal length information corresponding to each frame image.
In this embodiment of the application, electronic equipment shoots target object through N focus to obtain N frame image, then through later stage simulation and stack, obtain comparatively natural rotatory burnt image, avoided electronic equipment to simulate single image, and the problem that rotatory burnt effect that exists is unnatural, so, promoted electronic equipment and shot the image effect of rotatory burnt image.
Step 202, the electronic device performs a rotary focusing process on M frame images in the N frame images.
In this embodiment of the present application, the M frame images are images with focal lengths between a first focal length and a preset rotation Jiao Jiaoju, where 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 rotation Jiao Jiaoju, 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 a shooting preview interface, a second input of the user to the target object, so that the electronic device may perform focusing processing on the target object, and record focal length information of current focus definition, so as to determine the first focal length according to the focal length information of current focus definition; or after shooting is completed, the electronic device may determine, as the first focal length, a focal length corresponding to one frame image with the largest image definition from the N frame images.
Alternatively, in an embodiment of the present application, the second input may be any one of the following: click input, long press input, slide input, or preset trajectory input, etc. The specific requirements can be determined according to actual use, and the embodiment of the invention is not limited.
Optionally, in the embodiment of the present application, the preset focal length may be a maximum focal length default by the electronic device, a focal length set by a user, or a focal length determined by the electronic device according to image definition.
Alternatively, in the embodiment of the present application, the above step 202 may be specifically implemented by the following steps 202a to 202 c.
Step 202a, the electronic device determines M-1 first regions from the M-1 frame image according to the target image regions in the image corresponding to the first focal length.
In this embodiment of the present application, each of the M-1 first regions is an image region corresponding to the target image region in one of M-1 frame images, where the M-1 frame image is an image other than the image corresponding to the first focal length in the M frame images.
In the embodiment of the application, the electronic device may determine the target image area in the image corresponding to the first focal length, so that M-1 first areas are determined from M-1 frame images between the first focal length and the preset focal length through the mapping relationship.
Optionally, in the embodiment of the present application, the electronic device may determine a center area or an edge area in the image corresponding to the first focal length as the target image area; or the electronic device may determine the user-specified region 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, the electronic device may determine a center area in the image corresponding to the first focal length F1 as a target image area (an area indicated by a dotted line in fig. 2), so that the electronic device may determine a first area in the same position as the target image area from the one frame image corresponding to the focal length F3 according to the target image area.
Step 202b, the electronic device performs weight configuration on the M regions through the M target weight values.
In this embodiment of the present application, each of the M target weight values is used to indicate a sharpness 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 spiral focus processing on the M-frame image according to the weights of the target image area and the M-1 first areas.
Optionally, in the embodiment of the present application, the target weight value may be preset for the electronic device, or may be set by a user according to a requirement of the user.
Optionally, in the embodiment of the present application, the target weight value may be used to indicate a rotation speed of the electronic device when performing a rotation focus processing on the M-frame image.
Step 202c, the electronic device performs a rotary focus processing on the M frame images according to the M target weight values.
In the embodiment of the application, the electronic device may perform the shot processing on the M frame images based on a preset algorithm according to the M target weight values.
It can be understood that the electronic device may perform different configurations on the M target weight values, so that the image effects of the obtained M frame images are different.
Optionally, in the embodiment of the present application, after performing the spiral focusing processing on the M frame images according to the M target weight values, the user may adjust the M target weight values of the M frame images, so that the electronic device obtains different image effects.
For example, there are 100 frames of images from the first focal length to the preset focal length, the electronic device records the 100 frames of images as P0 to P100, configures weights for the 100 frames of images respectively, and marks W0 to W100, and supposing that the electronic device performs blurring processing on each frame of image in the 100 frames of images, the weight corresponding to the i-th frame of image Pi is Wi, so that blurring with intensity of 100% -Wi/sum (W) is performed on Pi, and marks the image after blurring processing as P' i, wherein sum (W) represents the sum of weights from W0 to W100.
In the embodiment of the invention, after the electronic device determines the target image area and the M-1 first areas, the electronic device can simulate different gyros Jiao Shoufa through different configuration weights so as to obtain different gyros effects, thus improving the flexibility of shooting gyros images by the electronic device.
Optionally, in the embodiment of the present application, before the step 202b, the image processing method provided in the embodiment of the present application further includes the following steps 301 and 302.
Step 301, the electronic device performs a cropping process on the image corresponding to the first focal length to obtain a target image area, and performs a cropping process 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 cut 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 amplification processing on the target image area and the M-1 first areas.
And 302, respectively performing size amplification processing on the target image area and M-1 first areas to obtain an image with the size matched with the initial size of the M frame image.
In the embodiment of the application, the electronic device can perform size amplification processing on the target image area and M-1 first areas obtained by cutting processing to obtain the image with the same initial size as the M frame image, so that the electronic device can perform rotary focusing processing on the amplified target image area and M-1 first areas to obtain the target image.
In the embodiment of the invention, after the electronic device cuts the M frame image to obtain the target image area and M-1 first areas, the target image area and M-1 first areas are respectively enlarged to the images with the same initial size as the M frame image, so that the electronic device carries out the rotary focus processing through the enlarged target image area and M-1 first areas, a natural gradual change process from clear to fuzzy can be obtained, and the image effect of the rotary focus image shot by the electronic device is improved.
And 203, the electronic equipment performs image processing on the M frame images subjected to the focusing processing to obtain target images.
In the embodiment of the application, the electronic device may perform superposition processing on the M frame image after the focusing processing in a layer form, so as to obtain the target image.
Alternatively, in the embodiment of the present application, the above step 203 may be specifically implemented by the following steps 203a and 203 b.
And 203a, the electronic equipment performs rotation processing on the M frame image subjected to the rotation processing to obtain the M frame image subjected to the rotation processing.
In the embodiment of the application, the electronic device can rotate the M frame images subjected to the focusing processing according to the focal length proportion difference through the target rotation angle.
Optionally, in the embodiment of the present application, the electronic device may perform rotation processing on the M-frame image after the rotation processing according to a clockwise direction; or the rotation process is performed counterclockwise.
Optionally, in the embodiment of the present application, the target rotation angle may be a default value of the electronic device; or set by the user.
Optionally, in the embodiment of the present application, when the electronic device performs rotation processing on the M-frame image, the rotation angle of each frame of image in the M-frame image may be partially the same, completely the same, or completely different.
For example, assuming that 3 different focal lengths exist between the first focal length and the preset focal length, the electronic device may rotate the image corresponding to the first focal length by 10 degrees with respect to the reference point, rotate the image corresponding to the second focal length by 20 degrees with respect to the reference point, and rotate the image corresponding to the fourth focal length by 30 degrees with respect to the reference point, that is, the electronic device may rotate by a corresponding angle according to a focal length difference between the focal lengths of the first focal length and the preset focal length and the first focal length.
And 203b, the electronic equipment performs image superposition processing on the M frame images after the rotation processing to obtain target images.
In this embodiment of the present application, the electronic device may perform superposition processing on the M frame image after the rotation processing in a layer form, so as to obtain the target image.
In the embodiment of the application, the electronic equipment can perform rotation processing according to the M frames of images subjected to rotation processing, so that target images with different rotation effects are obtained, and the flexibility of the image effects shot by the electronic equipment is improved.
Alternatively, in the embodiment of the present application, the above step 203 may be specifically implemented by the following step 203 c.
And 203c, the electronic equipment performs image superposition processing on the M frame images subjected to the focusing processing according to the first sequence to obtain target images.
In this embodiment of the present application, the first order is any one of the following: the acquisition sequence of the M frame images, the sequence of the M frame images after the user adjusts the M frame images, and the sequence determined according to the focal length of the M frame images.
The embodiment of the application provides an image processing method, an electronic device can acquire N frames of images of a target object through N focal lengths, then perform rotary focus processing 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 focus processing to obtain the target image. In the scheme, as the electronic equipment collects the N frames of images of the target object through N focal lengths, it can be understood that the larger the focal length is, the smaller the shooting range is, 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, so that after the electronic equipment carries out the rotary focusing processing on the M frames of images in the N frames of images within the preset focal length range, the more natural gradual change process from clear to fuzzy can be obtained, the problem that in the related art, the electronic equipment simulates a single image and the existing rotary focusing effect is unnatural is avoided, and the image effect of the rotary focusing image shot by the electronic equipment is improved.
It should be noted that, 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 provided in the embodiment of the present application will be described by taking an example in which the image processing apparatus executes an image processing method.
Fig. 3 shows a schematic diagram of one possible configuration of an image processing apparatus involved in an 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. The processing module 72 is configured to perform a rotation focus processing on M frame images in the N frame images, where the M frame images are images with focal lengths between a first focal length and a preset rotation Jiao Jiaoju, the first focal length is a focal length of an image with a maximum definition in the N frame images, the first focal length is smaller than the preset rotation Jiao Jiaoju, and M is an integer smaller than or equal to N; and performing image processing on the M frame images subjected to the focusing processing to obtain target images.
In one possible implementation manner, the acquisition module 71 is specifically configured to receive a first input from a user to a target object; and responding to the first input, and respectively shooting the target object through each focal length of the N focal lengths to obtain N frames of images respectively corresponding to the N focal lengths.
In one possible implementation manner, the processing module 72 is specifically configured to determine M-1 first areas from M-1 frame images according to the target image area in the image corresponding to the first focal length, where each first area is an image area corresponding to the target image area in one of the M-1 frame images, and the M-1 frame images are images other than the image corresponding to the first focal length in the M-1 frame images; 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 area in the M areas, and the M areas comprise a target image area and M-1 first areas; and performing rotary focus processing on the M frames of images according to the M target weight values.
In one possible implementation manner, the image processing apparatus provided in the embodiment of the present application further includes a clipping module and an amplifying module. And the cutting module is used for cutting the image corresponding to the first focal length to obtain a target image area before the processing module 72 respectively carries out weight configuration on the M areas through the M target weight values, and respectively cutting each frame of image in the M-1 frames of images to obtain 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.
In one possible implementation manner, the processing module 72 is specifically configured to perform rotation processing on the M frame image after the rotation processing, to obtain a M frame image after the rotation processing; and performing image superposition processing on the M frame images after the rotation processing to obtain target images.
In one possible implementation manner, the processing module 72 is specifically configured to perform image overlaying processing on the M frame images after the focusing processing according to the first order, so as to obtain a target image; wherein the first order is any one of: the acquisition sequence of the M frame images, the sequence of the M frame images after the user adjusts the M frame images, and the sequence determined according to the focal length of the M frame images.
The embodiment of the application provides an image processing device, because the image processing device collects N frames of images of a target object through N focal lengths, it can be understood that the larger the focal length is, the smaller the shooting range is, namely the lower the image definition is, namely the image from clear to fuzzy in the N frames of images obtained by the image processing device is the image from whole to local, so that after the image processing device carries out the rotary focus 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 art, the electronic equipment simulates a single image and the existing rotary focus effect is unnatural is avoided, and the image effect of the rotary focus image shot by the image processing device is improved.
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 may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a mobile phone, tablet, notebook, palmtop, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., 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, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
The image processing apparatus provided in this embodiment of the present application can implement each process implemented by the embodiments of the methods of fig. 1 to 3, and in order to avoid repetition, a description is omitted here.
Optionally, as shown in fig. 4, the embodiment of the present application further provides an electronic device 90, including a processor 91 and a memory 92, where a program or an instruction capable of being executed on the processor 91 is stored in the memory 92, and the program or the instruction when executed by the processor 91 implements each step of the embodiment of the image processing method, and the steps can achieve the same technical effect, so that repetition is avoided, and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 5 is a schematic hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 100 includes, but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.
Those skilled in the art will appreciate that the electronic device 100 may further include a power source (e.g., a battery) for powering the various components, and that the power source may be logically coupled to the processor 110 via a power management system to perform functions such as managing charging, discharging, and power consumption via 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 shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 110 is configured to collect 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 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 rotation Jiao Jiaoju, the first focal length is the focal length of the image with the largest definition in the N frames of images, the first focal length is smaller than the preset rotation Jiao Jiaoju, and M is an integer smaller than or equal to N; and performing image processing on the M frame images subjected to the focusing processing to obtain target images.
The embodiment of the application provides electronic equipment, because the electronic equipment collects N frames of images of a target object through N focal lengths, it can be understood that the larger the focal length is, the smaller the shooting range is, namely the lower the image definition is, namely the image from clear to fuzzy in the N frames of images obtained by the electronic equipment is, and the whole image is to local image, so that after the electronic equipment carries out rotary focus processing on 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, the problem that in the related technology, the electronic equipment simulates a single image and the existing rotary focus effect is unnatural is avoided, and the image effect of the rotary focus image shot by the electronic equipment is improved.
Optionally, in an embodiment of the present application, the user input unit 107 is configured to receive a first input of a target object by a user. The processor 110 is specifically configured to, in response to the first input, respectively shoot the target object through each of the N focal lengths, and obtain N frame images corresponding to the N focal lengths respectively.
Optionally, in the embodiment of the present application, the processor 110 is configured to determine M-1 first areas from M-1 frame images according to a target image area in an image corresponding to the first focal length, where each first area is an image area corresponding to the target image area 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 areas through M target weight values, wherein each target weight value is respectively used for indicating the definition of one area in the M areas, and the M areas comprise a target image area and M-1 first areas; and performing rotary focus 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, before performing weight configuration on the M regions by using the M target weight values, perform a cropping process on an image corresponding to the first focal length to obtain a target image region, and perform a cropping process on each frame of image in the M-1 frame of image to obtain M-1 first regions; and performing size amplification processing on the target image area and the M-1 first areas respectively to obtain an image with the size matched with the initial size of the M frame image.
Optionally, in the embodiment of the present application, the processor 110 is specifically configured to perform rotation processing on the M frame image after the rotation processing, to obtain the M frame image after the rotation processing; and performing image superposition processing on the M frame images after the rotation processing to obtain target images.
Optionally, in the embodiment of the present application, the processor 110 is specifically configured to perform image stacking processing on the M frame images after the focusing processing according to the first order, so as to obtain a target image; wherein the first order is any one of: the acquisition sequence of the M frame images, the sequence of the M frame images after the user adjusts the M frame images, and the sequence determined according to the focal length of the M frame images.
The electronic device provided in the embodiment of the present application can implement each process implemented by the above method embodiment, and can achieve the same technical effects, so that repetition is avoided, and details are not repeated here.
The beneficial effects of the various implementation manners in this embodiment may be specifically referred to the beneficial effects of the corresponding implementation manners in the foregoing method embodiment, and in order to avoid repetition, the description is omitted here.
It should be appreciated that in embodiments of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The 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, a joystick, and so forth, which are not described in detail herein.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 109 may include volatile memory or nonvolatile memory, or the memory 109 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 109 in embodiments of the present 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 that primarily processes operations involving an operating system, user interface, application programs, etc., and a modem processor that primarily processes 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, and when the program or the instruction is executed by a processor, the program or the instruction implement each process of the embodiment of the method, and the same technical effects can be achieved, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled with the processor, and the processor is used for running a program or an instruction, implementing each process of the above method embodiment, and achieving the same technical effect, so as to avoid repetition, and not repeated here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
The embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the respective processes of the embodiments of the image processing method described above, and achieve the same technical effects, and are not repeated herein.
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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.

Claims (12)

1. An image processing method, the method comprising:
collecting 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 rotation Jiao Jiaoju, the first focal length is the focal length of the image with the largest definition in the N frame images, the first focal length is smaller than the preset rotation Jiao Jiaoju, M is an integer smaller than or equal to N, and the M frame images comprise images corresponding to the first focal length and images corresponding to the preset rotation Jiao Jiaoju;
and performing image processing on the M frame images subjected to the focusing processing to obtain target images.
2. The method of claim 1, wherein the acquiring N frames of images of the target object through N focal lengths comprises:
receiving a first input of a user to the target object;
and responding to the first input, and respectively shooting the target object through each focal length of the N focal lengths to obtain N frame images respectively corresponding to the N focal lengths.
3. The method according to claim 1 or 2, wherein the performing a spiral focus process on M frame images of the N frame images includes:
According to a target image area in an image corresponding to the first focal length, M-1 first areas are determined from M-1 frame images, each first area is an image area corresponding to the target image area in one frame of image in the M-1 frame images, and the M-1 frame images are images except for the image corresponding to the first focal length in the M frame images;
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 area in the M areas, and the M areas comprise the target image area and the M-1 first areas;
and performing rotary focusing processing on the M frames of images according to the M target weight values.
4. A method according to claim 3, wherein before the weighting 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 cutting each frame of image in the M-1 frames of images to obtain M-1 first areas;
performing size amplification processing on the target image area and the M-1 first areas respectively to obtain an image with the size matched with the initial size of the M frame image;
And performing the rotary focus processing on the M frame images according to the M target weight values, including:
and performing rotary focusing processing on the image with the size matched with the initial size of the M frame images according to the M target weight values to obtain a target image.
5. The method according to claim 1, wherein the performing image processing on the M-frame image after the focusing processing to obtain a target image includes:
performing rotation processing on the M frame images subjected to the rotation processing to obtain the M frame images subjected to the rotation processing;
and performing image superposition processing on the M frame images after the rotation processing to obtain the target image.
6. The method according to claim 1, wherein the performing image processing on the M-frame image after the focusing processing to obtain a target image includes:
according to a first sequence, performing image superposition processing on the M frames of images subjected to the rotary focus processing to obtain the target image;
wherein the first order is any one of: the acquisition sequence of the M frame images, the sequence of the M frame images after the user adjusts the M frame images, and the sequence determined according to the focal length of the M frame images.
7. An image processing apparatus, characterized in that the image processing apparatus comprises: the acquisition module and the 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 configured to perform a rotation focus processing on M frame images in the N frame images, where the M frame images are images with focal lengths between a first focal length and a preset rotation Jiao Jiaoju, the first focal length is a focal length of an image with a maximum definition in the N frame images, the first focal length is smaller than the preset rotation Jiao Jiaoju, M is an integer smaller than or equal to N, and the M frame images include an image corresponding to the first focal length and an image corresponding to the preset rotation Jiao Jiaoju; and performing image processing on the M frame images subjected to the focusing processing to obtain target images.
8. The apparatus according to claim 7, wherein the acquisition module is specifically configured to receive a first input from a user to the target object; and responding to the first input, and respectively shooting the target object through each focal length of the N focal lengths to obtain N frame images respectively corresponding to the N focal lengths.
9. The apparatus according to claim 7 or 8, wherein the processing module is specifically configured to determine M-1 first areas from M-1 frame images according to a target image area in an image corresponding to the first focal length, where each first area is an image area corresponding to the target image area in one frame image of the M-1 frame images, and the M-1 frame images are images other than the image corresponding to the first focal length in the M frame images; 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 area in the M areas, and the M areas comprise the target image area and the M-1 first areas; and performing rotary focus 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 an enlargement module;
the cutting module is used for cutting the image corresponding to the first focal length before the processing module respectively carries out weight configuration on M areas through M target weight values to obtain the target image areas, and respectively cutting each frame of image in the M-1 frame of images to obtain M-1 first areas;
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;
the processing module is specifically configured to perform a spiral focus processing on the image with the size matching the initial size of the M frame image according to the M target weight values, so as to obtain a target image.
11. The device according to claim 7, wherein the processing module is specifically configured to perform rotation processing on the M-frame image after the rotation processing, to obtain the M-frame image after the rotation processing; and performing image superposition processing on the M frame images after the rotation processing to obtain the target image.
12. The apparatus of claim 7, wherein the processing module is specifically configured to perform image overlaying processing on the M frame images after the rotational focus 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 frame images, the sequence of the M frame images after the user adjusts the M frame images, and the sequence determined according to the focal length of the M frame 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 CN114666513A (en) 2022-06-24
CN114666513B true 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
CN114666513A (en) 2022-06-24

Similar Documents

Publication Publication Date Title
WO2018166069A1 (en) Photographing preview method, graphical user interface, and terminal
CN112637500B (en) Image processing method and device
CN112954193B (en) Shooting method, shooting device, electronic equipment and medium
CN113473004A (en) Shooting method and device
CN113014798A (en) Image display method and device and electronic equipment
CN112738397A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN114520877A (en) Video recording method and device and electronic equipment
CN114125179B (en) Shooting method and device
CN113727001B (en) Shooting method and device and electronic equipment
CN113207038B (en) Video processing method, video processing device and electronic equipment
WO2021238942A1 (en) Anti-shake method, anti-shake apparatus, and electronic device
CN112839166B (en) Shooting method and device and electronic equipment
CN114666513B (en) Image processing method and device
CN114125297B (en) Video shooting method, device, electronic equipment and storage medium
CN114785957A (en) Shooting method and device thereof
CN114245018A (en) Image shooting method and device
CN112887611A (en) Image processing method, device, equipment and storage medium
CN114157810B (en) Shooting method, shooting device, electronic equipment and medium
CN117692756A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN113489901B (en) Shooting method and device thereof
CN117097982B (en) Target detection method and system
CN117745528A (en) Image processing method and device
CN115242976A (en) Shooting method, shooting device and electronic equipment
CN116916147A (en) Image processing method, image sending device and electronic equipment
CN113709326A (en) Lens shadow correction method and device and electronic equipment

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