Object size measurement method and related device, security inspection machine and storage medium

By establishing the coordinate system of the target ellipse in the security inspection machine and mapping it, the problem that the physical radius cannot be accurately measured when the object to be measured is tilted, and accurate and convenient measurements are achieved in the tilt situation.

CN120063174AActive Publication Date: 2025-05-30IFLYTEK (SUZHOU) TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510543015.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-05-30
Estimated Expiration
2045-04-28

AI Technical Summary

Technical Problem

In the application scenario of security inspection machines, the object to be tested is usually not placed in a direction parallel to the security inspection channel, resulting in the inability to accurately measure the physical radius of the object through fixed points or scribing operations on the scan image.

Method used

By obtaining the detection results of the scanned image and the equipment parameters of the security check machine, a coordinate system of the target ellipse is established, and the mapping coefficient is calculated using the target angle and physical radius, the target ellipse is equivalent to the target circle, and the physical radius is solved in the second coordinate system based on the end point coordinates, equipment parameters and mapping coefficients.

Benefits of technology

When the object to be measured is inclined to the travel direction of the security check channel, the physical radius of the object can be accurately and conveniently measured, improving the convenience and accuracy of measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120063174A_ABST
    Figure CN120063174A_ABST
Patent Text Reader

Abstract

The invention discloses an object size measurement method, a related device, a security inspection machine and a storage medium, and the method comprises the steps: obtaining a detection result of a first scanning image, and obtaining equipment parameters of the security inspection machine; establishing a first coordinate system by taking the center of the target ellipse as an original point, the direction of a long axis of the target ellipse as a transverse axis and the direction of a short axis of the target ellipse as a longitudinal axis; obtaining a mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction based on the target included angle; wherein the target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius; and based on the endpoint coordinates, the equipment parameters and the mapping coefficient, solving in the second coordinate system to obtain the physical radius. According to the scheme, the physical radius of the to-be-measured object can be accurately and conveniently measured when the to-be-measured object is inclined to the advancing direction of the security check channel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of security inspection image processing, and in particular, to an object size measurement method, related device, security inspection machine, and storage medium. Background Art

[0002] As one of the standard configurations in places such as airports, subways, and logistics, the security inspection machine can penetrate the surface of an object to scan and image the object and its interior, and can help detect the size of the object being inspected in the above-mentioned places.

[0003] However, in application scenarios such as daily commuting, since the object to be measured is usually not required to be placed on the security inspection channel in a relatively regular manner parallel to the traveling direction of the security inspection channel, it is impossible to estimate the physical radius of the object to be measured through convenient operations such as fixing points and drawing lines on the scanned image. In view of this, how to accurately and conveniently measure the physical radius of the object to be measured when the object to be measured is placed obliquely to the traveling direction of the security inspection channel has become an urgent problem to be solved. Summary of the Invention

[0004] The main technical problem to be solved by the present application is to provide an object size measurement method, related device, security inspection machine, and storage medium, which can accurately and conveniently measure the physical radius of the object to be measured when the object to be measured is placed obliquely to the traveling direction of the security inspection channel.

[0005] To solve the above technical problem, a first aspect of the present application provides an object size measurement method, including: obtaining the detection result of the first scanned image and obtaining the device parameters of the security inspection machine; wherein, the first scanned image is obtained by the security inspection machine scanning the object to be measured on the security inspection channel, and the detection result includes: the target angle between the object to be measured and the traveling direction of the security inspection channel, and the endpoint coordinates of the relative endpoints of the object edge of the object to be measured in the vertical direction of the traveling direction; establishing a first coordinate system with the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis; wherein, the major axis is obtained based on the target angle and the physical radius of the object to be measured, the minor axis is the physical radius, the target ellipse is intercepted on the object to be measured by the plane where the first light ray and the second light ray are located, the first light ray and the second light ray are respectively tangent to the object to be measured and respectively form images to form relative endpoints; obtaining the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction based on the target angle; wherein, the target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius; solving for the physical radius in the second coordinate system based on the endpoint coordinates, device parameters, and mapping coefficient.

[0006] To solve the above technical problems, the second aspect of the present application provides an object size measurement device, including: a measurement preparation module, a coordinate establishment module, a coefficient determination module, and a radius solution module. The measurement preparation module is used to obtain the detection result of the first scanned image and obtain the device parameters of the security inspection machine; wherein, the first scanned image is obtained by the security inspection machine scanning the object to be measured on the security inspection channel, and the detection result includes: the target angle between the object to be measured and the traveling direction of the security inspection channel, and the endpoint coordinates of the relative endpoints of the object edge of the object to be measured in the vertical direction of the traveling direction. The coordinate establishment module is used to establish a first coordinate system with the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis; wherein, the major axis is obtained based on the target angle and the physical radius of the object to be measured, the minor axis is the physical radius, the target ellipse is intercepted on the object to be measured by the plane where the first light ray and the second light ray are located, and the first light ray and the second light ray are respectively tangent to the object to be measured and respectively form images to form relative endpoints. The coefficient determination module is used to obtain the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction based on the target angle; wherein, the target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius. The radius solution module is used to solve and obtain the physical radius in the second coordinate system based on the endpoint coordinates, the device parameters, and the mapping coefficient.

[0007] To solve the above technical problems, the third aspect of the present application provides an electronic device, at least including a memory and a processor coupled to each other. The memory stores at least program instructions, and the processor is used to execute the program instructions to implement the object size measurement method in the first aspect above.

[0008] To solve the above technical problems, the fourth aspect of the present application provides a security inspection machine, at least including the electronic device in the third aspect above.

[0009] To solve the above technical problems, the fifth aspect of the present application provides a computer-readable storage medium, storing program instructions that can be run by a processor, and the program instructions are used to implement the object size measurement method in the first aspect above.

[0010] For the above solution, obtain the detection result of the first scanned image and obtain the device parameters of the security inspection machine. The first scanned image is obtained by the security inspection machine scanning the object to be inspected on the security inspection passage. The detection result includes: the target angle between the object to be inspected and the traveling direction of the security inspection passage, and the endpoint coordinates of the object edge of the object to be inspected relative to the endpoints in the direction perpendicular to the traveling direction. Then, taking the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis, establish a first coordinate system. The major axis is obtained based on the target angle and the physical radius of the object to be inspected, and the minor axis is the physical radius. The target ellipse is intercepted on the object to be inspected by the plane where the first light ray and the second light ray are located. The first light ray and the second light ray are respectively tangent to the object to be inspected and respectively form images to form relative endpoints. Thus, based on the target angle, obtain the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction. The target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius. Furthermore, based on the endpoint coordinates, device parameters, and mapping coefficient, solve for the physical radius in the second coordinate system. On the one hand, when the object to be inspected is placed obliquely to the traveling direction of the security inspection passage, by detecting the target angle between the object to be inspected and the traveling direction of the security inspection passage, the first coordinate system where the actual target ellipse is formed is equivalent to the second coordinate system of the target circle, which helps to improve the convenience of measuring the physical radius. On the other hand, when solving for the radius in the second coordinate system, jointly solve by combining the actual detected endpoint coordinates in the first scanned image, the device parameters of the security inspection machine, and the mapping parameters determined by the target angle, which helps to improve the measurement accuracy of the physical radius. Therefore, it is possible to accurately and conveniently measure the physical radius of the object to be inspected when the object to be inspected is placed obliquely to the traveling direction of the security inspection passage. Description of the Drawings

[0011] Figure 1 is a schematic flowchart of an embodiment of the object size measurement method of the present application; Figure 2a is a schematic diagram of the effect of an embodiment of the first scanned image of the present application; Figure 2b is a schematic diagram of the effect of an embodiment of the object size measurement method of the present application; Figure 2c is a schematic diagram of the effect of another embodiment of the object size measurement method of the present application; Figure 2d is a schematic diagram of the effect of yet another embodiment of the object size measurement method of the present application; Figure 3 is a schematic framework diagram of an embodiment of the object size measurement device of the present application; Figure 4 is a schematic framework diagram of an embodiment of the electronic device of the present application; Figure 5 is a schematic framework diagram of an embodiment of the security inspection machine of the present application; Figure 6 It is a schematic framework diagram of an embodiment of the computer-readable storage medium of the present application. Detailed implementation manners

[0012] The following will combine with the accompanying drawings of the specification to elaborate on the solutions of the embodiments of the present application in detail.

[0013] In the following description, specific details such as specific system structures, interfaces, and technologies are proposed for the purpose of illustration rather than limitation, so as to thoroughly understand the present application.

[0014] In this article, the terms "system" and "network" are often used interchangeably. The term " / and" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the fragment " / " in this article generally represents an "or" relationship between the front and rear associated objects. In addition, "multiple" in this article means two or more than two.

[0015] Please refer to Figure 1 , Figure 1 It is a schematic flowchart of an embodiment of the object size measurement method of the present application. Specifically, it may include the following steps: Step S11: Obtain the detection result of the first scanned image and obtain the device parameters of the security inspection machine.

[0016] In the embodiments of the present disclosure, the first scanned image can be obtained by the security inspection machine scanning the object to be measured on the security inspection channel, and the detection result can specifically include: the target angle between the object to be measured and the traveling direction of the security inspection channel, and the endpoint coordinates of the relative endpoints of the object edge of the object to be measured in the vertical direction of the traveling direction. It should be noted that the object to be measured can be a columnar object, such as a bottle, etc., and the specific type of the object to be measured is not limited here. As a special example, the object to be measured can specifically be a cylindrical object.

