Security inspection image segmentation method, device, electronic device and computer readable medium

By identifying the blank gap or edge positions in the security inspection image for segmentation, the problem of incomplete luggage items in the prior art is solved, and intelligent segmentation of the security inspection image is achieved, which reduces uncertainty and improves business efficiency.

CN114255344BActive Publication Date: 2025-03-28NUCTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010953071.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-11
Publication Date
2025-03-28
Estimated Expiration
2040-09-11

AI Technical Summary

Technical Problem

In weak control security inspection business scenarios such as rail transit, logistics, and large-scale activities, the existing long image segmentation method fails to effectively consider the edges and boundaries of luggage items, resulting in incomplete luggage items received by the upper-level business system, increasing the difficulty of identifying suspects and inaccurate judgment conclusions, and thus increasing the probability of security loopholes and risks.

Method used

A security image segmentation method is proposed, which is divided by obtaining security image and identifying the position information of the blank gap. If it fails, the edge position is obtained through edge search to ensure that the segmented image contains complete object objects.

Benefits of technology

It realizes intelligent partitioning of ultra-long security images generated by security inspection packets, avoids incomplete object objects in the target image after segmentation, reduces the uncertainty of luggage items and suspects caused by long image segmentation, and improves the quality and efficiency of upper-level services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114255344B_ABST
    Figure CN114255344B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, electronic device and computer-readable medium for segmenting security inspection images. The method comprises: obtaining a security inspection image, wherein the security inspection image comprises at least one object; identifying the security inspection image to obtain the position information of the blank gap, segmenting the security inspection image according to the position information of the blank gap, and obtaining a target segmented image including the object; if the position information of the blank gap fails to be obtained, performing edge search on the security inspection image to obtain the edge position; segmenting the security inspection image according to the edge position, and determining the first segmented image including the object obtained by segmentation as the target segmented image. The method, device, electronic device and computer-readable medium for segmenting security inspection images involved in the present disclosure can realize intelligent segmentation of security inspection images, reduce the uncertainty of baggage items and suspicious objects caused by segmentation of long images, and improve the quality and efficiency of upper-level services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of image processing, and in particular to a security inspection image segmentation method, device, electronic device and computer-readable medium. Background Art

[0002] In weakly controlled security inspection business scenarios such as rail transit, logistics, and large-scale events, long images of continuous packages often appear in the scanned images. Due to reasons such as image size and business requirements, images exceeding a certain length will no longer be suitable as scanned perspective images corresponding to luggage items for business processing by the upper-level business system. At present, for such images, the continuous scanned images can be cut off in a timely manner according to a certain image width as the standard to form multiple independent images of appropriate length, and then the corresponding image data is transmitted to the upper-level business system. For example, the image corresponding to the image judgment task in the centralized image judgment system is the image of appropriate length after segmentation. However, the existing long image segmentation is segmented according to a certain image width and range, and the edges and boundaries of the actual luggage items are not considered, resulting in that most of the luggage items in the images received by the upper-level business system are incomplete. If there are suspected dangerous goods in the luggage items, the image is likely to contain only part of the dangerous goods. The emergence of such situations directly increases the difficulty of related suspicious object identification business and the inaccuracy of judgment conclusions, and increases the probability of security vulnerabilities and risks.

[0003] Therefore, a new security inspection image segmentation method, device, electronic device and computer-readable medium are needed.

[0004] The above information disclosed in this background section is only for enhancement of understanding of the background of the present disclosure and therefore it may include information that does not constitute the relevant technology that is already known to one of ordinary skill in the art. Summary of the invention

[0005] In view of this, the embodiments of the present disclosure provide a security inspection image segmentation method, device, electronic device and computer-readable medium, which can to a certain extent avoid the occurrence of security inspection misjudgment caused by the inability to segment images according to luggage positions in related technologies.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a security inspection image segmentation method is proposed, the method comprising: acquiring a security inspection image, the security inspection image comprising at least one object; identifying the security inspection image to obtain position information of blank gaps, and segmenting the security inspection image according to the position information of the blank gaps to obtain a target segmented image comprising the object; if obtaining the position information of the blank gaps fails, performing edge search on the security inspection image to obtain edge positions; segmenting the security inspection image according to the edge positions, and determining a first segmented image comprising the object obtained by segmentation as the target segmented image.

