CN111031178A - Video stream clipping method and electronic equipment - Google Patents

Video stream clipping method and electronic equipment Download PDF

Info

Publication number
CN111031178A
CN111031178A CN201911320804.9A CN201911320804A CN111031178A CN 111031178 A CN111031178 A CN 111031178A CN 201911320804 A CN201911320804 A CN 201911320804A CN 111031178 A CN111031178 A CN 111031178A
Authority
CN
China
Prior art keywords
image
area
video stream
electronic device
clipping
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.)
Pending
Application number
CN201911320804.9A
Other languages
Chinese (zh)
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 CN201911320804.9A priority Critical patent/CN111031178A/en
Publication of CN111031178A publication Critical patent/CN111031178A/en
Priority to PCT/CN2020/136656 priority patent/WO2021121237A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Human Computer Interaction (AREA)
  • Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention provides a video stream clipping method and electronic equipment, relates to the technical field of communication, and aims to solve the problem that a main body in one or some images in a clipped video stream is lost when the video stream is clipped. The scheme comprises the following steps: determining a first cutting area of a first image in a target video stream, wherein the first cutting area comprises a first object; determining a second cutting area of a second image in the target video stream according to the first cutting area and the first object, wherein the second cutting area comprises a second object in the second image, and the matching degree of the second object and the first object is greater than or equal to a first preset threshold value; and cutting the image outside the first cutting area in the first image, and cutting the image outside the second cutting area in the second image to obtain the cut target video stream. The method is applied to scenes of clipping video streams.

Description

