Cargo inspection method, device and electronic device

CN117346707BActive Publication Date: 2026-09-25NUCTECH JIANGSU CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210750832.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2026-09-25
Estimated Expiration
2042-06-28

AI Technical Summary

Technical Problem

[0007]本公开的目的在于提供一种货物检测方法、装置与电子设备,用于至少在一定程度上克服由于相关技术的限制和缺陷而导致的货物种类无法通过扫描图像外形轮廓进行准确识别的问题

Benefits of technology

[0042]本公开实施例通过自动根据预设参照物的实际尺寸确定扫描图像的距离参数,进而根据扫描图像的距离参数估算待测货物的实际尺寸,根据待测货物的实际尺寸和待测货物的申报信息对待测货物进行检测,可以消除由于设备差异、设备维护、车辆扫描时的停放位置等造成的偏差,进而对扫描图像中物体的长度、面积、重量进行更加精准的测量,辅助图像分析人员进行更准确的图像分析,进以提升机检查验的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117346707B_ABST
    Figure CN117346707B_ABST
Patent Text Reader

Abstract

The present disclosure provides a cargo detection method, device and electronic equipment. The method comprises: acquiring a scanning image of a cargo to be detected by an image acquisition device; determining a target reference in the scanning image; determining a first direction distance parameter and a second direction distance parameter range of the scanning image according to pixel information of the target reference and an actual size of the target reference, the second direction being perpendicular to the first direction; determining a first direction size and a second direction size range of the cargo to be detected according to the first direction distance parameter and the second direction distance parameter range of the scanning image and pixel information of the cargo to be detected in the scanning image; and determining whether the cargo to be detected passes the detection according to the first direction size and the second direction size range and declaration information of the cargo to be detected. The present disclosure can accurately measure the actual size of the cargo through the scanning image, and check the cargo according to the actual size of the cargo.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of information technology, and more specifically, to a cargo inspection method, apparatus, and electronic equipment. Background Technology

[0002] In machine inspection operations, container vehicle scanning systems scan vehicles to generate scanned images. Image analysts need to analyze these images to determine whether the goods loaded inside the container match the declared information. In some scenarios, it is necessary to estimate the size (length, area) of a certain region in the inspected image to determine the type or quantity of goods.

[0003] Existing length and area measurement functions convert measurements using default distance parameters in the scanned image, which represent the unit length corresponding to the number of pixels. For example, the distance parameters (PixelX = 200, PixelY = 205) mean that 200 pixels on the horizontal axis correspond to an actual length of 1 meter, and 205 pixels on the vertical axis correspond to an actual height of 1 meter. When length and area need to be estimated, the lengths of the horizontal and vertical axes are calculated based on the corresponding distance parameters, and then converted to obtain the area.

[0004] This method of estimating size using fixed distance parameters can lead to discrepancies between the estimated and actual sizes when the distance parameters are not corrected in a timely manner, or when factors such as unstable vehicle speed, the distance between the vehicle being scanned, items in the vehicle, and the accelerator of the scanning device (similar to the focal length of a camera) occur during vehicle scanning. This makes it difficult to obtain accurate size information, resulting in low accuracy in identifying goods with similar sizes or packaging sizes.

[0005] Therefore, there is a need for a detection method that can accurately improve the identification accuracy of goods.

[0006] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0007] The purpose of this disclosure is to provide a cargo inspection method, apparatus, and electronic device to overcome, at least to some extent, the problem that cargo types cannot be accurately identified by scanning the outline of images due to limitations and defects in related technologies.

[0008] According to a first aspect of the present disclosure, a cargo inspection method is provided, comprising: acquiring a scanned image of a cargo to be inspected using an image acquisition device; determining a target reference object in the scanned image; determining a first directional distance parameter and a second directional distance parameter range of the scanned image based on pixel information of the target reference object and the actual size of the target reference object, wherein the second direction is perpendicular to the first direction; determining a first directional dimension and a second directional dimension range of the cargo to be inspected based on the first directional distance parameter and the second directional distance parameter range of the scanned image and pixel information of the cargo to be inspected in the scanned image; and determining whether the cargo to be inspected passes inspection based on the first directional dimension and the second directional dimension range and declaration information of the cargo to be inspected.

[0009] In one exemplary embodiment of this disclosure, the image acquisition device includes a radiation emitting device and a detector module disposed opposite to each other, the cargo to be tested is located between the radiation emitting device and the detector module, and the detector module is used to receive inspection radiation emitted by the radiation emitting device, the inspection radiation partially passing through the cargo to be tested.

[0010] In one exemplary embodiment of this disclosure, the target reference object includes a box-shaped compartment. Determining the range of the first direction distance parameter and the second direction distance parameter of the scanned image based on the pixel information of the target reference object and the actual size of the target reference object includes:

[0011] The outline pixel information of the box-shaped cabin is determined based on the scanned image;

[0012] The length and height pixel information of the box-shaped cabin are determined based on the outline pixel information.

[0013] The first directional distance parameter is determined based on the actual length of the box-shaped cabin and the length pixel information;

[0014] The range of the second directional distance parameter is determined based on the actual height of the box-shaped cabin and the height pixel information. The maximum value of the range of the second directional distance parameter is the near-ray source surface height distance parameter of the box-shaped cabin, and the minimum value of the range of the second directional distance parameter is the far-ray source surface height distance parameter of the box-shaped cabin.

[0015] In one exemplary embodiment of this disclosure, determining the first-direction dimension and the second-direction dimension range of the goods to be tested based on the range of first-direction distance parameters and second-direction distance parameters of the scanned image and the pixel information of the goods to be tested in the scanned image includes:

[0016] The first-direction dimension of the cargo to be tested is determined based on the ratio of the pixel information of the cargo in the first direction to the distance parameter in the first direction.

[0017] The minimum size of the cargo under test in the second direction is determined based on the ratio of the pixel information of the cargo under test in the second direction to the maximum value of the distance parameter range in the second direction.

[0018] The maximum size of the cargo under test in the second direction is determined based on the ratio of the pixel information of the cargo under test in the second direction to the minimum value of the distance parameter range in the second direction.

[0019] The second directional dimension range of the cargo to be tested is determined based on the minimum dimension and the maximum dimension.

[0020] In one exemplary embodiment of this disclosure, determining the first-direction dimension and the second-direction dimension range of the goods to be tested based on the range of the first-direction distance parameter and the second-direction distance parameter of the scanned image and the pixel information of the goods to be tested in the scanned image includes:

[0021] In response to an image cropping command, a target region to be cropped in the scanned image is determined. The target region corresponds to one or more of the goods to be tested. The outline of the target region includes regular and irregular shapes.

[0022] Based on the first directional distance parameter and the second directional distance parameter range, determine the second directional size range corresponding to each preset size unit of the target region in the first direction, and the first directional size corresponding to each preset size unit of the target region in the second direction;

[0023] The area range of the target region is determined based on the second direction dimension range corresponding to each preset dimension unit in the first direction and the first direction dimension corresponding to each preset dimension unit in the second direction.

[0024] In one exemplary embodiment of this disclosure, determining whether the goods to be tested pass the inspection based on the first directional dimension and the second directional dimension range and the declaration information of the goods to be tested includes:

[0025] The type of goods to be tested and the corresponding size characteristics of the goods to be tested are determined based on the declaration information of the goods to be tested.

[0026] When the dimensions in the first direction and the second direction meet the size characteristics, the goods to be tested are determined to have passed the inspection.

[0027] In one exemplary embodiment of this disclosure, determining whether the goods to be tested pass the inspection based on the first directional dimension and the second directional dimension range and the declaration information of the goods to be tested includes:

[0028] The type of goods to be tested and the density range corresponding to the type of goods are determined based on the declared information of the goods to be tested.

[0029] The volume range of the cargo to be tested is determined based on the first directional dimension, the second directional dimension range, and the dimensions of the specification container in which the cargo to be tested is located. The specification container includes a box-shaped compartment.

[0030] The first weight range of the cargo to be tested is determined based on the volume range and the density range;

[0031] The second weight range of the cargo to be tested is determined based on the cargo weight corresponding to the specified container specifications.

[0032] If the overlap rate between the second weight range and the first weight range is greater than a preset threshold, the goods to be tested are determined to have passed the test.