[0008] In an exemplary embodiment of the present disclosure, determining the first segmented image including the article object obtained by segmentation as the target segmented image includes: if segmentation of the security inspection image according to the edge position fails or the image width of the first segmented image is greater than a segmentation width threshold, determining a pixel ratio of black pixels in the first segmented image to total pixels of the first segmented image; determining the number of image erosions according to the pixel ratio; performing at least one image erosion on the first segmented image according to the number of image erosions to obtain an eroded image; determining a black pixel increment in each column of the first segmented image according to the eroded image and the first segmented image; determining the column where the black pixel increment is less than the increment threshold as a segmentation position; segmenting the first segmented image according to the segmentation position, and determining a second segmented image obtained by segmentation as the target segmented image.

[0009] In an exemplary embodiment of the present disclosure, determining the column where the black pixel increment is less than the increment threshold as the segmentation position includes: if the black pixel increment in each column in the first segmented image is greater than or equal to the increment threshold, performing image dilation processing on the first segmented image to obtain an expanded image; performing a dislocation analysis on the expanded image through a preset detection rectangle, and determining the line formed by the dislocation point obtained by the analysis as the segmentation position.

[0010] In an exemplary embodiment of the present disclosure, determining the second segmented image obtained by segmentation as the target segmented image includes: processing the second segmented image through a contour algorithm to obtain a contour boundary box of the object; and segmenting the second segmented image according to the contour boundary box to obtain a target segmented image.

[0011] In an exemplary embodiment of the present disclosure, obtaining the target segmented image includes: sorting the target segmented image according to the coordinate values ​​of the contour boundary box in the first segmented image; and sending the sorted target segmented image to an upper system.

[0012] In an exemplary embodiment of the present disclosure, the method further includes: eliminating the target segmentation images whose image width is smaller than a segmentation width threshold; and eliminating the target segmentation images whose image height is smaller than a segmentation height threshold.

[0013] In an exemplary embodiment of the present disclosure, the method further includes: receiving an image acquisition request from an upper-level system; acquiring image column data of the security inspection image; associating the image column data to the target segmented image according to the segmentation condition of the target segmented image; and in response to the image acquisition request, sending the target segmented image and the image column data associated with the target segmented image to the upper-level system.

[0014] In an exemplary embodiment of the present disclosure, identifying the security inspection image to obtain the position information of the blank gap includes: detecting and obtaining white pixels of the security inspection image; and determining the position information of the blank gap according to the positions of the white pixels.

[0015] According to one aspect of the present disclosure, a security inspection image segmentation device is provided, the device comprising: an image acquisition module, configured to acquire a security inspection image, the security inspection image comprising at least one object; a first segmentation module, configured to identify the security inspection image to obtain position information of a blank gap, so as to segment the security inspection image according to the position information of the blank gap, and obtain a target segmented image comprising the object; an edge search module, configured to perform edge search on the security inspection image to obtain an edge position if the position information of the blank gap fails to be obtained; and a second segmentation module, configured to segment the security inspection image according to the edge position, and determine the first segmented image comprising the object obtained by segmentation as the target segmented image.

[0016] According to one aspect of the present disclosure, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.

[0017] According to one aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0018] According to the security inspection image segmentation method, device, electronic device and computer-readable medium provided by some embodiments of the present disclosure, by identifying and obtaining blank gaps in the security inspection image, the security inspection image is segmented according to the blank gaps, so as to realize intelligent segmentation of the super-long security inspection image generated by the security inspection package. When the blank gap fails to be obtained, the security inspection image is segmented according to the edge position obtained by the edge search by performing edge search on the security inspection image, so as to avoid the existence of incomplete object in the target segmented image obtained by segmentation, realize intelligent segmentation of the security inspection image, reduce the uncertainty of baggage items and suspects caused by segmentation of long images, and improve the quality and efficiency of upper-level business.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail its exemplary embodiments with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present disclosure, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative work.

[0021] Figure 1 is a flow chart of a security inspection image segmentation method according to an exemplary embodiment;

[0022] Figure 2 is a flow chart of a security inspection image segmentation method according to an exemplary embodiment;

[0023] Figure 3 is a flow chart of a security inspection image segmentation method according to an exemplary embodiment;

[0024] Figure 4 is a flow chart of a security inspection image segmentation method according to an exemplary embodiment;

[0025] Figure 5 A schematic diagram schematically shows a security inspection image according to an embodiment of the present disclosure;

[0026] Figure 6 A schematic diagram schematically shows a security inspection image according to an embodiment of the present disclosure;

[0027] Figure 7 A schematic diagram schematically shows a security inspection image according to an embodiment of the present disclosure;