[0017] In an implementation scenario, after obtaining the first scanned image, the first scanned image can be subjected to target detection to obtain the target area of the object to be measured in the first scanned image (such as the minimum circumscribed rectangle of the object to be measured). On this basis, the axis of the object to be measured can be determined with the assistance of the target area, so as to obtain the angle between the axis and the traveling direction as the target angle. Please continue to refer to Figure 2a , Figure 2a It is a schematic diagram of the effect of an embodiment of the first scanned image of the present application. As Figure 2a shown, Figure 2a the dashed box in Figure 2a is the target area, and the midline of the target area (such as the dashed line without an arrow inFigure 2a where θ. Of course, Figure 2a The illustration shown is only a possible example in the actual application process, and other possible situations will not be exemplified one by one here.

[0018] In one implementation scenario, as described above, after obtaining the first scanned image, the first scanned image can be subjected to object detection to obtain the target region of the object to be measured in the first scanned image (such as the minimum bounding rectangle of the object to be measured). On this basis, edge processing can be further performed in the target region to obtain the object edge of the object to be measured in the first scanned image, that is, in the direction perpendicular to the traveling direction, relative endpoints can be selected on the object edge of the object to be measured, and the coordinate difference between the relative endpoints can be obtained. It should be noted that the coordinate difference between the relative endpoints is more precisely the coordinate difference of the relative endpoints on the ordinate (i.e., the V coordinate difference). Please continue to refer to Figure 2a , Figure 2a The dashed box in is the target region. In the direction perpendicular to the traveling direction (such as Figure 2a the dashed line with an arrow attached in), relative endpoints P3 and P4 can be selected on the object edge of the object to be measured, and the difference in their ordinates (V coordinates) can be obtained as the coordinate difference between the relative endpoints. It should be noted that the object to be measured may not be a regular shape. For example, Figure 2a the object to be measured in is a thin neck and thick body. In order to make the finally measured physical radius more valuable as a reference, a regular region that occupies a relatively larger area can be determined on the object to be measured in the first scanned image (such as Figure 2a the bottle body region in, rather than the neck region), and then in the direction perpendicular to the traveling direction, relative endpoints are selected on the object edge of this regular region to obtain the coordinate difference of the relative endpoints. Of course, Figure 2a The illustration shown is only a possible example in the actual application process, and other possible situations will not be exemplified one by one here.

[0019] In one implementation scenario, the device parameters can be provided by the manufacturer for subsequent retrieval by burning them into the internal storage of the security inspection machine when it leaves the factory.

[0020] In another implementation scenario, the device parameters can also be obtained by pre-calibrating the security inspection machine based on the second scanned image of the calibration ruler placed on the security inspection channel, and the calibration ruler can be perpendicular to the traveling direction of the security inspection channel. More precisely, the extension direction of the calibration ruler can be perpendicular to the traveling direction of the security inspection machine. As a possible example in the actual application process, the light source of the security inspection machine can be an X-ray. Then, in order to improve the clarity of scanning the calibration ruler as much as possible, the calibration ruler can be a lead ruler or an X-ray developing ruler such as an impervious ray marking ruler. The specific type of the calibration ruler is not limited here.

[0021] In a specific implementation scenario, the device parameters may include the vertical distance from the light source to the security inspection channel. For the "vertical distance" in the device parameters, in order to calibrate the "vertical distance", a first algebraic expression can be constructed based on the physical height of the calibration ruler and the unknown quantity representing the vertical distance. The sum of the unknown quantity representing the vertical distance and the physical height can be obtained as the shortest distance, and then based on the unknown quantity representing the vertical distance and the shortest distance, the first algebraic expression can be obtained. That is to say, after obtaining the shortest distance containing the unknown quantity, the first algebraic expression can be constructed based on the ratio of the unknown quantity to the shortest distance. At the same time, based on the vertex coordinates of each vertex of the calibration ruler on the same cross-section in the second scanned image, the distance ratio between the first distance and the second distance can be obtained. Exemplarily, the difference in the vertex coordinates of the vertices on the top side of the cross-section can be obtained as the top side coordinate difference, and the difference in the vertex coordinates of the vertices on the bottom side of the cross-section can be obtained as the bottom side coordinate difference. On this basis, the distance ratio can be obtained based on the ratio of the top side coordinate difference to the bottom side coordinate difference. It should be noted that in the case of representing pixel coordinates by (U, V), unless otherwise specified in the embodiments of the present disclosure, when performing relevant calculations on pixel coordinates, it generally specifically refers to the ordinate (i.e., the V coordinate) among them. On this basis, a second function can be constructed based on the first algebraic expression and the distance ratio, and then the vertical distance can be obtained by solving based on the second function. It should be noted that the first algebraic expression represents the ratio of the vertical distance to the shortest distance from the light source to the plane where the top surface of the calibration ruler is located. The vertex coordinates of each vertex are respectively formed by the imaging of the light rays of each light source passing through the target edge on the calibration ruler. The target edge is perpendicular to the traveling direction. The first distance is the distance between the intersection points on the detector of the security inspection machine after the light rays of the light source pass through the target edge on the top surface of the calibration ruler, and the second distance is the distance between the intersection points on the detector after the light rays of the light source pass through the target edge on the bottom surface of the calibration ruler. For the convenience of understanding, please refer to Figure 2b , Figure 2b is a schematic diagram of the effect of an embodiment of the object size measurement method of the present application. As Figure 2b shown, the three thick lines from top to bottom respectively represent the image layer, the detector, and the security inspection channel. It should be noted that the detector is used to sense the light rays emitted by the light source to form corresponding pixels on the image layer. Since different materials have different light absorption rates, the detector can detect the energy of the received light rays to determine the differences between the materials through which different light rays pass, and then represent them in different grayscales or colors on the image layer. Among them, O represents the light source (i.e., regarded as a point light source), and the rectangle on the security inspection channel represents the cross-section of the calibration ruler. It should be noted that this cross-section is perpendicular to the extension direction of the calibration ruler. Please continue to refer to Figure 2b , A, B, C, and D are the four vertices on the cross-section, then AB represents the physical height of the calibration ruler, and OP represents the vertical distance from the light source to the security inspection channel, OP 2That is, it represents the shortest distance from the light source to the plane where the top surface of the calibration scale is located (i.e., the perpendicular distance from the light source to the plane where the top surface of the calibration scale is located). The vertex coordinates of vertex A are V a , and the vertex coordinates of vertex B are V b , and the vertex coordinates of vertex C are V c , and the vertex coordinates of vertex D are V d . The above vertex coordinates are respectively formed by the imaging of each light source ray passing through the target edge on the calibration scale. For example, the vertex coordinate V a is formed by the imaging of the light source ray OA passing through the target edge at point A (i.e., the edge line perpendicular to the paper plane at point A). The vertex coordinate V b is formed by the imaging of the light source ray OB passing through the target edge at point B (i.e., the edge line perpendicular to the paper plane at point B). The vertex coordinate V c is formed by the imaging of the light source ray OC passing through the target edge at point C (i.e., the edge line perpendicular to the paper plane at point C). The vertex coordinate V d is formed by the imaging of the light source ray OD passing through the target edge at point D (i.e., the edge line perpendicular to the paper plane at point D). The intersection point between the light source ray OB and the security inspection channel can be denoted as B 0 , and the intersection point with the detector can be denoted as B 1 , the intersection point between the light source ray OA and the detector can be denoted as A 1 , the intersection point between the light source ray OC and the security inspection channel can be denoted as C 0 , and the intersection point with the detector can be denoted as C 1 , the intersection point between the light source ray OD and the detector can be denoted as D 1 . In addition, the scaling factor between the image layer and the detector can be denoted as λ 1 , and the scaling factor between the detector and the security inspection channel can be denoted as λ 2 , then the overall scaling factor of the security inspection machine can be denoted as λ = λ 1 *λ 2 . According to the principle of similar triangles, it can be known that: B 0 C 0 / B 1 C 1 =OP / OP 1 AD / A 1 D 1 =OP / OP 1 By combining the above two equations, it can be obtained that: B 0 C 0 / B 1 C 1 =AD / A 1 D 1 That is to say: B 0 C 0 / AD = B 1 C 1 / A 1 D 1 Also, since AD = BC, the above equation can be transformed into: B 0 C 0 / BC = B 1 C 1 / A 1 D 1 In addition, according to the principle of similar triangles, it can also be known that: OP / OP 2 = B 0 C 0 / BC Combining the above two equations, we can get: OP / OP 2 = B 1 C 1 / A 1 D 1 Also, because: OP 2 = OP + PP 2 = OP + AB Combining the above two equations, we can get: OP / (OP + AB) = B 1 C 1 / A 1 D 1 Also, because: B 1 C 1 = λ 1 *(V b - V c ) A 1 D 1 = λ 1 *(V a - V d ) Therefore: B 1 C 1 / A 1 D 1 =(V b - V c ) / (V a - V d ) In the above equation, B 1 C1 is the first distance, A 1 D 1 is the second distance, B 1 C 1 / A 1 D 1 is the distance ratio between the first distance and the second distance. Among them, V b -V c represents the top edge coordinate difference, V a -V d represents the bottom edge coordinate difference.

[0022] Substitute the above formula into the previous OP / (OP + AB) = B 1 C 1 / A 1 D 1 in the formula, and we can get: OP / (OP + AB) = (V b -V c ) / (V a -V d ) The above formula is the second function. Among them, OP is the unknown quantity representing the vertical distance, AB represents the physical height. Therefore, OP / (OP + AB) is the first algebraic expression representing the ratio of the vertical distance to the shortest distance from the light source to the plane where the top surface of the calibration ruler is located. (V b -V c ) / (V a -V d ) is the distance ratio between the first distance and the second distance. Therefore, by solving the above second function, the vertical distance OP can be obtained: OP = (V b -V c ) * AB / (V a -V d + V b -V c ) In a specific implementation scenario, the device parameters may further include the imaging coordinates of the light source perpendicular to the security inspection channel for the outgoing light. For the "imaging coordinates" in the device parameters, in order to calibrate the "imaging coordinates", a second algebraic expression can be constructed based on the upper vertex coordinates and lower vertex coordinates of the calibration scale on the same high line on the target side in the second scanned image and the unknown quantity representing the imaging coordinates. Exemplarily, the difference between the upper vertex coordinates and the lower vertex coordinates can be obtained as the high line coordinate difference, and the difference between the upper vertex coordinates and the unknown quantity representing the imaging coordinates can be obtained as the target expression. On this basis, the second algebraic expression can be obtained based on the ratio of the high line coordinate difference to the target expression. At the same time, the numerical ratio between the physical height of the calibration scale and the vertical distance can be obtained. On this basis, a third function can be constructed based on the second algebraic expression and the numerical ratio, and then the imaging coordinates can be obtained by solving based on the third function. It should be noted that the target side is a side of the calibration scale close to the light source, the second algebraic expression represents the ratio of the third distance to the fourth distance, the upper vertex coordinates and the lower vertex coordinates are respectively formed by the imaging of each light source ray passing through the same high line, the third distance is the distance between the intersection points of the light source rays on the detector of the security inspection machine after passing through the same high line, and the fourth distance is the distance between the intersection point of the light source ray on the detector of the security inspection machine after passing through the upper vertex of the same high line and the intersection point of the outgoing light ray on the detector of the security inspection machine. For ease of understanding, please continue to refer to Figure 2b , P 1 is the intersection point of the outgoing light ray perpendicular to the security inspection channel of the light source O on the detector, and the imaging coordinates are V p . According to the principle of similar triangles: AB 0 / A 1 B 1 =OP / OP 1 PB 0 / P 1 B 1 =OP / OP 1 Combining the above two equations, we can get: AB 0 / A 1 B 1 =PB 0 / P 1 B 1 The above equation can be transformed into: AB 0 / PB 0 =A 1 B 1 / P 1 B 1 According to the principle of similar triangles, it can also be known that: AB 0 / PB 0 =AB / OP By combining the above two equations, we can obtain: A 1 B 1 / P 1 B 1 =AB / OP In the above formula, AB / OP represents the numerical ratio between the physical height of the calibration scale and the vertical distance. A 1 B 1 / P 1 B 1 represents the second algebraic expression. Among them, A 1 B 1 represents the distance between the intersection points on the detector of the security inspection machine after the light source light passes through the high line AB. P 1 B 1 represents the intersection point B on the detector of the security inspection machine after the light source light passes through the upper vertex B of the high line AB 1 and the intersection point P of the outgoing light on the detector of the security inspection machine 1 The distance between them. Further, for the second algebraic expression, since: A 1 B 1 =λ 1 *(V b -V a ) P 1 B 1 =λ 1 *(V p -V b ) In the above formula, V b -V a represents the difference between the vertex coordinate and the lower vertex coordinate (i.e., the high line coordinate difference). V p -V b represents the difference between the upper vertex coordinate and the unknown quantity representing the imaging coordinate (i.e., the target formula). Therefore, the second algebraic expression A 1 B 1 / P 1 B 1 can also be expressed as: A 1 B 1 / P 1 B 1 =(V b -V a ) / (V p -V b ) That is to say, the second algebraic expression can also be expressed as the ratio of the high line coordinate difference to the target formula. Therefore, the above formula A1 B 1 / P 1 B 1 = AB / OP can be reconstructed as: (V b -V a ) / (V p -V b ) = AB / OP The above equation is the third function. Solving the above third function can obtain the imaging coordinate V p : V p =(V b -V a )*OP / AB + V b In a specific implementation scenario, the device parameters can also include the scaling factor during the imaging of the security inspection machine. For the "scaling factor" in the device parameters, in order to calibrate the "scaling factor", the physical width of the calibration ruler can be obtained, and the vertex coordinate difference between the two vertices at the bottom edge of the calibration ruler in the same cross-section in the second scanned image can be obtained as the bottom edge coordinate difference. On this basis, the scaling factor can be obtained based on the ratio of the physical width to the bottom edge coordinate difference. It should be noted that the width direction of the calibration ruler is perpendicular to the extension direction of the calibration ruler and perpendicular to the height direction of the calibration ruler. Generally speaking, when the calibration ruler is placed flat, with the scale side facing, the height direction is the thickness direction of the calibration ruler, and the extension direction is the direction in which the scale index increases or decreases. Then the width direction is the direction in which the scale is engraved. For ease of understanding, please continue to refer to Figure 2b , the physical width of the calibration ruler is AD, and the physical width AD can be obtained by scaling A 2 to D 1 using the aforementioned scaling factor λ 1 : AD = λ 2 *A 1 D 1 In addition, as described above: A 1 D 1 = λ 1 *(V a -V d ) Combining the above two equations, we can obtain: AD = λ 2 *λ 1 *(V a -V d ) And because the scaling factor λ of the security inspection machine = λ 2 *λ 1, so the scaling factor λ of the security inspection machine can be expressed as: λ = AD / (V a - V d ) In the above formula, the two vertices at the bottom edge of the calibration ruler in the same cross-section are points A and D. Therefore, the difference between the vertex coordinates of the two can be expressed as V a - V d . That is to say, the physical width AD and the coordinate difference V of the bottom edge a - V d The ratio is denoted as the scaling factor λ.

[0023] In a specific implementation scenario, as mentioned above, the device parameters can also include the scaling factor when the security inspection machine forms an image. For the "scaling factor" in the device parameters, different from the aforementioned calibration method, in order to calibrate the scaling factor when the security inspection machine forms an image at the object to be measured, the first pixel coordinates of the upper boundary point of the object to be measured in the first scanned image can be detected. Exemplarily, the boundary points can include: in the target direction of the first scanned image, the first boundary point and the second boundary point on the object to be measured. The target direction is the placement direction of the calibration ruler on the security inspection channel, that is, the direction perpendicular to the traveling direction. It should be noted that after obtaining the first scanned image, target detection can be performed on the first scanned image to obtain the target area of the object to be measured in the first scanned image (such as the minimum bounding rectangle of the object to be measured). On this basis, the pixel points located on the boundary of the target area in the target direction can be selected, which are the first boundary point and the second boundary point. That is to say, the first boundary point and the second boundary point must satisfy being located on the target area (such as on the rectangle frame of the minimum bounding rectangle), and also satisfy forming a boundary in the target direction. Please continue to refer to Figure 2a , the dashed box is the target area, and P1 and P2 are the first boundary point and the second boundary point respectively. Of course, Figure 2aThe illustration is merely a possible example in the actual application process, and other possible cases will not be exemplified one by one here. In addition, for the first scale index corresponding to any boundary point, the second pixel coordinate of the scale line to which the first scale index belongs is not greater than the first pixel coordinate of the boundary point, and the scale line to which the first scale index belongs is closest to the boundary point. At the same time, the scale line sequence of the calibration ruler in the second scanned image can be detected, and the scale line sequence can include the second pixel coordinates of the scale lines on the calibration ruler, so that the scale line adjacent to the boundary point can be found in the scale line sequence based on the first pixel coordinate and the second pixel coordinate to obtain the first scale index. Furthermore, based on the first scale index, the physical distance between adjacent scale lines on the calibration ruler, and the pixel distance between boundary points, the scaling factor when the security inspection machine images the object to be inspected can be obtained. Before the security inspection machine inspects the object to be inspected, the calibration ruler can be placed on the security inspection machine first to obtain the second scanned image of the calibration ruler by the security inspection machine, and then detection (such as edge detection of the second scanned image) can be performed based on the second scanned image to obtain the scale line sequence. It should be noted that after the scale line sequence is detected, the security inspection machine can save the scale line sequence. Then, when an object to be inspected passes through the inspection and its size needs to be measured by the scanned image of the object to be inspected, the saved scale line sequence can be loaded. Of course, during this process, the calibration ruler does not need to be placed on the security inspection machine anymore to avoid affecting the security inspection due to the placement of the calibration ruler on the security inspection machine. As a possible implementation manner, when the accuracy requirement for the scaling factor is relatively loose, the product of the absolute difference of the first scale index and the physical distance can be obtained as the first distance, and then the ratio of the first distance to the pixel distance can be obtained as the scaling factor. It should be noted that the absolute difference of the first scale index is the absolute difference between the first scale indices of the aforementioned first boundary point and the second boundary point, and the pixel distance between boundary points is the pixel distance between the aforementioned first boundary point and the second boundary point (more precisely, the pixel distance in the target direction). Or, as another possible implementation manner, when the accuracy requirement for the scaling factor is relatively strict, after obtaining the first scale index, the difference between the first pixel coordinate and the second pixel coordinate of the first scale index can be obtained as the first difference, and the difference between the second pixel coordinate of the reference scale index and the second pixel coordinate of the first scale index can be obtained as the second difference, and the reference scale index is the scale index after the first scale index. On this basis, the ratio of the first difference to the second difference can be obtained as the additional scale index of the first scale index. It should be noted that the additional scale index is a floating-point value. After obtaining the additional scale index, the scaling factor when the security inspection machine images the object to be inspected can be obtained based on the first scale index, the additional scale index, the physical distance, and the pixel distance. For example, the second scale index can be obtained based on the first scale index and the additional scale index of the first scale index.Generally speaking, an additional scale index of the first scale index can be added to the first scale index to obtain a second scale index. On this basis, the product of the absolute difference of the second scale index and the physical distance can be obtained as the second distance, and the ratio of the second distance to the pixel distance can be obtained as the scaling factor.

[0024] It should be noted that the above examples are only several possible ways to obtain device parameters, and the ways to obtain device parameters are not limited herein. That is to say, whether the device parameters are obtained by reading the internal storage of the security inspection machine, or by calibration, or even by other possible ways not mentioned in the embodiments of the present disclosure, they can all be applied to the embodiments of the present disclosure to measure the physical radius of the object to be measured accordingly. In addition, during the security inspection process, the object to be measured can be placed at any position on the security inspection channel (such as a belt, etc.) (such as close to the light source, or far from the light source; or close to the midline of the security inspection channel, or far from the midline of the security inspection channel), so as to be conveyed from one end to the other end by the security inspection channel during the security inspection process.

[0025] Step S12: Establish a first coordinate system with the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis.

[0026] In the embodiments of the present disclosure, the major axis can be obtained based on the target angle and the physical radius of the object to be measured, the minor axis is the physical radius, the target ellipse can be intercepted on the object to be measured by the plane where the first light ray and the second light ray are located, the first light ray and the second light ray are respectively tangent to the object to be measured and respectively form opposite endpoints when imaging. It should be noted that since the object to be measured is inclined to the traveling direction of the security inspection channel, when the light source of the security inspection machine scans the object to be measured, the cross-section of its fan-shaped light beam on the object to be measured is elliptical. Therefore, when measuring the physical radius, the cross-section of the fan-shaped light beam where the two light rays forming the opposite endpoints in the first scanned image are located on the object to be measured can be used as the target ellipse. For the convenience of understanding, please refer to Figure 2c , Figure 2c is a schematic diagram of the effect of another embodiment of the object size measurement method of the present application. As Figure 2c shown, the three thick lines from top to bottom respectively represent the image layer, the detector, and the security inspection channel. The light source of the security inspection machine is usually located below its security inspection channel, denoted as O. The cross-section of the fan-shaped light beam where the first light ray OB and the second light ray OC are located on the object to be measured forms an ellipse as shown in Figure 2c shown, which can be used as the target ellipse. On this basis, the center O 1 of the target ellipse can be used as the origin, the direction of the major axis as the horizontal axis, and the direction of the minor axis as the vertical axis to establish a first coordinate system. That is to say, the center O 1 of the target ellipse has coordinates (0, 0) in the first coordinate system. Of course,Figure 2c The example shown is only one possible example in actual application, and other possible situations where the object to be tested is placed on the security inspection channel are not listed one by one here.

[0027] Step S13: Based on the target angle, obtain the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction.

[0028] In the embodiment of the present disclosure, the target ellipse is equivalent to a target circle in the second coordinate system, and the radius of the target circle is the physical radius. It should be noted that since the major axis can be expressed as the ratio of the cosine value of the minor axis and the target angle, the minor axis can be expressed as the physical radius. Figure 2a , Figure 2c and Figure 2d , Figure 2d FIG. 1 is a schematic diagram showing the effect of another embodiment of the object size measurement method of the present application. Figure 2a and Figure 2c As shown, the major axis and minor axis can be expressed as: a=r / cos(θ) b=r Since the major axis direction is the horizontal axis direction of the first coordinate system, and the minor axis direction is the vertical axis direction of the first coordinate system, the target ellipse in the first coordinate system can be expressed as:

[0029] On this basis, the expressions of the major axis and minor axis can be substituted into the above formula to obtain:

[0030] That is:

[0031] Therefore, we can set: X = xcos(θ), Y = y, and the above formula can be transformed into: X 2 +Y 2 =r 2 , so it can be regarded as that the first coordinate system is mapped in its horizontal axis direction by the mapping coefficient cos(θ), and there is no need to remap in its vertical axis direction to obtain the second coordinate system in which the target ellipse is equivalent to the target circle, that is, Figure 2d The second coordinate system with the center E of the target circle as the coordinate origin is shown in . That is to say, in the embodiment of the present disclosure, the mapping coefficient can specifically be the cosine value of the target angle. It should be noted that the mapping coefficient cos(θ) is mainly used for mapping in the horizontal axis direction, while remaining unchanged in the vertical axis direction, so as to make the target ellipse equivalent to the target circle, thereby reducing the calculation complexity as much as possible. The following specifically describes how the mapping coefficient cos(θ) affects the calculation in the horizontal axis direction.

[0032] Step S14: Based on the endpoint coordinates, device parameters, and mapping coefficients, solve for the physical radius in the second coordinate system.

[0033] Specifically, as described above, the device parameters may include the vertical distance from the light source to the security inspection channel, the imaging coordinates of the light rays emitted perpendicularly to the security inspection channel by the light source, and the scaling factor during the imaging of the security inspection machine. Then, based on the endpoint coordinates, scaling factor, and mapping coefficients, the physical distance in the second coordinate system between the first intersection point of the first light ray on the security inspection channel and the second intersection point of the second light ray on the security inspection channel can be obtained. The endpoint coordinates are respectively formed by the imaging of the first light ray and the second light ray. Thus, based on the endpoint coordinates, imaging coordinates, scaling factor, vertical distance, and mapping coefficients, the first sine value and the second sine value of the first angle and the second angle between the first light ray and the second light ray and the security inspection channel in the second coordinate system can be obtained. Furthermore, based on the physical distance, vertical distance, first sine value, and second sine value, the physical radius can be obtained. In the above manner, by combining the endpoint coordinates, scaling factor, and mapping coefficients, the physical distance in the second coordinate system between the intersection points of the light source rays forming the endpoint coordinates on the security inspection channel is obtained, and by combining the endpoint coordinates, imaging coordinates, scaling factor, vertical distance, and mapping coefficients, the sine values of the angles between the light source rays forming the endpoint coordinates and the security inspection channel in the second coordinate system are obtained, so as to further obtain the physical radius in the second coordinate system by combining the vertical distance and the obtained physical distance and sine values. Therefore, the radius can be solved from a geometric perspective.

[0034] In an implementation scenario, the endpoint coordinates may include the first endpoint coordinates formed by the imaging of the first light ray and the second endpoint coordinates formed by the imaging of the second light ray. For ease of understanding, please refer to Figure 2c and Figure 2d , such as Figure 2c where the first light ray OB and the second light ray OC in b each form endpoint coordinates V c . Figure 2c The effect example in the first coordinate system shown in Figure 2d , for the equivalent in the second coordinate system, please refer to Figure 2d where the first light ray OB and the second light ray OC in b each form endpoint coordinates V c . In addition, for ease of description, the endpoint coordinates of the relative endpoints can be expressed as including the first endpoint coordinates formed by the imaging of the first light ray (such as Figure 2c , Figure 2d where V b ) and the second endpoint coordinates formed by the imaging of the second light ray (such as Figure 2c , Figure 2d where V c ).

[0035] In an implementation scenario, to obtain the physical distance between the first intersection point of the first light ray on the security inspection channel and the second intersection point of the second light ray on the security inspection channel in the second coordinate system, the first coordinate difference between the first endpoint coordinate and the second endpoint coordinate can be obtained, and then the first coordinate difference can be scaled based on the scaling coefficient to obtain the physical distance between the first intersection point and the second intersection point in the first coordinate system. Furthermore, the physical distance in the first coordinate system can be mapped based on the mapping coefficient to obtain the physical distance between the first intersection point and the second intersection point in the second coordinate system. For ease of understanding, please continue to refer to Figure 2c and Figure 2d , such as Figure 2c in which the first intersection point of the first light ray on the security inspection channel is point B, and the second intersection point of the second light ray on the security inspection channel is point C. Therefore, the physical distance between the first intersection point of the first light ray on the security inspection channel and the second intersection point of the second light ray on the security inspection channel can be expressed as: BC = λ(V b - V c ) In the above formula, BC represents the physical distance between the first intersection point of the first light ray on the security inspection channel and the second intersection point of the second light ray on the security inspection channel in the first coordinate system, λ represents the scaling coefficient, and V b - V c represents the first coordinate difference. Further, please continue to refer to Figure 2d , after obtaining the physical distance in the first coordinate system, it can be mapped using the mapping coefficient to obtain the physical distance in the second coordinate system: BC = λ(V b - V c ) * cos(θ) = λ(V b - V c ) * cos(θ) In the above formula, cos(θ) represents the mapping coefficient. That is to say, the physical distance in the second coordinate system can be directly obtained by multiplying the physical distance in the first coordinate system by the mapping coefficient. In the above manner, the endpoint coordinates include the first endpoint coordinates formed by the imaging of the first light ray and the second endpoint coordinates formed by the imaging of the second light ray. The first coordinate difference between the first endpoint coordinates and the second endpoint coordinates is obtained, and then the first coordinate difference is scaled based on the scaling coefficient to obtain the physical distance between the first intersection point and the second intersection point in the first coordinate system. Furthermore, based on the mapping coefficient, the physical distance in the first coordinate system is mapped to obtain the physical distance between the first intersection point and the second intersection point in the second coordinate system. Therefore, the coordinate difference can be scaled by the scaling coefficient first and then mapped by the mapping coefficient to determine the physical distance between the first intersection point of the first light ray on the security inspection channel and the second intersection point of the second light ray on the security inspection channel in the second coordinate system, which can conveniently determine the physical distance between the intersection points of the light source rays forming the endpoint coordinates in the second coordinate system on the security inspection channel.

[0036] In an implementation scenario, in order to obtain the first sine value of the first included angle between the first light ray and the security inspection channel in the second coordinate system and the second sine value of the second included angle between the second light ray and the security inspection channel in the second coordinate system, the second coordinate difference between the target endpoint coordinates and the imaging coordinates can be obtained first, so that the second coordinate difference can be scaled based on the scaling coefficient to obtain the target distance between the intersection point of the target light ray on the security inspection channel and the intersection point of the outgoing light ray on the security inspection channel in the first coordinate system. Furthermore, based on the vertical distance and the target distance, the target sine value of the target included angle between the target light ray and the security inspection channel in the second coordinate system can be obtained. It should be noted that the target endpoint coordinates are formed by the imaging of the target light ray. When the target light ray is the first light ray, the target included angle is the first included angle and the target sine value is the first sine value. When the target light ray is the second light ray, the target included angle is the second included angle and the target sine value is the second sine value. In the above manner, by obtaining the coordinate difference between the target endpoint coordinates and the imaging coordinates of the security inspection machine, and scaling it first by the scaling coefficient and then mapping it by the mapping coefficient, combined with the vertical distance from the light source to the security inspection channel, the target sine value can be obtained, which can conveniently solve the problem equivalent to the target circle by combining the scaling coefficient and the mapping coefficient to determine the target sine value.

[0037] In a specific implementation scenario, first, based on the ratio of the vertical distance to the target distance in the second coordinate system, the target tangent value of the target angle in the second coordinate system can be obtained. Then, based on the target tangent value, trigonometric function conversion is performed to obtain the target sine value of the target angle in the second coordinate system. That is to say, by using the conversion relationship between sine and tangent, the target tangent value can be converted to obtain the target sine value. It should be noted that for the conversion relationship between sine and tangent, the technical details of trigonometric function conversion can be referred to and will not be elaborated here. The above method first obtains the target tangent value of the target angle in the second coordinate system based on the ratio of the vertical distance to the target distance, and then performs trigonometric function conversion based on the target tangent value to obtain the target sine value of the target angle in the second coordinate system. It can utilize the trigonometric function to convert from tangent to sine, which helps to improve the simplicity of determining the target sine value.

[0038] In a specific implementation scenario, please continue to refer to Figure 2c and Figure 2d , taking the first light ray OB as the target light ray as an example. At this time, the first endpoint coordinate V b formed by its imaging is the target endpoint coordinate, and the angle β 1 between it and the security inspection passage is the target angle. At this time, the second coordinate difference V p between it and the imaging coordinate V p -V b can be obtained, and the second coordinate difference V p -V b is scaled based on the scaling coefficient λ to obtain the target distance BP in the first coordinate system between the intersection point B of the target light ray OB on the security inspection passage and the intersection point P of the outgoing light ray OP on the security inspection passage: BP = λ * (V p -V b ) On this basis, the target distance in the first coordinate system can be mapped using the mapping coefficient cos(θ) to obtain the target distance in the second coordinate system between the intersection point B of the first light ray OB on the security inspection passage and the intersection point P of the outgoing light ray on the security inspection passage: BP = λ * (V p -V b ) * cos(θ) In the above formula, cos(θ) represents the mapping coefficient. That is to say, the mapping can be directly achieved by multiplying the mapping coefficient cos(θ) by the target distance in the first coordinate system, and then the target distance in the second coordinate system can be obtained. On this basis, based on the ratio of the vertical distance OP to the target distance BP in the second coordinate system, the target tangent value of the target angle β 1 can be obtained: tan(β 1) = OP / BP = OP / [λ * (V p - V b ) * cos(θ)] It can be seen that the target tangent value of the target angle after the target ellipse is equivalent to the target circle is actually the target tangent value of the target angle when the object to be measured is placed parallel to the traveling direction of the security inspection channel divided by the mapping coefficient cos(θ). Further, based on the target tangent value of the target angle β 1 , trigonometric function conversion can be performed to obtain the target sine value (i.e., the first sine value) of the target angle β 1 in the second coordinate system:

[0039] In a specific implementation scenario, please continue to refer to Figure 2c and Figure 2d . Taking the second light ray OC as the target light ray as an example, at this time, the second endpoint coordinate V c formed by its imaging is the target endpoint coordinate, and the angle α 1 between it and the security inspection channel is the target angle. At this time, the second coordinate difference V p between it and the imaging coordinate V p - V c can be obtained, and the second coordinate difference V p - V c is scaled based on the scaling coefficient λ to obtain the target distance CP in the first coordinate system between the intersection point C of the target light ray OC on the security inspection channel and the intersection point P of the outgoing light ray OP on the security inspection channel: CP = λ * (V p - V c ) On this basis, the mapping coefficient cos(θ) can be used to map the target distance in the first coordinate system to obtain the target distance in the second coordinate system between the intersection point C of the second light ray OC on the security inspection channel and the intersection point P of the outgoing light ray on the security inspection channel: CP = λ * (V p - V c ) * cos(θ) In the above formula, cos(θ) represents the mapping coefficient. That is to say, the mapping coefficient cos(θ) can be directly multiplied by the target distance in the first coordinate system to achieve the mapping, and then the target distance in the second coordinate system can be obtained. On this basis, based on the ratio of the vertical distance OP to the target distance CP, the target tangent value of the target angle α 1 in the second coordinate system can be obtained: tan(α 1 ) = OP / CP = OP / [λ * (V p - Vc ) * cos(θ) It can be seen that the target tangent value of the target angle after the target ellipse is equivalent to the target circle is essentially the target tangent value of the target angle when the object to be measured is placed parallel to the traveling direction of the security inspection channel divided by the mapping coefficient cos(θ). Further, based on the target tangent value of the target angle α 1 , trigonometric function conversion can be performed to obtain the target sine value (i.e., the second sine value) of the target angle α 1 :

[0040] It should be noted that the first angle β 1 between the first light ray and the security inspection channel is the angle β 2 P 2 between the first light ray and the virtual plane C 0 passing through the center E of the object to be measured and parallel to the security inspection channel. The second angle α 1 between the second light ray and the security inspection channel is the angle α 2 P 2 between the second light ray and the virtual plane C 0 passing through the center E of the object to be measured and parallel to the security inspection channel. Therefore: sin(α 0 ) = sin(α 1 ) sin(β 0 ) = sin(β 1 ) In an implementation scenario, as a possible implementation method, after obtaining the physical distance in the second coordinate system and the first sine value and the second sine value in the second coordinate system, after obtaining the second sine value sin(α 1 ), the arcsine function can be used to process it to obtain the angle value of the second angle α 1 . Then, the complementary angle C 2 CB of the second angle can be obtained accordingly (i.e., subtracting the angle value of the first angle α 1 from 180 degrees). Since half of this complementary angle (not shown, denoted as γ 1 ) forms one of the acute angles of a right triangle with CE as the hypotenuse and the radius perpendicular to the security inspection channel as one of the right sides. For the sake of easy description, the intersection point of the center E perpendicular to the security inspection channel on the security inspection channel can be denoted as point F (to avoid interference with the second angle α 1 in Figure 2c , point F is not shown). Therefore, the ratio of the physical radius r to CF is the tangent value of half of this complementary angle γ 1 : tan(γ 1) = r / CF That is, CF = r / tan(γ 1 )

[0041] Meanwhile, after obtaining the second sine value sin(β 1 ), the arcsine function can be used to process it to obtain the angle value of the first included angle β 1 , and then take half of this angle value (not shown, denoted as γ here for the convenience of explanation 2 ). Since half of the first included angle forms one of the acute angles of a right triangle with BE as the hypotenuse and the radius perpendicular to the security inspection passage as one of the right sides. As mentioned above, the intersection point of the center E perpendicular to the security inspection passage on the security inspection passage can be denoted as point F. Therefore, the ratio of the physical radius r to BF is the tangent value of half of the angle value of the first included angle γ 2 : tan(γ 2 ) = r / BF That is, BF = r / tan(γ 2 ). In addition, since the physical distance BC between the first intersection point of the first light ray on the security inspection passage and the second intersection point of the second light ray on the security inspection passage is BC = CF + BF, it can be obtained that: BC = CF + BF = r / tan(γ 1 ) + r / tan(γ 2 ) That is: r = BC / (1 / tan(γ 1 ) + 1 / tan(γ 2 )) = λ(V b - V c ) * cos(θ) / (1 / tan(γ 1 ) + 1 / tan(γ 2 )) In one implementation scenario, as another possible implementation, after obtaining the physical distance in the second coordinate system and the first sine value and the second sine value in the second coordinate system, a first formula with the physical radius as an unknown quantity can be constructed based on the first sine value and the second sine value, and a second formula with the physical radius as an unknown quantity can be constructed based on the vertical distance, so that a first function with the physical radius as an unknown quantity can be constructed based on the ratio of the physical distance to the first formula and the ratio of the vertical distance to the second formula, and then the physical radius of the object to be measured can be obtained by solving based on the first function. It should be noted that the first formula represents the physical length of the first line segment in the second coordinate system, and the first line segment is formed by the intersection of the first light ray and the second light ray on the virtual plane, respectively, and the virtual plane passes through the center of the object to be measured and is parallel to the security inspection channel. The second formula represents the physical length of the second line segment, and the second line segment is a vertical line segment from the light source to the virtual plane. The above method constructs a first function with the physical radius as the unknown quantity based on the ratio of the physical distance to the first formula and the ratio of the vertical distance to the second formula, and solves the first function to obtain the physical radius of the object to be measured. The first formula represents the physical length of the first line segment in the second coordinate system, and the second formula represents the physical length of the second line segment. The function can be solved from a geometric perspective to obtain the physical radius of the object to be measured.

[0042] In a specific implementation scenario, in order to construct the first formula, a first subformula can be constructed based on the first sine value and the unknown quantity representing the physical radius, and a second subformula can be constructed based on the second sine value and the unknown quantity representing the physical radius, and the first subformula represents the physical length from the intersection point of the first ray on the virtual plane to the center in the second coordinate system, and the second subformula represents the physical length from the intersection point of the second ray on the virtual plane to the center in the second coordinate system. Please refer to Figure 2d , the virtual plane is C 2 P 2 , the first ray OB is on the virtual plane C 2 P 2 Upper intersection point B 2 Physical length EB to center E 2 It can be expressed as: EB 2 =r / sin(β 0 ) From this we can get the first minor formula r / sin(β 1 ). Similarly, the second light OC is on the virtual plane C 2 P 2 Upper intersection point C 2 Physical length EC to center E 2 It can be expressed as: EC 2 =r / sin(α 0 ) The second minor can thus be obtained as r / sin(α 1 )). Since the first light ray OB and the second light ray OC intersect at points B 2 and C 2 on the virtual plane respectively, forming the first line segment B 2 C 2 , the sum of the first minor and the second minor is thus the first expression: B 2 C 2 = EB 2 + EC 2 = r / sin(β 0 )+ r / sin(α 0 ) In a specific implementation scenario, to construct the second expression, it can be specifically based on the sum of the vertical distance and the unknown quantity representing the physical radius to construct the second expression. Please refer to Figure 2d for the physical length of the vertical line segment (i.e., the second line segment) OP from the light source O to the virtual plane 2 . The second expression can be represented as OP + r.

[0043] In a specific implementation scenario, after obtaining the first expression and the second expression, the first function with the physical radius r as the unknown quantity can be constructed: BC / B 2 C 2 = OP / (OP + r) That is to say: BC / (r / sin(β 0 )+ r / sin(α 0 )) = OP / (OP + r) Therefore, the physical radius r can be solved as follows: r = λ*(V b - V c )*cos(θ)*OP / (OP*ω - λ*(V b - V c )) where ω = 1 / sin(β 0 )+ 1 / sin(α 0 ). To facilitate the understanding of the above calculation process, please continue to refer to Figure 2c . According to the principle of similar triangles, it can be known that: BC / B 2 C 2 = OP / (OP + PP 2 ) = OP / (OP + r) As known from the above, B 2 C 2= EB 2 + EC 2 = r / sin(β 0 )+ r / sin(α 0 )=r*ω Therefore, by combining the above two equations, we can obtain: BC / (r*ω)= OP / (OP+r) Therefore, the physical radius r can be obtained: r=BC*OP / (OP*ω - BC) Also, because: BC=λ*(V b -V c )*cos(θ) Finally, the physical radius r can be obtained: r=λ*(V b -V c ) *cos(θ)*OP / (OP*ω - λ*(V b -V c ) *cos(θ)) It should be noted that the above examples are only several possible examples of mapping from the first coordinate system of the target ellipse to the second coordinate system of the target circle to solve the physical radius of the object to be measured. Other possible solution methods are not limited here and will not be exemplified one by one.

[0044] For the above solution, obtain the detection result of the first scanned image and the device parameters of the security inspection machine. The first scanned image is obtained by scanning the object to be inspected on the security inspection channel. The detection result includes: the target angle between the object to be inspected and the traveling direction of the security inspection channel, and the endpoint coordinates of the relative endpoints of the object edge of the object to be inspected in the direction perpendicular to the traveling direction. Then, taking the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis, establish the first coordinate system. The major axis is obtained based on the target angle and the physical radius of the object to be inspected, and the minor axis is the physical radius. The target ellipse is intercepted on the object to be inspected by the plane where the first light ray and the second light ray are located. The first light ray and the second light ray are respectively tangent to the object to be inspected and respectively form images to form relative endpoints. Thus, based on the target angle, obtain the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction. The target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius. Furthermore, based on the endpoint coordinates, device parameters, and mapping coefficient, solve for the physical radius in the second coordinate system. On the one hand, when the object to be inspected is placed obliquely to the traveling direction of the security inspection channel, by detecting the target angle between the object to be inspected and the traveling direction of the security inspection channel, the first coordinate system where the target ellipse is actually formed is equivalent to the second coordinate system of the target circle, which helps to improve the convenience of measuring the physical radius. On the other hand, when solving for the radius in the second coordinate system, jointly solve by combining the actually detected endpoint coordinates in the first scanned image, the device parameters of the security inspection machine, and the mapping parameters determined by the target angle, which helps to improve the measurement accuracy of the physical radius. Therefore, it is possible to accurately and conveniently measure the physical radius of the object to be inspected when the object to be inspected is placed obliquely to the traveling direction of the security inspection channel.

[0045] Please refer to Figure 3 , Figure 3It is a schematic diagram of the framework of an embodiment of the object size measurement device of the present application. The object size measurement device 30 includes: a measurement preparation module 31, a coordinate establishment module 32, a coefficient determination module 33, and a radius solution module 34. The measurement preparation module 31 is configured to obtain the detection result of the first scanned image and obtain the device parameters of the security inspection machine. Among them, the first scanned image is obtained by scanning the object to be measured on the security inspection channel by the security inspection machine, and the detection result includes: the target angle between the object to be measured and the traveling direction of the security inspection channel, and the endpoint coordinates of the relative endpoints of the object edge of the object to be measured in the vertical direction of the traveling direction. The coordinate establishment module 32 is configured to establish a first coordinate system with the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis. Among them, the major axis is obtained based on the target angle and the physical radius of the object to be measured, the minor axis is the physical radius, the target ellipse is intercepted on the object to be measured by the plane where the first light ray and the second light ray are located, and the first light ray and the second light ray are respectively tangent to the object to be measured and respectively form images to form relative endpoints. The coefficient determination module 33 is configured to obtain the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction based on the target angle. Among them, the target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius. The radius solution module 34 is configured to solve and obtain the physical radius in the second coordinate system based on the endpoint coordinates, the device parameters, and the mapping coefficient.

[0046] In the above solution, the object size measurement device 30 obtains the detection result of the first scanned image and obtains the device parameters of the security inspection machine. The first scanned image is obtained by the security inspection machine scanning the object to be measured on the security inspection channel. The detection result includes: the target angle between the object to be measured and the traveling direction of the security inspection channel, and the endpoint coordinates of the object edge of the object to be measured relative to the endpoints in the vertical direction of the traveling direction. Then, with the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis, a first coordinate system is established. The major axis is obtained based on the target angle and the physical radius of the object to be measured, and the minor axis is the physical radius. The target ellipse is intercepted on the object to be measured by the plane where the first light ray and the second light ray are located. The first light ray and the second light ray are respectively tangent to the object to be measured and respectively form images to form opposite endpoints. Thus, based on the target angle, the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction is obtained. The target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius. Furthermore, based on the endpoint coordinates, device parameters, and mapping coefficient, the physical radius is solved in the second coordinate system. On the one hand, when the object to be measured is placed obliquely to the traveling direction of the security inspection channel, by detecting the target angle between the object to be measured and the traveling direction of the security inspection channel, the first coordinate system where the actual target ellipse is formed is equivalent to the second coordinate system of the target circle, which helps to improve the convenience of measuring the physical radius. On the other hand, when solving the radius in the second coordinate system, it is jointly solved by combining the actually detected endpoint coordinates in the first scanned image, the device parameters of the security inspection machine, and the mapping parameters determined by the target angle, which helps to improve the measurement accuracy of the physical radius. Therefore, it is possible to accurately and conveniently measure the physical radius of the object to be measured when the object to be measured is placed obliquely to the traveling direction of the security inspection channel.

[0047] In some disclosed embodiments, the device parameters include the vertical distance from the light source to the security inspection channel, the imaging coordinates of the light rays emitted perpendicularly to the security inspection channel by the light source, and the scaling factor when the security inspection machine forms an image. The radius solving module 34 includes a physical distance measurement sub-module, which is used to obtain the physical distance between the first intersection point of the first light ray on the security inspection channel and the second intersection point of the second light ray on the security inspection channel in the second coordinate system based on the endpoint coordinates, the scaling factor, and the mapping coefficient; wherein, the endpoint coordinates are respectively formed by the imaging of the first light ray and the second light ray; the radius solving module 34 includes an included angle sine calculation sub-module, which is used to obtain the first sine value and the second sine value of the first included angle and the second included angle between the first light ray and the second light ray and the security inspection channel respectively in the second coordinate system based on the endpoint coordinates, the imaging coordinates, the scaling factor, the vertical distance, and the mapping coefficient; the radius solving module 34 includes a physical radius solving sub-module, which is used to obtain the physical radius based on the physical distance, the vertical distance, the first sine value, and the second sine value.

[0048] In some disclosed embodiments, the endpoint coordinates include a first endpoint coordinate formed by the imaging of a first light ray and a second endpoint coordinate formed by the imaging of a second light ray. The physical distance measurement sub-module includes a first difference calculation unit configured to obtain a first coordinate difference between the first endpoint coordinate and the second endpoint coordinate; the physical distance measurement sub-module includes a first difference scaling unit configured to scale the first coordinate difference based on a scaling coefficient to obtain a physical distance between a first intersection point and a second intersection point in a first coordinate system; the physical distance measurement sub-module includes a first distance mapping unit configured to map the physical distance in the first coordinate system based on a mapping coefficient to obtain a physical distance between the first intersection point and the second intersection point in a second coordinate system.

[0049] In some disclosed embodiments, the sine of the included angle calculation sub-module includes a second difference calculation unit configured to obtain a second coordinate difference between a target endpoint coordinate and an imaging coordinate; the sine of the included angle calculation sub-module includes a second difference scaling unit configured to scale the second coordinate difference based on a scaling coefficient to obtain a target distance between an intersection point of a target light ray on a security inspection channel and an intersection point of an outgoing light ray on the security inspection channel in a first coordinate system; the sine of the included angle calculation sub-module includes a second distance mapping unit configured to map the target distance in the first coordinate system based on a mapping coefficient to obtain a target distance between the intersection point of the target light ray on the security inspection channel and the intersection point of the outgoing light ray on the security inspection channel in a second coordinate system; the sine of the included angle calculation sub-module includes a target sine calculation unit configured to obtain a target sine value of a target included angle between the target light ray and the security inspection channel in the second coordinate system based on a vertical distance and the target distance in the second coordinate system; wherein, the target endpoint coordinate is formed by the imaging of the target light ray. When the target light ray is the first light ray, the target included angle is the first included angle and the target sine value is the first sine value. When the target light ray is the second light ray, the target included angle is the second included angle and the target sine value is the second sine value.

[0050] In some disclosed embodiments, the target sine calculation unit is specifically configured to obtain a target tangent value of the target included angle in the second coordinate system based on the ratio of the vertical distance to the target distance in the second coordinate system, and perform a trigonometric function conversion based on the target tangent value of the target included angle in the second coordinate system to obtain the target sine value of the target included angle in the second coordinate system.

[0051] In some disclosed embodiments, the physical radius solving sub-module includes an expression constructing unit, configured to construct a first expression with the physical radius as the unknown based on a first sine value and a second sine value, and construct a second expression with the physical radius as the unknown based on the vertical distance; the physical radius solving sub-module includes a function constructing unit, configured to construct a first function with the physical radius as the unknown based on the ratio of the physical distance to the first expression and the ratio of the vertical distance to the second expression; the physical radius solving sub-module includes a function solving unit, configured to solve based on the first function to obtain the physical radius of the object to be measured; wherein, the first expression represents the physical length of a first line segment in a second coordinate system, the first line segment is formed by the intersection points of a first light ray and a second light ray on a virtual plane respectively, the virtual plane passes through the center of the object to be measured and is parallel to the security inspection passage, and the second expression represents the physical length of a second line segment, the second line segment is the vertical line segment from the light source to the virtual plane.

[0052] In some disclosed embodiments, the expression constructing unit is specifically configured to construct a first sub-expression based on the first sine value and the unknown representing the physical radius, and construct a second sub-expression based on the second sine value and the unknown representing the physical radius; obtain the first expression based on the sum of the first sub-expression and the second sub-expression; wherein, the first sub-expression represents the physical length from the intersection point of the first light ray on the virtual plane to the center in the second coordinate system, and the second sub-expression represents the physical length from the intersection point of the second light ray on the virtual plane to the center in the second coordinate system.

[0053] In some disclosed embodiments, the device parameters are pre-obtained by calibrating a second scanned image of a calibration ruler placed on the security inspection passage by the security inspection machine, and the calibration ruler is perpendicular to the traveling direction of the security inspection passage.

[0054] In some disclosed embodiments, the device parameters include the vertical distance from the light source to the security inspection passage. The object size measuring device 30 includes an arithmetic expression constructing module, configured to construct a first algebraic expression based on the physical height of the calibration ruler and the unknown representing the vertical distance, and obtain the distance ratio between a first distance and a second distance based on the vertex coordinates of each vertex of the calibration ruler on the same cross-section in the second scanned image; the object size measuring device 30 includes a function constructing module, configured to construct a second function based on the first algebraic expression and the distance ratio; the object size measuring device 30 includes a distance solving module, configured to solve based on the second function to obtain the vertical distance; wherein, the first algebraic expression represents the ratio of the vertical distance to the shortest distance from the light source to the plane where the top surface of the calibration ruler is located, the vertex coordinates of each vertex are respectively formed by the imaging of each light source ray passing through the target edge of the calibration ruler, the target edge is perpendicular to the traveling direction, the first distance is the distance between the intersection points on the detector of the security inspection machine after the light source ray passes through the target edge of the top surface of the calibration ruler, and the second distance is the distance between the intersection points on the detector after the light source ray passes through the target edge of the bottom surface of the calibration ruler.

[0055] In some disclosed embodiments, the device parameters include the imaging coordinates of the light source emitting light perpendicular to the security inspection channel. The object size measuring device 30 includes an arithmetic expression construction module for constructing a second algebraic expression based on the upper vertex coordinates and lower vertex coordinates of the calibration scale on the same high line on the target side in the second scanned image and the unknown quantity representing the imaging coordinates, and obtaining the numerical ratio between the physical height of the calibration scale and the vertical distance; the object size measuring device 30 includes a function construction module for constructing a third function based on the second algebraic expression and the numerical ratio; the object size measuring device 30 includes a coordinate solving module for solving based on the third function to obtain the imaging coordinates; wherein, the target side is a side of the calibration scale close to the light source, the second algebraic expression represents the ratio of the third distance to the fourth distance, the upper vertex coordinates and the lower vertex coordinates are respectively formed by the imaging of each light source ray passing through the same high line, the third distance is the distance between the intersection points of the light source rays on the detector of the security inspection machine after passing through the same high line, and the fourth distance is the distance between the intersection point of the light source ray on the detector of the security inspection machine after passing through the upper vertex of the same high line and the intersection point of the outgoing light ray on the detector of the security inspection machine.

[0056] In some disclosed embodiments, the device parameters include the scaling factor during the imaging of the security inspection machine. The object size measuring device 30 includes a measurement preparation module for obtaining the physical width of the calibration scale and obtaining the difference between the vertex coordinates of the two vertices on the bottom edge of the calibration scale in the same cross-section in the second scanned image as the bottom edge coordinate difference; the object size measuring device 30 includes a factor determination module for obtaining the scaling factor based on the ratio of the physical width to the bottom edge coordinate difference.

[0057] In some disclosed embodiments, the device parameters include the scaling factor during the imaging of the security inspection machine. The object size measuring device 30 includes an image detection module for detecting the first pixel coordinates of the upper boundary point of the object to be measured in the first scanned image and detecting the scale line sequence of the calibration scale in the second scanned image; wherein, the scale line sequence includes the second pixel coordinates of the scale lines on the calibration scale; the object size measuring device 30 includes an index search module for searching for the scale line adjacent to the boundary point in the scale line sequence based on the first pixel coordinates and the second pixel coordinates to obtain the first scale index; the object size measuring device 30 includes a factor calculation module for obtaining the scaling factor during the imaging of the security inspection machine at the object to be measured based on the first scale index, the physical distance between adjacent scale lines on the calibration scale, and the pixel distance between the boundary points.

[0058] In some disclosed embodiments, the object size measuring device 30 includes a coordinate difference module configured to obtain a difference between a first pixel coordinate and a second pixel coordinate of a first scale index as a first difference, and obtain a difference between a second pixel coordinate of a reference scale index and the second pixel coordinate of the first scale index as a second difference; wherein the reference scale index is a scale index subsequent to the first scale index; the object size measuring device 30 includes an additional index module configured to obtain a ratio of the first difference to the second difference as an additional scale index of the first scale index; the coefficient calculation module is specifically configured to obtain a scaling coefficient when the security inspection machine images an object to be measured based on the first scale index, the additional scale index, the physical distance, and the pixel distance.

[0059] In some disclosed embodiments, the major axis is represented as a ratio of the minor axis to the cosine value of the target angle, and the mapping coefficient is the cosine value of the target angle; and / or, the target angle is determined by detecting the axis of the object to be measured in the first scanned image.

[0060] Please refer to Figure 4 , Figure 4 is a schematic framework diagram of an embodiment of the electronic device of the present application. The electronic device 40 at least includes a memory 41 and a processor 42 that are coupled to each other. The memory 41 stores at least program instructions, and the processor 42 is configured to execute the program instructions to implement the steps in any of the above object size measurement method embodiments. Specifically, reference may be made to the foregoing disclosed embodiments, which will not be elaborated herein.

[0061] Specifically, the processor 42 is configured to control itself and the memory 41 to implement the steps in any of the above object size measurement method embodiments. The processor 42 may also be referred to as a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Additionally, the processor 42 may be implemented jointly by integrated circuit chips.

[0062] In the above solution, the electronic device 40 obtains the detection result of the first scanned image and the device parameters of the security inspection machine. The first scanned image is obtained by the security inspection machine scanning the object to be inspected on the security inspection passage. The detection result includes: the target angle between the object to be inspected and the traveling direction of the security inspection passage, and the endpoint coordinates of the object edge of the object to be inspected relative to the endpoints in the vertical direction of the traveling direction. Then, with the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis, a first coordinate system is established. The major axis is obtained based on the target angle and the physical radius of the object to be inspected, and the minor axis is the physical radius. The target ellipse is intercepted on the object to be inspected by the plane where the first light ray and the second light ray are located. The first light ray and the second light ray are respectively tangent to the object to be inspected and respectively form images to form opposite endpoints. Thus, based on the target angle, the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction is obtained. The target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius. Furthermore, based on the endpoint coordinates, the device parameters, and the mapping coefficient, the physical radius is solved in the second coordinate system. On the one hand, when the object to be inspected is placed obliquely to the traveling direction of the security inspection passage, by detecting the target angle between the object to be inspected and the traveling direction of the security inspection passage, the first coordinate system where the actual target ellipse is formed is equivalent to the second coordinate system of the target circle, which helps to improve the convenience of measuring the physical radius. On the other hand, when solving the radius in the second coordinate system, it is jointly solved by combining the actual detected endpoint coordinates in the first scanned image, the device parameters of the security inspection machine, and the mapping parameters determined by the target angle, which helps to improve the measurement accuracy of the physical radius. Therefore, when the object to be inspected is placed obliquely to the traveling direction of the security inspection passage, the physical radius of the object to be inspected can be accurately and conveniently measured.

[0063] Please refer to Figure 5 , Figure 5 which is a schematic framework diagram of an embodiment of the security inspection machine of the present application. The security inspection machine 50 at least includes the electronic device 40 in the above embodiment. Of course, in addition, the security inspection machine 50 may further include other component devices, such as a light source (not shown), a security inspection passage such as a belt (not shown), an outer frame (not shown), a detector (not shown), etc. The specific structure of the security inspection machine 50 can refer to the technical details related thereto in the art, and the specific structure of the security inspection machine will not be elaborated herein.

[0064] In the above solution, the electronic device 40 in the security inspection machine 50 obtains the detection result of the first scanned image and the device parameters of the security inspection machine 50. The first scanned image is obtained by scanning an object to be inspected on the security inspection channel. The detection result includes: the target angle between the object to be inspected and the traveling direction of the security inspection channel, and the endpoint coordinates of the object edge of the object to be inspected relative to the endpoints in the direction perpendicular to the traveling direction. Then, with the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis, a first coordinate system is established. The major axis is obtained based on the target angle and the physical radius of the object to be inspected, and the minor axis is the physical radius. The target ellipse is intercepted on the object to be inspected by the plane where the first light ray and the second light ray are located. The first light ray and the second light ray are respectively tangent to the object to be inspected and respectively form images to form opposite endpoints. Thus, based on the target angle, the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction is obtained. The target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius. Furthermore, based on the endpoint coordinates, device parameters, and mapping coefficient, the physical radius is solved in the second coordinate system. On the one hand, when the object to be inspected is placed obliquely to the traveling direction of the security inspection channel, by detecting the target angle between the object to be inspected and the traveling direction of the security inspection channel, the first coordinate system where the actual target ellipse is formed is equivalent to the second coordinate system of the target circle, which helps to improve the convenience of measuring the physical radius. On the other hand, when solving the radius in the second coordinate system, it is jointly solved by combining the actual detected endpoint coordinates in the first scanned image, the device parameters of the security inspection machine 50, and the mapping parameters determined by the target angle, which helps to improve the measurement accuracy of the physical radius. Therefore, when the object to be inspected is placed obliquely to the traveling direction of the security inspection channel, the physical radius of the object to be inspected can be accurately and conveniently measured.

[0065] Please refer to Figure 6 , Figure 6 which is a schematic framework diagram of an embodiment of the computer-readable storage medium of the present application. The computer-readable storage medium 60 stores program instructions 61 that can be run by a processor, and the program instructions 61 are used to implement the steps in any of the above-described embodiments of the object size measurement method.

[0066] In the above solution, the computer-readable storage medium 60 obtains the detection result of the first scanned image and obtains the device parameters of the security inspection machine. The first scanned image is obtained by the security inspection machine scanning the object to be inspected on the security inspection channel. The detection result includes: the target angle between the object to be inspected and the traveling direction of the security inspection channel, and the endpoint coordinates of the object edge of the object to be inspected relative to the endpoints in the direction perpendicular to the traveling direction. Then, with the center of the target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis, a first coordinate system is established. The major axis is obtained based on the target angle and the physical radius of the object to be inspected, and the minor axis is the physical radius. The target ellipse is intercepted on the object to be inspected by the plane where the first light ray and the second light ray are located. The first light ray and the second light ray are respectively tangent to the object to be inspected and respectively form images to form opposite endpoints. Thus, based on the target angle, the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction is obtained. The target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius. Furthermore, based on the endpoint coordinates, device parameters, and mapping coefficient, the physical radius is solved in the second coordinate system. On the one hand, when the object to be inspected is placed obliquely to the traveling direction of the security inspection channel, by detecting the target angle between the object to be inspected and the traveling direction of the security inspection channel, the first coordinate system where the actual target ellipse is formed is equivalent to the second coordinate system of the target circle, which helps to improve the convenience of measuring the physical radius. On the other hand, when solving the radius in the second coordinate system, it is jointly solved by combining the actual detected endpoint coordinates in the first scanned image, the device parameters of the security inspection machine, and the mapping parameters determined by the target angle, which helps to improve the measurement accuracy of the physical radius. Therefore, when the object to be inspected is placed obliquely to the traveling direction of the security inspection channel, the physical radius of the object to be inspected can be accurately and conveniently measured.

[0067] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.

[0068] The descriptions of the above embodiments tend to emphasize the differences between the embodiments. The same or similar parts can be referred to each other. For the sake of brevity, they will not be repeated in this article.

[0069] In several embodiments provided in the present application, it should be understood that the disclosed methods and apparatuses can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.

[0070] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0071] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0072] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in various embodiments of the present application. And the aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs and other various media that can store program codes.

