Method, apparatus, equipment and storage medium for merging the results of contraband identification in parcels

CN122265927BActive Publication Date: 2026-08-14HUNAN SUKE INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]本申请的目的在于提供一种包裹违禁品识别结果合并方法、装置、设备及存储介质,以解决现有技术中的以下技术问题:现有安检违禁品识别仅依据类别标签进行简单合并,未考量违禁品空间位置、尺寸差异及相互间隔情况,容易将中间存在空隙甚至夹杂其他违禁品的同类物品错误合并;该类粗放合并方式不仅会增大后续目标跟踪算法的运算复杂度、降低运行性能,还会造成安检展示界面标识排布过于密集,不利于安检员直观查看辨识;同时传统方案无法精准识别违禁品间的物理分隔间隙,合并结果准确度低,还易引发违禁品漏检问题

Benefits of technology

[0014]有益效果:本申请的包裹违禁品识别结果合并方法、装置、设备及存储介质,通过多维度初筛判据结合检测分离轴精准校验的递进式合并校验方案,实现了安检图像中同类违禁品合并的高效性与高准确性。整体上,通过初筛与精准校验的配合,实现了粗筛过滤无效目标、精校识别隐藏分隔的全流程管控,既解决了传统静态校验易遗漏分隔特征、误合并率高的问题,又避免了单一全量校验计算量大、效率低的缺陷,在保障违禁品识别准确性的同时,显著提升了安检系统的处理效率与鲁棒性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122265927B_ABST
    Figure CN122265927B_ABST
Patent Text Reader

Abstract

This application relates to the field of security inspection image data processing technology, and discloses a method, apparatus, device, and storage medium for merging package contraband identification results. The method includes: selecting similar and spatially adjacent contraband items to be merged to form a first set, and then filtering them using initial screening criteria to obtain a second set; selecting the bounding rectangles of two contraband items in the second set to determine the intersection rectangle to construct an initial separation axis, and performing translation and / or rotation to generate a detection separation axis; and completing the merging and output of package contraband identification results based on similarity verification of the detection separation axis. The apparatus, device, and storage medium all correspond to this method. This application solves the problems of traditional static verification easily missing separation features and having a high false merging rate, while avoiding the defects of large computational load and low efficiency of single full-scale verification. While ensuring the accuracy of contraband identification, it significantly improves the processing efficiency and robustness of the security inspection system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of security inspection image data processing technology, specifically a method, apparatus, equipment, and storage medium for merging the results of package contraband identification. Background Technology

[0002] With the booming development of the modern logistics industry, the number of parcels has exploded, and the types of items they contain have become increasingly diverse. Against this backdrop, ensuring public safety and preventing the flow of contraband through logistics channels has become crucial. Security inspection machines, as key equipment in the logistics security inspection process, can image and detect the contents of parcels and identify potentially contraband. Typically, after scanning a parcel, the security inspection machine generates corresponding video images of the parcel. These images contain information such as the outline and density of the items inside the parcel, forming the basis for subsequent contraband identification. Receiving the video images of the parcel sent by the security inspection machine is the first step in identifying and analyzing contraband in parcels, and it is also the information entry point for building the entire contraband identification system. Only through the processing and analysis of these images can we further determine whether contraband is present in the parcel and the specific details of any such contraband. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, device, and storage medium for merging the results of package contraband identification, in order to solve the following technical problems in the prior art: existing security inspection contraband identification simply merges items based on category labels without considering the spatial position, size differences, and spacing of contraband items, which easily leads to the incorrect merging of similar items with gaps or even mixed with other contraband items; this kind of coarse merging method not only increases the computational complexity of subsequent target tracking algorithms and reduces operating performance, but also results in overly dense labeling on the security inspection display interface, which is not conducive to the intuitive viewing and identification by security personnel; at the same time, traditional solutions cannot accurately identify the physical separation gaps between contraband items, resulting in low accuracy of merging results and easily causing the problem of missed detection of contraband items.

[0004] To achieve the above objectives, this application provides a method for merging the results of prohibited item identification in parcels, including: Obtain the results of prohibited items identification in the package from the security inspection machine, filter out the prohibited items of the same type and in spatial contact to form a first set, and use the preset preliminary screening criteria to filter the first set to obtain a second set; The bounding rectangles of two prohibited items in the second set are selected to determine the intersection rectangle. An initial separation axis is constructed based on the intersection rectangle. The initial separation axis is translated and / or rotated to generate a detection separation axis. The detection separation axis is then subjected to similarity verification. For prohibited items that pass the similarity check, they are allowed to be merged. After traversing all prohibited items in the second set for verification, the prohibited item identification results of the package are merged and output.

[0005] Preferably, the generation of the detection separation axis includes obtaining the detection separation axis based on translating an initial separation axis, the translation process including: The outer rectangles of the two contrabands used to construct the initial separation axis are defined as the first outer rectangle and the second outer rectangle; Determine the maximum translation distance based on the difference between the first and second bounding rectangles; Obtain the normal vector of the initial separation axis; based on the aspect ratio between the first and second bounding rectangles, determine the direction of the normal vector, which is the translation direction; The initial separation axis is translated along the translation direction. When the translation reaches the maximum translation distance, the translation is stopped. During the translation process, the initial separation axis is extended in real time until it intersects both the first and second circumscribed rectangles, thereby constructing a dynamic detection separation axis.

[0006] Preferably, the generation of the detection separation axis further includes obtaining the detection separation axis by rotating the initial separation axis, the rotation process including: The outer rectangles of the two contraband used to construct the initial separation axis are defined as the third outer rectangle and the fourth outer rectangle; Determine the maximum rotation angle based on the differences between the third and fourth bounding rectangles; The rotation direction is determined based on the aspect ratio between the initial separation axis deflection direction and the third and fourth circumscribed rectangles; The initial separation axis is rotated along the rotation direction, and the rotation is stopped when the maximum rotation angle is reached. During the rotation, the initial separation axis is extended in real time until it intersects with both the third and fourth circumscribed rectangles, thereby constructing a dynamic detection separation axis.

[0007] Preferably, the initial screening criteria include an initial number criterion, a crossover ratio criterion, a static intersection rectangle criterion, an aspect ratio criterion, and an area criterion; wherein: The initial count criterion is as follows: when the number of contraband items of the same type and in spatial contact in the first set is less than the preset contraband count threshold, it is determined that merging is not allowed; The cross ratio criterion is as follows: when the cross ratio of the intersection rectangles corresponding to the same type of prohibited items that are spatially adjacent in the first set is less than the preset cross ratio threshold, it is determined that merging is not allowed. The static criterion for intersection rectangles is as follows: similarity check is performed on the intersection rectangles corresponding to the same type of prohibited items that are spatially in contact in the first set. Prohibited items that fail the similarity check are determined to be prohibited items that cannot be merged. The aspect ratio criterion is as follows: for two bounding rectangles corresponding to the same type of contraband and spatially adjacent contraband in the first set, based on the aspect ratio difference rate between the bounding rectangles and combined with the preset aspect ratio difference rate threshold, it is determined whether merging is allowed. The area criterion is as follows: for two circumscribed rectangles corresponding to the same type of contraband items that are spatially adjacent in the first set, the area difference rate between the circumscribed rectangles is used as a basis to determine whether merging is allowed.

