WO2021196925A1 - Method and apparatus for detecting and tracking moving object - Google Patents

Method and apparatus for detecting and tracking moving object Download PDF

Info

Publication number
WO2021196925A1
WO2021196925A1 PCT/CN2021/077624 CN2021077624W WO2021196925A1 WO 2021196925 A1 WO2021196925 A1 WO 2021196925A1 CN 2021077624 W CN2021077624 W CN 2021077624W WO 2021196925 A1 WO2021196925 A1 WO 2021196925A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
pixel
pixel projection
projection
tracking
Prior art date
Application number
PCT/CN2021/077624
Other languages
French (fr)
Chinese (zh)
Inventor
陈志强
张丽
唐虎
张佳明
付禹铭
Original Assignee
清华大学
同方威视技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 清华大学, 同方威视技术股份有限公司 filed Critical 清华大学
Publication of WO2021196925A1 publication Critical patent/WO2021196925A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/223Analysis of motion using block-matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Definitions

  • the present disclosure relates to the field of image processing, and more specifically to a method for detecting and tracking a moving object, a device for detecting and tracking a moving object, an electronic device, and a computer-readable storage medium.
  • Moving object detection and tracking are hot issues in the field of computer vision, which are widely used in video surveillance, human-computer interaction, virtual reality and image compression.
  • optical flow method In terms of moving object detection, the three commonly used methods are optical flow method, frame difference method, and background subtraction method.
  • the optical flow method is effective in detecting and tracking moving objects, but its shortcomings are large amount of calculation, long time-consuming, and large resource occupation, which is not suitable for fast, real-time tracking scenes.
  • frame difference method and the background subtraction method are less computationally intensive and time-consuming, the detection effect is greatly reduced as the complexity of the background increases.
  • a method for detecting and tracking a moving object may include: obtaining an image including the object using an image acquisition device; and preprocessing the image. Processing to obtain a binarized image; horizontal projection and vertical projection are performed on the pixels in the binarized image to obtain pixel projection rows and pixel projection columns projected into one row and one column, wherein the pixels in the pixel projection row
  • the value of each pixel projection is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and the value of each pixel projection in the pixel projection column is The sum of the binarized values of all pixels on the row corresponding to the pixel projection in the binarized image;
  • the area of the object is determined based on a predetermined threshold and the pixel projection row and the pixel projection column ; And based on the determined area to determine whether the objects in the two images before and after are the same object, so as to realize the detection and tracking of the
  • preprocessing the image to obtain a binarized image may include: performing grayscale and binarization processing on the image to obtain the binarized image.
  • determining the area of the object based on a predetermined threshold and the pixel projection row and the pixel projection column may include: from the pixel projection row and the pixel projection column based on the predetermined threshold Filtering out pixel projections larger than the predetermined threshold; and determining the area of the object based on the filtered pixel projections.
  • determining the area of the object based on the filtered pixel projections may include: determining the horizontal boundary of the area of the object according to the pixel projections at the horizontal ends of the filtered pixel projections; Determine the vertical boundary of the area of the object according to the pixel projections at the vertical ends of the filtered pixel projections; and determine the area of the object based on the horizontal boundary and the vertical boundary.
  • the vertical boundary is determined only once, and the determined vertical boundary is directly projected into a subsequent image to form a subsequent image The vertical boundary of the object's area.
  • the horizontal boundary is determined only once, and the determined horizontal boundary is directly projected into a subsequent image to form the object in the subsequent image The horizontal boundary of the area.
  • the method may further include: determining the movement distance of the object based on the area of the object in the two images before and after the object is determined to be the same object in the two images before and after.
  • determining the moving distance of the object based on the area of the object in the two frames of images before and after may include: determining the horizontal moving distance of the object, including: projecting the pixels in the previous frame of image along the line with one pixel as the step length Horizontal movement; after each horizontal movement, determine the state value between the pixel projection line in the previous frame image and the pixel projection line in the next frame image after the movement: and the state value that will be calculated for multiple horizontal movements
  • the smallest state value among the plurality of state values is determined as the distance of the horizontal movement of the object between the previous and next two frames of images; and the vertical movement distance of the object is determined, wherein the method of determining the vertical movement distance of the object is the same as that of determining the level of the object The method of moving distance is the same.
  • the determining the state value between the pixel projection line in the previous frame image and the pixel projection line in the subsequent frame image after the movement may include: determining the state value by using the following formula:
  • H represents the state value
  • j represents the jth movement
  • the value of w is the number of pixel projections in the pixel projection row -1
  • Ap represents the previous frame of image
  • Ap+j (1,i) represents the jth time
  • a c represents the image of the next frame
  • a c (1,i) represents the i-th pixel projection in the pixel projection line in the next frame of image Pixel projection.
  • a moving object detection and tracking device including: an image acquisition device configured to obtain an image including the object; a preprocessing unit configured to pre-process the image Processing to obtain a binarized image; the pixel projection unit is configured to perform horizontal projection and vertical projection on the pixels in the binarized image to obtain pixel projection rows and pixel projection columns projected into one row and one column, wherein, The value of each pixel projection in the pixel projection row is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and the pixel projection column The value of each pixel projection is the sum of the binarized values of all pixels on the row corresponding to the pixel projection in the binarized image; the area determining unit is configured to be based on a predetermined threshold and the pixel projection The rows and the pixel projection columns determine the area of the object; and the determination unit is configured to determine whether the objects in the two frames of images before and after are the same object based on the determined
  • an electronic device including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are described When executed by one or more processors, the one or more processors implement the method according to the first aspect.
  • a computer-readable storage medium having executable instructions stored thereon, and when the instructions are executed by a processor, the processor implements the method according to the first aspect.
  • the moving object detection and tracking method invented in this paper uses the projection method.
  • the projection method has a small amount of calculation and is fast and simple.
  • the method in this paper is suitable for scenarios with a relatively simple background, fast detection and tracking in real time, and limited computing resources.
  • the present disclosure uses projection algorithms in image processing technology to detect and track moving objects in image/video data. As a result, image/video data can be more conveniently applied to scenarios such as subsequent intelligent detection and manual monitoring.
  • Fig. 1 schematically shows a system architecture of a method for detecting and tracking a moving object according to an embodiment of the present disclosure
  • Fig. 2 schematically shows a flow chart of a method for detecting and tracking a moving object according to an embodiment of the present disclosure
  • Fig. 3 schematically shows a diagram of obtaining pixel projection rows and pixel projection columns by horizontal projection and vertical projection of pixels in a binarized image according to an embodiment of the present disclosure
  • Fig. 4 schematically shows a diagram of filtering out pixel projections larger than a predetermined threshold from pixel projection rows and pixel projection columns based on a predetermined threshold according to an embodiment of the present disclosure
  • Fig. 5 schematically shows a flow chart of determining the moving distance of an object in two frames before and after according to an embodiment of the present disclosure
  • Fig. 6 schematically shows a block diagram of a mobile object detection and tracking device according to an embodiment of the present disclosure.
  • Fig. 7 schematically shows a block diagram of an electronic device suitable for implementing a method for detecting and tracking a moving object according to an embodiment of the present disclosure.
  • references to "one embodiment,” “an embodiment,” “an example,” or “example” mean that a specific feature, structure, or characteristic described in conjunction with the embodiment or example is included in the present invention In at least one embodiment. Therefore, the phrases “in one embodiment,” “in an embodiment,” “an example,” or “example” appearing in various places throughout the specification do not necessarily all refer to the same embodiment or example.
  • specific features, structures, or characteristics may be combined in one or more embodiments or examples in any suitable combination and/or sub-combination.
  • module may include a unit implemented in hardware, software, or firmware, and may be interchangeable with other terms (for example, “logic”, “logic block”, “part” or “circuit") To use.
  • a module may be a single integrated component adapted to perform one or more functions or the smallest unit or part of the single integrated component.
  • the module may be implemented in the form of an application specific integrated circuit (ASIC).
  • ASIC application specific integrated circuit
  • the embodiments of the present disclosure provide a fast and real-time moving object detection and tracking method suitable for a scene with a simple background.
  • the method includes: obtaining an image including an object by using an image acquisition device; The image is preprocessed to obtain a binarized image; the pixels in the binarized image are projected horizontally and vertically to obtain pixel projection rows and pixel projection columns projected into one row and one column, where the pixel projection row
  • the value of each pixel projection is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and the value of each pixel projection in the pixel projection column is the binarized image
  • the sum of the binarization values of all pixels on the row corresponding to the pixel projection in the pixel projection; the area of the object is determined based on the predetermined threshold and the pixel projection row and the pixel projection column; the two frames of the image are determined based on the determined area Whether the objects are the same objects to realize the detection
  • Fig. 1 schematically shows an example system architecture of a method for detecting and tracking a moving object according to an embodiment of the present disclosure.
  • the system architecture 100 may include a security inspection machine 101, a network 105, and a central processing unit 106 that can communicate with each other.
  • the security inspection machine 101 may include a conveyor belt 102 and an image capture device 104.
  • the object 103 When the object 103 is placed on the conveyor belt 102, the object 103 moves along a certain direction (for example, A shown in FIG. 1) along with the conveyor belt.
  • a certain direction for example, A shown in FIG. 1
  • the image capturing device 104 may be configured to capture an image or video in the security inspection machine 101, specifically, to capture an image or video including an object 103 moving on the conveyor belt 102.
  • the image capturing device 104 may be configured to send the captured image or video to the central processing unit 106 via the network 105 for processing by the central processing unit 106.
  • the image capturing device 104 may be a camera, a video camera, a smart phone, a tablet computer, or any device with a function of capturing images or videos.
  • the central processing unit 106 may be configured to receive an image including a moving object 103 from the image capturing device 104, and processing the received image is to detect and track the object 103.
  • the central processing unit 106 may include a processor (not shown), a memory (not shown), a communication module (not shown), and the like.
  • the processor of the central processing unit 106 may be configured to detect and track the moving object 103 based on the image received by the central processing unit 106 from the image capturing device 104.
  • the memory of the central processing unit 106 may store instructions, information, and data (for example, images or videos received from the image capturing device 106) related to the detection and tracking of moving objects.
  • the communication module in the central processing unit 106 can support the establishment of a direct (for example, wired) communication channel or a wireless communication channel (for example, via the network 105) between the central processing unit 106 and an external device (for example, the security check machine 101), and The established communication channel performs communication.
  • a direct (for example, wired) communication channel or a wireless communication channel for example, via the network 105
  • an external device for example, the security check machine 101
  • the communication module may include one or more communication processors capable of independently operating with a processor (for example, an application processor (AP)), and support wired communication and/or wireless communication.
  • the communication module may include a wireless communication module (for example, a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (for example, a local area network (LAN) communication module or Power Line Communication (PLC) module).
  • the respective one of these communication modules may be connected via a first network (for example, a short-range communication network such as Bluetooth, Wi-Fi Direct or Infrared Data Association (IrDA)) or a second network (for example, a long-distance communication network).
  • a first network for example, a short-range communication network such as Bluetooth, Wi-Fi Direct or Infrared Data Association (IrDA)
  • a second network for example, a long-distance communication network
  • a communication network such as a cellular network, the Internet, or a computer network (for example, a LAN or a wide area network (WAN)), communicates with external electronic devices.
  • These various types of communication modules may be implemented as a single component (e.g., a single chip), or these various types of communication modules may be implemented as multiple components (e.g., multiple chips) separated from each other.
  • the wireless communication module may use user information (for example, International Mobile Subscriber Identity (IMSI)) stored in the user identification module to identify and verify the electronic device in the communication network (such as the first network or the second network).
  • IMSI International Mobile Subscriber Identity
  • the central processing unit 106 may also include a display, a microphone, etc., to display or broadcast the object currently being tracked.
  • system architecture described above is a system architecture for applying this method under a security inspection machine, but those skilled in the art should understand that this is only an example for illustrative purposes, and the method of the present disclosure can be applied to various scenarios with relatively simple backgrounds. middle.
  • Fig. 2 schematically shows a flowchart of a method for detecting and tracking a moving object according to an embodiment of the present disclosure.
  • the method includes the following operations.
  • the image capture device 104 takes a picture or takes a video of the space in the security inspection machine to obtain an image including the object 103 moving on the conveyor belt.
  • the central processing unit 106 preprocesses the image collected by the image collecting device 104 to obtain a binarized image.
  • the preprocessing may be grayscale and binarization processing. After processing, the gray level of the pixel where the background is located is 0, and the gray level of the pixel with the object is 255.
  • the central processing unit 106 performs horizontal projection and vertical projection on the pixels in the binarized image to obtain pixel projection rows projected in one row and one column.
  • Fig. 3 schematically shows a diagram of obtaining pixel projection rows and pixel projection columns by horizontal projection and vertical projection of pixels in a binarized image according to an embodiment of the present disclosure.
  • each pixel projection in the pixel projection row is the sum of the pixel values on the column corresponding to the pixel projection in the binarized image.
  • the pixel projection columns arranged in one column are obtained.
  • the value of each pixel projection in the pixel projection column is the sum of the pixel values on the row corresponding to the pixel projection in the binarized image.
  • the pixel with a pixel value of 1 is projected to the second pixel in the pixel projection row Projection 1.
  • the central processing unit 106 determines the area of the object 103 based on a predetermined threshold and pixel projection rows and pixel projection columns.
  • pixel projections larger than a predetermined threshold are filtered out from pixel projection rows and pixel projection columns based on a predetermined threshold, and the area of the object is determined based on the filtered pixel projections.
  • the horizontal boundary of the area of the object is determined according to the pixel projections at the horizontal ends of the filtered pixel projections; the horizontal boundary of the area of the object is determined according to the pixel projections at the vertical ends of the filtered pixel projections.
  • the vertical boundary; and based on the horizontal boundary and the vertical boundary, the area of the object is determined.
  • Fig. 4 schematically shows a diagram of filtering out pixel projections larger than a predetermined threshold from a pixel projection row and a pixel projection column based on a predetermined threshold according to an embodiment of the present disclosure.
  • the predetermined threshold is 2
  • the pixel projections larger than the predetermined threshold can be filtered out.
  • the pixels larger than the predetermined threshold selected from the pixel projection row are projected into the pixel projection row from the 6th pixel counted from left to right to the 12th pixel projection, from the pixel projection.
  • the pixel projections selected in the column that are larger than the predetermined threshold are the fourth pixel projection and the ninth projection pixel counted from the top to the bottom in the pixel projection column.
  • the horizontal boundary lines A and A'and the vertical boundary lines B and B' can be obtained.
  • the area defined by the horizontal boundary lines A and A'and the vertical boundary lines B and B' is the object's area.
  • the object 103 moves horizontally in the security inspection machine along with the conveyor belt.
  • the first determined vertical boundary may be stored in the memory, so that the vertical boundary may be directly applied to the binarized image of the subsequent image when the subsequent image is processed.
  • the object when it only moves in the vertical direction but does not move in the horizontal direction, it is only necessary to determine the horizontal boundary of the object when it is first determined.
  • the first determined horizontal boundary can be stored in the memory, so that the horizontal boundary can be directly applied to the binarized image of the subsequent image when the subsequent image is processed.
  • the area of the object can be determined in each image. At this time, by comparing the area of the object in the image, it can be determined whether the object in the two images before and after is the same object.
  • it can also be used to determine whether a new object appears in the image.
  • the moving distance of the object between the two frames before and after can be determined based on the regions of the images in the two frames before and after.
  • Fig. 5 schematically shows a flowchart of determining the moving distance of an object in two frames before and after according to an embodiment of the present disclosure.
  • the method includes the following operations.
  • the pixel projection row in the previous frame of image is moved along the horizontal direction with one pixel as the step size.
  • j represents the jth movement
  • the value of w is the number of pixel projections in the pixel projection row-1
  • a p+j (1, i) represents the pixel projection row in the previous frame of the image after the jth movement
  • the i-th pixel projection of A c (1,i) represents the i-th pixel in the pixel projection row of the next frame of image.
  • the smallest state value is selected from these state values as the horizontal movement distance of the object between the previous and next two frames of images.
  • the method of determining the distance of the object's vertical movement is the same as the method of determining the distance of the object's horizontal movement, which will not be described in detail here.
  • FIG. 6 schematically shows a block diagram of a mobile object detection and tracking device 1000 according to an embodiment of the present disclosure.
  • the moving object detection and tracking device 1000 may include an image acquisition device 1001, a preprocessing unit 1002, a pixel projection unit 1003, an area determination unit 1004, and a determination unit 1005.
  • the image acquisition device 1001 may be configured to obtain an image including the object.
  • the preprocessing unit 1002 may be configured to preprocess the image to obtain a binarized image.
  • the pixel projection unit may be configured to perform horizontal projection and vertical projection on the pixels in the binarized image to obtain pixel projection rows and pixel projection columns projected in one row and one column.
  • each pixel projection in the pixel projection row is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image
  • each pixel in the pixel projection column is projected
  • the value of is the sum of the binarized values of all pixels on the row corresponding to the pixel projection in the binarized image.
  • the area determination unit 1004 may be configured to determine the area of the object based on a predetermined threshold and pixel projection rows and pixel projection columns.
  • the determining unit 1005 may be configured to determine whether the objects in the two frames of images before and after are the same object based on the determined area, so as to realize the detection and tracking of the moving object.
  • the moving object detection and tracking device 1000 may also include other modules for correspondingly performing the above various operations.
  • a unit or module according to an embodiment of the present disclosure may be implemented in one unit or module.
  • One unit or module according to an embodiment of the present disclosure may be split into a plurality of units or modules to be implemented.
  • a unit or module according to an embodiment of the present disclosure may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, Application-specific integrated circuit (ASIC), or it can be implemented by hardware or firmware in any other reasonable way that integrates or encapsulates the circuit, or by software, hardware, and firmware in any of three ways or in any of them The appropriate combination of to achieve.
  • the modules according to the embodiments of the present disclosure may be at least partially implemented as computer program modules, and when the computer program modules are executed, corresponding functions may be performed.
  • At least one of the above-mentioned units or modules may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate , Packaged system, application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any of the three implementation methods of software, hardware and firmware Or it can be realized by any suitable combination of them.
  • FPGA field programmable gate array
  • PLA programmable logic array
  • ASIC application specific integrated circuit
  • at least one of the above-mentioned modules may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
  • Fig. 7 schematically shows a block diagram of an electronic device suitable for implementing a method for detecting and tracking a moving object according to an embodiment of the present disclosure.
  • the electronic device shown in FIG. 7 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • an electronic device 700 includes a processor 701, which can be loaded into a random access memory (RAM) 703 according to a program stored in a read only memory (ROM) 702 or from a storage part 708 The program executes various appropriate actions and processing.
  • the processor 701 may include, for example, a general-purpose microprocessor (for example, a CPU), an instruction set processor and/or a related chipset and/or a special purpose microprocessor (for example, an application specific integrated circuit (ASIC)), and so on.
  • the processor 701 may also include on-board memory for caching purposes.
  • the processor 701 may include a single processing unit or multiple processing units for performing different actions of a method flow according to an embodiment of the present disclosure.
  • the processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704.
  • the processor 701 executes various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703.
  • the processor 701 may also execute various operations of the method flow according to the embodiments of the present disclosure by executing programs stored in the one or more memories.
  • the electronic device 700 may further include an input/output (I/O) interface 705, and the input/output (I/O) interface 705 is also connected to the bus 704.
  • the electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input part 706 including a keyboard, a mouse, etc.; including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and The output section 707 of a speaker and the like; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, and the like.
  • the communication section 709 performs communication processing via a network such as the Internet.
  • the driver 810 is also connected to the I/O interface 705 as needed.
  • a removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as required, so that the computer program read therefrom is installed into the storage section 708 as required.
  • the method flow according to the embodiment of the present disclosure may be implemented as a computer software program.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication part 709, and/or installed from the removable medium 811.
  • the computer program executes the above-mentioned functions defined in the system of the embodiment of the present disclosure.
  • the systems, devices, devices, modules, units, etc. described above may be implemented by computer program modules.
  • the present disclosure also provides a computer-readable storage medium.
  • the computer-readable storage medium may be included in the device/device/system described in the above embodiment; or it may exist alone without being assembled into the device/ In the device/system.
  • the aforementioned computer-readable storage medium carries one or more programs, and when the aforementioned one or more programs are executed, the method according to the embodiments of the present disclosure is implemented.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but not limited to: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM) , Erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable storage medium may include one or more memories other than the ROM 702 and/or RAM 703 and/or ROM 702 and RAM 703 described above.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more for realizing the specified logic function.
  • Executable instructions may also occur in a different order from the order marked in the drawings. For example, two blocks shown one after another can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by It is realized by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

Provided in the present disclosure is a method for detecting and tracking a moving object. The method comprises: using an image acquisition apparatus to obtain an image comprising an object; pre-processing the image to obtain a binarized image; performing horizontal projection and vertical projection on pixels in the binarized image to obtain a pixel projection row and a pixel projection column as the pixels are projected into a row and a column; on the basis of a predetermined threshold value, the pixel projection row and the pixel projection column, determining the area of the object; and on the basis of the determined area, determining whether objects in two consecutive frames of an image are the same object, so as to realize the detection and tracking of a moving object. Further provided in the present disclosure are an apparatus for detecting and tracking a moving object, an electronic device, and a non-transitory computer-readable medium.

Description

移动物体检测和跟踪方法以及装置Method and device for detecting and tracking moving objects 技术领域Technical field
本公开涉及图像处理领域,并且更具体地涉及一种移动物体检测和跟踪方法、一种移动物体检测和跟踪装置、一种电子设备以及一种计算机可读存储介质。The present disclosure relates to the field of image processing, and more specifically to a method for detecting and tracking a moving object, a device for detecting and tracking a moving object, an electronic device, and a computer-readable storage medium.
背景技术Background technique
移动物体检测和跟踪是计算机视觉领域的热门问题,广泛应用于视频监控、人机交互、虚拟现实和图像压缩等领域。Moving object detection and tracking are hot issues in the field of computer vision, which are widely used in video surveillance, human-computer interaction, virtual reality and image compression.
近年来随着硬件技术的不断发展和分析技术的不断拓展,对移动物体的图像的处理与分析日益受到重视,特别是在高帧率视频当中,如何快速准确地对移动物体进行检测和跟踪成为一个重要的研究课题。In recent years, with the continuous development of hardware technology and the continuous expansion of analysis technology, the image processing and analysis of moving objects has been paid more and more attention, especially in the high frame rate video, how to quickly and accurately detect and track moving objects has become An important research topic.
在移动物体检测方面,目前常用的三种方法为光流法、帧差法、背景相减法。光流法在检测和跟踪移动物体方面效果较好,但是其缺点在于计算量大、耗时较长、占用资源较大,不适合快速、实时跟踪的场景。帧差法和背景相减法虽然计算量较小、耗时较短,但是检测效果随着背景复杂程度的提升而大幅降低。In terms of moving object detection, the three commonly used methods are optical flow method, frame difference method, and background subtraction method. The optical flow method is effective in detecting and tracking moving objects, but its shortcomings are large amount of calculation, long time-consuming, and large resource occupation, which is not suitable for fast, real-time tracking scenes. Although the frame difference method and the background subtraction method are less computationally intensive and time-consuming, the detection effect is greatly reduced as the complexity of the background increases.
因此,需要一种适用于背景较为简单的、能够快速实时地检测和跟踪移动物体的方法。Therefore, there is a need for a method that is suitable for a relatively simple background and can quickly detect and track moving objects in real time.
发明内容Summary of the invention
为了解决上述技术问题,在本公开的第一方面中,提供了一种移动物体检测和跟踪方法,所述方法可以包括:利用图像采集装置获得包括所述物体的图像;对所述图像进行预处理以获得二值化图像;对所述二值化图像中的像素进行水平投影和竖直投影以获得投影成一行和一列的像素投影行和像素投影列,其中,所述像素投影行中的每一个像素投影的值为所述二值化图像中的与该像素投影相对应的列上的所有像素的二值化值之和,并且所述像素投影列中的每一个像素投影 的值为所述二值化图像中的与该像素投影相对应的行上的所有像素的二值化值之和;基于预定阈值和所述像素投影行以及所述像素投影列来确定所述物体的区域;以及基于所确定的区域确定前后两帧图像中的物体是否为相同物体,以实现移动物体的检测和跟踪。In order to solve the above technical problems, in the first aspect of the present disclosure, a method for detecting and tracking a moving object is provided. The method may include: obtaining an image including the object using an image acquisition device; and preprocessing the image. Processing to obtain a binarized image; horizontal projection and vertical projection are performed on the pixels in the binarized image to obtain pixel projection rows and pixel projection columns projected into one row and one column, wherein the pixels in the pixel projection row The value of each pixel projection is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and the value of each pixel projection in the pixel projection column is The sum of the binarized values of all pixels on the row corresponding to the pixel projection in the binarized image; the area of the object is determined based on a predetermined threshold and the pixel projection row and the pixel projection column ; And based on the determined area to determine whether the objects in the two images before and after are the same object, so as to realize the detection and tracking of the moving object.
根据第一方面,其中,对所述图像进行预处理以获得二值化图像可以包括:对所述图像进行灰度化和二值化处理,以获得所述二值化图像。According to the first aspect, wherein preprocessing the image to obtain a binarized image may include: performing grayscale and binarization processing on the image to obtain the binarized image.
根据第一方面,其中,基于预定阈值和所述像素投影行以及所述像素投影列来确定所述物体的区域可以包括:基于所述预定阈值从所述像素投影行和所述像素投影列中筛选出大于所述预定阈值的像素投影;以及基于所筛选出的像素投影,来确定所述物体的区域。According to the first aspect, wherein determining the area of the object based on a predetermined threshold and the pixel projection row and the pixel projection column may include: from the pixel projection row and the pixel projection column based on the predetermined threshold Filtering out pixel projections larger than the predetermined threshold; and determining the area of the object based on the filtered pixel projections.
根据第一方面,其中,基于所筛选出的像素投影来确定所述物体的区域可以包括:根据所筛选出的像素投影中的处于水平两端的像素投影,确定所述物体的区域的水平边界;根据所筛选出的像素投影中的处于竖直两端的像素投影,确定所述物体的区域的竖直边界;以及基于所述水平边界和所述竖直边界,确定所述物体的区域。According to the first aspect, wherein determining the area of the object based on the filtered pixel projections may include: determining the horizontal boundary of the area of the object according to the pixel projections at the horizontal ends of the filtered pixel projections; Determine the vertical boundary of the area of the object according to the pixel projections at the vertical ends of the filtered pixel projections; and determine the area of the object based on the horizontal boundary and the vertical boundary.
根据第一方面,其中,在所述物体仅水平移动的情况下,仅确定一次所述竖直边界,并且将所确定的所述竖直边界直接投影到后续图像中,以在后续图像中形成物体的区域的竖直边界。According to the first aspect, wherein, in the case where the object moves only horizontally, the vertical boundary is determined only once, and the determined vertical boundary is directly projected into a subsequent image to form a subsequent image The vertical boundary of the object's area.
根据第一方面,其中,在所述物体仅竖直移动的情况下,仅确定一次所述水平边界,并且将所确定的所述水平边界直接投影到后续图像中,以在后续图像中形成物体的区域的水平边界。According to the first aspect, wherein, in the case that the object only moves vertically, the horizontal boundary is determined only once, and the determined horizontal boundary is directly projected into a subsequent image to form the object in the subsequent image The horizontal boundary of the area.
根据第一方面,所述方法还可以包括:在确定前后两帧图像中的物体为相同物体的情况下,基于前后两帧图像中的物体的区域确定物体的移动距离。According to the first aspect, the method may further include: determining the movement distance of the object based on the area of the object in the two images before and after the object is determined to be the same object in the two images before and after.
根据第一方面,基于前后两帧图像中的物体的区域确定物体的移动距离可以包括:确定物体的水平移动距离,包括:以一个像素为步长将前一帧图像中的像素投影行沿着水平方向移动;在每一次水平移动之后,确定移动后的前一帧图像中的像素投影行与后一帧图像中的像素投影行之间的状态值:以及将针对多次水平移动而计算的多个状 态值之中的最小状态值确定为前后两帧图像之间的物体水平移动的距离;以及确定物体的竖直移动距离,其中确定物体的竖直移动的距离的方法与确定物体的水平移动的距离的方法相同。According to the first aspect, determining the moving distance of the object based on the area of the object in the two frames of images before and after may include: determining the horizontal moving distance of the object, including: projecting the pixels in the previous frame of image along the line with one pixel as the step length Horizontal movement; after each horizontal movement, determine the state value between the pixel projection line in the previous frame image and the pixel projection line in the next frame image after the movement: and the state value that will be calculated for multiple horizontal movements The smallest state value among the plurality of state values is determined as the distance of the horizontal movement of the object between the previous and next two frames of images; and the vertical movement distance of the object is determined, wherein the method of determining the vertical movement distance of the object is the same as that of determining the level of the object The method of moving distance is the same.
根据第一方面,所述确定移动后的前一帧图像中的像素投影行与后一帧图像中的像素投影行之间的状态值可以包括:利用下列公式确定状态值:According to the first aspect, the determining the state value between the pixel projection line in the previous frame image and the pixel projection line in the subsequent frame image after the movement may include: determining the state value by using the following formula:
Figure PCTCN2021077624-appb-000001
Figure PCTCN2021077624-appb-000001
其中,H表示状态值,j表示第j次移动,w的值为像素投影行中的像素投影数量-1,A p表示前一帧图像,A p+j(1,i)表示第j次移动后的前一帧图像中的像素投影行中的第i个像素投影,A c表示后一帧图像,A c(1,i)表示后一帧图像中的像素投影行中的第i个像素投影。 Among them, H represents the state value, j represents the jth movement, the value of w is the number of pixel projections in the pixel projection row -1, Ap represents the previous frame of image, and Ap+j (1,i) represents the jth time The i-th pixel projection in the pixel projection line in the previous frame of the image after the movement, A c represents the image of the next frame, and A c (1,i) represents the i-th pixel projection in the pixel projection line in the next frame of image Pixel projection.
在本公开的第二方面中,提供了一种移动物体检测和跟踪装置,包括:图像采集装置,被配置为获得包括所述物体的图像;预处理单元,被配置为对所述图像进行预处理以获得二值化图像;像素投影单元,被配置为对所述二值化图像中的像素进行水平投影和竖直投影以获得投影成一行和一列的像素投影行和像素投影列,其中,所述像素投影行中的每一个像素投影的值为所述二值化图像中的与该像素投影相对应的列上的所有像素的二值化值之和,并且所述像素投影列中的每一个像素投影的值为所述二值化图像中的与该像素投影相对应的行上的所有像素的二值化值之和;区域确定单元,被配置为基于预定阈值和所述像素投影行以及所述像素投影列来确定所述物体的区域;以及判定单元,被配置为基于所确定的区域来判定前后两帧图像中的物体是否为相同物体,以实现移动物体的检测和跟踪。In a second aspect of the present disclosure, there is provided a moving object detection and tracking device, including: an image acquisition device configured to obtain an image including the object; a preprocessing unit configured to pre-process the image Processing to obtain a binarized image; the pixel projection unit is configured to perform horizontal projection and vertical projection on the pixels in the binarized image to obtain pixel projection rows and pixel projection columns projected into one row and one column, wherein, The value of each pixel projection in the pixel projection row is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and the pixel projection column The value of each pixel projection is the sum of the binarized values of all pixels on the row corresponding to the pixel projection in the binarized image; the area determining unit is configured to be based on a predetermined threshold and the pixel projection The rows and the pixel projection columns determine the area of the object; and the determination unit is configured to determine whether the objects in the two frames of images before and after are the same object based on the determined area, so as to realize the detection and tracking of the moving object.
在本公开的第三方面中,提供了一种电子设备,包括:一个或多个处理器;以及存储器,用于存储一个或多个程序,其中,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现根据第一方面所述的方法。In a third aspect of the present disclosure, there is provided an electronic device including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are described When executed by one or more processors, the one or more processors implement the method according to the first aspect.
在本公开的第四方面中,提供了一种计算机可读存储介质,其上存储有可执行指令,该指令被处理器执行时使处理器实现根据第一方面所述的方法。In a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having executable instructions stored thereon, and when the instructions are executed by a processor, the processor implements the method according to the first aspect.
本文发明的移动物体检测及跟踪方法利用投影法。投影法运算量小且快速简单。本文发明的方法适用于背景较为简单、需要实时快速地检测及跟踪、且计算资源有限的场景。The moving object detection and tracking method invented in this paper uses the projection method. The projection method has a small amount of calculation and is fast and simple. The method in this paper is suitable for scenarios with a relatively simple background, fast detection and tracking in real time, and limited computing resources.
本公开利用图像处理技术中的投影算法对图像/视频数据中的移动物体进行检测和跟踪。由此,可以将图像/视频数据更方便的应用到后续智能检测、人工监控等场景中。The present disclosure uses projection algorithms in image processing technology to detect and track moving objects in image/video data. As a result, image/video data can be more conveniently applied to scenarios such as subsequent intelligent detection and manual monitoring.
附图说明Description of the drawings
通过参考附图详细描述本公开的实施例,本公开的上述和其它实施例和特征将变得更清楚,在附图中:The above-mentioned and other embodiments and features of the present disclosure will become clearer by describing the embodiments of the present disclosure in detail with reference to the accompanying drawings. In the accompanying drawings:
图1示意性示出了根据本公开实施例的移动物体检测和跟踪方法的***架构;Fig. 1 schematically shows a system architecture of a method for detecting and tracking a moving object according to an embodiment of the present disclosure;
图2示意性示出了根据本公开实施例的移动物体检测和跟踪方法的流程图;Fig. 2 schematically shows a flow chart of a method for detecting and tracking a moving object according to an embodiment of the present disclosure;
图3示意性示出了根据本公开实施例的对二值化图像中的像素进行水平投影和竖直投影而获得像素投影行和像素投影列的图;Fig. 3 schematically shows a diagram of obtaining pixel projection rows and pixel projection columns by horizontal projection and vertical projection of pixels in a binarized image according to an embodiment of the present disclosure;
图4示意性示出了根据本公开实施例的基于预定阈值从像素投影行和像素投影列中筛选出大于预定阈值的像素投影的图;Fig. 4 schematically shows a diagram of filtering out pixel projections larger than a predetermined threshold from pixel projection rows and pixel projection columns based on a predetermined threshold according to an embodiment of the present disclosure;
图5示意性示出了根据本公开实施例的确定前后两帧中物体的移动距离的流程图;Fig. 5 schematically shows a flow chart of determining the moving distance of an object in two frames before and after according to an embodiment of the present disclosure;
图6示意性示出了根据本公开实施例的移动物体检测和跟踪装置的框图;以及Fig. 6 schematically shows a block diagram of a mobile object detection and tracking device according to an embodiment of the present disclosure; and
图7示意性示出了根据本公开实施例的适于实现移动物体检测和跟踪方法的电子设备的框图。Fig. 7 schematically shows a block diagram of an electronic device suitable for implementing a method for detecting and tracking a moving object according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将详细描述本发明的具体实施例,应当注意,这里描述的实施例只用于举例说明,并不用于限制本发明。在以下描述中,为了提供对本发明的透彻理解,阐述了大量特定细节。然而,对于本领域普通技术人员显而易见的是:不必采用这些特定细节来实行本发明。在 其他实例中,为了避免混淆本发明,未具体描述公知的电路、材料或方法。Specific embodiments of the present invention will be described in detail below. It should be noted that the embodiments described here are only used for exemplification and are not used to limit the present invention. In the following description, in order to provide a thorough understanding of the present invention, numerous specific details are set forth. However, it is obvious to a person of ordinary skill in the art that it is not necessary to adopt these specific details to implement the present invention. In other instances, in order to avoid obscuring the present invention, well-known circuits, materials, or methods are not specifically described.
在整个说明书中,对“一个实施例”、“实施例”、“一个示例”或“示例”的提及意味着:结合该实施例或示例描述的特定特征、结构或特性被包含在本发明至少一个实施例中。因此,在整个说明书的各个地方出现的短语“在一个实施例中”、“在实施例中”、“一个示例”或“示例”不一定都指同一实施例或示例。此外,可以以任何适当的组合和/或子组合将特定的特征、结构或特性组合在一个或多个实施例或示例中。Throughout the specification, references to "one embodiment," "an embodiment," "an example," or "example" mean that a specific feature, structure, or characteristic described in conjunction with the embodiment or example is included in the present invention In at least one embodiment. Therefore, the phrases "in one embodiment," "in an embodiment," "an example," or "example" appearing in various places throughout the specification do not necessarily all refer to the same embodiment or example. In addition, specific features, structures, or characteristics may be combined in one or more embodiments or examples in any suitable combination and/or sub-combination.
应当理解,当称元件“耦接到”或“连接到”另一元件时,它可以是直接耦接或连接到另一元件或者可以存在中间元件。相反,当称元件“直接耦接到”或“直接连接到”另一元件时,不存在中间元件。It should be understood that when an element is referred to as being "coupled" or "connected to" another element, it can be directly coupled or connected to the other element or intervening elements may be present. In contrast, when an element is referred to as being "directly coupled to" or "directly connected to" another element, there are no intervening elements.
此外,这里使用的术语“和/或”包括一个或多个相关列出的项目的任何和所有组合。In addition, the term "and/or" as used herein includes any and all combinations of one or more of the related listed items.
将理解的是,与术语相应的单数形式的名词可包括一个或更多个事物,除非相关上下文另有明确指示。如这里所使用的,诸如“A或B”、“A和B中的至少一个”、“A或B中的至少一个”、“A、B或C”、“A、B和C中的至少一个”以及“A、B或C中的至少一个”的短语中的每一个短语可包括在与所述多个短语中的相应一个短语中一起列举出的项的所有可能组合。如这里所使用的,诸如“第1”和“第2”或者“第一”和“第二”的术语可用于将相应部件与另一部件进行简单区分,并且不在其它方面(例如,重要性或顺序)限制所述部件。It will be understood that a noun in the singular form corresponding to a term may include one or more things, unless the relevant context clearly indicates otherwise. As used herein, such as "A or B", "at least one of A and B", "at least one of A or B", "A, B or C", "at least one of A, B and C" Each of the phrases of "a" and "at least one of A, B, or C" may include all possible combinations of items listed together with the corresponding one of the plurality of phrases. As used herein, terms such as "first" and "second" or "first" and "second" can be used to simply distinguish a corresponding component from another component and not in other respects (for example, importance Or order) to limit the components.
如这里所使用的,术语“模块”可包括以硬件、软件或固件实现的单元,并可与其他术语(例如,“逻辑”、“逻辑块”、“部分”或“电路”)可互换地使用。模块可以是被适配为执行一个或更多个功能的单个集成部件或者是该单个集成部件的最小单元或部分。例如,根据实施例,可以以专用集成电路(ASIC)的形式来实现模块。As used herein, the term "module" may include a unit implemented in hardware, software, or firmware, and may be interchangeable with other terms (for example, "logic", "logic block", "part" or "circuit") To use. A module may be a single integrated component adapted to perform one or more functions or the smallest unit or part of the single integrated component. For example, according to the embodiment, the module may be implemented in the form of an application specific integrated circuit (ASIC).
应该理解的是,本公开的各种实施例以及其中使用的术语并不意图将在此阐述的技术特征限制于具体实施例,而是包括针对相应实施例的各种改变、等同形式或替换形式。除非本文另有明确定义,否则 所有术语将给出其最广泛的可能解释,包括说明书中暗示的含义以及本领域技术人员理解的和/或字典、论文等中定义的含义。It should be understood that the various embodiments of the present disclosure and the terms used therein are not intended to limit the technical features set forth herein to specific embodiments, but include various changes, equivalents, or alternatives to the corresponding embodiments. . Unless explicitly defined otherwise herein, all terms will give their broadest possible interpretations, including meanings implied in the specification and meanings understood by those skilled in the art and/or defined in dictionaries, papers, etc.
此外,本领域普通技术人员应当理解,在此提供的附图都是为了说明的目的,并且附图不一定是按比例绘制的。对于附图的描述,相似的参考标号可用来指代相似或相关的元件。以下将参考附图对本公开进行示例性描述。In addition, those of ordinary skill in the art should understand that the drawings provided herein are for illustrative purposes, and the drawings are not necessarily drawn to scale. For the description of the drawings, similar reference numerals may be used to refer to similar or related elements. Hereinafter, the present disclosure will be exemplarily described with reference to the accompanying drawings.
为了解决如上所述的问题,本公开的实施例提供了一种适用于背景较简单的场景的且快速实时的移动物体检测和跟踪方法,该方法包括:利用图像采集装置获得包括物体的图像;对图像进行预处理以获得二值化图像;对二值化图像中的像素进行水平投影和竖直投影以获得投影成一行和一列的像素投影行和像素投影列,其中,像素投影行中的每一个像素投影的值为二值化图像中的与该像素投影相对应的列上的所有像素的二值化值之和,并且像素投影列中的每一个像素投影的值为二值化图像中的与该像素投影相对应的行上的所有像素的二值化值之和;基于预定阈值和像素投影行以及像素投影列来确定物体的区域;基于所确定的区域确定前后两帧图像中的物体是否为相同物体,以实现移动物体的检测和跟踪。In order to solve the above-mentioned problems, the embodiments of the present disclosure provide a fast and real-time moving object detection and tracking method suitable for a scene with a simple background. The method includes: obtaining an image including an object by using an image acquisition device; The image is preprocessed to obtain a binarized image; the pixels in the binarized image are projected horizontally and vertically to obtain pixel projection rows and pixel projection columns projected into one row and one column, where the pixel projection row The value of each pixel projection is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and the value of each pixel projection in the pixel projection column is the binarized image The sum of the binarization values of all pixels on the row corresponding to the pixel projection in the pixel projection; the area of the object is determined based on the predetermined threshold and the pixel projection row and the pixel projection column; the two frames of the image are determined based on the determined area Whether the objects are the same objects to realize the detection and tracking of moving objects.
以下将参考附图并结合具体实施例详细阐述本公开。Hereinafter, the present disclosure will be described in detail with reference to the accompanying drawings and in conjunction with specific embodiments.
图1示意性地示出了根据本公开实施例的移动物体检测和跟踪方法的示例***架构。该***架构100可以包括彼此之间能够通信的安检机101、网络105以及中央处理单元106。Fig. 1 schematically shows an example system architecture of a method for detecting and tracking a moving object according to an embodiment of the present disclosure. The system architecture 100 may include a security inspection machine 101, a network 105, and a central processing unit 106 that can communicate with each other.
安检机101可以包括传送带102和图像捕获装置104。The security inspection machine 101 may include a conveyor belt 102 and an image capture device 104.
当物体103置于传送带102上时,物体103随着传送带沿着某一方向(例如,图1中所示的A)移动。When the object 103 is placed on the conveyor belt 102, the object 103 moves along a certain direction (for example, A shown in FIG. 1) along with the conveyor belt.
图像捕获装置104可以被配置为捕获安检机101中的图像或视频,具体地,被配置为捕获包括在传送带102上移动的物体103的图像或视频。The image capturing device 104 may be configured to capture an image or video in the security inspection machine 101, specifically, to capture an image or video including an object 103 moving on the conveyor belt 102.
图像捕获装置104可以被配置为经由网络105将所捕获的图像或视频发送到中央处理单元106,以供中央处理单元106进行处理。The image capturing device 104 may be configured to send the captured image or video to the central processing unit 106 via the network 105 for processing by the central processing unit 106.
在一个示例中,图像捕获装置104可以是相机、摄像机、智能手 机、平板电脑、或具有捕获图像或者视频功能的任何设备。In an example, the image capturing device 104 may be a camera, a video camera, a smart phone, a tablet computer, or any device with a function of capturing images or videos.
中央处理单元106可以被配置为从图像捕获装置104接收包括正在移动的物体103在内的图像,对接收的图像进行处理是检测和跟踪物体103。The central processing unit 106 may be configured to receive an image including a moving object 103 from the image capturing device 104, and processing the received image is to detect and track the object 103.
将在下文详细讨论中央处理单元106检测和跟踪移动的物体103的详细操作。The detailed operation of the central processing unit 106 to detect and track the moving object 103 will be discussed in detail below.
中央处理单元106可以包括处理器(未示出)、存储器(未示出)、通信模块(未示出)等。The central processing unit 106 may include a processor (not shown), a memory (not shown), a communication module (not shown), and the like.
中央处理单元106的处理器可以被配置为:基于中央处理单元106从图像捕获装置104接收的图像,检测和跟踪移动的物体103。The processor of the central processing unit 106 may be configured to detect and track the moving object 103 based on the image received by the central processing unit 106 from the image capturing device 104.
中央处理单元106的存储器可以存储与用于检测和跟踪移动的物体有关的指令、信息和数据(例如,从图像捕获装置106接收的图像或视频)。The memory of the central processing unit 106 may store instructions, information, and data (for example, images or videos received from the image capturing device 106) related to the detection and tracking of moving objects.
中央处理单元106中的通信模块可以支持在中央处理单元106与外部装置(例如,安检机101)之间建立直接(例如,有线)通信信道或无线通信信道(例如,经由网络105),并经由建立的通信信道执行通信。The communication module in the central processing unit 106 can support the establishment of a direct (for example, wired) communication channel or a wireless communication channel (for example, via the network 105) between the central processing unit 106 and an external device (for example, the security check machine 101), and The established communication channel performs communication.
通信模块可以包括能够与处理器(例如,应用处理器(AP))独立操作的一个或更多个通信处理器,并支持有线通信和/或无线通信。根据本公开实施例,通信模块可以包括无线通信模块(例如,蜂窝通信模块、短距离无线通信模块或全球导航卫星***(GNSS)通信模块)或有线通信模块(例如,局域网(LAN)通信模块或电力线通信(PLC)模块)。这些通信模块中的相应一个可经由第一网络(例如,短距离通信网络,诸如蓝牙、无线保真(Wi-Fi)直连或红外数据协会(IrDA))或第二网络(例如,长距离通信网络,诸如蜂窝网络、互联网、或计算机网络(例如,LAN或广域网(WAN)))与外部电子装置进行通信。可将这些各种类型的通信模块实现为单个部件(例如,单个芯片),或可将这些各种类型的通信模块实现为彼此分离的多个部件(例如,多个芯片)。无线通信模块可使用存储在用户识别模块中的用户信息(例如,国际移动用户识别码(IMSI))识别并验证通信网 络(诸如第一网络或第二网络)中的电子装置。The communication module may include one or more communication processors capable of independently operating with a processor (for example, an application processor (AP)), and support wired communication and/or wireless communication. According to an embodiment of the present disclosure, the communication module may include a wireless communication module (for example, a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (for example, a local area network (LAN) communication module or Power Line Communication (PLC) module). The respective one of these communication modules may be connected via a first network (for example, a short-range communication network such as Bluetooth, Wi-Fi Direct or Infrared Data Association (IrDA)) or a second network (for example, a long-distance communication network). A communication network, such as a cellular network, the Internet, or a computer network (for example, a LAN or a wide area network (WAN)), communicates with external electronic devices. These various types of communication modules may be implemented as a single component (e.g., a single chip), or these various types of communication modules may be implemented as multiple components (e.g., multiple chips) separated from each other. The wireless communication module may use user information (for example, International Mobile Subscriber Identity (IMSI)) stored in the user identification module to identify and verify the electronic device in the communication network (such as the first network or the second network).
此外,中央处理单元106还可以包括显示器、麦克风等,以用于显示或播报当前正在跟踪的物体。In addition, the central processing unit 106 may also include a display, a microphone, etc., to display or broadcast the object currently being tracked.
以上所描述的***架构为在安检机下应用本方法的***架构,但是本领域技术人员应当理解,这仅是用于说明目的的示例,本公开的方法可以应用于各种背景较简单的场景中。The system architecture described above is a system architecture for applying this method under a security inspection machine, but those skilled in the art should understand that this is only an example for illustrative purposes, and the method of the present disclosure can be applied to various scenarios with relatively simple backgrounds. middle.
图2示意性示出了根据本公开实施例的移动物体检测和跟踪方法的流程图。Fig. 2 schematically shows a flowchart of a method for detecting and tracking a moving object according to an embodiment of the present disclosure.
如图2所示,该方法包括如下操作。As shown in Figure 2, the method includes the following operations.
在操作S201中,图像采集装置104对在安检机内的空间进行拍照或者拍摄视频,以获得包括在传送带上移动的物体103在内的图像。In operation S201, the image capture device 104 takes a picture or takes a video of the space in the security inspection machine to obtain an image including the object 103 moving on the conveyor belt.
在操作S203中,中央处理单元106对图像采集装置104采集的图像进行预处理,以获得二值化图像。In operation S203, the central processing unit 106 preprocesses the image collected by the image collecting device 104 to obtain a binarized image.
在示例性实施例中,预处理可以是灰度化和二值化处理。处理后,背景所在像素的灰度为0,有物体的像素灰度为255。In an exemplary embodiment, the preprocessing may be grayscale and binarization processing. After processing, the gray level of the pixel where the background is located is 0, and the gray level of the pixel with the object is 255.
在操作S205中,中央处理单元106对二值化图像中的像素进行水平投影和竖直投影,以获得投影成一行和一列的像素投影行。In operation S205, the central processing unit 106 performs horizontal projection and vertical projection on the pixels in the binarized image to obtain pixel projection rows projected in one row and one column.
图3示意性示出了根据本公开实施例的对二值化图像中的像素进行水平投影和竖直投影而获得像素投影行和像素投影列的图。Fig. 3 schematically shows a diagram of obtaining pixel projection rows and pixel projection columns by horizontal projection and vertical projection of pixels in a binarized image according to an embodiment of the present disclosure.
参考图3,二值化图像进行水平投影时获得被布置成一行的像素投影行。其中,像素投影行中的每个像素投影的值为二值化图像中的与该像素投影相对应的列上的像素值之和。Referring to FIG. 3, when the binarized image is horizontally projected, a projection row of pixels arranged in a row is obtained. Wherein, the value of each pixel projection in the pixel projection row is the sum of the pixel values on the column corresponding to the pixel projection in the binarized image.
例如,对于二值化图像中的第二列像素,其中包括两个值为1的像素,则进行水平投影时,这两个像素值为1的像素点投影到像素投影行中的第二像素投影2。For example, for the second column of pixels in the binarized image, which includes two pixels with a value of 1, when performing horizontal projection, these two pixels with a pixel value of 1 are projected to the second pixel in the pixel projection row Projection 2.
二值化图像进行竖直投影时获得被布置成一列的像素投影列。其中,像素投影列中的每个像素投影的值为二值化图像中的与该像素投影相对应的行上的像素值之和。When the binarized image is vertically projected, the pixel projection columns arranged in one column are obtained. Wherein, the value of each pixel projection in the pixel projection column is the sum of the pixel values on the row corresponding to the pixel projection in the binarized image.
例如,对于二值化图像中的第二行像素,其中包括1个值为1的像素,则进行水平投影时,这1个像素值为1的像素点投影到像素投 影行中的第二像素投影1。For example, for the second row of pixels in the binarized image, which includes a pixel with a value of 1, when performing horizontal projection, the pixel with a pixel value of 1 is projected to the second pixel in the pixel projection row Projection 1.
现在返回参考图2,继续图2中的流程图。Now refer back to FIG. 2 and continue the flowchart in FIG. 2.
在操作S207中,中央处理单元106基于预定阈值和像素投影行以及像素投影列来确定物体103的区域。In operation S207, the central processing unit 106 determines the area of the object 103 based on a predetermined threshold and pixel projection rows and pixel projection columns.
在示例性实施例中,基于预定阈值从像素投影行和像素投影列中筛选出大于预定阈值的像素投影,并且基于所筛选出的像素投影来确定物体的区域。In an exemplary embodiment, pixel projections larger than a predetermined threshold are filtered out from pixel projection rows and pixel projection columns based on a predetermined threshold, and the area of the object is determined based on the filtered pixel projections.
更具体地,根据所筛选出的像素投影中的处于水平两端的像素投影,确定物体的区域的水平边界;根据所筛选出的像素投影中的处于竖直两端的像素投影,确定物体的区域的竖直边界;以及基于水平边界和竖直边界,确定物体的区域。More specifically, the horizontal boundary of the area of the object is determined according to the pixel projections at the horizontal ends of the filtered pixel projections; the horizontal boundary of the area of the object is determined according to the pixel projections at the vertical ends of the filtered pixel projections. The vertical boundary; and based on the horizontal boundary and the vertical boundary, the area of the object is determined.
图4示意性示出了根据本公开实施例的基于预定阈值从像素投影行和像素投影列中筛选出大于预定阈值的像素投影的图。Fig. 4 schematically shows a diagram of filtering out pixel projections larger than a predetermined threshold from a pixel projection row and a pixel projection column based on a predetermined threshold according to an embodiment of the present disclosure.
如图4所示,当预定阈值为2时,通过将像素投影行中的像素投影与预定阈值相减,从而可以筛选出大于预定阈值的像素投影。As shown in FIG. 4, when the predetermined threshold is 2, by subtracting the pixel projections in the pixel projection row from the predetermined threshold, the pixel projections larger than the predetermined threshold can be filtered out.
如图4中所示,经过筛选后,从像素投影行中筛选出的大于预定阈值的像素投影为像素投影行中的从左向右计数的第6像素投影至第12像素投影,从像素投影列中筛选出的大于预定阈值的像素投影为像素投影列中的从上向下计数的第4像素投影和第9投影像素。As shown in Figure 4, after filtering, the pixels larger than the predetermined threshold selected from the pixel projection row are projected into the pixel projection row from the 6th pixel counted from left to right to the 12th pixel projection, from the pixel projection The pixel projections selected in the column that are larger than the predetermined threshold are the fourth pixel projection and the ninth projection pixel counted from the top to the bottom in the pixel projection column.
基于筛选出的像素投影,可以获得水平边界线A和A’以及竖直边界线B和B’,由水平边界线A和A’以及竖直边界线B和B’限定的区域即为物体的区域。Based on the filtered pixel projections, the horizontal boundary lines A and A'and the vertical boundary lines B and B'can be obtained. The area defined by the horizontal boundary lines A and A'and the vertical boundary lines B and B'is the object's area.
在示例性实施例中,在如图1中所示的场景的情况下,物体103随着传送带在安检机中水平移动。在这种情况下,由于物体在竖直方向上没有任何的高度变化,因此仅需在首次确定时确定物体的竖直边界即可。此时,首次确定的竖直边界可以存储在存储器中,以在处理后续图像时直接将该竖直边界应用于后续图像的二值化图像即可。In an exemplary embodiment, in the case of the scene as shown in FIG. 1, the object 103 moves horizontally in the security inspection machine along with the conveyor belt. In this case, since the object does not have any height change in the vertical direction, it is only necessary to determine the vertical boundary of the object when it is first determined. At this time, the first determined vertical boundary may be stored in the memory, so that the vertical boundary may be directly applied to the binarized image of the subsequent image when the subsequent image is processed.
类似地,在物体在仅有竖直方向的移动而不存在水平方向的移动的情况下,仅需在首次确定时确定物体的水平边界即可。此时,首次确定的水平边界可以存储在存储器中,以在处理后续图像时直接将该 水平边界应用于后续图像的二值化图像即可。Similarly, when the object only moves in the vertical direction but does not move in the horizontal direction, it is only necessary to determine the horizontal boundary of the object when it is first determined. At this time, the first determined horizontal boundary can be stored in the memory, so that the horizontal boundary can be directly applied to the binarized image of the subsequent image when the subsequent image is processed.
基于以上处理,可以在每个图像中确定出物体的区域。此时,通过比较图像中的物体的区域即可确定前后两帧的图像中的物体是否为相同的物体。Based on the above processing, the area of the object can be determined in each image. At this time, by comparing the area of the object in the image, it can be determined whether the object in the two images before and after is the same object.
示例性地,还能够据此来确定图像中是否出现了新的物体。Exemplarily, it can also be used to determine whether a new object appears in the image.
当确定前后两帧中的物体为相同物体时,检测和跟踪移动物体成功。When it is determined that the objects in the two frames before and after are the same object, the detection and tracking of the moving object succeeds.
此时,可以基于前后两帧中的图像的区域确定前后两帧之间物体的移动距离。At this time, the moving distance of the object between the two frames before and after can be determined based on the regions of the images in the two frames before and after.
图5示意性示出了根据本公开实施例的确定前后两帧中物体的移动距离的流程图。Fig. 5 schematically shows a flowchart of determining the moving distance of an object in two frames before and after according to an embodiment of the present disclosure.
如图5所示,该方法包括如下操作。As shown in Figure 5, the method includes the following operations.
在操作S501中,确定前后两帧图像之间物体的水平移动距离。In operation S501, the horizontal movement distance of the object between the two frames of images before and after is determined.
具体地,在操作S5011中,以一个像素为步长,将前一帧图像中的像素投影行沿着水平方向移动。Specifically, in operation S5011, the pixel projection row in the previous frame of image is moved along the horizontal direction with one pixel as the step size.
在操作S5013中,在每次移动之后,计算移动后的像素投影行与后一帧图像中的像素投影行之间的状态值。In operation S5013, after each movement, the state value between the pixel projection line after the movement and the pixel projection line in the subsequent frame of image is calculated.
计算状态值H的公式如下:The formula for calculating the state value H is as follows:
Figure PCTCN2021077624-appb-000002
Figure PCTCN2021077624-appb-000002
其中,j表示第j次移动,w的值为像素投影行中的像素投影数量-1,A p+j(1,i)表示第j次移动后的前一帧图像中的像素投影行中的第i个像素投影,A c(1,i)表示后一帧图像中的像素投影行中的第i个像素。 Among them, j represents the jth movement, the value of w is the number of pixel projections in the pixel projection row-1, and A p+j (1, i) represents the pixel projection row in the previous frame of the image after the jth movement The i-th pixel projection of A c (1,i) represents the i-th pixel in the pixel projection row of the next frame of image.
在经过多个移动之后(例如,状态值中出现极小值时),在操作S5015中,从这些状态值中选择最小的状态值作为前后两帧图像之间的物体的水平移动距离。After multiple movements (for example, when a minimum value appears in the state value), in operation S5015, the smallest state value is selected from these state values as the horizontal movement distance of the object between the previous and next two frames of images.
至此,确定出了前后两帧图像之间的物体的水平移动距离。At this point, the horizontal movement distance of the object between the two frames of images before and after has been determined.
处理进行至操作S503,在操作S503中,确定前后两帧图像之间的物体的竖直移动距离。The process proceeds to operation S503, and in operation S503, the vertical movement distance of the object between two frames of images before and after is determined.
确定物体的竖直移动的距离的方法与确定物体的水平移动的距离的方法相同,在此不再详述。The method of determining the distance of the object's vertical movement is the same as the method of determining the distance of the object's horizontal movement, which will not be described in detail here.
图6示意性示出了根据本公开实施例的移动物体检测和跟踪装置1000的框图。FIG. 6 schematically shows a block diagram of a mobile object detection and tracking device 1000 according to an embodiment of the present disclosure.
如图6所示,移动物体检测和跟踪装置1000可以包括图像采集装置1001、预处理单元1002、像素投影单元1003、区域确定单元1004以及判定单元1005。As shown in FIG. 6, the moving object detection and tracking device 1000 may include an image acquisition device 1001, a preprocessing unit 1002, a pixel projection unit 1003, an area determination unit 1004, and a determination unit 1005.
图像采集装置1001可以被配置为获得包括所述物体的图像。The image acquisition device 1001 may be configured to obtain an image including the object.
预处理单元1002可以被配置为对图像进行预处理以获得二值化图像。The preprocessing unit 1002 may be configured to preprocess the image to obtain a binarized image.
像素投影单元可以被配置为对二值化图像中的像素进行水平投影和竖直投影以获得投影成一行和一列的像素投影行和像素投影列。The pixel projection unit may be configured to perform horizontal projection and vertical projection on the pixels in the binarized image to obtain pixel projection rows and pixel projection columns projected in one row and one column.
其中,像素投影行中的每一个像素投影的值为二值化图像中的与该像素投影相对应的列上的所有像素的二值化值之和,并且像素投影列中的每一个像素投影的值为所述二值化图像中的与该像素投影相对应的行上的所有像素的二值化值之和。Wherein, the value of each pixel projection in the pixel projection row is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and each pixel in the pixel projection column is projected The value of is the sum of the binarized values of all pixels on the row corresponding to the pixel projection in the binarized image.
区域确定单元1004可以被配置为基于预定阈值和像素投影行以及像素投影列来确定所述物体的区域。The area determination unit 1004 may be configured to determine the area of the object based on a predetermined threshold and pixel projection rows and pixel projection columns.
判定单元1005可以被配置为基于所确定的区域来判定前后两帧图像中的物体是否为相同物体,以实现移动物体的检测和跟踪。The determining unit 1005 may be configured to determine whether the objects in the two frames of images before and after are the same object based on the determined area, so as to realize the detection and tracking of the moving object.
除了以上模块1001、1002、1003、1004和1005之外,移动物体检测和跟踪装置1000还可以包括其他模块,用于对应地执行上述各种操作。In addition to the above modules 1001, 1002, 1003, 1004, and 1005, the moving object detection and tracking device 1000 may also include other modules for correspondingly performing the above various operations.
为了清楚和简洁起见,在此不再赘述各个模块及其中所执行的对应操作。For the sake of clarity and brevity, each module and the corresponding operations performed in it will not be repeated here.
根据本公开的实施例的多个单元或模块的功能可以在一个单元或模块中实现。根据本公开实施例的一个单元或模块可以被拆分成多个单元或模块来实现。根据本公开实施例的单元或模块可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上***、基板上的***、封装上的***、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式的硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任 意几种的适当组合来实现。或者,根据本公开实施例的模块可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。The functions of multiple units or modules according to an embodiment of the present disclosure may be implemented in one unit or module. One unit or module according to an embodiment of the present disclosure may be split into a plurality of units or modules to be implemented. A unit or module according to an embodiment of the present disclosure may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, Application-specific integrated circuit (ASIC), or it can be implemented by hardware or firmware in any other reasonable way that integrates or encapsulates the circuit, or by software, hardware, and firmware in any of three ways or in any of them The appropriate combination of to achieve. Alternatively, the modules according to the embodiments of the present disclosure may be at least partially implemented as computer program modules, and when the computer program modules are executed, corresponding functions may be performed.
根据本公开的实施例,上述单元或模块中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上***、基板上的***、封装上的***、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。可选地,上述模块中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。According to an embodiment of the present disclosure, at least one of the above-mentioned units or modules may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate , Packaged system, application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any of the three implementation methods of software, hardware and firmware Or it can be realized by any suitable combination of them. Optionally, at least one of the above-mentioned modules may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
图7示意性示出了根据本公开实施例的适于实现移动物体检测和跟踪方法的电子设备的框图。Fig. 7 schematically shows a block diagram of an electronic device suitable for implementing a method for detecting and tracking a moving object according to an embodiment of the present disclosure.
图7示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。The electronic device shown in FIG. 7 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
如图8所示,根据本公开实施例的电子设备700包括处理器701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。处理器701例如可以包括通用微处理器(例如CPU)、指令集处理器和/或相关芯片组和/或专用微处理器(例如,专用集成电路(ASIC)),等等。处理器701还可以包括用于缓存用途的板载存储器。处理器701可以包括用于执行根据本公开实施例的方法流程的不同动作的单一处理单元或者是多个处理单元。As shown in FIG. 8, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can be loaded into a random access memory (RAM) 703 according to a program stored in a read only memory (ROM) 702 or from a storage part 708 The program executes various appropriate actions and processing. The processor 701 may include, for example, a general-purpose microprocessor (for example, a CPU), an instruction set processor and/or a related chipset and/or a special purpose microprocessor (for example, an application specific integrated circuit (ASIC)), and so on. The processor 701 may also include on-board memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of a method flow according to an embodiment of the present disclosure.
在RAM 703中,存储有电子设备700操作所需的各种程序和数据。处理器701、ROM 702以及RAM 703通过总线704彼此相连。处理器701通过执行ROM 702和/或RAM 703中的程序来执行根据本公开实施例的方法流程的各种操作。需要注意,所述程序也可以存储在除ROM 702和RAM 703以外的一个或多个存储器中。处理器701也可以通过执行存储在所述一个或多个存储器中的程序来执行根据本公开实施例的方法流程的各种操作。In the RAM 703, various programs and data required for the operation of the electronic device 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The processor 701 executes various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. The processor 701 may also execute various operations of the method flow according to the embodiments of the present disclosure by executing programs stored in the one or more memories.
根据本公开的实施例,电子设备700还可以包括输入/输出(I/O)接口705,输入/输出(I/O)接口705也连接至总线704。电子设备700还可以包括连接至I/O接口705的以下部件中的一项或多项:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器810也根据需要连接至I/O接口705。可拆卸介质811,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器810上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。According to an embodiment of the present disclosure, the electronic device 700 may further include an input/output (I/O) interface 705, and the input/output (I/O) interface 705 is also connected to the bus 704. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input part 706 including a keyboard, a mouse, etc.; including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and The output section 707 of a speaker and the like; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, and the like. The communication section 709 performs communication processing via a network such as the Internet. The driver 810 is also connected to the I/O interface 705 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as required, so that the computer program read therefrom is installed into the storage section 708 as required.
根据本公开的实施例,根据本公开实施例的方法流程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读存储介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质811被安装。在该计算机程序被处理器701执行时,执行本公开实施例的***中限定的上述功能。根据本公开的实施例,上文描述的***、设备、装置、模块、单元等可以通过计算机程序模块来实现。According to the embodiment of the present disclosure, the method flow according to the embodiment of the present disclosure may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication part 709, and/or installed from the removable medium 811. When the computer program is executed by the processor 701, it executes the above-mentioned functions defined in the system of the embodiment of the present disclosure. According to the embodiments of the present disclosure, the systems, devices, devices, modules, units, etc. described above may be implemented by computer program modules.
本公开还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中描述的设备/装置/***中所包含的;也可以是单独存在,而未装配入该设备/装置/***中。上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被执行时,实现根据本公开实施例的方法。The present disclosure also provides a computer-readable storage medium. The computer-readable storage medium may be included in the device/device/system described in the above embodiment; or it may exist alone without being assembled into the device/ In the device/system. The aforementioned computer-readable storage medium carries one or more programs, and when the aforementioned one or more programs are executed, the method according to the embodiments of the present disclosure is implemented.
根据本公开的实施例,计算机可读存储介质可以是非易失性的计算机可读存储介质,例如可以包括但不限于:便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行***、装置或者器件使用或者与其结合使用。例如,根据本 公开的实施例,计算机可读存储介质可以包括上文描述的ROM 702和/或RAM 703和/或ROM 702和RAM 703以外的一个或多个存储器。According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but not limited to: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM) , Erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include one or more memories other than the ROM 702 and/or RAM 703 and/or ROM 702 and RAM 703 described above.
附图中的流程图和框图,图示了按照本公开各种实施例的***、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的***来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions, and operations of the system, method, and computer program product according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more for realizing the specified logic function. Executable instructions. It should also be noted that, in some alternative implementations, the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown one after another can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by It is realized by a combination of dedicated hardware and computer instructions.
本领域技术人员可以理解,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合,即使这样的组合或结合没有明确记载于本公开中。特别地,在不脱离本公开精神和教导的情况下,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合。所有这些组合和/或结合均落入本公开的范围。Those skilled in the art can understand that the features described in the various embodiments of the present disclosure and/or the claims can be combined and/or combined in various ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the various embodiments of the present disclosure and/or the features described in the claims can be combined and/or combined in various ways. All these combinations and/or combinations fall within the scope of the present disclosure.
以上对本公开的实施例进行了描述。但是,这些实施例仅仅是为了说明的目的,而并非为了限制本公开的范围。尽管在以上分别描述了各实施例,但是这并不意味着各个实施例中的措施不能有利地结合使用。本公开的范围由所附权利要求及其等同物限定。不脱离本公开的范围,本领域技术人员可以做出多种替代和修改,这些替代和修改都应落在本公开的范围之内。The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only, and are not intended to limit the scope of the present disclosure. Although the respective embodiments are described above separately, this does not mean that the measures in the respective embodiments cannot be advantageously used in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and these substitutions and modifications should fall within the scope of the present disclosure.

Claims (12)

  1. 一种移动物体检测和跟踪方法,包括:A method for detecting and tracking moving objects, including:
    利用图像采集装置获得包括所述物体的图像;Obtaining an image including the object by using an image acquisition device;
    对所述图像进行预处理以获得二值化图像;Preprocessing the image to obtain a binarized image;
    对所述二值化图像中的像素进行水平投影和竖直投影以获得投影成一行和一列的像素投影行和像素投影列,其中,所述像素投影行中的每一个像素投影的值为所述二值化图像中的与该像素投影相对应的列上的所有像素的二值化值之和,并且所述像素投影列中的每一个像素投影的值为所述二值化图像中的与该像素投影相对应的行上的所有像素的二值化值之和;Perform horizontal projection and vertical projection on the pixels in the binarized image to obtain pixel projection rows and pixel projection columns that are projected into one row and one column, wherein the value of each pixel projection in the pixel projection row is given by The sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and the value of each pixel projection in the pixel projection column is the value in the binarized image The sum of the binarized values of all pixels on the row corresponding to the pixel projection;
    基于预定阈值和所述像素投影行以及所述像素投影列来确定所述物体的区域;以及Determining the area of the object based on a predetermined threshold and the pixel projection row and the pixel projection column; and
    基于所确定的区域确定前后两帧图像中的物体是否为相同物体,以实现移动物体的检测和跟踪。Based on the determined area, it is determined whether the objects in the two images before and after are the same object, so as to realize the detection and tracking of the moving object.
  2. 根据权利要求1所述的移动物体检测和跟踪方法,其中,对所述图像进行预处理以获得二值化图像包括:The method for detecting and tracking a moving object according to claim 1, wherein preprocessing the image to obtain a binarized image comprises:
    对所述图像进行灰度化和二值化处理,以获得所述二值化图像。Performing grayscale and binarization processing on the image to obtain the binarized image.
  3. 根据权利要求1所述的移动物体检测和跟踪方法,其中,基于预定阈值和所述像素投影行以及所述像素投影列来确定所述物体的区域包括:The method for detecting and tracking a moving object according to claim 1, wherein determining the area of the object based on a predetermined threshold and the pixel projection row and the pixel projection column comprises:
    基于所述预定阈值从所述像素投影行和所述像素投影列中筛选出大于所述预定阈值的像素投影;以及Filtering out pixel projections larger than the predetermined threshold from the pixel projection row and the pixel projection column based on the predetermined threshold; and
    基于所筛选出的像素投影,来确定所述物体的区域。Based on the filtered pixel projections, the area of the object is determined.
  4. 根据权利要求3所述的移动物体检测和跟踪方法,其中,基于所筛选出的像素投影来确定所述物体的区域包括:The method for detecting and tracking a moving object according to claim 3, wherein determining the area of the object based on the filtered pixel projection comprises:
    根据所筛选出的像素投影中的处于水平两端的像素投影,确定所述物体的区域的水平边界;Determine the horizontal boundary of the area of the object according to the pixel projections at the horizontal ends of the filtered pixel projections;
    根据所筛选出的像素投影中的处于竖直两端的像素投影,确定所述物体的区域的竖直边界;以及Determine the vertical boundary of the area of the object according to the pixel projections at the vertical ends of the filtered pixel projections; and
    基于所述水平边界和所述竖直边界,确定所述物体的区域。Based on the horizontal boundary and the vertical boundary, the area of the object is determined.
  5. 根据权利要求4所述的移动物体检测和跟踪方法,其中,The method for detecting and tracking a moving object according to claim 4, wherein:
    在所述物体仅水平移动的情况下,仅确定一次所述竖直边界,并且将所确定的所述竖直边界直接投影到后续图像中,以在后续图像中形成物体的区域的竖直边界。In the case that the object only moves horizontally, the vertical boundary is determined only once, and the determined vertical boundary is directly projected into the subsequent image to form the vertical boundary of the area of the object in the subsequent image .
  6. 根据权利要求4所述的移动物体检测和跟踪方法,其中,The method for detecting and tracking a moving object according to claim 4, wherein:
    在所述物体仅竖直移动的情况下,仅确定一次所述水平边界,并且将所确定的所述水平边界直接投影到后续图像中,以在后续图像中形成物体的区域的水平边界。In the case that the object only moves vertically, the horizontal boundary is determined only once, and the determined horizontal boundary is directly projected into a subsequent image to form a horizontal boundary of the area of the object in the subsequent image.
  7. 根据权利要求1所述的移动物体检测和跟踪方法,还包括:The method for detecting and tracking a moving object according to claim 1, further comprising:
    在确定前后两帧图像中的物体为相同物体的情况下,基于前后两帧图像中的物体的区域确定物体的移动距离。In the case where it is determined that the objects in the two images before and after are the same object, the moving distance of the object is determined based on the area of the object in the two images before and after.
  8. 根据权利要求7所述的移动物体检测和跟踪方法,基于前后两帧图像中的物体的区域确定物体的移动距离包括:According to the method for detecting and tracking a moving object according to claim 7, determining the moving distance of the object based on the area of the object in two frames of images before and after includes:
    确定物体的水平移动距离,包括:Determine the horizontal movement distance of the object, including:
    以一个像素为步长将前一帧图像中的像素投影行沿着水平方向移动;Move the pixel projection row in the previous frame of image along the horizontal direction with one pixel as the step size;
    在每一次水平移动之后,确定移动后的前一帧图像中的像素投影行与后一帧图像中的像素投影行之间的状态值:以及After each horizontal movement, determine the state value between the pixel projection line in the previous frame image and the pixel projection line in the next frame image after the movement: and
    将针对多次水平移动而计算的多个状态值之中的最小状态值确定为前后两帧图像之间的物体水平移动的距离;以及Determine the smallest state value among the plurality of state values calculated for multiple horizontal movements as the distance of the horizontal movement of the object between the previous and next two frames of images; and
    确定物体的竖直移动距离,其中确定物体的竖直移动的距离的方法与确定物体的水平移动的距离的方法相同。The vertical movement distance of the object is determined, wherein the method of determining the vertical movement distance of the object is the same as the method of determining the horizontal movement distance of the object.
  9. 根据权利要求8所述的移动物体检测和跟踪方法,所述确定移动后的前一帧图像中的像素投影行与后一帧图像中的像素投影行之间的状态值包括:The method for detecting and tracking a moving object according to claim 8, wherein the determining the state value between the pixel projection line in the previous frame image and the pixel projection line in the subsequent frame image after the movement comprises:
    利用下列公式确定状态值:Use the following formula to determine the status value:
    Figure PCTCN2021077624-appb-100001
    Figure PCTCN2021077624-appb-100001
    其中,H表示状态值,j表示第j次移动,w的值为像素投影行中的像素投影数量-1,A p表示前一帧图像,A p+j(1,i)表示第j次移动后 的前一帧图像中的像素投影行中的第i个像素投影,A c表示后一帧图像,A c(1,i)表示后一帧图像中的像素投影行中的第i个像素投影。 Among them, H represents the state value, j represents the jth movement, the value of w is the number of pixel projections in the pixel projection row -1, Ap represents the previous frame of image, and Ap+j (1,i) represents the jth time The i-th pixel projection in the pixel projection line in the previous frame of the image after the movement, A c represents the image of the next frame, and A c (1,i) represents the i-th pixel projection in the pixel projection line in the next frame of image Pixel projection.
  10. 一种移动物体检测和跟踪装置,包括:A moving object detection and tracking device, including:
    图像采集装置,被配置为获得包括所述物体的图像;An image acquisition device configured to obtain an image including the object;
    预处理单元,被配置为对所述图像进行预处理以获得二值化图像;A preprocessing unit configured to preprocess the image to obtain a binarized image;
    像素投影单元,被配置为对所述二值化图像中的像素进行水平投影和竖直投影以获得投影成一行和一列的像素投影行和像素投影列,其中,所述像素投影行中的每一个像素投影的值为所述二值化图像中的与该像素投影相对应的列上的所有像素的二值化值之和,并且所述像素投影列中的每一个像素投影的值为所述二值化图像中的与该像素投影相对应的行上的所有像素的二值化值之和;The pixel projection unit is configured to perform horizontal projection and vertical projection on the pixels in the binarized image to obtain pixel projection rows and pixel projection columns projected into one row and one column, wherein each of the pixel projection rows The value of a pixel projection is the sum of the binarization values of all pixels on the column corresponding to the pixel projection in the binarized image, and the value of each pixel projection in the pixel projection column is equal to The sum of the binarized values of all pixels on the row corresponding to the pixel projection in the binarized image;
    区域确定单元,被配置为基于预定阈值和所述像素投影行以及所述像素投影列来确定所述物体的区域;以及An area determining unit configured to determine the area of the object based on a predetermined threshold and the pixel projection row and the pixel projection column; and
    判定单元,被配置为基于所确定的区域来判定前后两帧图像中的物体是否为相同物体,以实现移动物体的检测和跟踪。The determining unit is configured to determine whether the objects in the two frames of images before and after are the same object based on the determined area, so as to realize the detection and tracking of the moving object.
  11. 一种电子设备,包括:An electronic device including:
    一个或多个处理器;以及One or more processors; and
    存储器,用于存储一个或多个程序,Memory, used to store one or more programs,
    其中,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现权利要求1所述的方法。Wherein, when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method according to claim 1.
  12. 一种计算机可读存储介质,其上存储有可执行指令,该指令被处理器执行时使处理器实现权利要求1所述的方法。A computer-readable storage medium having executable instructions stored thereon, and when the instructions are executed by a processor, the processor implements the method of claim 1.
PCT/CN2021/077624 2020-03-31 2021-02-24 Method and apparatus for detecting and tracking moving object WO2021196925A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010247730.7 2020-03-31
CN202010247730.7A CN113470065B (en) 2020-03-31 2020-03-31 Moving object detection and tracking method and apparatus

Publications (1)

Publication Number Publication Date
WO2021196925A1 true WO2021196925A1 (en) 2021-10-07

Family

ID=77865912

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/077624 WO2021196925A1 (en) 2020-03-31 2021-02-24 Method and apparatus for detecting and tracking moving object

Country Status (2)

Country Link
CN (1) CN113470065B (en)
WO (1) WO2021196925A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117078677A (en) * 2023-10-16 2023-11-17 江西天鑫冶金装备技术有限公司 Defect detection method and system for starting sheet

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114882065B (en) * 2022-07-12 2023-03-14 深圳市瑞图生物技术有限公司 Method and device for judging fluidity of detection object, analyzer and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231756A (en) * 2008-01-30 2008-07-30 安防科技(中国)有限公司 Method and apparatus for detecting moving goal shade
CN102682455A (en) * 2012-05-10 2012-09-19 天津工业大学 Front vehicle detection method based on monocular vision
CN104658011A (en) * 2015-01-31 2015-05-27 北京理工大学 Intelligent transportation moving object detection tracking method
CN107093186A (en) * 2017-03-10 2017-08-25 北京环境特性研究所 The strenuous exercise's detection method matched based on edge projection
US20190099146A1 (en) * 2017-10-02 2019-04-04 Wisconsin Alumni Research Foundation System and method of quantitative angiograpy

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103713329B (en) * 2012-09-29 2016-12-21 清华大学 CT imaging positions method and the equipment of object
CN104715249B (en) * 2013-12-16 2018-06-05 株式会社理光 Object tracking methods and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231756A (en) * 2008-01-30 2008-07-30 安防科技(中国)有限公司 Method and apparatus for detecting moving goal shade
CN102682455A (en) * 2012-05-10 2012-09-19 天津工业大学 Front vehicle detection method based on monocular vision
CN104658011A (en) * 2015-01-31 2015-05-27 北京理工大学 Intelligent transportation moving object detection tracking method
CN107093186A (en) * 2017-03-10 2017-08-25 北京环境特性研究所 The strenuous exercise's detection method matched based on edge projection
US20190099146A1 (en) * 2017-10-02 2019-04-04 Wisconsin Alumni Research Foundation System and method of quantitative angiograpy

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117078677A (en) * 2023-10-16 2023-11-17 江西天鑫冶金装备技术有限公司 Defect detection method and system for starting sheet
CN117078677B (en) * 2023-10-16 2024-01-30 江西天鑫冶金装备技术有限公司 Defect detection method and system for starting sheet

Also Published As

Publication number Publication date
CN113470065A (en) 2021-10-01
CN113470065B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
US11450146B2 (en) Gesture recognition method, apparatus, and device
US11062123B2 (en) Method, terminal, and storage medium for tracking facial critical area
US10453204B2 (en) Image alignment for burst mode images
US9710698B2 (en) Method, apparatus and computer program product for human-face features extraction
US8254643B2 (en) Image processing method and device for object recognition
US9628709B2 (en) Systems and methods for capturing images using a mobile device
KR101322168B1 (en) Apparatus for real-time face recognition
US20150016687A1 (en) Method, system and computer storage medium for face detection
JP6688277B2 (en) Program, learning processing method, learning model, data structure, learning device, and object recognition device
WO2021196925A1 (en) Method and apparatus for detecting and tracking moving object
US11900676B2 (en) Method and apparatus for detecting target in video, computing device, and storage medium
US20130272575A1 (en) Object detection using extended surf features
CN111626163B (en) Human face living body detection method and device and computer equipment
US20210074001A1 (en) Motion Detection Method and Motion Detection System with Low Computational Complexity and High Detection Accuracy
CN111046746A (en) License plate detection method and device
CN108229281B (en) Neural network generation method, face detection device and electronic equipment
CA3062788C (en) Detecting font size in a digital image
CN110378934A (en) Subject detection method, apparatus, electronic equipment and computer readable storage medium
US11132778B2 (en) Image analysis apparatus, image analysis method, and recording medium
JP6028972B2 (en) Image processing apparatus, image processing method, and image processing program
US9036873B2 (en) Apparatus, method, and program for detecting object from image
CN113515978B (en) Data processing method, device and storage medium
CN109493349B (en) Image feature processing module, augmented reality equipment and corner detection method
CN115250329A (en) Camera control method and device, computer equipment and storage medium
CN112752086A (en) Image signal processor, method and system for environment mapping

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21780240

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21780240

Country of ref document: EP

Kind code of ref document: A1