[0073] If the technical solution of this application involves personal information, before the product applying the technical solution of this application processes personal information, it has clearly informed the personal information processing rules and obtained the independent consent of the individual. If the technical solution of this application involves sensitive personal information, before the product applying the technical solution of this application processes sensitive personal information, it has obtained the individual's separate consent and at the same time meets the requirements of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If an individual voluntarily enters the collection scope, it is regarded as consenting to the collection of their personal information; or on the device for personal information processing, when the personal information processing rules are informed by obvious signs / information, personal authorization is obtained through pop-up messages or by asking the individual to upload their personal information by themselves, etc.; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

Claims

1. A method for measuring the size of an object, characterized in that: include: Obtaining the detection result of the first scanned image and the equipment parameters of the security inspection machine; wherein the first scanned image is obtained by the security inspection machine scanning the object to be detected on the security inspection channel, and the detection result includes: the target angle between the object to be detected and the traveling direction of the security inspection channel, and the endpoint coordinates of the object edge of the object to be detected relative to the endpoint in the direction perpendicular to the traveling direction; A first coordinate system is established with the center of a target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis; wherein the major axis is obtained based on the target angle and the physical radius of the object to be measured, the minor axis is the physical radius, the target ellipse is intercepted on the object to be measured by the plane where the first light ray and the second light ray are located, and the first light ray and the second light ray are respectively tangent to the object to be measured and are respectively imaged to form the relative endpoints; Based on the target angle, a mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction is obtained; wherein the target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius; The physical radius is obtained by solving in the second coordinate system based on the endpoint coordinates, the device parameters and the mapping coefficients.