[0008] Preferably, the similarity check is a dual-color check, specifically: performing a dual-color check on the color histogram of the intersection rectangle or the color histogram of the detection separation axis, including performing a first color check to obtain a first color check result and performing a second color check to obtain a second color check result, and performing a color similarity check based on the first color check result and the second color check result to determine whether merging is allowed; wherein: The first color verification is a color similarity analysis performed on the historical experience value statistical range of the target prohibited item; where the target prohibited item is the prohibited item for which a merging judgment is required; the historical experience value statistical range is determined based on the prohibited item category corresponding to the target prohibited item; The second color verification involves color similarity analysis of the historical experience value statistical range for non-target prohibited items. The historical experience value statistical range for non-target prohibited items includes: the historical experience value statistical range for the prohibited item categories corresponding to other prohibited items after excluding the prohibited item category corresponding to the target prohibited item; and the statistical range for the background color calibration value of the security inspection machine image.

[0009] Preferably, the determination of the maximum translation distance is as follows: The maximum translation distance is determined based on the aspect ratio difference rate between the first and second circumscribed rectangles and the area difference rate between the first and second circumscribed rectangles.

[0010] Preferably, the determination of the maximum rotation angle is as follows: The maximum rotation angle is determined based on the aspect ratio difference rate between the third and fourth circumscribed rectangles and the area difference rate between the third and fourth circumscribed rectangles.

[0011] To achieve the above objectives, this application also provides a device for merging the results of package contraband identification, which applies the package contraband identification result merging method described above, including: The fine screening object determination module is configured to: obtain the identification results of prohibited items in packages from the security inspection machine, screen out prohibited items of the same type and in spatial contact to form a first set, and use preset preliminary screening criteria to screen the first set to obtain a second set; The dynamic criterion execution module is configured to: select the bounding rectangles of two prohibited items in the second set to determine the intersection rectangle, construct an initial separation axis based on the intersection rectangle; translate and / or rotate the initial separation axis to generate a detection separation axis, and perform similarity verification on the detection separation axis; The prohibited items identification result merging module is configured to: determine prohibited items that pass the similarity check as allowed to be merged, and after traversing all prohibited items in the second set for verification, complete the output of the merged prohibited items identification results for the package.

[0012] To achieve the above objectives, this application also provides a device for merging the results of package contraband identification, including at least one processor, at least one memory, and a data bus; The processor and the memory communicate with each other via the data bus; The memory stores program instructions that can be executed by the processor, which calls the program instructions to execute the package contraband identification result merging method as described above.

[0013] To achieve the above objectives, this application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the method for merging package contraband identification results as described above.

[0014] Beneficial Effects: The method, apparatus, equipment, and storage medium for merging prohibited item identification results in this application achieve high efficiency and accuracy in merging similar prohibited items in security inspection images through a progressive merging and verification scheme that combines multi-dimensional initial screening criteria with precise verification of the detection separation axis. Overall, the combination of initial screening and precise verification enables full-process control of filtering invalid targets through coarse screening and identifying hidden separations through fine-tuning. This solves the problems of traditional static verification, which is prone to missing separation features and has a high rate of false merging, while avoiding the shortcomings of single full-volume verification, which has a large computational load and low efficiency. While ensuring the accuracy of prohibited item identification, it significantly improves the processing efficiency and robustness of the security inspection system. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 A flowchart illustrating the method for merging prohibited items identification results in parcels provided in this application embodiment; Figure 2 Illustration of contraband merging provided in this application embodiment Figure 1The direction in the image is from the upper right. Figure 3 Illustration of contraband merging provided in this application embodiment Figure 2 The direction in the image is from the top left. Figure 4 A schematic diagram showing the translation of the separation axis in the upper left direction when contraband is merged, as provided in the embodiments of this application; Figure 5 A schematic diagram of the rotation of the separation axis in a clockwise direction during the merging of contraband provided in the embodiments of this application; Figure 6 A flowchart illustrating the translation process provided in this application embodiment; Figure 7 A flowchart illustrating the rotation process provided in an embodiment of this application; Figure 8 A structural block diagram of the rotating package contraband identification result merging device provided in the embodiments of this application; in the figure: 10, fine screening object determination module; 20, dynamic criterion execution module; 30, contraband identification result merging module.

[0017] The implementation, functional features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0018] The technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0019] In this document, the term "comprising" is intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0020] This embodiment discloses a method, apparatus, device, and storage medium for merging the identification results of prohibited items in packages. It aims to solve the problem that existing security checks simply merge prohibited items according to their categories without considering spatial location, size differences, and physical intervals, which can lead to erroneous merging and missed detections. It reduces the complexity of subsequent target tracking algorithms, simplifies the display of security check interface labels, and improves the accuracy of prohibited item merging results and the efficiency of security check identification.

[0021] The application scenarios of this embodiment will now be described.

[0022] The current security inspection process using video surveillance generally includes the following steps: Step 1: Acquire video images of the package transmitted by the security inspection machine; Step 2: Process video images using a package segmentation algorithm to identify packages and output new packages in the image; Step 3: Use deep learning algorithms to perform AI-based contraband detection on the new package image and output the contraband contained in the package; Step 4: Optimize and adjust the detection results of prohibited items in the package to generate the final result of prohibited item identification; Step 5: Calculate the location of the final result of the contraband identification using the target tracking algorithm, and complete the rendering.

[0023] In practical applications, it has been found that for stage three, if a package contains multiple prohibited items of the same type, without any merging optimization in stage four, the target tracking algorithm in stage five will become more complex and its performance will decrease. Furthermore, the user interface will need to densely render and display the prohibited items, making it very difficult for security personnel to inspect them. For example, in stage three, if a package contains a box of milk, a box of lighters, and a box of beverages, the current detection algorithm will identify numerous bottles of milk, a large number of lighters, and many bottles of beverages as prohibited items. If no merging optimization is performed in stage four, the aforementioned technical difficulties will arise.

[0024] Furthermore, we will now explain the technical solutions for optimizing step four in the existing technology.

[0025] Existing technical solutions primarily rely on simple merging based on a single category attribute of prohibited items. Specifically, when a security scanner scans a package and identifies multiple prohibited items using an AI-based prohibited item detection algorithm, existing technologies simply count and merge prohibited items belonging to the same category. For example, if five lighters are detected in a package, existing technologies will merge these five lighters into a single result: "Lighters (5)". The core of this merging method is to reduce the number of duplicate displays of prohibited items of the same category, thereby reducing the number of objects processed by subsequent target tracking algorithms and the density of identifiers during user interface rendering.

[0026] However, in practical applications, it has been found that the merging logic only considers the basic category label of the prohibited items. That is, as long as the category names are the same, the quantities are summed to form a merged result that includes both category and total quantity information, without considering other characteristics such as size or distribution within the package. This easily leads to all or some prohibited items of the same category being merged into a single prohibited item. For example, if a large suitcase contains two cartons of milk, even if there are gaps between the two cartons or other prohibited items, they will be merged into one prohibited item.

[0027] Therefore, this embodiment proposes a method, apparatus, device, and storage medium for merging the identification results of prohibited items in packages.

[0028] It should also be noted that current mainstream target detection models in the industry, such as the YOLO series V1 to V7, output target location information based on axis-aligned bounding rectangles, without providing a minimum bounding rectangle. The contraband merging process in this embodiment is designed specifically to address this common industry practice: under the unified format of axis-aligned bounding rectangles, it achieves accurate merging of similar and contacting contraband items through multi-dimensional criteria and dynamic detection separation axis verification, possessing broad engineering adaptability.

