CN113315903A - Image acquisition method and device, electronic equipment and storage medium - Google Patents

Image acquisition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113315903A
CN113315903A CN202010121331.6A CN202010121331A CN113315903A CN 113315903 A CN113315903 A CN 113315903A CN 202010121331 A CN202010121331 A CN 202010121331A CN 113315903 A CN113315903 A CN 113315903A
Authority
CN
China
Prior art keywords
image
preview image
preview
acquiring
background
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
CN202010121331.6A
Other languages
Chinese (zh)
Other versions
CN113315903B (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202010121331.6A priority Critical patent/CN113315903B/en
Publication of CN113315903A publication Critical patent/CN113315903A/en
Application granted granted Critical
Publication of CN113315903B publication Critical patent/CN113315903B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • 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/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • 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

Landscapes

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

Abstract

The disclosure relates to an image acquisition method and device, an electronic device and a storage medium. An image acquisition method comprising: acquiring preview images of a preset number of frames; processing preview images of a preset number of frames to obtain a foreground part, a background part, the position of a shot object in each preview image and the motion direction of the shot object in each preview image; and acquiring a target image with a background dynamic blurring effect based on the foreground part and the background part in each preview image, the position of the shooting object in each preview image and the motion direction of the shooting object. In the embodiment, a user does not need to use a professional shooting device, and the user does not need to have a professional shooting technology, so that the shooting experience is favorably improved.

Description

Image acquisition method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image obtaining method and apparatus, an electronic device, and a storage medium.
Background
At present, as electronic equipment is used more and more widely, a user can shoot images by using a camera on the electronic equipment at any time and any place, so that various nice moments are reserved.
During the shooting process, the user can use different shooting techniques to achieve more wonderful image effects, such as panning. Taking a panning effect as an example, a slow shutter is used for tracking a shooting object to shoot, at this time, the shutter speed is set to be the slow shutter, then the camera is shaken along with the shooting object, so that the camera moves along a self rotating shaft perpendicular to a horizontal plane as a horizontal arc, the effect that a moving object in an image is clear and a background is virtual is achieved, and an effect diagram is shown in fig. 1, so that the moving object in the image can be highlighted.
However, in order to obtain the panning effect, the user needs to use a professional photographing apparatus, and also needs to have a professional photographing skill, which reduces the photographing experience.
Disclosure of Invention
The present disclosure provides an image acquisition method and apparatus, an electronic device, and a storage medium to solve the deficiencies of the related art.
According to a first aspect of the embodiments of the present disclosure, there is provided an image acquisition method applied to an electronic device, the method including:
acquiring preview images of a preset number of frames;
processing the preview images of the preset number of frames to acquire a foreground part, a background part, the position of a shot object in each preview image and the motion direction of the shot object in each preview image;
and acquiring a target image with a background dynamic blurring effect based on the foreground part and the background part in each preview image, the position of the shooting object in each preview image and the motion direction of the shooting object.
Optionally, before the preview images of the preset number of frames are acquired, the method further includes:
detecting a current shooting mode of the electronic equipment;
and acquiring preview images to obtain at least a preset number of frame preview images in response to the fact that the current shooting mode is the motion shooting mode.
Optionally, detecting a current shooting mode of the electronic device includes:
acquiring a plurality of preset shooting modes in response to detection of a selection operation indicating selection of a shooting mode;
in response to detection of a selection operation indicating selection of a motion capture mode, it is determined that the current capture mode is the motion capture mode.
Optionally, detecting a current shooting mode of the electronic device includes:
acquiring a focusing area and a shooting object in the focusing area in response to detection of a trigger operation representing focusing;
and determining that the current shooting mode is the motion shooting mode in response to the fact that the shooting object in the focusing area moves and the background is stable within the preset time length.
Optionally, the obtaining of the preview image comprises:
and acquiring a preview image according to a preset interval time, wherein the size of the preview image is the same as that of an image sensor in the electronic equipment.
Optionally, the method further includes a step of updating the preset interval time, specifically including:
acquiring the movement speed of a shooting object in a preview image;
determining interval time corresponding to the motion speed of the shooting object based on the corresponding relation between the preset motion speed and the interval time;
and updating the preset interval time.
Optionally, acquiring a preset number of frame preview images includes:
a preset number of frames of preview images are read from a designated location, or,
and selecting a preset number of frames of video frames from the specified video as preview images.
Optionally, processing the preview images of the preset number of frames to obtain a foreground portion, a background portion, a position of the photographic subject in each preview image, and a moving direction of the photographic subject in each preview image includes:
sequentially inputting each preview image into a first Gaussian mixture model for acquiring a foreground part and a second Gaussian mixture model for acquiring a background part, and respectively acquiring the foreground part and the background part in each preview image;
acquiring the position of the shooting object in each preview image based on the foreground part in each preview image;
and determining the moving direction of the photographic object based on the position of the photographic object in each preview image.
Optionally, processing the preview images of the preset number of frames to obtain a foreground portion, a background portion, a position of the photographic subject in each preview image, and a moving direction of the photographic subject in each preview image includes:
sequentially inputting each preview image into a preset semantic model to obtain a foreground part and a background part in each preview image; the background part is the part except the foreground part in each preview image;
based on the position of the foreground part in each preview image, and taking the position as the position of the shooting object in each preview image;
and determining the moving direction of the photographic object based on the position of the photographic object in each preview image.
Optionally, acquiring a target image with a background motion blur effect based on a foreground portion, a background portion, a position of a photographic subject in each preview image, and a moving direction of the photographic subject in each preview image includes:
determining preview images to be processed based on the positions of the shot images in the preview images;
performing motion blurring processing opposite to the motion direction on the background part of the preview image to be processed based on the motion direction to obtain a blurred background image;
and superposing the foreground part of the preview image to be processed to the blurred background image to obtain the target image.
According to a second aspect of the embodiments of the present disclosure, there is provided an image capturing apparatus applied to an electronic device, the apparatus including:
the preview image acquisition module is used for acquiring preview images of a preset number of frames;
the preview image processing module is used for processing the preview images of the preset number of frames to acquire a foreground part, a background part, the positions of the shot objects in the preview images and the motion directions of the shot objects in the preview images;
and the target image acquisition module is used for acquiring a target image with a background dynamic blurring effect based on the foreground part and the background part in each preview image, the position of the shot object in each preview image and the motion direction of the shot object.
Optionally, the apparatus further comprises:
the shooting mode detection module is used for detecting the current shooting mode of the electronic equipment;
and the preview image shooting module is used for responding to the detection that the current shooting mode is the motion shooting mode, acquiring preview images and obtaining at least a preset number of frames of preview images.
Optionally, the shooting mode detection module includes:
a shooting mode acquisition unit configured to acquire a plurality of preset shooting modes in response to detection of a selection operation indicating selection of a shooting mode;
a photographing mode determination unit for determining that the current photographing mode is the motion photographing mode in response to detecting a selection operation indicating selection of the motion photographing mode.
Optionally, the shooting mode detection module includes:
a photographic subject acquisition unit configured to acquire a focusing area and a photographic subject within the focusing area in response to detection of a trigger operation indicating focusing;
and the shooting mode determining unit is used for responding to the moving of the shooting object in the focusing area within the preset time length and the stable background, and determining that the current shooting mode is the motion shooting mode.
Alternatively,
the preview image photographing module includes:
the device comprises a preview image shooting unit, a preview image acquisition unit and a display unit, wherein the preview image shooting unit is used for acquiring a preview image according to a preset interval time, and the size of the preview image is the same as that of an image sensor in the electronic equipment.
Optionally, the apparatus further includes an interval time updating unit, configured to update the preset interval time, and specifically includes:
a moving speed obtaining subunit, configured to obtain a moving speed of the photographic subject in the preview image;
the interval time determining subunit is used for determining the interval time corresponding to the motion speed of the shooting object based on the preset corresponding relation between the motion speed and the interval time;
and the interval time updating subunit is used for updating the preset interval time.
Optionally, the preview image acquiring module includes:
a preview image reading unit configured to read a preset number of frames of preview images from a designated position;
alternatively, the first and second electrodes may be,
and the preview image selecting unit is used for selecting a preset number of frames of video frames from the specified video as preview images.
Optionally, the preview image processing module includes:
a foreground and background acquiring unit, configured to sequentially input each preview image into a first gaussian mixture model for acquiring a foreground portion and a second gaussian mixture model for acquiring a background portion, and respectively acquire the foreground portion and the background portion in each preview image;
an object position acquiring unit configured to acquire a position of the photographic object in each of the preview images based on a foreground portion in each of the preview images;
a moving direction determining unit configured to determine a moving direction of the photographic subject based on a position of the photographic subject in each of the preview images.
Optionally, the preview image processing module includes:
the foreground and background acquisition unit is used for sequentially inputting each preview image into a preset semantic model to acquire a foreground part and a background part in each preview image; the background part is the part except the foreground part in each preview image;
a subject position acquiring unit configured to take a position of the photographic subject in each preview image as a position based on a position of a foreground portion in each preview image;
a moving direction determining unit configured to determine a moving direction of the photographic subject based on a position of the photographic subject in each of the preview images.
Optionally, the target image acquiring module includes:
a to-be-processed image determining unit, configured to determine a preview image to be processed based on a position of the captured image in each preview image;
the motion blurring processing unit is used for carrying out motion blurring processing opposite to the motion direction on the background part of the preview image to be processed based on the motion direction to obtain a blurred background image;
and the target image acquisition unit is used for superposing the foreground part of the preview image to be processed to the blurred background image to obtain the target image.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a camera;
a processor;
a memory for storing a computer program executable by the processor;
the processor is configured to execute the computer program in the memory to implement the steps of the method described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a readable storage medium having stored thereon an executable computer program which, when executed, performs the steps of the method described above
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
as can be seen from the foregoing embodiments, in the embodiments of the present disclosure, the images are previewed by obtaining a preset number of frames; then, processing the preview images of the preset number of frames, and acquiring the foreground part, the background part, the position of the shot object in each preview image and the motion direction of the shot object in each preview image; then, a target image with a background motion blur effect may be acquired based on the foreground portion, the background portion, the position of the photographic subject in each preview image, and the moving direction of the photographic subject in each preview image. In this way, in the embodiment, by processing the preview image, a target image with a background dynamic blurring effect can be obtained, and the motion feeling of the shooting object can be highlighted; moreover, in the embodiment, the user does not need to use professional shooting equipment, and the user does not need to have professional shooting technology, so that the shooting experience is favorably improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is an effect diagram exemplified in the related art.
FIG. 2 is a flow chart illustrating an image acquisition method according to an exemplary embodiment.
FIG. 3 is a flowchart illustrating acquiring a preview image according to an exemplary embodiment.
Fig. 4 is a flow diagram illustrating an acquisition motion capture mode according to an exemplary embodiment.
Fig. 5 is a flow diagram illustrating an acquisition motion capture mode according to an exemplary embodiment.
Fig. 6 is an effect diagram of a photographic subject shown according to an exemplary embodiment.
FIG. 7 is a flowchart illustrating an update interval time according to an example embodiment.
Fig. 8(a) to 8(d) are diagrams illustrating effects of acquiring a 4-frame preview image according to an exemplary embodiment.
FIG. 9 is a flow chart illustrating one method of obtaining a direction of motion according to an exemplary embodiment.
FIG. 10 is a flow chart illustrating another method of obtaining a direction of motion according to an exemplary embodiment.
FIG. 11 is a flowchart illustrating acquiring a target image according to an exemplary embodiment.
FIG. 12 is an effect diagram of a target image shown in accordance with an exemplary embodiment.
Fig. 13 to 18 are block diagrams illustrating an image pickup apparatus according to an exemplary embodiment.
FIG. 19 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The following exemplary described embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of devices consistent with certain aspects of the present disclosure as recited in the claims below.
In practical application, in order to obtain a remote shooting effect, a user needs to use professional shooting equipment and professional shooting skills, so that shooting experience is reduced.
In order to solve the technical problem, an embodiment of the present disclosure provides an image obtaining method, which is applicable to an electronic device, where the electronic device may be provided with a camera, so as to have a function of obtaining a preview image; a data transmission interface may also be provided, so that the function of reading preview images from other electronic devices is provided, and the setting can be performed according to specific scenes. FIG. 2 is a flow chart illustrating an image acquisition method according to an exemplary embodiment. Referring to fig. 2, an image acquisition method includes steps 21 to 23, in which:
in step 21, a preset number of frame preview images are acquired.
In this embodiment, the manner of acquiring the preview image by the electronic device may include:
in some embodiments, a camera is disposed on the electronic device, and the electronic device can acquire the preview image in real time. The electronic device may store a plurality of shooting modes in advance, such as a normal shooting mode, a motion shooting mode, a panorama shooting mode, and the like, and the technician may set the shooting modes according to technical scenarios, which is not limited herein.
And when the starting of the camera is detected, the electronic equipment enters a preview state. At this time, the current shooting mode of the electronic device may continue to be the shooting mode at the last shooting, or the current shooting mode of the electronic device may be the shooting mode preset by the user, or the user manually adjusts the current shooting mode, or the electronic device automatically switches the current shooting mode.
Referring to fig. 3, in step 31, the electronic device may detect a current photographing mode, including:
in one example, referring to fig. 4, in step 41, the electronic device may detect a selection operation by a user, and when the selection operation indicating selection of a photographing mode is detected, a plurality of preset photographing modes may be acquired in response to the selection operation. For example, the selection operation may be that the user clicks a shooting mode menu, and at this time, the electronic device may acquire a plurality of shooting modes included in the menu. In step 42, the electronic device may determine that the current photographing mode is the motion photographing mode in response to detecting a selection operation, e.g., a click operation, indicating selection of one of the plurality of photographing modes.
In another example, referring to fig. 5, in step 51, the electronic device may detect a trigger operation of a user, such as a focusing operation, and when the trigger operation indicating focusing is detected, a focusing area may be acquired in response to the trigger operation indicating focusing. Then, the electronic device may obtain the photographic object in the focusing area by using a preset semantic model, where the photographic object is a pedestrian as shown in fig. 6. Wherein the semantic model may include, but is not limited to: an image recognition algorithm, or a deep learning algorithm. In step 52, the electronic apparatus starts timing when a trigger operation indicating focusing is detected, and determines whether a photographic subject within a focusing area moves and whether a background other than the photographic subject is stable. The background is stable, that is, the displacement of the designated pixel in the two adjacent frames of preview images cannot exceed the first displacement threshold, for example, the first displacement threshold takes the value of 10 pixels, and the shot object movement refers to the displacement of the designated pixel on the shot object in the two adjacent frames of preview images exceeds the second displacement threshold, for example, the second displacement threshold takes the value of 100 pixels.
With continued reference to fig. 3, in step 32, in response to detecting that the current photographing mode is the motion photographing mode, a preview image is acquired.
In this embodiment, the electronic device may acquire a preview image within a viewing range in response to detecting that the current shooting mode is the motion shooting mode. In one example, the electronic device acquires preview images at preset intervals, where the size of the preview images is the same as the size of an image sensor within the electronic device, known colloquially as a "big picture". The preset interval time can be set to 200 milliseconds, so that the movement of a shot object in a visual range can be displayed in two adjacent frames of preview images, external noise can not be introduced, and the shooting quality of the preview images is favorably improved.
In another example, the electronic device may update the preset interval time. Referring to fig. 7, in step 71, the electronic device may acquire a moving speed of a photographic subject in a preview image. The motion speed obtaining mode comprises the following steps: in one example, the electronic device acquires two adjacent frames of preview images, and the movement speed of the photographic subject can be calculated according to the position of the photographic subject and the preset interval time. In another embodiment, since the electronic device focuses the photographic subject when acquiring each preview image, the movement speed and the movement direction of the photographic subject can be acquired when focusing (or tracking) the photographic subject as well. In step 72, the electronic device may preset a corresponding relationship between the movement speed and the interval time, so that the electronic device may determine the interval time corresponding to the movement speed of the photographic object based on the preset corresponding relationship between the movement speed and the interval time. In step 73, the preset interval is updated with the new interval. In this embodiment, the preset interval time is updated, so that the method and the device can adapt to a scene with a changed motion speed of the shot object, ensure that each preview image contains the shot object, avoid the situation that no shot object exists in the preview image, and improve the shooting efficiency.
In this embodiment, the electronic device may detect a trigger operation indicating that the user takes an image, such as pressing a shutter or clicking a shooting virtual key, and when the trigger operation is detected, may respond to the trigger operation indicating that the image is taken, and may start at a time when the trigger operation is detected, and acquire a preset number of frame preview images before the trigger operation, with the effect as shown in fig. 8(a), fig. 8(b), fig. 8(c), and fig. 8 (d). The preset number may be set according to a specific scenario, and in an example, the value of the preset number is 4. Of course, if the computing resources of the electronic device are sufficient, the preset number may be as large as possible, for example, 10 to 20, and as the preset number is larger, the effect of the subsequent target image is better.
In other embodiments, considering that the electronic device has a multi-shot function, the electronic device may read a preset number of frames (multi-shot) of images from a designated location (e.g., local memory, cache) as preview images. Considering that the electronic device is provided with a data transmission interface, in this case, the electronic device can communicate with other electronic devices through the data transmission interface, and read a preset number of frame images from a specified location (e.g., local memory, cache) of the other electronic devices as preview images. Of course, the electronic device may also select a preset number of frames of video frames from the video as the preview image. A technician can select a suitable mode to acquire a preset number of frame preview images according to the functions of the electronic device, and the corresponding scheme falls within the protection scope of the present disclosure.
In step 22, the preview images of the preset number of frames are processed to obtain the foreground portion, the background portion, the position of the photographic subject in each preview image, and the moving direction of the photographic subject in each preview image.
In this embodiment, the electronic device may process the preview image of the preset data frame to obtain the foreground portion, the background portion, the position of the photographic object in each preview image, and the moving direction of the photographic object in each preview image, including:
in an example, a Gaussian Mixture Model (GMM) for obtaining a foreground portion, which is referred to as a first gaussian mixture model for distinguishing, and a Gaussian Mixture Model (GMM) for obtaining a background portion, which is referred to as a second gaussian mixture model for distinguishing, may be pre-stored in the electronic device. Referring to fig. 9, in step 91, the electronic device may sequentially input each preview image to the first gaussian mixture model and the second gaussian mixture model to obtain a foreground portion and a background portion in each preview image, respectively. In step 92, the electronic device may acquire the position of the photographic subject in each preview image based on the foreground portion in each preview image. In step 93, the electronic device may determine the moving direction of the photographic subject based on the position of the photographic subject in each preview image, for example, the position of the photographic subject in two adjacent preview images may be used to determine the displacement of the photographic subject, and the moving direction of the photographic subject may be determined by the displacement. Or, the movement speed of the shooting object can be calculated by combining the displacement and the preset interval time, and since each frame of preview image corresponds to one shooting moment, the movement speed is a vector, and the direction of the vector is the movement direction.
In another example, a semantic model, such as an image recognition algorithm implemented based on a neural network, may be preset in the electronic device, and the foreground portion of the input image may be obtained through the semantic model. Referring to fig. 10, in step 101, the electronic device may sequentially input each preview image into a preset semantic model, where the semantic model may output a foreground portion in each preview image, and a portion other than the foreground portion is a background portion, that is, the foreground portion and the background portion in each preview image may be obtained. In practical application, considering that the semantic model only outputs the confidence rate of each semantic segmentation area, the semantic segmentation areas need to be associated according to the focusing position in the tracking process, so that the foreground part and the same shooting object can be determined. In step 102, the electronic device may determine the position as the position of the photographic subject in each preview image based on the position of the foreground portion in each preview image. In step 93, the electronic device may determine a moving direction of the photographic subject based on the position of the photographic subject in each preview image. For example, by means of displacement or by means of movement speed, see the content of step 73 for details, which are not described herein again.
In still another embodiment, the moving direction of the photographic subject may be determined when the photographic subject is tracked during the acquisition of the preview image, or the moving direction may be determined using the position of the in-focus area. For example, the position of the in-focus area in the second frame preview image is moved rightward with respect to the first frame preview image, and at this time, the moving direction of the tracking photographic subject can be determined to be rightward. Moreover, the foreground part and the background part of each preview image are still realized by the scheme of step 91 or step 101, and the position of the shooting object is still realized by the scheme of step 91 or step 102.
It should be noted that, in the foregoing embodiment, only a limited number of examples of obtaining the foreground part, the background part, and the moving direction are illustrated, and a technician may combine the foregoing solutions according to a specific scene or set other technical solutions, where the foreground part, the background part, and the moving direction can be obtained, each solution falls within the protection scope of the present disclosure.
In step 23, a target image with a background motion blur effect is acquired based on a foreground portion, a background portion, a position of a photographic subject in each preview image, and a moving direction of the photographic subject in each preview image.
In this embodiment, referring to fig. 11, in step 111, the electronic device may determine a preview image to be processed based on the position of the captured image in each preview image. Assuming that the preview image of the photographic subject closest to the center of the preview image is the preview image to be processed, the electronic device may acquire the distance between the designated position on the photographic image and the center position of the preview image, and use the preview image corresponding to the smallest distance as the preview image to be processed. In step 112, a motion blur process is performed on the background portion of the preview image to be processed based on the motion direction, which is opposite to the motion direction, to obtain a blurred background image. The motion blur processing may be, but not limited to, a convolution blur, a convolution smoothing filter, a point spread function, and the like, and is not limited herein. In step 113, the electronic device may superimpose the foreground portion of the preview image to be processed on the blurred background image to obtain a target image, where the target image has the background dynamic blurring effect shown in fig. 12, that is, the moving car is clear, and other areas are blurred, so that the moving car can be highlighted.
Therefore, in the embodiment of the present disclosure, a preset number of frame preview images may be obtained; then, processing the preview images of the preset number of frames, and acquiring the foreground part, the background part, the position of the shot object in each preview image and the motion direction of the shot object in each preview image; then, a target image with a background motion blur effect may be acquired based on the foreground portion, the background portion, the position of the photographic subject in each preview image, and the moving direction of the photographic subject in each preview image. In this way, in the embodiment, by processing the preview image, a target image with a background dynamic blurring effect can be obtained, and the motion feeling of the shooting object can be highlighted; moreover, in the embodiment, the user does not need to use professional shooting equipment, and the user does not need to have professional shooting technology, so that the shooting experience is favorably improved.
Fig. 13 is a block diagram illustrating an image capturing apparatus according to an exemplary embodiment, applied to an electronic device, and referring to fig. 13, the image capturing apparatus includes:
a preview image obtaining module 131, configured to obtain a preset number of frame preview images;
a preview image processing module 132, configured to process the preview images of the preset number of frames, and obtain a foreground portion, a background portion, a position of the photographic object in each preview image, and a moving direction of the photographic object in each preview image;
and a target image acquiring module 133, configured to acquire a target image with a background motion blur effect based on a foreground portion and a background portion in each of the preview images, a position of the photographic subject in each of the preview images, and a moving direction of the photographic subject.
In one embodiment, the apparatus further comprises:
the shooting mode detection module is used for detecting the current shooting mode of the electronic equipment;
and the preview image shooting module is used for responding to the detection that the current shooting mode is the motion shooting mode, acquiring preview images and obtaining at least a preset number of frames of preview images.
In one embodiment, referring to fig. 14, the photographing mode detecting module includes:
a shooting mode acquisition unit 141 for acquiring a plurality of preset shooting modes in response to detection of a selection operation indicating selection of a shooting mode;
a photographing mode determining unit 142 for determining that the current photographing mode is the motion photographing mode in response to detecting a selection operation indicating selection of the motion photographing mode.
In one embodiment, referring to fig. 15, the photographing mode detecting module includes:
a photographic subject acquisition unit 151 configured to acquire a focusing area and a photographic subject within the focusing area in response to detection of a trigger operation indicating focusing;
a shooting mode determination unit 152, configured to determine that the current shooting mode is a motion shooting mode in response to the shooting subject moving and the background being stable within the focus area within a preset time period.
In one embodiment, the preview image capture module includes:
the device comprises a preview image acquisition unit, a display unit and a display unit, wherein the preview image acquisition unit is used for acquiring a preview image according to a preset interval time, and the size of the preview image is the same as that of an image sensor in the electronic equipment.
In an embodiment, referring to fig. 16, the apparatus further includes an interval time updating unit, configured to update the preset interval time, specifically including:
a moving speed acquisition sub-unit 161 for acquiring a moving speed of the photographic subject in the preview image;
an interval time determining subunit 162, configured to determine, based on a preset correspondence between a movement speed and an interval time, an interval time corresponding to the movement speed of the photographic object;
an interval time updating subunit 163 configured to update the preset interval time.
In one embodiment, referring to fig. 17, the preview image processing module 132 includes:
a foreground-background acquiring unit 171, configured to sequentially input each preview image into a first gaussian mixture model for acquiring a foreground portion and a second gaussian mixture model for acquiring a background portion, and respectively acquire the foreground portion and the background portion in each preview image;
an object position acquiring unit 172 configured to acquire the position of the photographic object in each preview image based on the foreground portion in each preview image;
a moving direction determining unit 173 configured to determine a moving direction of the photographic subject based on the position of the photographic subject in each preview image.
In one embodiment, with continued reference to fig. 17, the preview image processing module 132 includes:
the foreground background acquiring unit 171 is further configured to sequentially input each preview image into a preset semantic model, and obtain a foreground portion and a background portion in each preview image; the background part is the part except the foreground part in each preview image;
a subject position acquiring unit 172, configured to further determine, based on the position of the foreground portion in each preview image, the position as the position of the photographic subject in each preview image;
a moving direction determining unit 173 is further configured to determine a moving direction of the photographic subject based on the position of the photographic subject in each preview image.
In one embodiment, with continued reference to fig. 18, the target image acquisition module 133 includes:
a to-be-processed image determining unit 181 configured to determine a preview image to be processed based on a position of the captured image in each of the preview images;
a motion blur processing unit 182, configured to perform motion blur processing opposite to the motion direction on the background portion of the preview image to be processed based on the motion direction, so as to obtain a blurred background image;
the target image obtaining unit 183 is configured to superimpose the foreground portion of the preview image to be processed on the blurred background image, so as to obtain the target image.
It can be understood that the apparatus provided in the embodiments of the present disclosure corresponds to the method described above, and specific contents may refer to the contents of each embodiment of the method, which are not described herein again.
FIG. 19 is a block diagram illustrating an electronic device in accordance with an example embodiment. For example, the electronic device 1900 may be a smartphone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
Referring to fig. 19, electronic device 1900 may include one or more of the following components: a processing component 1902, a memory 1904, a power component 1906, a multimedia component 1908, an audio component 1910, an input/output (I/O) interface 1912, a sensor component 1914, a communications component 1916, and an image capture component 1918.
The processing assembly 1902 generally operates the entirety of the electronic device 1900, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 1902 may include one or more processors 1920 to execute computer programs. Further, the process component 1902 can include one or more modules that facilitate interaction between the process component 1902 and other components. For example, the processing component 1902 can include a multimedia module to facilitate interaction between the multimedia component 1908 and the processing component 1902. In an example, the processor 1920 may implement the steps of the methods illustrated in fig. 1-11.
The memory 1904 is configured to store various types of data to support operations at the electronic device 1900. Examples of such data include computer programs for any application or method operating on the electronic device 1900, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1904 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 1906 provides power to the various components of the electronic device 1900. Power components 1906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 1900.
The multimedia component 1908 includes a screen that provides an output interface between the electronic device 1900 and the target object. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a target object. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Audio component 1910 is configured to output and/or input audio signals. For example, audio component 1910 includes a Microphone (MIC) configured to receive external audio signals when electronic device 1900 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1904 or transmitted via the communication component 1916. In some embodiments, audio component 1910 further includes a speaker for outputting audio signals.
The I/O interface 1912 provides an interface between the processing component 1902 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc.
The sensor component 1914 includes one or more sensors to provide various aspects of state assessment for the electronic device 1900. For example, sensor component 1914 may detect an open/closed state of electronic device 1900, the relative positioning of components, such as a display and keypad of electronic device 1900, the sensor component 1914 may also detect a change in the position of electronic device 1900 or a component, the presence or absence of a target object in contact with electronic device 1900, the orientation or acceleration/deceleration of electronic device 1900, and a change in the temperature of electronic device 1900.
The communication component 1916 is configured to facilitate wired or wireless communication between the electronic device 1900 and other devices. The electronic device 1900 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1916 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1916 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 1900 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components.
In an exemplary embodiment, a non-transitory readable storage medium is also provided, such as the memory 1904 including instructions, that includes an executable computer program that is executable by the processor. The readable storage medium may be, among others, ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (22)

1. An image acquisition method applied to an electronic device, the method comprising:
acquiring preview images of a preset number of frames;
processing the preview images of the preset number of frames to acquire a foreground part, a background part, the position of a shot object in each preview image and the motion direction of the shot object in each preview image;
and acquiring a target image with a background dynamic blurring effect based on the foreground part and the background part in each preview image, the position of the shooting object in each preview image and the motion direction of the shooting object.
2. The image acquisition method according to claim 1, wherein before acquiring a preset number of frame preview images, the method further comprises:
detecting a current shooting mode of the electronic equipment;
and acquiring preview images to obtain at least a preset number of frame preview images in response to the fact that the current shooting mode is the motion shooting mode.
3. The image acquisition method according to claim 2, wherein detecting a current shooting mode of the electronic device comprises:
acquiring a plurality of preset shooting modes in response to detection of a selection operation indicating selection of a shooting mode;
in response to detection of a selection operation indicating selection of a motion capture mode, it is determined that the current capture mode is the motion capture mode.
4. The image acquisition method according to claim 2, wherein detecting a current shooting mode of the electronic device comprises:
acquiring a focusing area and a shooting object in the focusing area in response to detection of a trigger operation representing focusing;
and determining that the current shooting mode is the motion shooting mode in response to the fact that the shooting object in the focusing area moves and the background is stable within the preset time length.
5. The image acquisition method according to claim 2, wherein acquiring the preview image comprises:
and acquiring a preview image according to a preset interval time, wherein the size of the preview image is the same as that of an image sensor in the electronic equipment.
6. The image acquisition method according to claim 5, further comprising the step of updating the preset interval time, specifically comprising:
acquiring the movement speed of a shooting object in a preview image;
determining interval time corresponding to the motion speed of the shooting object based on the corresponding relation between the preset motion speed and the interval time;
and updating the preset interval time.
7. The image acquisition method according to claim 1, wherein acquiring a preset number of frame preview images comprises:
a preset number of frames of preview images are read from a designated location, or,
and selecting a preset number of frames of video frames from the specified video as preview images.
8. The image acquisition method according to claim 1, wherein processing the preview images of the preset number of frames to acquire a foreground portion, a background portion, a position of a photographic subject in each preview image, and a moving direction of the photographic subject in each preview image comprises:
sequentially inputting each preview image into a first Gaussian mixture model for acquiring a foreground part and a second Gaussian mixture model for acquiring a background part, and respectively acquiring the foreground part and the background part in each preview image;
acquiring the position of the shooting object in each preview image based on the foreground part in each preview image;
and determining the moving direction of the photographic object based on the position of the photographic object in each preview image.
9. The image acquisition method according to claim 1, wherein processing the preview images of the preset number of frames to acquire a foreground portion, a background portion, a position of a photographic subject in each preview image, and a moving direction of the photographic subject in each preview image comprises:
sequentially inputting each preview image into a preset semantic model to obtain a foreground part and a background part in each preview image; the background part is the part except the foreground part in each preview image;
based on the position of the foreground part in each preview image, and taking the position as the position of the shooting object in each preview image;
and determining the moving direction of the photographic object based on the position of the photographic object in each preview image.
10. The image acquisition method according to claim 1, wherein acquiring the target image with the background motion blur effect based on a foreground portion, a background portion, a position of the photographic subject in each preview image, and a moving direction of the photographic subject in each preview image comprises:
determining preview images to be processed based on the positions of the shot images in the preview images;
performing motion blurring processing opposite to the motion direction on the background part of the preview image to be processed based on the motion direction to obtain a blurred background image;
and superposing the foreground part of the preview image to be processed to the blurred background image to obtain the target image.
11. An image acquisition apparatus, applied to an electronic device, the apparatus comprising:
the preview image acquisition module is used for acquiring preview images of a preset number of frames;
the preview image processing module is used for processing the preview images of the preset number of frames to acquire a foreground part, a background part, the positions of the shot objects in the preview images and the motion directions of the shot objects in the preview images;
and the target image acquisition module is used for acquiring a target image with a background dynamic blurring effect based on the foreground part and the background part in each preview image, the position of the shot object in each preview image and the motion direction of the shot object.
12. The image capturing apparatus according to claim 11, characterized in that the apparatus further comprises:
the shooting mode detection module is used for detecting the current shooting mode of the electronic equipment;
and the preview image shooting module is used for responding to the detection that the current shooting mode is the motion shooting mode, acquiring preview images and obtaining at least a preset number of frames of preview images.
13. The image capturing apparatus according to claim 12, wherein the shooting mode detection means includes:
a shooting mode acquisition unit configured to acquire a plurality of preset shooting modes in response to detection of a selection operation indicating selection of a shooting mode;
a photographing mode determination unit for determining that the current photographing mode is the motion photographing mode in response to detecting a selection operation indicating selection of the motion photographing mode.
14. The image capturing apparatus according to claim 12, wherein the shooting mode detection means includes:
a photographic subject acquisition unit configured to acquire a focusing area and a photographic subject within the focusing area in response to detection of a trigger operation indicating focusing;
and the shooting mode determining unit is used for responding to the moving of the shooting object in the focusing area within the preset time length and the stable background, and determining that the current shooting mode is the motion shooting mode.
15. The image capturing apparatus according to claim 12, wherein the preview image capturing module includes:
the device comprises a preview image shooting unit, a preview image acquisition unit and a display unit, wherein the preview image shooting unit is used for acquiring a preview image according to a preset interval time, and the size of the preview image is the same as that of an image sensor in the electronic equipment.
16. The image capturing device according to claim 15, wherein the device further includes an interval time updating unit, configured to update the preset interval time, specifically including:
a moving speed obtaining subunit, configured to obtain a moving speed of the photographic subject in the preview image;
the interval time determining subunit is used for determining the interval time corresponding to the motion speed of the shooting object based on the preset corresponding relation between the motion speed and the interval time;
and the interval time updating subunit is used for updating the preset interval time.
17. The image capturing apparatus according to claim 11, wherein the preview image capturing module includes:
a preview image reading unit configured to read a preset number of frames of preview images from a designated position;
alternatively, the first and second electrodes may be,
and the preview image selecting unit is used for selecting a preset number of frames of video frames from the specified video as preview images.
18. The image capturing apparatus according to claim 11, wherein the preview image processing module includes:
a foreground and background acquiring unit, configured to sequentially input each preview image into a first gaussian mixture model for acquiring a foreground portion and a second gaussian mixture model for acquiring a background portion, and respectively acquire the foreground portion and the background portion in each preview image;
an object position acquiring unit configured to acquire a position of the photographic object in each of the preview images based on a foreground portion in each of the preview images;
a moving direction determining unit configured to determine a moving direction of the photographic subject based on a position of the photographic subject in each of the preview images.
19. The image capturing apparatus according to claim 11, wherein the preview image processing module includes:
the foreground and background acquisition unit is used for sequentially inputting each preview image into a preset semantic model to acquire a foreground part and a background part in each preview image; the background part is the part except the foreground part in each preview image;
a subject position acquiring unit configured to take a position of the photographic subject in each preview image as a position based on a position of a foreground portion in each preview image;
a moving direction determining unit configured to determine a moving direction of the photographic subject based on a position of the photographic subject in each of the preview images.
20. The image capturing apparatus according to claim 11, wherein the target image capturing means includes:
a to-be-processed image determining unit, configured to determine a preview image to be processed based on a position of the captured image in each preview image;
the motion blurring processing unit is used for carrying out motion blurring processing opposite to the motion direction on the background part of the preview image to be processed based on the motion direction to obtain a blurred background image;
and the target image acquisition unit is used for superposing the foreground part of the preview image to be processed to the blurred background image to obtain the target image.
21. An electronic device, comprising:
a camera;
a processor;
a memory for storing a computer program executable by the processor;
the processor is configured to execute the computer program in the memory to implement the steps of the method of any of claims 1 to 10.
22. A readable storage medium having stored thereon an executable computer program, wherein the computer program when executed implements the steps of the method of any one of claims 1 to 10.
CN202010121331.6A 2020-02-26 2020-02-26 Image acquisition method and device, electronic equipment and storage medium Active CN113315903B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010121331.6A CN113315903B (en) 2020-02-26 2020-02-26 Image acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010121331.6A CN113315903B (en) 2020-02-26 2020-02-26 Image acquisition method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113315903A true CN113315903A (en) 2021-08-27
CN113315903B CN113315903B (en) 2023-08-22

Family

ID=77369805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010121331.6A Active CN113315903B (en) 2020-02-26 2020-02-26 Image acquisition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113315903B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905173A (en) * 2021-08-30 2022-01-07 浙江大华技术股份有限公司 Focusing method, focusing apparatus, and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821243A (en) * 2011-06-07 2012-12-12 索尼公司 Image processing device, method of controlling image processing device, and program for causing computer to execute the same method
JP2015012481A (en) * 2013-06-28 2015-01-19 キヤノン株式会社 Image processing device
CN107409166A (en) * 2015-04-10 2017-11-28 高通股份有限公司 Panning lens automatically generate
WO2018116322A1 (en) * 2016-12-20 2018-06-28 Indian Institute Of Technology Madras System and method for generating pan shots from videos
US20180288315A1 (en) * 2017-03-31 2018-10-04 Lenovo (Beijing) Co., Ltd. Imaging method and electronic device thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821243A (en) * 2011-06-07 2012-12-12 索尼公司 Image processing device, method of controlling image processing device, and program for causing computer to execute the same method
JP2015012481A (en) * 2013-06-28 2015-01-19 キヤノン株式会社 Image processing device
CN107409166A (en) * 2015-04-10 2017-11-28 高通股份有限公司 Panning lens automatically generate
WO2018116322A1 (en) * 2016-12-20 2018-06-28 Indian Institute Of Technology Madras System and method for generating pan shots from videos
US20180288315A1 (en) * 2017-03-31 2018-10-04 Lenovo (Beijing) Co., Ltd. Imaging method and electronic device thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905173A (en) * 2021-08-30 2022-01-07 浙江大华技术股份有限公司 Focusing method, focusing apparatus, and computer-readable storage medium
CN113905173B (en) * 2021-08-30 2023-04-07 浙江大华技术股份有限公司 Focusing method, focusing apparatus, and computer-readable storage medium

Also Published As

Publication number Publication date
CN113315903B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
KR101772177B1 (en) Method and apparatus for obtaining photograph
US10674088B2 (en) Method and device for acquiring image, terminal and computer-readable storage medium
EP3905203A1 (en) Method and apparatus for processing video, and storage medium
CN108154465B (en) Image processing method and device
US11310443B2 (en) Video processing method, apparatus and storage medium
CN107015648B (en) Picture processing method and device
CN110995993B (en) Star track video shooting method, star track video shooting device and storage medium
CN112884809A (en) Target tracking method and device, electronic equipment and storage medium
CN107105311B (en) Live broadcasting method and device
CN111461950B (en) Image processing method and device
CN113315903B (en) Image acquisition method and device, electronic equipment and storage medium
CN109255839B (en) Scene adjustment method and device
CN111340690A (en) Image processing method, image processing device, electronic equipment and storage medium
CN108986803B (en) Scene control method and device, electronic equipment and readable storage medium
EP3905660A1 (en) Method and device for shooting image, and storage medium
CN107707819B (en) Image shooting method, device and storage medium
CN110458962B (en) Image processing method and device, electronic equipment and storage medium
CN109862252B (en) Image shooting method and device
EP3945717A1 (en) Take-off capture method and electronic device, and storage medium
CN114339015B (en) Photographing processing method, photographing processing device and storage medium
CN109447929B (en) Image synthesis method and device
CN117956268A (en) Preview frame rate control method and device thereof
CN112784107A (en) Method, device and storage medium for extracting picture from video
CN114943791A (en) Animation playing method, device, equipment and storage medium
CN115514875A (en) Image processing method and device

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