2. The method according to claim 1, characterized in that The device parameters include the vertical distance from the light source to the security inspection channel, the imaging coordinates of the light source perpendicular to the light emitted from the security inspection channel, and the scaling factor of the security inspection machine during imaging. The physical radius is obtained by solving in the second coordinate system based on the endpoint coordinates, the device parameters, and the mapping coefficient, including: Based on the endpoint coordinates, the scaling factor and the mapping factor, a physical distance between a first intersection point of the first light ray on the security inspection channel and a second intersection point of the second light ray on the security inspection channel in the second coordinate system is obtained; wherein the endpoint coordinates are formed by imaging the first light ray and the second light ray respectively; and, Based on the endpoint coordinates, the imaging coordinates, the scaling factor, the vertical distance, and the mapping factor, obtaining a first sine value and a second sine value of a first angle and a second angle between the first light ray and the security inspection channel, respectively, in the second coordinate system; The physical radius is obtained based on the physical distance, the vertical distance, the first sine value, and the second sine value.

3. The method according to claim 2, characterized in that The endpoint coordinates include a first endpoint coordinate formed by imaging the first light and a second endpoint coordinate formed by imaging the second light, and obtaining a physical distance between a first intersection point of the first light on the security inspection channel and a second intersection point of the second light on the security inspection channel in the second coordinate system based on the endpoint coordinates, the scaling factor, and the mapping factor includes: Obtaining a first coordinate difference between the first endpoint coordinates and the second endpoint coordinates; Scaling the first coordinate difference based on the scaling factor to obtain a physical distance between the first intersection point and the second intersection point in the first coordinate system; The physical distance in the first coordinate system is mapped based on the mapping coefficient to obtain the physical distance between the first intersection point and the second intersection point in the second coordinate system.