[0029] The method, apparatus, equipment, and storage medium for merging the identification results of prohibited items in packages disclosed in this embodiment will now be described in detail.

[0030] Reference Figure 1 , Figure 1 A flowchart illustrating the method for merging the identification results of prohibited items in packages provided in this application embodiment.

[0031] Firstly, such as Figure 1 As shown in the figure, this embodiment discloses a method for merging the identification results of prohibited items in packages, including: The preconditions for the specific application of this embodiment will now be explained.

[0032] In this specific application, security inspection images are acquired through security inspection equipment. For a given security inspection image, all new packages within that image are traversed to obtain the corresponding current package information. All prohibited items within the current package are grouped by category, for example, milk, lighters, and beverages. It should be noted that, to facilitate subsequent determination of whether merging is permissible, this embodiment uses an existing disjoint-set data structure algorithm to obtain prohibited items that are spatially in contact. Based on this, the prohibited item identification result for the security inspection machine's package is obtained.

[0033] S10: Obtain the results of the security inspection machine's identification of prohibited items in packages, filter out prohibited items of the same type and in spatial contact to form a first set, and use preset preliminary screening criteria to screen the first set to obtain a second set.

[0034] To address the problem that existing security inspection contraband identification results are simply merged based on category labels without comprehensively considering the quantity, spatial location, size differences, and physical spacing of contraband, it is easy to mistakenly merge similar contraband with gaps or mixed with other items, leading to inaccurate merging results, increased complexity of subsequent target tracking algorithms, and cluttered and difficult-to-distinguish security inspection interface markings. In S10, this embodiment first obtains the contraband identification results of the package from the security inspection machine, filters out similar contraband that are spatially in contact to form a first set, and then uses preset preliminary screening criteria, including initial number criteria, intersection rectangle static criteria, aspect ratio criteria, and area criteria, to perform multi-dimensional screening on the first set to obtain a second set, laying the foundation for subsequent accurate verification.

[0035] Specifically, the initial screening criteria include the initial number criterion, the cross ratio criterion, the static intersection rectangle criterion, the aspect ratio criterion, and the area criterion.

[0036] The initial count criterion is as follows: when the number of contraband items of the same type and in spatial contact in the first set is less than the preset threshold for the number of contraband items, it is determined that merging is not allowed.

[0037] In a specific application of this embodiment, for a first set, the number of contraband items of the same type that are spatially adjacent to each other within that first set is obtained. A preset threshold for the number of contraband items is set. For example, such as Then when the number obtained is less than When this condition is met, merging is deemed not allowed. It should be noted that "not allowed to merge" here can be understood as not needing to merge, that is, directly outputting the prohibited items in the set as independent identification results without any merging operation. This avoids redundancy or confusion in identification results caused by merging a small number of similar prohibited items, reduces unnecessary computational overhead, and ensures that the identification results of each independent prohibited item are clear and traceable, avoiding the risk of information loss or misjudgment caused by merging operations.

[0038] The cross ratio criterion is as follows: when the cross ratio of the intersection rectangles corresponding to the same type of prohibited items that are spatially adjacent in the first set is less than the preset cross ratio threshold, it is determined that merging is not allowed.

[0039] In a specific application of this embodiment, for two contraband items of the same type and spatially adjacent in a first set, the cross ratio of the intersection rectangles corresponding to the two contraband items is obtained. Value, if the The value is less than the preset crossover ratio threshold. For example, such as If the two prohibited items do not meet the criteria for merging, they are considered unsuitable for merging, and the process begins iterating through the next prohibited item. This means that merging is disallowed, and the two prohibited items are output as independent identification results, bypassing subsequent dual color verification and separation axis detection processes. The purpose of this design is to pre-determine that prohibited items with extremely low spatial overlap and almost no contact do not need to be merged, avoiding the waste of computational power caused by complex subsequent color analysis and separation axis calculations, thus improving the efficiency of the overall merging process. Simultaneously, it avoids the risk of unnecessary merging of these naturally independent targets from the outset, ensuring the accuracy of the identification results.

[0040] The static criterion for intersection rectangles is as follows: similarity verification is performed on the intersection rectangles corresponding to the same type of prohibited items that are spatially in contact in the first set. Prohibited items that fail the similarity verification are determined to be prohibited items that cannot be merged.

[0041] In the scenario of contraband item merging and verification, existing similarity verification technologies typically employ color similarity checks. For color similarity verification, current technologies generally rely solely on a single color feature for matching. Common types include overall similarity comparison based on a global color histogram, and simple statistical verification based on pixel mean or variance. The drawback of this single-check approach is that when the gaps between contraband items are filled by background color or other item colors, it is easy to misclassify similar items with physical separation as continuous targets, or to miss the separation gaps due to the similarity between the background color and the contraband item color. This leads to distorted merging results and an inability to effectively distinguish between truly continuous targets and independent targets separated by the background / other items.

[0042] To overcome the shortcomings of existing single-color verification, the similarity verification in this embodiment adopts dual-color verification. Specifically, dual-color verification is performed on the color histogram of the intersection rectangle or the color histogram of the detection separation axis, including performing a first color verification to obtain a first color verification result and performing a second color verification to obtain a second color verification result. Based on the first color verification result and the second color verification result, color similarity verification is performed to determine whether merging is allowed.

[0043] The first color verification is a color similarity analysis performed on the historical experience value statistical range of the target prohibited item; the target prohibited item is the prohibited item for which a merging judgment is required; the historical experience value statistical range is determined based on the prohibited item category corresponding to the target prohibited item.

[0044] In the specific application of this embodiment, for the prohibited item category corresponding to the target prohibited item, the historical experience value statistical range of that prohibited item category is obtained. It should be noted that this historical experience value statistical range is determined based on big data values. For example: two similar milk cartons are in contact, each carton containing several bottles of milk. A determination is needed regarding whether these bottles of milk can be combined. In this case, the target prohibited item is the bottled milk. At this time, several lighters are present in the gap formed by the two similar milk cartons in contact. Compared to the bottled milk, the lighters are not the target prohibited item, i.e., other prohibited items.

[0045] For ease of explanation, this embodiment defines the historical experience value statistical range for a prohibited item category as follows: the red range is... The green area is The blue area is Therefore, the first color verification specifically involves: obtaining the color histogram of the intersection rectangles. Or detect the color histogram of the separation axis. The red component in The percentage of the interval, the green component is in The percentage of the interval, the blue component is in Based on the percentage values ​​of the intervals, calculate the color histogram of the intersection rectangle. Or detect the color histogram of the separation axis. The color similarity to the historical experience value statistical range is used for the first color verification.

[0046] The second color verification involves color similarity analysis of the historical experience value statistical range for non-target prohibited items. The historical experience value statistical range for non-target prohibited items includes: the historical experience value statistical range for the prohibited item categories corresponding to other prohibited items after excluding the prohibited item category corresponding to the target prohibited item; and the statistical range for the background color calibration value of the security inspection machine image.

[0047] In the specific application of this embodiment, the color similarity analysis performed on the historical experience value statistical interval of non-target prohibited items is a non-target color reference library constructed for the prohibited items to be merged. It is used to identify the intersection area or detect whether there are dividing color features on the separation axis, so as to distinguish between continuous prohibited items and separated independent prohibited items.