[0033] In one exemplary embodiment of this disclosure, determining a target reference object in the scanned image includes: identifying a preset reference object in the scanned image; if the preset reference object is identified, setting the preset reference object as the target reference object; if the preset reference object is not identified, sending the scanned image to a manual processing library; responding to a processing completion message from the manual processing library, obtaining reference object designation information corresponding to the scanned image, the reference object designation information including a designated reference object; and setting the designated reference object as the target reference object.

[0034] In one exemplary embodiment of this disclosure, the reference designation information further includes actual size information corresponding to the designated reference object, wherein the actual size information includes a designated part mark of the designated reference object and the actual size corresponding to the designated part mark.

[0035] In one exemplary embodiment of this disclosure, the method further includes: if the processing completion message from the manual processing library is not obtained within a preset time period, using a first preset value as a first directional distance parameter of the scanned image, and using a second preset value as a second directional distance parameter of the scanned image.

[0036] In one exemplary embodiment of this disclosure, the preset reference object includes an object with preset morphological characteristics placed on the container compartment or the cargo to be tested before the start of the detection.

[0037] In one exemplary embodiment of this disclosure, determining the range of a first directional distance parameter and a second directional distance parameter of the scanned image based on the pixel information of the target reference object and the actual size of the target reference object includes: updating the first preset value based on the first directional distance parameter of the scanned image, and updating the second preset value based on the range of the second directional distance parameter of the scanned image.

[0038] In an exemplary embodiment of this disclosure, determining the range of a first directional distance parameter and a second directional distance parameter of the scanned image based on the pixel information of the target reference and the actual size of the target reference includes: determining a deformation parameter of the target reference based on the pixel information and the actual size; when the deformation parameter exceeds a third preset value, interpolating the scanned parameters based on the deformation parameter to correct the deformation of the scanned image; and re-acquiring the pixel information of the target reference based on the deformed scanned image to determine the range of the first directional distance parameter and the second directional distance parameter.

[0039] According to a second aspect of the present disclosure, a cargo inspection apparatus is provided, comprising: a scanned image acquisition module configured to acquire a scanned image of a cargo to be inspected via an image acquisition device; a reference object positioning module configured to determine a target reference object in the scanned image; a distance parameter calculation module configured to determine a first-direction distance parameter and a second-direction distance parameter range of the scanned image based on pixel information of the target reference object and the actual size of the target reference object, wherein the second direction is perpendicular to the first direction; an actual size calculation module configured to determine a first-direction size and a second-direction size range of the cargo to be inspected based on the first-direction distance parameter and the second-direction distance parameter range of the scanned image and pixel information of the cargo to be inspected in the scanned image; and a size detection module configured to determine whether the cargo to be inspected passes inspection based on the first-direction size and the second-direction size range and the declaration information of the cargo to be inspected.

[0040] According to a third aspect of this disclosure, an electronic device is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to perform the method as described in any of the preceding methods based on instructions stored in the memory.

[0041] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a program stored thereon that, when executed by a processor, implements the cargo inspection method as described in any of the preceding claims.

[0042] This embodiment of the present disclosure automatically determines the distance parameters of the scanned image based on the actual size of a preset reference object, and then estimates the actual size of the goods to be tested based on the distance parameters of the scanned image. The goods to be tested are then inspected based on their actual size and the declaration information of the goods to be tested. This can eliminate deviations caused by equipment differences, equipment maintenance, and the parking position of the vehicle during scanning, thereby enabling more accurate measurement of the length, area, and weight of objects in the scanned image. This assists image analysts in performing more accurate image analysis, thereby improving the accuracy of machine inspection.

[0043] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0044] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0045] Figure 1 This is a flowchart of a cargo inspection method in an exemplary embodiment of this disclosure.

[0046] Figure 2 This is a schematic diagram of an image acquisition device in one embodiment of the present disclosure.

[0047] Figure 3 This is a schematic diagram of the detection information of detector 221 in one embodiment of this disclosure.

[0048] Figure 4 yes Figure 3 A schematic diagram of the scanning image generated by the detector module 22 shown.

[0049] Figure 5 This is a sub-flowchart of step S3 in one embodiment of this disclosure.

[0050] Figure 6 This is a sub-flowchart of step S4 in one embodiment of this disclosure.

[0051] Figure 7 This is a sub-flowchart of step S4 in another embodiment of this disclosure.

[0052] Figure 8 This is a sub-flowchart of step S5 in one embodiment of this disclosure.

[0053] Figure 9 This is a flowchart of the complete process for inspecting the goods to be tested in one embodiment of this disclosure.

[0054] Figure 10 This is a block diagram of a cargo inspection device according to an exemplary embodiment of the present disclosure.

[0055] Figure 11 This is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0056] 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 examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0057] Furthermore, the accompanying drawings are merely illustrative of this disclosure, and the same reference numerals in the drawings denote the same or similar parts, thus repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0058] The exemplary embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0059] Figure 1 This is a flowchart of a cargo inspection method in an exemplary embodiment of this disclosure.

[0060] refer to Figure 1 The cargo inspection method 100 may include:

[0061] Step S1: Acquire a scanned image of the goods to be tested using an image acquisition device;

[0062] Step S2: Determine the target reference object in the scanned image;

[0063] Step S3: Determine the range of the first direction distance parameter and the second direction distance parameter of the scanned image based on the pixel information of the target reference object and the actual size of the target reference object, wherein the second direction is perpendicular to the first direction;

[0064] Step S4: Determine the first-direction dimension and the second-direction dimension range of the goods to be tested based on the first-direction distance parameter and the second-direction distance parameter range of the scanned image and the pixel information of the goods to be tested in the scanned image;

[0065] Step S5: Determine whether the goods to be tested pass the inspection based on the first directional dimension and the second directional dimension range and the declaration information of the goods to be tested.

[0066] This embodiment of the present disclosure automatically determines the distance parameters of the scanned image based on the actual size of a preset reference object, and then estimates the actual size of the goods to be tested based on the distance parameters of the scanned image. The goods to be tested are then inspected based on their actual size and the declaration information of the goods to be tested. This can eliminate deviations caused by equipment differences, equipment maintenance, and the parking position of the vehicle during scanning, thereby enabling more accurate measurement of the length, area, and weight of objects in the scanned image. This assists image analysts in performing more accurate image analysis, thereby improving the accuracy of machine inspection.

[0067] The following is a detailed explanation of each step of the cargo inspection method 100.

[0068] In step S1, a scanned image of the goods to be tested is acquired by an image acquisition device.

[0069] In one embodiment of this disclosure, the image acquisition device includes a radiation emitting device and a detector module disposed opposite to each other. The goods to be tested are located between the radiation emitting device and the detector module. The detector module is used to receive inspection radiation emitted by the radiation emitting device, and the inspection radiation partially passes through the goods to be tested.

[0070] Figure 2 This is a schematic diagram of an image acquisition device in one embodiment of the present disclosure.

[0071] refer to Figure 2 The image acquisition device 200 may include:

[0072] X-ray emitting device 21, used to generate and emit rays;

[0073] The detector module 22, facing the radiation emitting device 21, includes one or more detectors 221 and detector arms 222. Each detector 221 is mounted on the detector arm 222 and is used to receive radiation emitted by the radiation emitting device 21.

[0074] The conveying device 23, located between the X-ray emitting device 21 and the detector module 22, is used to make the goods to be tested, located between the X-ray emitting device 21 and the detector module 22, move in a straight line relative to the X-ray emitting device 21 and the detector module 22 during the inspection process.

[0075] The control and image processing device 24 is connected to the X-ray emitting device 21, the detector module 22, and the transmission device 23. It is used to control the X-ray emitting device 21, the detector module 22, and the transmission device 23, and to reconstruct the scanned image of the cargo to be tested based on the projection data received by the detector module 22.

[0076] In some embodiments, the radiation emitting device 21 may be, for example, an accelerator. Accelerators, as radiation sources that use magnetic or electric fields to accelerate electrons to hit a target and generate X-rays, are widely used in security inspection systems, especially large container inspection systems. In other embodiments, the radiation emitting device 21 may also be a radiation source emitting gamma rays, an X-ray machine, or a radioactive isotope, and this disclosure does not impose any particular limitations on this.

