Frame rate adjustment method and device, electronic device and storage medium
By detecting the number and motion speed of the detection targets in the image frame of the target scene, dynamically adjusting the video analysis frame rate, the problem of inflexible frame rate setting in the prior art is solved, and more efficient computing resource utilization is achieved.
Patent Information
- Application Number
- CN202110996537.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-27
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-08-27
AI Technical Summary
The prior art sets a fixed video analysis frame rate in video analysis, which cannot adapt to changes in different application scenarios, resulting in waste of computing resources or loss of analysis frames.
通过获取目标场景的图像帧,检测目标数量,预测目标数量变化值,动态调整目标跳帧数,从而调整帧率。
It realizes real-time adjustment of frame rates according to the specific situation of the target scenario, reduces waste of computing resources, and improves the efficiency of video analysis.
Smart Images

Figure CN113792622B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a frame rate adjustment method and device, an electronic device, and a storage medium. Background Art
[0002] In the field of video analysis, the frame rate of video analysis is usually set to save computing resources and improve video analysis performance. Setting an appropriate frame rate can minimize computing resource consumption while meeting the accuracy requirements of video analysis. The frame rate of video analysis is highly coupled to the application scenario. The optimal frame rate of video analysis may be different for different application scenarios.
[0003] In the related art, usually after manually analyzing the relevant information of the scene, a fixed video analysis frame rate is manually set. However, this method is only applicable to application scenarios with little change. Summary of the invention
[0004] The present disclosure proposes a frame rate adjustment technical solution.
[0005] According to one aspect of the present disclosure, a frame rate adjustment method is provided, including: acquiring a first image frame captured for a target scene; detecting the first image frame to determine the number of detected targets in the first image frame; and determining a target frame skip number based on the number of detected targets to adjust the frame rate of the image frame for acquiring the target scene according to the target frame skip number.
[0006] In some possible implementations, the method further includes: obtaining a change value in the number of detected targets in a second image frame relative to the number of detected targets in the first image frame, wherein the second image frame is the next frame image of the first image frame; and determining the target frame skip number based on the number of detected targets includes: determining the target frame skip number based on the number of detected targets in the first image frame and the change value in the number.
[0007] In some possible implementations, obtaining the change value of the number of detection targets in the second image frame relative to the detection targets in the first image frame includes: determining the movement speed of the detection targets in the first image frame; and predicting the change value of the number of detection targets based on the movement speed of the detection targets.
[0008] In some possible implementations, determining the movement speed of the detection target in the first image frame includes: determining the first target in the first image frame and the first speed of the first target according to a preset first motion detection algorithm; determining the second target in the first image frame and the second speed of the second target according to a preset second motion detection algorithm; matching at least one of the first targets with at least one of the second targets to determine at least one detection target that successfully matches and at least one detection target that fails to match; determining the movement speed of the detection target that successfully matches according to the first speed and the second speed of the detection target that successfully matches, and determining the movement speed of the detection target that failed to match according to the first speed or the second speed of the detection target that failed to match.
[0009] In some possible implementations, determining the movement speed of the successfully matched detection target based on the first speed and the second speed of the successfully matched detection target includes: fusing the first speed and the second speed to obtain the movement speed of the successfully matched detection target.
[0010] In some possible implementations, predicting the quantity change value of the detection target based on the movement speed of the detection target includes: summing the running speeds of multiple detection targets in the first image frame to obtain a cumulative speed; and determining the quantity change value according to the cumulative speed.
[0011] In some possible implementations, the summing up of the running speeds of multiple detection targets in the first image frame to obtain the cumulative speed includes: performing weighted summation of the movement speed of at least one detection target that has been successfully matched and the movement speed of at least one detection target that has failed to be matched to obtain the cumulative speed, wherein the weight coefficients corresponding to the detection target that has been successfully matched and the detection target that has failed to be matched are different.
[0012] In some possible implementations, determining a target frame skipping number based on the number of detected targets includes: determining an initial frame skipping number based on the number of detected targets; comparing the initial frame skipping number with a preset frame skipping threshold to obtain a comparison result; and determining the target frame skipping number based on the comparison result.
[0013] In some possible implementations, the preset frame skipping threshold includes a maximum frame skipping number and a minimum frame skipping number, and determining the target frame skipping number based on the comparison result includes: when the initial frame skipping number is less than the maximum frame skipping number and greater than the minimum frame skipping number, determining the initial frame skipping number as the target frame skipping number; when the initial frame skipping number is greater than or equal to the maximum frame skipping number, determining the maximum frame skipping number as the target frame skipping number; when the initial frame skipping number is less than or equal to the minimum frame skipping number, determining the minimum frame skipping number as the target frame skipping number.
[0014] In some possible implementations, the maximum number of frame skips is determined based on the accuracy requirement for image frame analysis, and the minimum number of frame skips is determined based on available computing resources.
[0015] In some possible implementations, the method further includes: acquiring image frames to be analyzed in the video of the target scene according to the target frame skipping number.
[0016] According to one aspect of the present disclosure, a frame rate adjustment device is provided, comprising:
[0017] An acquisition module, used to acquire a first image frame captured for a target scene;
[0018] A detection module, configured to detect the first image frame and determine the number of detection targets in the first image frame;
[0019] A determination module is used to determine a target frame skipping number based on the number of detected targets, so as to adjust the frame rate of image frames for acquiring the target scene according to the target frame skipping number.
[0020] In some possible implementations, the detection module is further used to obtain a change value in the number of detected targets in a second image frame relative to the detected targets in the first image frame, wherein the second image frame is the next frame image of the first image frame; and the determination module is used to determine the target frame jump number based on the number of detected targets in the first image frame and the change value in the number.
[0021] In some possible implementations, the detection module is used to determine a movement speed of the detection target in the first image frame; and predict a quantity change value of the detection target based on the movement speed of the detection target.
[0022] In some possible implementations, the detection module is used to determine the first target in the first image frame and the first speed of the first target according to a preset first motion detection algorithm; determine the second target in the first image frame and the second speed of the second target according to a preset second motion detection algorithm; match at least one of the first targets with at least one of the second targets to determine at least one successfully matched detection target and at least one unmatched detection target; determine the movement speed of the successfully matched detection target according to the first speed and the second speed of the successfully matched detection target, and determine the movement speed of the unmatched detection target according to the first speed or the second speed of the unmatched detection target.
[0023] In some possible implementations, the detection module is used to fuse the first speed and the second speed to obtain the movement speed of the successfully matched detection target.
[0024] In some possible implementations, the detection module is used to sum the running speeds of multiple detection targets in the first image frame to obtain a cumulative speed; and determine the quantity change value according to the cumulative speed.
[0025] In some possible implementations, the determination module is used to perform a weighted sum of the movement speed of at least one detection target that has been successfully matched and the movement speed of at least one detection target that has failed to be matched, to obtain the cumulative speed, wherein the weight coefficients corresponding to the detection targets that have been successfully matched and the detection targets that have failed to be matched are different.
[0026] In some possible implementations, the determination module is used to determine an initial frame skipping number based on the number of detected targets; compare the initial frame skipping number with a preset frame skipping threshold to obtain a comparison result; and determine the target frame skipping number based on the comparison result.
[0027] In some possible implementations, the determination module is used to determine the initial frame skip number as the target frame skip number when the initial frame skip number is less than the maximum frame skip number and greater than the minimum frame skip number; to determine the maximum frame skip number as the target frame skip number when the initial frame skip number is greater than or equal to the maximum frame skip number; and to determine the minimum frame skip number as the target frame skip number when the initial frame skip number is less than or equal to the minimum frame skip number.
[0028] In some possible implementations, the maximum number of frame skips is determined based on the accuracy requirement for image frame analysis, and the minimum number of frame skips is determined based on available computing resources.
[0029] In some possible implementations, the device further includes: an analysis module, configured to obtain image frames to be analyzed in the video of the target scene according to the target frame skipping number.
[0030] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0031] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
[0032] In an embodiment of the present disclosure, a first image frame captured for a target scene can be acquired, and the first image frame can be further detected to determine the number of detected targets in the first image frame. Based on the number of detected targets, a target adjustment number can be determined to adjust the frame rate of image frames for acquiring the target scene according to the target frame skip number. Thus, the target frame skip number of image frames can be determined in real time according to the specific circumstances of the target scene, so that the frame rate of image frame analysis can adapt to the target scene. For example, when there are many pedestrians in the target scene, the frame rate of image frame acquisition can be increased, and when there are fewer pedestrians in the target scene, the frame rate of image frame acquisition can be reduced, thereby reducing the waste of computing resources.
[0033] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0035] Figure 1 A flowchart of a frame rate adjustment method according to an embodiment of the present disclosure is shown.
[0036] Figure 2 A flowchart of an example of a frame rate adjustment method according to an embodiment of the present disclosure is shown.
[0037] Figure 3 A block diagram of a frame rate adjustment device according to an embodiment of the present disclosure is shown.
[0038] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0039] Figure 5A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0040] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0041] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0042] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0043] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0044] In the related art, during the video analysis process, a fixed number of skipped frames or frame rate can be set to analyze the image frames. This method is simple to operate and is suitable for application scenarios that do not change much over time. However, for application scenarios that change greatly over time, when there are fewer targets in the scene, the frame rate may be set too high, which will waste computing resources. When there are more targets in the scene, some image frames including those of faster-moving targets may be lost due to the frame rate being set too low.
[0045] The frame rate adjustment scheme provided by the embodiment of the present disclosure can determine the target frame skipping number based on the number of detected targets in the first image frame, so that the frame rate of the image frame of the target scene can be dynamically adjusted according to the target frame skipping number, so as to meet the frame rate requirements of video analysis in application scenarios that vary greatly over time. The frame rate adjustment scheme provided by the embodiment of the present disclosure can be applied to scenarios such as video analysis, image sampling, and video frame extraction. For example, in the pedestrian analysis scenario at a subway station, the number of pedestrians will vary greatly over time. During rush hour, there are a large number of pedestrians, and a smaller target frame skipping number can be obtained based on the number of pedestrians; during non-peak hours, there are a small number of pedestrians, and a larger target frame skipping number can be obtained based on the number of pedestrians. In this way, the frame rate of the image frame analysis can be adjusted in real time according to the actual situation of the target scene, so as to meet the frame rate requirements of video analysis in application scenarios that vary greatly over time.
[0046] The map generation method provided by the embodiment of the present disclosure can be executed by a terminal device, a server or other types of electronic devices, wherein the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the frame rate adjustment method can be implemented by a processor calling a computer-readable instruction stored in a memory. Alternatively, the method can be executed by a server. For the convenience of description, the execution subject of the frame rate adjustment method is collectively referred to as an electronic device hereinafter.
[0047] Figure 1 A flow chart of a frame rate adjustment method according to an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the frame rate adjustment method includes:
[0048] Step S11, acquiring a first image frame captured for a target scene.
[0049] In the embodiments of the present disclosure, the target scene may be an application scene that changes over time without changing. The first image frame may be a current image frame captured for the target scene. The electronic device may have a shooting function, which may shoot the target scene in real time and obtain the first image frame in the shot video. Alternatively, the electronic device may obtain the first image frame transmitted by other devices via wired or wireless means. For example, the electronic device may obtain a video stream transmitted by a camera and extract the first image frame from the video stream.
[0050] Step S12: Detect the first image frame to determine the number of detection targets in the first image frame.
[0051] In the disclosed embodiment, after acquiring the first image frame, the first image frame may be detected. For example, some target detection algorithms, such as R-CNN, Faster R-CNN, YOLO or SSD, may be used to detect the first image frame to obtain the detected target in the first image frame, and further count the number of detected targets in the first image frame. The detected target may be determined according to the actual application scenario or demand. For example, in the target scenario of analyzing pedestrians entering and exiting a subway station, the detected target may be a pedestrian. For another example, in the target scenario of analyzing vehicles on a traffic road, the detected target may be a vehicle.
[0052] Step S13: determining a target frame skipping number based on the number of the detected targets, so as to adjust the frame rate of the image frames for acquiring the target scene according to the target frame skipping number.
[0053] In the disclosed embodiment, the number of detected targets can reflect the specific situation of the target scene, so that the target frame skipping number can be determined based on the number of detected targets in the first image frame. For example, the target frame skipping number can be obtained based on a preset linear relationship and the number of detected targets. The linear relationship can be a corresponding relationship between the number of detected targets and the target frame skipping number. Using the preset linear relationship, the target frame skipping number corresponding to the number of detected targets can be determined. The number of detected targets can be negatively correlated with the target frame skipping number, that is, the larger the number of detected targets, the smaller the target frame skipping number, and the smaller the number of detected targets, the larger the target frame skipping number.
[0054] In some implementations, after determining the target frame skipping number, the frame rate of image frames for acquiring the target scene can be further adjusted according to the target frame skipping number. For example, the target frame skipping number can be converted into a target frame rate, and the frame rate of the currently acquired image frames can be further adjusted to the target frame rate. This allows the frame rate of the video analysis to be adjusted in real time to meet the target scene's requirements for the frame rate of image frame acquisition.
[0055] In some implementations, after determining the target number of frame skips, the image frames to be analyzed can be obtained in the video of the target scene according to the target number of frame skips. For example, when the target number of frame skips is 2, the image frame with a frame interval of 2 from the first image frame in the video can be obtained, that is, assuming that the first image frame is the first frame image in the video, the fourth frame image in the video can be obtained. In this way, the image frames for subsequent analysis can be extracted from the video according to the target number of frame skips, thereby meeting the requirements of analysis accuracy and computing power.
[0056] In some implementations, when the electronic device and the video analysis device are not the same device, a target frame skipping number or a target frame rate determined based on the target frame skipping number may also be sent to the video analysis device, and the video analysis device may obtain the next image frame of the first image frame based on the target frame skipping number or the target frame rate.
[0057] The disclosed embodiments can determine the target frame skipping number based on the number of detected targets, so as to adjust the frame rate of the image frames of the target scene according to the target frame skipping number, thereby adaptively adjusting the frame rate to meet the frame rate requirements of application scenarios where the number of detected targets varies greatly over time.
[0058] In some implementations, in order to further make the target frame skipping number applicable to the actual situation of the target scene, when determining the target frame skipping number based on the number of detected targets, the initial frame skipping number can be first determined based on the number of detected targets, and then the initial frame skipping number is compared with the preset frame skipping threshold to obtain a comparison result, and then the target frame skipping number is determined according to the comparison result. For example, when the initial frame skipping number is less than the preset frame skipping threshold, the initial frame skipping number is set to the target frame skipping number, and when the initial frame skipping number is greater than or equal to the preset frame skipping threshold, the preset frame skipping threshold is set to the target frame skipping number. Here, the preset frame skipping threshold can be set according to the actual application scenario or demand. In some implementations, the frame skipping threshold can be set according to the accuracy requirement of the image frame analysis. In this way, the size of the target frame skipping number can be limited by the preset frame skipping threshold, and frame skipping is performed according to the target frame skipping number on the premise of meeting the requirements of the actual application scenario, for example, on the premise of meeting the accuracy requirement of the image frame analysis.
[0059] In one example, the preset frame skipping threshold includes a maximum frame skipping number and a minimum frame skipping number. When the initial frame skipping number is less than the maximum frame skipping number and greater than the minimum frame skipping number, the initial frame skipping number can be determined as the target frame skipping number. When the initial frame skipping number is greater than or equal to the maximum frame skipping number, the maximum frame skipping number can be determined as the target frame skipping number. When the initial frame skipping number is less than or equal to the minimum frame skipping number, the minimum frame skipping number can be determined as the target frame skipping number. In this way, the initial frame skipping number can be saturated, and the size of the target frame skipping number can be limited by the maximum frame skipping number and the minimum frame skipping number, so that the target frame skipping number can better meet the needs of actual application scenarios.
[0060] Here, when determining the target number of frame skipping, the target number of frame skipping may be calculated as follows:
[0061]
[0062] Among them, j max is the maximum number of skipped frames, j min is the minimum number of skipped frames, j 0is the initial skip frame number, and j is the target skip frame number.
[0063] In some examples, the maximum number of frame skips can be determined based on the accuracy requirements for image frame analysis, so that the target number of frame skips can meet the accuracy requirements for image frame analysis even when the maximum value is reached. The minimum number of frame skips can be determined based on available computing resources, so that the target number of frame skips can meet the limitations of computing resources currently available to the electronic device even when the minimum value is reached. In this way, the computing resources of the electronic device can be saved as much as possible while meeting the accuracy requirements for video analysis, so that the target number of frame skips can better meet the actual situation of the target scene.
[0064] The frame rate adjustment scheme provided by the embodiments of the present disclosure can also be used in application scenarios in which computing resources are dynamically allocated. For example, when the target number of frame jumps is large, the computing resources allocated to the target scene can be reduced; when the target number of frame jumps is small, the computing resources allocated to the target scene can be increased, thereby achieving dynamic adjustment of the computing resources of the target scene and improving the utilization rate of computing resources.
[0065] In some implementations, when determining the target frame skipping number based on the number of detected targets, the change value of the number of detected targets in the second image frame relative to the number of detected targets in the first image frame may also be obtained, and then the target frame skipping number may be determined based on the number of detected targets in the first image frame and the change value of the number of detected targets. Here, the second image frame may be the next image frame of the first image frame in the video, and the change value of the number of detected targets in the second image frame relative to the number of detected targets in the first image frame may be understood as the number of changes that may occur in the time interval corresponding to the first image frame and the second image frame.
[0066] For example, the number change value of the detection target at the current moment can be predicted based on the historical number change of the detection target that is statistically analyzed. The number of historical changes in the detection target can be the number of real-time changes in the detection target in the target scene that is statistically analyzed within a preset historical statistical period, such as recording the real-time number of detection targets in the target scene within a historical week to form a corresponding relationship between the number of detection targets and time. Further, the historical number change of the detection target can be determined based on the corresponding relationship between the number of detection targets and time. The number change value of the detection target can reflect the number of detection targets in the second image frame to a certain extent, that is, the number of future detection targets, so that the number of detection targets in the second image frame can be determined based on the number of detection targets in the first image frame and the number change value of the detection targets. For example, the number of detection targets in the first image frame and the number change value of the detection targets can be added to obtain the number of detection targets in the second image frame. Further, the target frame skipping number is determined based on the number of detection targets in the second image frame. For example, the target frame skipping number corresponding to the number of detection targets in the second image frame can be determined based on the above-mentioned preset linear relationship.
[0067] When the target frame skipping number is determined according to the number of detected targets and the value of the number of detected targets, it can be calculated by the following formula (2):
[0068] j=γ*(n+Δn) Formula (2);
[0069] Wherein, j may be the target frame skipping number, γ may be the conversion coefficient, n may be the number of detected targets in the first image frame, and Δn may be the change value of the number of detected targets.
[0070] By determining the target frame skipping number according to the number of detected targets in the first image frame and the value of the number change of detected targets, the change in the number of detected targets in the target scene within a short period of time can be taken into account, so that the target frame skipping number determined in this way can be more accurate.
[0071] In some implementations, when obtaining the value of the change in the number of detection targets in the second image frame relative to the detection targets in the first image frame, the movement speed of the detection targets in the first image frame can also be determined first. For example, the detection object of the previous frame image of the first image frame can be obtained, and the detection object of the previous frame image and the detection object of the first image frame are matched to determine the detection objects that match in the previous frame image and the first image frame. The matched detection objects can be considered to be the same detection object. Further, according to the image position of each detection object in the previous frame image and the first image frame, the movement speed of each detection object can be determined, that is, the movement speed of each detection target in the first image frame can be determined by target tracking for each detection object. Further, according to the movement speed of each detection target, the value of the change in the number of detection targets can be predicted. For example, the value of the change in the number of detection targets can be related to the movement speed of the detection target. The greater the speed of the detection target, the greater the value of the change in the number of detection targets. The value of the change in the number of detection targets can be determined according to the average value or median of the movement speed of each detection object. By detecting the movement speed of the target, the change value of the number of detected targets can be accurately predicted, and further, the accurate target frame jump number can be obtained based on the change value of the number of detected targets. Therefore, the movement speed of the detected target can be considered in the frame rate adjustment, making the frame rate change more timely and smooth, which can improve the accuracy of video analysis.
[0072] In some implementations, in order to make the determined motion speed more accurate, the first speed of the detection target in the first image frame can be determined according to a preset first motion detection algorithm, the second speed of the detection target in the first image frame can be determined according to a preset second motion detection algorithm, and the motion speed of the detection target in the first image frame can be further determined based on the first speed and the second speed.
[0073] Here, the preset first motion detection algorithm and the preset second motion detection algorithm may correspond to different target tracking algorithms. For example, the first motion detection algorithm may correspond to the Sort multi-target tracking algorithm, and the second motion detection algorithm may correspond to the optical flow tracking method. Since the target tracking principles of the first motion detection algorithm and the second motion detection algorithm are different, the detection target and the motion speed of the detection target determined by the target tracking may be different. For example, the Sort multi-target tracking algorithm can detect and track the complete detection target in the first image frame. In some cases, there may be incomplete detection targets in the first image frame. For example, for a pedestrian who is entering or exiting the first image frame, there may be only one foot of the pedestrian in the first image frame. It may be difficult to track the incomplete detection target using the first motion detection algorithm, or the first speed of the detection target determined by the first motion detection algorithm may not be accurate enough. Therefore, based on determining the first speed of the detection target in the first image frame according to the preset first motion detection algorithm, the preset second motion detection algorithm can be used to determine the second speed of the detection target in the first image frame, and the motion speed of the detection target in the first image frame can be further determined according to the first speed and the second speed. For example, the average of the first speed and the second speed can be used as the motion speed of the detection target in the first image frame. By using different motion detection algorithms to determine the motion speed of the detection target in the first image frame, the accuracy of the motion speed can be further improved, making the value of the change in the number of detection targets determined by the motion speed more accurate.
[0074] In some implementations, when the motion speed of the detection target in the first image frame is determined based on the first speed and the second speed, the first speed and the second speed can be fused. For example, for any detection target, the first speed and the second speed of the detection target can be fused using a preset fusion coefficient to obtain the fusion speed of the detection target. The fusion coefficients corresponding to the first speed and the second speed can be different. Here, the fusion coefficient can be set according to the actual application scenario or requirements, or the corresponding fusion coefficient can be set according to the accuracy corresponding to the first speed and the second speed. For example, when the accuracy of the first speed is greater than the accuracy of the second speed, the fusion coefficient of the first speed can be set greater than the fusion coefficient of the second speed, so that the more accurate first speed can occupy a larger proportion in the motion speed obtained after fusion. By fusing the first speed and the second speed, a more accurate motion speed of the detection target can be obtained.
[0075] In one example, the moving speed of the detected target can be expressed as formula (3):
[0076] s=α*s track +β*s LK Formula (3);
[0077] Among them, s can represent the moving speed of the detected target, s track It can represent the first speed of the detected target, s LK can represent the second speed of the detected target, α can represent the fusion coefficient corresponding to the first speed, and β can represent the fusion coefficient corresponding to the second speed.
[0078] In some implementations, there may be a situation where the detection targets obtained by detection and tracking based on different motion detection algorithms are inconsistent, such as the situation mentioned above that some target tracking algorithms only detect and track the complete detection targets in the first image frame. In this case, a suitable second motion detection algorithm can be selected to supplement the deficiencies of the first motion detection algorithm. For example, the optical flow tracking method can be selected as the second motion detection algorithm to detect the first image frame. The optical flow tracking method can establish a correspondence between the pixel points corresponding to the same projection point in the first image frame and the previous image frame through the grayscale of the pixel points. The projection point can represent an object in a real scene. The optical flow tracking method can be used to obtain not only the complete detection target in the first image frame, but also the incomplete detection target in the first image frame. Accordingly, the detection target determined by the first motion detection algorithm can be used as the first target, and the detection target determined by the second motion detection algorithm can be used as the second target. The number of first targets and the number of second targets may be different, that is, a detection target may be detected by both the first motion detection algorithm and the second motion detection algorithm, or a detection target can only be detected by the first motion detection algorithm or the second motion detection algorithm. In the case where a detection target can only be detected by the first motion detection algorithm or the second motion detection algorithm, the detection target only corresponds to the first speed or the second speed, so that the detection target only corresponding to the first speed or the second speed can be used as the motion speed of the detection target.
[0079] In the above implementation, the quantity change value of the detection target in the second image frame relative to the detection target in the first image frame can be predicted based on the movement speed of the detection target. In some implementations, when determining the quantity change value of the detection target based on the movement speed of the detection target, the running speeds of multiple detection targets in the first image frame can be summed, that is, the running speeds of each detection target in the first image frame are added to obtain the cumulative speed, and the quantity change value of the detection target is determined according to the cumulative speed. The quantity change value of the detection target can be positively correlated with the cumulative speed, and the greater the cumulative speed, the greater the quantity change value of the detection target. The quantity change value of the detection target can be measured by the cumulative speed of multiple detection targets in the first image frame, so that the quantity change value of the detection target can be quickly and accurately determined by the cumulative speed.
[0080] In some examples, when the detection target in the first image frame is detected by different algorithms, such as when the first image frame is detected by the above-mentioned first motion detection algorithm and the above-mentioned second motion detection algorithm, that is, according to the preset first motion detection algorithm, at least one first target in the first image frame and the first speed of the first target are determined, and, according to the preset second motion detection algorithm, at least one second target in the first image frame and the second speed of the second target are determined. Further, at least one first target can be matched with at least one second target to determine at least one successfully matched detection target and at least one unmatched detection target in the first image frame. For example, some matching algorithms can be used to match at least one first target and at least one second target. The successfully matched detection target can be understood as the first target and the second target representing the same detection target, and the unmatched detection target can correspond to a separate detection target. Then, the motion speed of the successfully matched detection target is determined based on the first speed and the second speed of the successfully matched detection target. For example, for each successfully matched detection target, the first speed and the second speed of the successfully matched detection target can be fused using the above formula (3) to obtain the motion speed of the successfully matched detection target. And the motion speed of the unmatched detection target is determined based on the first speed or the second speed of the unmatched detection target. For example, for each unmatched detection target, the first speed or the second speed corresponding to each unmatched detection target can be used as the motion speed of the unmatched detection target. In this way, the detection targets in the first image frame and the motion speeds of each detection target can be determined more accurately.
[0081] Furthermore, the running speeds of multiple detection targets can be summed to obtain a cumulative speed, that is, the movement speed of at least one successfully matched detection target and the movement speed of at least one unmatched detection target can be weighted and summed to obtain a cumulative speed. For example, different weight coefficients can be set for the successfully matched detection target and the unmatched detection target, respectively, and then the movement speeds of each detection target are weighted and summed to obtain a cumulative speed. In this way, different weights can be assigned to the successfully matched detection targets and the unmatched detection targets according to different detection methods, so that the weighted cumulative speed is more accurate, and then a more accurate value of the change in the number of detection targets can be obtained based on the cumulative speed.
[0082] In one example, the change value of the number of detection targets can be determined according to the following formula (4):
[0083] Δn=λ*∑s matched +μ*∑s not_matched Formula (4);
[0084] Among them, s matched It can be the movement speed of the successfully matched detection target, s not_matched It can be the movement speed of the detection target that failed to match, λ can be the weight coefficient corresponding to the detection target that successfully matched, μ can be the weight coefficient corresponding to the detection target that failed to match, and Δn can represent the change value of the number of predicted detection targets.
[0085] The frame rate adjustment method provided by the embodiment of the present disclosure is described below by using an example. Figure 2 A flowchart showing an example of a frame rate adjustment method according to an embodiment of the present disclosure includes:
[0086] Step S201: Acquire a first image frame captured for a target scene.
[0087] Step S202: Detect the first image frame using a preset first motion detection algorithm to determine a first target in the first image and a first speed of the first target.
[0088] Step S203: Detect the first image frame using a preset second motion detection algorithm to obtain a second target in the first image and a second speed of the second target.
[0089] Step S204, matching the first target and the second target, and determining the detection targets that have been successfully matched and the detection targets that have failed to be matched in the first image frame.
[0090] Step S205, determining the movement speed of the successfully matched detection target according to the first speed and the second speed corresponding to the successfully matched detection target, and determining the movement speed of the unmatched detection target according to the first speed or the second speed corresponding to the unmatched detection target.
[0091] Step S206: predicting the change value of the number of detection targets according to the movement speed of the detection targets.
[0092] Here, the detection targets may include detection targets with successful matching and detection targets with failed matching.
[0093] Step S207, determining the target frame skipping number according to the change value of the number of detected targets and the number of detected targets in the first image frame.
[0094] The disclosed embodiments can be applied to scenes that vary greatly over time, such as during rush hour, when there are a large number of pedestrians and the speed of movement is fast. By dynamically adjusting the target frame skipping number, a lower target frame skipping number can be obtained during peak hours, thereby improving the analysis frame rate of image frames and meeting the requirements of video analysis accuracy. After the peak period, the number of pedestrians decreases, and a higher target frame skipping number can be obtained, thereby reducing the analysis frame rate of image frames. On the premise of meeting the requirements of video analysis accuracy, the number of image frames analyzed is reduced, computing resources are saved, and system power consumption is reduced.
[0095] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0096] In addition, the present disclosure also provides a frame rate adjustment device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any frame rate adjustment method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.
[0097] Figure 3 A block diagram of a frame rate adjustment device according to an embodiment of the present disclosure is shown as follows: Figure 3 As shown, the device comprises:
[0098] An acquisition module 31 is used to acquire a first image frame captured for a target scene;
[0099] A detection module 32, configured to detect the first image frame and determine the number of detection targets in the first image frame;
[0100] The determination module 33 is used to determine a target frame skipping number based on the number of the detected targets, so as to adjust the frame rate of the image frames of the target scene according to the target frame skipping number.
[0101] In some possible implementations, the detection module 32 is further configured to obtain a quantity change value of the detection targets in a second image frame relative to the detection targets in the first image frame, wherein the second image frame is a next image frame of the first image frame;
[0102] The determination module 33 is used to determine the target frame skipping number according to the number of detected targets in the first image frame and the number change value.
[0103] In some possible implementations, the detection module 32 is used to determine a movement speed of the detection target in the first image frame; and predict a quantity change value of the detection target based on the movement speed of the detection target.
[0104] In some possible implementations, the detection module 32 is used to determine the first target in the first image frame and the first speed of the first target according to a preset first motion detection algorithm; determine the second target in the first image frame and the second speed of the second target according to a preset second motion detection algorithm; match at least one of the first targets with at least one of the second targets to determine at least one successfully matched detection target and at least one unmatched detection target; determine the movement speed of the successfully matched detection target according to the first speed and the second speed of the successfully matched detection target, and determine the movement speed of the unmatched detection target according to the first speed or the second speed of the unmatched detection target.
[0105] In some possible implementations, the detection module 32 is used to fuse the first speed and the second speed to obtain the movement speed of the successfully matched detection target.
[0106] In some possible implementations, the detection module 32 is used to sum the running speeds of multiple detection targets in the first image frame to obtain a cumulative speed; and determine the quantity change value according to the cumulative speed.
[0107] In some possible implementations, the determination module 33 is used to perform a weighted sum of the movement speed of at least one detection target that has been successfully matched and the movement speed of at least one detection target that has failed to be matched, to obtain the cumulative speed, wherein the weight coefficients corresponding to the detection targets that have been successfully matched and the detection targets that have failed to be matched are different.
[0108] In some possible implementations, the determination module 33 is used to determine an initial frame skipping number based on the number of detected targets; compare the initial frame skipping number with a preset frame skipping threshold to obtain a comparison result; and determine the target frame skipping number based on the comparison result.
[0109] In some possible implementations, the determination module 33 is used to determine the initial frame skip number as the target frame skip number when the initial frame skip number is less than the maximum frame skip number and greater than the minimum frame skip number; to determine the maximum frame skip number as the target frame skip number when the initial frame skip number is greater than or equal to the maximum frame skip number; and to determine the minimum frame skip number as the target frame skip number when the initial frame skip number is less than or equal to the minimum frame skip number.
[0110] In some possible implementations, the maximum number of frame skips is determined based on the accuracy requirement for image frame analysis, and the minimum number of frame skips is determined based on available computing resources.
[0111] In some possible implementations, the device further includes: an analysis module, configured to obtain image frames to be analyzed in the video of the target scene according to the target frame skipping number.
[0112] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0113] The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0114] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0115] The embodiments of the present disclosure also provide a computer program product, including computer-readable codes. When the computer-readable codes are executed on a device, a processor in the device executes instructions for implementing the frame rate adjustment method provided in any of the above embodiments.
[0116] The embodiment of the present disclosure also provides another computer program product for storing computer-readable instructions, which, when executed, enables a computer to perform the operations of the frame rate adjustment method provided in any of the above embodiments.
[0117] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0118] Figure 4 A block diagram of an electronic device 800 according to an embodiment of the present disclosure is shown. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0119] Reference Figure 4 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0120] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0121] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0122] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0123] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0124] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0125] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0126] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0127] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0128] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0129] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above method.
[0130] Figure 5 1 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server. Figure 5 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0131] The electronic device 1900 may further include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Microsoft's server operating system (Windows ServerTM), Apple's graphical user interface-based operating system (Mac OSXTM), a multi-user multi-process computer operating system (UnixTM), a free and open source Unix-like operating system (LinuxTM), an open source Unix-like operating system (FreeBSDTM), or the like.
[0132] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0133] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0134] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0135] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0136] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0137] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0138] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0139] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0140] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0141] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0142] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A frame rate adjustment method, characterized in that: include: Acquire a first image frame captured for a target scene; Detecting the first image frame to determine the number of detection targets in the first image frame; Determining a target frame skipping number based on the number of detected targets, so as to adjust a frame rate of image frames for acquiring the target scene according to the target frame skipping number; Wherein, the method further comprises: Acquire a value of a change in the number of detection targets in a second image frame relative to the number of detection targets in the first image frame, wherein the second image frame is an image frame next to the first image frame; The determining the target frame skipping number based on the number of the detected targets includes: determining the target frame skipping number according to the number of the detected targets in the first image frame and the number change value; The step of obtaining a change value of the number of detection targets in the second image frame relative to the number of detection targets in the first image frame includes: Determining a moving speed of a detection target in the first image frame; Based on the movement speed of the detection target, the quantity change value of the detection target is predicted.
2. The method according to claim 1, characterized in that The determining the motion speed of the detection target in the first image frame includes: Determine a first target in the first image frame and a first speed of the first target according to a preset first motion detection algorithm; Determine a second target in the first image frame and a second speed of the second target according to a preset second motion detection algorithm; Matching at least one of the first targets with at least one of the second targets, and determining at least one detection target that successfully matches and at least one detection target that fails to match; The movement speed of the successfully matched detection target is determined according to the first speed and the second speed of the successfully matched detection target, and the movement speed of the failed matching detection target is determined according to the first speed or the second speed of the failed matching detection target.
3. The method according to claim 2, characterized in that The determining the movement speed of the successfully matched detection target according to the first speed and the second speed of the successfully matched detection target includes: The first speed and the second speed are merged to obtain the movement speed of the successfully matched detection target.
4. The method according to any one of claims 2 or 3, characterized in that: The predicting the change value of the number of the detection targets based on the movement speed of the detection targets includes: Summing the running speeds of multiple detection targets in the first image frame to obtain a cumulative speed; The quantity change value is determined according to the accumulation speed.
5. The method according to claim 4, characterized in that The step of summing the running speeds of the plurality of detection targets in the first image frame to obtain a cumulative speed includes: The accumulated speed is obtained by performing a weighted summation on the movement speed of at least one of the successfully matched detection targets and the movement speed of at least one of the failedly matched detection targets, wherein the weight coefficients corresponding to the successfully matched detection targets and the failedly matched detection targets are different.
6. The method according to claim 1, characterized in that The determining the target frame skipping number based on the number of detected targets includes: Determining an initial frame skipping number based on the number of detected targets; Comparing the initial frame skipping number with a preset frame skipping threshold to obtain a comparison result; The target number of frame skipping is determined according to the comparison result.
7. The method according to claim 6, characterized in that The preset frame skipping threshold includes a maximum frame skipping number and a minimum frame skipping number, and determining the target frame skipping number according to the comparison result includes: When the initial frame skipping number is less than the maximum frame skipping number and greater than the minimum frame skipping number, determining the initial frame skipping number as the target frame skipping number; When the initial frame skipping number is greater than or equal to the maximum frame skipping number, determining the maximum frame skipping number as the target frame skipping number; When the initial frame skipping number is less than or equal to the minimum frame skipping number, the minimum frame skipping number is determined as the target frame skipping number.
8. The method according to claim 7, characterized in that The maximum number of frame skips is determined based on the accuracy requirement for image frame analysis, and the minimum number of frame skips is determined based on available computing resources.
9. The method according to claim 1, characterized in that: The method further comprises: The image frames to be analyzed are acquired in the video of the target scene according to the target frame skipping number.
10. A frame rate adjustment device, characterized in that: include: An acquisition module, used to acquire a first image frame captured for a target scene; A detection module, configured to detect the first image frame and determine the number of detection targets in the first image frame; A determination module, configured to determine a target frame skipping number based on the number of the detected targets, so as to adjust a frame rate of image frames for acquiring the target scene according to the target frame skipping number; The detection module is further used to obtain a value of a change in the number of detection targets in a second image frame relative to the number of detection targets in the first image frame, wherein the second image frame is a next frame image of the first image frame; the determination module is further used to determine the target frame skipping number according to the number of detection targets in the first image frame and the value of the change in the number; Wherein, the detection module is further used to determine the movement speed of the detection target in the first image frame; and predict the change value of the number of the detection target based on the movement speed of the detection target.
11. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 9.
12. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Remaining object detection method and device and vehicle
CN111415347A
Video stream processing method and device, electronic equipment and storage medium
CN112040090A