[0048] To facilitate understanding, specific examples will be provided below.

[0049] For example, if the current prohibited item category to be merged is "bottled liquids", then the non-target color reference library specifically contains two parts: First, the color statistical range of other prohibited items corresponding to prohibited item categories, that is, the statistical range of historical experience values; specifically, after excluding "bottled liquids", the historical color distribution range of all other prohibited item categories in the security inspection system, such as the metal color range of knives, the shell color range of lithium batteries, the plastic color range of lighters, etc.

[0050] Second, the color calibration range of the security inspection image background: that is, the color distribution range of typical background elements such as the security inspection machine conveyor belt, clothing, and packaging filler, such as the gray range of the gray conveyor belt and the RGB value range of white clothing.

[0051] By comparing the pixel colors of the detection area with the aforementioned reference range, if a large number of colors belonging to non-target contraband or the background are found, it can be determined that there is a physical separation between the two contraband items to be merged, and thus it is determined that merging is not allowed.

[0052] The static criterion for intersection rectangles in this embodiment will now be explained using the color of the background of the security inspection image to define the range.

[0053] The historical experience value statistical range for this prohibited item category as defined above is: the red range is... The green area is The blue area is .

[0054] Obtain the statistical range of color calibration values ​​for the background of the security inspection image, defining the red range as... The green area is The blue area is .

[0055] Reference Figure 2 and Figure 3 . Figure 2 Illustration of contraband merging provided in this application embodiment Figure 1 The direction in the image is from the upper right. Figure 3 Illustration of contraband merging provided in this application embodiment Figure 2 The direction in the image is from the top left.

[0056] For two contraband items of the same type that are spatially adjacent in a first set, obtain the intersection rectangle of the two contraband items. ,like Figure 2 and Figure 3 The light blue transparent area in the image. Calculate the intersection rectangle. Color histogram of the corresponding region image .

[0057] Calculate separately The red component in Percentage of the interval The green component is Percentage of the interval The blue component is Percentage of the interval .

[0058] Calculate the intersection rectangle The color similarity between the corresponding region image and the category of prohibited items The mathematical expression is as follows: Calculate separately The red component in Percentage of the interval The green component is Percentage of the interval The blue component is Percentage of the interval .

[0059] Calculate the intersection rectangle Color similarity between the corresponding region image and the image background The mathematical expression is as follows: At this point, regarding similarity verification, if The value is less than For example, ,and The value is less than For example, If a contraband item is found to be unsuitable for merging, the process begins iterating through the next contraband item. This means that merging is not allowed because there is a clear non-target color separation feature between the two contraband items to be merged. They are then output as independent recognition results, bypassing subsequent aspect ratio, area difference checks, and separation axis detection. This is done to filter out targets with color separation in advance, avoiding unnecessary complex calculations later, while ensuring that similar contraband items separated by the background or other objects are not mistakenly merged, thus improving the accuracy of the recognition results and overall processing efficiency.

[0060] The aspect ratio criterion is as follows: for two bounding rectangles corresponding to the same type of contraband items that are spatially adjacent in the first set, the merging is determined based on the aspect ratio difference rate between the bounding rectangles and a preset aspect ratio difference rate threshold.

[0061] For two contraband items of the same type that are spatially adjacent in a first set, calculate the aspect ratio of the rectangles representing the target locations of these two contraband items. , Based on aspect ratio , Calculate the aspect ratio difference rate between these two prohibited items. The mathematical expression is as follows: in, This is a function for the absolute value of floating-point numbers.

[0062] if The value is greater than the preset aspect ratio difference rate threshold. For example, If a contraband item is found to be significantly different in size or shape, it is considered unsuitable for merging and the process begins iterating through the next contraband item. This means that merging is not allowed because the two contraband items are deemed to have significantly different dimensions and are likely not consecutively placed items of the same type. They are then output as independent identification results and do not proceed to subsequent area difference verification and separation axis detection processes. This design leverages the fact that similar contraband items typically have consistent aspect ratios, pre-screening targets with significant shape differences. This avoids unnecessary complex calculations and effectively prevents erroneous merging due to large shape differences, further improving the accuracy of the merging results and overall processing efficiency.

[0063] The area criterion is as follows: for two circumscribed rectangles corresponding to the same type of contraband items that are spatially adjacent in the first set, the area difference rate between the circumscribed rectangles is used as a basis to determine whether merging is allowed.

[0064] For two contraband items of the same type that are spatially adjacent in a first set, calculate the aspect ratio of the rectangles representing the target locations of these two contraband items. , Based on aspect ratio , Calculate the aspect ratio difference rate between these two prohibited items. The mathematical expression is as follows: in, It is an absolute value function.

[0065] if The value is greater than the preset area difference rate threshold. For example, If the size difference between two prohibited items is too large, it is considered unnecessary to merge them, and the process begins iterating through the next prohibited item. Understandably, this disallowing of merging means that the two prohibited items are deemed to have a significant size difference, making merging them into a single target unreasonable. They are then output as independent identification results and do not proceed to the subsequent separation axis verification process. In security inspection scenarios, similar prohibited items are usually of similar size. If the area difference rate exceeds a preset threshold, it indicates that the two items are likely independent entities. Terminating the merging process early avoids unnecessary complex calculations and prevents the erroneous merging of similar items with significant size differences, further ensuring the accuracy and efficiency of the identification results.

[0066] Based on the above, through a multi-dimensional initial screening process consisting of initial number criteria, cross ratio criteria, intersection rectangle static criteria, aspect ratio criteria, and area criteria, the prohibited items in the first set have been verified layer by layer for quantity validity, spatial overlap, color continuity, and shape consistency. Pairs of prohibited items that do not meet the merging rationality have been eliminated, resulting in the second set.

[0067] To balance processing efficiency and screening accuracy, the execution order of the initial screening criteria in this embodiment can be flexibly configured to adapt to the performance and accuracy requirements of different scenarios. The following are two typical implementation methods: Method 1: The process is executed in the following order: first, quantity validity; second, spatial overlap; and third, shape and color features. First, the initial quantity criterion is applied to verify the quantity of similar, spatially adjacent prohibited items in the first set, directly eliminating prohibited item groups whose quantities do not meet the merging criteria. Next, the cross-ratio criterion is applied to verify the overlap of the intersection rectangles of the remaining prohibited item pairs, filtering out prohibited item pairs with insufficient spatial contact. Then, the aspect ratio and area criters are applied sequentially to verify the dimensional consistency of the prohibited item pairs from a shape perspective. Finally, the static intersection rectangle criterion is applied to verify the color continuity of the prohibited item pairs that have passed the aforementioned checks, completing the static-level separation feature identification.

[0068] Method 2: The process is executed in the following order: initial quantity and spatial characteristics screening, color feature verification, and finally shape consistency verification. First, the initial quantity criterion and cross-ratio criterion are executed simultaneously to complete the basic filtering and remove prohibited item groups and pairs that are insufficient in quantity or do not meet the spatial overlap standard. Then, the intersection rectangle static criterion is executed to prioritize the identification of prohibited item pairs with gaps through color features. Finally, the aspect ratio criterion and area criterion are executed in sequence to verify the shape consistency of the remaining prohibited item pairs.