[0077] When the image acquisition device 200 is started, the control and image processing device 24 controls the transmission device 23 to start, so that the tool (e.g., a truck) loaded with the goods to be tested passes through the scanning channel between the X-ray emitting device 21 and the detector module 22 under the control of the transmission device 23. At the same time, the control and image processing device 24 controls the X-ray emitting device 21 to emit X-rays so that the X-rays pass through the goods to be tested and reach the detector module 22. The detector 22 transmits the received signal to the control and image processing device 24 so that the control and image processing device 24 can identify the received signal and generate a scanned image of the goods to be tested and the tool.

[0078] The specific process can be as follows: The truck is loaded onto the conveyor 23 anchored at the entrance of the scanning channel, and the conveyor 23 locks the truck's front wheels. After the winch of the conveyor 23 is started, it is pulled forward by a steel cable, and the conveyor 23 carries the truck smoothly into the scanning channel. When the truck enters the scanning channel, the X-ray emitting device 21 emits a beam for detection. The X-ray beam passes through the truck and is received by the detector 221 mounted inside the detector arm 222. The detector 221 converts the image signal into an electrical signal and inputs it to the control and image processing device 24 outside the scanning channel. The control and image processing device 24 analyzes the density distribution of the objects in the box based on the intensity changes of the X-rays and converts the X-ray intensity into image grayscale, thereby generating a perspective image of the objects in the box, i.e., a scanned image. After generating the scanned image based on the image signal, the control and image processing device 24 transmits the scanned image to the display device for display, so that the inspection personnel can identify the goods to be tested through the scanned image. After the inspection is completed, the X-ray emitting device 21 stops emitting the beam, and the conveyor 23 carries the truck out of the scanning channel. Once the conveyor 23 reaches the exit of the scanning channel and is anchored, the truck is unloaded from the conveyor 23.

[0079] like Figure 2In the illustrated embodiment, the detector arm 222 is L-shaped, and multiple detectors 221 of the same specifications can be mounted on the detector arm 222. Each detector 221 includes multiple detector crystals arranged side by side. The detector 221 can be a solid-state detector unit, a gas detector unit, or a semiconductor detector unit. To ensure that the detector 221 is aligned with the beam direction of the radiation emitting device 21, the multiple detectors 221 on the detector arm 222 can be configured with different mounting angles. The number and position of the detectors 221 on each detector arm 222 can be determined by those skilled in the art according to actual needs.

[0080] The method of this embodiment can be executed by a control and image processing device 24. When the control and image processing device 24 generates a scanned image based on the detection device 22, the scanned image contains scanning information on each detection arm 222, which is automatically processed into data on the same plane.

[0081] Figure 3 This is a schematic diagram of the detection information of detector 221 in one embodiment of this disclosure.

[0082] In some embodiments of this disclosure, the goods to be tested can be loaded into a container compartment, which may include, for example, a shipping container. Since shipping containers have fixed specifications and models, the actual external dimensions of the container can be obtained based on its model. Furthermore, the container compartment can also be an opaque packaging device such as a train carriage or a freight car; this disclosure does not impose any special limitations on this.

[0083] exist Figure 3 In the illustrated embodiment, when the goods to be tested are loaded into a container, the rays emitted by the ray emitting device 21 pass through the container, and the horizontal and vertical arms of the detector arm 222 receive the scanning signals respectively. Figure 3 On the left and right sides, A, B, C, and D represent the four long sides of the container.

[0084] The detectors 221 on the horizontal and vertical arms of detector arm 222 receive data, such as... Figure 3 As shown on the left, the detector position can be determined based on the detector number 221, and the angle between detector 221 and the radiation emitting device 21 can be determined based on the position of detector 221. The data received by detector 221 is then processed by an algorithm to merge the data received by detector 221 on the horizontal arm of detector arm 222 with the data received by detector 221 on the vertical arm, generating a result as shown on the left. Figure 3 The right side shows the machine scan data, and the data is merged into a complete scan image.

[0085] Figure 4 yes Figure 3 A schematic diagram of the scanning image generated by the detector module 22 shown.

[0086] refer to Figure 4 The four lines A1, B1, C1, and D1 correspond to the four sides A, B, C, and D in the actual container, respectively. The lengths of the four lines A1, B1, C1, and D1 are the length pixels of the scanned container. The cargo 41 to be tested is located in the container, and the scanned image of the cargo 41 intersects with the length pixels of the scanned container.

[0087] In step S2, the target reference object in the scanned image is determined.

[0088] In one embodiment of this disclosure, a preset reference object may first be identified in the scanned image; if the preset reference object is identified, it is set as the target reference object; if the preset reference object is not identified, the scanned image is sent to a manual processing library.

[0089] If a processing completion message is received from the manual processing library within a preset time period, the system can respond to the processing completion message, obtain the reference object specification information corresponding to the scanned image, including the specified reference object; and set the specified reference object as the target reference object.

[0090] If no processing completion message is received from the manual processing library within the preset time period, a first preset value is used as the first direction distance parameter of the scanned image, and a second preset value is used as the second direction distance parameter of the scanned image. The first and second preset values ​​are system default distance parameter values, which can be corrected and updated in real time subsequently.

[0091] It should be noted that in actual implementation, after the system is started, the first direction distance parameter can be set to a first preset value by default, and the second direction distance parameter can be set to a second preset value. After determining the current range of the first and second direction distance parameters in real time based on the scanned image in step S3, the first and second direction distance parameters are updated using the real-time determined values, so that the real-time calculated values ​​of these two parameters are used to detect the goods under test in the subsequent step S4. If the target reference object is not identified in step S2, and step S3 cannot be reached to calculate the current first and second direction distance parameters, it can also directly proceed to step S4 and use the aforementioned first and second preset values ​​to detect the goods under test.

[0092] After the original scanned image is generated, the control and image processing device 24 first needs to automatically analyze and calculate the scanned image to identify whether there is a preset reference object in the scanned image. The preset reference object can be identified according to the preset length and shape. The length and shape of the preset reference object include standard container body, wheels, standard reference objects, box trucks, etc., which are identified by the algorithm.

[0093] In some embodiments, a preset reference object may not be set, or the preset reference object may not be recognized, and the image analyst may manually delineate the specified reference object based on the scanned image. In this case, the function of automatically recognizing preset reference objects in the scanned image can be turned on or off as needed by setting parameters or configuration items.

[0094] If the preset reference object is not recognized, or cannot be recognized (i.e., no standard distance is recognized in the scanned image), such as when the scanned image is a machined part or the image analyst believes that the distance parameter is not accurate enough, the scanned image can be sent to the manual processing library so that the image analyst can select a specified reference object (for example, a truck tire can be selected as the specified reference object in the scanned image) and obtain the preset actual size of the specified reference object.

[0095] In this embodiment, the manual processing library corresponds to a data storage address for storing scanned images. This data storage address can correspond to a database, a cache, or the data storage address corresponding to the interface being operated by the image analyst. The image analyst can directly access the scanned images in the manual processing library and perform operations on them, such as selecting a specified reference object or setting the actual size of the specified reference object. When the first direction distance parameter is set to a first preset value by default, and the second direction distance parameter is set to a second preset value by default, the image analyst can also directly modify the values ​​of the first and second direction distance parameters, that is, update the first and second direction distance parameters to the modified values.

[0096] In some cases, after obtaining a designated reference object set by the image analyst, the preset actual size of the designated reference object can be obtained based on its preset information, such as the length of a standard container or the diameter of a standard truck tire. However, in other cases, the designated reference object lacks preset information or cannot be fully identified. In this case, the reference object designation information also includes the actual size information corresponding to the designated reference object, which includes the designated part markings of the designated reference object and the actual size corresponding to those markings.

[0097] Image analysts can use mouse dragging to select one or more parts of a specified reference object for marking (e.g., marking the length or height of the reference object), and input the corresponding actual dimensions for the marked parts, such as... Figure 4The system allows users to select the length and height (marked at a specified location) of the outer packaging of the goods to be tested (41) as the standard distance. Reference information is set by selecting pixels in the selected area and inputting the actual dimensions. The length and height of the outer packaging of the goods to be tested (41) can be obtained through the experience of image analysts or from the corresponding declaration information (customs declaration, manifest, etc.).

