Distance detection method, device, storage medium and electronic device
By using the target detection model to detect and judge the video frames in the bank ATM queue, the problem of high labor supervision costs is solved, efficient and accurate safe distance monitoring is achieved, and costs are reduced.
Patent Information
- Application Number
- CN202210327299.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2042-03-30
AI Technical Summary
When maintaining a safe distance in line with bank ATMs, the cost of human supervision in the existing technology is high, and machine learning algorithms require a large amount of training data and artificial annotation, which is high.
By collecting video frames in the target monitoring video, using video frames to learn and train the target network, the target detection model is obtained, which is used to determine whether the distance between two adjacent queuing figures meets the preset distance standard, and adjust the interval distance through laser projection reminder.
It reduces the cost of labor supervision when maintaining a safe distance in bank ATM queues, improves the accuracy and efficiency of distance detection, and reduces dependence on training data.
Smart Images

Figure CN114719767B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and specifically, to a distance detection method, device, storage medium and electronic device. Background Art
[0002] At present, the requirement to maintain a certain distance in the queue of bank ATMs requires corresponding staff to maintain it in most scenarios, but it is unregulated in many scenarios. For example, there is no relevant control in the queue of ATMs. In addition, most of the existing technologies use machine learning algorithms to predict the distance, but manual maintenance will lead to a waste of human resources. Prediction by machine learning algorithms requires certain training data, and the acquisition of this data also requires some costs (requires manual marking of distances).
[0003] There is currently no effective solution to the problem of high human supervision costs when requiring bank users to queue up and maintain a safe distance. Summary of the invention
[0004] The main purpose of the present application is to provide a distance detection method, device, storage medium and electronic device to solve the problem of high human supervision costs when requiring bank users to queue and maintain a safe distance in the related art.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a distance detection method is provided. The method comprises: collecting video frames in a target monitoring video, wherein the video frames at least include: image frames of target identification and image frames including queued persons; using the video frames to learn and train the target network to obtain a target detection model; and determining whether the distance between the two adjacent target queued persons meets a preset distance standard when the relative positions of the two adjacent target queued persons in the image frames of the queued persons are determined based on the target detection model and have not moved.
[0006] Furthermore, collecting video frames in the target surveillance video includes: determining a start frame and an end frame in the target surveillance video according to a first preset time period; and intercepting a video stream of a start frame and an end frame in the target surveillance video to obtain video frames.
[0007] Furthermore, using video frames to learn and train the target algorithm network includes: marking the image frame information in the video frame according to the target algorithm to obtain the target video frame, wherein the image frame information at least includes: image frame type, horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame; normalizing the horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame according to the width and height of the image frame in the target video frame to obtain processed data; and using the processed data and image frame type to learn and train the target algorithm network.
[0008] Furthermore, after the target network is trained using video frames to obtain a target detection model, the method also includes: calculating a relative displacement according to the target detection model, wherein the relative displacement is a moving distance between the relative positions of two adjacent target queueing persons; and when the relative displacement is less than a preset threshold, determining that the relative positions of two adjacent target queueing persons in the image frame of the queueing persons have not moved.
[0009] Further, calculating the relative displacement according to the target detection model includes: setting a second preset time period; and calculating the relative displacement according to the target detection model within the second preset time period.
[0010] Furthermore, determining whether the distance between two adjacent target queueing persons meets the preset distance standard includes: calculating the distance between adjacent identifications in the image frame of the target identification to obtain the target distance; comparing the distance between two adjacent target queueing persons with the target distance to obtain a comparison result; if the comparison result indicates that the distance between two adjacent target queueing persons is less than the target distance, determining that the distance between the two adjacent target queueing persons does not meet the preset distance standard; if the comparison result indicates that the distance between two adjacent target queueing persons is greater than or equal to the target distance, determining that the distance between the two adjacent target queueing persons meets the preset distance standard.
[0011] Furthermore, after determining that the distance between two adjacent target queue persons does not meet the preset distance standard, the method also includes: projecting a laser onto the target ground where the two adjacent target queue persons are located through a target device to remind the two adjacent target queue persons to adjust the interval distance.
[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a distance detection device is provided. The device comprises: a collection unit, used to collect video frames in a target monitoring video, wherein the video frames at least include: image frames of target identification and image frames including queued persons; a training unit, used to use the video frames to train the target network to obtain a target detection model; and a judgment unit, used to judge whether the distance between two adjacent target queued persons meets a preset distance standard when the relative positions of the two adjacent target queued persons in the image frames of the queued persons are determined to be unchanged based on the target detection model.
[0013] Furthermore, the acquisition unit includes: a first determination module, used to determine the start frame and the end frame in the target monitoring video according to a first preset time period; an interception module, used to intercept the video stream of the start frame and the end frame in the target monitoring video to obtain a video frame.
[0014] Furthermore, the training unit includes: an identification module, which is used to identify the image frame information in the video frame according to the target algorithm to obtain the target video frame, wherein the image frame information at least includes: image frame type, horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame; a processing module, which is used to normalize the horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame according to the width and height of the image frame in the target video frame to obtain processed data; a training module, which is used to use the processed data and image frame type to learn and train the target algorithm network.
[0015] Furthermore, the device also includes: a calculation unit, which is used to calculate the relative displacement according to the target detection model after learning and training the target network using video frames to obtain the target detection model, wherein the relative displacement is the moving distance of the relative positions of two adjacent target queuing persons; and a determination unit, which is used to determine that the relative positions of two adjacent target queuing persons in the image frame of the queuing persons have not moved when the relative displacement is less than a preset threshold.
[0016] Furthermore, the calculation unit includes: a setting module, used for setting a second preset time period; and a first calculation module, used for calculating the relative displacement according to the target detection model within the second preset time period.
[0017] Furthermore, the judgment unit includes: a second calculation module, which is used to calculate the distance between adjacent identifications in the image frame of the target identification to obtain the target distance; a comparison module, which is used to compare the distance between two adjacent target queuing persons with the target distance to obtain a comparison result; a second determination module, which is used to determine that the distance between two adjacent target queuing persons does not meet the preset distance standard if the comparison result indicates that the distance between two adjacent target queuing persons is less than the target distance; and a third determination module, which is used to determine that the distance between two adjacent target queuing persons meets the preset distance standard if the comparison result indicates that the distance between two adjacent target queuing persons is greater than or equal to the target distance.
[0018] Furthermore, the device also includes: a processing unit, which is used to project a laser onto the target ground where the two adjacent target queue persons are located through a target device after determining that the distance between two adjacent target queue persons does not meet the preset distance standard, so as to remind the two adjacent target queue persons to adjust the interval distance.
[0019] Through this application, the following steps are adopted: video frames in the target monitoring video are collected, wherein the video frames at least include: image frames of target identification and image frames including queued people; the target network is trained using the video frames to obtain a target detection model; when the relative positions of two adjacent target queued people in the image frames of the queued people are determined based on the target detection model, it is determined whether the distance between the two adjacent target queued people meets the preset distance standard, thereby solving the problem of high human supervision costs when requiring bank users to queue and maintain a safe distance in the related technology. The distance of the collected video frames is judged by the target detection model, thereby achieving the effect of reducing the human supervision cost when requiring bank users to queue and maintain a safe distance. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 is a flow chart of a distance detection method provided according to an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of a distance detection device provided according to an embodiment of the present application;
[0023] Figure 3 It is a schematic diagram of the network architecture of the distance detection electronic device provided according to the embodiment of the present application. DETAILED DESCRIPTION
[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0025] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0028] The present invention is described below in conjunction with preferred implementation steps. Figure 1 is a flow chart of a distance detection method provided according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0029] Step S101, collecting video frames in the target monitoring video, wherein the video frames at least include: image frames of the target logo and image frames of the queued persons.
[0030] Specifically, the present application uses a YOLO algorithm to capture and collect video frames of people waiting in line at an ATM and yellow warning stickers (corresponding to the target logo in the present application) through a camera that shoots video, wherein the video surveillance uploads video stream data through the network.
[0031] Optionally, in the distance detection method provided in an embodiment of the present application, collecting video frames in the target surveillance video includes: determining a start frame and an end frame in the target surveillance video according to a first preset time period; intercepting a video stream of a start frame and an end frame in the target surveillance video to obtain a video frame.
[0032] Specifically, the surveillance video uploaded in real time is frame extracted, and the start video frame image and the end video frame image are taken with k milliseconds (corresponding to the first preset time period in this application) as the interval, wherein the video frame may include the waiting queue and the yellow warning sticker. By acquiring the surveillance video in real time, the extraction of static frame images is more accurate.
[0033] Step S102, using video frames to train the target network to obtain a target detection model.
[0034] Specifically, the video frames captured by the surveillance video are input into the YOLOv4 network for training to obtain the target detection model.
[0035] Optionally, in the distance detection method provided in the embodiment of the present application, using video frames to learn and train the target algorithm network includes: identifying the image frame information in the video frame according to the target algorithm to obtain the target video frame, wherein the image frame information includes at least: image frame type, horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame; normalizing the horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame according to the width and height of the image frame in the target video frame to obtain processed data; and using the processed data and image frame type to learn and train the target algorithm network.
[0036] Specifically, the image information obtained in the video is annotated according to the YOLO algorithm. For example, each line of image frame information can be the image frame type, the upper left corner horizontal coordinate (x), the upper left corner vertical coordinate (y), the frame width (width), and the frame height (height). Except for the category, the identification of other image frame information can be normalized by dividing by the width and height of the picture. The YOLOv4 network is trained with the processed data, and the detection model with the best performance on the verification set is saved as the target detection model in this application, thereby improving the training accuracy of the target detection model.
[0037] Optionally, in the distance detection method provided in the embodiment of the present application, after the target network is trained using video frames to obtain a target detection model, the method further includes: calculating a relative displacement according to the target detection model, wherein the relative displacement is the moving distance of the relative positions of two adjacent target queuing persons; when the relative displacement is less than a preset threshold, determining that the relative positions of two adjacent target queuing persons in the image frame of the queuing persons have not moved.
[0038] Specifically, calculating the relative displacement according to the target detection model includes: setting a second preset time period; and calculating the relative displacement according to the target detection model within the second preset time period.
[0039] It should be noted that the second preset time period is the minimum monitoring unit for monitoring whether the relative positions of two adjacent target queue persons move.
[0040] For example, according to the YOLOv4 model, the displacement between two adjacent queuing persons is calculated within 1 s (corresponding to the second preset time in this application). When the offset is less than t, it is considered that there is no movement between the queuing persons, and the queuing persons are considered to be in a relatively stable state, suitable for safety distance detection; when the offset is greater than t, it is considered that there is movement between the queuing persons, that is, the queue moves forward, and it is not suitable for safety distance detection. By judging the magnitude of the displacement of the queuing crowd, the accuracy of the target detection model is reflected in this application.
[0041] Step S103: When it is determined that the relative positions of two adjacent queuing persons in the image frame of the queuing persons based on the target detection model have not moved, determine whether the distance between the two adjacent queuing persons meets the preset distance standard.
[0042] Specifically, if there is no relative movement between two adjacent queuing persons so far, extract the coordinate information calculated within k milliseconds to determine whether the distance between the two adjacent queuing persons meets the preset distance standard.
[0043] Optionally, in the distance detection method provided in the embodiment of this application, determining whether the distance between two adjacent queuing persons meets the preset distance standard includes: calculating the distance between adjacent identifiers in the image frame of the target identifier to obtain the target distance; comparing the distance between the two adjacent queuing persons with the target distance to obtain a comparison result; if the comparison result indicates that the distance between the two adjacent queuing persons is less than the target distance, determine that the distance between the two adjacent queuing persons does not meet the preset distance standard; if the comparison result indicates that the distance between the two adjacent queuing persons is greater than or equal to the target distance, determine that the distance between the two adjacent queuing persons meets the preset distance standard.
[0044] For example, calculate the relative distance d1 between adjacent yellow warning strips, and use this as a threshold, and the relative distance d n , when d n < d1, it is considered that the distance between the detected relative queuing persons does not meet the safety distance regulations.
[0045] Among them, d = (x1 + 0.5w1)-(x2 + 0.5w2), where x1 is the coordinate value of the queuing person in the starting frame, x2 is the coordinate value of the queuing person in the ending frame, w1 is the image width in the starting frame, and w2 is the image width in the ending frame.
[0046] That is, by intelligently judging whether the distance between two adjacent queuing persons meets the preset distance standard, unnecessary labor supervision expenses are reduced.
[0047] Optionally, in the distance detection method provided in the embodiment of the present application, after determining that the distance between two adjacent target queue persons does not meet the preset distance standard, the method also includes: projecting a laser onto the target ground where the two adjacent target queue persons are located through a target device to remind the two adjacent target queue persons to adjust the interval distance.
[0048] Specifically, when the distance between two adjacent detection targets does not meet the safety regulations, a laser is used to project a ground warning to the center of the object that does not meet the safety distance, so as to remind the two adjacent target queues to adjust the interval distance, further reducing unnecessary manpower supervision expenses.
[0049] In summary, the distance detection method provided by the embodiment of the present application collects video frames in the target monitoring video, wherein the video frames at least include: image frames of target identification and image frames of queued people; the target network is trained using the video frames to obtain a target detection model; when the relative positions of two adjacent target queued people in the image frames of the queued people are determined based on the target detection model, it is determined whether the distance between the two adjacent target queued people meets the preset distance standard, thereby solving the problem of high human supervision costs when requiring bank users to queue and maintain a safe distance in the related technology. The distance of the collected video frames is judged by the target detection model, thereby achieving the effect of reducing the human supervision costs when requiring bank users to queue and maintain a safe distance.
[0050] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] The embodiment of the present application also provides a distance detection device. It should be noted that the distance detection device of the embodiment of the present application can be used to execute the distance detection method provided in the embodiment of the present application. The distance detection device provided in the embodiment of the present application is introduced below.
[0052] Figure 2 is a schematic diagram of a distance detection device according to an embodiment of the present application. Figure 2 As shown, the device includes: a collection unit 201, a training unit 202, and a judgment unit 203.
[0053] Specifically, the acquisition unit 201 is used to acquire video frames in the target monitoring video, wherein the video frames at least include: image frames of the target identification and image frames of the queued persons;
[0054] A training unit 202 is used to use video frames to train the target network to obtain a target detection model;
[0055] The judgment unit 203 is used to judge whether the distance between two adjacent target queue persons meets a preset distance standard when it is determined based on the target detection model that the relative positions of two adjacent target queue persons in the image frame of the queue persons have not moved.
[0056] In summary, the distance detection device provided by the embodiment of the present application collects video frames in the target monitoring video through the acquisition unit 201, wherein the video frames at least include: image frames of target identification and image frames including queued persons; the training unit 202 uses the video frames to learn and train the target network to obtain a target detection model; the judgment unit 203 determines whether the distance between two adjacent target queued persons meets the preset distance standard when the relative positions of the two adjacent target queued persons in the image frame of the queued persons are determined based on the target detection model, thereby solving the problem of high human supervision costs when requiring bank users to queue and maintain a safe distance in the related technology. The distance of the collected video frames is judged by the target detection model, thereby achieving the effect of reducing the human supervision costs when requiring bank users to queue and maintain a safe distance.
[0057] Optionally, in the distance detection device provided in an embodiment of the present application, the acquisition unit 201 includes: a first determination module, used to determine the start frame and the end frame in the target surveillance video according to a first preset time period; an interception module, used to intercept the video stream of the start frame and the end frame in the target surveillance video to obtain a video frame.
[0058] Optionally, in the distance detection device provided in the embodiment of the present application, the training unit 202 includes: an identification module, which is used to identify the image frame information in the video frame according to the target algorithm to obtain the target video frame, wherein the image frame information at least includes: image frame type, horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame; a processing module, which is used to normalize the horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame according to the width and height of the image frame in the target video frame to obtain processed data; a training module, which is used to use the processed data and image frame type to learn and train the target algorithm network.
[0059] Optionally, in the distance detection device provided in the embodiment of the present application, the device also includes: a calculation unit, used to calculate the relative displacement according to the target detection model after learning and training the target network using video frames to obtain the target detection model, wherein the relative displacement is the moving distance of the relative positions of two adjacent target queuing persons; and a determination unit, used to determine that the relative positions of two adjacent target queuing persons in the image frame of the queuing persons have not moved when the relative displacement is less than a preset threshold.
[0060] Optionally, in the distance detection device provided in the embodiment of the present application, the calculation unit includes: a setting module, used to set a second preset time period; and a first calculation module, used to calculate the relative displacement according to the target detection model within the second preset time period.
[0061] Optionally, in the distance detection device provided in the embodiment of the present application, the judgment unit 203 includes: a calculation module, which is used to calculate the distance between adjacent identifications in the image frame of the target identification to obtain the target distance; a comparison module, which is used to compare the distance between two adjacent target queuing persons with the target distance to obtain a comparison result; a second determination module, which is used to determine that the distance between the two adjacent target queuing persons does not meet the preset distance standard if the comparison result indicates that the distance between the two adjacent target queuing persons is less than the target distance; and a third determination module, which is used to determine that the distance between the two adjacent target queuing persons meets the preset distance standard if the comparison result indicates that the distance between the two adjacent target queuing persons is greater than or equal to the target distance.
[0062] Optionally, in the distance detection device provided in the embodiment of the present application, the device also includes: a processing unit, which is used to project a laser onto the target ground where the two adjacent target queue persons are located through a target device after determining that the distance between two adjacent target queue persons does not meet a preset distance standard, so as to remind the two adjacent target queue persons to adjust the interval distance.
[0063] The distance detection device includes a processor and a memory. The above-mentioned acquisition unit 201, training unit 202, judgment unit 203, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0064] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the distance detection is performed by adjusting the kernel parameters.
[0065] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0066] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, a distance detection method is implemented.
[0067] An embodiment of the present invention provides a processor, which is used to run a program, wherein the distance detection method is executed when the program is running.
[0068] like Figure 3As shown, an embodiment of the present invention provides an electronic device, the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: acquiring video frames in a target monitoring video, wherein the video frames at least include: image frames of target identifications, image frames including queued persons; using the video frames to learn and train a target network to obtain a target detection model; and determining whether the distance between the two adjacent target queued persons meets a preset distance standard when it is determined based on the target detection model that the relative positions of two adjacent target queued persons in the image frames of the queued persons have not moved.
[0069] When the processor executes the program, the following steps are also implemented: determining the start frame and the end frame in the target monitoring video according to the first preset time period; intercepting the video stream of the start frame and the end frame in the target monitoring video to obtain a video frame.
[0070] When the processor executes the program, the following steps are also implemented: the image frame information in the video frame is identified according to the target algorithm to obtain the target video frame, wherein the image frame information at least includes: image frame type, horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame; the horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame are normalized according to the width and height of the image frame in the target video frame to obtain processed data; and the target algorithm network is trained using the processed data and image frame type.
[0071] When the processor executes the program, the following steps are also implemented: after using the video frame to learn and train the target network to obtain the target detection model, the relative displacement is calculated according to the target detection model, wherein the relative displacement is the moving distance of the relative positions of two adjacent target queueing persons; when the relative displacement is less than a preset threshold, it is determined that the relative positions of the two adjacent target queueing persons in the image frame of the queueing persons have not moved.
[0072] When the processor executes the program, the following steps are also implemented: setting a second preset time period; and calculating the relative displacement according to the target detection model within the second preset time period.
[0073] When the processor executes the program, the following steps are also implemented: calculating the distance between adjacent identifications in the image frame of the target identification to obtain the target distance; comparing the distance between two adjacent target queue persons with the target distance to obtain a comparison result; if the comparison result indicates that the distance between the two adjacent target queue persons is less than the target distance, determining that the distance between the two adjacent target queue persons does not meet the preset distance standard; if the comparison result indicates that the distance between the two adjacent target queue persons is greater than or equal to the target distance, determining that the distance between the two adjacent target queue persons meets the preset distance standard.
[0074] When the processor executes the program, the following steps are also implemented: after determining that the distance between two adjacent target queue persons does not meet the preset distance standard, a laser is projected onto the target ground where the two adjacent target queue persons are located through a target device to remind the two adjacent target queue persons to adjust the interval distance.
[0075] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0076] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: acquiring video frames in a target monitoring video, wherein the video frames at least include: image frames of target identifications and image frames of queued persons; using the video frames to learn and train a target network to obtain a target detection model; and determining whether the distance between two adjacent target queued persons meets a preset distance standard when it is determined based on the target detection model that the relative positions of two adjacent target queued persons in the image frames of the queued persons have not moved.
[0077] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: determining a start frame and an end frame in a target surveillance video according to a first preset time period; intercepting a video stream of a start frame and an end frame in the target surveillance video to obtain a video frame.
[0078] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: identifying the image frame information in the video frame according to the target algorithm to obtain the target video frame, wherein the image frame information at least includes: image frame type, horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame; normalizing the horizontal coordinate, vertical coordinate, total width of the picture frame, and total height of the picture frame according to the width and height of the image frame in the target video frame to obtain processed data; and using the processed data and image frame type to learn and train the target algorithm network.
[0079] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: after using video frames to learn and train the target network to obtain a target detection model, the relative displacement is calculated according to the target detection model, wherein the relative displacement is the moving distance of the relative positions of two adjacent target queuing persons; when the relative displacement is less than a preset threshold, it is determined that the relative positions of two adjacent target queuing persons in the image frame of the queuing persons have not moved.
[0080] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: setting a second preset time period; and calculating the relative displacement according to the target detection model within the second preset time period.
[0081] When executed on a data processing device, the method is also suitable for executing a program that is initialized with the following method steps: calculating the distance between adjacent identifications in an image frame of a target identification to obtain a target distance; comparing the distance between two adjacent target queue characters with the target distance to obtain a comparison result; if the comparison result indicates that the distance between two adjacent target queue characters is less than the target distance, determining that the distance between the two adjacent target queue characters does not meet a preset distance standard; if the comparison result indicates that the distance between two adjacent target queue characters is greater than or equal to the target distance, determining that the distance between the two adjacent target queue characters meets a preset distance standard.
[0082] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: after determining that the distance between two adjacent target queue persons does not meet the preset distance standard, a laser is projected onto the target ground where the two adjacent target queue persons are located through a target device to remind the two adjacent target queue persons to adjust the interval distance.
[0083] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0084] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0085] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0086] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0087] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0088] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0089] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0090] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0091] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0092] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A distance detection method, characterized in that: include: Collecting video frames in the target monitoring video, wherein the video frames at least include: image frames of the target identification and image frames of the queued persons, wherein the target identification is identification information of the warning information; Using the video frames to train the target network to obtain a target detection model; When it is determined based on the target detection model that the relative positions of two adjacent target queue persons in the image frame of the queue persons have not moved, determining whether the distance between the two adjacent target queue persons meets a preset distance standard; Wherein, after the target network is trained by using the video frame to obtain the target detection model, the method further includes: Calculating a relative displacement according to the target detection model, wherein the relative displacement is a moving distance between the relative positions of the two adjacent target queue persons; When the relative displacement is less than a preset threshold, it is determined that the relative positions of two adjacent target queue persons in the image frame of the queue persons have not moved.
2. The method according to claim 1, characterized in that The video frames in the target surveillance video include: Determining a start frame and an end frame in the target surveillance video according to a first preset time period; The video streams of the start frame and the end frame in the target monitoring video are intercepted to obtain the video frame.
3. The method according to claim 1, characterized in that Using the video frame to learn and train the target algorithm network includes: Identify the image frame information in the video frame according to the target algorithm to obtain a target video frame, wherein the image frame information at least includes: image frame type, abscissa, ordinate, total width of the picture frame, and total height of the picture frame; Normalizing the abscissa, the ordinate, the total width of the picture frame, and the total height of the picture frame according to the width and height of the image frame in the target video frame to obtain processed data; The processed data and the image frame type are used to perform learning and training on a target algorithm network.
4. The method according to claim 1, characterized in that: Calculating the relative displacement according to the target detection model includes: Setting a second preset time period; The relative displacement is calculated according to the target detection model within the second preset time period.
5. The method according to claim 1, characterized in that Determining whether the distance between two adjacent target queue persons meets the preset distance standard includes: Calculating the distances between adjacent marks in the image frame of the target mark to obtain the target distance; Compare the distance between two adjacent target queue persons with the target distance to obtain a comparison result; If the comparison result indicates that the distance between two adjacent target queue persons is less than the target distance, it is determined that the distance between the two adjacent target queue persons does not meet the preset distance standard; If the comparison result indicates that the distance between two adjacent target queue persons is greater than or equal to the target distance, it is determined that the distance between the two adjacent target queue persons meets the preset distance standard.
6. The method according to claim 5, characterized in that After determining that the distance between two adjacent target queue persons does not meet the preset distance standard, the method further includes: The laser is projected onto the target ground where the two adjacent target queue persons are located through the target device to remind the two adjacent target queue persons to adjust the interval distance.
7. A distance detection device, characterized in that: include: A collection unit, used for collecting video frames in the target monitoring video, wherein the video frames at least include: image frames of the target identification and image frames of the queued persons, wherein the target identification is identification information of the warning information; A training unit, used to use the video frames to train the target network to obtain a target detection model; A judging unit, configured to judge whether the distance between two adjacent target queue persons meets a preset distance standard when it is determined based on the target detection model that the relative positions of the two adjacent target queue persons in the image frame of the queue persons have not moved; The device further includes: a calculation unit, which is used to calculate a relative displacement according to the target detection model after learning and training the target network using video frames to obtain a target detection model, wherein the relative displacement is the moving distance of the relative positions of the two adjacent target queuing persons; and a determination unit, which is used to determine that the relative positions of the two adjacent target queuing persons in the image frame of the queuing persons have not moved when the relative displacement is less than a preset threshold.
8. A computer-readable storage medium, characterized in that: The storage medium stores a program, wherein the program executes the method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: include: The method comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Image data detection method and device
CN112287869A
Queuing guidance method, device and system, electronic equipment and storage medium
CN112735019A
Public place queuing abnormal behavior detection method based on OpenPose and OpenCV
CN113989707A