[0028] Figure 8 is based on Figure 7 Schematic diagram of the corrosion image obtained by the schematic diagram shown;

[0029] Fig. 9 A schematic diagram schematically shows a security inspection image according to an embodiment of the present disclosure;

[0030] Fig.10 A schematic diagram schematically shows a security inspection image according to an embodiment of the present disclosure;

[0031] Fig.11 A schematic diagram schematically shows an appropriately long image according to an embodiment of the present disclosure;

[0032] Fig. 12A , 12B A schematic diagram schematically shows an appropriately long image according to an embodiment of the present disclosure;

[0033] Fig.13 A schematic diagram of stitching of images of appropriate length according to an embodiment of the present disclosure is schematically shown;

[0034] Fig.14 is a block diagram of a security inspection image segmentation device according to an exemplary embodiment;

[0035] Fig.15 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0037] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

[0038] 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 may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0039] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0040] 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 component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the disclosed concepts. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0041] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present disclosure, and therefore cannot be used to limit the protection scope of the present disclosure.

[0042] In the security inspection image segmentation scenario in the related technology, in order to realize the intelligent segmentation of the security inspection image, a part of the previous segmented image is superimposed on the next image. If there is an object that is difficult to identify at the edge of the previous image, the probability that the next image can contain more complete information about the object is greatly increased, and the processing of the object will be postponed to the next image. However, this solution still cannot guarantee the integrity and consistency of the information of the luggage items in the image, and the processing of the items in the second half of the image is likely to be delayed, for example Figure 6 , Figure 7 , Fig. 9 As shown, the situations where the gap between objects is too small (between 610 and 620), the objects are non-contact staggeredly connected (between 710 and 720), and there is slight adhesion between objects (between 910 and 920) are described respectively. When the images of the above situations are segmented in the related art, the effect is not satisfactory.

[0043] Currently, there is no technical solution to address the above-mentioned defects.

[0044] In view of the defects in the related art, the present application proposes a security inspection image segmentation method, device, electronic device and computer-readable medium.

[0045] Figure 11 is a flowchart of a security inspection image segmentation method according to an exemplary embodiment. The security inspection image segmentation method provided in the embodiment of the present disclosure can be executed by any electronic device with computing and processing capabilities, such as a user terminal and / or a server. In the following embodiments, the method is illustrated by taking the server executing the method as an example, but the present disclosure is not limited to this. The security inspection image segmentation method provided in the embodiment of the present disclosure may include steps S102 to S108.

[0046] like Figure 1 As shown, in step S102, a security inspection image is acquired, and the security inspection image includes at least one object.

[0047] In the disclosed embodiment, the security inspection image may be generated by real-time detection of the security inspection equipment, for example. The object may be a luggage item.

[0048] In step S104, the security inspection image is identified to obtain the position information of the blank gaps, and the security inspection image is segmented according to the position information of the blank gaps to obtain a target segmented image including the object.

[0049] In the embodiment of the present disclosure, the blank gap can be obtained by, for example, switching on and off the light eye and delaying. When scanning the object, the position of the object is scanned as black pixels, and the air is scanned as white pixels.

[0050] In an exemplary embodiment, white pixels of the security inspection image may be detected; and the position information of the blank gaps may be determined according to the positions of the white pixels. Adjacent white pixels may be determined according to the positional relationship between the white pixels, so as to determine the position information of the blank gaps according to the adjacent white pixels. Among them, a target segmentation image of the object may also be generated by judging the object (black pixels) and the white pixels, so as to avoid a large number of blank areas in the image. Figure 5 The schematic diagram of the security inspection image according to the embodiment of the present disclosure is schematically shown. Figure 5 As shown, in the security inspection image, there is a blank gap between the object 510 and the object 520. The security inspection image can be segmented according to the position information of the blank gap to obtain a target segmented image including the object 510 and a target segmented image including the object 520.

[0051] In step S106, if the position information of the blank gap fails to be obtained, edge search is performed on the security inspection image to obtain the edge position.

[0052] In the disclosed embodiment, edge search is one of the image processing methods, which is used to extract the edge of an object in an image. For example, it can be performed by the leftmost search, that is, first find an edge point of the object, then search its 8 neighboring points in a clockwise direction to obtain the next edge point, and continue searching in this way to obtain a closed point sequence, that is, the edge of the object. In the process of searching, it is also necessary to determine whether a point of foreground color is an edge point or an inner point of the object, which can be achieved by analyzing the characteristics of the edge point.