[0098] Step S3: Determine the range of the first direction distance parameter and the second direction distance parameter of the scanned image based on the pixel information of the target reference object and the actual size of the target reference object, wherein the second direction is perpendicular to the first direction.

[0099] In some scenarios, scanned images may exhibit distortion, such as a circular wheel appearing as an ellipse in the scanned image, or a square object appearing as a rectangle in the scanned image. This significantly interferes with image analysis. Therefore, in one embodiment of this disclosure, after obtaining the pixel information and actual size of the target reference object in step S2, the potential distortion of the scanned image can be corrected based on this pixel information and actual size. The distorted image and distorted areas can be calibrated to resolve the issues of scanned image distortion and discrepancies with actual size. Using the distorted scanned image to re-obtain the pixel information of the target reference object allows for more accurate calculation of distance parameters based on the more accurate pixel information.

[0100] In one embodiment, in step S3, the deformation parameters of the target reference object are first determined based on the pixel information and the actual size. Then, when the deformation parameters exceed a third preset value, the scanning parameters are interpolated based on the deformation parameters to correct the deformation of the scanned image. Finally, the pixel information of the target reference object is reacquired based on the deformed scanned image to determine the range of the first direction distance parameter and the second direction distance parameter.

[0101] like Figure 4 As shown, if a 40GP standard container may be automatically identified in the image, the pixel point X corresponding to the container's length, the pixel point Y corresponding to its height, and the known actual dimensions of the 40GP container (length: 12.192 meters, height: 2.591 meters) can be obtained from the identification results. The following formula can then be used to determine whether the scanned image is distorted:

[0102]

[0103] In the above process, the height pixel Y corresponding to the length of the container in the scanned image can be either the height pixel near the X-ray source surface or the height pixel far from the X-ray source surface. Experiments show that using the height pixel near the X-ray source surface is more accurate in determining whether the image is distorted.

[0104] When e is within the deformation error range of ±ω (ω is the third preset value, such as 5%), such as e∈[1-ω,1+ω], the scanned image is considered to have no deformation or minimal deformation and does not require correction; if e<1-ω or e>1+ω, the scanned image is considered to have deformation and needs to be interpolated laterally or vertically according to the value of e to make the scanned image match the actual size and solve the image deformation problem.

[0105] The corrected scan image overcomes image distortion caused by scanning angle and container speed, and its pixel information more accurately reflects the actual dimensions of the cargo and target reference object. After distortion correction, distance parameters can be calculated from the corrected scan image.

[0106] Figure 5 This is a sub-flowchart of step S3 in one embodiment of this disclosure.

[0107] refer to Figure 5 In one exemplary embodiment of this disclosure, the target reference object includes a box-shaped compartment, and step S3 may include:

[0108] Step S31: Determine the outline pixel information of the box-shaped compartment based on the scanned image;

[0109] Step S32: Determine the length and height pixel information of the box-shaped compartment based on the outline pixel information;

[0110] Step S33: Determine the first direction distance parameter based on the actual length of the container cabin and the length pixel information;

[0111] Step S34: Determine the range of the second direction distance parameters based on the actual height of the box-shaped cabin and the height pixel information. The maximum value of the range of the second direction distance parameters is the height distance parameter of the near-ray source surface of the box-shaped cabin, and the minimum value of the range of the second direction distance parameters is the height distance parameter of the far-ray source surface of the box-shaped cabin.

[0112] In this embodiment, the first direction is parallel to the length of the container cabin, and the second direction is parallel to the height of the container cabin. The distance parameter refers to the number of pixels in the horizontal (first direction) and vertical (second direction) directions of the scanned image corresponding to a 1-meter length. The contour line pixel information is, for example,... Figure 4 The pixel information of the four outlines A, B, C, and D shown.

[0113] refer to Figure 5 and Figure 4 In the illustrated embodiment, since containers typically have fixed specifications, the actual length and height of the container can be determined based on the container information in the declaration information.

[0114] Now, assuming the actual dimensions of the container are length L and height H meters, the first and second directions can be calculated using formulas (2) to (4). Figure 4 Distance parameters (as shown):

[0115]

[0116]

[0117]

[0118] In the above formula, PixelX is the distance parameter in the first direction, PixelY1 is the maximum distance parameter in the second direction (i.e., the distance parameter at the height of the near-source surface), PixelY2 is the minimum distance parameter in the second direction (i.e., the distance parameter at the height of the near-source surface), X is the pixel point automatically detected in the first direction of the container, A1C1 is the number of pixels in the scanned image corresponding to the edge of the container's near-source surface AC, and B1D1 is the number of pixels in the scanned image corresponding to the edge of the container's far-source surface BD.

[0119] Set [PixelY2, PixelY1] to the range of second-direction distance parameters corresponding to the current scanned image and the cargo to be tested. This way, the size of the cargo to be tested can be estimated in subsequent processes, regardless of which side of the container the cargo to be tested is actually closer to or the distance from the X-ray emitting device 21.

[0120] In addition to setting container-type compartments, represented by shipping containers, as the target reference, one or more other items can also be set as the target reference.

[0121] When the target reference object is set to another item, it is necessary to ensure that the actual size of the target reference object or the actual distance between target reference objects can be obtained. Simultaneously, it is necessary to ensure that the scanning information of the target reference object can cover all possible distances between the goods under test and the radiation emitting device 21. For example, when the target reference object is a wheel, it is necessary not only to acquire scanning images of the wheel near the radiation source surface to cover scenarios where the goods under test are close to the radiation source surface, but also to acquire scanning images of the wheel far from the radiation source surface to cover scenarios where the goods under test are far from the radiation source. Therefore, the number of target reference objects in this embodiment can be one or more.

[0122] In some scenarios, pre-set reference objects include objects with predetermined morphological characteristics placed on the container cabin or the cargo to be tested before the inspection begins. Multiple small target reference objects with fixed spacing can be pre-set on the container cabin or truck. For example, before inspection, prominently protruding items, such as high-density, regularly shaped metal standard parts (with good image quality), can be installed at the four corners of the container's upper surface. The range of the first and second direction distance parameters of the scanned image is determined by comparing the actual spacing between the multiple target reference objects with the spacing between the multiple target reference objects on the scanned image.

[0123] In other embodiments, the target reference object can be directly set as packaging material that comes into direct contact with the goods to be tested, such as a packaging box with fixed specifications. When the goods to be tested are large appliances such as refrigerators and washing machines, using the packaging box as the target reference object can enable faster testing of the goods.

[0124] After the distance parameters are calculated by automatically identifying the standard distance (the size of the target reference object) or by manually specifying the target reference object, the current distance parameters can be accurately applied to the current scanned image. Since the cargo to be tested is located between the near-source region and the far-source region in the scanned image, a length or area range can be obtained based on the two distance parameters in the second direction.

[0125] In one embodiment, after obtaining the first direction distance parameter and the range of the second direction distance parameter, the system default distance parameter can be updated according to the distance parameter obtained in real time. For example, the first preset value and the second preset value in step S2 can be updated: the first preset value is updated according to the first direction distance parameter of the scanned image, and the second preset value is updated according to the range of the second direction distance parameter of the scanned image.

[0126] The first and second preset values ​​can be updated in real time after a set of first and second direction distance parameters and ranges are obtained, or they can be updated periodically based on the average value of multiple sets of first and second direction distance parameters and ranges or other statistical analysis values.

[0127] For example, when the image analysis is complete and the system is closed, the automatically recognized or manually corrected distance parameters can be written to the database for storage. The image analysis system can analyze the default distance parameters, automatically recognized and corrected distance parameters, and manually corrected distance parameters on a device-by-device basis to determine whether the deviation of a device's distance parameters exceeds a set threshold. For devices with excessive deviations, timely and effective alerts are provided, and the device operator can use this feedback to check and correct the relevant parameters.

[0128] In step S4, the first direction dimension and the second direction dimension range of the goods to be tested are determined based on the range of the first direction distance parameter and the second direction distance parameter of the scanned image and the pixel information of the goods to be tested in the scanned image.

[0129] Figure 6 This is a sub-flowchart of step S4 in one embodiment of this disclosure.

[0130] refer to Figure 6 In one embodiment, step S4 may include:

[0131] Step S41: Determine the size of the cargo in the first direction based on the ratio of the pixel information of the cargo in the first direction to the distance parameter in the first direction.

[0132] Step S42: Determine the minimum size of the cargo to be tested in the second direction based on the ratio of the pixel information of the cargo to be tested in the second direction to the maximum value of the distance parameter range in the second direction.

[0133] Step S43: Determine the maximum size of the cargo in the second direction based on the ratio of the pixel information of the cargo to be measured in the second direction to the minimum value of the distance parameter range in the second direction.

[0134] Step S44: Determine the second-direction dimension range of the goods to be measured based on the minimum and maximum dimensions.

[0135] exist Figure 6 In the illustrated embodiment, when the target reference is a box-shaped container, let the number of pixels of the cargo to be measured in the first direction be x, and the number of pixels in the second direction be y. The first-direction dimension L0 and the minimum dimension Hmin and the maximum dimension Hmax of the cargo in the second direction can be determined according to formulas (2) to (4) and the following formulas (5) to (7):

[0136]

[0137]

[0138]

[0139] Therefore, the first directional dimension L0 and the second directional dimension range [Hmin, Hmax] of the goods to be measured can be determined. For example, the second directional dimension range can be [1.1 meters, 1.2 meters].

[0140] The reason for determining a range of dimensions in the second direction, rather than directly determining the dimensions in the second direction, is that when the target reference is a container, if the cargo to be tested is loaded in a container much larger than its packaging dimensions, it may be closer to the side of the container near the X-ray source, or it may be closer to the side of the container away from the X-ray source. The height of the cargo in the scanned image will vary depending on the distance. Therefore, two dimensions in the second direction can be determined corresponding to these two extreme cases, thus ensuring that the actual dimensions of the cargo to be tested are within the range of the second direction corresponding to these two extreme cases.

[0141] After determining the range of the first and second dimensions of the goods to be measured, the maximum area of ​​the goods to be measured can be automatically calculated based on the maximum value of the first and second dimensions, and the minimum area of ​​the goods to be measured can be calculated based on the minimum value of the first and second dimensions, thereby determining the actual area range of the goods to be measured.

[0142] In this embodiment of the disclosure, the pixel information of the goods to be tested in the first direction and the pixel information in the second direction can be automatically identified by the system according to the packaging of the goods to be tested (e.g., a square box), or can be manually defined by the image analyst, so that the image analyst can obtain the dimensions to be measured according to actual needs, which can correspond to one or more goods to be tested.

[0143] Figure 7 This is a sub-flowchart of step S4 in another embodiment of this disclosure.

[0144] refer to Figure 7 In one exemplary embodiment of this disclosure, step S4 may further include:

[0145] Step S45: In response to the image capture command, determine the target area to be captured in the scanned image. The target area corresponds to one or more goods to be tested. The outline of the target area includes regular and irregular shapes.

[0146] Step S46: Determine the second direction dimension range corresponding to each preset dimension unit of the target area in the first direction, and the first direction dimension corresponding to each preset dimension unit of the target area in the second direction, based on the range of the first direction distance parameter and the second direction distance parameter.

[0147] Step S47: Determine the area range of the target region based on the second direction dimension range corresponding to each preset dimension unit in the first direction and the first direction dimension corresponding to each preset dimension unit in the second direction.

[0148] exist Figure 7In the illustrated embodiment, when an image analyst needs to measure the area of ​​a certain region in an image, they can manually take a screenshot to select the outline of the target region, such as a rectangular region, a circular region, an elliptical region, etc., and drag the mouse on the scanned image to obtain the region to be measured. Then, the distance parameter is used to calculate the corresponding areas of the near-source region and the far-source region to obtain the area measurement range of the region.

[0149] Specifically, the number of pixels corresponding to each row and each column in the scanned image can be determined based on the contour of the target region. Then, the actual size corresponding to each row of scanned information and each column of scanned information in the target region can be automatically determined based on the range of the first direction distance parameter and the second direction distance parameter calculated in step S2.

[0150] Regardless of whether the target region's outline is a regular or irregular shape, the system can automatically perform integration calculations on the actual dimensions of each row and each column, and then automatically calculate the actual area of ​​the target region based on double integrals. Since the actual dimensions in the second direction include two extreme cases, the final calculated actual area of ​​the target region is a range that includes both the maximum and minimum areas.

[0151] exist Figure 7 In the illustrated embodiment, image analysts can also set their own measurement line segments to estimate the distance between any two points in the scanned image. Assuming the endpoints M and N of the line segment set by the image analyst correspond to coordinate points M(x1,y1) and N(x2,y2) in the scanned image, since M and N are located between the near-source region and the far-source region in the scanned image, the distance l between M and N is... MN The following formula can be used to calculate:

[0152]

[0153]

[0154] l MN ∈[l1,l2] (10)

[0155] In step S4, it is determined whether the goods to be tested pass the inspection based on the first directional dimension and the second directional dimension range and the declaration information of the goods to be tested.

[0156] After determining the actual dimensions of the goods to be tested based on the declared information, the calculated actual dimensions can be compared with the actual dimensions in the declared information to determine whether the goods to be tested match the declared information. For example, the type of goods to be tested and the corresponding dimensional characteristics can be determined based on the declared information, and if the dimensions in the first and second directions meet the dimensional characteristics, the goods to be tested are deemed to have passed the inspection.

[0157] Taking a rectangular box with fixed dimensions as an example, assuming that the areas of the three sides of the box are S1, S2, and S3 (the areas of opposite sides of the six sides of the box are equal) according to the declaration information, the actual area range of the box is calculated to be [S4, S5]. If any of S1, S2, or S3 is within the range of [S4, S5], the box is judged to meet the declaration information; otherwise, the box is judged to not meet the declaration information.

[0158] For accurate detection, length and height information can also be directly compared. Assuming the lengths of the three sides of the packaging box are L1, L2, and L3, and the calculated first dimension of the packaging box is L4, and the second dimension range is [L5, L6], then if the difference between any of L1, L2, or L3 and L4 is less than a preset value (e.g., 1 cm), it is determined whether either of the other two dimensions falls within the [L5, L6] range. If either of the other two dimensions falls within the [L5, L6] range, the packaging box can be determined to match the declared information. If the differences between L1, L2, L3, and L4 are all greater than the preset value, or even if the difference between any of L1, L2, or L3 and L4 is less than the preset value, but the other two dimensions do not fall within the [L5, L6] range, then the packaging box can be directly determined to be inconsistent with the declared range.

[0159] In addition to determining the shape of the goods to be measured if they have regular contours, it is also possible to determine the shape of the goods to be measured if they have irregular contours (e.g., a bag of cotton). This can be done based on multiple dimensions of the goods in the first direction or multiple dimensions in the second direction (see reference). Figure 7 The example involves checking whether the goods meet the dimensions (bag size) specified in the declaration information. Furthermore, if the goods have unique outline dimensions (shape features), such as a convex packaging, the actual dimensions of the corresponding feature parts can be directly calculated, and the goods can then be inspected based on both the actual and calculated dimensions. The shape of the goods can vary, and those skilled in the art can pre-set size inspection schemes for multiple shape features, thereby automatically matching the size inspection scheme based on the shape features of the goods, improving customs clearance efficiency.

[0160] The determination of dimensional characteristics and area can be performed simultaneously or sequentially, and this disclosure is not limited to this.

[0161] Inspecting goods solely based on their external dimensions can be confusing when the packaging is generic (e.g., all are rectangular box-shaped). Therefore, in addition to judging their shape, embodiments of this disclosure can also estimate the weight of the goods.

[0162] Figure 8 This is a sub-flowchart of step S5 in one embodiment of this disclosure.

[0163] refer to Figure 8 In one exemplary embodiment of this disclosure, step S5 may include:

[0164] Step S51: Determine the type of goods to be tested and the density range corresponding to the type of goods based on the declaration information of the goods to be tested.

[0165] Step S52: Determine the volume range of the goods to be tested based on the first direction dimension, the second direction dimension range, and the dimensions of the specification container where the goods to be tested are located. The specification container includes a box-type compartment.

[0166] Step S53: Determine the first weight range of the goods to be tested based on the volume range and density range;