[0069] In any of the above execution sequences, if any prohibited item pair does not meet the corresponding criterion conditions at any step, the merging process will be terminated directly and will not enter the subsequent verification stage. This achieves efficient filtering of invalid targets, avoids unnecessary complex calculations, and maximizes the overall processing efficiency while ensuring screening accuracy.

[0070] In practical applications, it has been found that these initial screening criteria alone are insufficient to accurately identify minute gaps between contraband items or dividing areas filled with background colors or other item colors. This can easily lead to the misclassification of similar contraband items that appear continuous on the surface but have actual physical gaps. To address this issue, this embodiment further constructs an initial separation axis based on an intersection rectangle for the second set obtained from the initial screening. A detection separation axis is then generated through translation and / or rotation to accurately verify the separation status between contraband items.

[0071] S20: Select the bounding rectangles of the two prohibited items in the second set to determine the intersection rectangle, and construct the initial separation axis based on the intersection rectangle; translate and / or rotate the initial separation axis to generate the detection separation axis, and perform similarity verification on the detection separation axis.

[0072] The construction of the initial separation shaft will now be explained.

[0073] In the specific application of this embodiment, the following method is used to detect intersection rectangles. Does the corresponding region have an initial separation axis? For example, the initial separation axis For reference Figure 2 and Figure 3 The green line segment in the middle: Determine the intersection rectangle The four vertices are respectively , , , ; refer to Figure 2 ,like The area is formed by the intersection of the lower right and upper left portions of the location of the contraband, then the separation axis... for ; refer to Figure 3 ,like The area is formed by the intersection of the lower left and upper right portions of the location of the contraband, then the separation axis... for .

[0074] The present embodiment will now describe how to translate and / or rotate the initial separation axis to generate the detection separation axis.

[0075] Reference Figure 4 and Figure 5 . Figure 4 This is a schematic diagram of the translation of the separation axis in the direction of the upper left when contraband is merged, as provided in the embodiments of this application. Figure 5 This is a schematic diagram of the rotation of the separation axis in a clockwise direction when contraband is combined, as provided in the embodiments of this application.

[0076] In this embodiment, the method of translating and / or rotating the initial separation axis to generate the detection separation axis is not fixed to a single mode, but is flexibly selected according to the shape characteristics and relative posture of the contraband to be merged in the second set: refer to Figure 4 When the contraband to be merged is of a regular shape and its orientation is substantially parallel, all potential separation areas can be covered simply by translating the initial separation axis; see reference. Figure 5 When prohibited items are tilted, misaligned, or irregularly shaped, a rotation operation is required to adjust the angle of the separation shaft to match their relative posture.

[0077] In the specific application of this embodiment, by combining translation and / or rotation, it is possible to fully cover the tiny gaps, tilted separations, and hidden separation areas under irregular shapes that may exist between contraband items, providing sufficient detection dimensions for subsequent similarity verification, thereby solving the problem of identifying the separation state of contraband items with different postures and shapes.

[0078] The specific implementation methods of translation and rotation will now be explained in detail.

[0079] Reference Figure 6 , Figure 6 A flowchart illustrating the translation process provided in this application embodiment.

[0080] like Figure 6 As shown, regarding the specific implementation of the translation, specifically, the generation of the detection separation axis includes obtaining the detection separation axis by translating the initial separation axis. This translation process includes: A1: Define the two bounding rectangles used to construct the initial separation axis as the first bounding rectangle and the second bounding rectangle.

[0081] Reference Figure 4 At this point, the first bounding rectangle corresponds to the bounding rectangle of contraband 1, and the second bounding rectangle corresponds to the bounding rectangle of contraband 2.

[0082] A2: Determine the maximum translation distance based on the difference between the first and second circumscribed rectangles.

[0083] To prevent the separating axis from exceeding the effective range of the intersection rectangle during translation, while ensuring coverage of all potential separating areas, a reasonable maximum translation distance needs to be determined based on the differences between the first and second circumscribed rectangles. Specifically, if the translation distance is set too small, minute gaps between prohibited items may be missed; if it is set too large, the separating axis will shift out of the intersection rectangle area, introducing invalid background pixels and interfering with the similarity verification results. Therefore, determining the maximum translation distance requires a comprehensive calculation combining the aspect ratio difference rate and area difference rate of the first and second circumscribed rectangles to achieve a balance between not missing separating features and not introducing invalid information.

[0084] Specifically, the determination of the maximum translation distance is as follows: The maximum translation distance is determined based on the aspect ratio difference rate between the first and second circumscribed rectangles and the area difference rate between the first and second circumscribed rectangles.

[0085] In this embodiment, the aspect ratio difference rate and area difference rate mentioned above can be directly reused from the aspect ratio difference rate and area difference rate calculated in the preceding steps, without repeated calculation, thereby reducing redundant calculations and improving processing efficiency. Based on these two existing difference rate parameters, the initial separation axis can be dynamically calculated. Maximum translation distance This provides clear boundary constraints for subsequent translation operations.

[0086] calculate The maximum translation distance is The mathematical expression is as follows: in: It is the square root function; These are preset values ​​set based on actual needs, for example, such as... .

[0087] A3: Obtain the normal vector of the initial separation axis; based on the aspect ratio between the first and second circumscribed rectangles, determine the direction of the normal vector, which is the translation direction.

[0088] In this specific application, the normal vector perpendicular to the initial separation axis is obtained. To determine the direction of the normal vector, the aspect ratio of the first bounding rectangle is used. Aspect ratio of the second circumscribed rectangle ,judge and The size of the vector, and the direction of the normal vector, point towards the side with the smaller aspect ratio. (Refer to...) Figure 4 This is the orange vector in the diagram.

[0089] A4: Translate the initial separation axis along the translation direction. Stop translating when the maximum translation distance is reached. During the translation process, extend the initial separation axis in real time until it intersects both the first and second circumscribed rectangles, thereby constructing a dynamic detection separation axis.

[0090] In the specific application of this embodiment, Translate along the normal vector and in its direction, with the distance moved gradually increasing from 1. Upon arrival The translation stops at that point. The value gradually increases from 1 to... During the translation process, after each translation, the length is extended. From both ends, until it intersects with the rectangular sides of all target locations, a dynamic, new detection separation axis is formed. . Reference Figure 4 The thin green line in the image shows a detection method for separating shafts. An example, namely a line segment .

[0091] The similarity verification performed on the detection separation axis obtained by translation is now explained in detail.

[0092] In the specific application of this embodiment, the detection separation axis obtained by translation is defined as ,against The similarity check performed also employs the aforementioned dual-color check. Following the explanation and examples of the dual-color check described above, for... The similarity check performed is as follows: Premisely, this embodiment generates multiple lines during the translation process. Specifically, after each translation, a new path is generated. For each new one generated Double color verification is performed. If a verification fails (i.e., the colors are not similar), merging is directly disallowed, and the translation operation is stopped. Therefore, it should be noted that this embodiment establishes the maximum translation distance for the translation process. It is a clearly defined boundary constraint in the translation process, that is, if it reaches If the color is similar and the verification is still passed, then there is no need to continue the translation process. It can be directly determined that they can be merged or the rotation process can be repeated for further judgment.

[0093] calculate Color histogram of the corresponding region image ; Calculate separately In the middle, the red component is Percentage of the interval The green component is Percentage of the interval The blue component is Percentage of the interval .