[0053] In an exemplary embodiment, the security inspection image may be subjected to image pre-processing such as cropping and blurring, and then edge search may be performed on the pre-processed security inspection image.

[0054] In step S108, the security inspection image is segmented according to the edge position, and a first segmented image including the object obtained by segmentation is determined as a target segmented image.

[0055] In the embodiment of the present disclosure, an attempt may be made to segment the security inspection image according to the edge position, and the security inspection image in which the gaps between the objects are too small may be segmented. Figure 6 The schematic diagram of the security inspection image according to the embodiment of the present disclosure is schematically shown. Figure 6 As shown, the gap between the article object 610 and the article object 620 is too small. By partitioning the security inspection image by edge position, a dividing line 630 can be determined, so that the security inspection image is divided according to the dividing line 630 to obtain a first divided image including the article object 610 and the article object 620, that is, a target divided image.

[0056] According to the security inspection image segmentation method provided by the embodiment of the present disclosure, by identifying the blank gaps in the security inspection image, the security inspection image is segmented according to the blank gaps, so as to realize the intelligent segmentation of the super-long security inspection image generated by the security inspection package. When the blank gaps fail to be obtained, the security inspection image is segmented according to the edge position obtained by the edge search by edge search, so as to avoid the existence of incomplete object in the target segmented image obtained by segmentation, realize the intelligent segmentation of the security inspection image, reduce the uncertainty of baggage items and suspects caused by the segmentation of long images, and improve the quality and efficiency of upper-level business.

[0057] In an exemplary embodiment, target segmented images whose image width is less than a segmentation width threshold may be eliminated; and target segmented images whose image height is less than a segmentation height threshold may be eliminated. Since dirty images usually include very small noise points or thin lines, this embodiment can eliminate the noise points or thin lines.

[0058] It should be clearly understood that the present disclosure describes how to form and use specific examples, but the principles of the present disclosure are not limited to any details of these examples. On the contrary, based on the teachings of the contents disclosed in the present disclosure, these principles can be applied to many other embodiments.

[0059] Figure 2 The present invention is a flowchart of a security inspection image segmentation method according to an exemplary embodiment.

[0060] like Figure 2 As shown, in the embodiment of the present invention, the above step S108 may further include the following steps.

[0061] In step S202, if segmenting the security inspection image according to the edge position fails or the image width of the first segmented image is greater than the segmentation width threshold, a pixel ratio of black pixels in the first segmented image to total pixels of the first segmented image is determined.

[0062] In the disclosed embodiment, when there are intersections between the edge positions of different object objects, segmentation of the security inspection image according to the edge positions may fail.

[0063] In step S204, the number of image erosion times is determined according to the pixel ratio.

[0064] In the disclosed embodiment, the pixel ratio and the number of image erosion times may be in inverse proportion. When the pixel ratio is smaller, the number of image erosion times is greater.

[0065] In step S206, the first segmented image is eroded at least once according to the number of image erosion times to obtain an eroded image.

[0066] In the disclosed embodiment, when the number of image erosions is n, the first segmented image may be subjected to n image erosion operations, where n is an integer greater than 0. Image erosion is a basic morphological operation, which is mainly used to find extremely small areas. Image erosion is similar to "area erosion", which reduces and refines the highlight area or white part in the image, and the result image is smaller than the highlight area of ​​the original image.

[0067] In step S208, the black pixel increment of each column in the first segmented image is determined according to the eroded image and the first segmented image.

[0068] In the disclosed embodiment, the amount of black pixels in each column of the eroded image and the amount of black pixels in each column of the first segmented image may be subtracted to obtain the increment of black pixels in each column of the first segmented image. For example, if the amount of black pixels in a column of the eroded image is a, and the amount of black pixels in each column of the first segmented image is b, then the increment of black pixels in the column of the first segmented image is ab.

[0069] In step S210 , a column where the black pixel increment is less than the increment threshold is determined as a segmentation position.

[0070] In the disclosed embodiment, the increment threshold may be obtained based on experimental data.

[0071] Figure 7 A schematic diagram of a security inspection image according to an embodiment of the present disclosure is schematically shown. Figure 8 is based on Figure 7 Schematic diagram of the corrosion image obtained as shown in the schematic diagram. Figure 7 In the security inspection image shown, the positional relationship between the object 710 and the object 720 is a non-contact staggered connection. Figure 8 The medium gray-black mask area represents the black pixel increment after erosion, from Figure 8 It can be seen that the black pixel increment in the area between the object 710 and the object 720 is the smallest. When the black pixel increment in the area is less than the increment threshold, it can be determined as the segmentation position.