[0167] Step S54: Determine the second weight range of the goods to be tested based on the weight of the goods corresponding to the specified container.

[0168] Step S55: If the overlap rate between the second weight range and the first weight range is greater than a preset threshold, the goods to be tested are determined to have passed the inspection.

[0169] exist Figure 8 In the illustrated embodiment, the type and density range of the goods to be tested can be determined first based on the declaration information. For example, the density range of cotton is definitely less than that of household appliances. Then, the volume range of the goods to be tested can be estimated based on the two-dimensional dimension information calculated in the above steps.

[0170] Taking the example of the cargo to be tested being loaded in a container hold, when the cargo is loaded in a container hold, from... Figure 3As can be seen in the illustrated embodiment, it is impossible to determine whether the scanned image of the goods under test is the image of the side of the goods closest to the X-ray source or the image of the side of the goods far from the X-ray source (the goods under test do not have clear bottom edge scanning information like a container). Therefore, assuming the depth of the container in the third direction (i.e., perpendicular to the first and second directions) is D, we can first assume that the goods under test fill the container in the third direction (a common loading rule). Then, based on the maximum area of ​​the goods under test on the plane formed by the first and second directions and the depth D of the container, we calculate the maximum volume of the goods under test. Then, based on this area range and the preset minimum depth of the goods under test in the third direction, we calculate the minimum volume of the goods under test, thereby determining the volume range of the goods. The preset minimum depth of the goods under test in the third direction can be the possible packaging depth of the goods under test. For example, when the goods to be tested are determined to be cotton based on the declaration information and the packaging bag information is known, it can be found that when a packaging bag is filled with cotton, the maximum depth of the packaging bag in the third direction does not exceed a meter. Therefore, the volume of the packaging bag can be calculated based on the first direction dimension, the second direction dimension range, and a meter, and this volume can be set as the minimum volume of cotton in the box-type cabin.

[0171] Based on the minimum and maximum volume values ​​and the density of the goods to be tested, the first weight range [M1, M2] of the goods to be tested can be obtained. Then, based on whether the actual measured weight of the goods to be tested (e.g., the actual measured weight of the truck minus the standard net weight of the truck and the net weight of the container compartment equals the weight of the goods to be tested) falls within the first weight range, it can be determined whether the goods to be tested are consistent with the declared information.

[0172] In a simpler scenario, the goods to be tested are located in a standard package. According to the declaration information, the actual dimensions of the three sides of the standard package are L1, L2, and L3, respectively. The actual volume of the goods to be tested can be obtained directly from L1*L2*L3. Then, the weight range of the goods to be tested in a standard package can be calculated based on the density corresponding to the type of goods to be tested (which can be determined based on the gross weight and net weight of the goods). The declared weight range of the goods to be tested in the container compartment (standard container) is obtained based on the number of standard packages in the declaration information, which is the second weight range. Finally, the actual measured weight of the goods to be tested is determined to be within the second weight range to determine whether the goods to be tested conform to the declaration information.

[0173] In this embodiment of the disclosure, in addition to comparing the measured weight with the first weight range and the second weight range respectively to perform dual detection of the cargo weight, the first weight range calculated based on the scanned image and the second weight range calculated based on the declaration information can also be compared, and the cargo to be tested can be judged to be consistent with the declaration information based on whether the overlap rate between the two is greater than a preset threshold.

[0174] The above detection method can be used in scenarios where only one type of cargo to be tested exists in the container, or in scenarios where multiple types of cargo to be tested exist in the container. When multiple types of cargo to be tested exist in the container, the weight range corresponding to each type of cargo can be estimated using the above method. Then, the weight ranges corresponding to multiple types of cargo are added together to obtain the weight range of all cargo in the current container (first weight range, second weight range). Then, based on whether the actual detected weight of all cargo in the container is within this weight range, and whether the overlap between the first weight range and the second weight range exceeds a preset threshold, it is determined whether the cargo in the container matches the declared information. If the declared information corresponding to the image contains multiple product names, the system can provide prompts for the weight information corresponding to multiple product names to assist image analysts in making judgments.

[0175] The calculation of the size characteristics, area range, and weight range of the goods to be tested is performed automatically, and the comparison with the declaration information of the goods to be tested can also be performed automatically. Therefore, the method provided in this embodiment can greatly improve the detection efficiency.

[0176] It should be noted that the inspection of the goods under test using the size characteristics, area range, and weight range can be carried out simultaneously or separately, or the detection methods can be pre-set according to the packaging type or other characteristics of the goods under test. This disclosure does not impose any special restrictions on this.

[0177] When the image analysis is complete and the process is closed, the automatically recognized or manually corrected distance parameters can be automatically written to the database for storage. The system can analyze default distance parameters, automatically recognized and corrected distance parameters, and manually corrected distance parameters on a device-by-device basis. Based on set thresholds, it can determine the deviation of the device's distance parameters and provide timely and effective alerts for devices with excessive deviations. On-site equipment can use this feedback to check and correct relevant parameters. The corrected distance parameters can be fed back to the scanning equipment, allowing for timely detection and optimization of scanning equipment parameter issues, thus creating a continuous feedback loop for improvement and optimization.

[0178] Figure 9 This is a flowchart of the complete process for inspecting the goods to be tested in one embodiment of this disclosure.

[0179] refer to Figure 9 The process of inspecting the goods to be tested may include:

[0180] Step S901: Scan the vehicle loaded with the goods to be tested;

[0181] Step S902: Generate the original scanned image based on the scanned information;

[0182] Step S903: Automatically identify the length and shape of a preset reference object in the scanned image. If the length and shape of the preset reference object are identified, proceed to step S904; otherwise, proceed to step S909.

[0183] Step S904: Determine the target reference object and obtain the pixel information and actual size of the target reference object;

[0184] Step S905: Determine whether the current image is distorted based on the length and shape of the target reference object. If the image is distorted, proceed to step S906; otherwise, proceed to step S907.

[0185] Step S906: The deformed area is calibrated to its actual size using interpolation to correct the scanned image;

[0186] Step S907: Automatically calculate distance parameters based on the pixel information and actual size of the target reference object, and then proceed to step S908;

[0187] Step S908: Length, area, and weight are automatically estimated based on distance parameters and fed back to image analysts;

[0188] Step S909: Send the scanned image to the manual processing library;

[0189] Step S910: Determine whether a processing completion message has been received within a preset time period. If yes, return to step S904 and determine the target reference object based on the result of manual processing. If no, proceed to step S911.

[0190] Step S911: Use the default distance parameter as the distance parameter, and proceed to step S908;

[0191] Step S912: After the image analysis is completed, the system stores the distance parameters, and the process ends.

[0192] exist Figure 9 In the illustrated embodiment, after acquiring the scanned image, it is first determined whether a preset reference object can be identified. If identified, the preset reference object is set as the target reference object, and its actual size is obtained. If not identified, the scanned image can be directly displayed to the image analyst, allowing the analyst to manually set a specified reference object as the target reference object, or manually input the specified reference object and its corresponding actual size. After determining the target reference object and its actual size, distortion correction can be performed on the current image.

[0193] In step S908, the automatically estimated length, area, and weight can be based on the automatically identified shape of the goods to be measured, or on the range of the goods to be measured in the scanned image manually defined by the image analyst, as described in the above embodiment.

[0194] In step S912, the distance parameters stored in the system can be used as default distance parameters (i.e., the first preset value and the second preset value mentioned above) to directly participate in the identification of the target reference object in the next step, or even directly used to identify the next batch of goods to be tested. Alternatively, the default distance parameters can be updated based on the distance parameters stored multiple times. However, to ensure the accuracy of the identification results, it is best to calculate the distance parameters for each batch of goods to be tested and to detect the goods to be tested based on the real-time calculated distance parameters.

[0195] As can be seen from the above embodiments, the method provided in this disclosure uses image processing technology to calibrate the distance parameters (length, near-field height, far-field height) of the scanned image based on the scanned image of an automatically identified or manually selected target reference object. This eliminates deviations caused by equipment differences, equipment maintenance, and the parking position of vehicles during scanning, thereby enabling more accurate measurement of the length, area, and weight of objects in the scanned image. This assists image analysts in performing more accurate image analysis, thereby improving the accuracy of machine inspection. The method in this disclosure can be used not only for image processing during the generation of container and vehicle scanned images but also for image analysis in application software.

