Multi-camera target counting method, system and device based on dynamic warning line and medium
By introducing dynamic warning lines in a multi-camera system, generating warning areas and determining the motion paths of monitored objects, the problems of missed and repeated counting in multi-camera counting are solved, and accurate target counting is achieved in complex scenarios.
Patent Information
- Application Number
- CN202510619450.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-09-26
AI Technical Summary
When multiple cameras jointly cover a wide channel, the simple overlay technology of traditional cameras leads to problems of missed counting and repeated counting, and the counting errors are serious, especially in complex scenarios.
A multi-camera target counting method based on dynamic warning lines is adopted. By acquiring images collected by multiple cameras in real time, warning lines and warning areas are generated, the motion path of the monitored object is determined, and counting is performed based on the motion path, including the processing of fixed areas, transition areas and dynamic areas.
It effectively solves the problems of missed counting and repeated counting in multi-camera counting, adapts to the target counting needs in complex scenarios, and improves the accuracy and consistency of counting.
Smart Images

Figure CN120708147A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent video surveillance, and in particular to a multi-camera target counting method, system, device and medium based on dynamic warning lines. Background Art
[0002] Intelligent video surveillance technology has been widely used in the field of object counting in recent years. In particular, detection methods based on cordon lines or trip wires have become a core technology for counting traffic and people in scenarios such as shopping malls, transportation hubs, and sports stadiums. The current mainstream single-camera cordon line technology defines a virtual boundary, determines the direction of moving objects crossing it, and counts them, thereby further confirming the number of vehicles or people within a larger area. However, while a single camera can cover narrow passages, once the application scenario becomes more complex, a single camera's field of view is insufficient to cover wide passages, necessitating the use of multiple cameras to jointly cover the same passage.
[0003] When multiple cameras jointly cover a single channel, the limitations of this traditional camera simple superposition technology method will be exposed. Each camera uses ordinary warning lines to count independently, which will cause problems at the connection points of the warning lines. That is, when multiple cameras independently set fixed warning lines, the spatial relationship between adjacent warning lines (intersection, separation or tangency) will cause counting errors. Specifically, the intersection and overlap area of adjacent warning lines: when the target passes through, multiple cameras are triggered to count, resulting in repeated counting; the gap area between adjacent warning lines: when the target passes through the uncovered area, it is not captured by any camera, resulting in missed counting; the tangent connection area of adjacent warning lines: when the target crosses the critical point of the warning lines of two cameras, the adjacent cameras’ judgment conditions are not met, resulting in missed counting. Summary of the Invention
[0004] In view of the shortcomings of the prior art described above, the purpose of the present invention is to provide a multi-camera target counting method, system, device and medium based on dynamic warning lines, which are used to solve problems such as missed counting and repeated counting when multiple cameras are jointly counting.
[0005] To achieve the above-mentioned and other related purposes, the first aspect of the present invention provides a multi-camera target counting method based on dynamic warning lines, the method comprising: obtaining images of target entrances and exits captured in real time by multiple cameras; wherein, a corresponding warning line and a warning area passed through by the warning line are generated in the images captured by each camera; when a camera captures a monitored object appearing in the warning area, the movement path of the monitored object crossing the warning line is determined based on the images captured by each camera, and the monitored object is counted based on the movement path.
[0006] In some embodiments of the first aspect of the present invention, the warning area includes a fixed area and a transition area that are passed through and connected by a warning line, and the fixed area and the transition area are respectively divided into a first area and a second area by the warning line; wherein, the fixed area is the area covered by the camera alone, and the transition area is the area covered jointly by the camera and the transition areas of other cameras; the transition area in the image captured by each camera has an inner boundary and an outer boundary, and the inner boundary is connected to the fixed area of the camera.
[0007] In some embodiments of the first aspect of the present invention, determining the movement path of the monitored object crossing the warning line based on the images captured by each camera, and counting the monitored object based on the movement path includes: when the monitored object appears in a fixed area in the image captured by a camera and the image corresponds to the previous frame image of the monitored object crossing the warning line, counting judgment is performed based on the next frame image captured by the camera, and the counting result is updated when the count is determined; when the monitored object appears in a transition area in the image captured by a camera and the image corresponds to the previous frame image of the monitored object crossing the warning line, selecting the next frame image of the monitored object captured by a camera for counting judgment, and updating the counting result when the count is determined; when the monitored object appears in the transition area in the image captured by a camera and the image corresponds to the previous frame image of the monitored object passing the intersection of the warning line and the outer boundary of the transition area, selecting the next frame image of the monitored object captured by a camera for counting judgment, and updating the counting result when the count is determined.
[0008] In some embodiments of the first aspect of the present invention, when a monitored object appears in a fixed area in an image captured by a camera and the image corresponds to the previous frame image in which the monitored object crosses the warning line, it is determined based on the next frame image captured by the camera whether the monitored object is in the fixed area or the transition area after crossing the warning line. If so, the counting is performed directly based on the direction of crossing the warning line, and the counting result is updated.
[0009] In some embodiments of the first aspect of the present invention, when a monitored object appears in a transition zone in an image captured by a camera and the image corresponds to the previous frame image of the monitored object crossing the warning line, the distance between the monitored object and the corresponding fixed area in each image is calculated, and the camera corresponding to the image with the closest distance is selected as the target camera; based on the next frame image captured by the target camera, it is determined whether the monitored object is in the fixed area or the transition zone after crossing the warning line. If so, the counting is directly performed based on the direction of crossing the warning line, and the counting result is updated.
[0010] In some embodiments of the first aspect of the present invention, when a monitored object appears in the transition zone in an image captured by a camera and the image corresponds to the previous frame image of the monitored object passing through the intersection of the warning line and the outer boundary of the transition zone, a camera is selected from each camera as the target camera, and the warning line of the camera is controlled to be extended, and the dynamic zone is activated on the opposite side of the outer boundary of the transition zone with the extended warning line as the axis; based on the next frame image captured by the target camera, it is determined whether the monitored object is in the dynamic zone after passing the intersection of the warning line and the outer boundary of the transition zone. If so, counting is performed directly based on the direction of crossing the warning line, and the counting result is updated.
[0011] In some embodiments of the first aspect of the present invention, counting based on the direction of crossing the warning line includes: if the monitored object crosses the warning line from the first zone of the warning zone to the second zone, the count is increased by 1; if the monitored object crosses the warning line from the second zone of the warning zone to the first zone, the count is decreased by 1; if the monitored object crosses the warning line from the first zone of the warning zone to the dynamic zone, the count is increased by 1; if the monitored object crosses the warning line from the second zone of the warning zone to the dynamic zone, the count is decreased by 1.
[0012] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present invention provides a multi-camera target counting system based on dynamic warning lines, including: an image acquisition module, used to obtain images of target entrance and exit channels captured in real time by multiple cameras; wherein, a corresponding warning line and a warning area passed by the warning line are generated in the image captured by each camera; a target monitoring module, connected to the image acquisition module, used to monitor the positions of all monitored objects in the image; a target tracking module, connected to the target monitoring module, used to associate the position sequences belonging to the same monitored object in two adjacent frames, thereby obtaining the motion trajectory of the monitored object; a counting module, connected to the target tracking module, counts the monitored object based on the motion path.
[0013] To achieve the above-mentioned objectives and other related objectives, the third aspect of the present invention provides a computer device comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the multi-camera target counting method based on dynamic warning lines.
[0014] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-camera target counting method based on dynamic warning lines.
[0015] As described above, the multi-camera target counting method, system, device and medium based on dynamic warning lines of the present invention have the following beneficial effects: the present invention obtains images of the target entrance and exit channels captured by multiple cameras in real time, and corresponding warning lines and warning areas are generated in the images captured by each camera; when a camera captures a monitored object appearing in the warning area, the movement path of the monitored object crossing the warning line is determined based on the images captured by each camera, and the monitored object is counted based on the movement path. The present invention sets warning lines and fixed areas and transition areas passed by the warning lines and dynamic areas activated in response to special scenarios for the images captured by the cameras, which can comprehensively cope with various counting situations of multi-camera target counting and overcome the problems of over-counting and under-counting caused by traditional warning line splicing. In the face of application scenarios with complex and changeable channels, the present invention can be applied to a large number of scenarios by placing cameras of different numbers and positions according to different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Shown is a flow chart of a multi-camera target counting method based on dynamic warning lines in one embodiment of the present invention.
[0017] Figure 2 Shown is a schematic diagram of the motion path determination and counting process in one embodiment of the present invention.
[0018] Figure 3 It is a schematic diagram showing a monitored object crossing a warning line from a first transition zone to a second transition zone in one embodiment of the present invention.
[0019] Figure 4 It is a schematic diagram showing the monitoring object from the first transition zone to the dynamic zone in one embodiment of the present invention.
[0020] Figure 5 Shown is a module schematic diagram of a multi-camera target counting system based on dynamic warning lines in one embodiment of the present invention.
[0021] Figure 6 Shown is a schematic structural diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following describes the embodiments of the present application through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0023] It should be noted that in the following description, reference is made to the accompanying drawings, which describe several embodiments of the present invention. It should be understood that other embodiments may be used and that mechanical, structural, electrical and operational changes may be made without departing from the spirit and scope of the present invention. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present invention is limited only by the claims of the published patents. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. Spatially related terms, such as "upper", "lower", "left", "right", "below", "below", "lower", "above", "upper", etc., may be used in the text to facilitate the description of the relationship between one element or feature shown in the figure and another element or feature.
[0024] Throughout this specification, when a part is said to be "connected" to another part, this includes not only "direct connection" but also "indirect connection" with other elements interposed therebetween. Furthermore, when a part is said to "include" a certain component, unless otherwise stated, this does not exclude the other component but rather implies that the other component may be included.
[0025] The terms "first," "second," and "third" are used to describe various parts, components, regions, layers, and / or segments, but are not intended to be limiting. These terms are used solely to distinguish one part, component, region, layer, or segment from another. Therefore, a reference to a first part, component, region, layer, or segment below may also refer to a second part, component, region, layer, or segment without departing from the scope of the present invention.
[0026] Furthermore, as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprise", "include" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Thus, "A, B, or C" or "A, B, and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B, and C". Exceptions to this definition occur only when the combination of elements, functions, or operations is inherently mutually exclusive in some way.
[0027] The present invention provides a multi-camera target counting method based on dynamic warning lines. The method obtains images of target entrances and exits collected by multiple cameras in real time, and generates corresponding warning lines and warning areas in the images collected by each camera. When a camera captures a monitored object appearing in a warning area, the method determines the movement path of the monitored object crossing the warning line based on the images collected by each camera, and counts the monitored object based on the movement path. The present invention sets warning lines and fixed areas and transition areas passed by the warning lines in the images collected by the cameras, as well as dynamic areas activated in response to special scenarios. This method can comprehensively cope with various counting situations of multi-camera target counting and overcome the problems of over-counting and under-counting caused by traditional warning line splicing. In the face of application scenarios with complex and changeable channels, the present invention can be applied to a large number of scenarios by placing cameras of different numbers and positions according to different scenarios.
[0028] The following is a detailed description of the embodiments of the present application with reference to the accompanying drawings so that those skilled in the art can easily implement the present application. The present application can be embodied in many different forms and is not limited to the embodiments described herein.
[0029] like Figure 1 The following is a flow chart of a multi-camera target counting method based on dynamic warning lines according to an embodiment of the present invention. The method includes:
[0030] Step S1: Acquire target entrance and exit channel image data collected by multiple cameras in real time.
[0031] Specifically, multiple cameras are installed at the target entrance and exit to ensure they can capture images of the target entrance and exit. The cameras can be installed as needed, for example, on both sides of the passage. Each camera captures images of the target entrance and exit from a corresponding angle. The captured images are used to generate warning lines and warning zones. The warning zones are divided into a first zone and a second zone, using the warning line as the boundary.
[0032] In one embodiment, the length of the warning line in the image captured by each camera can be set according to actual application. Warning zones are generated on both sides of the warning line generated in the image captured by each camera. The warning zones are divided into a fixed zone and a transition zone. The transition zone boundary is adjacent to the fixed zone boundary. The fixed zone and the transition zone are divided into a first zone and a second zone, separated by the warning line. The fixed zone is the area covered by the camera alone, and the transition zone is the area covered by the camera and the transition zones of other cameras. The transition zone in the image captured by each camera has an inner boundary and an outer boundary, and the inner boundary is adjacent to the fixed zone of the camera. The size of the fixed zone and the transition zone can be adjusted by setting camera parameters.
[0033] Step S2: When a camera captures a monitored object appearing in the warning area, a movement path of the monitored object crossing the warning line is determined based on images captured by each camera, and the monitored object is counted based on the movement path.
[0034] In one embodiment, if Figure 2 The step of determining the movement path of the monitored object crossing the warning line based on the images collected by each camera, and counting the monitored object based on the movement path includes:
[0035] When a monitored object appears in a fixed area in an image captured by a camera and that image corresponds to the frame before the monitored object crossed the warning line, a count is determined based on the subsequent frame captured by the camera, and the count result is updated when the count is determined. Specifically, when a monitored object approaches the warning line in an image captured by a camera and has a tendency to cross the warning line, that image is considered the frame before the object crossed the warning line. It should be noted that when the monitored object is in a fixed area and the distance from the warning line gradually decreases and becomes less than a preset distance, it is considered that the monitored object has a tendency to cross the warning line, and that image is considered the frame before the object crossed the warning line. The preset distance is set to an extremely small value. In this case, when a camera-captured image is detected to have a tendency to cross the warning line and appears in a fixed area, a count is determined based on the frame after the image captured by the camera, and the count result is updated when the count is determined.
[0036] When a monitored object appears in a transition zone in an image captured by a camera and the image corresponds to the previous frame image of the monitored object crossing the warning line, an image of the next frame image of the monitored object crossing the warning line captured by a camera is selected for counting and judgment, and the counting result is updated when the count is determined. It should be noted that when the monitored object is in the transition zone and the distance from the warning line gradually decreases and is less than a preset distance, it is considered that the monitored object has a tendency to cross the warning line, that is, the image is regarded as the previous frame image of the monitored object crossing the warning line. The preset distance is set to an extremely small value. In this case, when it is detected that there is a tendency to cross the warning line in images captured by multiple cameras and it appears in the transition zone, an image of the next frame image of the image captured by a camera is selected for counting and judgment, and the counting result is updated when the count is determined.
[0037] When a monitored object appears at the intersection of the warning line and the outer boundary of the transition zone in an image captured by a camera and the image corresponds to the previous frame image of the monitored object crossing the warning line, an image of the next frame of the monitored object crossing the warning line captured by a camera is selected for counting and judgment, and the counting result is updated when the count is determined. It should be noted that when the monitored object is close to the intersection of the warning line and the outer boundary of the transition zone, it is considered that the monitored object has a tendency to cross the warning line, that is, the image is regarded as the previous frame image of crossing the warning line. The specific judgment method can be to judge the distance close to the intersection and the moving direction close to the intersection. In this case, when it is detected that there is a tendency to cross the warning line in the images captured by multiple cameras and it appears at the intersection of the warning line and the outer boundary of the transition zone, an image of the next frame of the image captured by a camera is selected for counting and judgment, and the counting result is updated when the count is determined.
[0038] In one embodiment, when a monitored object appears in a fixed area in an image captured by a camera and the image corresponds to a frame before the monitored object crosses the warning line, a determination is made based on a subsequent frame of image captured by the camera whether the monitored object has crossed the warning line.
[0039] If the object crosses the cordon, it will continue to determine whether it is in the fixed area or the transition area after crossing the cordon. If so, it will directly count based on the direction of crossing the cordon and update the counting result. If not, it will not be counted.
[0040] If you do not cross the cordon, it will not be counted.
[0041] In one embodiment, when a monitored object appears in a fixed area in an image captured by a camera, and that image corresponds to the frame immediately preceding the monitored object's crossing of a warning line, a subsequent image captured by the camera is used to determine whether the monitored object is in the fixed area after crossing the warning line. In this case, the direction of crossing the warning line is determined by comparing the monitored object's position in the subsequent image captured by the camera with the position of the monitored object in the frame immediately preceding the crossing of the warning line. This is used to determine the direction of crossing the warning line, and the count result is updated when the count is determined.
[0042] When a monitored object appears in a fixed area in an image captured by a camera, and that image corresponds to the frame before the monitored object crossed the warning line, the subsequent frame captured by that camera is used to determine whether the monitored object is in the transition zone after crossing the warning line. In this case, images of the monitored object in the transition zone captured by other cameras do not meet the counting criteria due to the lack of the frame before the monitored object crossed the warning line. The position of the monitored object in the subsequent frame captured by that camera is compared with the position of the monitored object in the frame before crossing the warning line to determine the direction of crossing the warning line, implement the counting judgment, and update the counting result when the count is determined.
[0043] In one embodiment, when a monitored object appears in a transition zone in an image captured by a camera and the image corresponds to a frame before the monitored object crosses the warning line, a camera is selected as a target camera, and a determination is made based on a subsequent frame of image captured by the camera to determine whether the monitored object has crossed the warning line.
[0044] If the object crosses the cordon, it will continue to determine whether it is in the fixed area or the transition area after crossing the cordon. If so, it will directly count based on the direction of crossing the cordon and update the counting result. If not, it will not be counted.
[0045] If you do not cross the cordon, it will not be counted.
[0046] In one embodiment, when a monitored object appears in a transition zone in an image captured by a camera and the image corresponds to the previous frame image of the monitored object crossing the warning line, the straight-line distance between the monitored object and the fixed zone boundary connected to the inner boundary of the transition zone covered by the corresponding camera in each image is calculated respectively, and the calculated straight-line distances are compared. The camera corresponding to the image with the shortest straight-line distance is selected as the target camera. At this time, the transition zone on the image captured by the other cameras that are not selected as the target camera is suppressed and no longer participates in the subsequent counting of the monitored object, thereby avoiding repeated counting. Specifically, based on the next frame image captured by the target camera, it is judged whether the monitored object is in a fixed zone or a transition zone after crossing the warning line. In this case, the position of the monitored object in the next frame image captured by the camera and the position of the monitored object in the previous frame image crossing the warning line are compared to determine the direction of crossing the warning line, thereby realizing counting judgment, and updating the counting result when determining the count. Figure 3 .
[0047] In a specific embodiment, when multiple monitoring objects appear in the transition zone at the same time in images captured by multiple cameras and the image corresponds to the previous frame image of these monitoring objects crossing the warning line, the ReID algorithm can be used to determine whether a monitoring object in each image is the same monitoring object. After determining that it is the same monitoring object, the distance between the monitoring object and the corresponding fixed area in each image is calculated, and the camera corresponding to the image with the closest distance is selected as the target camera.
[0048] In one embodiment, the selection of the target camera can also be determined by priority of a specific camera according to the manual setting in the program, that is, priority is given to determining whether the monitored object is in the transition zone of the specific camera. If so, the camera is used as the target camera, and the transition zones of other cameras are suppressed.
[0049] In one embodiment, when a monitored object appears in a transition zone in an image captured by a camera and the image corresponds to a previous frame of image in which the monitored object passes through the intersection of a warning line and an outer boundary of the transition zone, a determination is made based on a subsequent frame of image captured by the camera as to whether the monitored object has crossed the warning line.
[0050] If the object crosses the warning line, it will continue to determine whether it is in the dynamic area or transition area after crossing the warning line. If so, it will directly count based on the direction of crossing the warning line and update the counting result. If not, it will not be counted.
[0051] If you do not cross the cordon, it will not be counted.
[0052] In one embodiment, when the monitored object appears in the transition zone in an image captured by a camera, and the image corresponds to the previous frame of the image in which the monitored object passed through the intersection of the warning line and the outer boundary of the transition zone, the camera in the transition zone corresponding to the outer boundary of the intersection is selected as the target camera. At this time, the transition zones of other cameras are suppressed, and the warning line in the image captured by the camera is controlled to extend toward its non-warning zone. The dynamic zone is activated on the opposite side of the outer boundary of the transition zone with the extended warning line as the axis to expand the monitoring range. The range of the extended warning line and dynamic zone can be set according to the specific application scenario. Specifically, when the monitored object appears in the transition zone in the image captured by the target camera, and the image corresponds to the previous frame of the image in which the monitored object passed through the intersection of the warning line and the outer boundary of the transition zone, it is determined based on the next frame of the image captured by the target camera whether the monitored object is in the dynamic zone or the transition zone after passing the intersection of the warning line and the outer boundary of the transition zone. In this case, the position of the monitored object in the next frame of image captured by the camera is compared with the position of the monitored object in the previous frame of image that crossed the warning line to determine the direction of crossing the warning line, realize counting judgment, and update the counting result when the count is determined. Figure 4 .
[0053] In one embodiment, determining the direction of crossing the warning line and implementing counting judgment includes: if the monitored object crosses the warning line from the first zone of the warning area to the second zone, the count is increased by 1; if the monitored object crosses the warning line from the second zone of the warning area to the first zone, the count is decreased by 1; if the monitored object crosses the warning line from the first zone of the warning area to the dynamic zone, the count is increased by 1; if the monitored object crosses the warning line from the second zone of the warning area to the dynamic zone, the count is decreased by 1.
[0054] Specifically, it includes the following situations:
[0055] If the monitored object crosses the warning line from the first zone to the second zone of the warning area, that is, the monitored object enters the target entrance channel, the count is increased by 1:
[0056] When the monitored object is located in the first zone of the fixed area in the previous frame of image before it crosses the warning line, and the monitored object captured by the target camera is located in the second zone of the fixed area after crossing the warning line in the next frame of image, that is, the direction in which the monitored object crosses the warning line is from the first zone of the warning area to the second zone, the count is increased by 1, and the count result is updated when the count is determined;
[0057] When the monitored object is located in the first zone of the fixed zone in the previous frame of image before it crosses the warning line, and the monitored object captured by the target camera is located in the second zone of the transition zone after crossing the warning line in the next frame of image, that is, the direction in which the monitored object crosses the warning line is from the first zone of the warning zone to the second zone, the count is increased by 1, and the count result is updated when the count is determined;
[0058] When the monitored object is located in the first zone of the transition zone in the previous frame of image before it crosses the warning line, and the monitored object captured by the target camera is located in the second zone of the fixed zone after crossing the warning line in the next frame of image, that is, the direction in which the monitored object crosses the warning line is from the first zone of the warning zone to the second zone, the count is increased by 1, and the count result is updated when the count is determined;
[0059] When the position of the monitored object in the previous frame image before it crosses the warning line is in the first zone of the transition zone, and the monitored object captured by the target camera is in the second zone of the transition zone after crossing the warning line in the next frame image, that is, the direction in which the monitored object crosses the warning line is from the first zone of the warning zone to the second zone, the count is increased by 1 at this time, and the count result is updated when the count is determined.
[0060] In the case where the monitored object crosses the warning line from the second zone of the warning zone to the first zone, that is, the monitored object exits the target exit channel, the count is reduced by 1:
[0061] When the monitored object is located in the second zone of the fixed area in the previous frame of image before it crosses the warning line, and the monitored object captured by the target camera is located in the first zone of the fixed area after crossing the warning line in the next frame of image, that is, the direction in which the monitored object crosses the warning line is from the second zone of the warning area to the first zone, the count is reduced by 1, and the count result is updated when the count is determined;
[0062] When the monitored object is located in the second zone of the fixed zone in the previous frame of image before it crosses the warning line, and the monitored object captured by the target camera is located in the first zone of the transition zone after crossing the warning line in the next frame of image, that is, the direction in which the monitored object crosses the warning line is from the second zone of the warning zone to the first zone, the count is reduced by 1, and the count result is updated when the count is determined;
[0063] When the monitored object is located in the second zone of the transition zone in the previous frame of image before it crosses the warning line, and the monitored object captured by the target camera is located in the first zone of the transition zone after it crosses the warning line in the next frame of image, that is, the direction in which the monitored object crosses the warning line is from the second zone of the warning zone to the first zone, the count is reduced by 1, and the count result is updated when the count is determined;
[0064] When the position of the monitored object in the previous frame image before it crosses the warning line is in the second zone of the transition zone, and the monitored object captured by the target camera is in the first zone of the fixed zone after crossing the warning line in the next frame image, that is, the direction in which the monitored object crosses the warning line is from the second zone of the warning zone to the first zone, the count is reduced by 1 at this time, and the count result is updated when the count is determined.
[0065] When the monitored object crosses the warning line from the first zone of the warning zone to the dynamic zone, that is, the monitored object enters the target entrance channel, the count is increased by 1:
[0066] When the position of the monitored object in the previous frame image before it crosses the warning line is in the first zone of the transition zone, and the monitored object captured by the target camera is in the dynamic zone after crossing the warning line in the next frame image, that is, the direction in which the monitored object crosses the warning line is from the first zone of the warning zone to the dynamic zone, the count is increased by 1 at this time, and the count result is updated when the count is determined.
[0067] When the monitored object crosses the warning line from the second zone of the warning zone to the dynamic zone, that is, the monitored object exits the target exit channel, the count is reduced by 1:
[0068] When the position of the monitored object in the previous frame image before it crosses the warning line is in the second zone of the transition zone, and the monitored object captured by the target camera is in the dynamic zone after crossing the warning line in the next frame image, that is, the direction in which the monitored object crosses the warning line is from the second zone of the warning zone to the dynamic zone, the count is reduced by 1 at this time, and the count result is updated when the count is determined.
[0069] Similar to the principles of the above embodiments, the present invention provides a multi-camera target counting system based on dynamic warning lines.
[0070] The following combination Figure 5 Provide specific embodiments:
[0071] like Figure 5 A schematic diagram showing a multi-camera target counting system based on dynamic warning lines in an embodiment of the present invention.
[0072] The system comprises:
[0073] An image acquisition module is used to obtain images of the target entrance and exit passages captured by multiple cameras in real time; wherein, a corresponding warning line and a warning area passed by the warning line are generated in the image captured by each camera;
[0074] A target monitoring module, connected to the image acquisition module, for monitoring the positions of all monitored objects in the image;
[0075] A target tracking module, connected to the target monitoring module, is used to associate the position sequences belonging to the same monitored object in two adjacent frames, thereby obtaining the motion trajectory of the monitored object;
[0076] The counting module is connected to the target tracking module and counts the monitored object based on the motion path.
[0077] It should be understood that Figure 5 The division of modules in the system embodiments is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into a single physical entity, or physically separated. Furthermore, these units can be implemented entirely as software invoked by processing elements, entirely as hardware, or partially as software invoked by processing elements, while others are implemented in hardware. Since the implementation principles of this dynamic warning line-based multi-camera target counting system have been described in the previous embodiments, they will not be repeated here.
[0078] The multi-camera target counting method based on dynamic warning lines provided by the embodiment of the present invention can be implemented on the terminal side or the server side. As for the hardware structure of the application terminal of the multi-camera target counting method based on dynamic warning lines, please refer to Figure 6 , is an optional hardware structure diagram of an application terminal 6000 of a multi-camera target counting method based on dynamic warning lines provided by an embodiment of the present invention, such as Figure 6 As shown, the computer device includes: at least one processor 601, a memory 602, at least one network interface 603 and a user interface 605. The various components in the device are coupled together via a bus system 604. It is understood that the bus system 604 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 604 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 604 is not described in detail. Figure 6 In the text, various buses are labeled as bus systems.
[0079] The user interface 605 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.
[0080] It will be appreciated that the memory 602 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM) or a programmable read-only memory (PROM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0081] The memory 602 in the embodiment of the present invention is used to store various categories of data to support the operation of the electronic terminal 600. Examples of such data include: any executable program for operating on the electronic terminal 600, such as an operating system 6021 and an application 6022; the operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 6022 can include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The multi-camera target counting method based on dynamic warning lines provided in the embodiment of the present invention can be included in the application 6022.
[0082] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 601. Processor 601 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in processor 601 or by software instructions. The above processor 601 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 601 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor 601 can be a microprocessor or any conventional processor. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium located in a memory. The processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0083] In an exemplary embodiment, the electronic terminal 600 may be configured to execute the aforementioned method using one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs).
[0084] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with a computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0085] In the embodiments provided herein, the computer readable and writable storage medium may include a read-only memory, a random access memory, an EEPROM, a CD-ROM or other optical disk storage device, a magnetic disk storage device or other magnetic storage device, a flash memory, a USB flash drive, a mobile hard disk, or any other medium that can be used to store desired program code in the form of instructions or data structures and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer readable medium. For example, if the instruction is sent from a website, a server or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwaves are included in the definition of the medium. However, it should be understood that computer readable and writable storage media and data storage media do not include connections, carriers, signals or other temporary media, but are intended to be non-temporary, tangible storage media. Disk and disc, as used in this application, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
[0086] In summary, the present invention provides a method, system, device and medium for a multi-camera target counting system based on dynamic warning lines. The method obtains images of target entrances and exits collected by multiple cameras in real time, and corresponding warning lines and warning areas are generated in the images collected by each camera. When a camera captures a monitored object appearing in the warning area, the movement path of the monitored object crossing the warning line is determined based on the images collected by each camera, and the monitored object is counted based on the movement path. The present invention sets warning lines and fixed areas, transition areas and dynamic areas activated in response to special scenarios for the images collected by the cameras. It can fully cope with various counting situations of multi-camera target counting and overcome the problems of over-counting and under-counting caused by traditional warning line splicing. In the face of complex and changeable application scenarios of channels, the present invention can be applied to a large number of scenarios by placing cameras of different numbers and positions according to different scenarios. Therefore, the present invention effectively overcomes the various shortcomings of the prior art and has high industrial utilization value.
[0087] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this invention. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be encompassed by the claims of this invention.
Claims
1. A multi-camera target counting method based on dynamic warning lines, characterized in that: include: Acquire images of the target entrance and exit passage captured by multiple cameras in real time; wherein, a corresponding warning line and a warning area passed through by the warning line are generated in the image captured by each camera; When a camera captures a monitored object appearing in the warning area, a movement path of the monitored object crossing the warning line is determined based on images captured by each camera, and the monitored object is counted based on the movement path.
2. The method for counting targets with multiple cameras based on dynamic warning lines according to claim 1, characterized in that: The warning area includes: A fixed area and a transition area are passed through and connected by a cordon, and the fixed area and the transition area are respectively divided into a first area and a second area by the cordon; wherein the fixed area is the area covered by the camera alone, and the transition area is the area covered by the camera and the transition areas of other cameras together; the transition area in the image captured by each camera has an inner boundary and an outer boundary, and the inner boundary is connected to the fixed area of the camera.
3. The method for counting targets with multiple cameras based on dynamic warning lines according to claim 2, characterized in that: Determining the movement path of the monitored object crossing the warning line based on the images collected by each camera, and counting the monitored object based on the movement path includes: When a monitored object appears in a fixed area in an image captured by a camera and the image corresponds to the previous frame image in which the monitored object crosses the warning line, a counting judgment is performed based on the next frame image captured by the camera, and the counting result is updated when the count is determined; When a monitored object appears in the transition zone in an image captured by a camera and the image corresponds to a previous frame image of the monitored object crossing the warning line, a subsequent frame image of the monitored object captured by a camera is selected for counting judgment, and the counting result is updated when the count is determined; When a monitored object appears in the transition zone in an image captured by a camera and the image corresponds to the previous frame image of the monitored object passing the intersection of the warning line and the outer boundary of the transition zone, a next frame image of the monitored object captured by a camera is selected for counting judgment, and the counting result is updated when the count is determined.
4. The method for counting targets with multiple cameras based on dynamic warning lines according to claim 3, characterized in that: When a monitored object appears in a fixed area in an image captured by a camera and the image corresponds to the previous frame image of the monitored object crossing the warning line, it is judged based on the next frame image captured by the camera whether the monitored object is in the fixed area or the transition area after crossing the warning line. If so, the count is directly based on the direction of crossing the warning line and the counting result is updated.
5. The method for counting targets with multiple cameras based on dynamic warning lines according to claim 3, characterized in that: When a monitored object appears in the transition zone in an image captured by a camera and the image corresponds to the previous frame image of the monitored object crossing the warning line, the distance between the monitored object and the corresponding fixed area in each image is calculated, and the camera corresponding to the image with the closest distance is selected as the target camera. Based on the next frame image captured by the target camera, it is determined whether the monitored object is in the fixed area or the transition zone after crossing the warning line. If so, the counting is directly based on the direction of crossing the warning line, and the counting result is updated.
6. The method for counting targets with multiple cameras based on dynamic warning lines according to claim 3, characterized in that: When a monitored object appears in the transition zone in an image captured by a camera and the image corresponds to the previous frame image of the monitored object passing through the intersection of the warning line and the outer boundary of the transition zone, a camera is selected from each camera as the target camera, and the warning line in the image captured by the camera is controlled to be extended, and the dynamic zone is activated on the opposite side of the outer boundary of the transition zone with the extended warning line as the axis; based on the next frame image captured by the target camera, it is judged whether the monitored object is in the dynamic zone after passing the intersection of the warning line and the outer boundary of the transition zone. If so, the counting is directly performed based on the direction of crossing the warning line, and the counting result is updated.
7. A multi-camera target counting method based on dynamic warning lines according to any one of claims 4 to 6, characterized in that: Counts based on the direction from which the line was crossed include: If the monitored object crosses the warning line from the first zone to the second zone of the warning area, the count is increased by 1; If the monitored object crosses the warning line from the second zone to the first zone of the warning zone, the count is reduced by 1; If the monitored object crosses the warning line from the first zone of the warning zone to the dynamic zone, the count is increased by 1; If the monitored object crosses the warning line from the second zone of the warning zone to the dynamic zone, the count is reduced by 1.
8. A multi-camera target counting system based on dynamic warning lines, characterized in that: include: An image acquisition module is used to obtain images of the target entrance and exit passages captured by multiple cameras in real time; wherein, a corresponding warning line and a warning area passed by the warning line are generated in the image captured by each camera; A target monitoring module, connected to the image acquisition module, for monitoring the positions of all monitored objects in the image; A target tracking module, connected to the target monitoring module, is used to associate the position sequences belonging to the same monitored object in two adjacent frames, thereby obtaining the motion trajectory of the monitored object; The counting module is connected to the target tracking module and counts the monitored object based on the motion path.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.