4. The method according to claim 2, characterized in that: The obtaining, based on the endpoint coordinates, the imaging coordinates, the scaling factor, the vertical distance, and the mapping factor, of a first angle and a second angle between the first light ray and the security inspection channel, respectively, and a first sine value and a second sine value in the second coordinate system, comprises: Acquire a second coordinate difference between the target endpoint coordinates and the imaging coordinates; Scaling the second coordinate difference based on the scaling factor to obtain a target distance in the first coordinate system between an intersection point of the target light on the security inspection channel and an intersection point of the outgoing light on the security inspection channel; Mapping the target distance in the first coordinate system based on the mapping coefficient to obtain the target distance in the second coordinate system between the intersection point of the target light ray on the security inspection channel and the intersection point of the outgoing light ray on the security inspection channel; Based on the vertical distance and the target distance in the second coordinate system, obtaining a target sine value of a target angle between the target light and the security inspection channel in the second coordinate system; Among them, the target endpoint coordinates are formed by imaging the target light. When the target light is the first light, the target angle is the first angle, and the target sine value is the first sine value. When the target light is the second light, the target angle is the second angle, and the target sine value is the second sine value.

5. The method according to claim 4, characterized in that The obtaining, based on the vertical distance and the target distance in the second coordinate system, a target sine value of a target angle between the target light and the security inspection channel in the second coordinate system includes: Obtaining a target tangent value of the target angle in the second coordinate system based on a ratio of the vertical distance to the target distance in the second coordinate system; A trigonometric function conversion is performed based on the target tangent value of the target angle in the second coordinate system to obtain a target sine value of the target angle in the second coordinate system.