Video stream clipping method and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a video stream clipping method and electronic equipment.
Background
With the development of communication technology, the functions of electronic devices are more and more abundant, for example, a video stream can be cut by the electronic devices to optimize the composition of images in the video stream.
In general, a video stream may be cropped in a cropping mode with a fixed cropping area. Specifically, a cutting area may be set for a video stream, and then the electronic device may cut out areas other than the cutting area in each frame of image of the video stream. For example, the top area of each frame of image of the video stream may be set as the cropping area, and the electronic device may crop out the areas other than the top area in each frame of image of the video stream.
However, according to the above method, when the position of the main body (for example, a face image, etc.) in each frame image in the video stream is changed in a large range, for example, when the main body in the previous frame image is located in the top area of the image and the main body in the next frame image is located in the bottom area of the image, if the video stream is cropped by fixing the cropping area, the main body in some or some of the cropped images in the video stream may be lost.
Disclosure of Invention
The embodiment of the invention provides a video stream clipping method and electronic equipment, which are used for solving the problem that a main body in a certain image or images in a clipped video stream is lost when the video stream is clipped.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present invention provides a video stream clipping method, which may be applied to an electronic device, and the method may include: determining a first cutting area of a first image in a target video stream, wherein the first cutting area comprises a first object; determining a second cutting area of a second image in the target video stream according to the first cutting area and the first object; cutting an image outside a first cutting area in the first image, and cutting an image outside a second cutting area in the second image to obtain a cut target video stream; the second cutting area comprises a second object in the second image, and the matching degree of the second object and the first object is larger than or equal to a first preset threshold value.
In a second aspect, an embodiment of the present invention provides an electronic device, including: the device comprises a determining module and a cutting module. The device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a first cutting area of a first image in a target video stream, and the first cutting area comprises a first object; determining a second cutting area of a second image in the target video stream according to the first cutting area and the first object, wherein the second cutting area comprises a second object in the second image, and the matching degree of the second object and the first object is greater than or equal to a first preset threshold value; and the cutting module is used for cutting the image which is positioned outside the first cutting area determined by the determining module in the first image, and cutting the image which is positioned outside the second cutting area determined by the determining module in the second image to obtain the cut target video stream.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, where the computer program, when executed by the processor, may implement the steps of the video stream cropping method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program may implement the steps of the video stream cropping method according to the first aspect.
In an embodiment of the present invention, an electronic device may determine a first cropped area (including a first object) of a first image in a target video stream; and according to the first clipping area and the first object, determining a second clipping area of a second image in the target video stream (including a second object in the second image, wherein the matching degree of the second object and the first object is greater than or equal to a first preset threshold); and cutting the image outside the first cutting area in the first image, and cutting the image outside the second cutting area in the second image to obtain a cut target video stream. By the scheme, when the electronic device determines the cropping area of one image, the determined cropping area of the other image and the object in the cropping area can be referred to, so that the determined cropping area of the one image determined by the electronic device can include an object matched with the object (for example, two objects are the same object), that is, by adopting the video stream cropping method provided by the embodiment of the invention, the determined cropping area of each image includes the main body of the image, and thus after each frame image in the video stream is cropped according to the cropping areas, the main body of the image in the cropped video stream can be prevented from being lost.
Drawings
Fig. 1 is a schematic diagram of an architecture of a possible android operating system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a video stream clipping method according to an embodiment of the present invention;
fig. 3 is a schematic interface diagram of an application of a video stream clipping method according to an embodiment of the present invention;
fig. 4 is a second schematic interface diagram of an application of a video stream clipping method according to an embodiment of the present invention;
fig. 5 is a third schematic interface diagram of an application of a video stream clipping method according to an embodiment of the present invention;
FIG. 6 is a fourth schematic interface diagram of an application of a video stream clipping method according to an embodiment of the present invention;
FIG. 7 is a fifth schematic view of an interface applied by the video stream clipping method according to the embodiment of the present invention;
fig. 8 is a second schematic diagram illustrating a video stream cropping method according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 10 is a second schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 11 is a third schematic structural diagram of an electronic apparatus according to an embodiment of the invention;
fig. 12 is a hardware schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The term "and/or" herein is an association relationship describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. The symbol "/" herein denotes a relationship in which the associated object is or, for example, a/B denotes a or B.
The terms "first" and "second," etc. herein are used to distinguish between different objects and are not used to describe a particular order of objects. For example, the first object and the second object, etc. are for distinguishing different objects, not for describing a particular order of the objects.
In the embodiments of the present invention, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the description of the embodiments of the present invention, unless otherwise specified, "a plurality" means two or more, for example, a plurality of elements means two or more elements, and the like.
The embodiment of the invention provides a video stream clipping method and electronic equipment, wherein the video stream clipping method can be applied to the electronic equipment, and the electronic equipment can determine a first clipping area (including a first object) of a first image in a target video stream; and according to the first clipping area and the first object, determining a second clipping area of a second image in the target video stream (including a second object in the second image, wherein the matching degree of the second object and the first object is greater than or equal to a first preset threshold); and cutting the image outside the first cutting area in the first image, and cutting the image outside the second cutting area in the second image to obtain a cut target video stream. By the scheme, when the electronic device determines the cropping area of one image, the determined cropping area of the other image and the object in the cropping area can be referred to, so that the determined cropping area of the one image determined by the electronic device can include an object matched with the object (for example, two objects are the same object), that is, by adopting the video stream cropping method provided by the embodiment of the invention, the determined cropping area of each image includes the main body of the image, and thus after each frame image in the video stream is cropped according to the cropping areas, the main body of the image in the cropped video stream can be prevented from being lost.
The electronic device in the embodiment of the present invention may be an electronic device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present invention are not limited in particular.
The following describes a software environment to which the video stream clipping method provided by the embodiment of the present invention is applied, by taking an android operating system as an example.
Fig. 1 is a schematic diagram of an architecture of a possible android operating system according to an embodiment of the present invention. In fig. 1, the architecture of the android operating system includes 4 layers, which are respectively: an application layer, an application framework layer, a system runtime layer, and a kernel layer (specifically, a Linux kernel layer).
The application program layer comprises various application programs (including system application programs and third-party application programs) in an android operating system.
The application framework layer is a framework of the application, and a developer can develop some applications based on the application framework layer under the condition of complying with the development principle of the framework of the application.
The system runtime layer includes libraries (also called system libraries) and android operating system runtime environments. The library mainly provides various resources required by the android operating system. The android operating system running environment is used for providing a software environment for the android operating system.
The kernel layer is an operating system layer of an android operating system and belongs to the bottommost layer of an android operating system software layer. The kernel layer provides kernel system services and hardware-related drivers for the android operating system based on the Linux kernel.
Taking an android operating system as an example, in the embodiment of the present invention, a developer may develop a software program for implementing the video stream clipping method provided in the embodiment of the present invention based on the system architecture of the android operating system shown in fig. 1, so that the video stream clipping method may run based on the android operating system shown in fig. 1. Namely, the processor or the electronic device can implement the video stream clipping method provided by the embodiment of the invention by running the software program in the android operating system.
The electronic device in the embodiment of the invention can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a Personal Computer (PC), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiment of the present invention is not particularly limited.
The execution main body of the video stream clipping method provided in the embodiment of the present invention may be the electronic device, or may also be a functional module and/or a functional entity capable of implementing the video stream clipping method in the electronic device, which may be specifically determined according to actual use requirements, and the embodiment of the present invention is not limited. The following takes an electronic device as an example to exemplarily describe the video stream clipping method provided by the embodiment of the present invention.
In general, cropping a video stream may include cropping the video stream in the temporal domain and cropping the video stream in the spatial domain. The video stream is clipped in the time domain, and a video stream with a longer duration may be clipped into a video stream with a shorter duration. The video stream is cropped in a spatial domain, and the image with larger size in the video stream can be cropped into the image with smaller size.
The size in the embodiment of the present invention may be a side length and/or an area. For example, the size of the image may be a side length of the image and/or an area of the image.
The video stream clipping method provided by the embodiment of the invention can be applied to clipping the video stream on a spatial domain through electronic equipment so as to optimize composition of images in the video stream or highlight scenes of main bodies of the images in the video stream. The main body in the embodiment of the present invention is a general meaning and is not a specific thing, and for example, the main body may be an image or an image of a main portion in a video stream.
Specifically, the electronic device may first determine a cropping area (e.g., a first cropping area in the embodiment of the present invention, hereinafter referred to as cropping area 1) of an image (hereinafter referred to as image a1) in the video stream; then, the electronic device may determine, with reference to an object (hereinafter, referred to as an object B1) in the image a1 in the cropping area 1, whether an object (hereinafter, referred to as an object B2) whose matching degree with the object B1 is greater than or equal to a preset threshold value is included in the other images (hereinafter, referred to as an image a2) in the video stream other than the image a 1. It is understood that object B2 and object B1 may be the same subject in the video stream, e.g., object B2 and object B1 may be facial images of the same user; thus, when the object B2 is included in one image a2, it means that the same subject is included in the image a2 and the image a 1. Then, the electronic device may determine, as a trimming region of the image a2 (e.g., a second trimming region in the embodiment of the present invention, hereinafter referred to as a trimming region 2), a region including the object B2 in the image a2, based on the trimming region 1 and the object B1. By analogy, the electronic device may determine the cropped regions of all images that include the same subject in the video stream. Thus, after the electronic device crops an image out of the cropped area of these images, for example, an image out of cropped area 1 of cropped image a1, and crops an image out of cropped area 2 of image a2, the images of the resulting cropped video stream all include the same body. Thereby avoiding the loss of the main body of the image in the clipped video stream.
It can be understood that, when a video stream is cropped by using the video stream cropping method provided by the embodiment of the present invention, if some images in the video stream do not include the above-mentioned subject (i.e. the matching degree of the object in the images and the above-mentioned object B1 is smaller than the preset threshold), the electronic device may also crop the video stream in the time domain, for example, assuming that the video stream includes 10 frames of images before cropping and 2 frames of images do not include the subject, the electronic device may crop the video stream in the time domain, for example, the electronic device may discard the 2 frames of images. Or, in order to ensure the fluency of the clipped video stream, the electronic device may also clip each frame image in the 2 frames of images in the clipping area of the frame image immediately preceding the frame image. The method can be determined according to actual use requirements, and the embodiment of the invention is not limited.
It should be noted that the above-described cropping process is described by taking an object in a video stream as an example, and in the actual cropping process, images including different objects may be cropped respectively. For example, assuming that 2 subjects are included in one video stream, namely, subject 1 and subject 2, the electronic device may respectively clip the frame images including subject 1 and the frame images including subject 2 according to the video stream clipping method provided by the embodiment of the present invention. The method can be determined according to actual use requirements, and the embodiment of the invention is not limited.
The following describes an exemplary video stream clipping method according to an embodiment of the present invention with reference to the drawings.
As shown in fig. 2, an embodiment of the present invention provides a video stream clipping method, which may include S201 to S203 described below.
S201, the electronic equipment determines a first cutting area of a first image in the target video stream.
The first cropping area may include a first object.
In the embodiment of the present invention, the target video stream may be a video stream that is tailored to a user's requirement. The first object may be understood as a subject in the target video stream. The body may be an object that the user desires to retain in the cropped target video stream.
Optionally, in this embodiment of the present invention, the first object may be any object having a clear boundary in the first image. For example, the first object may include at least one of: the image of the whole body of a person, the image of the face of a person, the image of a house, the image of a tree, the image of an animal, and the like can be determined according to actual use requirements, and the embodiment of the invention is not limited.
Wherein, any object with a clear boundary in the first image can be determined according to at least one of color, pattern and shape. For example, taking the example of determining an object with a clear boundary in the first image according to colors, if the background color of the first image is white, the object with the color of black, the object with the color of red black, the object with the color of blue black, and the object with the color of green in the first image may all be the object with the clear boundary in the first image.
Optionally, in the embodiment of the present invention, before the electronic device determines the first object in the first image, a user may first trigger the electronic device to select the target video stream, and display the first image in the target video stream, and it can be understood that at this time, the target video stream may be in an editable state.
Optionally, in this embodiment of the present invention, after the electronic device displays the first image, the electronic device may determine the first object in the first image, and then determine the first cropping area according to an area (for example, a first area described below) where the first object is located in the first image. Specifically, the above S201 may be implemented by the following S201a and S201 b.
S201a, the electronic device determines a first object in the first image.
The first object may be an object automatically recognized by the electronic device (implementation mode one), or may be an object selected by a user trigger (implementation mode two), and may be specifically determined according to actual use requirements, which is not limited in the embodiment of the present invention.
The following respectively exemplifies the first and second implementations.
In the first implementation manner, the first object is an object automatically identified by the electronic device.
In an embodiment of the present invention, after the electronic device displays the first image, the electronic device may automatically recognize the object in the first image by using an image recognition technology, and after recognizing the object in the first image, determine at least some of the recognized objects as the first objects.
For example, as shown in fig. 3, assuming that the electronic device recognizes that 3 face images are included in the first image 30 by using a face recognition technique, the electronic device may determine the 3 face images as a whole as the first object; alternatively, the electronic device may determine a partial face image of the 3 face images, for example, a face image having a largest area, a smallest area, or the like, as the first object. The method can be determined according to actual use requirements, and the embodiment of the invention is not limited.
Optionally, in an embodiment of the present invention, in a first implementation manner, if the electronic device cannot identify the object in the first image, for example, the colors of the objects in the first image are similar to the background color of the first image, or the objects have no clear boundary in the first image; the electronic device may display a prompt to the user that the subject is not recognized, for example, the prompt may be "no subject recognized, please try in another image".
In the second implementation mode, the first object triggers the selected object for the user.
In the embodiment of the present invention, after the electronic device displays the first image, if the user inputs an input parameter on the first image, the electronic device may acquire the input parameter input by the user, and determine an object corresponding to the input parameter in the first image as the first object.
Optionally, in the embodiment of the present invention, the input parameter input by the user may be at least one of the following: the input position, the input area, the input track and the input duration may be determined according to actual use requirements, and the embodiment of the present invention is not limited.
For example, as shown in (a) of fig. 4, the electronic device displays a first image 40, the first image 40 includes an image of a tree and an image of a house, if a user clicks on the image of the house, the electronic device may acquire a click position of the user (i.e., an input position input by the user), and identify the image of the house at the click position and determine the image of the house as a first object using an image recognition technique.
Optionally, in an embodiment of the present invention, in a second implementation manner, if the electronic device cannot identify the object corresponding to the input parameter input by the user, for example, the object corresponding to the input parameter input by the user is similar to a background color of the first image, or the object has no clear boundary in the first image; the electronic device may display a prompt to prompt the user that the currently selected subject is not recognizable, for example, the prompt may be "the currently selected subject is not recognizable, please re-select the subject for trial".
Optionally, in the embodiment of the present invention, in the first implementation manner and the second implementation manner, after the electronic device determines the first object, the electronic device may display a first recognition frame (for example, a recognition frame shown as 41 in (b) in fig. 4) in the first area where the first object is located. Wherein the first identification box can be used for indicating the first object determined by the electronic equipment.
In an embodiment of the present invention, a shape of the first region may be the same as a shape of the first recognition frame; the size (for example, the side length or the area) of the first region may be the same as the size of the first recognition frame, or the size of the first region may be smaller than the size of the first recognition frame.
S201b, the electronic device determines a first clipping area according to a first area where the first object is located in the first image.
Optionally, in this embodiment of the present invention, the electronic device may determine, as the first cropping area, an area including the first area in the first image, so that the first cropping area includes the first object.
Optionally, in this embodiment of the present invention, an area of the first cropping area may be larger than an area of the first identification frame. For example, as shown in (b) in fig. 4, the area of the first trimming region indicated by 42 is larger than the area of the first recognition frame indicated by 41.
Optionally, in the embodiment of the present invention, the aspect ratio of the first cropping area may be the same as or different from the aspect ratio of the first image, and may specifically be determined according to an actual use requirement.
Optionally, in this embodiment of the present invention, after the electronic device determines the first cropping area, the electronic device may display a first cropping frame (e.g., the cropping frame shown as 42 in (b) in fig. 4) on the first cropping area to indicate the first cropping area, so that the user may confirm whether the first cropping area meets the actual usage requirement of the user through the first cropping frame. The shape of the first cutting frame is the same as that of the first cutting area, and the size (side length or area) of the first cutting frame is the same as that of the first cutting area.
When the first object is an object automatically recognized by the electronic device, the electronic device may determine the first cropping area by using an AI composition technique. For example, the electronic device may determine one or more recommended cropping areas including the first object, and display a plurality of recommended cropping boxes for indicating the recommended cropping areas, and then the user may trigger the electronic device to select a cropping area whose composition meets the requirements by inputting to one of the recommended cropping boxes.
In the embodiment of the invention, since the electronic device can determine the first cropping area of the first image according to the area of the first object in the first image, it can be ensured that the first cropping area includes a main body which is required by a user and remains in the cropped image (or the cropped video stream), and thus the accuracy of cropping each frame of image in the video stream can be improved.
S202, the electronic equipment determines a second cutting area of a second image in the target video stream according to the first cutting area and the first object.
The second cropping area includes a second object in the second image, and a matching degree between the second object and the first object is greater than or equal to a first preset threshold (which may be determined according to actual usage requirements, and is not limited in the embodiment of the present invention).
In this embodiment of the present invention, the matching degree between the second object and the first object is greater than or equal to the first preset threshold may be understood as: the second object is the same subject in the target video stream as the first object, e.g., the second object is the same facial image (referring to a facial image that includes the same facial features) in the target video stream as the first object.
Optionally, in the embodiment of the present invention, the number of the second images in the target video stream may be one or multiple, and may be specifically determined according to actual use requirements, which is not limited in the embodiment of the present invention.
In the embodiments of the present invention, the number of second images in the target video stream is not limited in the following embodiments unless otherwise specified.
Optionally, in this embodiment of the present invention, the second image may be an image located after the first image in the target video stream; or the image in the target video stream before the first image may be determined according to actual usage requirements, and the embodiment of the present invention is not limited.
Optionally, in the embodiment of the present invention, the step S202 may be specifically implemented by the following steps S202a and S202 b.
S202a, the electronic device determines a second image including a second object in the target video stream according to the first object.
Optionally, in this embodiment of the present invention, assuming that the other images in the target video stream except for the first image are at least one third image, the second image may be an image in the at least one third image.
In the embodiment of the present invention, after the electronic device determines the first object, the electronic device may determine a matching degree of each third image with the first object to determine whether each third image includes the second object; after the electronic device determines that the second object is included in some third image, the electronic device may determine the third image as the second image.
Specifically, the electronic device may extract first target feature information of the first object, and extract second target feature information of each third image; then, the electronic device may sequentially compare each second target feature information with the first target feature information, and determine whether a matching degree of each second target feature information with the first target feature information is greater than or equal to a preset threshold (e.g., the first preset threshold). If the matching degree of a certain second target feature information and the first target feature information is greater than or equal to a first preset threshold, the electronic device may determine that a third image corresponding to the second target feature information includes a second object, and an object indicated by the second target feature information in the third image is the second object. If the matching degree of a certain second target feature information and the first target feature information is smaller than a first preset threshold, the electronic device may determine that the third image corresponding to the second target feature information does not include the second object. And repeating the steps until the electronic equipment compares each second target characteristic information with the first target characteristic information. It is to be understood that when the electronic device determines that the second object is included in a third image, the electronic device may determine that the third image is the second image.
For example, assuming that the first object is a facial image of the user a, taking a third image as an example, the electronic device may extract facial feature information in the first object (i.e., the first target feature information), extract feature information in the third image (i.e., the second target feature information), and compare the feature information with the facial feature information. If the matching degree between the feature information and the facial feature information is greater than or equal to the preset matching degree threshold (i.e., the first preset threshold), the electronic device may determine that the third image includes the facial image of the user a, determine, as the second object, an object corresponding to the second target feature information in the third image, and determine, as the second image, the third image. If the matching degree of the feature information and the facial feature information is smaller than a preset matching degree threshold value, the electronic device may determine that the facial image of the user a is not included in the third image, that is, the second object is not included in the third image.
Optionally, in this embodiment of the present invention, after the electronic device determines a second image, the electronic device may display a second recognition frame in a second area where the second object is located in the second image. Wherein the second identification box may be used to indicate the second object determined by the electronic device. For the description of the second region and the second identification frame, reference may be specifically made to the related description of the first region and the first identification frame in the foregoing embodiment, and details are not repeated here to avoid repetition.
S202b, the electronic device determines a second clipping area including a second object in the second image according to the first clipping area and the first object.
Optionally, in this embodiment of the present invention, the electronic device may determine, through the following two possible implementations (i.e., the first possible implementation and the second possible implementation), the second cropping area including the second object in the second image.
First possible implementation
In the embodiment of the present invention, the electronic device may determine, according to the size of the first cropping area and the relative position of the first object and the first cropping area, a second cropping area including a second object in the second image.
Optionally, in this embodiment of the present invention, the size (side length and/or area) of the second cropping area may be the same as the size of the first cropping area.
Optionally, in this embodiment of the present invention, the electronic device may determine a relative position (hereinafter, referred to as a second relative position) of the second object and the second clipping region according to a relative position (hereinafter, referred to as a first relative position) of the first object and the first clipping region. Wherein the second relative position may be coincident with the first relative position.
Optionally, in this embodiment of the present invention, the electronic device may determine a relative position between a central point of the first object and a central point of the first clipping region as the first relative position; alternatively, the relative position between the center point of the first region and the center point of the first clipping region may be determined as the first relative position.
For example, the first relative position is determined according to the center point of the first region and the center point of the first clipping region. Assuming that the center point of the first region is point a and the center point of the first clipping region is point B, when point a is located at the left side of point B, as shown in fig. 5, it indicates that the first relative position may be that the first object is located in the left region of the first clipping region, so that the electronic device may determine the second relative position that the second object is located in the left region of the second clipping region. When the point a is located at the right side of the point B, it indicates that the first relative position may be that the first object is located in a right area of the first trimming area, so that the electronic device may determine that the second relative position is that the second object is located in a right area of the second trimming area. When the point a is located above the point B, it indicates that the first relative position may be that the first object is located in an upper region of the first trimming region, so that the electronic device may determine that the second relative position is that the second object is located in an upper region of the second trimming region. When the point a is located below the point B, it indicates that the first relative position may be that the first object is located in a lower area of the first trimming area, so that the electronic device may determine that the second relative position is that the second object is located in a lower area of the second trimming area. When point a coincides or approximately coincides with point B, it indicates that the first relative position is that the first object is located in the center area of the first clipping region, so that the electronic device may determine that the second relative position is that the second object is located in the middle area of the second clipping region. The method can be determined according to actual use requirements, and the embodiment of the invention is not limited.
In the embodiment of the present invention, when the center point of the first cropping area is located at the origin of a coordinate system, the center point of the first area is illustrated with respect to the origin.
In addition, in the embodiment of the present invention, the relative position is determined by taking the relative position relationship between the first object and the first clipping region as an example, and in an actual implementation, the relative position relationship and the distance between the first object and the first clipping region may also be determined by combining.
In the embodiment of the present invention, on one hand, since the size of the second clipping area is the same as the size of the first clipping area, it can be ensured that the sizes of the frame images in the clipped target video stream can be kept consistent. On the other hand, since the relative position of the second object and the second cropping area is consistent with the relative position of the first object and the first cropping area, the positions of the first object and the second object in each frame image of the cropped target video stream can be guaranteed to be basically fixed. Therefore, the picture composition effect of the image in the target video stream can be optimized, and the cut target video stream can be ensured to have a better display effect.
Second possible implementation
In the embodiment of the invention, the electronic device may determine the second cropping area including the second object in the second image according to the area ratio of the first object in the first cropping area and the relative position of the first object and the first cropping area.
Optionally, in this embodiment of the present invention, the electronic device may determine, according to an area ratio of the first object in the first cropping area, an area ratio of the second object in the second cropping area; and the relative position of the second object and the second clipping area can be determined according to the relative position of the first object and the first clipping area. For the description of the relative position of the object and the clipping region, reference may be made to the related description of the first possible implementation manner, and details are not described here again to avoid repetition.
Optionally, in this embodiment of the present invention, the area ratio of the first object in the first cropping area may be understood as a ratio of the area of the first object to the area of the first cropping area.
Optionally, in this embodiment of the present invention, the electronic device may determine a ratio (hereinafter, referred to as a second ratio) of the area of the second object to the area of the second clipping region according to a ratio (hereinafter, referred to as a first ratio) of the area of the first object to the area of the first clipping region. Wherein the second ratio may be the same as the first ratio.
Illustratively, assume that the area of the first object is 1 square centimeter and the area of the first cropping area is 2 square centimeters; assuming that the area of the second object is 0.8 square centimeter and the area of the second cutting area is X; the electronic device may determine that the first ratio P1 is 1:2, and the second ratio P2 is 1:2, so that the electronic device may determine that the area X of the second cropped area is 0.8/P2 is 1.6 square centimeters.
In the embodiment of the present invention, on the one hand, since the proportion of the second object in the second clipping area is the same as the proportion of the first object in the second clipping area, it can be ensured that the proportions of the first object and the second object in each frame image in the clipped target video stream are the same. On the other hand, since the relative position of the second object and the second cropping area can be kept consistent with the relative position of the first object and the first cropping area, the positions of the first object and the second object in each frame image of the cropped target video stream can be guaranteed to be basically fixed. Therefore, the composition effect of each frame of image in the target video stream can be optimized, and the main body in the cut target video stream can be further highlighted, so that the cutting effect is improved.
The first possible implementation and the second possible implementation are exemplarily described below with reference to fig. 6.
Exemplarily, in the present embodiment, as shown in fig. 6 (a), it is assumed that the first cropping area 61 of the first image 60 has an area of 2 square centimeters, and the first cropping area 61 includes a face image (i.e., a first object), the face image being located in a central area of the first cropping area, and the face image having an area of 1 square centimeter; as shown in fig. 6 (b) or fig. 6 (c), it is assumed that the second image 62 also includes a face image, and the area of the face image in the second image 62 is 0.5 square centimeter. Then, in a first possible implementation, as shown in fig. 6 (b), the electronic device may determine that the area of the second trimming region 63 is 2 square centimeters, and the center point of the second trimming region 63 coincides with the center point of the face image in the second image 62; namely, the electronic equipment determines the two cutting areas according to the size of the first cutting area and the relative position of the first object and the first cutting area. In a second possible implementation, as shown in fig. 6 (c), the electronic device determines that the area of the second cropping area 63 is 1 square centimeter, and the center point of the second cropping area 63 coincides with the center point of the face image in the second image 62; namely, the electronic equipment determines the second cutting area according to the area ratio of the first object in the first cutting area and the relative position of the first object and the first cutting area.
Optionally, in this embodiment of the present invention, after the electronic device determines the second cropping area, when the electronic device displays the second image, the electronic device may display a second cropping frame on the second cropping area, where a size of the second cropping frame is the same as a size of the second cropping area. For other descriptions of the second crop box, reference may be specifically made to the related description of the second crop box in the foregoing embodiment, and details are not described here again.
Optionally, in this embodiment of the present invention, after determining the second clipping area, the electronic device may further divide the target video stream into at least one video segment according to a distribution condition of a main body (for example, the first object or the second object) in the target video stream, and mark each video segment, for example, a flag mark may be set in each of a first frame and a last frame of each video stream segment; or the time period corresponding to each video clip in the progress bar of the target video stream may be marked with a different color.
Wherein, each frame of image of each video stream segment can include the first object or the second object, i.e. include the main body in the target video stream.
S203, the electronic equipment cuts the image which is positioned outside the first cutting area in the first image, cuts the image which is positioned outside the second cutting area in the second image, and obtains a cut target video stream.
In the embodiment of the present invention, the electronic device may crop an image, which is located outside the first cropping area, in the first image, by: the electronic device retains an image of the first image that is within the first cropped area and discards an image of the first image that is outside the first cropped area. The electronic device cropping the image of the second image that is outside the second cropping area may be understood as: the electronic device retains images in the second image that are within the second cropped area and discards images in the second image that are outside the second cropped area. In this way, the clipped target video stream of the electronic device includes the image in the first clipping region and the image in the second clipping region.
It can be understood that, in an actual implementation, the second image may be a plurality of frames of second images, and thus, after the first image and the plurality of frames of second images are cropped, the cropped first image and the cropped plurality of frames of second images are synthesized into one video stream, and the cropped target video stream can be obtained.
In an embodiment of the present invention, when the electronic device crops an image (the first image or the second image) that is outside the cropping area (the first cropping area or the second cropping area), the cropping may be performed by using a Cohen-Sutherland cropping algorithm, a midpoint segmentation algorithm, or a Sutherland-Hodgeman cropping algorithm.
In the video stream cropping method provided by the embodiment of the present invention, when the electronic device determines the cropping area of one image, the determined cropping area of the other image and the object in the cropping area can be referred to, so that the cropping area of the one image determined by the electronic device can include an object matching the object (for example, two objects are the same object), that is, by using the video stream cropping method provided by the embodiment of the present invention, the determined cropping area of each image includes the body of the image, and thus after each frame of image in the video stream is cropped according to the cropping areas, the body of the image in the cropped video stream can be prevented from being lost.
Optionally, in the embodiment of the present invention, after the electronic device obtains the clipped target video stream, the electronic device may further perform pixel interpolation on each frame image in the clipped target video stream by using an interpolation method, so as to adjust the size of each frame image in the clipped target video stream. For example, the size of each frame image in the clipped target video stream may be restored to the size before clipping.
Optionally, in this embodiment of the present invention, when the second object is located in the second image and is close to the boundary of the second image, the boundary of the second cropping area determined by the electronic device may exceed the boundary of the second image, and thus, after the electronic device crops an image in the second image that is outside the second cropping area, the size of the obtained image may be smaller than the size of the second cropping area. Further, in order to ensure that the sizes of the frame images in the cropped target video stream are consistent, the embodiment of the present invention may adjust the second cropping area when the boundary of the second cropping area exceeds the boundary of the second image, so that the adjusted boundary of the second cropping area is located in the second image, that is, the adjusted boundary of the second cropping area does not exceed the boundary of the second image.
A method for determining whether the boundary of the second trimming area exceeds the boundary of the second image by the electronic device will be described first.
Illustratively, it is assumed that the second image and the second crop area are in the same coordinate system. After the electronic device determines the second crop area, the electronic device may acquire a coordinate range of a boundary of the second crop area on an x-axis of the coordinate system (hereinafter, referred to as a first coordinate range) and a coordinate range of a boundary of the second crop area on a y-axis of the coordinate system (hereinafter, referred to as a second coordinate range), and acquire a coordinate range of a boundary of the second image on the x-axis of the coordinate system (hereinafter, referred to as a third coordinate range) and a coordinate range of a boundary of the second image on the y-axis of the coordinate system (hereinafter, referred to as a fourth coordinate range). The electronic device may then compare the first coordinate range to a third coordinate range and the second coordinate range to a fourth coordinate range. If all the coordinates in the first coordinate range belong to the third coordinate range and all the coordinates in the second coordinate range belong to the fourth coordinate range, the electronic device may determine that the boundary of the second cropping area does not exceed the boundary of the second image. If at least one coordinate in the first coordinate range belongs to the third coordinate range or at least one coordinate in the second coordinate range belongs to the fourth coordinate range, the electronic device may determine that the boundary of the second cropping area exceeds the boundary of the second image.
For example, assume that the coordinate range of the second image on the X-axis of the planar coordinate system is [ X1, X2], the coordinate range of the second image on the Y-axis of the planar coordinate system is [ Y1, Y2 ]; the coordinate range of the second clipping region on the X-axis of the coordinate system is [ X3, X4], and the coordinate range of the second clipping region on the Y-axis of the planar coordinate system is [ Y3, Y4 ]. The electronic device may compare [ X3, X4] to [ X1, X2], and [ Y3, Y4] to [ Y1, Y2 ]. As shown in (a) of fig. 7, since X3 > X1 and X4 < X2, and Y3 > Y1 and Y4 < Y2, the electronic device may determine that the boundary of the second clipping region 70 does not exceed the boundary of the second image 70. As shown in (b) in fig. 7, since Y4 > Y2, the electronic device may determine that the boundary of the second trimming area 71 exceeds the boundary of the second image 70.
The method for adjusting the second cropping area by the electronic device is further exemplarily described below.
Illustratively, in conjunction with fig. 2, as shown in fig. 8, after S202, the video stream clipping method according to the embodiment of the present invention may further include S204.
And S204, if the electronic equipment determines that the boundary of the second cutting area exceeds the boundary of the second image, adjusting the second cutting area.
The boundary of the second cropping area adjusted by the electronic device can be located in the second image; and the adjusted second clipping region includes a second object.
Optionally, in the embodiment of the present invention, before and after the electronic device adjusts the second clipping area, the shape and size of the second clipping area may be kept unchanged.
Optionally, in this embodiment of the present invention, the electronic device may determine a shift direction of the boundary of the second cropping area with respect to the center point of the second image, and determine a shift amount of the boundary of the second cropping area with respect to the boundary of the second image in the shift direction, so that the electronic device may adjust the second cropping area according to the shift direction and the shift amount.
For example, the electronic device may move the entire second trimming area by the offset amount in a direction opposite to the offset direction while keeping the size of the second trimming area unchanged.
In the embodiment of the invention, when the boundary of the second cropping area exceeds the boundary of the second image, the electronic device can adjust the boundary of the second cropping area into the second image, so that the size of the image obtained after the electronic device crops the image which is positioned outside the second cropping area in the second image is equal to the size of the second cropping area, and the cropped target video stream can be ensured to have a better display effect.
Optionally, in this embodiment of the present invention, after the electronic device determines the second clipping region, the electronic device may adopt a smoothing algorithm to adjust a position of the second clipping region in the second image according to a position of the first clipping region in the first image, so as to adjust a position of the second clipping region in the second image, so as to improve smoothness between frames of images in the clipped target video stream, and thus avoid a picture of the clipped target video stream from shaking.
It should be noted that, in the embodiment of the present invention, after executing the above step S204, the electronic device may further adjust the position of the second cropping area in the second image according to the position of the first cropping area in the first image.
Optionally, in the embodiment of the present invention, the smoothing algorithm may be a unary linear fitting algorithm, or may be a least square method, or may also be any other possible smoothing algorithm, which may be determined specifically according to actual use requirements, and the embodiment of the present invention is not limited.
Specifically, the electronic device may perform linear fitting on the start coordinate of the first clipping region and the start coordinate of the second clipping region to update the start clipping coordinate of the second clipping region, and determine a second clipping region again according to the original size of the second clipping region, with the updated start clipping coordinate as a starting point.
The start coordinate of one clipping region (for example, the first clipping region or the second clipping region) may be any coordinate on the boundary of the clipping region. For example, as shown in fig. 7 (a), the start trimming coordinate of the second trimming area may be any coordinate such as (X1, Y1), (X1, Y2), (X2, Y1), or (X2, Y2).
For example, the electronic device adjusts the position of the second cropping area in the second image by using a unary linear fitting algorithm. The electronic device may perform a linear fit of the coordinates of the starting clipping point of the first clipping region on the x-axis with the coordinates of the starting clipping point of the second clipping region on the x-axis to adjust the coordinates of the starting clipping point of the second clipping region on the x-axis. Accordingly, the electronic device may perform linear fitting on the coordinate of the starting clipping point of the first clipping region on the y-axis and the coordinate of the starting clipping point of the second clipping region on the y-axis to adjust the coordinate of the starting clipping point of the second clipping region on the y-axis. Therefore, the electronic device may adjust the starting cropping point of the second cropping area, and then, the electronic device may determine a second cropping area again according to the original size of the second cropping area, using the adjusted starting cropping point as the starting point, so that the electronic device may adjust the position of the second cropping area in the second image.
In the embodiment of the invention, the electronic device can adjust the smoothness of the clipped target video stream in advance by adjusting the position of the second clipping area in the second image, so that the smoothness of the clipped target video stream can be improved, and the clipped target video stream is ensured to have a better display effect.
In the embodiment of the present invention, the video stream clipping methods shown in the above method drawings are all exemplarily described by referring to one drawing in the embodiment of the present invention. In specific implementation, the video stream clipping method shown in each method drawing can also be implemented by combining any other drawing which can be combined and is illustrated in the above embodiments, and details are not described here.
As shown in fig. 9, an embodiment of the present invention provides an electronic device, which may include: a determination module 901 and a cropping module 902. A determining module 901, configured to determine a first cropping area of a first image in a target video stream, where the first cropping area may include a first object; and determining a second cropping area of a second image in the target video stream according to the first cropping area and the first object. The first cropping area can include a first object, the second cropping area can include a second object in the second image, and the matching degree of the second object and the first object can be greater than or equal to a first preset threshold value; the cropping module 902 may be configured to crop an image in the first image that is outside the first cropping area determined by the determining module 901, and crop an image in the second image that is outside the second cropping area determined by the determining module 901, so as to obtain a cropped target video stream.
Optionally, in this embodiment of the present invention, the determining module 901 may be specifically configured to determine, according to the first object, a second image that includes a second object in the target video stream; and determining a second clipping area including a second object in the second image according to the first clipping area and the first object.
Optionally, in this embodiment of the present invention, the determining module 901 may be specifically configured to determine the second clipping region according to a size of the first clipping region and a relative position of the first object and the first clipping region.
Optionally, in this embodiment of the present invention, the determining module 901 may be specifically configured to determine the second clipping region according to an area ratio of the first object in the first clipping region and a relative position between the first object and the first clipping region.
Optionally, in this embodiment of the present invention, in combination with fig. 9, as shown in fig. 10, the electronic device may further include an adjusting module 903. An adjusting module 903, configured to, after the determining module 901 determines the second cropping area, in a case where the determining module 901 determines that the boundary of the second cropping area exceeds the boundary of the second image, the electronic device may adjust the second cropping area according to the boundary of the second image; and the boundary of the adjusted second cutting area is positioned in the second image.
Optionally, in this embodiment of the present invention, in combination with fig. 9, as shown in fig. 10, the electronic device may further include an adjusting module 903. The adjusting module 903 may be configured to, after the determining module 901 determines the second clipping region, adjust a position of the second clipping region in the second image according to a position of the first clipping region in the first image by using a smoothing algorithm.
Optionally, in this embodiment of the present invention, the determining module 901 may be specifically configured to determine a first object in the first image, and determine a first cropping area according to a first area of the first object in the first image; the first object is an object automatically recognized by the electronic equipment or an object selected by a user trigger.
Optionally, in this embodiment of the present invention, in combination with fig. 9, as shown in fig. 11, the electronic device may further include a display module 904. A display module 904 may be configured to display the first recognition box in the first area after the determination module 901 determines the first object. Wherein the first identification box may be used to indicate the determined first object; the size (area and shape) of the first recognition frame may be the same as the size of the first trimming region.
The electronic device 900 provided in the embodiment of the present invention can implement each process implemented by the electronic device shown in the foregoing method embodiment, and is not described here again to avoid repetition.
An embodiment of the present invention provides an electronic device, where the electronic device may determine a first cropping area (including a first object) of a first image in a target video stream; and according to the first clipping area and the first object, determining a second clipping area of a second image in the target video stream (including a second object in the second image, wherein the matching degree of the second object and the first object is greater than or equal to a first preset threshold); and cutting the image outside the first cutting area in the first image, and cutting the image outside the second cutting area in the second image to obtain a cut target video stream. By the scheme, when the electronic device determines the cropping area of one image, the determined cropping area of the other image and the object in the cropping area can be referred to, so that the determined cropping area of the one image determined by the electronic device can include an object matched with the object (for example, two objects are the same object), that is, by adopting the video stream cropping method provided by the embodiment of the invention, the determined cropping area of each image includes the main body of the image, and thus after each frame image in the video stream is cropped according to the cropping areas, the main body of the image in the cropped video stream can be prevented from being lost.
Fig. 12 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention. As shown in fig. 12, 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, processor 110, and power supply 111. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 12 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, a pedometer, and the like.
The processor 110 is configured to determine a first cropping area of a first image in the target video stream, where the first cropping area includes a first object; determining a second cutting area of a second image in the target video stream according to the first cutting area and the first object; and cutting the image outside the first cutting area in the first image, and cutting the image outside the second cutting area in the second image to obtain a cut target video stream. The second cutting area comprises a second object in the second image, and the matching degree of the second object and the first object is larger than or equal to a first preset threshold value.
It is understood that, in the embodiment of the present invention, the determining module 901 and the clipping module 902 in the structural schematic diagrams of the electronic device (for example, fig. 9 to fig. 11) may be implemented by the processor 110. The adjusting module 903 in the structural schematic diagram of the electronic device (for example, fig. 10) may be implemented by the processor 110. The display module 904 in the structural schematic diagram of the electronic device (for example, fig. 11) can be implemented by the display unit 106.
The embodiment of the invention provides electronic equipment, which can determine a first cutting area (comprising a first object) of a first image in a target video stream; and according to the first clipping area and the first object, determining a second clipping area of a second image in the target video stream (including a second object in the second image, wherein the matching degree of the second object and the first object is greater than or equal to a first preset threshold); and cutting the image outside the first cutting area in the first image, and cutting the image outside the second cutting area in the second image to obtain a cut target video stream. By the scheme, when the electronic device determines the cropping area of one image, the determined cropping area of the other image and the object in the cropping area can be referred to, so that the determined cropping area of the one image determined by the electronic device can include an object matched with the object (for example, two objects are the same object), that is, by adopting the video stream cropping method provided by the embodiment of the invention, the determined cropping area of each image includes the main body of the image, and thus after each frame image in the video stream is cropped according to the cropping areas, the main body of the image in the cropped video stream can be prevented from being lost.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 101 may be used for receiving and sending signals during a message transmission or call process, and specifically, after receiving downlink data from a base station, the downlink data is processed by the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 102, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the network module 102 or stored in the memory 109 into an audio signal and output as sound. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the electronic apparatus 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 includes a speaker, a buzzer, a receiver, and the like.
The input unit 104 is used to receive an audio or video signal. The input unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes image data of a still picture or a video stream obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the network module 102. The microphone 1042 may receive sound and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode.
The electronic device 100 also includes at least one sensor 105, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the electronic device 100 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 105 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 106 is used to display information input by a user or information provided to the user. 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 (LCD), an organic light-emitting diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 107 includes a touch panel 1071 and other input devices 1072. Touch panel 1071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 1071 (e.g., operations by a user on or near touch panel 1071 using a finger, stylus, or any suitable object or attachment). The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and receives and executes commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 1071 may be overlaid on the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although in fig. 12, the touch panel 1071 and the display panel 1061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the electronic device, and is not limited herein.
The interface unit 108 is an interface for connecting an external device to the electronic apparatus 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 100 or may be used to transmit data between the electronic apparatus 100 and the external device.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the electronic device. Processor 110 may include one or more processing units; alternatively, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The electronic device 100 may further include a power supply 111 (e.g., a battery) for supplying power to each component, and optionally, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the electronic device 100 includes some functional modules that are not shown, and are not described in detail herein.
Optionally, an embodiment of the present invention further provides an electronic device, which includes the processor 110 shown in fig. 12, the memory 109, and a computer program stored in the memory 109 and capable of running on the processor 110, where the computer program, when executed by the processor 110, implements the processes of the foregoing method embodiment, and can achieve the same technical effect, and details are not described here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the processes of the method embodiments, and can achieve the same technical effects, and in order to avoid repetition, the details are not repeated here. The computer-readable storage medium may include a read-only memory (ROM), a Random Access Memory (RAM), a magnetic or optical disk, and the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling an electronic device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. A video stream clipping method applied to an electronic device is characterized by comprising the following steps:
determining a first clipping area of a first image in a target video stream, wherein the first clipping area comprises a first object;
determining a second clipping area of a second image in the target video stream according to the first clipping area and the first object, wherein the second clipping area comprises a second object in the second image, and the matching degree of the second object and the first object is greater than or equal to a first preset threshold value;
and cutting the image which is positioned outside the first cutting area in the first image, and cutting the image which is positioned outside the second cutting area in the second image to obtain the cut target video stream.
2. The method of claim 1, wherein determining a second cropped area of a second image in the target video stream based on the first cropped area and the first object comprises:
determining, according to the first object, the second image including the second object in the target video stream;
and determining the second cutting area comprising the second object in the second image according to the first cutting area and the first object.
3. The method of claim 2, wherein the determining the second cropped area in the second image that includes the second object according to the first cropped area and the first object comprises:
and determining the second clipping area according to the size of the first clipping area and the relative position of the first object and the first clipping area.
4. The method of claim 2, wherein the determining the second cropped area in the second image that includes the second object according to the first cropped area and the first object comprises:
and determining the second clipping region according to the area ratio of the first object in the first clipping region and the relative position of the first object and the first clipping region.
5. The method of any of claims 1 to 4, wherein after determining a second cropped area of a second image in the target video stream, the method further comprises:
if the boundary of the second cutting area exceeds the boundary of the second image, adjusting the second cutting area;
and the adjusted boundary of the second cutting area is positioned in the second image.
6. The method of claim 1, wherein after determining a second cropped area of a second image in the target video stream, the method further comprises:
and adjusting the position of the second cutting area in the second image according to the position of the first cutting area in the first image by adopting a smoothing algorithm.
7. An electronic device, characterized in that the electronic device comprises: a determining module and a cutting module;
the determining module is used for determining a first cutting area of a first image in a target video stream, wherein the first cutting area comprises a first object; determining a second clipping area of a second image in the target video stream according to the first clipping area and the first object, wherein the second clipping area comprises a second object in the second image, and the matching degree of the second object and the first object is greater than or equal to a first preset threshold value;
and the cutting module is used for cutting the image which is positioned outside the first cutting area and determined by the determining module in the first image, and cutting the image which is positioned outside the second cutting area and determined by the determining module in the second image to obtain the cut target video stream.
8. The electronic device of claim 7,
the determining module is specifically configured to determine, according to the first object, the second image including the second object in the target video stream; and determining the second cutting area comprising the second object in the second image according to the first cutting area and the first object.
9. The electronic device of claim 8,
the determining module is specifically configured to determine the second clipping region according to the size of the first clipping region and the relative position of the first object and the first clipping region.
10. The electronic device of claim 8,
the determining module is specifically configured to determine the second clipping region according to an area ratio of the first object in the first clipping region and a relative position of the first object and the first clipping region.
11. The electronic device of any of claims 7-10, further comprising an adjustment module;
the adjusting module is configured to, after the determining module determines the second clipping region, adjust the second clipping region if the determining module determines that the boundary of the second clipping region exceeds the boundary of the second image;
and the adjusted boundary of the second cutting area is positioned in the second image.
12. The electronic device of claim 7, further comprising an adjustment module;
and the adjusting module is used for adjusting the position of the second clipping area in the second image according to the position of the first clipping area in the first image by adopting a smoothing algorithm after the determining module determines the second clipping area.
CN201911320804.9A 2019-12-19 2019-12-19 Video stream clipping method and electronic equipment Pending CN111031178A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911320804.9A CN111031178A (en) 2019-12-19 2019-12-19 Video stream clipping method and electronic equipment
PCT/CN2020/136656 WO2021121237A1 (en) 2019-12-19 2020-12-16 Video stream clipping method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911320804.9A CN111031178A (en) 2019-12-19 2019-12-19 Video stream clipping method and electronic equipment