[0072] In step S212, the first segmented image is segmented according to the segmentation position, and a second segmented image obtained by segmentation is determined as a target segmented image.

[0073] In this embodiment, it is determined whether the security inspection image has luggage dislocation according to the pixel ratio of black pixels, and then the number of image corrosion times is determined according to the degree of luggage dislocation, and the corrosion image and black pixel increment are obtained in sequence. When there is a column in the first segmented image where the black pixel increment is less than the increment threshold, it means that the column is likely to be the location of air, and then it is determined that the column is not the column where the luggage is located, and it can be used as a segmentation position for segmentation, realizing intelligent detection of case images, determining the segmentation position according to the detection results, realizing intelligent segmentation of images, reducing the uncertainty of luggage and suspects caused by long image segmentation, ensuring that each target segmented image (the second segmented image in this embodiment) contains only one object, and improving the quality and efficiency of upper-level services.

[0074] Figure 3 The present invention is a flowchart of a security inspection image segmentation method according to an exemplary embodiment.

[0075] like Figure 3 As shown, in the embodiment of the present invention, the above step S210 may further include the following steps.

[0076] In step S302, if the increment of black pixels in each column of the first segmented image is greater than or equal to the increment threshold, image dilation processing is performed on the first segmented image to obtain a dilated image.

[0077] In the disclosed embodiment, image dilation is a basic morphological operation, which is mainly used to find the maximum area in the image. Image dilation is similar to "domain expansion", which expands the highlight area or white part in the image, and the result image is larger than the highlight area of ​​the original image.

[0078] In step S304, the expansion image is subjected to a misalignment analysis using a preset detection rectangle, and the lines formed by the misalignment points obtained by the analysis are determined as segmentation positions.

[0079] In the disclosed embodiment, pixel incremental misalignment analysis can be performed by using a preset detection rectangle, that is, starting from the position of the specified pixel in the image, the detection rectangle is moved to continuously obtain misalignment points, and a connecting line or a connecting area is formed by the misalignment points. The misalignment analysis is used to detect whether the position of the specified pixel in the image meets the conditions for forming a misalignment point, and the condition for forming a misalignment point is that the position of the pixel is a highlight area, not a black pixel. Generally, the starting position of the misalignment analysis is the highlight position of the column with the smallest increment value in the black pixel increment (greater than or equal to the increment threshold) in step S302.

[0080] In this embodiment, by performing image dilation processing on the first segmented image, the obtained dilated image contains more highlighted pixel areas, which makes it easier to determine the misalignment points between the objects during misalignment analysis, and then determine the segmentation position according to the misalignment points.

[0081] Figure 4 The present invention is a flowchart of a security inspection image segmentation method according to an exemplary embodiment.

[0082] like Figure 4 As shown, in the embodiment of the present invention, the above step S212 may include the following steps.

[0083] In step S402, the second segmented image is processed by a contour algorithm to obtain a contour boundary box of the object.

[0084] In the embodiment of the present disclosure, the contour algorithm is used to detect the edge contours of valid pixels in the image. In this embodiment, the second segmented image is a rough segmentation of the misplaced objects in the security inspection image. The contour boundary points of each object are obtained by detection, which helps to further accurately segment the image according to the distribution of the object.

[0085] In step S404, the second segmented image is segmented according to the contour boundary box to obtain a target segmented image.

[0086] In the disclosed embodiment, the second segmented image can be further segmented according to the contour boundary box to obtain the target segmented image. Based on the segmentation segmentation line (i.e., segmentation position) applied when segmenting the first segmented image, it can help the contour algorithm to find the edge contour of the object.

[0087] In this embodiment, since the second segmented image is usually obtained by bevel segmentation and cannot form a complete rectangular image, the contour boundary box of the object can be obtained by the contour algorithm. When the second segmented image is segmented according to the contour boundary box, the second segmented image can be segmented according to the minimum positive circumscribed rectangle of the contour boundary box to obtain the target segmented image, so that the target segmented image is a complete rectangular image. When segmenting according to the minimum positive circumscribed rectangle of the contour boundary box, the area between the beveled surface (i.e., the segmentation position) and the minimum circumscribed rectangle of the contour boundary box can be filled with white air pixels, and unnecessary blank areas in the second segmented image can be removed. The contour algorithm is executed based on the second segmented image, and the second segmented image is segmented according to the obtained contour boundary box. Since each second segmented image contains only one object, other irrelevant object objects that do not need to be calculated can be excluded, avoiding interference of other irrelevant object objects on the contour algorithm, reducing the execution difficulty of the contour algorithm, and making each obtained target segmented image only include pixel data of one object. In this embodiment, when the second segmented image is segmented according to the contour boundary box, blank pixels (i.e., air pixels) can be used to supplement the pixel-free portion caused by the oblique segmentation, and unnecessary blank areas can be removed. The unnecessary blank areas can be, for example, Figure 7 The blank area below the item object 710 on the left side of the middle dividing line.

