Search

CN-122024120-A - Object counting method, electronic device, and computer-readable storage medium

CN122024120ACN 122024120 ACN122024120 ACN 122024120ACN-122024120-A

Abstract

The application discloses an object counting method, electronic equipment and a computer readable storage medium, wherein the method comprises the steps of performing median filtering processing according to the first object number of each video frame in a video stream acquired in real time to obtain the second object number in each video frame; and carrying out mode filtering processing on the second object number of each video frame in the target counting time to obtain the target object number. Thereby improving object count accuracy.

Inventors

  • SU HAO
  • DING GUIGUANG
  • WANG ZHONGJIU
  • JIN HENG
  • ZHANG XIAOFENG
  • HUANG PENG

Assignees

  • 浙江大华技术股份有限公司

Dates

Publication Date
20260512
Application Date
20251216

Claims (11)

  1. 1. An object counting method, characterized in that the object counting method comprises: Performing median filtering processing according to the first object number of each video frame in the video stream acquired in real time to obtain the second object number in each video frame; in response to receiving a manual counting trigger instruction, determining a target counting time according to a first trigger time in the manual counting trigger instruction; and performing mode filtering processing on the second object number of each video frame in the target counting time to obtain the target object number.
  2. 2. The object counting method according to claim 1, characterized in that the method further comprises: in response to not receiving the manual counting trigger instruction but meeting an automatic counting trigger condition, determining at least two frames of target video frames from the video stream according to the automatic counting trigger condition, wherein a second trigger moment when the automatic counting trigger condition is met is later than a first trigger moment of the manual counting trigger instruction; and performing mode filtering processing on the second object number of each target video frame to obtain the target object number.
  3. 3. The object counting method according to claim 2, wherein the step of determining at least two frames of target video frames from each video stream according to the auto-count trigger condition comprises: Acquiring a first video frame and a second video frame from the video stream, wherein the object state of the first video frame is that an object does not exist, the object state of the second video frame is that an object exists, the first video frame and the second video frame are adjacent video frames in the video stream, and the frame sequence of the first video frame is smaller than the frame sequence of the second video frame; And taking the video frames in the video stream from the acquisition time of the second video frame to the second triggering time as the target video frames.
  4. 4. The object counting method according to claim 2, wherein before the step of determining at least two frames of target video frames from the video stream according to the auto-count trigger condition in response to not receiving the manual-count trigger instruction but satisfying the auto-count trigger condition, the method further comprises: Taking the video frame acquired in real time as a third video frame; Acquiring an object state of the third video frame and an object state of a fourth video frame, wherein the third video frame and the fourth video frame are adjacent video frames in the video stream, the frame sequence of the fourth video frame is smaller than that of the third video frame, and the frame sequence of the second video frame is smaller than that of the fourth video frame; And responding to the condition that the object state of the third video frame is that the object does not exist and the object state of the fourth video frame is that the object exists, and representing that the automatic counting triggering condition is met.
  5. 5. The method for counting objects according to claim 1, wherein the step of performing median filtering processing according to the first object number of each video frame in the video stream acquired in real time to obtain the second object number in each video frame comprises: Taking a video frame acquired in real time as a current video frame, and storing the first object number of the current video frame into an acquired sliding window buffer area; And carrying out median filtering processing according to the first object number in the sliding window buffer area to obtain the second object number of the current video frame.
  6. 6. The method according to claim 5, wherein the first number of objects in the sliding window buffer includes a first number of objects of the current video frame and a first number of objects of other video frames, and the storing time of the other video frames is earlier than the storing time of the current video frame, and the step of performing median filtering according to the first number of objects in the sliding window buffer to obtain the second number of objects of the current video frame includes: sorting the first object number of the current video frame and the first object number of the other video frames to obtain a sorted first object number; And determining the median in the ordered first object number as the second object number of the current video frame.
  7. 7. The object counting method according to claim 1, wherein the step of determining a target count time from a first trigger time in the manual count trigger instruction includes: Acquiring a first trigger time of the manual counting trigger instruction; taking a first preset time period earlier than the first trigger time as the target counting time; or taking a second preset time period which is later than the first trigger time as the target counting time.
  8. 8. The object counting method according to claim 1, wherein the step of performing mode filtering processing on the second object number of each video frame in the target counting time to obtain a target object number includes: dividing video frames with the same second object number in the target counting time into the same data group to obtain a plurality of data groups; taking the data group with the largest video frame number as a target data group; and taking the second object number of each video frame in the target data set as the target object number.
  9. 9. The object counting method according to claim 1, wherein before the step of performing median filtering processing on the first object number of each video frame in the video stream acquired in real time to obtain the second object number in each video frame, the method further comprises: performing target detection processing on each video frame acquired in real time to obtain a first initial object in each video frame; Filtering the first initial object according to the region of interest in the video frame to obtain a first target object in the video frame; and tracking the first target object in the video frame to obtain the first object number in the video frame.
  10. 10. An electronic device comprising a memory and a processor, wherein the memory stores program instructions, the processor retrieving the program instructions from the memory to perform the object counting method of any one of claims 1-9.
  11. 11. A computer storage medium comprising program data stored thereon, which when executed by a processor is adapted to carry out the object counting method according to any one of claims 1-9.