Publications (1)

Publication Number Publication Date
CN111031178A true CN111031178A (en) 2020-04-17

Family

ID=70212189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911320804.9A Pending CN111031178A (en) 2019-12-19 2019-12-19 Video stream clipping method and electronic equipment

Country Status (2)

Country Link
CN (1) CN111031178A (en)
WO (1) WO2021121237A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112132836A (en) * 2020-08-14 2020-12-25 咪咕文化科技有限公司 Video image clipping method and device, electronic equipment and storage medium
CN112561840A (en) * 2020-12-02 2021-03-26 北京有竹居网络技术有限公司 Video clipping method and device, storage medium and electronic equipment
WO2021121237A1 (en) * 2019-12-19 2021-06-24 维沃移动通信有限公司 Video stream clipping method and electronic device
CN115018704A (en) * 2022-05-27 2022-09-06 浙江大华技术股份有限公司 Image processing method and device, electronic equipment and storage medium
WO2023116792A1 (en) * 2021-12-22 2023-06-29 华为技术有限公司 Image display method, electronic device thereof, and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105263049A (en) * 2015-10-28 2016-01-20 努比亚技术有限公司 Video cropping device based on frame coordinate, method and mobile terminal
EP3276951A1 (en) * 2015-03-26 2018-01-31 Sony Corporation Image processing system, image processing method, and program
CN107786812A (en) * 2017-10-31 2018-03-09 维沃移动通信有限公司 A kind of image pickup method, mobile terminal and computer-readable recording medium
CN107911748A (en) * 2017-11-24 2018-04-13 南京融升教育科技有限公司 A kind of video method of cutting out based on recognition of face
CN109040780A (en) * 2018-08-07 2018-12-18 北京优酷科技有限公司 A kind of method for processing video frequency and server
CN109089157A (en) * 2018-06-15 2018-12-25 广州华多网络科技有限公司 Method of cutting out, display equipment and the device of video pictures

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106937114B (en) * 2015-12-30 2020-09-25 株式会社日立制作所 Method and device for detecting video scene switching
CN108447021B (en) * 2018-03-19 2021-06-08 河北工业大学 Video scaling method based on block division and frame-by-frame optimization
CN110322472A (en) * 2018-03-30 2019-10-11 华为技术有限公司 A kind of multi-object tracking method and terminal device
CN108776970B (en) * 2018-06-12 2021-01-12 北京字节跳动网络技术有限公司 Image processing method and device
CN110223301B (en) * 2019-03-01 2021-08-03 华为技术有限公司 Image clipping method and electronic equipment
CN111031178A (en) * 2019-12-19 2020-04-17 维沃移动通信有限公司 Video stream clipping method and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3276951A1 (en) * 2015-03-26 2018-01-31 Sony Corporation Image processing system, image processing method, and program
CN105263049A (en) * 2015-10-28 2016-01-20 努比亚技术有限公司 Video cropping device based on frame coordinate, method and mobile terminal
CN107786812A (en) * 2017-10-31 2018-03-09 维沃移动通信有限公司 A kind of image pickup method, mobile terminal and computer-readable recording medium
CN107911748A (en) * 2017-11-24 2018-04-13 南京融升教育科技有限公司 A kind of video method of cutting out based on recognition of face
CN109089157A (en) * 2018-06-15 2018-12-25 广州华多网络科技有限公司 Method of cutting out, display equipment and the device of video pictures
CN109040780A (en) * 2018-08-07 2018-12-18 北京优酷科技有限公司 A kind of method for processing video frequency and server

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021121237A1 (en) * 2019-12-19 2021-06-24 维沃移动通信有限公司 Video stream clipping method and electronic device
CN112132836A (en) * 2020-08-14 2020-12-25 咪咕文化科技有限公司 Video image clipping method and device, electronic equipment and storage medium
CN112561840A (en) * 2020-12-02 2021-03-26 北京有竹居网络技术有限公司 Video clipping method and device, storage medium and electronic equipment
CN112561840B (en) * 2020-12-02 2024-05-28 北京有竹居网络技术有限公司 Video clipping method and device, storage medium and electronic equipment
WO2023116792A1 (en) * 2021-12-22 2023-06-29 华为技术有限公司 Image display method, electronic device thereof, and medium
CN115018704A (en) * 2022-05-27 2022-09-06 浙江大华技术股份有限公司 Image processing method and device, electronic equipment and storage medium
CN115018704B (en) * 2022-05-27 2024-09-20 浙江大华技术股份有限公司 Image processing method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2021121237A1 (en) 2021-06-24

