A method and a detection system and a computing device for detecting intelligent recognition operation performance of security inspection equipment
By employing multi-threaded processing and asynchronous data acquisition, the time accuracy problem in detecting the computational speed of intelligent recognition algorithms for security inspection equipment is solved, achieving a high-precision and highly objective detection method suitable for evaluating the intelligent recognition computational performance of security inspection equipment.
Patent Information
- Application Number
- CN202510896871.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-06-30
AI Technical Summary
Existing technologies for testing the computational speed of intelligent recognition algorithms in security inspection equipment suffer from insufficient time accuracy in the collected results, especially under high-frequency acquisition equipment and high computing power requirements, which cannot guarantee the objectivity and accuracy of the collected results.
A multi-threaded processing logic is adopted to asynchronously acquire data from distance sensors and video capture devices. Data inflection points and text labels are identified through asynchronous threads, and the intelligent recognition computing performance of security inspection equipment is calculated in combination with timestamps. Data acquisition and calculation time nodes are processed separately to avoid the impact of computation time on the acquisition results.
It improves the detection accuracy and objectivity of the intelligent recognition algorithm in security inspection equipment, ensures the precision and time accuracy of the measurement method, and is suitable for portable detection of various types of security inspection equipment.
Smart Images

Figure CN120803768B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of security inspection equipment testing technology, specifically to a method, testing system, and computing device for testing the intelligent recognition computing performance of security inspection equipment. Background Technology
[0002] The processing speed of intelligent recognition algorithms in security inspection equipment is a crucial indicator of its performance and a key criterion for determining whether it meets national standards. Industry professionals must not only use objective and impartial testing systems to measure the processing speed of these algorithms but also ensure that the time accuracy of the objective measurements is not lower than the processing accuracy of the intelligent recognition algorithm. Since the processing speed of the intelligent recognition algorithm is closely related to the performance of its hardware, high-performance hardware can achieve processing speeds of tens of milliseconds, meaning that processing performance is positively correlated with hardware performance. This poses a challenge to the processing performance of objective detection systems.
[0003] Therefore, a technical solution is needed to provide a measurement method that ensures the time accuracy of the intelligent recognition algorithm running speed of security inspection equipment, making the measurement method more objective and precise. Summary of the Invention
[0004] This invention aims to provide a method, system, and computing device for testing the intelligent recognition computing performance of security inspection equipment. It provides a measurement method that ensures time accuracy for testing the running speed of the intelligent recognition algorithm of security inspection equipment, and the measurement method is more objective and precise.
[0005] According to one aspect of the present invention, a method for detecting the intelligent identification computing performance of security inspection equipment is provided, the method comprising:
[0006] Asynchronously acquire distance data sequences collected by distance sensors installed in the detection chamber of the security inspection equipment, and record the current timestamp as the first reference time data before acquiring the distance data sequences;
[0007] Asynchronously determine whether there is a data inflection point and the location of the data inflection point in the distance data sequence;
[0008] Asynchronously acquire the image frame sequence acquired by the video acquisition device from the video acquisition interface of the security inspection equipment, and record the current timestamp as a second reference time data before acquiring the image frame sequence;
[0009] Asynchronous identification is performed to determine whether the security inspection device adds a text label to the corresponding image frame in the image frame sequence based on the result of intelligent identification calculation, and to determine the position of the label image frame where the text label first appears.
[0010] Calculate the metrics used to evaluate the performance of the intelligent recognition computation of the security inspection equipment, including:
[0011] The first time is calculated based on the first reference time data, the data inflection point position, and the first sampling frequency of the distance sensor, and is used as the start time of the intelligent identification operation of the security inspection equipment;
[0012] The second time is calculated based on the second reference time, the position of the tag image frame, and the second sampling frequency of the video collector, and is used as the end time of the intelligent recognition operation of the security inspection equipment;
[0013] The difference between the end time and the start time is used to evaluate the performance of the intelligent recognition calculation of the security inspection equipment.
[0014] According to some embodiments, the asynchronous acquisition of distance data sequence collected by a distance sensor set in the detection chamber of the security inspection equipment is performed in the first thread, and the current timestamp is recorded as the first reference time data before acquiring the distance data sequence;
[0015] In the second thread, the asynchronous determination of whether there is a data inflection point and the location of the data inflection point in the distance data sequence is performed.
[0016] In the third thread, the asynchronous acquisition of the image frame sequence acquired by the video acquisition device from the video acquisition interface of the security inspection equipment is performed, and the current timestamp is recorded as the second reference time data before acquiring the image frame sequence;
[0017] In the fourth thread, the asynchronous identification is performed to determine whether the security inspection device has added a text label to the corresponding image frame in the image frame sequence based on the result of the intelligent identification operation, and the position of the label image frame where the text label first appears is determined.
[0018] According to some embodiments, the asynchronous acquisition of distance data sequences collected by distance sensors disposed within the detection chamber of the security inspection equipment includes:
[0019] Monitor the interface cache of the distance sensor, retrieve the newly added data from the interface cache of the distance sensor and store it in the first global storage queue to obtain the distance data sequence.
[0020] According to some embodiments, the asynchronous determination of whether a data inflection point exists and the location of the data inflection point in the distance data sequence includes:
[0021] The data in the distance data sequence whose value decreases by more than a predetermined threshold compared to the value of adjacent data is used as the data inflection point;
[0022] Calculate the position of the data inflection point in the distance data sequence based on the data inflection point.
[0023] According to some embodiments, the asynchronous acquisition of distance data sequences collected by distance sensors disposed within the detection chamber of the security inspection equipment includes:
[0024] Monitor the interface cache of the distance sensor, retrieve the new data in the interface cache of the distance sensor and store it in a temporary queue;
[0025] When the cumulative length of data stored in the temporary queue is equal to the length of the temporary queue, the data in the temporary queue is copied to the first global queue as the distance data sequence.
[0026] According to some embodiments, the asynchronous determination of whether a data inflection point exists and the location of the data inflection point in the distance data sequence includes:
[0027] Copy the data in the temporary queue to the first global queue, and then clear the temporary queue;
[0028] The data in the distance data sequence whose value decreases by more than a predetermined threshold compared to the value of adjacent data is used as the data inflection point;
[0029] Calculate the position of the data inflection point in the distance data sequence based on the data inflection point.
[0030] According to some embodiments, the asynchronous acquisition of image frame sequences acquired by the video acquisition device from the video acquisition interface of the security inspection equipment includes:
[0031] The image frame data collected by the interface of the video capture device is read and stored in the second global storage queue to obtain the image frame sequence.
[0032] According to some embodiments, the asynchronous identification of whether a text tag added by the security inspection device to the corresponding image frame of the image frame sequence based on the result of intelligent identification calculation, and determining the position of the tag image frame where the text tag first appears, includes:
[0033] Optical character recognition is performed on the last image frame data stored in the image frame sequence to determine whether the text label exists;
[0034] If the text label exists in the tail image frame data, then delete the tail image frame data and use the preceding image frame data as the tail image frame data.
[0035] Repeat the above steps to perform optical character recognition on the tail image frame data containing the text label until the tail image frame data of the image frame sequence does not contain the text label. Then, use the currently stored data length of the image frame sequence plus 1 as the position of the label image frame.
[0036] According to some embodiments, a line interval range in which the text label appears in an image frame is preset, and the line interval range is used as a target detection range for identifying whether the text label exists in the image frame sequence.
[0037] According to some embodiments, the first thread, the second thread, and the third thread are started in the main thread;
[0038] After determining that there is a data inflection point in the distance data sequence, the second thread sends a first message and starts the fourth thread;
[0039] The first thread terminates its execution upon receiving the first message;
[0040] When the fourth thread detects the presence of the text label in the image frame sequence, it sends a second message.
[0041] After determining the position of the tag image frame, the fourth thread sends a third message;
[0042] The third thread terminates its operation upon receiving the second message.
[0043] After receiving the third message, the main thread executes the calculation of the performance indicators used to evaluate the intelligent recognition operation of the security inspection equipment.
[0044] According to some embodiments, the first thread, the third thread, and the fourth thread are started in the main thread;
[0045] When the length of the data stored in the temporary queue is equal to the length of the temporary queue, the first thread starts the second thread;
[0046] After determining that there is a data inflection point in the distance data sequence, the second thread sends a first message;
[0047] The first thread terminates its execution upon receiving the first message;
[0048] After receiving the first message, the fourth thread sends a second message when it recognizes the presence of the text label in the image frame sequence.
[0049] After determining the position of the tag image frame, the fourth thread sends a third message;
[0050] The third thread terminates its operation upon receiving the second message.
[0051] After receiving the third message, the main thread executes the calculation of the performance indicators used to evaluate the intelligent recognition operation of the security inspection equipment.
[0052] According to some embodiments, the first thread and the second thread are started in the main thread;
[0053] After determining that there is a data inflection point in the distance data sequence, the second thread sends a first message and starts the third and fourth threads;
[0054] The first thread terminates its execution upon receiving the first message;
[0055] When the fourth thread detects the presence of the text label in the image frame sequence, it sends a second message.
[0056] After determining the position of the tag image frame, the fourth thread sends a third message;
[0057] The third thread terminates its operation upon receiving the second message.
[0058] After receiving the third message, the main thread executes the calculation of the performance indicators used to evaluate the intelligent recognition operation of the security inspection equipment.
[0059] According to another aspect of the present invention, a detection system for detecting the intelligent identification computing performance of security inspection equipment is provided, characterized in that the detection system comprises: a distance sensor, a video acquisition unit, a processing unit, and a memory, wherein,
[0060] The distance sensor is used to collect distance data generated by the width of the security inspection equipment channel and the changes in the width.
[0061] The video capture device is used to collect image frame data of the screen images and videos output by the security inspection equipment;
[0062] The processing unit receives distance data collected from the distance sensor and image frame data collected from the video capture device, and performs calculations to determine the start time, end time, and duration of the intelligent recognition operation.
[0063] The memory stores a computer program that, when executed by the processing unit, implements the method described in any of the preceding descriptions.
[0064] According to another aspect of the present invention, a computing device is provided, comprising:
[0065] Processor; and
[0066] A memory that stores a computer program, which, when executed by the processor, implements the method as described in any of the preceding methods.
[0067] According to embodiments of the present invention, distance data sequences and first reference time data collected by a distance sensor are acquired asynchronously; data inflection points and their positions in the distance data sequences are determined asynchronously; image frame sequences and second reference time data are acquired asynchronously by a video capture device; text labels in the image frames of the image frame sequences are identified asynchronously; and the position of the label image frame where the text label first appears is determined. Finally, based on the first reference time data, the data inflection point position, the first sampling frequency of the distance sensor, the second reference time, the label image frame position, and the second sampling frequency of the video capture device, an index for evaluating the performance of the intelligent recognition operation of the security inspection equipment is calculated. This invention improves the accuracy of image processing time calculation by processing data in parallel through multiple asynchronous threads, providing a measurement method that guarantees time accuracy for detecting the running speed of the intelligent recognition algorithm of security inspection equipment. The measurement method is more objective and precise.
[0068] According to an embodiment of the present invention, the range of line intervals in which text labels appear during the imaging process is set, thereby reducing the range of subsequent target detection and saving memory space occupied by the computation process.
[0069] According to embodiments of the present invention, multi-threaded processing logic separates the processing of acquired data from the processing of computation time nodes. The design establishes a sequential relationship between packet processing, serial computation, and parallel computation, thus avoiding the impact of computation time on the accuracy of the acquired results. When using this processing method, the accuracy of the acquired results is no longer affected by computation time, but only by the hardware acquisition frequency; the higher the hardware acquisition frequency, the higher the time accuracy of the acquired results.
[0070] According to embodiments of the present invention, the present invention has made significant optimizations in terms of time dimension, space dimension and computing scale, minimizing the use of storage resources and computing power resources, thereby enabling portable low computing power processors to meet the business scenario requirements of detecting various types of security inspection equipment.
[0071] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit the invention. Attached Figure Description
[0072] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below.
[0073] Figure 1 This diagram illustrates a detection terminal for detecting the intelligent identification computing performance of security inspection equipment according to an example embodiment.
[0074] Figure 2 A flowchart illustrating a method for testing the intelligent identification computing performance of security inspection equipment according to an example embodiment is shown.
[0075] Figure 3 A schematic diagram illustrating the workflow of the main thread according to an example embodiment is shown.
[0076] Figure 4 A schematic diagram of the workflow of the first thread according to an example embodiment is shown.
[0077] Figure 5 A schematic diagram of the workflow of the first thread according to another example embodiment is shown.
[0078] Figure 6 A schematic diagram illustrating the workflow of the second thread according to an example embodiment is shown.
[0079] Figure 7 A schematic diagram of the workflow of the second thread according to another example embodiment is shown.
[0080] Figure 8 A schematic diagram illustrating the workflow of the third thread according to an example embodiment is shown.
[0081] Figure 9 A schematic diagram illustrating the workflow of the fourth thread according to an example embodiment is shown.
[0082] Figure 10 A flowchart illustrating a first embodiment according to an example embodiment is shown.
[0083] Figure 11 A flowchart illustrating a second embodiment according to an example embodiment is shown.
[0084] Figure 12 A flowchart illustrating a third embodiment according to an example embodiment is shown.
[0085] Figure 13 An example schematic diagram of a text label according to an example embodiment is shown.
[0086] Figure 14 A block diagram of a computing device according to an exemplary embodiment is shown. Detailed Implementation
[0087] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that the invention will be thorough and complete, and the concept of the exemplary embodiments will be fully conveyed to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.
[0088] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a full understanding of embodiments of the invention. However, those skilled in the art will recognize that the technical solutions of the invention can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of the invention.
[0089] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0090] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0091] It should be understood that although the terms first, second, third, etc., may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another. Therefore, the first component discussed below may be referred to as the second component without departing from the teachings of the present invention. As used herein, the term "and / or" includes all combinations of any one and more of the associated listed items.
[0092] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of exemplary embodiments, and the modules or processes in the drawings are not necessarily essential for implementing the present invention, and therefore cannot be used to limit the scope of protection of the present invention.
[0093] Currently, the main methods for determining the processing speed of intelligent recognition algorithms in security inspection equipment are the operation log recording method and the objective equipment detection method. The objective equipment detection method involves collecting the technical parameters and test object dimensions of the security inspection equipment, setting the length of the sensor bracket, connecting the detection terminal, and using laser rangefinders and OCR technology to determine the start and end times of the intelligent recognition algorithm, and then calculating and outputting the algorithm's running time.
[0094] The existing detection implementation scheme includes: collecting the technical parameters of the security inspection equipment and the dimensions of the test object, and calculating the detection points; calculating the distance from the detection point to the exit of the security inspection equipment channel based on the location of the detection point, and setting the length of the sensor bracket according to the distance; fixing the sensor support rod to the side wall of the security inspection equipment channel exit using a suction cup; connecting the sensor communication interface to the signal acquisition device; connecting the video output interface of the security inspection equipment to the input interface of the video capture card, and connecting the output interface of the video capture card to the processing unit; the detection terminal automatically identifies each connection status and displays each connection status to the user through a display; placing the test object... At the entrance of the security inspection equipment channel, the security inspection equipment is started; when the conveyor belt transports the test object completely through the X-ray scanning section, the sensor is blocked by the test object, and the collected data changes. The initial moment of the blockage is recorded as the start time T1 of the intelligent recognition of the security inspection equipment; the detection terminal uses optical character recognition (OCR recognition) to recognize the input video signal frame by frame. When the label text of the test object is detected, the time corresponding to the frame where the label text is located is recorded as the end time T2 of the intelligent recognition algorithm of the security inspection equipment; the running time ΔT = T2 - T1 of the intelligent recognition algorithm of the security inspection equipment is calculated, and the calculation result is output.
[0095] Existing methods describe how to determine the start and end times of data acquisition, but these methods cannot guarantee the temporal accuracy of the acquisition results. The first problem with existing methods is that when using high-frequency acquisition equipment, the large sampling scale per unit time means that although the computational delay for processing a single sample is small, the cumulative delay of large-scale data over a sufficiently long period will severely impact the acquisition results. Firstly, in the method for calculating the start time T1, if the computational time for identifying changes in the acquired data exceeds the data acquisition cycle of the high-frequency sensor, the data acquired by the high-frequency sensor will accumulate in the communication interface buffer, and the moment the change is detected will be later than the actual moment of change. Secondly, in the method for calculating the end time T2, if the computational time of the OCR recognition algorithm exceeds the refresh rate of the security inspection equipment screen, video signal frame drops will occur, leading to a misalignment of the mapping relationship between the frame containing the label text and the corresponding time, making it impossible to obtain an objective and accurate end time.
[0096] The second problem with existing methods is that high-frequency acquisition devices are affected by the electromagnetic field of the external environment of the communication line during data transmission and by the storage scheduling mechanism (such as the allocation of new memory blocks) during data storage. This causes random differences in the interval between each sampling data, which in turn leads to a decrease in the time accuracy of individual sampling data.
[0097] The third problem with existing methods is that the video data acquired by the high-frequency acquisition card is image data output from the security inspection equipment to the monitor screen. The resolution of this image data is positively correlated with the size of the security inspection equipment. In order to retain more details in the X-ray image, the larger the size of the security inspection equipment channel, the more detector chip arrays are used, which corresponds to the need for higher resolution video output. Large security inspection machines often need to output 4K resolution ultra-high-definition images. This means that the detection device needs to have the ability to process high-frequency ultra-high-definition video data. This makes it impossible for graphics workstation-level computing processors to meet the processing requirements of frame-by-frame OCR recognition. However, high-performance computing processors do not have the advantage of portability. This leads to a contradiction between high computing power and portability.
[0098] The fourth problem with existing methods is that the size of individual characters on the labels output by security inspection equipment is typically around 10×10 pixels, while the screen images output by these devices are usually 2K resolution. Therefore, recognizing label text in high-definition screen images output by security inspection equipment is a typical small target recognition problem in the field of image recognition. OCR recognition algorithms are extremely time-consuming in small target recognition, especially in images without label text, where the algorithm needs to exhaustively search all branch cases, leading to even greater time consumption.
[0099] Therefore, this invention proposes a method, a detection system, and a computing device for detecting the intelligent recognition computing performance of security inspection equipment. This provides a measurement method that ensures time accuracy for detecting the running speed of the intelligent recognition algorithm of security inspection equipment, and the measurement method is more objective and precise.
[0100] Before describing the embodiments of this application, some terms or concepts involved in the embodiments of this application will be explained.
[0101] Security inspection equipment: Equipment that uses X-rays to scan and inspect packages.
[0102] Standard test body: A standard test object designed according to national standards for testing the performance indicators of security inspection equipment.
[0103] Distance sensor: The distance sensor described in this invention is a high-frequency laser rangefinder, and its acquisition frequency is generally not lower than 500Hz.
[0104] Video capture device: The capture frequency is generally not lower than 60Hz, including 60Hz, 120Hz, 200Hz or higher.
[0105] High-frequency acquisition device: The high-frequency acquisition device of the present invention includes a distance sensor and a video acquisition device.
[0106] Detection device: The detection device described in this invention specifically refers to an objective detection system used to detect the imaging processing speed of security inspection equipment.
[0107] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention.
[0108] Figure 1 This diagram illustrates a detection terminal for detecting the intelligent identification computing performance of security inspection equipment according to an example embodiment.
[0109] See Figure 1 The detection terminal includes a distance sensor, a video capture device, a processing unit, and a memory. The distance sensor collects distance data related to the width of the security inspection equipment's channel and changes in that width. The video capture device collects image frame data from the screen video output by the security inspection equipment. The processing unit receives the distance data from the distance sensor and the image frame data from the video capture device, and performs calculations to determine the start time, end time, and duration of the intelligent recognition operation. The memory stores a computer program that, when executed by the processing unit, implements a method for detecting the intelligent recognition performance of the security inspection equipment.
[0110] According to some embodiments, the processing processor is responsible for receiving distance data and images displayed by the security inspection equipment. Through comprehensive processing and analysis of these two types of data, the start and end times of the imaging operation during the scanning of the test object by the security inspection equipment are accurately identified, and the total time consumed by the entire imaging operation process is calculated.
[0111] According to some embodiments, when a test object enters the scanning area of the security inspection equipment, a high-frequency laser rangefinder captures its positional changes in real time. Simultaneously, the video acquisition unit records the image generation process on the security inspection equipment's display. The processing unit accurately matches the timestamp information of the two sets of data to identify the moment the target object first appears and finally stabilizes in the image, comparing this with the corresponding positional information in the ranging data to determine whether the real-time performance of the imaging system meets the standards.
[0112] Figure 2 A flowchart illustrating a method for testing the intelligent identification computing performance of security inspection equipment according to an example embodiment is shown.
[0113] See Figure 2 According to some embodiments, the method of the present invention is used to detect terminals by sequentially starting multiple asynchronous threads in the main thread to process data according to actual testing needs. These asynchronous threads include a first thread, a second thread, a third thread, and a fourth thread. The first thread is a distance sensor data storage thread, the third thread is a video capture device image data storage thread, the second thread is a distance sensor data calculation thread, and the fourth thread is an OCR recognition algorithm thread.
[0114] In S101, the distance data sequence collected by the distance sensor set in the detection chamber of the security inspection equipment is asynchronously acquired, and the current timestamp is recorded as the first reference time data before acquiring the distance data sequence.
[0115] According to some embodiments, the asynchronous acquisition of distance data sequence collected by the distance sensor set in the detection cavity of the security inspection equipment is performed in the first thread, and the current timestamp is recorded as the first reference time data before acquiring the distance data sequence.
[0116] According to some embodiments, the method for obtaining distance data sequence includes: monitoring the interface cache of the distance sensor, retrieving new data from the interface cache of the distance sensor and storing it in a first global storage queue to obtain the distance data sequence.
[0117] According to some embodiments, the method for obtaining distance data sequence further includes: monitoring the interface cache of the distance sensor, retrieving new data from the interface cache of the distance sensor and storing it in a temporary queue; when the length of the data stored in the temporary queue is equal to the length of the temporary queue, the data in the temporary queue is copied to the first global queue as the distance data sequence.
[0118] According to some embodiments, as described above, the workflow of the first thread differs under different testing requirements.
[0119] According to an embodiment of the present invention, see Figure 4 Under low-power hardware conditions, the first thread's work includes: recording the current timestamp as the first reference time data before acquiring the distance data sequence; monitoring the interface cache of the distance sensor, retrieving new data from the interface cache of the distance sensor and storing it in the first global storage queue to obtain the distance data sequence; waiting to receive the first message, and stopping reading the data in the interface cache of the distance sensor when the first message is received, and ending the first thread.
[0120] According to an embodiment of the present invention, see Figure 5To ensure high time accuracy at the algorithm level, operations with uncertain time consumption are transferred to time-independent threads by adding a temporary queue. The first thread's tasks include: clearing historical data in the distance sensor interface cache; recording the current timestamp as the first reference time data before acquiring the distance data sequence; monitoring the distance sensor interface cache, retrieving new data from the cache and storing it in the temporary queue; copying the data in the temporary queue to the first global queue when the cumulative data length in the temporary queue equals the queue's length; waiting to receive the first message, stopping reading data from the distance sensor interface cache upon receiving the message, and ending the first thread.
[0121] In S103, it is asynchronously determined whether there is a data inflection point and the location of the data inflection point in the distance data sequence.
[0122] According to some embodiments, the asynchronous determination of whether there is a data inflection point and the location of the data inflection point is performed in a second thread.
[0123] According to some embodiments, in the third thread, data in the distance data sequence whose value decreases by more than a predetermined threshold compared to the value of adjacent data is used as the data inflection point; the position of the data inflection point in the distance data sequence is calculated based on the data inflection point.
[0124] According to some embodiments, in the second thread, the data in the temporary queue is copied to the first global queue, and the temporary queue is cleared; the data in the distance data sequence whose value decreases by more than a predetermined threshold compared with the value of adjacent data is used as the data inflection point; the position of the data inflection point in the distance data sequence is calculated based on the data inflection point.
[0125] According to some embodiments, the second thread selects a different workflow based on the specific workflow of the first thread. For example, see... Figure 6 and Figure 7 , Figure 6 This illustrates the workflow of the second thread when the first thread operates under low-power hardware conditions. Figure 7 This illustrates the workflow of the second thread when the first thread is working while ensuring high time accuracy at the algorithm level.
[0126] According to an embodiment of the present invention, when the first thread operates under low-power hardware conditions, the work of the second thread includes: determining whether there is a data inflection point in the distance data sequence; if there is no data inflection point, waiting for a period of time and repeating the previous step of determination; if it is determined that there is a data inflection point, sending the first message to the first thread and starting the fourth thread; calculating the data inflection point position of the data inflection point in the distance data sequence, and ending the second thread.
[0127] According to an embodiment of the present invention, when the first thread works while ensuring high time accuracy at the algorithm level, the work of the second thread includes: when the temporary queue is full, copying the data in the temporary queue to the first global queue to obtain a distance data sequence, and clearing the temporary queue; determining whether there is a data inflection point in the distance data sequence; if there is no data inflection point, ending the second thread; if there is a data inflection point, sending the first message to the first thread and the fourth thread, calculating the data inflection point position of the data inflection point in the distance data sequence, and ending the second thread.
[0128] In S105, the image frame sequence acquired by the video acquisition device from the video acquisition interface of the security inspection equipment is asynchronously acquired, and the current timestamp is recorded as the second reference time data before acquiring the image frame sequence.
[0129] According to some embodiments, the asynchronous acquisition of image frame sequences from the video acquisition interface of the security inspection equipment is performed in a third thread, and the current timestamp is recorded as a second reference time data before acquiring the image frame sequence.
[0130] According to some embodiments, the image frame data acquired by the video capture device's interface is read in the third thread and stored in a second global storage queue to obtain the image frame sequence.
[0131] According to some embodiments, the workflow of the third thread is as follows: Figure 8 The third thread's tasks include: recording the current timestamp as a second reference time data before acquiring the image frame sequence; reading the image frame data acquired by the video capture device's interface and storing it in a second global storage queue to obtain the image frame sequence; waiting to receive a second message, and stopping the storage of the image frame data and ending the third thread when the second message is received.
[0132] In S107, asynchronous identification is performed to determine whether the security inspection device has added a text label to the corresponding image frame in the image frame sequence based on the result of intelligent identification calculation, and to determine the position of the label image frame where the text label first appears.
[0133] According to some embodiments, in the fourth thread, the asynchronous identification is performed to determine whether the security inspection device adds a text label to the corresponding image frame in the image frame sequence based on the result of the intelligent identification operation, and to determine the position of the label image frame where the text label first appears. The text label style is described in [reference needed]. Figure 13 .
[0134] According to some embodiments, in the fourth thread, optical character recognition is performed on the last tail image frame data stored in the image frame sequence, and it is determined whether the text label exists; if the text label exists in the tail image frame data, the tail image frame data is deleted, and the preceding image frame data is used as the tail image frame data; the above steps are repeated, and optical character recognition is performed on the tail image frame data containing the text label until the text label is not found in the tail image frame data of the image frame sequence, at which point the current data length of the image frame sequence plus 1 is used as the position of the label image frame.
[0135] According to some embodiments, the workflow of the fourth thread is as follows: Figure 9 The fourth thread includes: performing optical character recognition on the last image frame data stored in the second global queue, and determining whether the text label exists; if the text label exists in the last image frame data, sending the second message to the second thread, deleting the last image frame data, and using the preceding image frame data as the last image frame data; repeating the above steps, performing optical character recognition on the last image frame data containing the text label, until it is determined that the text label does not exist in the last image frame data of the second global queue, using the current length of the second global queue plus 1 as the position of the earliest tag image frame containing the text label; after obtaining the tag image frame position, sending the third message to the main thread and ending the fourth thread.
[0136] According to some embodiments, a line interval range in which the text label appears in an image frame is preset, and the line interval range is used as a target detection range for identifying whether the text label exists in the image frame sequence.
[0137] According to some embodiments, the range of lines in which text labels appear during the imaging process is set in the main thread based on the imaging characteristics of the security inspection equipment screen. The range of lines in which text labels appear includes the upper and lower boundaries of the text labels in the image. Since the imaging characteristics of security inspection equipment typically involve imaging within a fixed area of the screen or sliding from the left (or right) side of the screen to the other within a fixed area, the target detection range of the OCR algorithm can be significantly reduced by narrowing the text label recognition range, thereby saving memory space occupied during computation.
[0138] In S109, an index is calculated to evaluate the performance of the intelligent recognition operation of the security inspection equipment.
[0139] According to some embodiments, a first time is calculated based on the first reference time data, the data inflection point position, and the first sampling frequency of the distance sensor, as the start time of the intelligent recognition operation of the security inspection equipment; a second time is calculated based on the second reference time, the tag image frame position, and the second sampling frequency of the video collector, as the end time of the intelligent recognition operation of the security inspection equipment; the difference between the end time and the start time is used to evaluate the performance of the intelligent recognition operation of the security inspection equipment.
[0140] According to some embodiments, the main thread continuously listens for the third message and stops listening when the third message is received. Then, based on the acquired first sampling frequency of the distance sensor, the second sampling frequency of the video capture device, and the offset distance data, the first reference time data, the data inflection point position, the first reference time data, and the tag image frame position acquired in S101 to S107 are used to calculate the duration of the imaging operation.
[0141] According to some embodiments, the product of the data inflection point position and the first sampling frequency, plus the sum of the first reference time data, is used as the start time of the intelligent recognition operation; the product of the sum of the tag image frame position and offset distance data, multiplied by the second sampling frequency, plus the sum of the second reference time data, is used as the start time of the intelligent recognition operation; the difference between the end time of the intelligent recognition operation and the start time of the intelligent recognition operation is used to evaluate the performance of the intelligent recognition operation.
[0142] According to some embodiments, the start time T1 of the intelligent recognition operation is calculated using the first reference time data Tr1, the data inflection point position P1, and the first sampling frequency fs1, and the calculation method is T1 = Tr1 + P1 × fs1; the end time T2 of the intelligent recognition operation is calculated using the second reference time data Tr2, the tag image frame position P2, the offset distance data TC, and the sampling frequencies fs2 of the first and second reference times, and the calculation method is T2 = Tr2 + (TC + P2) × fs2; finally, the time difference is calculated to obtain the intelligent recognition operation time T, which is used to evaluate the performance of the intelligent recognition operation, and the calculation method is T = T2 - T1.
[0143] According to an embodiment of the present invention, the range of line intervals in which text labels appear during the imaging process is set, reducing the range of subsequent target detection and saving memory space occupied by the computation process. Asynchronous threads are started sequentially, and computational data is acquired through these asynchronous threads. Based on the computational data, the duration for evaluating the performance of the intelligent recognition computation is calculated. This invention improves the computational accuracy of intelligent recognition computation performance by processing data in parallel through multiple asynchronous threads, providing a measurement method that guarantees time accuracy for the running speed of intelligent recognition algorithms in security inspection equipment. The measurement method is more objective and precise.
[0144] According to embodiments of the present invention, multi-threaded processing logic separates the processing of acquired data from the processing of computation time nodes. The design establishes a sequential relationship between packet processing, serial computation, and parallel computation, thus avoiding the impact of computation time on the accuracy of the acquired results. When using this processing method, the accuracy of the acquired results is no longer affected by computation time, but only by the hardware acquisition frequency; the higher the hardware acquisition frequency, the higher the time accuracy of the acquired results.
[0145] Figure 3 A schematic diagram illustrating the workflow of the main thread according to an example embodiment is shown.
[0146] In S201, the range of row pixels in which the text label appears in the screen image is set.
[0147] According to some embodiments, when the main thread starts, it first sets the range of row pixels in the screen image where the text label appears.
[0148] In S203, start the asynchronous thread.
[0149] According to some embodiments, asynchronous threads are started to achieve parallel information collection. Through multi-asynchronous thread processing logic, the data collection calculation and the calculation of time nodes are processed separately.
[0150] In S205, determine whether a third message has been received.
[0151] According to some embodiments, it is determined whether a third message from a fourth thread has been received. If not, the determination continues until a third message is received.
[0152] In S207, calculate the program's execution time.
[0153] According to some embodiments, the calculation of the computation time begins after receiving the third message, wherein the third message is for calculating the imaging computation time.
[0154] According to some embodiments, the start time T1 of the intelligent recognition operation is calculated using the first reference time data Tr1, the data inflection point position P1, and the first sampling frequency fs1, and the calculation method is T1 = Tr1 + P1 × fs1; the end time T2 of the intelligent recognition operation is calculated using the second reference time data Tr2, the tag image frame position P2, the offset distance data TC, and the sampling frequencies fs2 of the first and second reference times, and the calculation method is T2 = Tr2 + (TC + P2) × fs2; finally, the time difference is calculated to obtain the intelligent recognition operation time T, which is used to evaluate the performance of the intelligent recognition operation, and the calculation method is T = T2 - T1.
[0155] According to some implementations, the main thread and all threads read relevant data faster than the data production speed in distance sensors and high-frequency camera acquisition units, thus avoiding data backlog.
[0156] Figure 4 A schematic diagram of the workflow of the first thread according to an example embodiment is shown.
[0157] According to some embodiments, the workflow of the first thread differs under different testing requirements, such as under low-power hardware conditions or when ensuring high time accuracy at the algorithm level. The first thread may choose to directly store the data read from the distance sensor's interface cache into a global queue, or store it in a temporary queue first.
[0158] In S301, the current timestamp is recorded as the first reference time (Tr1).
[0159] According to some embodiments, when the first thread sequentially stores the data read from the interface cache of the distance sensor into the first global queue (gQueue1), the current timestamp (Tr1) is recorded as the first reference time data before the distance data sequence is obtained.
[0160] In S303, the distance sensor data is stored in the first global queue.
[0161] According to some embodiments, the interface cache of the distance sensor is monitored. When there is no data in the interface cache of the distance sensor, it waits to read. When data appears, it is read. After reading, it waits to read again. As long as there is new data in the cache, it is retrieved and stored in the first global queue (gQueue1). Here, gQueue1 is a global storage queue of variable length. When the allocated memory block is full, a new memory block will be automatically allocated. This will not affect the quantity and order of data read from the interface cache.
[0162] In S305, it is determined whether the first message has been received.
[0163] According to some embodiments, the system waits to receive a first message, which is a message indicating that the first thread has stopped storing data. When the first thread receives the first message, it stops reading data from the interface cache of the distance sensor and terminates the first thread.
[0164] Figure 5 A schematic diagram of the workflow of the first thread according to another example embodiment is shown.
[0165] See Figure 5 , Figure 5 The illustration shows the scenario where the first thread reads data from the interface cache of the distance sensor in a timely manner and stores it sequentially into a temporary queue, wherein the length of the temporary queue is fixed.
[0166] In S401, clear the distance sensor interface cache.
[0167] According to some embodiments, historical data in the distance sensor interface cache is cleared.
[0168] In S403, the current timestamp is recorded as the sensor data start timestamp (Tr1).
[0169] According to some embodiments, the current timestamp (Tr1) is recorded as the first reference time data before acquiring the distance data sequence.
[0170] In S405, the distance sensor interface cache data is stored in a temporary queue.
[0171] According to some embodiments, the interface cache of the distance sensor is monitored. Whenever there is new data in the cache, it is retrieved and stored in a temporary queue. When the length of the accumulated stored data is equal to the length of the temporary queue, a second thread is started to continue repeating the operation of caching new data.
[0172] In S407, determine whether the first message has been received.
[0173] According to some embodiments, if it is determined that the first message has been received, the reading of data in the interface cache of the distance sensor is stopped and the first thread is terminated.
[0174] In S409, determine whether the temporary queue is full.
[0175] According to some embodiments, if it is determined that the first message has been received, it is determined whether the temporary queue is full. If it is determined that the temporary queue is not full, S405 and S407 are repeated.
[0176] In S411, start the second thread.
[0177] According to some implementations, if it is determined that the temporary queue is full, a second thread is started.
[0178] Figure 6 A schematic diagram illustrating the workflow of the second thread according to an example embodiment is shown.
[0179] According to some embodiments, the second thread is responsible for identifying the moment when the standard test object arrives at the distance sensor position. In practical use, the physical device upon which this invention relies involves installing the distance sensor at a designated location within the security checkpoint, and recording the moment the standard test object arrives at the sensor position as the start time of the security equipment's imaging operation.
[0180] According to some embodiments, see Figure 6 , Figure 6 This illustrates the workflow of the second thread when the first thread reads data from the distance sensor's interface cache in a timely manner and stores it sequentially into gQueue1.
[0181] In S501, a global queue is used to calculate the steep inflection point of the sequence.
[0182] According to some embodiments, when the standard test object has not reached the sensor position, the distance data collected by the sensor is the width between the two side walls inside the security check channel. When the standard test object reaches the sensor position, the distance data collected by the sensor becomes the width between the side wall inside the security check channel and the standard test object. Therefore, it is only necessary to calculate the position of the steep drop inflection point in gQueue1. The time corresponding to this position data is the start time of the imaging operation.
[0183] In S503, determine whether a data inflection point exists.
[0184] According to some embodiments, it is determined whether there is a data inflection point in gQueue1. If there is no data inflection point, S501 is repeated.
[0185] In S505, the first message is sent to the first thread, and other asynchronous threads are started as needed.
[0186] According to some implementations, if a data inflection point exists, a first message is sent and a fourth thread is started.
[0187] In S507, calculate the data inflection point at the data inflection point position P1 in the data sequence.
[0188] According to some embodiments, the data inflection point position P1 in gQueue1 is calculated, and then the second thread ends.
[0189] According to some embodiments, since the standard test body has a fixed width and is not allowed to be placed against the inner wall of the security inspection equipment during the inspection operation, it is known from experience that when the collected distance data fluctuations stabilize (generally, after the fluctuations of the preceding data stabilize, a drop of more than 10% is a valid signal), when the drop of two adjacent distance values exceeds the threshold (usually 40%), the position corresponding to the subsequent value is the inflection point.
[0190] Figure 7 A schematic diagram of the workflow of the second thread according to another example embodiment is shown.
[0191] According to some embodiments, see Figure 7 , Figure 7 This illustrates the workflow of the second thread when the first thread reads data from the distance sensor's interface cache in a timely manner and stores it sequentially into a temporary queue.
[0192] In S601, the data in the temporary queue is copied to the first global queue.
[0193] According to some implementations, the data in the temporary queue is copied to gQueue1.
[0194] In S603, clear the temporary queue.
[0195] According to some implementations, after the second thread copies the data in the temporary queue to gQueue1, the temporary queue is cleared.
[0196] In S605, a global queue is used to calculate the steep inflection point of the sequence.
[0197] According to some embodiments, when the standard test object has not reached the sensor position, the distance data collected by the sensor is the width between the two side walls inside the security check channel. When the standard test object reaches the sensor position, the distance data collected by the sensor becomes the width between the side wall inside the security check channel and the standard test object. Therefore, it is only necessary to calculate the position of the steep drop inflection point in gQueue1. The time corresponding to this position data is the start time of the imaging operation.
[0198] In S607, determine whether a data inflection point exists.
[0199] According to some implementations, it is determined whether there is a data inflection point in gQueue1. If there is no data inflection point, the second thread is terminated.
[0200] In S609, the first message is sent to the first thread.
[0201] According to some embodiments, if a data inflection point exists, a first message is sent, and the data inflection point position P1 in gQueue1 is calculated. Specifically, the first thread terminates upon receiving the first message, and the fourth thread begins OCR recognition using the tail data from the image frame sequence upon receiving the first message.
[0202] In S611, calculate the data inflection point position P1 in the data inflection point position in the data sequence.
[0203] According to some embodiments, the data inflection point position P1 in gQueue1 is calculated, and the second thread ends after calculating the data inflection point position P1. The second thread is started once each time the temporary queue is full.
[0204] Figure 8 A schematic diagram illustrating the workflow of the third thread according to an example embodiment is shown.
[0205] In S701, the current timestamp is recorded as the second reference time (Tr2).
[0206] According to some embodiments, the current timestamp (Tr2) is recorded as a second reference time data before acquiring the image frame sequence.
[0207] According to some embodiments, the third thread's function is to read image frame data from the video capture device interface in a timely manner and store it sequentially into the second global queue (gQueue2). The queue length of gQueue2 is a fixed length L, calculated by the video capture device's sampling frequency fs2 and the magnification factor a, i.e., L = a × fs2, where L is directly proportional to fs2; the larger fs2 is, the larger L is, and the smaller fs2 is, the smaller L is. a is the magnification factor; for most security inspection devices, a can be set to 5. For security inspection devices with particularly slow recognition speeds, the value of a can be increased. A larger value of a results in a larger L and more memory resources consumed during the calculation.
[0208] In S703, image frame data is read and stored in a second global queue of fixed length.
[0209] According to some embodiments, the image frame data is read and stored in gQueue2.
[0210] In S705, it determines whether a second message has been received.
[0211] According to some embodiments, the system waits to receive a second message. This second message is a stop-storage message for the third thread; upon receiving the second message, the storage of image frame data to gQueue2 is stopped and the third thread terminates.
[0212] In S707, determine whether the second global queue is full.
[0213] According to some implementations, when the second global queue is full, data is started to be deleted from the head of the queue.
[0214] In S709, data is deleted from the head of the queue and the total number of deleted data (TC) is recorded.
[0215] According to some embodiments, when the number of image frames stored in gQueue2 exceeds the length L, the earliest image frame data that entered the queue is deleted from the head of gQueue2, and the number of deleted data is recorded using offset distance data TC, thereby recording the offset distance of gQueue2 relative to the reference time point Tr2.
[0216] Figure 9 A schematic diagram illustrating the workflow of the fourth thread according to an example embodiment is shown.
[0217] In S801, OCR recognition is performed using the tail data in the image frame sequence.
[0218] According to some embodiments, the fourth thread's function is to identify the earliest moment when a text label appears in the screen image output by the security inspection device. The fourth thread works as follows: once the imaging operation of the security inspection device has started, it uses an OCR algorithm to identify whether a text label exists within a specified area of the screen image frame by frame. The moment corresponding to the first image data showing a text label is the end moment of the security inspection device's imaging operation.
[0219] According to some implementations, the last data stored in gQueue2 is used for OCR recognition to determine whether text tags exist.
[0220] In S803, determine whether a text label exists.
[0221] According to some embodiments, if the message does not exist, the first step is repeated; if the message exists, the second message is sent.
[0222] According to some embodiments, after the third thread receives the second message, it stops storing new image frame data into gQueue2.
[0223] In S805, a second message is sent to delete the tail data of the image frame sequence.
[0224] According to some embodiments, after the second message is sent, OCR recognition of the image frame data is performed starting from the end of gQueue2. As long as text is detected, the image frame data is deleted. After the image frame data is deleted, the length of gQueue2 is reduced by 1.
[0225] In S807, the tail data of the image frame sequence is dequeued one by one, and the dequeued data is processed using an OCR algorithm.
[0226] According to some embodiments, the preceding data of the data deleted in the second step, i.e. the last data at the end of the current queue, is taken out from gQueue2 and OCR recognition is performed.
[0227] In S809, determine whether a text label exists.
[0228] According to some embodiments, if the last data at the end of the current queue contains a text label, then S805 and S807 are repeated to poll the last data of gQueue2 until the OCR recognition result of the last data is that there is no text.
[0229] According to some embodiments, if it is determined that no text label exists, the label image frame position P2 is calculated.
[0230] In S811, the position P2 of the earliest data tag image frame with the text tag is calculated using the current length of the queue, and the third message is sent.
[0231] According to some embodiments, a third message is sent to end the fourth thread, and the length of the data currently stored in gQueue2 is incremented by 1 to be used as the position P2 of the earliest tag image frame where the text label appears.
[0232] Figure 10 A flowchart illustrating a first embodiment according to an example embodiment is shown.
[0233] See Figure 10 , Figure 10 The implementation process of the technical solution in the first embodiment is described.
[0234] According to some embodiments, the first thread, the second thread, and the third thread are started in the main thread. After determining that there is a data inflection point in the distance data sequence, the second thread sends a first message and starts the fourth thread; the first thread terminates its operation after receiving the first message; when the fourth thread recognizes the presence of the text label in the image frame sequence, it sends a second message; after determining the position of the label image frame, the fourth thread sends a third message; the third thread terminates its operation after receiving the second message; after receiving the third message, the main thread executes the calculation of the performance indicators used to evaluate the intelligent recognition operation of the security inspection equipment.
[0235] In the first embodiment, the distance sensor and the video capture device are started in the main thread. The first thread and the second thread are started at the same time as the distance sensor is started, and the third thread is started at the same time as the video capture device is started.
[0236] In the first embodiment, the first thread reads data from the interface cache of the distance sensor in a timely manner and stores it sequentially into the first global queue (gQueue1). The second thread directly checks whether there is a data inflection point in gQueue1. When the second thread determines that there is a data inflection point in gQueue1, it sends a first message to the first thread and starts the fourth thread to perform text label recognition. After the first, second, third, and fourth threads have completed their work, the main thread obtains the calculation data generated by each thread and calculates the final imaging calculation time. The specific workflow of the main thread and each thread has been described in detail above and will not be repeated here.
[0237] According to some embodiments, in the first embodiment, a method is used where a first thread stores distance sensor data and a second thread identifies inflection point data. After identifying the inflection point location, the time corresponding to the location of the inflection point is calculated according to the sampling period. The recognition result is not affected by the computation time, but only by the sampling period. Since the runtime of the OCR recognition algorithm is much longer than the sampling period of the image frame data, a third thread stores the image frame data, and a fourth thread extracts the image frame data for OCR recognition according to the runtime interval of the OCR recognition algorithm. When a text label is found in the image, the image with the earliest text label is searched in reverse order. This can also avoid the problem that the OCR algorithm is particularly time-consuming when recognizing images without text labels.
[0238] Figure 11 A flowchart illustrating a second example according to an example embodiment is shown.
[0239] See Figure 11 , Figure 11 The implementation process of the technical solution of the second embodiment is described.
[0240] According to some embodiments, the first thread, the third thread, and the fourth thread are started in the main thread. When the length of the data stored in the temporary queue is equal to the length of the temporary queue, the first thread starts the second thread; after determining that there is a data inflection point in the distance data sequence, the second thread sends a first message; after receiving the first message, the first thread terminates its own operation; after receiving the first message, the fourth thread sends a second message when it recognizes the presence of the text label in the image frame sequence; after determining the position of the label image frame, the fourth thread sends a third message; after receiving the second message, the third thread terminates its own operation; after receiving the third message, the main thread executes the calculation of the performance indicators used to evaluate the intelligent recognition operation of the security inspection equipment.
[0241] In the second embodiment, the distance sensor and the video capture device are started in the main thread. The first thread is started at the same time as the distance sensor is started, and the third and fourth threads are started at the same time as the video capture device is started.
[0242] According to some embodiments, the first thread stores the read data into a temporary queue. When the temporary queue is full, the second thread is started. The second thread copies the data in the temporary queue to gQueue1 and clears the temporary queue. The second thread is started every time the temporary queue is full. After the first, second, third, and fourth threads have completed their work, the main thread obtains the computational data generated by each thread and calculates the final imaging computation time. The specific workflow of the main thread and each thread has been described in detail above and will not be repeated here.
[0243] According to some embodiments, the second embodiment adds some data processing details. Considering that the time consumption of queue operations of variable length is uncertain, in accordance with the concept of trading space for time, the uncertain time consumption of operations is transferred to time-independent threads by adding temporary queues, which further ensures the time accuracy at the algorithm level.
[0244] Figure 12 A flowchart illustrating a third example according to an example embodiment is shown.
[0245] See Figure 12 , Figure 12 The implementation process of the technical solution of the third embodiment is described.
[0246] According to some embodiments, the first thread and the second thread are started in the main thread. After determining that there is a data inflection point in the distance data sequence, the second thread sends a first message and starts the third thread and the fourth thread; the first thread terminates its operation after receiving the first message; the fourth thread sends a second message when it recognizes the presence of the text label in the image frame sequence; the fourth thread sends a third message after determining the position of the label image frame; the third thread terminates its operation after receiving the second message; after receiving the third message, the main thread executes the calculation of the performance indicators used to evaluate the intelligent recognition operation of the security inspection equipment.
[0247] In the third embodiment, the distance sensor and video capture device are started in the main thread, and the first thread and the second thread are started at the same time as the distance sensor is started.
[0248] According to some embodiments, after waiting for the second thread to send the first message to the first thread, the third and fourth threads are started simultaneously with the start of the video capture device. Once the first, second, third, and fourth threads have completed their work, the main thread acquires the computational data generated by each thread and calculates the final imaging processing time. The specific workflow of the main thread and each thread has been described in detail above and will not be repeated here.
[0249] According to some embodiments, the third embodiment further adjusts the startup order of multiple threads, increases the loop waiting time between each calculation, and further reduces the resource usage requirements, that is, reduces the thread concurrency and reduces the computing resource utilization rate. It is suitable for use under low-power hardware conditions. The drawback is that it increases the overall time of the detection operation itself.
[0250] Figure 14 A block diagram of a computing device according to an exemplary embodiment of the present invention is shown.
[0251] like Figure 14 As shown, the computing device 30 includes a processor 12 and a memory 14. The computing device 30 may also include a bus 22, a network interface card 16, and an I / O interface 18. The processor 12, memory 14, network interface card 16, and I / O interface 18 can communicate with each other via the bus 22.
[0252] Processor 12 may include one or more general-purpose CPUs (Central Processing Units), microprocessors, or application-specific integrated circuits, for executing relevant program instructions. According to some embodiments, computing device 30 may also include a high-performance display adapter (GPU) 20 for accelerating processor 12.
[0253] Memory 14 may include a machine-readable medium in the form of volatile memory, such as random access memory (RAM), read-only memory (ROM), and / or cache memory. Memory 14 is used to store one or more programs containing instructions, as well as data. Processor 12 may read the instructions stored in memory 14 to perform the methods described above according to embodiments of the present invention.
[0254] The computing device 30 can also communicate with one or more networks via the network interface card 16. The network interface card 16 can be a DPU smart network card.
[0255] Bus 22 can include address bus, data bus, control bus, etc. Bus 22 provides a path for exchanging information between components.
[0256] It should be noted that, in specific implementations, the computing device 30 may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the device described above may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0257] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), network storage devices, cloud storage devices, or any type of medium or device suitable for storing instructions and / or data.
[0258] This invention also provides a computer program product comprising a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments.
[0259] Those skilled in the art will clearly understand that the technical solutions of the present invention can be implemented by means of software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware capable of independently performing or cooperating with other components to perform a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit, etc.
[0260] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0261] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0262] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0263] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0264] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0265] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention.
[0266] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0267] Exemplary embodiments of the present invention have been specifically shown and described above. It should be understood that the present invention is not limited to the detailed structures, arrangements, or implementations described herein; rather, the present invention is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended provisions.
Claims
1. A method for detecting intelligent recognition operation performance of security inspection equipment, characterized in that, The method comprises: Asynchronously acquiring a distance data sequence collected by a distance sensor arranged in a detection cavity of the security inspection device, and recording a current timestamp as first reference time data before acquiring the distance data sequence; Asynchronously determining whether there is a data inflection point and a data inflection point position in the distance data sequence: using data whose drop amplitude compared with adjacent data values exceeds a predetermined threshold as the data inflection point, and calculating the data inflection point position in the distance data sequence according to the data inflection point; Asynchronously acquiring an image frame sequence collected by a video collector from a video collection interface of the security inspection device, and recording a current timestamp as second reference time data before acquiring the image frame sequence; Asynchronously identifying whether there is a text label added in a corresponding image frame of the image frame sequence by the security inspection device according to a result of intelligent identification operation, and determining a label image frame position where the text label first appears; Calculating an index for evaluating the performance of the intelligent identification operation of the security inspection device, comprising: According to the first reference time data, the data inflection point position, and the first sampling frequency of the distance sensor, calculating a first time as the start time of the intelligent identification operation of the security inspection device; According to the second reference time, the label image frame position, and the second sampling frequency of the video collector, calculating a second time as the end time of the intelligent identification operation of the security inspection device; Using the difference between the end time and the start time to evaluate the performance of the intelligent identification operation of the security inspection device; Wherein, the asynchronous acquisition of the distance data sequence collected by the distance sensor arranged in the detection cavity of the security inspection device is performed in a first thread, and the current timestamp is recorded as the first reference time data before acquiring the distance data sequence; The asynchronous determination of whether there is a data inflection point and a data inflection point position in the distance data sequence is performed in a second thread; The asynchronous acquisition of the image frame sequence collected by the video collector from the video collection interface of the security inspection device is performed in a third thread, and the current timestamp is recorded as the second reference time data before acquiring the image frame sequence; The asynchronous identification of whether there is a text label added in a corresponding image frame of the image frame sequence by the security inspection device according to a result of intelligent identification operation, and determining a label image frame position where the text label first appears is performed in a fourth thread.
2. The method of claim 1, wherein, The asynchronous acquisition of the distance data sequence collected by the distance sensor arranged in the detection cavity of the security inspection device comprises: Monitoring the interface buffer of the distance sensor, taking out the newly added data in the interface buffer of the distance sensor and storing it into a first global storage queue to obtain the distance data sequence.
3. The method of claim 1, wherein, The asynchronous acquisition of the distance data sequence collected by the distance sensor arranged in the detection cavity of the security inspection device comprises: Monitoring the interface buffer of the distance sensor, taking out the newly added data in the interface buffer of the distance sensor and storing it into a temporary queue; copying the data in the temporary queue to the first global queue as the distance data sequence when the length of the data accumulated stored in the temporary queue is equal to the length of the temporary queue.
4. The method of claim 3, wherein, the asynchronous determination of whether there is a data inflection point in the distance data sequence and the data inflection point position comprises: copying the data in the temporary queue to the first global queue and emptying the temporary queue; using the data in the distance data sequence that has a decrease exceeding a predetermined threshold compared to the value of adjacent data as the data inflection point; calculating the data inflection point position in the distance data sequence according to the data inflection point.
5. The method of claim 1, wherein, the asynchronous acquisition of the image frame sequence collected by the video collector from the video collection interface of the security device comprises: reading the image frame data collected by the interface of the video collector and storing it in the second global storage queue to obtain the image frame sequence.
6. The method of claim 5, wherein, the asynchronous identification of whether there is a text label added in the corresponding image frame of the image frame sequence by the security device according to the result of intelligent identification operation in the image frame sequence and the determination of the label image frame position where the text label first appears comprises: performing optical character recognition on the last tail image frame data stored in the image frame sequence and determining whether there is the text label; if the tail image frame data has the text label, deleting the tail image frame data and using the previous image frame data of the tail image frame data as the tail image frame data; repeating the above steps to perform the optical character recognition on the tail image frame data that has the text label until the tail image frame data of the image frame sequence is identified to not have the text label, and using the length of the data currently stored in the image frame sequence plus 1 as the label image frame position.
7. The method of claim 6, wherein, The method further comprises: previously setting the line interval range in which the text label appears in the image frame as the target detection range for identifying whether there is the text label in the image frame sequence.
8. The method of claim 1, wherein: the first thread, the second thread and the third thread are started in the main thread; the second thread sends a first message and starts the fourth thread after determining that there is a data inflection point in the distance data sequence; the first thread ends its own running after receiving the first message; the fourth thread sends a second message when it identifies that there is the text label in the image frame sequence; the fourth thread sends a third message after determining the label image frame position; the third thread ends its own running after receiving the second message; the main thread executes the calculation of the index for evaluating the performance of the intelligent identification operation of the security device after receiving the third message.
9. The method of claim 4, wherein: the first thread, the third thread and the fourth thread are started in the main thread; the first thread starts the second thread when the length of the data accumulated stored in the temporary queue is equal to the length of the temporary queue. the second thread sends a first message after determining that there is a data inflection point in the distance data sequence; the first thread ends its own operation after receiving the first message; the fourth thread sends a second message after receiving the first message and identifying the text label in the image frame sequence; the fourth thread sends a third message after determining the position of the label image frame; the third thread ends its own operation after receiving the second message; the main thread executes the index for evaluating the performance of the intelligent recognition operation of the security device after receiving the third message.
10. The method of claim 1, wherein, the first thread and the second thread are started in the main thread; the second thread sends a first message and starts the third thread and the fourth thread after determining that there is a data inflection point in the distance data sequence; the first thread ends its own operation after receiving the first message; the fourth thread sends a second message after identifying the text label in the image frame sequence; the fourth thread sends a third message after determining the position of the label image frame; the third thread ends its own operation after receiving the second message; the main thread executes the index for evaluating the performance of the intelligent recognition operation of the security device after receiving the third message.
11. A detection system for detecting the intelligent recognition operation performance of security inspection equipment, characterized in that, The detection system comprises a distance sensor, a video collector, an operation processor and a memory, wherein, the distance sensor is configured to collect the width of a security device passage and distance data generated by the change of the width; the video collector is configured to collect image frame data of a screen image video output by the security device; the operation processor receives the distance data collected by the distance sensor and the image frame data collected by the video collector, and completes the operation of calculating the start time, end time and intelligent recognition operation duration; the memory stores a computer program, and when the computer program is executed by the operation processor, the method of any one of claims 1-10 is implemented.
12. A computing device, comprising: comprising: a processor; and a memory storing a computer program, and when the computer program is executed by the processor, the method of any one of claims 1-10 is implemented.
Citation Information
Patent Citations
Test processing method and device
CN115880605A
Dynamic compression method, system and equipment for teaching video and storage medium
CN120186416A