[0088] In an exemplary embodiment, in step S404, the target segmented images may be sorted according to the coordinate values ​​of the contour boundary boxes in the first segmented image; and the sorted target segmented images may be sent to an upper system.

[0089] Figure 4 The present invention is a flowchart of a security inspection image segmentation method according to an exemplary embodiment.

[0090] like Figure 4 As shown, in an embodiment of the present invention, the security inspection image segmentation method based on the above embodiment may further include the following steps.

[0091] In step S402, an image acquisition request from an upper-layer system is received.

[0092] In step S404, image column data of the security inspection image is acquired.

[0093] In step S406 , the image column data is associated with the target segmented image according to the segmentation condition of the target segmented image.

[0094] In step S408, in response to the image acquisition request, the target segmented image and the image column data associated with the target segmented image are sent to the upper system.

[0095] In this embodiment, when encountering a non-contact staggered connection scene, a bounding rectangle is generated based on the contour boundary box obtained by the contour algorithm, and the blank area between the contour boundary box and the bounding rectangle is filled with white pixels (i.e., air) to generate a complete image. The overlapping image column parts during the segmentation process will also be included in the two target segmented images after segmentation for image column transmission. However, the difference is that the object pixels belonging to the first target segmented image will not appear in the second target segmented image, but will be filled with air, and vice versa. Fig.10 The schematic diagram of the security inspection image according to the embodiment of the present disclosure is schematically shown. Fig.10 As shown, the area within the dotted frame 1010 is the overlapping portion, and the solid polygonal frames 1020 and 1030 correspond to the pixels of the object retained in the segmented image.

[0096] In an exemplary embodiment, when there is no gap or space in the security inspection image for the system to perform the segmentation operation (such as the above Figure 1 , Figure 2 , Figure 3 , Figure 4 When the segmentation process in the embodiment shown fails, the security inspection image can be segmented forcibly to form an image of appropriate length. An image of appropriate length is an image whose image width is less than or equal to the image width threshold and whose image height is less than or equal to the image height threshold. Fig.11 , Fig. 12B When the upper-level business system needs it, the forcibly cut luggage can be spliced ​​and restored, as shown in Fig.13 For example, Fig.11 is the first image of appropriate length after the security inspection image of the continuous bag is forcibly segmented, and Fig. 12A For the subsequent scanned image data after segmentation, Fig. 12A The second half (left side) of the text has a normal blank space, which can be divided into Fig. 12B . Fig.11 and Fig. 12B All of them are short images, and can be regarded as images of appropriate length when stitched together. Therefore, the stitching requirement is also logical, and what will be presented to the upper-level business system will be images with more complete luggage items.

[0097] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided by the present disclosure are performed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0098] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0099] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0100] Fig.14 The security inspection image segmentation device 1400 provided in the embodiment of the present disclosure may include: an image acquisition module 1402 , a first segmentation module 1404 , an edge search module 1406 and a second segmentation module 1408 .

[0101] The image acquisition module 1402 may be configured to acquire a security inspection image, where the security inspection image includes at least one object.

[0102] The first segmentation module 1404 may be configured to identify the security inspection image to obtain the position information of the blank gaps, so as to segment the security inspection image according to the position information of the blank gaps to obtain a target segmented image including the object.

[0103] The edge search module 1406 may be configured to perform edge search on the security inspection image to obtain the edge position if the acquisition of the position information of the blank gap fails.

[0104] The second segmentation module 1408 may be configured to segment the security inspection image according to edge positions, and determine the first segmented image including the object obtained by segmentation as the target segmented image.

[0105] According to the security inspection image segmentation device provided by the embodiment of the present disclosure, by identifying the blank gaps in the security inspection image, the security inspection image is segmented according to the blank gaps, so as to realize the intelligent segmentation of the super-long security inspection image generated by the security inspection continuous bag. When the blank gaps fail to be obtained, the security inspection image is segmented according to the edge position obtained by the edge search by edge search, so as to avoid the existence of incomplete object in the target segmented image obtained by segmentation, realize the intelligent segmentation of the security inspection image, reduce the uncertainty of baggage items and suspects caused by the segmentation of long images, and improve the quality and efficiency of upper-level business.