Similar Documents

Publication Publication Date Title
CN110995923B (en) Screen projection control method and electronic equipment
CN110719402B (en) Image processing method and terminal equipment
CN107817939B (en) Image processing method and mobile terminal
CN109743498B (en) Shooting parameter adjusting method and terminal equipment
CN107977652B (en) Method for extracting screen display content and mobile terminal
CN109032445B (en) Screen display control method and terminal equipment
CN111031178A (en) Video stream clipping method and electronic equipment
CN108763317B (en) Method for assisting in selecting picture and terminal equipment
CN109656437B (en) Information display method and terminal equipment
CN111145087B (en) Image processing method and electronic equipment
CN109495616B (en) Photographing method and terminal equipment
CN111401463B (en) Method for outputting detection result, electronic equipment and medium
CN107153500B (en) Method and equipment for realizing image display
CN107734172B (en) Information display method and mobile terminal
CN111601063B (en) Video processing method and electronic equipment
CN110944113B (en) Object display method and electronic equipment
CN109257504B (en) Audio processing method and terminal equipment
CN109859718B (en) Screen brightness adjusting method and terminal equipment
CN109639981B (en) Image shooting method and mobile terminal
CN109782970B (en) Display method and terminal
CN109104573B (en) Method for determining focusing point and terminal equipment
CN111343710A (en) Power adjustment method and electronic equipment
CN110851098A (en) Video window display method and electronic equipment
CN111026263B (en) Audio playing method and electronic equipment
CN111432122B (en) Image processing method 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200417