6. The method according to claim 2, characterized in that The obtaining the physical radius based on the physical distance, the vertical distance, the first sine value, and the second sine value includes: Based on the first sine value and the second sine value, construct a first equation with the physical radius as an unknown quantity, and based on the vertical distance, construct a second equation with the physical radius as an unknown quantity; Based on the ratio of the physical distance to the first equation and the ratio of the vertical distance to the second equation, construct a first function with the physical radius as an unknown quantity; Based on the first function, a solution is performed to obtain the physical radius of the object to be measured; wherein, the first formula represents the physical length of the first line segment in the second coordinate system, the first line segment is formed by the intersection of the first light ray and the second light ray on a virtual plane, the virtual plane passes through the center of the object to be measured and is parallel to the security inspection channel, the second formula represents the physical length of the second line segment, and the second line segment is a vertical line segment from the light source to the virtual plane.

7. The method according to claim 6, characterized in that The constructing, based on the first sine value and the second sine value, a first formula with the physical radius as an unknown quantity comprises: Constructing a first sub-formula based on the first sine value and an unknown quantity representing the physical radius, and constructing a second sub-formula based on the second sine value and an unknown quantity representing the physical radius; The first subformula is obtained based on the sum of the first subformula and the second subformula; wherein the first subformula represents the physical length from the intersection point of the first light ray on the virtual plane to the center in the second coordinate system, and the second subformula represents the physical length from the intersection point of the second light ray on the virtual plane to the center in the second coordinate system.

