Method, device, electronic equipment and storage medium for image processing
By setting a higher frame sampling frequency in curved areas and a lower frame sampling frequency in non-curved areas, the frame sampling frequency is dynamically adjusted, solving the problem of low detection accuracy in existing technologies and achieving fast and accurate target vehicle detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2022-07-27
- Publication Date
- 2026-07-10
AI Technical Summary
Existing target tracking algorithms use a fixed frame sampling frequency, which results in low detection accuracy and reduced algorithm performance in traffic scenarios with both straight and curved roads.
By setting a higher frame sampling frequency in curved areas and a lower frame sampling frequency in non-curved areas, the frame sampling frequency is dynamically adjusted to achieve dense sampling in curved areas and sparse sampling in straight areas based on the motion information of the detected object.
It achieves fast and accurate detection in curved areas, reduces computational load, and improves overall detection accuracy and algorithm performance.
Smart Images

Figure CN115294494B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to an image processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence (AI) technology, in the transportation sector, target tracking algorithms can be deployed on edge computing servers to identify vehicle movement trajectories, thereby detecting a series of violations such as crossing lane lines, driving against traffic, and speeding, and promptly alerting drivers. However, existing target tracking algorithms use a fixed frame sampling frequency, resulting in low detection accuracy for target objects. Summary of the Invention
[0003] This disclosure provides an image processing method, apparatus, electronic device, and storage medium to at least solve the technical problem of low detection accuracy in image detection in related technologies.
[0004] According to one aspect of this disclosure, an image processing method is provided, comprising: acquiring a target video of a target region, wherein the target region includes a preset sub-region; extracting frames from the target video based on a first frame extraction frequency to obtain a first image, wherein the first image is an image frame corresponding to a first moment of the target video; detecting the first image to obtain a first detection result, wherein the first detection result is used to indicate whether a target object exists in the preset sub-region at the first moment; and detecting the first image based on the first detection result to obtain a target detection result, wherein the target detection result is used to indicate motion information of the target object in the target region.
[0005] According to another aspect of this disclosure, an image processing apparatus is provided, comprising: a first acquisition module for acquiring a target video of a target region, wherein the target region includes a preset sub-region; a first frame extraction module for extracting frames from the target video based on a first frame extraction frequency to obtain a first image, wherein the first image is an image frame corresponding to a first moment of the target video; a first detection module for detecting the first image to obtain a first detection result, wherein the first detection result is used to indicate whether a target object exists in the preset sub-region at the first moment; and a second detection module for detecting the first image based on the first detection result to obtain a target detection result, wherein the target detection result is used to indicate motion information of the target object in the target region.
[0006] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the image processing method proposed in this disclosure.
[0007] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the image processing method proposed in this disclosure.
[0008] According to another aspect of this disclosure, a computer program product is provided, including a computer program that is executed by a processor using the image processing method proposed in this disclosure.
[0009] In this disclosure, by dividing the lane area into curved and non-curved areas, and setting a higher frame sampling frequency for the curved area and a lower frame sampling frequency for the non-curved area, the goal of quickly and accurately detecting target vehicles is achieved, thereby improving the detection accuracy of target vehicles and solving the technical problem of low detection accuracy in image detection in related technologies.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0012] Figure 1 This is a flowchart of an optional prior art frame extraction step according to an embodiment of the present disclosure;
[0013] Figure 2 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing an image processing method according to an embodiment of the present disclosure;
[0014] Figure 3 This is a flowchart of an image processing method according to an embodiment of the present disclosure;
[0015] Figure 4 This is a flowchart of an optional new target tracking algorithm according to an embodiment of the present disclosure;
[0016] Figure 5 This is a schematic diagram of an optional complete road scene according to an embodiment of the present disclosure;
[0017] Figure 6This is a schematic diagram of an optional marking of a curved area according to an embodiment of the present disclosure;
[0018] Figure 7 This is a structural block diagram of an image processing apparatus according to an embodiment of the present disclosure. Detailed Implementation
[0019] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0021] In recent years, AI technology has developed rapidly. For example, in the transportation field, target tracking algorithms can be deployed on Elastic Compute Service (ECS) servers to identify vehicle trajectories and detect violations such as lane violations, wrong-way driving, and speeding, providing timely alerts. DeepSort, as an emerging tracking algorithm, is widely used due to its clear principles, high accuracy, and speed. The DeepSort algorithm framework matches targets by measuring the similarity of their feature vectors. Therefore, the displacement and posture of the target between adjacent frames cannot change too much; otherwise, there is a risk of misidentification. Thus, the frame extraction interval parameter setting is crucial. In traffic scenarios, roads are typically divided into straight sections and curved sections. When vehicles travel in curved sections, their posture inevitably changes. If the frame extraction interval is too long and the frame extraction frequency is set too low, the target features in the curved section change drastically, easily leading to misidentification. If the frame extraction interval is too short and the frequency is set too high, the algorithm is called too frequently for targets in straight sections, causing unnecessary waste of computing power and affecting the overall algorithm performance. In existing DeepSort algorithm applications, the frame extraction frequency is usually set to a fixed value, that is, video frames are extracted at fixed intervals, the images are sent to target detection, and then target matching is performed. Figure 1 This is a flowchart of an optional prior art frame extraction step according to an embodiment of this disclosure, such as... Figure 1 As shown, the complete steps are as follows:
[0022] Step S11: The frame extraction module performs frame extraction at fixed intervals according to the set frame extraction frequency.
[0023] Step S12: The image obtained by frame extraction is sent to the object detection network;
[0024] Step S13: Match and track the target detection results.
[0025] Existing solutions use a fixed frame rate. However, choosing a fixed frame rate is challenging for traffic scenarios with both straight and curved roads. If the frame rate is set too low, the target vehicle's posture changes significantly and its features shift drastically in curved areas, easily leading to misidentification. If the frame rate is set too high, the algorithm becomes significantly time-consuming when calling on targets in straight road areas, impacting overall algorithm performance.
[0026] According to embodiments of this disclosure, an image processing method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0027] The method embodiments provided in this disclosure can be performed in a mobile terminal, computer terminal, or similar electronic device. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the disclosure described and / or claimed herein. Figure 2 A hardware block diagram of a computer terminal (or mobile device) for implementing an image processing method is shown.
[0028] like Figure 2 As shown, the computer terminal 200 includes a computing unit 201, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 202 or a computer program loaded from a storage unit 208 into a random access memory (RAM) 203. The RAM 203 may also store various programs and data required for the operation of the computer terminal 200. The computing unit 201, ROM 202, and RAM 203 are interconnected via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0029] Multiple components in computer terminal 200 are connected to I / O interface 205, including: input unit 206, such as keyboard, mouse, etc.; output unit 207, such as various types of monitors, speakers, etc.; storage unit 208, such as disk, optical disk, etc.; and communication unit 209, such as network card, modem, wireless transceiver, etc. Communication unit 209 allows computer terminal 200 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0030] The computing unit 201 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 201 performs the image processing methods described herein. For example, in some embodiments, the image processing methods may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 208. In some embodiments, part or all of the computer program may be loaded and / or installed on the computer terminal 200 via ROM 202 and / or communication unit 209. When the computer program is loaded into RAM 203 and executed by the computing unit 201, one or more steps of the image processing methods described herein may be performed. Alternatively, in other embodiments, the computing unit 201 may be configured to perform the image processing methods by any other suitable means (e.g., by means of firmware).
[0031] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0032] It should be noted here that, in some optional embodiments, the above... Figure 2 The electronic device shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 2 This is only one instance of a specific particular example, and is intended to illustrate the types of components that may exist in the aforementioned electronic devices.
[0033] Under the aforementioned operating environment, this disclosure provides, for example... Figure 3 The image processing method shown can be... Figure 2The computer terminal or similar electronic device shown is used for execution. Figure 3 This is a flowchart of an image processing method according to an embodiment of the present disclosure. Figure 3 As shown, the method may include the following steps:
[0034] Step S30: Obtain the target video of the target area, wherein the target area includes a preset sub-region.
[0035] The target area mentioned above can be any type of lane area, and the preset sub-area can be any type of curve area, wherein the preset sub-area is included in the target area; optionally, the target area can be predetermined by the user.
[0036] It should be noted that the preset sub-region can also be any one or more regions that can represent rapid changes in the posture of the target object. For example, it can be a lane change region or a hill climb region. In this embodiment, a curve region will be used as an example for explanation.
[0037] In one optional embodiment, an initial video of the target area can first be obtained; optionally, the target video can be a video obtained by cropping the initial video based on a preset time, or it can be a video obtained by extracting the part of the initial video containing the target object. The preset time can be set by the user in advance, and the specific time value is not limited. The user can set it according to their own needs.
[0038] The target objects mentioned above can be target vehicles driving in the target area, or pedestrians, obstacles, etc. in the target area, but are not limited to these.
[0039] In another optional embodiment, the target area can be determined first, and the target video can be obtained based on the target area. It should be noted that the target area includes a preset sub-area. The preset sub-area can be a curve area, but it is not limited to this. It can also be a climbing area, etc. In this embodiment, the curve area is used as an example for explanation.
[0040] In another alternative embodiment, the target area can first be determined, and then the target video can be acquired by cameras and edge computing servers pre-deployed in the target area and processed. It should be noted that the processing of the target video can include, but is not limited to, edge servers, and can also be any processor, module, device, system, or server capable of processing the target video. In this embodiment, an edge server is used as an example for explanation.
[0041] An edge server is a type of server that provides edge computing. Edge computing is computing that analyzes and processes data near its source, with the advantage of eliminating data transmission and thus reducing network traffic and response time. In this step, acquiring target video of the target area provides a foundation for subsequently acquiring motion information of the target object.
[0042] Step S31: Frames are extracted from the target video based on the first frame extraction frequency to obtain a first image, wherein the first image is the image frame corresponding to the first moment of the target video.
[0043] The first frame-sampling frequency mentioned above can be the frequency at which frames of the target video are sampled after a relatively long time interval T1, for example, it can be the frequency at which frames of the target video are sampled after 10 seconds, but it is not limited to this. The relatively long time interval T1 can be set by the user according to their needs. In this embodiment, 10 seconds is used as an example for explanation.
[0044] The first image mentioned above can be a frame-segmented image obtained by extracting frames from the target video at a first moment. The first moment can be the moment when the target video is extracted after T1, for example, it can be t1.
[0045] In one optional embodiment, the target video can be frame-sampling based on a first frame-sampling frequency to obtain a first image. The first frame-sampling frequency can be the frequency at which the target video is frame-sampling after T1, and the first image can be the frame-sampling image obtained after the target video is frame-sampling at a first moment. The first moment can be the moment when the target video is frame-sampling after T1.
[0046] In another optional embodiment, the target video can be frame-segmented based on a first frame-segmentation frequency using a frame-segmentation module to obtain a first image. It should be noted that frame-segmentation of the target video can include, but is not limited to, a frame-segmentation module, and can also be any processor, module, device, system, or server capable of performing frame-segmentation on the target video. In this embodiment, a frame-segmentation module is used as an example for explanation.
[0047] In this step, by extracting frames from the target video at longer time intervals T1, the computational load on the edge computing server can be reduced.
[0048] Step S32: Detect the first image to obtain a first detection result, wherein the first detection result is used to indicate whether a target object exists in the preset sub-region at the first moment.
[0049] The aforementioned first detection result can be the detection of a target object existing in a preset sub-region at a first moment, for example, the detection of a target vehicle existing in the curve region at time t1; or it can be the detection of no target object existing in the preset sub-region at the first moment, for example, the detection of no target vehicle existing in the curve region at time t1, but it is not limited to these. The detection can involve recognizing and analyzing the first image to confirm whether a target object exists in the preset sub-region at the first moment.
[0050] In one optional embodiment, the first image can be detected, and a first detection result can be output. This first detection result can indicate the presence of a target object in a preset sub-region at a first moment, or it can indicate the absence of a target object in the target sub-region at the first moment, but it is not limited to these two possibilities. In this step, by detecting the first image, the result of whether a target object exists in the preset sub-region can be obtained, which provides a basis for subsequent frame extraction of the target object in the preset sub-region at lower time intervals.
[0051] In another alternative embodiment, the first image can be identified and analyzed by the target detection algorithm module to obtain the first detection result.
[0052] It should be noted that the detection of the first image may include, but is not limited to, a target detection algorithm module, or any processor, module, device, system, or server capable of detecting the first image. In this embodiment, the target detection algorithm module will be used as an example for explanation.
[0053] Step S33: Detect the first image based on the first detection result to obtain the target detection result, wherein the target detection result is used to represent the motion information of the target object in the target region.
[0054] The target detection result mentioned above can be a detection result that can represent the motion information of the target object in the target area, such as the indicator light information and speed of the target vehicle (i.e. the target object), but it is not limited to this.
[0055] The aforementioned motion information may include the target vehicle's speed in the curved area of the target area at the first moment, indicator light information, etc.; or the target vehicle's speed in the non-curved area of the target area at the first moment, indicator light information, etc.; or the position information of pedestrians, obstacles, etc. in the target area at the first moment, etc., but is not limited to these.
[0056] In an optional embodiment, the first image can be detected based on the first detection result to obtain the target detection result. The target detection result can represent the motion information of the target object in the target area. For example, when the first detection result indicates that a target object exists in a preset sub-region at the first moment, the target vehicle (i.e., the target object) in the first image can be identified and analyzed to obtain the motion information of the target object in the curve area, such as the vehicle speed information and indicator light information of the target vehicle at the first moment, but not limited to this.
[0057] In another optional embodiment, the first image can be detected based on the first detection result to obtain a target detection result. This target detection result can represent the motion information of the target object within the target area. For example, if the first detection result indicates that no target object exists in a preset sub-region at a first moment, the target vehicle (i.e., the target object) in the non-curved area of the first image can be identified and analyzed to obtain the target object's motion information, such as the vehicle's speed and indicator light information at the first moment, but not limited to these. In this step, by analyzing the first image using the first detection result, the motion information of the target object can be obtained. This motion information can then be used to alert other drivers, enabling them to drive safely.
[0058] In another optional embodiment, the first image can be detected based on the first detection result by the target detection algorithm module to obtain the target detection result. The detection of the first image may include, but is not limited to, the target detection algorithm module, or any processor, module, device, system, or server capable of detecting the first image. In this embodiment, the target detection algorithm module is used as an example for explanation.
[0059] According to steps S30 to S34 of this disclosure, firstly, a target video of the target area is acquired; secondly, frames of the target video are extracted based on a first frame extraction frequency to obtain a first image; then, the first image is detected to obtain a first detection result; finally, the first image is detected based on the first detection result to obtain a target detection result, which can quickly and accurately obtain the motion information of the target object.
[0060] The method described in this embodiment will be further described below.
[0061] Optionally, detecting the first image based on the first detection result to obtain a target detection result includes: responding to the first detection result indicating the presence of a target object in a preset sub-region, extracting frames from the target video based on a second frame extraction frequency to obtain a second image, wherein the second image is an image frame corresponding to a second moment in the target video, and the second moment is spaced from the first moment by a first preset time interval; detecting the first image and the second image to obtain a target detection result, wherein the target detection result is used to represent the motion information of the target object in the target region.
[0062] The aforementioned second frame-sampling frequency can be the frequency at which frames of the target video are sampled after a short time interval T2, for example, it can be the frequency at which frames of the target video are sampled after 5 seconds, but it is not limited to this. The short time interval T2 can be set by the user according to their needs. In this embodiment, 5 seconds is used as an example for explanation.
[0063] The second image mentioned above can be a frame-segmented image obtained by extracting frames from the target video at a second time point. The second time point can be the time when the target video is extracted after T2, for example, it can be t2, but it is not limited to this.
[0064] The aforementioned first preset time can be a time that represents a short interval between the second moment and the first moment. The specific value can be set by the user according to their needs. In this embodiment, 5 seconds is used as an example, but it is not limited to this and can also be other times.
[0065] In an optional embodiment, in response to the first detection result that a target vehicle (i.e., a target object) exists in a preset sub-region, the target video can first be framed based on a second frame-sampling frequency to obtain a second image. The second frame-sampling frequency can be the frequency at which the target video is framed at a shorter time interval T2, and the second image can be the image at a second moment when the target video is framed. The second moment can be the moment when the target video is framed after a shorter time interval T2.
[0066] In another optional embodiment, in response to the first detection result indicating the presence of a target vehicle (i.e., a target object) in a preset sub-region, the target video can first be frame-sampling using a frame-sampling module based on a second frame-sampling frequency to obtain a second image. It should be noted that frame-sampling of the target video can include, but is not limited to, a frame-sampling module, and can also be any processor, module, device, system, or server capable of frame-sampling of the target video. In this embodiment, a frame-sampling module will be used as an example for explanation.
[0067] In another optional embodiment, the first and second images can be analyzed and identified to obtain motion information such as vehicle speed and indicator light information of the target vehicle in a preset sub-region of the target area, but this is not limited to this. In this step, after detecting the presence of the target vehicle in the framed image obtained at the first frame-sampling frequency, the target video is further frame-sampling at the second frame-sampling frequency to obtain the second image. By detecting the first and second images, information such as the target vehicle's speed can be obtained quickly and accurately.
[0068] In another optional embodiment, the first and second images can be analyzed and identified by the target algorithm detection module to obtain motion information such as vehicle speed and indicator light information of the target vehicle in a preset sub-region of the target area. It should be noted that the detection of the first and second images can include, but is not limited to, the target algorithm detection module, and can also be any processor, module, device, system, or server capable of detecting the first and second images. In this embodiment, the target algorithm detection module is used as an example for illustration.
[0069] Optionally, the method further includes: in response to the first detection result that there is no target object in the preset sub-region, performing frame extraction on the target video based on the first frame extraction frequency to obtain a third image, wherein the third image is the image frame corresponding to the third moment of the target video, and the third moment is spaced apart from the first moment by a second preset time; and performing detection on the first image and the third image to obtain a target detection result.
[0070] The aforementioned third image can be a frame-segmented image obtained by extracting frames from the target video at a third time point. The third time point can be the moment when the target video is extracted after a relatively long time interval T1, for example, it can be t3.
[0071] The aforementioned second preset time can be a relatively long interval between the third moment and the first moment. The specific value can be set according to the user's needs. In this embodiment, 10 seconds is used as an example, but it is not limited to this and can also be other times.
[0072] In an optional embodiment, in response to the first detection result that there is no target vehicle (i.e. target object) in the preset sub-region, the target video can first be framed based on the first frame-sampling frequency to obtain a third image. The first frame-sampling frequency can be the frequency at which the target video is framed at a relatively long time interval T1, and the third image can be the image at which the target video is framed at a third moment. The third moment can be the moment at which the target video is framed after a relatively long time interval T1.
[0073] In another alternative embodiment, in response to the first detection result that there is no target vehicle (i.e. target object) in the preset sub-region, the target video can first be framed by the frame extraction module based on the first frame extraction frequency to obtain the third image.
[0074] It should be noted that frame extraction of the target video can include, but is not limited to, a frame extraction module, or any processor, module, device, system, or server capable of performing frame extraction on the target video. In this embodiment, a frame extraction module will be used as an example for explanation.
[0075] In another optional embodiment, the first and third images can be analyzed and identified to obtain motion information such as vehicle speed and indicator light information of the target vehicle in non-preset sub-regions of the target area, but this is not limited to this. In this step, when it is detected that the target vehicle is not present in the framed images obtained at the first frame-sampling frequency, the target video is further frame-sampling at the first frame-sampling frequency to obtain the third image. By detecting the first and third images, the motion information of the target vehicle in non-preset sub-regions of the target area can be obtained. This motion information can then be used to alert other drivers to ensure safe driving.
[0076] In another optional embodiment, the first and third images can be detected by a target detection algorithm module to obtain the motion information of the target vehicle in a non-preset sub-region of the target area. It should be noted that image detection can include, but is not limited to, a target detection algorithm module, or any processor, module, device, system, or server capable of image detection. In this embodiment, a target detection algorithm module is used as an example for explanation.
[0077] Optionally, the method further includes: detecting the second image to obtain a second detection result, wherein the second detection result is used to indicate whether a target object exists in a preset sub-region at a second time; responding to the second detection result indicating that no target object exists in the preset sub-region, performing frame extraction on the target video based on a first frame extraction frequency to obtain a fourth image, wherein the fourth image is the image frame corresponding to the fourth time of the target video, and the fourth time is spaced from the second time by a second preset time; and detecting the first image, the second image, and the fourth image to obtain a target detection result.
[0078] The second detection result mentioned above can be the detection of a target object existing in a preset sub-region at a second time, for example, the detection of a target vehicle existing in the curve area at time t2; or it can be the detection of no target object existing in the preset sub-region at a second time, for example, the detection of no target vehicle existing in the curve area at time t2, but it is not limited to these. The detection can involve recognizing and analyzing the second image to confirm whether a target object exists in the preset sub-region at the second time.
[0079] The aforementioned fourth image can be a frame-segmented image obtained by extracting frames from the target video at the fourth time point. The fourth time point can be the moment when the target video is extracted after a relatively long time interval T1, for example, it can be t4.
[0080] In one optional embodiment, after acquiring the second image, the second image can first be detected to confirm whether there is a target vehicle (i.e., a target object) in the preset area at the second time.
[0081] In another optional embodiment, after acquiring the second image, the second image can first be detected by a target detection algorithm module to confirm whether a target vehicle (i.e., a target object) exists in the preset area at the second time. It should be noted that image detection can include, but is not limited to, a target detection algorithm module, or any processor, module, device, system, or server capable of image detection. In this embodiment, a target detection algorithm module is used as an example for explanation.
[0082] In another optional embodiment, when it is detected that there is no target object in the preset sub-region at the second time, the target video can be framed based on the first frame-sampling frequency to obtain a fourth image. The first frequency can be the frequency at which the target video is framed at a longer time interval T1, and the fourth image can be the framed image obtained by framing the target video at the first frequency at the fourth time. The fourth time can be the time when the target video is framed after a longer time interval T1.
[0083] In another optional embodiment, when it is detected that no target object exists in the preset sub-region at the second time, the target video can be frame-segmented based on a first frame-segmentation frequency using a frame-segmentation module to obtain a fourth image. It should be noted that frame-segmentation of the target video can include, but is not limited to, a frame-segmentation module, or any processor, module, device, system, or server capable of performing frame-segmentation on the target video. In this embodiment, a frame-segmentation module is used as an example for explanation.
[0084] In another optional embodiment, the first, second, and fourth images can be analyzed and identified to obtain motion information such as vehicle speed of the target vehicle in the target area outside the preset sub-region at the second time. In this step, when it is detected that no target object exists in the preset sub-region at the second time, the target video can be further frame-sampling based on the first frame-sampling frequency to obtain the fourth image. By detecting the first, second, and fourth images, the vehicle speed and other information of the target vehicle at the second time can be accurately obtained, thereby enabling other vehicles to drive safely.
[0085] In another optional embodiment, the first, second, and fourth images can be analyzed and identified by the target detection algorithm module to obtain motion information such as vehicle speed of the target vehicle in the target area outside the preset sub-region at the second time moment. It should be noted that image detection can include, but is not limited to, the target detection algorithm module, and can also be any processor, module, device, system, or server capable of image detection. In this embodiment, the target detection algorithm module is used as an example for explanation.
[0086] Optionally, the method further includes: in response to the second detection result indicating the presence of a target object in a preset sub-region, performing frame extraction on the target video based on a second frame extraction frequency to obtain a fifth image, wherein the fifth image is the image frame corresponding to the fifth moment of the target video, and the fifth moment is spaced apart from the second moment by a first preset time; and performing detection on the first image, the second image, and the fifth image to obtain a target detection result.
[0087] The fifth image mentioned above can be a frame-segmented image obtained by extracting frames from the target video at the fifth moment. The fifth moment can be the moment when the target video is extracted after a short time interval T2, for example, it can be t5.
[0088] In one optional embodiment, after acquiring the second image, the second image can first be detected to confirm whether there is a target vehicle (i.e., a target object) in the preset area at the second time.
[0089] In another optional embodiment, after acquiring the second image, the second image can first be detected using a target detection algorithm to confirm whether a target vehicle (i.e., a target object) exists in the preset area at the second time. It should be noted that image detection can include, but is not limited to, a target detection algorithm module, or any processor, module, device, system, or server capable of image detection. In this embodiment, a target detection algorithm module is used as an example for explanation.
[0090] In another optional embodiment, when a target object is detected in a preset sub-region at a second time, the target video can be framed based on a second frame-sampling frequency to obtain a fifth image. The second frequency can be the frequency at which the target video is framed at a shorter time interval T2, and the fifth image can be the framed image obtained by framing the target video at the second frequency at a fifth time. The fifth time can be the moment when the target video is framed after a shorter time interval T2.
[0091] In another optional embodiment, when a target object is detected in a preset sub-region at a second time, the target video can be frame-segmented based on a second frame-segmentation frequency using a frame-segmentation module to obtain a fifth image. It should be noted that frame-segmentation of the target video can include, but is not limited to, a frame-segmentation module, and can also be any processor, module, device, system, or server capable of performing frame-segmentation on the target video. In this embodiment, a frame-segmentation module is used as an example for explanation.
[0092] In this step, when a target object is detected in the preset sub-region at the second time, the target video can be further frame-sampling based on the second frame-sampling frequency to obtain the fifth image. By detecting the first image, the second image, and the fifth image, the motion information such as the vehicle speed of the target vehicle at the fifth time can be obtained quickly and accurately.
[0093] Optionally, the method further includes: acquiring identification information of multiple initial regions, wherein the identification information is used to indicate whether the multiple initial regions include a preset sub-region; classifying the multiple initial regions based on the identification information to obtain a target region and a first region, wherein the first region does not include the preset sub-region; extracting frames from the target video corresponding to the target region based on a second frame extraction frequency to obtain a sixth image; extracting frames from the first video corresponding to the first region based on a first frame extraction frequency to obtain a seventh image; detecting the sixth image to obtain a target detection result; and detecting the seventh image to obtain a third detection result, wherein the third detection result is used to represent the motion information of the target object in the first region.
[0094] The initial area mentioned above can be multiple lane areas containing curves; optionally, the identification information can be pre-set; optionally, the sign information can be pre-set by the user; optionally, the identification information can be one or more types of information pre-set by the user that can indicate whether there is a preset sub-area (i.e., a curve area) in the initial area. For example, the text "curve" can be used to indicate that the initial area includes a preset sub-area, or the voice "curve" can be used to indicate that the initial area includes a preset sub-area, but it is not limited to these.
[0095] The target area mentioned above can be the curve area in the initial area; the first area can be the area in the initial area other than the curve area.
[0096] In one alternative embodiment, identification information in multiple lanes can first be obtained, wherein the identification information can be used to indicate whether there is a curve area in the initial area, for example, it can be the text "curve" information, but is not limited to this.
[0097] In another alternative embodiment, the initial region can be classified based on the identification information. For example, the curved area can be classified into one category to obtain the target region, and the other areas in the initial region excluding the curved area can be classified into another category to obtain the first region, wherein the first region does not include the target region.
[0098] In another alternative embodiment, in order to improve the accuracy of image recognition in the curved area, the target video can be frame-sampling based on the second frame-sampling frequency to obtain the sixth image, wherein the target video is the video in the target area; at the same time, in order to reduce the image computation in the non-curved area, the target video can be frame-sampling based on the first frame-sampling frequency to obtain the seventh image, wherein the target video is the video in the first area.
[0099] In another optional embodiment, the sixth and seventh images can be identified and analyzed, which can not only quickly and accurately obtain the motion information of the target vehicle in the curve area, but also the motion information of the target vehicle in the non-curve area.
[0100] In this step, by setting a second frame-dropping frequency in the curve area and a first frame-dropping frequency in the non-curve area, we can not only quickly and accurately obtain the motion information of the target vehicle in the curve area, but also obtain the motion information of the target vehicle in the non-curve area while reducing the amount of data processing.
[0101] Optionally, the method further includes: presetting the sub-region as a curve region.
[0102] The aforementioned preset sub-areas can be pre-set; optionally, the aforementioned preset sub-areas can be pre-set by the user; optionally, the aforementioned preset sub-areas can be one or more areas that can reflect special areas in the lane, which can be pre-set by the user. In this embodiment, a curved area is used as an example for explanation, but it is not limited to this. For example, it can also be an intersection area, a lane changing area, an uphill area, etc.
[0103] In one optional embodiment, the preset sub-region can be a curve region, but it is not limited to this. It can also be a crossroads region, etc. In this embodiment, a curve region is used as an example for explanation.
[0104] In this step, by setting a preset sub-region, the frame extraction frequency can be dynamically adjusted. With the dynamic frame extraction frequency, not only can the motion information of the target vehicle in the curve region be obtained quickly and accurately, but also the data processing volume can be reduced and the overall algorithm performance can be improved.
[0105] In the present disclosure, by dividing the lane region into a curve region and a non-curve region, and setting a higher frame extraction frequency for the curve region and a lower frame extraction frequency for the non-curve region, the purpose of being able to detect the target vehicle quickly and accurately is achieved, and the technical effect of improving the detection accuracy of the target vehicle is realized, thus solving the technical problem of low detection accuracy in detecting images in the related art.
[0106] In the present disclosure, the target area road is pre-divided into a straight road and a curve area. When it is detected that the target vehicle appears in the straight road area, the upstream frame extraction module is notified to set the frame extraction time interval to t1 for sampling and target tracking. When it is detected that the target appears in the curve area, the upstream frame extraction module is notified to set the frame extraction time interval to t2 for sampling and target tracking. Among them, t2 < t1, which can ensure dense sampling in the curve and sparse sampling in the straight road, dynamically adjust the sampling interval, and ensure both the accuracy and performance of the algorithm. Specifically, the algorithm proceeds according to the following steps:
[0107] Step S1, after the edge computing server and the camera are installed and deployed, mark the curve area in the front-end picture, and the unmarked area is the straight road area;
[0108] Step S2, the camera continuously captures images and sends them to the frame extraction module for processing in video form;
[0109] Step S3, the frame extraction module reads the current frame rate setting and continuously extracts frames from the video at an interval time t;
[0110] Step S4, the frame extraction module sends the extracted images to the target detection algorithm module for processing;
[0111] Step S5, the target detection algorithm module detects the vehicle target in the image, outputs the position of the target object, and performs target matching;
[0112] Step S6, determine whether the position of the vehicle target belongs to the straight road or the curve area. If it belongs to the straight road area, notify the upstream frame extraction module to set the frame extraction time interval to a larger t1. If the target belongs to the curve area, notify the upstream frame extraction module to set the frame extraction time interval to a smaller t2;
[0113] Step S7, the frame extraction module extracts frames at the new frame extraction time interval and continuously performs steps S4 - S6.
[0114] Figure 4 This is a flowchart of an optional new target tracking algorithm according to an embodiment of the present disclosure, such as... Figure 4 As shown, the target detection network identifies the target region and confirms whether a curved area exists within it. If a curved area exists, the frame extraction time interval is set to a shorter time interval T2. Frames are extracted from the target video using the frame extraction module, and then the target detection algorithm module detects the target vehicle in the image, outputting the target vehicle's motion information for target matching. If no curved area exists, the frame extraction time interval is set to a longer time interval T1. Frames are extracted from the target video using the frame extraction module, and then the target detection algorithm module detects pedestrians or obstacles in the image, outputting the pedestrian or obstacle's position information for target matching.
[0115] Figure 5 This is a schematic diagram of an optional complete road scene according to an embodiment of the present disclosure, such as... Figure 5 As shown, this road diagram includes curved and non-curved areas.
[0116] Figure 6 This is a schematic diagram of an optional marking of a curved area according to an embodiment of the present disclosure, such as... Figure 6 As shown, the area enclosed in the box is the curve area.
[0117] When a vehicle appears within the box area, the upstream frame extraction module is notified to use the frame extraction time interval t2 for curves, thus quickly and accurately obtaining the target vehicle's motion information within the curve area. When a vehicle appears outside the box area, the upstream frame extraction module is notified to use the frame extraction time interval t1 for straight sections. This disclosure, by dynamically setting the frame extraction frequency, not only can quickly and accurately obtain the target vehicle's motion information within the curve area, but also improves the overall algorithm performance and reduces the amount of data processing.
[0118] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this disclosure.
[0120] This disclosure also provides an image processing apparatus for implementing the above embodiments and preferred embodiments, which will not be repeated hereafter. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0121] Figure 7 This is a structural block diagram of an image processing apparatus according to an embodiment of the present disclosure, such as... Figure 7 As shown, an image processing apparatus 700 includes: a first acquisition module 701, configured to acquire a target video of a target region, wherein the target region includes a preset sub-region; a first frame extraction module 702, configured to extract frames from the target video based on a first frame extraction frequency to obtain a first image, wherein the first image is an image frame corresponding to a first moment of the target video; a first detection module 703, configured to detect the first image to obtain a first detection result, wherein the first detection result is used to indicate whether a target object exists in the preset sub-region at the first moment; and a second detection module 704, configured to detect the first image based on the first detection result to obtain a target detection result, wherein the target detection result is used to indicate the motion information of the target object in the target region.
[0122] Optionally, the second detection module includes: a first frame extraction unit, configured to extract frames from the target video based on a second frame extraction frequency in response to a first detection result indicating the presence of a target object in a preset sub-region, to obtain a second image, wherein the second image is an image frame corresponding to a second moment in the target video, and the second moment is spaced from the first moment by a first preset time; and a first detection unit, configured to detect the first image and the second image to obtain a target detection result, wherein the target detection result is used to represent the motion information of the target object in the target region.
[0123] Optionally, the second detection module further includes: a second frame extraction unit, used to extract frames from the target video based on a first frame extraction frequency in response to the first detection result indicating that no target object exists in a preset sub-region, to obtain a third image, wherein the third image is the image frame corresponding to the third moment of the target video, and the third moment is spaced apart from the first moment by a second preset time; and a second detection unit, used to detect the first image and the third image to obtain a target detection result.
[0124] Optionally, the first detection unit includes: a first detection subunit, used to detect the second image and obtain a second detection result, wherein the second detection result is used to indicate whether a target object exists in a preset sub-region at a second time; a frame extraction subunit, used to extract frames from the target video based on a first frame extraction frequency in response to the second detection result indicating that a target object does not exist in the preset sub-region, to obtain a fourth image, wherein the fourth image is the image frame corresponding to the fourth time of the target video, and the fourth time is separated from the second time by a second preset time; and a second detection subunit, used to detect the first image, the second image, and the fourth image to obtain a target detection result.
[0125] Optionally, the first detection subunit is further configured to, in response to the second detection result indicating the presence of a target object in a preset sub-region, perform frame extraction on the target video based on a second frame extraction frequency to obtain a fifth image, wherein the fifth image is the image frame corresponding to the fifth moment of the target video, and the fifth moment is spaced apart from the second moment by a first preset time; and perform detection on the first image, the second image, and the fifth image to obtain a target detection result.
[0126] Optionally, the device further includes: a second acquisition module for acquiring identification information of multiple initial regions, wherein the identification information is used to indicate whether the multiple initial regions include a preset sub-region; a classification module for classifying the multiple initial regions based on the identification information to obtain a target region and a first region, wherein the first region does not include the preset sub-region; a second frame extraction module for extracting frames from the target video corresponding to the target region based on a second frame extraction frequency to obtain a sixth image; a third frame extraction module for extracting frames from the first video corresponding to the first region based on a first frame extraction frequency to obtain a seventh image; a third detection module for detecting the sixth image to obtain a target detection result; and a fourth detection module for detecting the seventh image to obtain a third detection result, wherein the third detection result is used to indicate the motion information of the target object in the first region.
[0127] Optionally, the first acquisition module in the device is used to acquire target video of the target area, wherein the target area includes a preset sub-area, and the preset sub-area is a curve area.
[0128] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0129] According to embodiments of this disclosure, this disclosure also provides an electronic device including a memory and at least one processor, the memory storing computer instructions, the processor being configured to execute the computer instructions to perform the steps in any of the above method embodiments.
[0130] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0131] Optionally, in this disclosure, the processor described above can be configured to perform the following steps via a computer program:
[0132] S1, acquire the target video of the target area, wherein the target area includes a preset sub-region;
[0133] S2, the target video is frame-sampling based on the first frame-sampling frequency to obtain the first image, wherein the first image is the image frame corresponding to the first moment of the target video;
[0134] S3, Detect the first image to obtain a first detection result, wherein the first detection result is used to indicate whether a target object exists in the preset sub-region at the first moment;
[0135] S4, based on the first detection result, the first image is detected to obtain the target detection result, wherein the target detection result is used to represent the motion information of the target object in the target area.
[0136] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0137] According to embodiments of the present disclosure, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are configured to perform the steps in any of the above method embodiments at runtime.
[0138] Optionally, in this embodiment, the non-volatile storage medium described above can be configured to store a computer program for performing the following steps:
[0139] S1, acquire the target video of the target area, wherein the target area includes a preset sub-region;
[0140] S2, the target video is frame-sampling based on the first frame-sampling frequency to obtain the first image, wherein the first image is the image frame corresponding to the first moment of the target video;
[0141] S3, Detect the first image to obtain a first detection result, wherein the first detection result is used to indicate whether a target object exists in the preset sub-region at the first moment;
[0142] S4, based on the first detection result, the first image is detected to obtain the target detection result, wherein the target detection result is used to represent the motion information of the target object in the target area.
[0143] Optionally, in this embodiment, the aforementioned non-transitory computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0144] According to embodiments of this disclosure, a computer program product is also provided. Program code for implementing the method embodiments of this disclosure can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on a machine, partially on a machine, partially on a remote machine as a standalone software package, or entirely on a remote machine or server.
[0145] In the above embodiments of this disclosure, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0146] In the several embodiments provided in this disclosure, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.
[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0148] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0150] The above description is only a preferred embodiment of this disclosure. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles of this disclosure, and these improvements and modifications should also be considered within the scope of protection of this disclosure.
Claims
1. An image processing method, comprising: Acquire target video of target area, wherein the target area includes preset sub-area, and the preset sub-area is a curve area; The target video is frame-sampling based on a first frame-sampling frequency to obtain a first image, wherein the first image is the image frame corresponding to the first moment of the target video. The first image is detected to obtain a first detection result, wherein the first detection result is used to indicate whether a target object exists in the preset sub-region at the first time. Based on the first detection result, the first image is detected to obtain a target detection result, wherein the target detection result is used to represent the motion information of the target object in the target area, and the motion information includes at least: vehicle speed information and indicator light information; Based on the first detection result, the first image is detected to obtain a target detection result, including: in response to the first detection result indicating that the target object exists in the preset sub-region, the target video is frame-sampling using a frame-sampling module based on a second frame-sampling frequency to obtain a second image, wherein the second image is an image frame corresponding to a second moment in the target video, and the second moment is spaced apart from the first moment by a first preset time; the first image and the second image are detected to obtain the target detection result, wherein the second frame-sampling frequency is a frequency at which the target video is frame-sampling at a shorter time interval relative to the first frame-sampling frequency; The method further includes: acquiring identification information of multiple initial regions, wherein the identification information is used to indicate whether the multiple initial regions include the preset sub-region; classifying the multiple initial regions based on the identification information to obtain the target region and a first region, wherein the first region does not include the preset sub-region; performing frame extraction on the target video corresponding to the target region based on the second frame extraction frequency to obtain a sixth image; performing frame extraction on the first video corresponding to the first region based on the first frame extraction frequency to obtain a seventh image; detecting the sixth image to obtain the target detection result; and detecting the seventh image to obtain a third detection result, wherein the third detection result is used to indicate the motion information of the target object in the first region.
2. The method according to claim 1, wherein, The method further includes: In response to the first detection result that the target object does not exist in the preset sub-region, the target video is frame-sampling based on the first frame-sampling frequency to obtain a third image, wherein the third image is the image frame corresponding to the third moment of the target video, and the third moment is spaced apart from the first moment by a second preset time. The first image and the third image are detected to obtain the target detection result.
3. The method according to claim 1, wherein, The method further includes: The second image is detected to obtain a second detection result, wherein the second detection result is used to indicate whether the target object exists in the preset sub-region at the second time. In response to the second detection result that the target object does not exist in the preset sub-region, the target video is frame-sampling based on the first frame-sampling frequency to obtain a fourth image, wherein the fourth image is the image frame corresponding to the fourth moment of the target video, and the fourth moment is spaced apart from the second moment by a second preset time. The first image, the second image, and the fourth image are detected to obtain the target detection result.
4. The method according to claim 3, wherein, The method further includes: In response to the second detection result that the target object exists in the preset sub-region, the target video is frame-sampling based on the second frame-sampling frequency to obtain a fifth image, wherein the fifth image is the image frame corresponding to the fifth moment of the target video, and the fifth moment is spaced from the second moment by the first preset time. The first image, the second image, and the fifth image are detected to obtain the target detection result.
5. An image processing apparatus, comprising: The first acquisition module is used to acquire the target video of the target area, wherein the target area includes a preset sub-area, and the preset sub-area is a curve area; The first frame extraction module is used to extract frames from the target video based on a first frame extraction frequency to obtain a first image, wherein the first image is the image frame corresponding to the first moment of the target video. A first detection module is used to detect the first image and obtain a first detection result, wherein the first detection result is used to indicate whether a target object exists in the preset sub-region at the first time. The second detection module is used to detect the first image based on the first detection result to obtain a target detection result, wherein the target detection result is used to represent the motion information of the target object in the target area, and the motion information includes at least: vehicle speed information and indicator light information; The second detection module includes: The first frame extraction unit is configured to, in response to the first detection result indicating that the target object exists in the preset sub-region, extract frames from the target video using the frame extraction module based on a second frame extraction frequency to obtain a second image, wherein the second image is an image frame corresponding to a second moment of the target video, and the second moment is spaced from the first moment by a first preset time. The first detection unit is used to detect the first image and the second image to obtain the target detection result. The second frame extraction frequency is the frequency at which the target video is extracted at a shorter time interval relative to the first frame extraction frequency. The device further includes: The second acquisition module is used to acquire identification information of multiple initial regions, wherein the identification information is used to indicate whether the multiple initial regions include the preset sub-region; A classification module is used to classify the plurality of initial regions based on the identification information to obtain the target region and a first region, wherein the first region does not include the preset sub-region; The second frame extraction module is used to extract frames from the target video corresponding to the target region based on the second frame extraction frequency to obtain the sixth image. The third frame extraction module is used to extract frames from the first video corresponding to the first region based on the first frame extraction frequency to obtain the seventh image. The third detection module is used to detect the sixth image and obtain the target detection result; The fourth detection module is used to detect the seventh image and obtain a third detection result, wherein the third detection result is used to represent the motion information of the target object in the first region.
6. The apparatus according to claim 5, characterized in that, The second detection module also includes: The second frame-sampling unit is configured to, in response to the first detection result that the target object does not exist in the preset sub-region, extract frames from the target video based on the first frame-sampling frequency to obtain a third image, wherein the third image is an image frame corresponding to the third moment of the target video, and the third moment is spaced apart from the first moment by a second preset time. The second detection unit is used to detect the first image and the third image to obtain the target detection result.
7. The apparatus according to claim 5, characterized in that, The first detection unit includes: The first detection subunit is used to detect the second image and obtain a second detection result, wherein the second detection result is used to indicate whether the target object exists in the preset sub-region at the second time. A frame extraction subunit is configured to extract frames from the target video based on the first frame extraction frequency in response to the second detection result indicating that the target object does not exist in the preset sub-region, thereby obtaining a fourth image, wherein the fourth image is an image frame corresponding to the fourth moment of the target video, and the fourth moment is spaced apart from the second moment by a second preset time. The second detection subunit is used to detect the first image, the second image, and the fourth image to obtain the target detection result.
8. The apparatus according to claim 7, characterized in that, The first detection subunit is also used for: In response to the second detection result that the target object exists in the preset sub-region, the target video is frame-sampling based on the second frame-sampling frequency to obtain a fifth image, wherein the fifth image is the image frame corresponding to the fifth moment of the target video, and the fifth moment is spaced apart from the second moment by a first preset time. The first image, the second image, and the fifth image are detected to obtain the target detection result.
9. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-4.
11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-4.