A method and system for inserting dangerous goods images for security inspection CT
By acquiring the tomographic images in the three-dimensional image of the security CT, extracting the two-dimensional and three-dimensional contours of the object, and determining the insertion position of the dangerous goods image, the problem of intricate contour acquisition and time-consuming determination of the insertion position in the prior art is solved, and the accuracy and real-timeness of the insertion are improved.
Patent Information
- Application Number
- CN202111220507.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2041-10-20
AI Technical Summary
The existing methods of hazardous material image insertion cannot obtain continuous and fine object profiles, have low accuracy, and are too time-consuming to determine the location of hazardous material image insertion, and have poor real-time performance.
By obtaining each tomographic image in the three-dimensional image of the security CT, the two-dimensional outline of the object in the three-dimensional image of the security CT is obtained, and the three-dimensional outline of the object in the three-dimensional image of the security CT is obtained, the insertion position of the hazardous material image is determined, and the dangerous material image insertion of the security CT is realized.
It realizes rapid and accurate acquisition of object contours in the three-dimensional security CT image, improving the accuracy and real-time nature of hazardous material image insertion.
Smart Images

Figure CN113935975B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of security inspection CT, and in particular to a method and system for inserting dangerous goods images for security inspection CT. Background Art
[0002] In the field of security inspection, X-ray computed tomography (CT) imaging technology reconstructs the scanned data of the object to obtain a three-dimensional image of the scanned object. Based on the generated image, the security inspector determines whether there are dangerous goods in the scanned object, thereby realizing the identification of dangerous goods in the scanned object. In actual situations, the proportion of inspected objects that actually carry dangerous goods is very small. In order to maintain the security inspector's ability to detect and pay attention to dangerous goods, the use of dangerous goods insertion technology (TIP, Threat Image Projection) in the image of the inspected baggage randomly inserts virtual dangerous goods images into the image of the scanned object. This is a widely used method in CT security inspection systems.
[0003] In order to ensure the realistic insertion effect of the dangerous goods image, it is necessary to ensure that the dangerous goods image cannot be inserted outside the baggage area or in the high-density position inside, that is, the high grayscale area in the image. In other words, TIP needs to solve two key problems: obtaining the outline of the object in the scanned image and finding a suitable insertion position. Due to the complexity of the items contained in the security inspection object, the object outline is often affected by metal artifacts, etc., making it difficult to directly obtain a continuous and fine outer contour. In addition, the process of finding a suitable insertion position requires operation in three-dimensional space, which is very time-consuming.
[0004] Therefore, the current method for inserting dangerous goods images cannot obtain continuous and fine object contours, has low accuracy, is too time-consuming in determining the insertion position of the dangerous goods image, and has poor real-time performance. Summary of the invention
[0005] In view of the above analysis, an embodiment of the present invention aims to provide a method and system for inserting dangerous goods images for security inspection CT, so as to solve the problems that the existing dangerous goods image insertion method cannot obtain continuous and fine object contours, has low accuracy, is too time-consuming in determining the insertion position of the dangerous goods image, and has poor real-time performance.
[0006] On the one hand, an embodiment of the present invention provides a method for inserting a dangerous goods image for a security inspection CT, comprising the following steps:
[0007] When receiving the dangerous goods image insertion signal, obtain the security inspection CT three-dimensional image of the preset range;
[0008] Based on each tomographic image in the security inspection CT three-dimensional image, a two-dimensional contour of an object in each tomographic image is obtained, and then a three-dimensional contour of the object in the security inspection CT three-dimensional image is obtained;
[0009] Determining an insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image, and the dangerous goods image;
[0010] Based on the insertion position of the dangerous goods image, the insertion of the dangerous goods image of the security inspection CT is achieved.
[0011] Furthermore, obtaining the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image includes:
[0012] S21, binarizing the tomographic image based on a first threshold value to obtain a first processed image;
[0013] S22, setting the data corresponding to the object region whose area in the first processed image is smaller than the area threshold to 0, to obtain a second processed image;
[0014] S23, extracting the circumscribed convex polygon containing all object regions in the second processed image to obtain a current third processed image;
[0015] S24, performing edge extraction on the current third processed image to obtain a first edge image;
[0016] S25, updating the third processed image based on the first edge image and the second processed image;
[0017] S26, acquiring a second edge image based on the updated third processed image;
[0018] S27, taking the updated third processed image as the current third processed image, and repeatedly executing steps S24 to S26 until the first edge image or the second edge image satisfies the edge constraint condition, and taking the edge in the second edge image as the two-dimensional contour of the object.
[0019] Further, in step S24, the edge extraction is performed on the current third processed image to obtain the first edge image, specifically: the third processed image is filtered, and then binarized based on a fourth threshold to obtain a fifth processed image, and the intersection of the fifth processed image and the current third processed image is used as the first edge image.
[0020] Further, in step S25, the third processed image is updated based on the first edge image and the second processed image, specifically:
[0021] inverting the data in the second processed image to obtain a fourth processed image;
[0022] Acquire a first data position where corresponding position data in the first edge image and the fourth processed image are both 1;
[0023] The data at the position corresponding to the first data position in the current third processed image is set to 0 to obtain an updated third processed image.
[0024] Further, in step S26, based on the updated third processed image, a second edge image is obtained, specifically:
[0025] Searching row by row and column by column in the updated third processed image for a second data position where the data is 1 at the leftmost and rightmost ends of each row and at the top and bottom of each column;
[0026] The data at the second data position in the updated third processed image is set to 1, and the data at other positions are set to 0, so as to obtain a second edge image.
[0027] Further, in step S27, the updated third processed image is used as the current third processed image, and steps S24 to S26 are repeatedly performed until the first edge image and the second edge image meet the edge constraint condition, and the edge in the second edge image is used as the two-dimensional contour of the object, specifically:
[0028] Set the data in the edge of the first edge image and the data in the edge of the second edge image to 1 to obtain a first intermediate image and a second intermediate image;
[0029] Subtract the second intermediate image from the first intermediate image to obtain a third intermediate image, and then obtain the number of data with data being 1 in the third intermediate image;
[0030] If the number of data is less than the set difference threshold, the edge in the second edge image is used as the two-dimensional contour of the object;
[0031] Otherwise, the updated third processed image is used as the current third processed image, and steps S24 to S26 are performed again.
[0032] Furthermore, the obtaining of the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image also includes:
[0033] By calculating the distance between two data with fixed intervals on the two-dimensional contour and the curve length, the data on the two-dimensional contour is judged to be abnormal and updated, so as to achieve the optimization of the two-dimensional contour.
[0034] Further, the step of determining the insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image comprises the following steps:
[0035] After downsampling the image of the hazardous goods to be inserted, binarization processing is performed based on a second threshold to obtain a first hazardous goods image;
[0036] After downsampling the acquired security inspection CT three-dimensional image, a debinarization process is performed based on a second threshold value to obtain a first three-dimensional image;
[0037] The data inside the contour of the obtained three-dimensional contour of the object is set to 1, and the data outside the contour is set to 0, so as to obtain a first binary image;
[0038] After downsampling the first binary image, binarization processing is performed based on a third threshold value to obtain a second binary image;
[0039] multiplying the second binarized image by the first three-dimensional image to obtain a second three-dimensional image;
[0040] Using the first dangerous goods image as a sliding window to traverse the second three-dimensional image, obtaining an insertion position of the dangerous goods image in the acquired security inspection CT three-dimensional image;
[0041] Wherein, downsampling is performed according to a set downsampling multiple.
[0042] Furthermore, the first dangerous goods image is used as a sliding window to traverse the second three-dimensional image to obtain the insertion position of the dangerous goods image in the acquired security inspection CT three-dimensional image, specifically:
[0043] The first dangerous goods image sequentially traverses the second three-dimensional image in a set traversal order:
[0044] If the number of inconsistent data in the data within the current overlapping area between the first dangerous goods image and the second three-dimensional image is less than the set number threshold, the position is determined to be the insertion position of the dangerous goods image in the second three-dimensional image, and the traversal ends;
[0045] If the insertion position of the dangerous goods image in the second three-dimensional image is obtained, the corresponding insertion position in the acquired security inspection CT three-dimensional image is obtained based on the downsampling multiple; otherwise, it is determined that the insertion of the dangerous goods image fails.
[0046] On the other hand, an embodiment of the present invention provides a dangerous goods image insertion system for security inspection CT, comprising:
[0047] A data acquisition module, used to obtain a security inspection CT three-dimensional image of a preset range upon receiving a dangerous goods image insertion signal;
[0048] An object three-dimensional contour acquisition module, used to obtain the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image, and then obtain the three-dimensional contour of the object in the security inspection CT three-dimensional image;
[0049] A dangerous goods image insertion position determination module, used to determine the insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image;
[0050] The dangerous goods image insertion module is used to insert the dangerous goods image of the security inspection CT based on the insertion position of the dangerous goods image.
[0051] Compared with the prior art, the present invention can achieve the following beneficial effects:
[0052] The present invention provides a method and system for inserting dangerous goods images for security inspection CT.
[0053] By acquiring each tomographic image in the security inspection CT three-dimensional image, the two-dimensional contour of the object in each tomographic image is obtained, and then the three-dimensional contour of the object in the security inspection CT three-dimensional image is obtained, so that the contour of the object in the security inspection CT three-dimensional image can be quickly and accurately obtained, ensuring that subsequent dangerous goods can be inserted into the area containing the object, improving the accuracy of dangerous goods image insertion, and then determining the insertion position of the dangerous goods image according to the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image, realizing the insertion of the dangerous goods image of the security inspection CT, and being able to quickly determine the insertion position of the dangerous goods image, thereby improving the real-time performance of the dangerous goods image insertion.
[0054] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0056] Figure 1 A schematic diagram of a flow chart of a method for inserting dangerous goods images into a security inspection CT provided by an embodiment of the present invention;
[0057] Figure 2 A schematic diagram of the structure of a dangerous goods image insertion system for security inspection CT provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0059] Example 1
[0060] A specific embodiment of the present invention discloses a method for inserting dangerous goods images for security inspection CT, such as Figure 1 As shown, the following steps are included:
[0061] S1. When a dangerous goods image insertion signal is received, a security inspection CT three-dimensional image of a preset range is obtained.
[0062] Specifically, when an object passes through the security inspection channel, a CT scan is started, and CT reconstruction is performed on the acquired scanning data. A software system is provided in the security inspection CT equipment. During the security inspection CT scanning process, the software system receives a dangerous goods image insertion signal, and then obtains a security inspection CT three-dimensional image of a preset range, wherein the preset range can be set according to actual needs, so that the security inspection CT can process the acquired partial image data during the scanning process, thereby speeding up the subsequent determination of the contour and insertion position by the security inspection CT.
[0063] S2. Based on each tomographic image in the security inspection CT three-dimensional image, obtain the two-dimensional contour of the object in each tomographic image, and then obtain the three-dimensional contour of the object in the security inspection CT three-dimensional image.
[0064] S3. Determine an insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image.
[0065] S4. Inserting the dangerous goods image of the security inspection CT is performed based on the insertion position of the dangerous goods image.
[0066] Specifically, after the insertion of the dangerous goods image is completed according to the determined insertion position, the three-dimensional image result of the inserted dangerous goods image is 3D rendered, so that the dangerous goods image is better integrated into the three-dimensional image, thereby improving the authenticity of the dangerous goods image.
[0067] Compared with the prior art, the method for inserting a dangerous goods image for a security inspection CT provided in the present embodiment obtains the two-dimensional contour of the object in each tomographic image by acquiring each tomographic image in the three-dimensional image of the security inspection CT, and then obtains the three-dimensional contour of the object in the three-dimensional image of the security inspection CT, thereby realizing fast and accurate acquisition of the contour of the object in the three-dimensional image of the security inspection CT, ensuring that subsequent dangerous goods can be inserted into the area containing the object, and improving the accuracy of the insertion of the dangerous goods image. Then, the insertion position of the dangerous goods image is determined according to the three-dimensional contour of the object, the three-dimensional image of the security inspection CT and the dangerous goods image, and the insertion of the dangerous goods image of the security inspection CT is realized. The insertion position of the dangerous goods image can be quickly determined, and the real-time performance of the insertion of the dangerous goods image is improved.
[0068] During implementation, in step S2, obtaining the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image includes:
[0069] S21, binarize the tomographic image based on the first threshold to obtain a first processed image. That is, the data in the tomographic image that is greater than the first threshold is set to 1, and the rest is set to 0, and the position where the data is 1 in the obtained first processed image represents the area where the object may exist.
[0070] Specifically, the first threshold is determined according to the image background value, where the image background value is a value when the scanned object is not included. Preferably, an average value of the image background value can be selected.
[0071] Preferably, the tomographic image may be filtered and then binarized according to a first threshold value to enhance edge features of objects in the image. More preferably, a 3×3 all-one matrix is selected as a convolution kernel for filtering.
[0072] S22, setting the data corresponding to the object region whose area is smaller than the area threshold in the first processed image to 0, and obtaining the second processed image. It can be understood that setting the data corresponding to the object region whose area is smaller than the area threshold to 0 can reduce the influence of noise; and retaining the object region with a larger area in the image to determine the contour is more helpful in finding the insertion position of the dangerous goods image, and at the same time, the object region with a larger area has a higher probability of existing in each fault data, which is more helpful in finding a suitable insertion position of the dangerous goods image.
[0073] Specifically, the area threshold is set according to actual conditions, so that when the tomographic image is binarized, the isolated area that still exists in the background area after binarization due to the fact that the first threshold cannot be set too large and the area with large fluctuations can be removed.
[0074] S23, extract the circumscribed convex polygon containing all object regions in the second processed image to obtain the current third processed image. It can be understood that in this step, the convex polygon containing all object regions, that is, the region with data 1 in the image, is extracted more efficiently using convex polygons.
[0075] S24: Perform edge extraction on the current third processed image to obtain a first edge image.
[0076] In the specific implementation, in step S24, the edge extraction is performed on the current third processed image to obtain the first edge image, specifically: the third processed image is filtered, and then binarized based on the fourth threshold to obtain the fifth processed image, and the intersection of the fifth processed image and the third processed image is used as the first edge image.
[0077] Preferably, a 3×3 all-1 matrix is selected as the convolution kernel for filtering, and the fourth threshold is set to a value of 8. It can be understood that the convolution kernel is an all-1 matrix, and the maximum value after data convolution is 9. Setting the fourth threshold to 8 can better extract the edge position information of objects in the image.
[0078] Optionally, a conventional edge extraction algorithm may be used for edge extraction, such as a Sobel operator or a Laplace operator.
[0079] S25, updating the third processed image based on the first edge image and the second processed image. It can be understood that by shrinking the edges of the current third processed image that do not belong to the object area in the above manner, the second edge image obtained subsequently is closer to the object area and more accurate.
[0080] In specific implementation, in step S25, updating the third processed image based on the first edge image and the second processed image is specifically as follows:
[0081] inverting the data in the second processed image to obtain a fourth processed image;
[0082] Acquire a first data position where corresponding position data in the first edge image and the fourth processed image are both 1;
[0083] The data at the position corresponding to the first data position in the current third processed image is set to 0 to obtain an updated third processed image.
[0084] S26. Acquire a second edge image based on the updated third processed image.
[0085] In specific implementation, in step S26, based on the updated third processed image, a second edge image is obtained, specifically:
[0086] Searching row by row and column by column in the updated third processed image for a second data position where the data is 1 at the leftmost and rightmost ends of each row and at the top and bottom of each column;
[0087] The data at the second data position in the updated third processed image is set to 1, and the data at other positions are set to 0, so as to obtain a second edge image.
[0088] S27, taking the updated third processed image as the current third processed image, and repeatedly executing steps S24 to S26 until the first edge image and the second edge image satisfy the edge constraint condition, and taking the edge in the second edge image as the two-dimensional contour of the object.
[0089] In specific implementation, in step S27, the updated third processed image is used as the current third processed image, and steps S24 to S26 are repeatedly performed until the first edge image and the second edge image meet the edge constraint condition, and the edge in the second edge image is used as the two-dimensional contour of the object, specifically:
[0090] Set the data in the edge of the first edge image and the data in the edge of the second edge image to 1 to obtain a first intermediate image and a second intermediate image;
[0091] Subtract the second intermediate image from the first intermediate image to obtain a third intermediate image, and then obtain the number of data with data being 1 in the third intermediate image;
[0092] If the number of data is less than the set difference threshold, the edge in the second edge image is used as the two-dimensional contour of the object;
[0093] Otherwise, the updated third processed image is used as the current third processed image, and steps S24 to S26 are performed again.
[0094] More specifically, the difference threshold is set to a smaller value. Exemplarily, the difference threshold is set to 0, indicating that the first edge image and the second edge image at this time are unchanged from the first edge image and the second edge image obtained last time.
[0095] During implementation, in step S2, obtaining the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image also includes:
[0096] By calculating the distance between two fixed-interval data on the two-dimensional contour and the curve length, the data on the two-dimensional contour is judged abnormally and updated, so as to optimize the two-dimensional contour. Specifically, the following steps are included:
[0097] S281, calculating the distance between any two data points on the two-dimensional contour line; wherein the distance may be Euclidean distance or Manhattan distance;
[0098] S282, comparing each calculated distance with a set distance threshold, if the calculated distance is greater than the distance threshold, it means that the two data points corresponding to the distance do not need to be optimized; otherwise, calculating the curve distance between the two data points corresponding to the distance;
[0099] S283, comparing each obtained curve distance with a set curve distance threshold, if it is less than the curve distance threshold, it means that the two data points corresponding to the curve distance do not need to be optimized; otherwise, extract the curve distance;
[0100] S284, after sorting all the extracted curve distances from large to small, execute step S285 on the curve distances in sequence;
[0101] S285. Determine whether the two data points corresponding to the current curve distance are both on the two-dimensional contour line. If so, replace the curve between the two data points corresponding to the current curve distance with a straight line and update the two-dimensional contour line; otherwise, do not process.
[0102] It is understandable that since the two-dimensional contour obtained from the tomographic image is affected by metal artifacts, the edges of the two-dimensional contour will be relatively tortuous. The extracted two-dimensional contour can be further optimized through the above method to reduce the influence of metal artifacts, so that the obtained two-dimensional contour is accurate, which is more helpful for the subsequent generation of three-dimensional contours and finding the insertion position of the dangerous goods image.
[0103] It should be noted that after acquiring the two-dimensional contour of the object in a single tomographic image, the two-dimensional contour of the object in each tomographic image is determined in the same way. Since the object changes little in consecutive tomographic images, the contour area acquired in the previous tomographic image is expanded outward by a certain amount and used as the current third processing image in step S23, thereby accelerating the processing speed. The subsequent tomographic image processing process follows the above process.
[0104] During implementation, in step S3, the insertion position of the dangerous goods image is determined based on the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image, including the following steps:
[0105] S31, downsampling the image of the hazardous goods to be inserted, and performing binarization processing based on a second threshold value to obtain a first hazardous goods image, wherein the downsampling is performed according to a set downsampling multiple.
[0106] Specifically, the selected dangerous goods image is a three-dimensional image of M×N×L, which is downsampled in three directions according to the downsampling multiples of i, j, and k respectively, and the downsampled dangerous goods image is Q×W×E, wherein Q=ceil(M / i), W=ceil(N / j), E=ceil(L / k); ceil() means rounding up.
[0107] More specifically, the three directions can be set as directions of a three-dimensional coordinate system with a certain point on the dangerous goods image as the origin; the downsampling process adopts an intra-regional averaging method, preferably a Neumann boundary condition.
[0108] More specifically, the downsampling multiple can be adjusted according to the size of the dangerous goods. Preferably, the downsampling multiples are i=10, j=10, k=10.
[0109] Specifically, the second threshold is set according to the pixel value of objects with lower density such as common fiber clothing and specific equipment conditions. More specifically, the setting range of the second threshold is 50-70.
[0110] S32: down-sample the acquired security inspection CT three-dimensional image, and then perform de-binarization processing based on a second threshold to obtain a first three-dimensional image.
[0111] It can be understood that the security inspection CT three-dimensional image is downsampled according to the processing process of downsampling the dangerous goods image, so that the dangerous goods image and the security inspection CT three-dimensional image are adapted to each other, and the amount of searched data is reduced, and the process of finding the insertion position is accelerated; the debinarization processing is performed according to the second threshold, that is, the data less than the second threshold is set to 1, and the rest is set to 0, so that the area with smaller grayscale in the security inspection three-dimensional CT image where the image can be inserted can be displayed for subsequent search for a suitable insertion position.
[0112] S33, setting the inner data of the obtained three-dimensional contour of the object to 1 and the outer data to 0, to obtain a first binary image.
[0113] S34 , after downsampling the first binary image, perform binarization processing based on a third threshold value to obtain a second binary image.
[0114] Specifically, the value range of the third threshold is 0.5-1. Preferably, the third threshold is 0.8, which can better represent the edge features.
[0115] It can be understood that the first binary image is downsampled according to the processing process of downsampling the dangerous goods image, so that the dangerous goods image, the security CT three-dimensional image and the first binary image are adapted, and the amount of searched data is reduced and the insertion position search process is accelerated. It should be noted that the materials of the scanned luggage items and the inserted dangerous goods are mostly uniform, such as bottled water, computers, etc., so downsampling will not have a significant impact on the content of the image.
[0116] S35 . Multiply the second binarized image by the first three-dimensional image to obtain a second three-dimensional image.
[0117] It can be understood that after multiplying the second binary image with the first three-dimensional image, regions within the contour range of the object and with low density can be obtained, and these regions are regions where dangerous goods images can be inserted.
[0118] S36, using the first dangerous goods image as a sliding window to traverse the second three-dimensional image, and obtain an insertion position of the dangerous goods image in the acquired security inspection CT three-dimensional image. It can be understood that the second two-dimensional image is traversed in sequence according to the first dangerous goods image, and if there is an area in the second two-dimensional image that is compatible with the first dangerous goods image, it can be used as the insertion position, so that the inserted dangerous goods image is better integrated with the original three-dimensional image and more closely matches the actual situation.
[0119] In the specific implementation, in step S36, the first dangerous goods image is used as a sliding window to traverse the second three-dimensional image to obtain the insertion position of the dangerous goods image in the acquired security inspection CT three-dimensional image, specifically:
[0120] The first dangerous goods image sequentially traverses the second three-dimensional image in a set traversal order:
[0121] If the number of inconsistent data in the data within the current overlapping area between the first dangerous goods image and the second three-dimensional image is less than the set number threshold, the position is determined to be the insertion position of the dangerous goods image in the second three-dimensional image, and the traversal ends;
[0122] If the insertion position of the dangerous goods image in the second three-dimensional image is obtained, the corresponding insertion position in the acquired security inspection CT three-dimensional image is obtained based on the downsampling multiple; otherwise, it is determined that the insertion of the dangerous goods image fails.
[0123] Specifically, the traversal order of the first dangerous goods image traversing the second three-dimensional image can be set according to needs. For example, the point (1,1,1) on the first dangerous goods image is used as a reference point to traverse the second three-dimensional image in turn along the x-axis direction, the y-axis direction and the z-axis direction. That is to say, if there is no suitable insertion position after the row data in the x-axis direction are compared one by one, the column data in the y-axis direction are compared one by one. If the position is not found in the y-axis direction, it is searched along the z-axis direction. After finding a position that meets the conditions, the coordinate point (c,v,b) of the reference point (1,1,1) on the first dangerous goods image in the second two-dimensional image is recorded, and then according to the downsampling multiple in step S31, the corresponding insertion position in the acquired original security inspection CT three-dimensional image is obtained as ((c-1)×i+1, (v-1)×j+1, (b-1)×k+1). According to the insertion position coordinates, the dangerous goods image is inserted into the security inspection CT three-dimensional image to complete the insertion of the dangerous goods image.
[0124] Example 2
[0125] A specific embodiment of the present invention discloses a dangerous goods image insertion system for security inspection CT, such as Figure 2 As shown, including:
[0126] A data acquisition module, used to obtain a security inspection CT three-dimensional image of a preset range upon receiving a dangerous goods image insertion signal;
[0127] An object three-dimensional contour acquisition module, used to obtain the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image, and then obtain the three-dimensional contour of the object in the security inspection CT three-dimensional image;
[0128] A dangerous goods image insertion position determination module, used to determine the insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image;
[0129] The dangerous goods image insertion module is used to insert the dangerous goods image of the security inspection CT based on the insertion position of the dangerous goods image.
[0130] The specific implementation process of the embodiment of the present invention can be found in the above method embodiment, which will not be described in detail in this embodiment.
[0131] Since the principles of this embodiment are the same as those of the above method embodiment, the system also has the corresponding technical effects of the above method embodiment.
[0132] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0133] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for inserting dangerous goods images for security inspection CT, characterized in that: The following steps are involved: When receiving the dangerous goods image insertion signal, obtain the security inspection CT three-dimensional image of the preset range; Based on each tomographic image in the security inspection CT three-dimensional image, a two-dimensional contour of an object in each tomographic image is obtained, and then a three-dimensional contour of the object in the security inspection CT three-dimensional image is obtained; Determining an insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image, and the dangerous goods image; Based on the insertion position of the dangerous goods image, inserting the dangerous goods image of the security inspection CT is realized; The method of obtaining the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image includes: S21, binarizing the tomographic image based on a first threshold value to obtain a first processed image; S22, setting the data corresponding to the object region whose area in the first processed image is smaller than the area threshold to 0, to obtain a second processed image; S23, extracting the circumscribed convex polygon containing all object regions in the second processed image to obtain a current third processed image; S24, performing edge extraction on the current third processed image to obtain a first edge image; S25, updating the third processed image based on the first edge image and the second processed image; S26, acquiring a second edge image based on the updated third processed image; S27, taking the updated third processed image as the current third processed image, and repeatedly executing steps S24 to S26 until the first edge image and the second edge image satisfy the edge constraint condition, and taking the edge in the second edge image as the two-dimensional contour of the object; The step of determining the insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image comprises the following steps: After downsampling the image of the hazardous goods to be inserted, binarization processing is performed based on a second threshold to obtain a first hazardous goods image; After downsampling the acquired security inspection CT three-dimensional image, a debinarization process is performed based on a second threshold value to obtain a first three-dimensional image; The data inside the contour of the obtained three-dimensional contour of the object is set to 1, and the data outside the contour is set to 0, so as to obtain a first binary image; After downsampling the first binary image, binarization processing is performed based on a third threshold value to obtain a second binary image; multiplying the second binarized image by the first three-dimensional image to obtain a second three-dimensional image; Using the first dangerous goods image as a sliding window to traverse the second three-dimensional image, obtaining an insertion position of the dangerous goods image in the acquired security inspection CT three-dimensional image; Wherein, downsampling is performed according to a set downsampling multiple.
2. The method for inserting dangerous goods images for security inspection CT according to claim 1, characterized in that: In step S24, the edge extraction is performed on the current third processed image to obtain the first edge image, specifically: the third processed image is filtered, and then binarized based on the fourth threshold to obtain the fifth processed image, and the intersection of the fifth processed image and the current third processed image is used as the first edge image.
3. The method for inserting dangerous goods images for security inspection CT according to claim 1, characterized in that: In step S25, the third processed image is updated based on the first edge image and the second processed image, specifically: inverting the data in the second processed image to obtain a fourth processed image; Acquire a first data position where corresponding position data in the first edge image and the fourth processed image are both 1; The data at the position corresponding to the first data position in the current third processed image is set to 0 to obtain an updated third processed image.
4. The method for inserting dangerous goods images for security inspection CT according to claim 1, characterized in that: In step S26, based on the updated third processed image, a second edge image is obtained, specifically: Searching row by row and column by column in the updated third processed image for a second data position where the data is 1 at the leftmost and rightmost ends of each row and at the top and bottom ends of each column; The data at the second data position in the updated third processed image is set to 1, and the data at other positions are set to 0, so as to obtain a second edge image.
5. The method for inserting dangerous goods images for security inspection CT according to claim 1, characterized in that: In step S27, the updated third processed image is used as the current third processed image, and steps S24 to S26 are repeatedly performed until the first edge image and the second edge image meet the edge constraint condition, and the edge in the second edge image is used as the two-dimensional contour of the object, specifically: Set the data in the edge of the first edge image and the data in the edge of the second edge image to 1 to obtain a first intermediate image and a second intermediate image; Subtract the second intermediate image from the first intermediate image to obtain a third intermediate image, and then obtain the number of data with data being 1 in the third intermediate image; If the number of data is less than the set difference threshold, the edge in the second edge image is used as the two-dimensional contour of the object; Otherwise, the updated third processed image is used as the current third processed image, and steps S24 to S26 are performed again.
6. The method for inserting dangerous goods images for security inspection CT according to claim 1, characterized in that: The method of obtaining the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image further includes: By calculating the distance between two data with fixed intervals on the two-dimensional contour and the curve length, the data on the two-dimensional contour is judged to be abnormal and updated, so as to achieve the optimization of the two-dimensional contour.
7. The method for inserting dangerous goods images for security inspection CT according to claim 1, characterized in that: The method of traversing the second three-dimensional image using the first dangerous goods image as a sliding window to obtain the insertion position of the dangerous goods image in the acquired security inspection CT three-dimensional image is specifically: The first dangerous goods image sequentially traverses the second three-dimensional image in a set traversal order: If the number of inconsistent data in the data within the current overlapping area between the first dangerous goods image and the second three-dimensional image is less than the set number threshold, the position is determined to be the insertion position of the dangerous goods image in the second three-dimensional image, and the traversal ends; If the insertion position of the dangerous goods image in the second three-dimensional image is obtained, the corresponding insertion position in the acquired security inspection CT three-dimensional image is obtained based on the downsampling multiple; otherwise, it is determined that the insertion of the dangerous goods image fails.
8. A dangerous goods image insertion system for security inspection CT, characterized in that: include: A data acquisition module, used to obtain a security inspection CT three-dimensional image of a preset range when receiving a dangerous goods image insertion signal; An object three-dimensional contour acquisition module, used to obtain the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image, and then obtain the three-dimensional contour of the object in the security inspection CT three-dimensional image; A module for determining a dangerous goods image insertion position, used to determine an insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image; A dangerous goods image insertion module, used to insert a dangerous goods image into the security inspection CT based on the insertion position of the dangerous goods image; The method of obtaining the two-dimensional contour of the object in each tomographic image based on each tomographic image in the security inspection CT three-dimensional image includes: S21, binarizing the tomographic image based on a first threshold value to obtain a first processed image; S22, setting the data corresponding to the object region whose area in the first processed image is smaller than the area threshold to 0, to obtain a second processed image; S23, extracting the circumscribed convex polygon containing all object regions in the second processed image to obtain a current third processed image; S24, performing edge extraction on the current third processed image to obtain a first edge image; S25, updating the third processed image based on the first edge image and the second processed image; S26, acquiring a second edge image based on the updated third processed image; S27, taking the updated third processed image as the current third processed image, and repeatedly executing steps S24 to S26 until the first edge image and the second edge image satisfy the edge constraint condition, and taking the edge in the second edge image as the two-dimensional contour of the object; The step of determining the insertion position of the dangerous goods image based on the three-dimensional contour of the object, the security inspection CT three-dimensional image and the dangerous goods image comprises the following steps: After downsampling the image of the hazardous goods to be inserted, binarization processing is performed based on a second threshold to obtain a first hazardous goods image; After downsampling the acquired security inspection CT three-dimensional image, a debinarization process is performed based on a second threshold value to obtain a first three-dimensional image; The data inside the contour of the obtained three-dimensional contour of the object is set to 1, and the data outside the contour is set to 0, so as to obtain a first binary image; After downsampling the first binary image, binarization processing is performed based on a third threshold value to obtain a second binary image; multiplying the second binarized image by the first three-dimensional image to obtain a second three-dimensional image; Using the first dangerous goods image as a sliding window to traverse the second three-dimensional image, obtaining an insertion position of the dangerous goods image in the acquired security inspection CT three-dimensional image; Wherein, downsampling is performed according to a set downsampling multiple.
Citation Information
Patent Citations
CT detection method and device
CN109975335A
Cross-border article image checking method and system
CN111458760A