8. The method according to claim 1, characterized in that The equipment parameters are obtained in advance based on the security inspection machine calibrating a second scan image of a calibration ruler placed on the security inspection channel, and the calibration ruler is perpendicular to the travel direction of the security inspection channel.

9. The method according to claim 8, characterized in that The equipment parameters include a vertical distance from the light source to the security inspection channel, and the calibration steps of the vertical distance include: Based on the physical height of the calibration ruler and the unknown quantity representing the vertical distance, a first algebraic expression is constructed, and based on the vertex coordinates of each vertex of the calibration ruler on the same cross section in the second scanned image, a distance ratio between the first distance and the second distance is obtained; constructing a second function based on the first algebraic expression and the distance ratio; Solving based on the second function to obtain the vertical distance; Among them, the first algebraic expression represents the ratio of the vertical distance to the shortest distance from the light source to the plane where the top surface of the calibration ruler is located, the vertex coordinates of each vertex are formed by imaging each light source light passing through the target edge on the calibration ruler, and the target edge is perpendicular to the travel direction, the first distance is the distance between the intersection points of the light source light on the detector of the security inspection machine after passing the target edge on the top surface of the calibration ruler, and the second distance is the distance between the intersection points of the light source light on the detector after passing the target edge on the bottom surface of the calibration ruler.