Description

Object counting method, electronic device, and computer-readable storage medium Technical Field The present invention relates to the field of image processing technologies, and in particular, to an object counting method, an electronic device, and a computer readable storage medium. Background Statistics of the number of objects in various number statistics scenarios is one of the most concerned problems of the manager. Accurate statistics of the number of objects is the basis for achieving fine management. At present, object identification processing is performed on an acquired image in a scene to be counted to determine the number of final objects in the scene to be counted, but the situation that counting jump is caused by single-frame false detection or omission detection exists, so that the problem of inaccurate counting is caused. In this regard, an object counting method capable of improving object counting accuracy is required. Disclosure of Invention The application mainly solves the technical problem of providing an object counting method, electronic equipment and a computer readable storage medium, which can count accurately. In order to solve the technical problems, the application provides an object counting method, which comprises the steps of performing median filtering processing according to the first object number of each video frame in a video stream acquired in real time to obtain the second object number in each video frame, determining target counting time according to the first triggering time in the manual counting triggering instruction in response to receiving the manual counting triggering instruction, and performing mode filtering processing on the second object number of each video frame in the target counting time to obtain the target object number. In one embodiment, the method further comprises the steps of responding to the fact that the manual counting trigger instruction is not received but an automatic counting trigger condition is met, determining at least two frames of target video frames from the video stream according to the automatic counting trigger condition, enabling second trigger time when the automatic counting trigger condition is met to be later than first trigger time when the manual counting trigger instruction is met, and carrying out mode filtering processing on the second object number of each target video frame to obtain the target object number. In an embodiment, the step of determining at least two frames of target video frames from each video stream according to the automatic counting triggering condition includes acquiring a first video frame and a second video frame from the video stream, wherein the object state of the first video frame is that the object does not exist, the object state of the second video frame is that the object exists, the first video frame and the second video frame are adjacent video frames in the video stream, the frame sequence of the first video frame is smaller than the frame sequence of the second video frame, and taking the video frames from the acquisition time of the second video frame to the second triggering time in the video stream as the target video frames. In an embodiment, before the step of determining at least two frames of target video frames from the video stream according to the automatic count trigger condition in response to not receiving the manual count trigger instruction but satisfying the automatic count trigger condition, the method further comprises taking a video frame acquired in real time as a third video frame, acquiring object states of the third video frame and object states of a fourth video frame, wherein the third video frame and the fourth video frame are adjacent video frames in the video stream, and the fourth video frame has a frame sequence smaller than that of the third video frame, and a second video frame has a frame sequence smaller than that of the fourth video frame, and characterizing that the automatic count trigger condition is satisfied in response to the object states of the third video frame being object absence and the object states of the fourth video frame being object presence. In an embodiment, the step of performing median filtering processing according to the number of the first objects of each video frame in the video stream obtained in real time to obtain the number of the second objects in each video frame includes taking the video frame obtained in real time as a current video frame, storing the number of the first objects of the current video frame into an obtained sliding window buffer area, and performing median filtering processing according to the number of the first objects in the sliding window buffer area to obtain the number of the second objects of the current video frame. In an embodiment, the first object number in the sliding window buffer area includes the first object number of the current video frame and the first object number of other video f