A tracking method, tracking device, terminal equipment and readable storage medium
By calculating the pedestrian area difference on the smart camera, the problem of easy interruption when the smart camera is installed on a sports device to track a target is solved, and the re-capture rate is reduced.
Patent Information
- Application Number
- CN202011073197.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-09
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-10-09
AI Technical Summary
When smart cameras are installed on sports equipment, the tracking target is easily interrupted when moving, resulting in a high re-capture rate.
By acquiring video image frames, pedestrian detection is performed, and the target difference between pedestrian areas is calculated. If the difference is less than or equal to the preset difference, the area is determined to be the same pedestrian, thereby maintaining tracking.
It effectively avoids interruptions when smart cameras track targets on sports equipment and reduces the re-capture rate.
Smart Images

Figure CN112330715B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing, and in particular relates to a tracking method, a tracking device, a terminal device and a readable storage medium. Background Art
[0002] With the popularization of the Internet of Things, the application of smart cameras is becoming more and more popular. For example, smart cameras are installed on patrol cars, allowing patrol cars to recognize faces and vehicles, so that patrol cars can track suspects and suspicious vehicles, and issue warnings to police officers, thereby improving the work efficiency of police officers.
[0003] However, when the smart camera is installed on a moving device (such as a patrol car), the moving device is moving relative to the ground, and the person is also moving relative to the ground, so the face image may be missed or the face image may be blurred. As a result, when using face tracking, the tracking of the same person is easily interrupted, resulting in a particularly high re-capture rate.
[0004] Therefore, currently when a smart camera is installed on a moving device and the tracking target is also moving, the tracking of the target is easily interrupted. Summary of the invention
[0005] The embodiments of the present application provide a tracking method, a tracking device, a terminal device and a readable storage medium, which can to a certain extent solve the problem that the tracking of the target is easily interrupted when the smart camera is installed on the motion device and the tracking target is also moving.
[0006] In a first aspect, an embodiment of the present application provides a tracking method, including:
[0007] Get video image frames;
[0008] Performing pedestrian detection on the video image frames to obtain a first pedestrian region of a first image frame and a second pedestrian region of a second image frame, wherein the first image frame and the second image frame are adjacent video image frames;
[0009] Calculating a target difference value based on the first pedestrian area and the second pedestrian area;
[0010] If the target difference is less than or equal to the preset difference, the first pedestrian region and the second pedestrian region corresponding to the target difference that is less than or equal to the preset difference are determined as pedestrian regions of the same pedestrian.
[0011] In a second aspect, an embodiment of the present application provides a tracking device, including:
[0012] An acquisition module, used for acquiring video image frames;
[0013] A pedestrian detection module, used to perform pedestrian detection on the video image frames to obtain a first pedestrian region of a first image frame and a second pedestrian region of a second image frame, wherein the first image frame and the second image frame are adjacent video image frames;
[0014] A calculation module, used for calculating a target difference according to the first pedestrian area and the second pedestrian area;
[0015] The determination module is used to determine the first pedestrian area and the second pedestrian area corresponding to the target difference value that is less than or equal to the preset difference value as pedestrian areas of the same pedestrian if the target difference value is less than or equal to the preset difference value.
[0016] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the tracking method described in any one of the above-mentioned first aspects.
[0019] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0020] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0021] The present application provides a tracking method. First, a video image frame is obtained. Then, pedestrian detection is performed on the video image frame to obtain a first pedestrian area of the first image frame and a second pedestrian area of the second image frame. The first image frame and the second image frame are adjacent video image frames. Then, a target difference is calculated based on the first pedestrian area and the second pedestrian area. If the target difference is less than or equal to a preset difference, the first pedestrian area and the second pedestrian area corresponding to the target difference that is less than or equal to the preset difference are determined as pedestrian areas of the same pedestrian. That is, in the present application, whether the two pedestrian areas are the areas of the same pedestrian is determined based on the target difference of the two pedestrian areas, and whether the two pedestrians are the same person is not determined based on the facial information of the two pedestrians. Therefore, even if the smart camera is installed on a motion device and the tracking target is also moving and misses the facial image or takes a blurred facial image, the tracking of the target will not be interrupted. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 is a flowchart of a tracking method provided by an embodiment of the present application;
[0024] Figure 2 is a schematic diagram of a first image frame, a first pedestrian region, a second image frame, and a second pedestrian region provided by an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of the structure of a tracking device provided by an embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0028] In the present invention, if it involves the collection of personal privacy data, such as facial and mobile phone usage information, the individual's permission will be obtained in advance, including but not limited to verbal reminders, posting posters, mobile phone reminders, etc.; if it involves conflicts with laws and regulations, it will be produced or used within the scope permitted by laws and regulations.
[0029] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0030] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0031] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0032] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0033] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0034] The tracking method provided in the embodiment of the present application can be applied to terminal devices such as mobile phones, tablet computers, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.
[0035] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0036] Embodiment 1
[0037] The following describes a tracking method provided in Example 1 of the present application. Figure 1 , the method comprising:
[0038] Step S101: Acquire a video image frame.
[0039] In step S101, the video image frame may be collected by the camera of the terminal device of this embodiment, or may be collected by other cameras and then sent to the terminal device of this embodiment. The application does not specifically limit the source of the video image frame.
[0040] It should be noted that if the video image frame is collected by the camera of the terminal device of this embodiment, the terminal device of this embodiment is installed on the sports device. If the video image frame is collected by other cameras and then sent to the terminal device of this embodiment, the terminal device of this embodiment can be installed on the sports device or on the background management module, and this application does not make specific restrictions on this.
[0041] Step S102: perform pedestrian detection on the video image frames to obtain a first pedestrian region of the first image frame and a second pedestrian region of the second image frame, wherein the first image frame and the second image frame are adjacent video image frames.
[0042] In step S102, pedestrian detection refers to the technology of using computer vision technology to determine whether there are pedestrians in an image or video sequence and to accurately locate them. The specific algorithm used for pedestrian detection can be selected by the user according to the actual situation. For example, a deep learning algorithm or a global feature-based algorithm is selected as the pedestrian detection algorithm in this application. This is not specifically limited in this application.
[0043] The first pedestrian area refers to the coordinate range of pedestrians in the first image frame, and the coordinate range is expressed in coordinates on a coordinate axis established with a first preset point on the first image frame as the center. The first preset point of the first image frame can be set according to actual needs, and this application does not make specific restrictions here. The second pedestrian area refers to the coordinate range of pedestrians in the second image frame, and the coordinate range is expressed in coordinates on a coordinate axis established with a second preset point on the second image frame as the center. The second preset point of the second image frame can be set according to actual needs, and this application does not make specific restrictions here.
[0044] After performing pedestrian detection on the video image frame, a first pedestrian region of the first image frame and a second pedestrian region of the second image frame can be obtained, and the first image frame and the second image frame are adjacent video image frames. For example, as shown in FIG2, 201 is the first image frame, 2011, 2012 and 2013 are first pedestrian regions, 202 is the second image frame, and 2021, 2022 and 2023 are second pedestrian regions. It should be noted that the first pedestrian region and the second pedestrian region can each include at least one.
[0045] Step S103: Calculate a target difference according to the first pedestrian region and the second pedestrian region.
[0046] In step S103, after obtaining the first pedestrian area and the second pedestrian area, the target difference between the second pedestrian area and each first pedestrian area is calculated. For example, the target difference between the second pedestrian area 2022 and each first pedestrian area 2011, 2012 and 2013 is calculated. It should be noted that when calculating the target difference based on the first pedestrian area and the second pedestrian area, it is necessary to calculate based on the same target point. For example, the target difference is calculated based on the center coordinates of each pedestrian area, that is, the target difference between the center coordinates of the second pedestrian area and the center coordinates of the first pedestrian area is calculated. Alternatively, the target difference is calculated based on the upper left corner coordinates of each pedestrian area, that is, the target difference between the upper left corner coordinates of the second pedestrian area and the upper left corner coordinates of the first pedestrian area is calculated.
[0047] Step S104: If the target difference is less than or equal to the preset difference, the first pedestrian region and the second pedestrian region corresponding to the target difference that is less than or equal to the preset difference are determined as pedestrian regions of the same pedestrian.
[0048] In step S104, when the target difference is less than or equal to the preset difference, it means that the first pedestrian region and the second pedestrian region corresponding to the target difference less than or equal to the preset difference are the pedestrian regions of the same pedestrian. Therefore, at this time, the first pedestrian region and the second pedestrian region corresponding to the target difference less than or equal to the preset difference are determined as the pedestrian regions of the same pedestrian. For example, Figure 2 As shown, the target differences between the second pedestrian region 2022 and each of the first pedestrian regions 2011, 2012, and 2013 are target difference 1, target difference 2, and target difference 3. Among the target difference 1, target difference 2, and target difference 3, only the target difference 2 is less than or equal to the preset difference, and the first pedestrian region 2012 and the second pedestrian region 2022 corresponding to the target difference 2 are determined as pedestrian regions of the same pedestrian.
[0049] In some embodiments, if the target difference is less than or equal to the preset difference, before determining the first pedestrian area and the second pedestrian area corresponding to the target difference that is less than or equal to the preset difference as pedestrian areas of the same pedestrian, it includes: obtaining the speed of the motion device; determining the preset difference based on the speed of the motion device.
[0050] In this embodiment, since the camera is installed on the motion device, the camera moves with the movement of the motion device, and the person is also moving. Therefore, if the preset difference is a fixed value, it may cause an error in the judgment of whether the two pedestrian areas are the pedestrian areas of the same pedestrian. Therefore, the terminal device can obtain the speed of the motion device, and then determine the preset difference according to the speed of the motion device. That is, the preset difference can change with the change of the speed of the motion device. When the speed of the motion device is fast, the preset difference is larger, and when the speed of the motion device is slower, the preset difference is smaller. Since the camera is moving, the person is also moving, therefore, setting the preset difference according to the speed of the camera (the speed of the motion device) can more accurately judge whether the two pedestrian areas are the pedestrian areas of the same pedestrian.
[0051] In other embodiments, after the first pedestrian area and the second pedestrian area corresponding to the target difference value less than or equal to the preset difference value are determined as pedestrian areas of the same pedestrian, the method includes: screening the video image frames containing the same pedestrian according to preset rules to obtain the optimal video image frame; performing face recognition on the optimal video image frame to obtain the target face information of the pedestrian.
[0052] In this embodiment, after obtaining the pedestrian regions corresponding to the same pedestrian, that is, obtaining the video image frames of the same pedestrian, if the pedestrian region corresponding to the pedestrian is no longer detected, it means that the pedestrian has left the field of view of the camera. At this time, the video image frames containing the pedestrian can be screened according to the preset rules to obtain the optimal video image frame. Then, face recognition is performed on the optimal video image frame to obtain the target face information of the pedestrian.
[0053] The target face information may include the face ID information of the pedestrian, the pedestrian's gender, age, whether he wears a mask, whether he wears glasses, whether he has a beard, and other information. It should be noted that when performing face recognition on the optimal video image frame of the pedestrian, the face image of the pedestrian can be first cropped from the optimal video image frame, and then face recognition is performed on the face image of the pedestrian. The user can set the face recognition algorithm according to actual conditions. For example, a deep learning algorithm is used as a face recognition algorithm. This application does not make specific restrictions here.
[0054] In this embodiment, since it is determined whether the two pedestrian areas are the areas of the same pedestrian based on the target difference between the two pedestrian areas, rather than based on the facial information of the two pedestrians, whether the two pedestrians are the same person. Therefore, even if the intelligent monitoring device is installed on a moving device and the tracking target is also moving and misses the facial image or takes a blurred facial image, the tracking of the target will not be interrupted. Since the tracking of the target will not be interrupted and only the optimal video image frame of the pedestrian is finally obtained, the recapture rate of the pedestrian can be reduced.
[0055] It should be noted that the preset rule can be set according to the position of the pedestrian area corresponding to the pedestrian in the video image frame containing the pedestrian, the size of the pedestrian area corresponding to the pedestrian, and the clarity of the pedestrian's face.
[0056] In other embodiments, after obtaining the target facial information of the pedestrian, the terminal device may send the facial information to the backend management platform, which then compares the facial information with the facial information in the blacklist database to find the suspect and then issue an early warning. Alternatively, after obtaining the target facial information of the pedestrian, the terminal device may directly compare the target facial information with the facial information in the blacklist database to find the suspect and then issue an early warning.
[0057] In other embodiments, the present application also includes: performing license plate recognition on video image frames to obtain initial license plate numbers corresponding to each video image frame; determining the initial license plate numbers whose number of identical characters is equal to or greater than a preset number as license plate numbers of the same license plate.
[0058] In this embodiment, based on the fact that the probability of having a preset number of identical characters between two license plates in a video is relatively small, the initial license plate numbers with the number of identical characters equal to or greater than the preset number can be determined as the license plate numbers of the same license plate. The characters may include words, letters, and numbers.
[0059] It should be noted that the user can select the license plate recognition algorithm according to the actual situation. For example, a deep learning algorithm is used as the license plate recognition algorithm in this embodiment. This application does not make specific restrictions here. The preset number can be designed by the user according to the actual situation. For example, the preset number is set to 4. Then when the number of identical characters of two license plate numbers is equal to or greater than 4, the two license plate numbers are determined to be the license plate numbers of the same license plate.
[0060] It should be understood that by performing license plate recognition on video image frames, in addition to obtaining the initial license plate number corresponding to each video image frame, other attribute information of the license plate on each video image frame can also be obtained. For example, the type and color of the license plate on each video image frame can also be obtained.
[0061] In other embodiments, due to the influence of factors such as the camera shooting angle, the license plate in the video image frame is tilted or distorted, thereby reducing the recognition accuracy of the license plate. Therefore, when performing license plate recognition on the video image frame, the license plate can be corrected first to obtain a corrected license plate, and then the corrected license plate can be subjected to character detection. The user can select the license plate correction algorithm according to the actual situation. For example, algorithms such as the Hough transform method, the rotation projection method, and the perspective transformation method are used as license plate correction algorithms. This application does not make specific limitations here.
[0062] In other embodiments, license plate recognition is performed on video image frames to obtain initial license plate numbers corresponding to each video image frame, including: performing license plate recognition on video image frames to obtain initial license plate numbers corresponding to each video image frame and recognition scores corresponding to the initial license plate numbers; accordingly, the tracking method also includes: from the initial license plate numbers corresponding to the same license plate, selecting the initial license plate number corresponding to the highest recognition score as the target license plate number of the license plate.
[0063] Since the camera is moving, the license plate image captured may not be very clear, which may lead to errors in the recognition of some characters on the license plate, and then multiple license plate numbers corresponding to one license plate may be obtained after the license plate is recognized, and finally the recapture rate is very high. Therefore, the initial license plate numbers with the same number of characters greater than the preset number are determined as the license plate numbers of the same license plate, and then the initial license plate number corresponding to the highest recognition score is selected from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate. This ensures that the license plate has only one corresponding license plate number, thereby reducing the recapture rate of the license plate.
[0064] The recognition score refers to the accuracy of recognizing the license plate number position on the video image frame as the initial license plate number. Therefore, when multiple initial license plate numbers of the same license plate are obtained, the initial license plate number corresponding to the highest recognition score is used as the target license plate number of the license plate, which can improve the accuracy of the license plate recognition.
[0065] In other embodiments, selecting the initial license plate number corresponding to the highest recognition score as the target license plate number of the license plate includes: checking whether the highest recognition score meets a preset threshold; if the preset threshold is met, using the initial license plate number corresponding to the highest recognition score as the target license plate number of the license plate.
[0066] In this embodiment, there is a certain error when recognizing the license plate number on the video image frame as the initial license plate number. Therefore, if the error is too large, the recognition accuracy of the license plate obtained in the end is low. Therefore, only when the highest recognition score meets the preset threshold, the initial license plate number corresponding to the highest recognition score is used as the target license plate number of the license plate, thereby improving the recognition accuracy of the license plate.
[0067] In some other embodiments, selecting the initial license plate number corresponding to the highest recognition score as the target license plate number of the license plate from the initial license plate numbers corresponding to the same license plate includes:
[0068] If the initial license plate number corresponding to the license plate is not detected again within the preset time interval, the initial license plate number corresponding to the highest recognition score is selected from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate.
[0069] In this embodiment, if the initial license plate number corresponding to the license plate is not detected again within the preset time interval, it means that the vehicle corresponding to the license plate has left the field of view of the camera. At this time, the initial license plate number corresponding to the highest recognition score is selected from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate.
[0070] In other embodiments, the initial license plate number corresponding to the highest recognition score is periodically selected from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate. For example, every 60 seconds, the initial license plate number corresponding to the highest recognition score is selected from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate.
[0071] In other embodiments, after the terminal device determines the target license plate number of the license plate, the terminal device may send the target license plate number of the license plate to the backend management platform, and the backend management platform then compares the target license plate number with the license plate numbers in the blacklist database, thereby discovering a suspicious vehicle and then issuing an early warning. Alternatively, after the terminal device determines the target license plate number of the license plate, the terminal device may also directly compare the target license plate number with the license plate numbers in the blacklist database, thereby discovering a suspicious vehicle and then issuing an early warning.
[0072] In summary, the present application provides a tracking method. First, a video image frame is obtained. Then, pedestrian detection is performed on the video image frame to obtain a first pedestrian area of the first image frame and a second pedestrian area of the second image frame. The first image frame and the second image frame are adjacent video image frames. Then, a target difference is calculated based on the first pedestrian area and the second pedestrian area. If the target difference is less than or equal to the preset difference, the first pedestrian area and the second pedestrian area corresponding to the target difference that is less than or equal to the preset difference are determined as pedestrian areas of the same pedestrian. That is, in the present application, whether the two pedestrian areas are the areas of the same pedestrian is determined based on the target difference of the two pedestrian areas, and whether the two pedestrians are the same person is not determined based on the facial information of the two pedestrians. Therefore, even if the smart camera is installed on a motion device and the tracking target is also moving and misses the facial image or takes a blurred facial image, the tracking of the target will not be interrupted.
[0073] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0074] Embodiment 2
[0075] Figure 3 An example of a tracking device is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown. The device 300 includes:
[0076] The acquisition module 301 is used to acquire video image frames.
[0077] The pedestrian detection module 302 is used to perform pedestrian detection on the video image frame to obtain a first pedestrian region of the first image frame and a second pedestrian region of the second image frame. The first image frame and the second image frame are adjacent video image frames.
[0078] The calculation module 303 is used to calculate the target difference according to the first pedestrian area and the second pedestrian area.
[0079] The determination module 304 is configured to determine the first pedestrian region and the second pedestrian region corresponding to the target difference value that is less than or equal to the preset difference value as pedestrian regions of the same pedestrian if the target difference value is less than or equal to the preset difference value.
[0080] Optionally, the device 300 further includes:
[0081] The speed acquisition module is used to obtain the speed of the motion device.
[0082] The preset difference determination module is used to determine the preset difference according to the speed of the sports device.
[0083] Optionally, the device 300 further includes:
[0084] The screening module is used to screen the video image frames containing the same pedestrian according to preset rules to obtain the optimal video image frame.
[0085] The face recognition module is used to perform face recognition on the optimal video image frame to obtain the target face information of the pedestrian.
[0086] Optionally, the device 300 further includes:
[0087] The license plate recognition module is used to perform license plate recognition on the video image frames to obtain the initial license plate number corresponding to each video image frame.
[0088] The license plate number determination module is used to determine the initial license plate numbers whose number of identical characters is equal to or greater than a preset number as the license plate numbers of the same license plate.
[0089] Optionally, the license plate recognition module is used to perform:
[0090] The license plate recognition is performed on the video image frames to obtain the initial license plate number corresponding to each video image frame and the recognition score corresponding to the initial license plate number.
[0091] Accordingly, the device 300 further includes:
[0092] The selection module is used to select the initial license plate number corresponding to the highest recognition score from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate.
[0093] Optionally, select the module to use for execution:
[0094] Check whether the highest recognition score meets a preset threshold;
[0095] If the preset threshold is met, the initial license plate number corresponding to the highest recognition score is used as the target license plate number.
[0096] Optionally, select the module to use for execution:
[0097] If the initial license plate number corresponding to the license plate is not detected again within the preset time interval, the initial license plate number corresponding to the highest recognition score is selected from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate.
[0098] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the first embodiment of the method of the present application. Their specific functions and technical effects can be found in the part of the method embodiment and will not be repeated here.
[0099] Embodiment 3
[0100] Figure 4 Schematic diagram of the terminal device provided in the third embodiment of the present application. Figure 4 As shown, the terminal device 400 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0101] Exemplarily, the computer program 403 may be divided into one or more modules / units, which are stored in the memory 402 and executed by the processor 401 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 403 in the terminal device 400. For example, the computer program 403 may be divided into an acquisition module, a pedestrian detection module, a calculation module, and a determination module, and the specific functions of each module are as follows:
[0102] Get video image frames;
[0103] Performing pedestrian detection on the video image frames to obtain a first pedestrian region of a first image frame and a second pedestrian region of a second image frame, wherein the first image frame and the second image frame are adjacent video image frames;
[0104] Calculating a target difference according to the first pedestrian area and the second pedestrian area;
[0105] If the target difference is less than or equal to a preset difference, the first pedestrian region and the second pedestrian region corresponding to the target difference that is less than or equal to the preset difference are determined as pedestrian regions of the same pedestrian.
[0106] The terminal device may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 It is only an example of the terminal device 400 and does not constitute a limitation of the terminal device 400. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0107] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware plug-ins, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0108] The memory 402 may be an internal storage unit of the terminal device 400, such as a hard disk or memory of the terminal device 400. The memory 402 may also be an external storage device of the terminal device 400, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 400. Further, the memory 402 may include both an internal storage unit of the terminal device 400 and an external storage device. The memory 402 is used to store the computer program and other programs and data required by the terminal device. The memory 402 may also be used to temporarily store data that has been output or is to be output.
[0109] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0110] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0111] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0112] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or plug-ins can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0113] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0115] If the above-mentioned integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned various method embodiments, and can also be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the above-mentioned computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0116] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some of the technical features therein by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A tracking method, characterized in that: include: Get video image frames; Performing pedestrian detection on the video image frames to obtain a first pedestrian region of a first image frame and a second pedestrian region of a second image frame, wherein the first image frame and the second image frame are adjacent video image frames; The first pedestrian area refers to the coordinate range of pedestrians in the first image frame, and the coordinate range is expressed in coordinates on a coordinate axis established with a first preset point on the first image frame as the center. The first preset point of the first image frame can be set according to actual needs. The second pedestrian area refers to the coordinate range of pedestrians in the second image frame, and the coordinate range is expressed in coordinates on a coordinate axis established with a second preset point on the second image frame as the center. The second preset point of the second image frame can be set according to actual needs. Calculating a target difference according to the first pedestrian region and the second pedestrian region includes: calculating a target difference according to the center coordinates of each pedestrian region, that is, calculating a target difference between the center coordinates of the second pedestrian region and the center coordinates of the first pedestrian region; If the target difference is less than or equal to a preset difference, the first pedestrian region and the second pedestrian region corresponding to the target difference that is less than or equal to the preset difference are determined as pedestrian regions of the same pedestrian; Before determining the first pedestrian region and the second pedestrian region corresponding to the target difference value that is less than or equal to the preset difference value as pedestrian regions of the same pedestrian if the target difference value is less than or equal to the preset difference value, the method includes: Obtain the speed of the moving device; since the camera is mounted on the moving device, the camera moves along with the movement of the moving device; The preset difference is determined according to the speed of the motion device; when the speed of the motion device is fast, the preset difference is larger, and when the speed of the motion device is slow, the preset difference is smaller; since the camera is moving and the person is also moving, the preset difference is set according to the speed of the camera, that is, the speed of the motion device.
2. The tracking method according to claim 1, characterized in that: After determining the first pedestrian region and the second pedestrian region corresponding to the target difference value that is less than or equal to the preset difference value as pedestrian regions of the same pedestrian, the method includes: Filtering the video image frames containing the same pedestrian according to a preset rule to obtain an optimal video image frame; Perform face recognition on the optimal video image frame to obtain target face information of the pedestrian.
3. The tracking method according to claim 1, characterized in that: Also includes: Performing license plate recognition on the video image frames to obtain initial license plate numbers corresponding to each of the video image frames; The initial license plate numbers whose number of identical characters is equal to or greater than a preset number are determined as the license plate numbers of the same license plate.
4. The tracking method according to claim 3, characterized in that: The performing license plate recognition on the video image frames to obtain the initial license plate number corresponding to each of the video image frames includes: Performing license plate recognition on the video image frames to obtain an initial license plate number corresponding to each of the video image frames and a recognition score corresponding to the initial license plate number; Accordingly, the tracking method further includes: From the initial license plate numbers corresponding to the same license plate, the initial license plate number corresponding to the highest recognition score is selected as the target license plate number of the license plate.
5. The tracking method according to claim 4, characterized in that: The step of selecting the initial license plate number corresponding to the highest recognition score as the target license plate number of the license plate includes: Checking whether the highest recognition score meets a preset threshold; If the preset threshold is met, the initial license plate number corresponding to the highest recognition score is used as the target license plate number of the license plate.
6. The tracking method according to claim 4, characterized in that: The step of selecting the initial license plate number corresponding to the highest recognition score from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate includes: If the initial license plate number corresponding to the license plate is not detected again within a preset time interval, the initial license plate number corresponding to the highest recognition score is selected from the initial license plate numbers corresponding to the same license plate as the target license plate number of the license plate.
7. A tracking device, characterized in that: include: An acquisition module, used for acquiring video image frames; a pedestrian detection module, configured to perform pedestrian detection on the video image frame to obtain a first pedestrian region of a first image frame and a second pedestrian region of a second image frame, wherein the first image frame and the second image frame are adjacent video image frames; The first pedestrian area refers to the coordinate range of pedestrians in the first image frame, and the coordinate range is expressed in coordinates on a coordinate axis established with a first preset point on the first image frame as the center. The first preset point of the first image frame can be set according to actual needs. The second pedestrian area refers to the coordinate range of pedestrians in the second image frame, and the coordinate range is expressed in coordinates on a coordinate axis established with a second preset point on the second image frame as the center. The second preset point of the second image frame can be set according to actual needs. a calculation module, configured to calculate a target difference according to the first pedestrian region and the second pedestrian region, comprising: calculating the target difference according to the center coordinates of each pedestrian region, that is, calculating the target difference between the center coordinates of the second pedestrian region and the center coordinates of the first pedestrian region; a determination module, configured to determine, if the target difference is less than or equal to a preset difference, the first pedestrian region and the second pedestrian region corresponding to the target difference that is less than or equal to the preset difference as pedestrian regions of the same pedestrian; Before determining the first pedestrian region and the second pedestrian region corresponding to the target difference value that is less than or equal to the preset difference value as pedestrian regions of the same pedestrian if the target difference value is less than or equal to the preset difference value, the method includes: Obtain the speed of the moving device; since the camera is mounted on the moving device, the camera moves along with the movement of the moving device; The preset difference is determined according to the speed of the motion device; when the speed of the motion device is fast, the preset difference is larger, and when the speed of the motion device is slow, the preset difference is smaller; since the camera is moving and the person is also moving, the preset difference is set according to the speed of the camera, that is, the speed of the motion device.
8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