[0196] Corresponding to the above method embodiments, this disclosure also provides a cargo inspection device that can be used to perform the above method embodiments.

[0197] Figure 10 This is a block diagram of a cargo inspection device according to an exemplary embodiment of the present disclosure.

[0198] refer to Figure 10 The cargo inspection device 1000 may include:

[0199] The image acquisition module 101 is configured to acquire a scanned image of the goods to be tested through an image acquisition device;

[0200] Reference object positioning module 102 is configured to determine the target reference object in the scanned image;

[0201] The distance parameter calculation module 103 is configured to determine the range of the first direction distance parameter and the second direction distance parameter of the scanned image based on the pixel information of the target reference object and the actual size of the target reference object, wherein the second direction is perpendicular to the first direction.

[0202] The actual size calculation module 104 is configured to determine the first-direction size and the second-direction size range of the goods to be tested based on the range of the first-direction distance parameter and the second-direction distance parameter of the scanned image and the pixel information of the goods to be tested in the scanned image.

[0203] The size detection module 105 is configured to determine whether the goods to be tested pass the inspection based on the size range in the first direction and the size range in the second direction and the declaration information of the goods to be tested.

[0204] In one exemplary embodiment of this disclosure, the image acquisition device includes a radiation emitting device and a detector module disposed opposite to each other, the cargo to be tested is located between the radiation emitting device and the detector module, and the detector module is used to receive inspection radiation emitted by the radiation emitting device, the inspection radiation partially passing through the cargo to be tested.

[0205] In an exemplary embodiment of this disclosure, the target reference object includes a box-shaped cabin, and the distance parameter calculation module 103 is configured to: determine the outline pixel information of the box-shaped cabin based on the scanned image; determine the length pixel information and height pixel information of the box-shaped cabin based on the outline pixel information; determine the first direction distance parameter based on the actual length of the box-shaped cabin and the length pixel information; and determine the range of the second direction distance parameter based on the actual height of the box-shaped cabin and the height pixel information, wherein the maximum value of the second direction distance parameter range is the near-ray source surface height distance parameter of the box-shaped cabin, and the minimum value of the second direction distance parameter range is the far-ray source surface height distance parameter of the box-shaped cabin.

[0206] In an exemplary embodiment of this disclosure, the actual size calculation module 104 is configured to: determine the first-direction size of the cargo to be tested based on the ratio of pixel information of the cargo to be tested in a first direction to the first-direction distance parameter; determine the minimum size of the cargo to be tested in a second direction based on the ratio of pixel information of the cargo to be tested in a second direction to the maximum value of the range of the second-direction distance parameter; determine the maximum size of the cargo to be tested in a second direction based on the ratio of pixel information of the cargo to be tested in a second direction to the minimum value of the range of the second-direction distance parameter; and determine the second-direction size range of the cargo to be tested based on the minimum size and the maximum size.

[0207] In an exemplary embodiment of this disclosure, the actual size calculation module 104 is configured to: respond to an image cropping instruction, determine a target region to be cropped in the scanned image, the target region corresponding to one or more goods to be measured, the outline of the target region including regular and irregular shapes; determine a second directional size range corresponding to each preset size unit of the target region in the first direction and a first directional size corresponding to each preset size unit of the target region in the second direction based on the range of the first directional distance parameter and the second directional distance parameter; and determine the area range of the target region based on the second directional size range corresponding to each preset size unit of the target region in the first direction and the first directional size corresponding to each preset size unit of the target region in the second direction.

[0208] In one exemplary embodiment of this disclosure, the size detection module 105 is configured to: determine the type of goods to be tested and the size characteristics corresponding to the type of goods based on the declaration information of the goods to be tested; and determine that the goods to be tested pass the detection when the size range of the first direction and the size range of the second direction meet the size characteristics.

[0209] In an exemplary embodiment of this disclosure, the size detection module 105 is configured to: determine the type of goods to be tested and the density range corresponding to the type of goods based on the declaration information of the goods to be tested; determine the volume range of the goods to be tested based on the first directional dimension, the second directional dimension range, and the dimension of the specification container in which the goods to be tested are located, wherein the specification container includes a box-shaped compartment; determine a first weight range of the goods to be tested based on the volume range and the density range; determine a second weight range of the goods to be tested based on the weight of the goods corresponding to the specification container; and determine that the goods to be tested pass the detection if the overlap rate between the second weight range and the first weight range is greater than a preset threshold.

[0210] In one exemplary embodiment of this disclosure, the reference object positioning module 102 is configured to: identify a preset reference object in the scanned image; if the preset reference object is identified, set the preset reference object as a target reference object; if the preset reference object is not identified, send the scanned image to a manual processing library; in response to a processing completion message from the manual processing library, obtain reference object designation information corresponding to the scanned image, the reference object designation information including a designated reference object; and set the designated reference object as the target reference object.

[0211] In one exemplary embodiment of this disclosure, the reference designation information further includes actual size information corresponding to the designated reference object, wherein the actual size information includes a designated part mark of the designated reference object and the actual size corresponding to the designated part mark.

[0212] In one exemplary embodiment of this disclosure, the reference object positioning module 102 is configured to: if the processing completion message from the manual processing library is not obtained within a preset time period, use a first preset value as the first direction distance parameter of the scanned image, and use a second preset value as the second direction distance parameter of the scanned image.

[0213] In one exemplary embodiment of this disclosure, the preset reference object includes an object with preset morphological characteristics placed on the container compartment or the cargo to be tested before the start of the detection.

[0214] In one exemplary embodiment of this disclosure, the distance parameter calculation module 103 is configured to: update the first preset value according to the first direction distance parameter of the scanned image, and update the second preset value according to the range of the second direction distance parameter of the scanned image.

[0215] In an exemplary embodiment of this disclosure, the distance parameter calculation module 103 is configured to: determine the deformation parameter of the target reference object based on the pixel information and the actual size; when the deformation parameter exceeds a third preset value, perform interpolation processing on the scanning parameter based on the deformation parameter to correct the deformation of the scanned image; and re-acquire the pixel information of the target reference object based on the deformed scanned image to determine the range of the first direction distance parameter and the second direction distance parameter.

[0216] Since the functions of the device 1000 have been described in detail in their respective method embodiments, they will not be repeated here.

[0217] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0218] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0219] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”

[0220] The following reference Figure 11 To describe an electronic device 1100 according to this embodiment of the present invention. Figure 11 The electronic device 1100 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0221] like Figure 11 As shown, the electronic device 1100 is manifested in the form of a general-purpose computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processing unit 1110, at least one storage unit 1120, and a bus 1130 connecting different system components (including storage unit 1120 and processing unit 1110).

[0222] The storage unit stores program code that can be executed by the processing unit 1110, causing the processing unit 1110 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 1110 can perform the method shown in the embodiments of this disclosure.

[0223] Storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 11201 and / or cache memory 11202, and may further include a read-only memory (ROM) 11203.

[0224] Storage unit 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0225] Bus 1130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0226] Electronic device 1100 can also communicate with one or more external devices 1200 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1100, and / or any device that enables electronic device 1100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1150. Furthermore, electronic device 1100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1160. As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0227] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0228] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section of this specification.

[0229] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0230] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and concept of this disclosure are indicated by the claims.

Claims

1. A method for inspecting goods, characterized in that, include: A scanned image of the cargo to be tested is acquired by an image acquisition device, the image acquisition device including a radiation emitting device and a detector module arranged opposite to each other, and the cargo to be tested is located between the radiation emitting device and the detector module; Identify the target reference object in the scanned image; Determining the range of a first-direction distance parameter and a second-direction distance parameter of the scanned image based on the pixel information of the target reference object and the actual size of the target reference object includes: determining the height pixel information of the target reference object based on the scanned image; determining the range of the second-direction distance parameter based on the actual height of the target reference object and the height pixel information, wherein the maximum value of the range of the second-direction distance parameter is the near-ray source surface height distance parameter of the target reference object, and the minimum value of the range of the second-direction distance parameter is the far-ray source surface height distance parameter of the target reference object; the second direction is perpendicular to the first direction; Determining the first-direction dimension and the second-direction dimension range of the goods to be tested based on the first-direction distance parameter and the second-direction distance parameter range of the scanned image, includes: determining the minimum dimension of the goods to be tested in the second direction based on the ratio of the pixel information of the goods to be tested in the second direction to the maximum value of the second-direction distance parameter range; determining the maximum dimension of the goods to be tested in the second direction based on the ratio of the pixel information of the goods to be tested in the second direction to the minimum value of the second-direction distance parameter range; and determining the second-direction dimension range of the goods to be tested based on the minimum dimension and the maximum dimension. Based on the first directional dimension and the second directional dimension range and the declared information of the goods to be tested, it is determined whether the goods to be tested pass the inspection.