[0094] calculate The color similarity between the corresponding region image and the category of prohibited items The mathematical expression is as follows: Calculate separately In the middle, the red component is Percentage of the interval The green component is Percentage of the interval The blue component is Percentage of the interval .

[0095] calculate Color similarity between the corresponding region image and the image background The mathematical expression is as follows: At this point, regarding similarity verification, if The value is less than For example, such as ,and The value is less than For example, such as If the condition is not met, merging is considered disallowed, and the process begins iterating through the next prohibited item. It's understandable that disallowing merging here means determining that the detection separation axis is not allowed. The corresponding area shows a very low match between its color characteristics and those of the contraband to be merged, as well as a low match between its color characteristics and those of the security image background. This indicates the presence of other color characteristics within the area that are neither the target contraband nor the background. It is highly likely that these are physical separations caused by other contraband or foreign objects. Therefore, the two contraband items are determined to be independent targets and cannot be merged. At this point, the merging process for this pair of contraband items is terminated, and the process begins iterating through the next group of contraband items. This avoids unnecessary computational overhead and prevents the erroneous merging of similar contraband items separated by other items.

[0096] Reference Figure 7 , Figure 7 A flowchart illustrating the rotation process provided in an embodiment of this application.

[0097] like Figure 7 As shown, regarding the specific implementation of the rotation, specifically, the generation of the detection separation axis further includes obtaining the detection separation axis by rotating the initial separation axis. This rotation process includes: B1: Define the outer rectangles of the two contrabands used to construct the initial separation axis as the third outer rectangle and the fourth outer rectangle.

[0098] Reference Figure 5 At this point, the third outer rectangle corresponds to the outer rectangle of contraband 1, and the fourth outer rectangle corresponds to the outer rectangle of contraband 2.

[0099] B2: Determine the maximum rotation angle based on the differences between the third and fourth circumscribed rectangles.

[0100] In this embodiment, the design principle for the rotation process corresponds to the design principle for the translation process. Therefore, the design principle for the rotation process will not be elaborated upon in this embodiment. It should be noted that, unlike the detection separation axis obtained based on translation, the detection separation axis obtained by rotation is designed to adapt to scenarios where there are tilted, misaligned, or non-parallel postures between contraband items, or asymmetrical or irregular features in shape. It breaks through the limitation that translation can only detect along a single direction, and can cover oblique gaps, irregular separations, and hidden separation areas caused by placement angle deviations between contraband items from multiple angles. This solves the problem of tilted separation features that may be missed in translation verification, and achieves comprehensive identification of the separation state of contraband items with different postures. Moreover, it does not rely on the symmetry assumption of the target shape and has universal detection capability for various irregularly shaped contraband items.

[0101] Specifically, the determination of the maximum rotation angle is as follows: The maximum rotation angle is determined based on the aspect ratio difference rate between the third and fourth circumscribed rectangles and the area difference rate between the third and fourth circumscribed rectangles.

[0102] In this embodiment, the aspect ratio difference rate and area difference rate in the calculation of the maximum translation distance, which are related to the calculation of the maximum rotation angle, are also directly reused from the aspect ratio difference rate and area difference rate calculated in the previous steps.

[0103] calculate The maximum rotation angle is The mathematical expression is as follows: in, These are preset values ​​set based on actual needs, for example, such as... .

[0104] B3: Determine the rotation direction based on the deflection direction of the initial separation axis and the aspect ratio between the third and fourth circumscribed rectangles.

[0105] In the specific application of this embodiment, Figure 5 The direction shown is The initial separation axis is explained as follows: Rotate around the midpoint of the initial separation axis; When the direction of the initial separation axis is If the aspect ratio of prohibited item 1 in the upper left corner is smaller than that of prohibited item 2 in the lower right corner, rotate clockwise; otherwise, rotate counterclockwise.

[0106] When the direction of the initial separation axis is not If If the aspect ratio of prohibited item 1 in the upper right corner is smaller than that of prohibited item 2 in the lower left corner, rotate counterclockwise; otherwise, rotate clockwise.

[0107] B4: Rotate the initial separation axis along the rotation direction, and stop rotating when it reaches the maximum rotation angle; during the rotation, extend the initial separation axis in real time until it intersects with both the third and fourth circumscribed rectangles, thereby constructing a dynamic detection separation axis.

[0108] In the specific application of this embodiment, Rotate along the direction of rotation, the rotation angle from Start gradually increasing to Upon arrival Stop rotating at that time. Throughout the entire process from... Start gradually increasing to During the rotation process, after each rotation, the duration is extended. From both ends, until it intersects with the rectangular sides of all target locations, a dynamic, new detection separation axis is formed. . Reference Figure 5 The thin green line in the image shows a detection method for separating shafts. An example, namely a line segment .

[0109] The similarity verification performed on the detection separation axis obtained by rotation is now explained in detail.

[0110] In the specific application of this embodiment, the detection separation axis obtained by translation is defined as Corresponding to the aforementioned Similarity checks, targeting The similarity check performed also employs the aforementioned dual-color check. Following the explanation and examples of the dual-color check described above, for... The similarity check performed is as follows: As a premise, the principle of the rotation process in this embodiment corresponds to the aforementioned translation process, that is, multiple lines are also generated during the rotation process. Specifically, after each rotation, a new path is generated. For each new one generated Double color verification is performed. If a verification fails (i.e., the colors are not similar), merging is directly disallowed, and the rotation operation is stopped simultaneously. Therefore, it should be noted that the maximum rotation angle constructed in this embodiment for the rotation process... It is a clear boundary constraint for the rotation process, that is, if it reaches If the color is similar and the verification is still passed, then there is no need to continue the rotation process. It can be directly determined that they can be merged, or the translation process can be repeated for further judgment. In practical applications, if the separation axes obtained by translation and rotation both pass the verification, it can be directly determined that they can be merged.

[0111] calculate Color histogram of the corresponding region image ; Calculate separately In the middle, the red component is Percentage of the interval The green component is Percentage of the interval The blue component is Percentage of the interval .

[0112] calculate The color similarity between the corresponding region image and the category of prohibited items The mathematical expression is as follows: Calculate separately In the middle, the red component is Percentage of the interval The green component is Percentage of the interval The blue component is Percentage of the interval .

[0113] calculate Color similarity between the corresponding region image and the image background The mathematical expression is as follows: At this point, regarding similarity verification, if The value is less than For example, such as ,and The value is less than For example, such as If the condition is not met, merging is considered disallowed, and the process begins iterating through the next prohibited item. It's understandable that disallowing merging here means determining that the detection separation axis is not allowed. The corresponding area shows a very low match between its color features and those of the contraband to be merged, and also a low match with the color features of the security image background. This indicates that there are other color features within the area that are neither the target contraband nor the background. It is highly likely that these are physical separations caused by other contraband or foreign objects. Therefore, the two contraband items are determined to be independent targets and cannot be merged. At this point, the merging process for this pair of contraband items is terminated, and the process begins iterating through the next group of contraband items. This avoids unnecessary computational overhead and prevents the erroneous merging of similar contraband items separated by other items.