[0106] In an exemplary embodiment, the second segmentation module 1408 may include a pixel ratio submodule, an erosion times submodule, an image erosion submodule, a pixel increment submodule, a segmentation position submodule, and a second segmentation submodule. The pixel ratio submodule may be configured to determine the pixel ratio of black pixels in the first segmentation image to the total pixels of the first segmentation image if segmentation of the security inspection image according to the edge position fails or the image width of the first segmentation image is greater than the segmentation width threshold. The erosion times submodule may be configured to determine the image erosion times according to the pixel ratio. The image erosion submodule may be configured to perform at least one image erosion on the first segmentation image according to the image erosion times to obtain an eroded image. The pixel increment submodule may be configured to determine the black pixel increment of each column in the first segmentation image according to the erosion image and the first segmentation image. The segmentation position submodule may be configured to determine the column with a black pixel increment less than the increment threshold as the segmentation position. The second segmentation submodule may be configured to segment the first segmentation image according to the segmentation position, and determine the second segmentation image obtained by segmentation as the target segmentation image.

[0107] In an exemplary embodiment, the segmentation position submodule may include an image expansion unit and a misalignment analysis unit. The image expansion unit may be configured to perform image expansion processing on the first segmented image to obtain an expanded image if the increment of black pixels in each column in the first segmented image is greater than or equal to the increment threshold. The misalignment analysis unit may be configured to perform misalignment analysis on the expanded image through a preset detection rectangle, and determine the line formed by the misalignment points obtained by the analysis as the segmentation position.

[0108] In an exemplary embodiment, the second segmentation submodule may include a contour acquisition unit and a third segmentation unit. The contour acquisition unit may be configured to process the second segmentation image through a contour algorithm to obtain a contour boundary box of the object. The third segmentation unit may be configured to segment the second segmentation image according to the contour boundary box to obtain a target segmentation image.

[0109] In an exemplary embodiment, the third segmentation unit may include an image sorting subunit and an image sending unit. The image sorting subunit may be configured to sort the target segmented images according to the coordinate values ​​of the contour boundary box in the first segmented image. The image sending unit may be configured to send the sorted target segmented images to the upper system.

[0110] In an exemplary embodiment, the security inspection image segmentation device 140 may further include an image rejection module configured to reject target segmentation images whose image width is smaller than a segmentation width threshold; and to reject target segmentation images whose image height is smaller than a segmentation height threshold.

[0111] In an exemplary embodiment, the security inspection image segmentation device 140 may further include a request acquisition module, a column data module, an image association module, and a request response module. The request acquisition module may be configured to receive an image acquisition request from an upper system. The column data module may be configured to acquire image column data of the security inspection image. The image association module may be configured to associate the image column data with the target segmented image according to the segmentation condition of the target segmented image. The request response module may be configured to send the target segmented image and the image column data associated with the target segmented image to the upper system in response to the image acquisition request.

[0112] In an exemplary embodiment, the first segmentation module 1404 may include a white pixel unit and a gap determination unit. The white pixel unit may be configured to detect white pixels of the security inspection image. The gap determination unit may be configured to determine the position information of the blank gap according to the position of the white pixel.

[0113] Fig.15 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Fig.15 The electronic device 1500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0114] like Fig.15 As shown, electronic device 1500 includes a central processing unit (CPU) 1501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1502 or a program loaded from a storage part 1508 into a random access memory (RAM) 1503. In RAM 1503, various programs and data required for system operation are also stored. CPU 1501, ROM 1502 and RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to bus 1504.

[0115] The following components are connected to the I / O interface 1505: an input section 1506 including a keyboard, a mouse, etc.; an output section 1507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN card, a modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as needed. A removable medium 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1510 as needed, so that a computer program read therefrom is installed into the storage section 1508 as needed.

[0116] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1509, and / or installed from a removable medium 1511. When the computer program is executed by a central processing unit (CPU) 1501, various functions defined in the system of the present application are executed.

[0117] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with at least one wire, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0118] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the above-mentioned module, program segment or a part of the code contains at least one executable instruction for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0119] The modules and / or submodules and / or units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the modules and / or submodules and / or units described may also be set in a processor. The names of these modules and / or submodules and / or units do not, in some cases, constitute limitations on the modules themselves.

[0120] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being installed in the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment. For example, the electronic device may implement the following method. Figure 1 or Figure 2 or Figure 3 or Figure 4 The steps shown.