2. The cargo inspection method as described in claim 1, characterized in that, The detector module is used to receive inspection rays emitted by the radiation emitting device, and the inspection rays partially pass through the cargo to be tested.

3. The cargo inspection method as described in claim 1 or 2, characterized in that, The target reference object includes a box-shaped compartment. The range of the first direction distance parameter and the second direction distance parameter of the scanned image, determined based on the pixel information and actual size of the target reference object, includes: The outline pixel information of the box-shaped cabin is determined based on the scanned image; The length and height pixel information of the box-shaped cabin are determined based on the outline pixel information. The first directional distance parameter is determined based on the actual length of the box-shaped cabin and the length pixel information; The range of the second directional distance parameter is determined based on the actual height of the box-shaped cabin and the height pixel information. The maximum value of the range of the second directional distance parameter is the near-ray source surface height distance parameter of the box-shaped cabin, and the minimum value of the range of the second directional distance parameter is the far-ray source surface height distance parameter of the box-shaped cabin.

4. The cargo inspection method as described in claim 1, characterized in that, Based on the first direction distance parameter of the scanned image and the pixel information of the goods to be tested in the scanned image, the first direction dimension of the goods to be tested is determined, including: The first-direction dimension of the cargo under test is determined based on the ratio of the pixel information of the cargo under test in the first direction to the distance parameter in the first direction.

5. The cargo inspection method as described in claim 1 or 4, characterized in that, Based on the range of first-direction distance parameters and second-direction distance parameters in the scanned image, and the pixel information of the goods to be tested in the scanned image, the determination of the first-direction dimension and the second-direction dimension range of the goods to be tested includes: In response to an image cropping command, a target region to be cropped in the scanned image is determined. The target region corresponds to one or more of the goods to be tested. The outline of the target region includes regular and irregular shapes. Based on the first directional distance parameter and the second directional distance parameter range, determine the second directional size range corresponding to each preset size unit of the target region in the first direction, and the first directional size corresponding to each preset size unit of the target region in the second direction; The area range of the target region is determined based on the second direction dimension range corresponding to each preset dimension unit in the first direction and the first direction dimension corresponding to each preset dimension unit in the second direction.

6. The cargo inspection method as described in claim 1, characterized in that, Determining whether the goods to be tested pass the inspection based on the first directional dimension and the second directional dimension range and the declared information of the goods to be tested includes: The type of goods to be tested and the corresponding size characteristics of the goods to be tested are determined based on the declaration information of the goods to be tested. When the dimensions in the first direction and the second direction meet the size characteristics, the goods to be tested are determined to have passed the inspection.

7. The cargo inspection method as described in claim 1, characterized in that, Determining whether the goods to be tested pass the inspection based on the first directional dimension and the second directional dimension range and the declared information of the goods to be tested includes: The type of goods to be tested and the density range corresponding to the type of goods are determined based on the declared information of the goods to be tested. The volume range of the cargo to be tested is determined based on the first directional dimension, the second directional dimension range, and the dimensions of the specification container in which the cargo to be tested is located. The specification container includes a box-shaped compartment. The first weight range of the cargo to be tested is determined based on the volume range and the density range; The second weight range of the cargo to be tested is determined based on the cargo weight corresponding to the specified container specifications. If the overlap rate between the second weight range and the first weight range is greater than a preset threshold, the goods to be tested are determined to have passed the test.

8. The cargo inspection method as described in claim 1, characterized in that, Determining the target reference object in the scanned image includes: Identify a preset reference object in the scanned image; If the preset reference object is identified, the preset reference object is set as the target reference object; If the preset reference object is not identified, the scanned image is sent to the manual processing library; In response to the processing completion message from the manual processing library, reference object specification information corresponding to the scanned image is obtained, wherein the reference object specification information includes a specified reference object; Set the specified reference object as the target reference object.

9. The cargo inspection method as described in claim 8, characterized in that, The reference object designation information also includes the actual size information corresponding to the designated reference object, and the actual size information includes the designated part mark of the designated reference object and the actual size corresponding to the designated part mark.

10. The cargo inspection method as described in claim 8, characterized in that, Also includes: If the processing completion message from the manual processing library is not obtained within a preset time period, a first preset value is used as the first direction distance parameter of the scanned image, and a second preset value is used as the second direction distance parameter of the scanned image.

11. The cargo inspection method as described in claim 10, characterized in that, The range of the first direction distance parameter and the second direction distance parameter of the scanned image determined based on the pixel information of the target reference object and the actual size of the target reference object includes: The first preset value is updated based on the first direction distance parameter of the scanned image, and the second preset value is updated based on the range of the second direction distance parameter of the scanned image.

12. The cargo inspection method as described in claim 8, characterized in that, The preset reference objects include objects with preset shape characteristics that are placed on the container cabin or the cargo to be tested before the start of the test.

13. The cargo inspection method as described in claim 1, characterized in that, The range of the first direction distance parameter and the second direction distance parameter of the scanned image determined based on the pixel information of the target reference object and the actual size of the target reference object includes: The deformation parameters of the target reference object are determined based on the pixel information and the actual size. When the deformation parameter exceeds a third preset value, the scanning parameter is interpolated based on the deformation parameter in order to correct the deformation of the scanned image. The pixel information of the target reference object is re-acquired based on the deformed scanned image to determine the range of the first direction distance parameter and the second direction distance parameter.

14. A cargo inspection device, characterized in that, include: The scanning image acquisition module is configured to acquire a scanned image of the goods to be tested through an image acquisition device, the image acquisition device including a radiation emitting device and a detector module arranged opposite to each other, and the goods to be tested being located between the radiation emitting device and the detector module; The reference object positioning module is configured to determine the target reference object in the scanned image; The distance parameter calculation module is configured to determine the range of a first-direction distance parameter and a second-direction distance parameter of the scanned image based on the pixel information of the target reference object and the actual size of the target reference object. This includes: determining the height pixel information of the target reference object based on the scanned image; determining the range of the second-direction distance parameter based on the actual height of the target reference object and the height pixel information, wherein the maximum value of the range of the second-direction distance parameter is the near-ray source surface height distance parameter of the target reference object, and the minimum value is the far-ray source surface height distance parameter of the target reference object; the second direction is perpendicular to the first direction. The actual size calculation module is configured to determine the first-direction size and the second-direction size range of the goods to be tested based on the first-direction distance parameter and the second-direction distance parameter range of the scanned image and the pixel information of the goods to be tested in the scanned image. This includes: determining the minimum size of the goods to be tested in the second direction based on the ratio of the pixel information of the goods to be tested in the second direction to the maximum value of the second-direction distance parameter range; determining the maximum size of the goods to be tested in the second direction based on the ratio of the pixel information of the goods to be tested in the second direction to the minimum value of the second-direction distance parameter range; and determining the second-direction size range of the goods to be tested based on the minimum size and the maximum size. The size detection module is configured to determine whether the goods to be tested pass the inspection based on the size range in the first direction and the size range in the second direction and the declaration information of the goods to be tested.

15. An electronic device, characterized in that, include: Memory; as well as A processor coupled to the memory, the processor being configured to execute the cargo inspection method as described in any one of claims 1-13 based on instructions stored in the memory.

16. A computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the cargo inspection method as described in any one of claims 1-13.

Citation Information

Patent Citations

  • Method and device for correcting scanned image and image scanning system

    CN113077391A

  • To-be-detected article size automatic detection method for double-light-source X-ray security inspection machine

    CN113790685A

  • Security inspection equipment, article size determination method, storage medium and equipment

    CN113960075A