[0114] Therefore, this embodiment achieves comprehensive verification of the separation status of contraband with different postures and shapes by translating and / or rotating the initial separation axis to generate the detection separation axis. The translation process is based on dynamically calculated maximum translation distance, expanding along the normal vector direction to adapt to contraband with regular shapes and parallel postures, covering small gaps in the horizontal / vertical directions. The rotation process is based on dynamically calculated maximum rotation angle, adjusting the separation axis angle to adapt to contraband with tilt, misalignment, or irregular shapes, covering oblique and irregular separation areas. The key parameters, maximum translation distance and maximum rotation angle, are dynamically determined based on the aspect ratio difference rate and area difference rate of the contraband's bounding rectangle. This avoids the introduction of invalid pixels due to the separation axis moving out of the effective area, and also avoids the omission of separation features due to improper angle / distance settings, balancing verification accuracy and computational cost. For the generated detection separation axis, the color similarity between the region and both the target contraband and non-target contraband is simultaneously verified. The color similarity analysis of the non-target contraband can include the color similarity to the background, thus quickly determining the presence of foreign object separation. Once a preset condition is met, the merging process for the current contraband pair is terminated, and the process iterates to the next target group without performing redundant calculations. Based on this, the limitations of traditional static verification are overcome. Through a combination of translation expansion and / or rotation adaptation strategies, full coverage detection of regular / irregular, parallel / tilted scenes is achieved. This effectively solves the problem that a single static separation axis cannot identify minute gaps, oblique separations, and hidden separation areas, avoiding erroneous merging caused by surface continuity but actual physical gaps. While improving merging accuracy, overall processing efficiency is ensured.

[0115] S30: For prohibited items that pass the similarity check, they are determined to be allowed to be merged. After traversing all prohibited items in the second set for verification, the prohibited item identification results of the package are merged and output.

[0116] In the specific application of this embodiment, the new set consisting of contraband from the second set, which is determined by the initial screening criteria and the similarity verification based on the detection separation axis, is defined as... The corresponding number is , , ... , , The merged prohibited items are defined as... and calculate target location That is, the position of the axis-aligned circumscribed rectangle, where... , Let be the coordinates of the top-left corner of the circumscribed rectangle. , (Given the width and height of the circumscribed rectangle), the merging and corresponding calculation process, based on the mathematical expression, is as follows: initialization The value is Target location; from Start traversing the collection For all other remaining contraband items, perform the following operations respectively: retrieve the current contraband items; merge. The method for determining the target location of the contraband is as follows: Calculate their target positions minimum value , maximum value ; Calculate their target positions minimum value , maximum value ; Calculate the target location after merging them. Revise The value is the target location after they are merged. .

[0117] When merging and outputting the results of prohibited item identification in packages, use sets. The categories of prohibited items in China are as follows Categories, using sets The names and quantities of prohibited items in China are used as... The name, for example, is "Milk (16 bottles)".

[0118] Additionally, it should be noted that in the specific application of this embodiment, in order to improve the quality of the data required for security personnel to interpret, a set is used. The confidence mean of all prohibited items in the data is used as... The confidence level.

[0119] This concludes the complete explanation of the technical principles, effects, and applications of the method for merging prohibited items identification results in packages as described in this embodiment.

[0120] Reference Figure 8 , Figure 8A structural block diagram of the rotating package contraband identification result merging device provided in the embodiments of this application; in the figure: 10, fine screening object determination module; 20, dynamic criterion execution module; 30, contraband identification result merging module.

[0121] Secondly, such as Figure 8 As shown, this embodiment also discloses a device for merging the identification results of prohibited items in packages, which applies the method for merging the identification results of prohibited items in packages as described above, including: The fine screening object determination module 10 is configured to: obtain the identification results of prohibited items in packages from the security inspection machine, screen out prohibited items of the same type and in spatial contact to form a first set, and use preset preliminary screening criteria to screen the first set to obtain a second set.

[0122] The dynamic criterion execution module 20 is configured to: select the bounding rectangles of two prohibited items in the second set to determine the intersection rectangle, construct an initial separation axis based on the intersection rectangle; translate and / or rotate the initial separation axis to generate a detection separation axis, and perform similarity verification on the detection separation axis.

[0123] The prohibited items identification result merging module 30 is configured to: determine the prohibited items that pass the similarity check as allowed to be merged, and after traversing all prohibited items in the second set for verification, complete the output of the package prohibited items identification result merging.

[0124] Thirdly, this embodiment also discloses a device for merging the identification results of prohibited items in packages, including at least one processor, at least one memory, and a data bus.

[0125] The processor and the memory communicate with each other via the data bus.

[0126] The memory stores program instructions that can be executed by the processor, which calls the program instructions to execute the package contraband identification result merging method as described above.

[0127] Fourthly, this embodiment also discloses a storage medium storing a computer program, which, when executed by a processor, implements the method for merging the identification results of contraband in packages as described above.

[0128] It should be noted that the package contraband identification result merging device, equipment, and storage medium of this embodiment correspond to the aforementioned package contraband identification result merging method. Therefore, any content not specifically described in the package contraband identification result merging device, equipment, and storage medium of this embodiment, including but not limited to functional definitions, working principles, and technical effects, can be referred to the description in the aforementioned package contraband identification result merging method, and will not be repeated here.

[0129] In summary, the method, apparatus, equipment, and storage medium for merging package contraband identification results in this embodiment achieve high efficiency and high accuracy in merging similar contraband in security inspection images through a progressive merging and verification scheme that combines multi-dimensional initial screening criteria with precise verification of the detection separation axis.

[0130] First, the initial screening, based on the initial number criterion, cross ratio criterion, static intersection rectangle criterion, aspect ratio criterion, and area criterion, eliminates prohibited pairs that do not meet the basic merging conditions. It not only filters out invalid targets through quantity and spatial overlap verification, but also completes coarse-grained segmentation and identification through color continuity and shape consistency verification, thus terminating the process that does not have reasonable merging in advance, avoiding redundant overhead of subsequent complex calculations, and greatly improving the overall processing efficiency.

[0131] Building upon this foundation, for minute gaps, oblique separations, and hidden separation areas in irregular shapes that cannot be identified by the initial screening, further precise verification is achieved through the detection separation axis: by translating and / or rotating the initial separation axis, multi-directional and multi-angle detection separation axes are generated, dynamically adapting to the posture and shape characteristics of contraband, covering various scenarios such as parallel, inclined, regular, and irregular shapes; at the same time, the maximum translation distance and maximum rotation angle are dynamically determined based on the difference of the circumscribed rectangle, avoiding the introduction of invalid detection areas and balancing verification accuracy and computational overhead; and the separation area is quickly determined through dual color similarity verification, and the merging process is terminated once a foreign object separation is detected, effectively avoiding erroneous merging caused by surface continuity but actual physical gaps.

[0132] Overall, by combining initial screening with precise verification, the system achieves full-process control of filtering out invalid targets through coarse screening and identifying hidden separations through fine verification. This solves the problems of traditional static verification, which is prone to missing separation features and has a high rate of false merging, while avoiding the shortcomings of single full verification, which has a large computational load and low efficiency. While ensuring the accuracy of contraband identification, it significantly improves the processing efficiency and robustness of the security inspection system.

[0133] In the embodiments provided in this application, it should be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code, or any suitable combination thereof. For hardware implementation, the processor may be implemented in one or more of the following: application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, other electronic units designed to implement the functions described herein, or combinations thereof. For software implementation, some or all of the processes of the embodiments may be performed by a computer program instructing the associated hardware. During implementation, the program may be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media may be any available medium accessible to a computer. Computer-readable storage media may include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code having the form of instructions or data structures and accessible to a computer.