[0121] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules and / or submodules and / or units described above can be concretized in one module. Conversely, the features and functions of one module and / or submodule and / or unit described above can be further divided into being concretized by multiple modules and / or submodules and / or units.

[0122] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0123] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0124] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A security inspection image segmentation method, characterized in that: include: Acquire a security inspection image, wherein the security inspection image includes at least one object; Recognize the security inspection image to obtain position information of blank gaps, and segment the security inspection image according to the position information of the blank gaps to obtain a target segmented image including the object; If the position information of the blank gap fails to be obtained, edge search is performed on the security inspection image to obtain the edge position; The security inspection image is segmented according to the edge position, and a first segmented image including the article object obtained by segmentation is determined as the target segmented image, which includes: If segmenting the security inspection image according to the edge position fails or the image width of the first segmented image is greater than the segmentation width threshold, determining a pixel ratio of black pixels in the first segmented image to total pixels of the first segmented image; Determining the number of image erosion times according to the pixel ratio; When the number of image erosions is n, performing n times of image erosion on the first segmented image to obtain an eroded image, where n is an integer greater than 0; Determine a black pixel increment of each column in the first segmented image according to the eroded image and the first segmented image; Determine the column where the black pixel increment is less than the increment threshold as a segmentation position; The first segmented image is segmented according to the segmentation position, and a second segmented image obtained by segmentation is determined as the target segmented image.

2. The method according to claim 1, characterized in that Determining the column where the black pixel increment is less than the increment threshold as the segmentation position comprises: If the black pixel increment in each column of the first segmented image is greater than or equal to the increment threshold, performing image dilation processing on the first segmented image to obtain a dilated image; The expansion image is subjected to a dislocation analysis through a preset detection rectangle, and a line formed by the dislocation points obtained through the analysis is determined as a segmentation position.

3. The method according to claim 1 or 2, characterized in that Determining the second segmented image obtained by segmentation as the target segmented image comprises: Processing the second segmented image by a contour algorithm to obtain a contour boundary box of the object; The second segmented image is segmented according to the contour boundary box to obtain a target segmented image.

4. The method according to claim 3, characterized in that Obtaining the target segmentation image includes: sorting the target segmented images according to the coordinate values ​​of the contour boundary boxes in the first segmented images; The sorted target segmented image is sent to the upper system.

5. The method according to claim 1, characterized in that Also includes: Eliminate the target segmented images whose image width is smaller than the segmentation width threshold; The target segmented images whose image height is less than the segmentation height threshold are eliminated.

6. The method according to claim 1, characterized in that Also includes: Receive image acquisition request from upper system; Acquire image column data of the security inspection image; Associating the image column data with the target segmented image according to the segmentation condition of the target segmented image; In response to the image acquisition request, the target segmented image and the image column data associated with the target segmented image are sent to the upper system.

7. The method according to claim 1, characterized in that: Recognizing the security inspection image to obtain the position information of the blank gap includes: Detecting and obtaining white pixels of the security inspection image; The position information of the blank gap is determined according to the position of the white pixel.

8. A security inspection image segmentation device, characterized in that: include: An image acquisition module, configured to acquire a security inspection image, wherein the security inspection image includes at least one object; A first segmentation module is configured to identify the security inspection image to obtain position information of blank gaps, and segment the security inspection image according to the position information of the blank gaps to obtain a target segmented image including the object; an edge search module, configured to perform edge search on the security inspection image to obtain edge positions if the position information of the blank gap fails to be obtained; The second segmentation module is configured to segment the security inspection image according to the edge position, and determine the first segmented image including the article object obtained by segmentation as the target segmented image, which includes: if the segmentation of the security inspection image according to the edge position fails or the image width of the first segmented image is greater than the segmentation width threshold, then determine the pixel ratio of black pixels in the first segmented image to the total pixels of the first segmented image; determine the number of image erosions according to the pixel ratio; when the number of image erosions is n, perform n image erosions on the first segmented image to obtain an eroded image, where n is an integer greater than 0; determine the black pixel increment of each column in the first segmented image according to the eroded image and the first segmented image; determine the column where the black pixel increment is less than the increment threshold as the segmentation position; segment the first segmented image according to the segmentation position, and determine the second segmented image obtained by segmentation as the target segmented image.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • A package image segmentation method for security inspection and a corresponding security inspection device

    CN109410226A

  • Security inspection intelligent auxiliary image judgment method and system and system control method

    CN109977877A