Image file pushing method and shooting device
Patent Information
- Application Number
- CN202480026222.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-12-05
AI Technical Summary
When existing shooting devices shoot and store videos, storage space is seriously wasted, storage capacity limitations lead to lag, video editing efficiency is low and labor costs are high, and users need to manually filter the edited videos, resulting in missing video materials and increasing costs.
The frame difference method is used to detect the target object in the video, divide the video frames and filter out the video clips containing the target object, and splice and push based on the video confidence and the moving distance and proportion of the target object, generate the target video and album, reduce storage needs and improve editing efficiency.
Effectively reduce storage space usage, reduce manual editing costs, and improve video editing efficiency. Users can obtain complete target videos and albums without manual editing, improving user experience.
Smart Images

Figure CN121079984A_ABST
Abstract
Description
Image file pushing method and shooting device Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method for pushing image files and a shooting device. Background Art
[0002] A shooting device (e.g., a camera) can be used to record life or shoot specific subjects, such as pets. Most current shooting devices store videos while shooting, and then edit the stored videos. This method not only takes up a lot of storage space and wastes storage resources, but is also limited by the storage capacity of the shooting device. The shooting device may update the system due to a freeze caused by exceeding the storage capacity, resulting in some videos being deleted. If the stored videos have not been edited, some videos will be missing. At this time, if the user wants to view and edit the videos, the available video materials are limited due to the missing video materials. In addition, users will also incur a lot of labor costs when screening / editing videos.
[0003] Summary of the Invention
[0004] The embodiments of the present application disclose a method for pushing an image file and a shooting device, which solve the technical problems of high labor costs and low efficiency in video editing in the prior art.
[0005] The present application provides a method for pushing an image file, the method comprising: capturing an initial video; if it is determined that a target object exists in the initial video, obtaining initial frame difference data of the initial video using a frame difference method; dividing the initial video into multiple first videos based on the initial frame difference data; screening multiple second videos including the target object from the multiple first videos based on video confidence levels of the multiple first videos; splicing the multiple second videos into a target video based on the movement distance and proportion of the target object in each second video, where the proportion is the proportion of the area occupied by the target object in the video frame corresponding to each second video; and pushing the target video to a preset electronic device.
[0006] In some embodiments of the application, the method further includes: determining a target video frame from each second video according to the proportion, generating a target album based on multiple target video frames; and pushing the target album to the electronic device.
[0007] In some embodiments of the application, if it is determined that there is a target object in the initial video, the frame difference method is used to obtain the initial frame difference data of the initial video, including: when the presence of a moving object is detected in the initial video according to the frame difference method, at least one initial video frame including the moving object is input into a preset recognition model; if the moving object is determined to be the target object according to the result output by the recognition model, the movement data of all moving objects in the initial video are obtained as the initial frame difference data based on the frame difference method.
[0008] In some embodiments of the application, dividing the initial video into multiple first videos based on the initial frame difference data includes: determining the video end frame where the moving object stops moving based on the initial frame difference data; and dividing the initial video into multiple first videos based on the video end frame.
[0009] In some embodiments of the application, the method of determining and screening multiple second videos of the target object from the multiple first videos based on the video confidence of the multiple first videos includes: obtaining multiple first video frames of each first video; inputting the multiple first video frames into a preset recognition model to obtain the confidence of each first video frame; taking the first video frame with the maximum confidence among the multiple first video frames corresponding to each first video as the representative frame of each first video; taking the confidence corresponding to the representative frame as the video confidence of the corresponding first video; and selecting multiple first videos corresponding to the video confidence greater than a preset threshold as the multiple second videos.
[0010] In some embodiments of the application, the multiple second videos are spliced into a target video based on the moving distance and proportion of the target object in each second video, including: obtaining the video frame corresponding to each second video, and using the video frame corresponding to each second video as the second video frame; obtaining a first score value for each second video based on the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame; sorting the first score value of each second video from large to small to obtain a sorting result; and splicing the multiple second videos into the target video based on the sorting result.
[0011] In some embodiments of the application, the first scoring value of each second video is obtained based on the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame, including: obtaining the target frame difference data corresponding to the second video from the initial frame difference data; determining the moving distance and the area ratio occupied by the target object in the corresponding second video frame based on the target frame difference data, and determining the proportion corresponding to each second video frame; normalizing the moving distance and the proportion to obtain normalized data; and calculating the average value of the normalized data as the first scoring value.
[0012] In some embodiments of the application, the first score value of each second video is obtained based on the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame, including: obtaining the target frame difference data corresponding to the second video from the initial frame difference data; determining the moving distance and the area ratio occupied by the target object in the corresponding second video frame based on the target frame difference data, and determining the proportion corresponding to each second video frame; normalizing the moving distance and the proportion to obtain normalized data; and determining a peak value from the normalized data as the first score value.
[0013] In some embodiments of the application, the target video frame is determined from each second video according to the proportion, and a target album is generated based on multiple target video frames, including: determining the second video frame with the largest proportion in the second video frames of each second video as the corresponding target video frame, and a second scoring value for each target video frame according to the proportion of the target object in the second video frame corresponding to each second video; generating the target album based on each target video frame; and determining the playback order of each target video frame in the target album based on the second scoring value.
[0014] The present application also provides a photographing device, which includes a processor and a memory, and the processor is used to execute a computer program stored in the memory to implement a method for pushing image files.
[0015] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for pushing the image file is implemented.
[0016] In the method for pushing an image file provided in the present application, an initial video is captured. If it is determined that the target object exists in the initial video, indicating that the initial video is a video to be processed, the initial video is stored and processed. Otherwise, the initial video is not processed and stored, which can reduce the amount of data processing and avoid occupying the storage space of the shooting device to a certain extent. After determining that the target object exists in the initial video, the initial frame difference data of the initial video is obtained by using the frame difference method, the initial video is divided into multiple first videos, and multiple second videos including the target object are screened from the multiple first videos. That is, from the multiple first videos that may include the target object, multiple second videos including the target object are determined based on the video confidence, and multiple second videos that meet the requirements are screened to provide materials for subsequent splicing into the target video. The moving distance and proportion are determined based on the obtained multiple second videos, and the order of splicing the second videos is determined to generate the target video, and the target video is pushed to the user. The user does not need to use other editing software to edit the initial video, which can improve the efficiency of video editing and does not require manual identification of whether the initial video contains the target object, reducing labor costs and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] FIG1 is a schematic diagram of an application scenario of the method for pushing image files provided in an embodiment of the present application.
[0018] FIG2 is a flow chart of a method for pushing an image file provided in an embodiment of the present application.
[0019] FIG3 is a flowchart of a method for pushing an image file provided in another embodiment of the present application. DETAILED DESCRIPTION
[0020] To facilitate understanding, some illustrations of concepts related to the embodiments of the present application are given for reference.
[0021] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0022] A shooting device (e.g., a camera) can be used to record life or shoot specific subjects, such as pets. Most current shooting devices store videos while shooting, and then edit the stored videos. This method not only takes up a lot of storage space and wastes storage resources, but is also limited by the storage capacity of the shooting device. The shooting device may update the system due to a freeze caused by exceeding the storage capacity, resulting in some videos being deleted. If the stored videos have not been edited, some videos will be missing. At this time, if the user wants to view and edit the videos, the available video materials are limited due to the missing video materials. In addition, users will also incur a lot of labor costs when screening / editing videos.
[0023] In order to better understand the image file pushing method and shooting device provided in the embodiments of the present application, the application scenario of the image file pushing method of the present application is first described below.
[0024] Figure 1 is a schematic diagram of an application scenario of the image file push method provided in an embodiment of the present application. The image file push method provided in an embodiment of the present application is applied to a camera 10, which is in communication with an electronic device 20. The camera 10 can receive instructions from the electronic device 20 and, upon receiving the instructions, can push the data indicated by the instructions, such as a target video and a target album, to the electronic device 20.
[0025] The communication connection method between the shooting device 10 and the electronic device 20 can be a wired communication method or a wireless communication method, wherein the wired network can be any one of a local area network, a metropolitan area network and a wide area network, and the wireless network can be any one of Bluetooth Technology, Wireless Local Area Network (Wireless Fidelity, Wi-Fi), Near Field Communication (Near Field Communication, NFC), ZigBee Wireless Networks (ZigBee) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, wireless Universal Serial Bus (USB) and the like.
[0026] The photographing device 10 may include, but is not limited to, a memory 12 and at least one processor 13 connected via a communication bus 11 .
[0027] The photographing device 10 may be a camera used for monitoring, such as an indoor camera, an outdoor camera, etc.
[0028] The electronic device 20 may include, but is not limited to, a display screen 210 for displaying a user interaction interface, or for displaying data sent by the photographing device 10, such as a target video and a target album.
[0029] The electronic device 20 may be a mobile phone, a laptop computer, a tablet computer, a desktop computer, a wearable watch, etc.
[0030] The schematic diagram 1 is merely an example of the photographing device 10 and does not constitute a limitation on the photographing device 10. The photographing device 10 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the photographing device 10 may also include input and output devices, network access devices, etc.
[0031] To solve the above problem, please refer to FIG2 , which is a flowchart of a method for pushing an image file provided by an embodiment of the present application, which is applied to a camera (e.g., camera 10 in FIG1 ). The order of the steps in the flowchart may be changed, and some steps may be omitted, depending on different needs.
[0032] Step S201: Capture initial video.
[0033] In some embodiments of the present application, the camera can be connected to an electronic device, which can be a mobile phone, a computer, an intelligent assistant (Alexa, Xiao Ai, etc.), an intelligent central control device (intelligent central control screen, etc.), etc. The camera captures the captured video in real time, but if the preset conditions are not met, the captured video is not stored, which can to a certain extent prevent invalid videos from occupying the storage space of the camera. Among them, the preset condition can be that the video contains the target object (pet), and the actual application is not limited to this. The user can set the preset condition according to their own needs.
[0034] In some embodiments of the present application, the user can choose whether to turn on the push function of videos or photo albums on the electronic device, and can also set target parameters on the electronic device after determining to turn on the push function. The target parameters may include push cycle, push time, etc. The video captured by the shooting device based on the target parameters is used as the initial video, and the initial video is used as the material basis for subsequent judgments.
[0035] In one example, the push cycle set by the user is one week. Assuming that the user sets the push cycle on September 1, the videos collected between September 1 and September 7 are used as the initial videos.
[0036] In another example, taking the push cycle set by the user as 24 hours as an example, assuming that the user sets the push cycle at 11:00 am on September 1, the video collected between 11:00 am on September 1 and 11:00 am on September 2 will be used as the initial video.
[0037] The above are just examples. The push cycle can also be set by hours or days, and this application does not limit this. The push time can be a fixed time, and users can set and adjust it according to actual needs. This application does not limit this.
[0038] Step S202: If it is determined that the target object exists in the initial video, initial frame difference data of the initial video is obtained using a frame difference method.
[0039] In some embodiments of the present application, during the real-time acquisition of the initial video, a frame difference method is simultaneously used to detect each acquired video frame to determine whether there is a moving object in the real-time acquired initial video. The principle of the frame difference method is to detect whether there is a moving object in the video based on the change in pixel values between consecutive frames in the video. Specifically, the frame difference method is used to decompose the initial video into a series of consecutive video frames. For each video frame, the pixel value difference between the current video frame and the previous video frame is calculated. If the difference value exceeds the difference threshold, it means that the pixel has changed from the previous video frame to the current video frame. This change may be the result of the movement of the moving object. In order to avoid errors, it can be determined based on multiple consecutive video frames.
[0040] In some embodiments of the present application, if a moving object is determined to exist in the initial video using a frame difference method, at least one initial video frame determined to be a moving object is obtained, and the at least one initial video frame is input into a preset recognition model. The recognition model can be a model pre-trained based on the object to be recognized. For example, if the camera is a home camera, the recognition model can be a model for recognizing pets or people, and this application is not limited to this.
[0041] In some embodiments of the present application, training a recognition model requires presetting the objects to be recognized. After determining the objects to be recognized by the recognition model, the recognition model can be trained through a neural network, such as one or more of Convolutional Neural Networks (CNN), Deep Neural Networks (Deep Neural Networks), and Recurrent Neural Networks (RNN). In one example, the training is to use pets as an example. Images containing a large number of pets are input into the neural network for training until the loss value obtained from the training is within a preset range, and the training is determined to be complete. Actual model training is not limited to this.
[0042] In some embodiments of the present application, if a moving object is determined to be a target object based on the results output by the recognition model, it indicates that the initial video contains the target object, and recognition of other initial video frames can be stopped, which can improve the processing efficiency of the initial video. Since the above-mentioned determination of whether the initial video contains a target object based on the frame difference method only involves part of the initial video, after determining that the moving object is the target object, the frame difference method is used to obtain the motion data of all moving objects in the initial video as initial frame difference data. The motion data can be the continuous video frames corresponding to the determination of the presence of the moving object, and the initial frame difference data can include multiple continuous video frames.
[0043] In one example, taking the moving object as a puppy, through the recognition model, it is determined that the initial video frame of the 1st minute contains the target object (puppy), then the recognition of other initial video frames after the 1st minute is stopped. Since the puppy has been moving from the 1st minute to the 10th minute, the video frames corresponding to the 1st minute to the 10th minute are determined as a continuous video frame. The puppy has been moving from the 15th minute to the 20th minute, then the 15th minute to the 20th minute are determined as a continuous video frame. Among them, the puppy did not move from the 10th minute to the 15th minute, and the video frames shot from the 10th minute to the 15th minute are not used as the initial frame difference data. In other embodiments of the present application, if it is determined based on the results output by the recognition model that the moving object is not the target object, in order to improve the safety of the user, the user can also set it to trigger security measures when the non-target object is identified. For example, the non-target object is regarded as a non-target object. When the non-target object is identified, the movement data of the non-target object is obtained according to the frame difference method, and the video and photo album corresponding to the non-target object are generated according to the movement data (the movement data is used as the initial detection difference data, and the corresponding video and photo album can be generated according to the following steps S203 to S206). This video and photo album are pushed to the user to prompt the user that a non-target object has been photographed, which can play a security role.
[0044] Step S203: dividing the initial video into multiple first videos based on the initial frame difference data.
[0045] In some embodiments of the present application, since the initial frame difference data includes the movement data of the moving object, the video frame in which the moving object stops moving can be determined based on the initial frame difference data, and the video frame in which the moving object stops moving can be used as the video end frame. For example, multiple consecutive video frames are obtained from the initial frame difference data, and the last video frame of each consecutive video frame is used as the video end frame.
[0046] In one example, the motion data includes consecutive video frames 1 to 200, and consecutive video frames 250 to 400. It can be determined that the moving object stops moving at the 201st video frame, and the 200th video frame can be used as the video end frame. Alternatively, the 201st video frame can be used as the video end frame. The above is only an example, and actual applications are not limited to this and can be set according to actual user needs.
[0047] In some embodiments of the present application, since the initial frame difference data is obtained based on the playback order of the initial video, the movement data of all moving objects can be traversed based on the order in which the initial frame difference data is obtained, that is, the video frames in which the moving objects are determined to exist are traversed, and the video frame in which the frame difference data is initially obtained is used as the video start frame, until the video end frame is traversed, and the first first video in the initial video is divided according to the video start frame and the video end frame. In addition, after the video end frame of the first first video is determined in sequence, the next traversed video frame is used as the video start frame of the next first video, until the video end frame is traversed, and the second first video is obtained, and so on, until all the initial frame difference data are traversed and the initial video is divided into multiple first videos.
[0048] In one example, the motion data includes consecutive video frames 1 to 200, and consecutive video frames 250 to 400. The 200th and 400th video frames are determined to be the video end frame, respectively. When the 200th video frame is traversed, the consecutive video frames 1 to 200 are divided into the first first video. When the 400th video frame is traversed, the consecutive video frames 250 to 400 are divided into the second first video. The above is merely an example, and actual applications are not limited thereto.
[0049] Step S204 : Filtering a plurality of second videos including the target object from the plurality of first videos based on the video confidences of the plurality of first videos.
[0050] In some embodiments of the present application, since the identification of the presence of the target object in the initial video in step S202 is determined only through a portion of the video frames of the initial video, after the initial video is divided into multiple first videos in step S203, it is possible that not all of the first videos contain the target object, that is, multiple first videos are videos containing moving objects, and at least one first video among the multiple first videos contains the target object. In order to select the video corresponding to the moving object as the target object from the multiple first videos, the video confidence of the multiple first videos can be calculated to determine the multiple second videos including the target object. The video confidence indicates the possibility that the moving object in the corresponding first video may be the target object. The greater the possibility, the higher the video confidence.
[0051] In some embodiments of the present application, the video confidence of multiple first videos can be calculated by first calculating the confidence of each first video frame of each first video. Specifically, multiple first video frames of each first video are obtained, and the multiple first video frames are input into a preset recognition model (see the recognition model of step S202). Since the recognition result output by the recognition model is a probability value, the greater the probability, the higher the possibility that the corresponding first video frame includes the target object. The confidence of each first video frame can be obtained according to the probability value, and the first video frame with the maximum confidence among the multiple first video frames corresponding to each first video is used as the representative frame of each corresponding first video, and the confidence corresponding to the representative frame is used as the video confidence of the corresponding first video. The multiple first videos corresponding to the video confidence greater than the preset threshold are selected as the multiple second videos, and the multiple first videos corresponding to the video confidence less than or equal to the preset threshold are discarded. The preset threshold can be set according to actual needs. For example, the preset threshold can be 0.6.
[0052] In one example, assuming that the multiple first videos include a first first video and a second first video, the confidence levels of the multiple first video frames corresponding to the first first video are calculated to include 0.3, 0.5, 0.3, 0.6, and 0.8. The maximum confidence level of the multiple first video frames corresponding to the first first video is 0.8. The video frame corresponding to 0.8 is used as the representative frame of the first first video, and 0.8 is used as the video confidence level of the first first video. Assuming that the preset threshold is 0.6, 0.8 is greater than 0.6, and the first first video is used as one of the multiple second videos. Similarly, the confidence levels of the multiple first video frames corresponding to the second first video are calculated to include 0.3, 0.5, 0.3, 0.5, and 0.1. The maximum confidence level of the multiple first video frames corresponding to the second first video is 0.5. The video frame corresponding to 0.5 is used as the representative frame of the second first video, and 0.5 is used as the video confidence level of the second first video. Assuming the preset threshold is 0.6, 0.5 is less than 0.6, and the second first video is not used as one of the multiple second videos, that is, the second first video is discarded. The above is just an example, and actual applications are not limited to this.
[0053] Step S205 , stitching the multiple second videos into a target video based on the moving distance and proportion of the target object in each second video.
[0054] In some embodiments of the present application, after determining multiple second videos, the multiple second videos can be spliced into a target video, and the splicing method may include: obtaining the video frame corresponding to each second video, using the video frame corresponding to each second video as the second video frame, and obtaining the first score value of each second video according to the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame, sorting the first score value of each second video from large to small to obtain the sorting result, and splicing the multiple second videos into the target video based on the sorting result. Wherein, if there is the same first score value, two second videos with the same first score value can be randomly sorted in parallel, and this application does not limit this. Wherein, the moving distance can be the distance moved in any direction, such as the coordinate axis direction of the X-axis, Y-axis and Z-axis.
[0055] In some embodiments of the present application, a first scoring value for each second video is obtained based on the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame, specifically: obtaining target frame difference data corresponding to the second video from the initial frame difference data, determining the moving distance and the area proportion occupied by the target object in the corresponding second video frame based on the target frame difference data, determining the proportion corresponding to each second video frame, normalizing the moving distance and the proportion to obtain normalized data, and calculating the average value of the normalized data as the first scoring value. Wherein, the proportion is the area proportion occupied by the target object in the video frame corresponding to each second video.
[0056] In other embodiments of the present application, a first scoring value of each second video is obtained based on the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame, specifically: obtaining the target frame difference data corresponding to the second video from the initial frame difference data, determining the moving distance and the area ratio occupied by the target object in the corresponding second video frame based on the target frame difference data, determining the proportion corresponding to each second video frame, normalizing the moving distance and the proportion to obtain normalized data, and determining the peak value from the normalized data as the first scoring value.
[0057] In one example, the first score of any second video is calculated. The movement distance is geometrically scaled to a value between 0 and 1. For example, the movement distance includes: [5, 2, 8, 1, 9]. The proportion is represented by a value between 0 and 1, where 0 indicates that there is no target object in the second video frame, and 1 indicates that the target object in the second video frame occupies the entire screen. For example, the proportion includes: [3, 7, 1, 6, 2]. Calculate the normalized data and get the moving distance [0.5, 0.125, 0.875, 0, 1] and the proportion [0.33, 1, 0, 0.83, 0.16]. Add the moving distance [0.5, 0.125, 0.875, 0, 1] and the proportion [0.33, 1, 0, 0.83, 0.16] respectively to get [0.83, 1.125, 0.875, 0, 0.26]. Sorting [0.83, 1.125, 0.875, 0, 0.26] gives [1.125, 0.875, 0.83, 0.26, 0]. Calculate the average value 0.618, and use 0.618 as the first score value. Alternatively, according to [1.125, 0.875, 0.83, 0.26, 0], the peak value 1.125 is selected as the first score value.
[0058] In some embodiments of the present application, after obtaining the first rating value of each second video, the first rating value of each second video is sorted from largest to smallest to obtain a sorting result, and based on the sorting result, the multiple second videos are spliced into a target video. Alternatively, the first rating value of each second video is sorted from smallest to largest to obtain a sorting result, and the multiple second videos are spliced into the target video. This application does not limit the sorting method after obtaining the first rating value, and the user can set it according to actual needs.
[0059] Step S206: Push the target video to a preset electronic device.
[0060] In some embodiments of the present application, after the target video is generated, the target video can be pushed to an electronic device based on the push time or push cycle set by the user (see step S201), so that the user can view the target video through the electronic device, thereby improving the user experience.
[0061] In an embodiment of the present application, an initial video is determined from a video captured in real time by a shooting device according to a preset push cycle or push time. If it is determined that the target object exists in the initial video, indicating that the initial video is a video to be processed, the initial video is stored and processed. Otherwise, if the target object does not exist in the initial video, the initial video is not processed and stored, which can reduce the amount of data processing to a certain extent and avoid occupying the storage space of the shooting device. After determining that the target object exists in the initial video, the frame difference method is used to obtain the initial frame difference data of the initial video, the initial video is divided into multiple first videos, and multiple second videos including the target object are screened from the multiple first videos. That is, from multiple first videos that may include the target object, multiple second videos including the target object are determined based on the video confidence, and multiple second videos that meet the requirements are screened out to provide materials for subsequent splicing into the target video. The moving distance and proportion are determined based on the multiple second videos obtained, and the order of splicing the second videos is determined to generate a target video. The target video is pushed to the electronic device. The target video can be pushed to the user based on the push cycle. The user does not need to use other editing software to edit the initial video, which can improve the efficiency of video editing and reduce the cost of obtaining the target video. There is no need for manual identification of whether the target object is contained in the initial video, which reduces labor costs and improves user experience.
[0062] FIG3 is a flow chart of a method for pushing an image file provided by another embodiment of the present application. As shown in FIG3 , the method includes the following steps:
[0063] Step S301: Capture initial video.
[0064] Step S302: If it is determined that the target object exists in the initial video, initial frame difference data of the initial video is obtained using a frame difference method.
[0065] Step S303: Divide the initial video into multiple first videos based on the initial frame difference data.
[0066] Step S304: Filter a plurality of second videos including the target object from the plurality of first videos based on the video confidence levels of the plurality of first videos.
[0067] In some embodiments of the present application, the specific description of steps S301 to S304 can refer to the embodiment shown in Figure 2 and will not be repeated here.
[0068] Step S305 , determining a target video frame from each second video according to the proportion, generating a target album according to the plurality of target video frames, and pushing the target album to a preset electronic device.
[0069] In some embodiments of the present application, the proportion is the area ratio of the target object in the video frame corresponding to each second video. The larger the area ratio, the larger the proportion. The proportion of the second video frame corresponding to each second video is obtained, and the second video frame with the largest proportion in each second video is used as the target video frame. The second score value is obtained based on the proportion.
[0070] In one example, if the proportions of the second video frames in the second video include: 0.6, 0.7, 0.8, 0.2, 0.6, and 0.7, the second video frame corresponding to 0.8 is used as the target video frame of the second video, and 0.8 is used as the second scoring value.
[0071] In some embodiments of the present application, after the target video frames are determined, the target video frames can be extracted as photos in the target album, and the playback order of the target video frames can be determined according to the second scoring values.
[0072] In one example, assuming that the second scoring values of multiple target video frames include: 0.7, 0.8, 0.6, 0.8, 0.9, the playback order is 0.9, 0.8, 0.8, 0.7, 0.6. If there are identical second scoring values, they are played in a random order and this application does not limit this.
[0073] In some embodiments of the present application, after determining the target album, the target album can be pushed to an electronic device so that the user can directly view the target album through the electronic device, thereby improving the user experience. In an embodiment of the present application, an initial video is captured. If it is determined that the target object exists in the initial video, indicating that the initial video is a video to be processed, the initial video is stored and processed. Otherwise, the initial video is not processed and stored, which can reduce the amount of data processing to a certain extent and avoid occupying the storage space of the shooting device. After determining that the target object exists in the initial video, the frame difference method is used to obtain the initial frame difference data of the initial video, the initial video is divided into multiple first videos, and multiple second videos of the target object are determined from the multiple first videos. That is, from multiple first videos that may include the target object, multiple second videos including the target object are determined based on the video confidence, and multiple second videos that meet the requirements are screened out to provide materials for subsequent splicing into the target video. The proportion is determined based on the multiple second videos obtained, the target video frame is determined, the target album is obtained based on the target video frame, and the target album is pushed to the user. The user does not need to use other editing software or shoot videos to edit or shoot the initial video, which can improve the efficiency of video editing and does not require manual identification of whether the initial video contains the target object, thereby reducing labor costs and improving user experience.
[0074] In other embodiments of the present application, a target video and / or a target album can be generated based on the movement distance and proportion of the target object in each second video. The target video and the target album can be sent to the electronic device at the same time, or only the target video or the target album can be sent to the electronic device. The user can set it according to actual needs, and this application does not limit this. Please continue to refer to Figure 1. In this embodiment, the memory 12 can be the internal memory of the shooting device 10, that is, the memory built into the shooting device 10. In other embodiments, the memory 12 can also be the external memory of the shooting device 10, that is, the memory external to the shooting device 10.
[0075] In some embodiments, the memory 12 is used to store program codes and various data, and to achieve high-speed and automatic access to programs or data during the operation of the shooting device 10.
[0076] The memory 12 may include a random access memory and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0077] In one embodiment, the processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any other conventional processor, etc.
[0078] If the program code and various data in the memory 12 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, such as the image file push method, which can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), etc.
[0079] It is understood that the module division described above is a logical functional division, and other division methods may be used in actual implementation. In addition, the functional modules in the various embodiments of the present application can be integrated into the same processing unit, or each module can exist physically separately, or two or more modules can be integrated into the same unit. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. A method for pushing an image file, characterized in that The method includes: Collecting an initial video; If it is determined that there is a target object in the initial video, using the frame difference method to obtain the initial frame difference data of the initial video; Based on the initial frame difference data, dividing the initial video into multiple first videos; Based on the video confidence levels of the multiple first videos, screening out multiple second videos that include the target object from the multiple first videos; According to the moving distance and proportion of the target object in each second video, splicing the multiple second videos into a target video, where the proportion is the area proportion of the target object in the video frames corresponding to each second video; Pushing the target video to a preset electronic device.
2. The method for pushing an image file according to claim 1, wherein The method further includes: Determining target video frames from each second video according to the proportion; Generating a target photo album based on the multiple target video frames; Pushing the target photo album to the preset electronic device.
3. The method for pushing an image file according to claim 1, wherein The step of if it is determined that there is a target object in the initial video and using the frame difference method to obtain the initial frame difference data of the initial video includes: When it is detected according to the frame difference method that there is a moving object in the initial video, inputting at least one initial video frame including the moving object into a preset recognition model; If it is determined according to the result output by the recognition model that the moving object is the target object, obtaining the moving data of all moving objects in the initial video based on the frame difference method as the initial frame difference data.
4. The method for pushing an image file according to claim 3, wherein The step of based on the initial frame difference data, dividing the initial video into multiple first videos includes: Determining the video end frames at which the moving object stops moving based on the initial frame difference data; Based on the video end frames, dividing the initial video into multiple first videos.
5. The method for pushing an image file according to claim 1, wherein The step of based on the video confidence levels of the multiple first videos, screening out multiple second videos that include the target object from the multiple first videos includes: Obtaining multiple first video frames of each first video; Inputting the multiple first video frames into a preset recognition model to obtain the confidence level of each first video frame; Taking the first video frame with the maximum confidence level among the multiple first video frames corresponding to each first video as the representative frame of each first video; Taking the confidence level corresponding to the representative frame as the video confidence level of the corresponding first video; Selecting multiple first videos corresponding to video confidence levels greater than a preset threshold as the multiple second videos.
6. The method for pushing an image file according to claim 1, wherein The step of according to the moving distance and proportion of the target object in each second video, splicing the multiple second videos into a target video includes: Obtaining the video frames corresponding to each second video, and taking the video frames corresponding to each second video as the second video frames; According to the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame, obtaining the first score value of each second video; Sorting the first score values of each second video in a descending order to obtain a sorting result; Based on the sorting result, splicing the multiple second videos into the target video.
7. The method for pushing an image file according to claim 6, wherein Obtaining a first score value for each second video according to the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame includes: Obtaining the target frame difference data corresponding to the second video from the initial frame difference data; Based on the target frame difference data, determining the moving distance and the area proportion of the target object in the corresponding second video frame, and determining the corresponding proportion for each second video frame; Normalizing the moving distance and the proportion to obtain normalized data; Calculating the average value of the normalized data as the first score value.
8. The method for pushing an image file according to claim 6, wherein, Obtaining a first score value for each second video according to the moving distance of the target object in each second video and the proportion of the target object in the corresponding second video frame includes: Obtaining the target frame difference data corresponding to the second video from the initial frame difference data; Based on the target frame difference data, determining the moving distance and the area proportion of the target object in the corresponding second video frame, and determining the corresponding proportion for each second video frame; Normalizing the moving distance and the proportion to obtain normalized data; Determining the peak value from the normalized data as the first score value.
9. The method for pushing an image file according to claim 6, wherein Determining target video frames from each second video according to the proportion, and generating a target photo album from the multiple target video frames includes: According to the proportion of the target object in the corresponding second video frame in each second video, determining the second video frame with the largest proportion in the second video frames of each second video as the corresponding target video frame, and the second score value of each target video frame; Generating the target photo album according to each target video frame; According to the second score value, determining the playing order of each target video frame in the target photo album.
10. A photographing device, characterized in that, The photographing device includes a processor and a memory, and the processor is configured to execute a computer program stored in the memory to implement the method for pushing an image file according to any one of claims 1 to 9.