[0134] Finally, it should be noted that the above description is only a preferred embodiment of this application and is not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for merging the results of contraband identification in packages, characterized in that, include: The system obtains the results of prohibited item identification from the security inspection machine, filters out prohibited items of the same type that are spatially adjacent to each other to form a first set, and uses preset preliminary screening criteria to filter the first set to obtain a second set. The preliminary screening criteria include initial number criteria, cross ratio criteria, intersection rectangle static criteria, aspect ratio criteria, and area criteria. Among them, the intersection rectangle static criteria specifically involves performing similarity checks on the intersection rectangles corresponding to the prohibited items of the same type that are spatially adjacent in the first set, and determining that prohibited items that fail the similarity check are not allowed to be merged. The similarity check is a dual color check, specifically: performing dual color checks on the color histogram of the intersection rectangle or the color histogram of the detection separation axis, including performing a first color check to obtain a first color check result and performing a second color check to obtain a second color check result. The first color check is a color similarity analysis performed on the historical experience value statistical interval of the target prohibited item, and the second color check is a color similarity analysis performed on the historical experience value statistical interval of non-target prohibited items. The bounding rectangles of two prohibited items in the second set are selected to determine the intersection rectangle. An initial separation axis is constructed based on the intersection rectangle. The initial separation axis is translated and / or rotated to generate a detection separation axis. The detection separation axis is similar to the detection separation axis, including dual color verification of the detection separation axis generated by translation and / or rotation. For prohibited items that pass the similarity check, they are allowed to be merged. After traversing all prohibited items in the second set for verification, the prohibited item identification results of the package are merged and output.

2. The method for merging the identification results of prohibited items in packages according to claim 1, characterized in that, The generation of the detection separation axis includes obtaining the detection separation axis by translating an initial separation axis, the translation process including: The outer rectangles of the two contrabands used to construct the initial separation axis are defined as the first outer rectangle and the second outer rectangle; Determine the maximum translation distance based on the difference between the first and second bounding rectangles; Obtain the normal vector of the initial separation axis; based on the aspect ratio between the first and second bounding rectangles, determine the direction of the normal vector, which is the translation direction; The initial separation axis is translated along the translation direction. When the translation reaches the maximum translation distance, the translation is stopped. During the translation process, the initial separation axis is extended in real time until it intersects both the first and second circumscribed rectangles, thereby constructing a dynamic detection separation axis.

3. The method for merging the identification results of prohibited items in packages according to claim 1, characterized in that, The generation of the detection separation axis further includes obtaining the detection separation axis based on rotating the initial separation axis, the rotation process including: The outer rectangles of the two contraband used to construct the initial separation axis are defined as the third outer rectangle and the fourth outer rectangle; Determine the maximum rotation angle based on the differences between the third and fourth bounding rectangles; The rotation direction is determined based on the aspect ratio between the initial separation axis deflection direction and the third and fourth circumscribed rectangles; The initial separation axis is rotated along the rotation direction, and the rotation is stopped when the maximum rotation angle is reached. During the rotation, the initial separation axis is extended in real time until it intersects with both the third and fourth circumscribed rectangles, thereby constructing a dynamic detection separation axis.

4. The method for merging the identification results of prohibited items in parcels according to claim 1, characterized in that, The initial count criterion is as follows: when the number of contraband items of the same type and in spatial contact in the first set is less than the preset contraband count threshold, it is determined that merging is not allowed; The cross ratio criterion is as follows: when the cross ratio of the intersection rectangles corresponding to the same type of prohibited items that are spatially adjacent in the first set is less than the preset cross ratio threshold, it is determined that merging is not allowed. The aspect ratio criterion is as follows: for two bounding rectangles corresponding to the same type of contraband and spatially adjacent contraband in the first set, based on the aspect ratio difference rate between the bounding rectangles and combined with the preset aspect ratio difference rate threshold, it is determined whether merging is allowed. The area criterion is as follows: for two circumscribed rectangles corresponding to the same type of contraband items that are spatially adjacent in the first set, the area difference rate between the circumscribed rectangles is used as a basis to determine whether merging is allowed.

5. The method for merging the results of package contraband identification according to claim 1 or 4, characterized in that, A color similarity check is performed based on the first and second color check results to determine whether merging is allowed; wherein: The target contraband is the contraband for which a decision on whether merging is permitted is made; the statistical range of historical experience values ​​is determined based on the contraband category corresponding to the target contraband. The historical experience value statistical range for non-target prohibited items includes: the historical experience value statistical range for the prohibited item categories corresponding to other prohibited items after excluding the prohibited item categories corresponding to the target prohibited items; and the statistical range for the background color calibration value of the security inspection machine image.

6. The method for merging the identification results of prohibited items in parcels according to claim 2, characterized in that, The determination of the maximum translation distance is as follows: The maximum translation distance is determined based on the aspect ratio difference rate between the first and second circumscribed rectangles and the area difference rate between the first and second circumscribed rectangles.

7. The method for merging the identification results of prohibited items in parcels according to claim 3, characterized in that, The determination of the maximum rotation angle is as follows: The maximum rotation angle is determined based on the aspect ratio difference rate between the third and fourth circumscribed rectangles and the area difference rate between the third and fourth circumscribed rectangles.

8. A device for merging the results of package contraband identification, employing the method for merging the results of package contraband identification as described in any one of claims 1 to 7, characterized in that, include: The fine screening object determination module is configured to: acquire the prohibited item identification results of the security inspection machine, screen out prohibited items of the same type and spatially adjacent to form a first set, and use preset preliminary screening criteria to screen the first set to obtain a second set; the preliminary screening criteria include initial number criteria, cross ratio criteria, intersection rectangle static criteria, aspect ratio criteria, and area criteria; wherein: the intersection rectangle static criteria specifically involves: performing similarity verification on the intersection rectangles corresponding to the prohibited items of the same type and spatially adjacent in the first set, and determining that prohibited items that fail the similarity verification are not allowed to be merged; the similarity verification is a dual color verification, specifically: performing dual color verification on the color histogram of the intersection rectangle or the color histogram of the detection separation axis, including performing a first color verification to obtain a first color verification result and performing a second color verification to obtain a second color verification result, the first color verification being a color similarity analysis performed on the historical experience value statistical interval of the target prohibited item, and the second color verification being a color similarity analysis performed on the historical experience value statistical interval of non-target prohibited items; The dynamic criterion execution module is configured to: select the bounding rectangles of two prohibited items in the second set to determine the intersection rectangle, construct an initial separation axis based on the intersection rectangle; translate and / or rotate the initial separation axis to generate a detection separation axis, and perform similarity verification on the detection separation axis, including dual color verification on the detection separation axis generated by translation and / or rotation; The prohibited items identification result merging module is configured to: determine prohibited items that pass the similarity check as allowed to be merged, and after traversing all prohibited items in the second set for verification, complete the output of the merged prohibited items identification results for the package.

9. A device for merging the results of package contraband identification, characterized in that, Includes at least one processor, at least one memory, and a data bus; The processor and the memory communicate with each other via the data bus; The memory stores program instructions that can be executed by the processor, which invokes the program instructions to execute the method for merging package contraband identification results as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for merging the identification results of contraband in packages as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Target frame detection optimization method based on millimeter wave radar, medium and electronic equipment

    CN121522642A

  • Automatic evaluation of three-dimensional vehicle perception using two-dimensional deep neural networks

    US20240046657A1