10. The method according to claim 8, characterized in that The equipment parameters include the imaging coordinates of the light source perpendicular to the light emitted from the security inspection channel and the vertical distance from the light source to the security inspection channel. The calibration steps of the imaging coordinates include: Based on the coordinates of the upper vertex and the lower vertex of the calibration ruler on the same height line on the side of the target in the second scanned image and the unknown quantity representing the imaging coordinates, a second algebraic expression is constructed, and a numerical ratio between the physical height of the calibration ruler and the vertical distance is obtained; constructing a third function based on the second algebraic expression and the numerical ratio; Solving based on the third function to obtain the imaging coordinates; Among them, the target side is a side of the calibration ruler close to the light source, the second algebraic expression represents the ratio of the third distance to the fourth distance, the upper vertex coordinates and the lower vertex coordinates are respectively formed by imaging of each light source light passing through the same high line, the third distance is the distance between the intersection points of the light source light on the detector of the security inspection machine after passing the same high line, and the fourth distance is the distance between the intersection point of the light source light on the detector of the security inspection machine after passing the upper vertex of the same high line and the intersection point of the outgoing light on the detector of the security inspection machine.

11. The method according to claim 8, characterized in that The equipment parameters include the scaling factor of the security inspection machine during imaging, and the scaling factor calibration steps include: Acquire the physical width of the calibration ruler, and acquire the difference between the vertex coordinates of two vertices on the bottom side of the calibration ruler in the same cross section in the second scanned image as the bottom side coordinate difference; The scaling factor is obtained based on the ratio of the physical width to the bottom edge coordinate difference.

12. The method according to claim 8, characterized in that The equipment parameters include the scaling factor of the security inspection machine during imaging, and the scaling factor calibration steps include: Detecting the first pixel coordinates of the boundary points on the object to be measured in the first scanned image, and detecting the scale line sequence of the calibration ruler in the second scanned image; wherein the scale line sequence includes the second pixel coordinates of the scale lines on the calibration ruler; Searching for a scale line adjacent to the boundary point in the scale line sequence based on the first pixel coordinate and the second pixel coordinate to obtain a first scale index; Based on the first scale index, the physical spacing between adjacent scale lines on the calibration ruler and the pixel spacing between the boundary points, a scaling factor of the security inspection machine when imaging the object to be inspected is obtained.

13. The method according to claim 12, characterized in that After searching the scale line adjacent to the boundary point in the scale line sequence based on the first pixel coordinate and the second pixel coordinate to obtain a first scale index, and before obtaining a scaling factor of the security inspection machine when imaging the object to be tested based on the first scale index, the physical spacing between adjacent scale lines on the calibration ruler, and the pixel spacing between the boundary points, the method further includes: Obtaining a difference between the first pixel coordinate and the second pixel coordinate of the first scale index as a first difference value, and obtaining a difference between the second pixel coordinate of a reference scale index and the second pixel coordinate of the first scale index as a second difference value; wherein the reference scale index is a scale index subsequent to the first scale index; Obtaining a ratio of the first difference to the second difference as an additional scale index of the first scale index; The obtaining, based on the first scale index, the physical spacing between adjacent scale lines on the calibration ruler and the pixel spacing between the boundary points, a scaling factor when the security inspection machine is imaging at the object to be inspected includes: Based on the first scale index, the additional scale index, the physical spacing and the pixel spacing, a scaling factor of the security inspection machine when imaging the object to be inspected is obtained.

14. The method according to any one of claims 1 to 13, characterized in that: The major axis is expressed as the ratio of the minor axis to the cosine value of the target angle, and the mapping coefficient is the cosine value of the target angle; And / or, the target angle is determined by detecting the axis of the object to be measured in the first scanning image.

15. An object size measuring device, characterized in that: include: A measurement preparation module, used to obtain the detection result of the first scan image and obtain the equipment parameters of the security inspection machine; wherein the first scan image is obtained by the security inspection machine scanning the object to be measured on the security inspection channel, and the detection result includes: the target angle between the object to be measured and the traveling direction of the security inspection channel, and the endpoint coordinates of the object edge of the object to be measured relative to the endpoint in the direction perpendicular to the traveling direction; A coordinate establishment module, for establishing a first coordinate system with the center of a target ellipse as the origin, the direction of the major axis of the target ellipse as the horizontal axis, and the direction of the minor axis of the target ellipse as the vertical axis; wherein the major axis is obtained based on the target angle and the physical radius of the object to be measured, the minor axis is the physical radius, the target ellipse is intercepted on the object to be measured by the plane where the first light and the second light are located, the first light and the second light are respectively tangent to the object to be measured and are respectively imaged to form the relative endpoints; A coefficient determination module, configured to obtain a mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction based on the target angle; wherein the target ellipse is equivalent to a target circle in the second coordinate system, and the radius size of the target circle is the physical radius; The radius solving module is used to solve the physical radius in the second coordinate system based on the endpoint coordinates, the device parameters and the mapping coefficients.

16. An electronic device, characterized in that: The device at least comprises a memory and a processor coupled to each other, wherein the memory at least stores program instructions, and the processor is used to execute the program instructions to implement the object size measurement method according to any one of claims 1 to 14.

17. A security inspection machine, characterized in that: At least comprising the electronic device as claimed in claim 16.

18. A computer-readable storage medium, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the object size measurement method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Imaging device and image analysis method

    CN102932591A

  • Monocular vision system, portable ball target used by monocular vision system and measuring method of monocular vision system

    CN103162622A

  • Method for grabbing target object by service robot based on elliptical cone artificial potential field

    CN111882610A

  • Numerical control rotary table tip inclination calibration method based on mandrel

    CN112880592A

  • Security inspection machine calibration method, related method, device, equipment and storage medium

    CN117422777A