Object Size Measurement Method and Related Devices, Security Inspection Machine, and Storage Medium

By obtaining scanned images and equipment parameters in the security inspection machine, establishing a coordinate system and converting it into a circular coordinate system, the radius measurement problem is solved when the object to be measured is placed in an inclined manner, and accurate and convenient physical radius measurement is achieved.

CN120063174BActive Publication Date: 2025-07-18IFLYTEK (SUZHOU) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When the object to be tested is placed inclined to the direction of travel of the security channel, it is difficult for the prior art to accurately and conveniently measure its physical radius.

Method used

By obtaining the detection results of the scanned image and the equipment parameters of the security check machine, a coordinate system is established, and the elliptical coordinate system is converted into a circular coordinate system using the target angle and mapping coefficient, and the physical radius is solved by combining the endpoint coordinates and equipment parameters.

Benefits of technology

It realizes accurate and convenient measurement of the physical radius when the object to be tested is placed in an inclined manner, improving the convenience and accuracy of measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120063174B_ABST
    Figure CN120063174B_ABST
Patent Text Reader

Abstract

The present application discloses an object size measurement method, related devices, an X-ray security inspection machine, and a storage medium. Among them, the object size measurement method includes: obtaining the detection result of a first scanned image and obtaining the device parameters of the X-ray security inspection machine; 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; 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. The above solution 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.
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 objects passing through the inspection in the above 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, in the first aspect of the present application, an object size measurement method is provided, 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; 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, to establish a first coordinate system; 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; based on the target angle, obtaining the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction; 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; based on the endpoint coordinates, device parameters, and mapping coefficient, solving for the physical radius in the second coordinate system.

[0006] To solve the above technical problems, a 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 configured 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 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; 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 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; 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 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.

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

[0008] To solve the above technical problems, a 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, a 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] In the above solution, the detection result of the first scanned image is obtained, and the device parameters of the security inspection machine are obtained. The first scanned image is obtained by scanning the object to be measured on the security inspection channel by the security inspection machine. 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 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 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 relative 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 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 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 measured is placed obliquely to the traveling direction of the security inspection channel, the physical radius of the object to be measured can be accurately and conveniently measured. Description of the Drawings

[0011] Figure 1 is a schematic flowchart of an embodiment of the object size measurement method of the present application;

[0012] Figure 2a is a schematic diagram of the effect of an embodiment of the first scanned image of the present application;

[0013] Figure 2b is a schematic diagram of the effect of an embodiment of the object size measurement method of the present application;

[0014] Figure 2c is a schematic diagram of the effect of another embodiment of the object size measurement method of the present application;

[0015] Figure 2d is a schematic diagram of the effect of yet another embodiment of the object size measurement method of the present application;

[0016] Figure 3 is a schematic framework diagram of an embodiment of the object size measurement device of the present application;

[0017] Figure 4 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0018] Figure 5 It is a schematic diagram of the framework of an embodiment of the security inspection machine of the present application;

[0019] Figure 6 It is a schematic diagram of the framework of an embodiment of the computer-readable storage medium of the present application. Detailed implementation manners

[0020] Next, in combination with the accompanying drawings of the specification, the solutions of the embodiments of the present application will be described in detail.

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

[0022] In this article, the terms "system" and "network" are often used interchangeably. The term " / and" in this article only describes 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 back associated objects. In addition, "multiple" in this article means two or more than two.

[0023] 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:

[0024] Step S11: Obtain the detection result of the first scanned image and obtain the device parameters of the security inspection machine.

[0025] In the embodiments of the present disclosure, the first scanned image can be obtained by scanning the object to be measured on the security inspection channel by the security inspection machine, and the detection result may 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.

[0026] 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 This is a schematic diagram of the effect of an embodiment of the first scanned image of this application. As Figure 2a shown, Figure 2a the dashed box in it is the target area, and the midline of the target area (such as Figure 2a the dashed line without an arrow in it) is the axis of the object to be measured, then the target angle is Figure 2a θ in it. Of course, Figure 2a what is shown is only a possible example in the actual application process, and other possible situations will not be exemplified one by one here.

[0027] In an implementation scenario, as described above, 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, edge detection can be further performed in the target area 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, more precisely, is 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 it is the target area, in the direction perpendicular to the traveling direction (such as Figure 2a the dashed line with an arrow in it), 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, such as Figure 2a the object to be measured in it is a bottle, and the neck of the bottle is thin and the whole body is thick. In order to make the finally measured physical radius more valuable for reference, a regular area 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 body area of the bottle, rather than the neck area), and then in the direction perpendicular to the traveling direction, relative endpoints are selected on the object edge of this regular area to obtain the coordinate difference of the relative endpoints. Of course, Figure 2a what is shown is only a possible example in the actual application process, and other possible situations will not be exemplified one by one here.

[0028] In an 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 the security inspection machine leaves the factory.

[0029] In another implementation scenario, the device parameters can also be obtained by pre-calibrating the second scanned image of the calibration ruler placed on the security inspection channel by the security inspection machine, and the calibration ruler can be perpendicular to the traveling direction of the security inspection channel. More precisely, the extending 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, if the light source of the security inspection machine is 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 a radiopaque marking ruler. The specific type of the calibration ruler is not limited herein.

[0030] In a specific implementation scenario, the device parameters can 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 between the vertex coordinates of the vertices on the top edge of the cross-section can be obtained as the top edge coordinate difference, and the difference between the vertex coordinates of the vertices on the bottom edge of the cross-section can be obtained as the bottom edge coordinate difference. On this basis, the distance ratio can be obtained based on the ratio of the top edge coordinate difference to the bottom edge coordinate difference. It should be noted that in the case where the pixel coordinates are represented by (U, V), unless otherwise specified in the embodiments of the present disclosure, when performing relevant calculations on the 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 easy understanding, please refer to Figure 2b , Figure 2b which is a schematic diagram of the effect of an embodiment of the object size measurement method of the present application. As Figure 2bAs shown, the three bold straight 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 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 to determine the differences between the materials through which different lights pass, and then represent them with 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, OP represents the vertical distance from the light source to the security inspection channel, OP2 represents the shortest distance from the light source to the plane where the top surface of the calibration ruler is located (i.e., the vertical distance from the light source to the plane where the top surface of the calibration ruler is located), and the vertex coordinates of vertex A are V a , the vertex coordinates of vertex B are V b , the vertex coordinates of vertex C are V c , the vertex coordinates of vertex D are V d , the above vertex coordinates are respectively formed by the imaging of the light rays of each light source passing through the target edge on the calibration ruler. For example, the vertex coordinate V a is formed by the imaging of the light ray OA of the light source passing through the target edge at point A (i.e., the edge line perpendicular to the paper surface at point A), and the vertex coordinate V b is formed by the imaging of the light ray OB of the light source passing through the target edge at point B (i.e., the edge line perpendicular to the paper surface at point B), and the vertex coordinate V c is formed by the imaging of the light ray OC of the light source passing through the target edge at point C (i.e., the edge line perpendicular to the paper surface at point C), and the vertex coordinate V d is formed by the imaging of the light ray OD of the light source passing through the target edge at point D (i.e., the edge line perpendicular to the paper surface at point D). The intersection point between the light ray OB and the security inspection channel can be denoted as B0, the intersection point with the detector can be denoted as B1, the intersection point between the light ray OA and the detector can be denoted as A1, the intersection point between the light ray OC and the security inspection channel can be denoted as C0, the intersection point with the detector can be denoted as C1, and the intersection point between the light ray OD and the detector can be denoted as D1. 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:

[0031] B0C0 / B1C1 = OP / OP1

[0032] AD / A1D1 = OP / OP1

[0033] By combining the above two equations, it can be obtained that:

[0034] B0C0 / B1C1 = AD / A1D1

[0035] That is:

[0036] B0C0 / AD = B1C1 / A1D1

[0037] Also, since AD = BC, the above equation can be further transformed into:

[0038] B0C0 / BC = B1C1 / A1D1

[0039] In addition, according to the principle of similar triangles, it can also be known that:

[0040] OP / OP2 = B0C0 / BC

[0041] Combining the above two equations, we can get:

[0042] OP / OP2 = B1C1 / A1D1

[0043] Also, since:

[0044] OP2 = OP + PP2 = OP + AB

[0045] Combining the above two equations, we can get:

[0046] OP / (OP + AB) = B1C1 / A1D1

[0047] Also, since:

[0048] B1C1 = λ1 * (V b -V c )

[0049] A1D1 = λ1 * (V a -V d )

[0050] Therefore:

[0051] B1C1 / A1D1 = (V b -V c ) / (V a -V d )

[0052] In the above formula, B1C1 is the first distance, A1D1 is the second distance, and B1C1 / A1D1 is the distance ratio between the first distance and the second distance. Among them, V b -V c represents the coordinate difference of the top side, and V a -V d represents the coordinate difference of the bottom side.

[0053] Substituting the above formula into the formula OP / (OP + AB) = B1C1 / A1D1, we can obtain:

[0054] OP / (OP + AB) = (V b -V c ) / (V a -V d )

[0055] 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:

[0056] OP = (V b -V c ) * AB / (V a -V d + V b -V c )

[0057] 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 emitted 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 the lower vertex coordinates of the calibration ruler on the same high line on the target side in the second scan 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 formula. On this basis, the second algebraic expression can be obtained based on the ratio of the high line coordinate difference to the target formula. At the same time, the numerical ratio between the physical height of the calibration ruler 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 the third function. It should be noted that 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 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 on the same high line and the intersection point of the emitted light ray on the detector of the security inspection machine. For the convenience of understanding, please continue to refer to Figure 2b, P1 is the intersection point of the light ray emitted perpendicularly to the security inspection passage by the light source O on the detector, and the imaging coordinate is V p . According to the principle of similar triangles:

[0058] AB0 / A1B1 = OP / OP1

[0059] PB0 / P1B1 = OP / OP1

[0060] By combining the above two equations, we can obtain:

[0061] AB0 / A1B1 = PB0 / P1B1

[0062] The above equation can be transformed into:

[0063] AB0 / PB0 = A1B1 / P1B1

[0064] According to the principle of similar triangles, it can also be known that:

[0065] AB0 / PB0 = AB / OP

[0066] By combining the above two equations, we can obtain:

[0067] A1B1 / P1B1 = AB / OP

[0068] In the above equation, AB / OP represents the numerical ratio between the physical height of the calibration scale and the vertical distance, and A1B1 / P1B1 represents the second algebraic expression. Among them, A1B1 represents the distance between the intersection points of the light ray of the light source after passing through the high line AB on the detector of the security inspection machine, and P1B1 represents the distance between the intersection point B1 of the light ray of the light source after passing through the upper vertex B of the high line AB on the detector of the security inspection machine and the intersection point P1 of the outgoing light ray on the detector of the security inspection machine. Further, for the second algebraic expression, since:

[0069] A1B1 = λ1 * (V b -V a )

[0070] P1B1 = λ1 * (V p -V b )

[0071] In the above equation, V b -V a represents the difference between the vertex coordinate and the lower vertex coordinate (i.e., the high line coordinate difference), and V p -V b represents the difference between the upper vertex coordinate and the unknown quantity representing the imaging coordinate (i.e., the target equation). Therefore, the second algebraic expression A1B1 / P1B1 can also be expressed as:

[0072] A1B1 / P1B1 = (V b-V a ) / (V p -V b )

[0073] That is, the second algebraic expression can also be expressed as the ratio of the difference in the height coordinates to the target expression. Therefore, the above formula A1B1 / P1B1 = AB / OP can be reconstructed as:

[0074] (V b -V a ) / (V p -V b ) = AB / OP

[0075] The above formula is the third function. Solving the above third function can obtain the imaging coordinate V p :

[0076] V p =(V b -V a )*OP / AB + V b

[0077] 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 difference in the vertex coordinates of the two vertices on 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 side of the scale lines facing, the height direction is the thickness direction of the calibration ruler, and the extension direction is the direction in which the index of the scale lines increases or decreases. 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 A1D1 with the aforementioned scaling factor λ2:

[0078] AD = λ2 * A1D1

[0079] In addition, as described above:

[0080] A1D1 = λ1*(V a -V d )

[0081] Combining the above two formulas, we can obtain:

[0082] AD = λ2 * λ1*(V a -V d )

[0083] Since the scaling factor λ of the security inspection machine is λ2*λ1, the scaling factor λ of the security inspection machine can be expressed as:

[0084] λ=AD / (V a -V d )

[0085] In the above formula, the two vertices of the calibration ruler on the bottom side of the same cross section are point A and point D, so the difference between the two vertex coordinates can be expressed as V a -V d That is, the physical width AD and the bottom coordinate difference V a -V d The ratio of is denoted as the scaling factor λ.

[0086] In a specific implementation scenario, as mentioned above, the equipment parameters may also include the scaling factor of the security inspection machine when imaging. For the "scaling factor" in the equipment parameters, different from the aforementioned calibration method, in order to calibrate the scaling factor of the security inspection machine when imaging at the object to be measured, the first pixel coordinates of the boundary point on the object to be measured in the first scanned image may be detected. Exemplarily, the boundary points may include: the first boundary point and the second boundary point on the object to be measured in the target direction of the first scanned image. The target direction is the placement direction of the calibration ruler on the security inspection channel, that is, the vertical direction of the travel direction. It should be noted that after obtaining the first scanned image, the first scanned image may 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 pixel points located on the boundary of the target area in the target direction may be selected as the first boundary point and the second boundary point. In other words, the first boundary point and the second boundary point must be located on the target area (such as the rectangular frame of the minimum circumscribed rectangle) and must also form a boundary in the target direction. Please continue to refer to Figure 2a , the dotted box is the target area, P1 and P2 are the first boundary point and the second boundary point respectively. Figure 2aThe illustration is merely a possible example in the actual application process, and other possible situations 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 can be performed based on the second scanned image (for example, edge detection can be performed 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 the size of the object to be inspected 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 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 pitch can be obtained as the scaling factor.

[0087] 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 here. That is to say, whether the device parameters are obtained by reading the internal storage of the security inspection machine, by calibration, or even by other possible ways not mentioned in the embodiments of the present disclosure, they can 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 center line of the security inspection channel, or far from the center line of the security inspection channel), so that the security inspection channel can be transmitted from one end to the other end during the security inspection process.

[0088] 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.

[0089] 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 an ellipse. 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 O1 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 coordinates of the center O1 of the target ellipse in the first coordinate system are (0, 0). Of course, Figure 2cThe 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.

[0090] 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.

[0091] 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 minor axis to the cosine value of 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:

[0092] a=r / cos(θ)

[0093] b=r

[0094] 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:

[0095]

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

[0097]

[0098] That is:

[0099]

[0100] 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 2dA second coordinate system with the center E of the target circle as the coordinate origin as shown. That is, in the embodiments 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 and remains unchanged in the vertical axis direction to equivalently transform the target ellipse into a target circle, thereby reducing the computational complexity as much as possible. The following specifically describes how the mapping coefficient cos(θ) affects the calculation in the horizontal axis direction.

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

[0102] Specifically, as described above, the device parameters can 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 coefficient, 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 coefficient, 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 coefficient, 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 coefficient, 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.

[0103] In an implementation scenario, the endpoint coordinates can 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 , as Figure 2c in which the first light ray OB and the second light ray OC respectively form endpoint coordinates V b and V c . Figure 2c The effect example in the first coordinate system as shown in Figure 2d , for the equivalent in the second coordinate system, please refer to Figure 2d in which the first light ray OB and the second light ray OC respectively form endpoint coordinates V b and V cIn 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 ).

[0104] In an implementation scenario, in order to obtain 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, the first coordinate difference between the first endpoint coordinates and the second endpoint coordinates 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 where 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:

[0105] BC = λ(V b - V c )

[0106] 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:

[0107] BC = λ(V b - V c ) * cos(θ) = λ(V b - V c ) * cos(θ)

[0108] 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.

[0109] 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 by the scaling coefficient first and then mapping it by the mapping coefficient, and combining 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.

[0110] 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.

[0111] 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 channel 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 based on the scaling coefficient λ, the second coordinate difference V p -V b is scaled 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 channel and the intersection point P of the outgoing light ray OP on the security inspection channel:

[0112] BP = λ * (V p -V b )

[0113] 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 channel and the intersection point P of the outgoing light ray on the security inspection channel:

[0114] BP = λ * (V p -V b ) * cos(θ)

[0115] 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:

[0116] tan(β1)= OP / BP = OP / [λ * (V p - V b ) * cos(θ)]

[0117] 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 first sine value) of the target angle β1 in the second coordinate system:

[0118]

[0119] 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:

[0120] CP = λ * (V p - V c )

[0121] 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:

[0122] CP = λ * (V p - V c ) * cos(θ)

[0123] In the above formula, cos(θ) represents the mapping coefficient. That is to say, the mapping can be directly realized 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 CP, the target tangent value of the target angle α1 in the second coordinate system can be obtained:

[0124] tan(α1)= OP / CP = OP[λ*(V p -V c )*cos(θ)]

[0125] Thus, 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:

[0126]

[0127] It should be noted that the first angle β1 between the first light ray and the security inspection channel is the angle β0 between the first light ray and the virtual plane C2P2 passing through the center E of the object to be measured and parallel to the security inspection channel, and the second angle α1 between the second light ray and the security inspection channel is the angle α0 between the second light ray and the virtual plane C2P2 passing through the center E of the object to be measured and parallel to the security inspection channel. Therefore:

[0128] sin(α0)=sin(α1)

[0129] sin(β0)=sin(β1)

[0130] In an implementation scenario, as a possible implementation method, after obtaining the physical distance in the second coordinate system and the first and second sine values 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 angular value of the second angle α1, and then the angular value of the supplementary angle C2CB of the second angle can be obtained accordingly (i.e., subtracting the angular value of the first angle α1 from 180 degrees). Since half of this supplementary angle (not shown, denoted as γ1 here for ease of explanation) 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 ease of 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 (not shown for fear of causing interference with the second angle α1 in Figure 2c ). Therefore, the ratio of the physical radius r to CF is the tangent value of half of this supplementary angle γ1:

[0131] tan(γ1)=r / CF

[0132] That is to say, CF=r / tan(γ1).

[0133] Meanwhile, after obtaining the second sine value sin(β1), the arcsine function can be used to process it to obtain the angular value of the first included angle β1, and then half of this angular value (not shown, denoted as γ2 here for the convenience of explanation). 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 angular value of the first included angle γ2:

[0134] tan(γ2)=r / BF

[0135] That is to say, 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, the following can be obtained:

[0136] BC = CF + BF=r / tan(γ1)+ r / tan(γ2)

[0137] That is to say:

[0138] r=BC / (1 / tan(γ1)+1 / tan(γ2))= λ(V b -V c )*cos(θ) / (1 / tan(γ1)+1 / tan(γ2))

[0139] In an implementation scenario, as another 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, a first equation with the physical radius as the unknown can be constructed based on the first sine value and the second sine value, and a second equation with the physical radius as the unknown can be constructed based on the vertical distance. Thus, a first function with the physical radius as the unknown can be constructed based on the ratio of the physical distance to the first equation and the ratio of the vertical distance to the second equation. Furthermore, 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 equation represents the physical length of the first line segment in the second coordinate system. The first line segment is formed by the intersection points of the first light ray and the second light ray on the 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 equation represents the physical length of the second line segment, and the second line segment is the perpendicular line segment from the light source to the virtual plane. In the above manner, based on the ratio of the physical distance to the first equation and the ratio of the vertical distance to the second equation, a first function with the physical radius as the unknown is constructed, and the physical radius of the object to be measured is obtained by solving based on the first function. The first equation represents the physical length of the first line segment in the second coordinate system, and the second equation represents the physical length of the second line segment, enabling the function to be solved from a geometric perspective to obtain the physical radius of the object to be measured.

[0140] In a specific implementation scenario, to construct the first equation, a first sub - equation can be constructed based on the first sine value and the unknown representing the physical radius, and a second sub - equation can be constructed based on the second sine value and the unknown representing the physical radius. The first sub - equation 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 - equation 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. Please refer to Figure 2d , where the virtual plane is C2P2. The physical length EB2 from the intersection point B2 of the first light ray OB on the virtual plane C2P2 to the center E can be expressed as:

[0141] EB2 = r / sin(β0)

[0142] Thus, the first sub - equation r / sin(β1) can be obtained. Similarly, the physical length EC2 from the intersection point C2 of the second light ray OC on the virtual plane C2P2 to the center E can be expressed as:

[0143] EC2 = r / sin(α0)

[0144] Since the intersection points B2 and C2 of the first light ray OB and the second light ray OC on the virtual plane form the first line segment B2C2, the sum of the first sub - equation and the second sub - equation is the first equation:

[0145] B2C2 = EB2 + EC2 = r / sin(β0) + r / sin(α0)

[0146] In a specific implementation scenario, to construct the second equation, it can be specifically based on the sum of the vertical distance and the unknown quantity representing the physical radius to construct the second equation. Please refer to Figure 2d , the physical length of the vertical line segment (i.e., the second line segment) OP2 from the light source O to the virtual plane can be expressed as OP + r in the second equation.

[0147] In a specific implementation scenario, after obtaining the first equation and the second equation, the first function with the physical radius r as the unknown quantity can be constructed:

[0148] BC / B2C2 = OP / (OP + r)

[0149] That is to say:

[0150] BC / (r / sin(β0) + r / sin(α0)) = OP / (OP + r)

[0151] Therefore, the physical radius r can be solved:

[0152] r = λ*(V b -V c )*cos(θ)*OP / (OP*ω - λ*(V b -V c )*cos(θ))

[0153] 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:

[0154] BC / B2C2 = OP / (OP + PP2) = OP / (OP + r)

[0155] As previously known:

[0156] B2C2 = EB2 + EC2 = r / sin(β0) + r / sin(α0) = r*ω

[0157] Therefore, by combining the above two equations, we can get:

[0158] BC / (r*ω) = OP / (OP + r)

[0159] Therefore, the physical radius r can be obtained:

[0160] r = BC*OP / (OP*ω - BC)

[0161] Also because:

[0162] BC = λ * (V b - V c ) * cos(θ)

[0163] Finally, the physical radius r can be obtained as follows:

[0164] r = λ * (V b - V c ) * cos(θ) * OP / (OP * ω - λ * (V b - V c ) * cos(θ))

[0165] It should be noted that the above examples are only several possible examples for solving the physical radius of the object to be measured by mapping from the first coordinate system of the target ellipse to the second coordinate system of the target circle. Other possible solution methods are not limited here, and no more examples will be given one by one.

[0166] In the above solution, the detection result of the first scanned image is obtained, and the device parameters of the security inspection machine are obtained. The first scanned image is obtained by scanning the object to be measured on the security inspection channel by the security inspection machine. 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 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 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 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 measured is placed obliquely to the traveling direction of the security inspection channel, the physical radius of the object to be measured can be accurately and conveniently measured.

[0167] 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. 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.

[0168] 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 passage. The detection result includes: the target angle between the object to be measured and the traveling direction of the security inspection passage, and the endpoint coordinates of the object edge of the object to be measured 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, 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 passage, by detecting the target angle between the object to be measured 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 measured is placed obliquely to the traveling direction of the security inspection passage, the physical radius of the object to be measured can be accurately and conveniently measured.

[0169] In some disclosed embodiments, the device parameters include the vertical distance from the light source to the security inspection passage, the imaging coordinates of the light rays emitted perpendicularly to the security inspection passage 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 passage and the second intersection point of the second light ray on the security inspection passage 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 passage 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.

[0170] In some disclosed embodiments, the endpoint coordinates include a first endpoint coordinate formed by imaging of a first light ray and a second endpoint coordinate formed by 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.

[0171] 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 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.

[0172] 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 a 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.

[0173] 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 the first sine value and the 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 the first line segment in the second coordinate system, the first line segment is formed by the intersection points of the first light ray and the second light ray on the 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 the second line segment, and the second line segment is the vertical line segment from the light source to the virtual plane.

[0174] 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.

[0175] In some disclosed embodiments, the device parameters are pre-obtained by calibrating the second scanned image of the 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.

[0176] 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 the first distance and the second distance based on the vertex coordinates of each vertex of the calibration ruler in 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 of the light source rays on the detector after passing through the target edge of the top surface of the calibration ruler, and the second distance is the distance between the intersection points of the light source rays on the detector after passing through the target edge of the bottom surface of the calibration ruler.

[0177] In some disclosed embodiments, the device parameters include the imaging coordinates of the light source emitting light perpendicular to the security inspection passage. The object size measurement 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 ruler 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 ruler and the vertical distance; the object size measurement 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 measurement device 30 includes a coordinate solution module for solving based on the third function to obtain the imaging coordinates; wherein, 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 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 emitted light ray on the detector of the security inspection machine.

[0178] In some disclosed embodiments, the device parameters include the scaling factor during the imaging of the security inspection machine. The object size measurement device 30 includes a measurement preparation module for obtaining the physical width of the calibration ruler and obtaining the difference between the vertex coordinates of the two vertices on the bottom edge of the calibration ruler in the same cross-section in the second scanned image as the bottom edge coordinate difference; the object size measurement 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.

[0179] In some disclosed embodiments, the device parameters include the scaling factor during the imaging of the security inspection machine. The object size measurement 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 ruler in the second scanned image; wherein, the scale line sequence includes the second pixel coordinates of the scale lines on the calibration ruler; the object size measurement 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 measurement 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 ruler, and the pixel distance between the boundary points.

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

[0181] In some disclosed embodiments, the major axis is represented 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 scanned image.

[0182] 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.

[0183] 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.

[0184] In the above solution, the electronic device 40 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, 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 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 for 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.

[0185] Please refer to Figure 5 , Figure 5 FIG. 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 to this, the security inspection machine 50 may also include other component devices, such as a light source (not shown), a security inspection channel 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.

[0186] In the above solution, the electronic device 40 in the security inspection machine 50 obtains the detection result of the first scanned image and obtains the device parameters of the security inspection machine 50. The first scanned image is obtained by the security inspection machine 50 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, 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 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 for 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 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.

[0187] 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.

[0188] 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 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 for 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.

[0189] 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.

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

[0191] In several embodiments provided by 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, and the indirect couplings or communication connections of the apparatuses or units can be in electrical, mechanical or other forms.

[0192] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can 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.

[0193] 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.

[0194] 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 this 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 (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical disks and other various media that can store program codes.

[0195] 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 individual's independent consent. 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, Including: 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 scanning the object to be inspected on the security inspection channel by the security inspection machine, and 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 vertical direction of the traveling direction. 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 inspected, the minor axis is the physical radius, and 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, and the first light ray and the second light ray are respectively tangent to the object to be inspected and respectively form the relative endpoints by imaging. Based on the target angle, obtain the mapping coefficient from the first coordinate system to the second coordinate system in the horizontal axis direction; 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. Based on the endpoint coordinates, the device parameters, and the mapping coefficient, solve for the physical radius in the second coordinate system.

2. The method according to claim 1, wherein 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 coefficient when the security inspection machine images. The solving for the physical radius in the second coordinate system based on the endpoint coordinates, the device parameters, and the mapping coefficient includes: Based on the endpoint coordinates, the scaling coefficient, and the mapping coefficient, obtain 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; wherein, the endpoint coordinates are respectively formed by imaging of the first light ray and the second light ray; and, Based on the endpoint coordinates, the imaging coordinates, the scaling coefficient, the vertical distance, and the mapping coefficient, obtain the first sine value and the second sine value in the second coordinate system of the first angle and the second angle between the first light ray and the second light ray and the security inspection channel respectively. Based on the physical distance, the vertical distance, the first sine value, and the second sine value, obtain the physical radius.

3. The method according to claim 2, wherein The endpoint coordinates include the first endpoint coordinates formed by imaging of the first light ray and the second endpoint coordinates formed by imaging of the second light ray. The obtaining of 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 based on the endpoint coordinates, the scaling coefficient, and the mapping coefficient includes: Obtain the first coordinate difference between the first endpoint coordinates and the second endpoint coordinates. Scale the first coordinate difference based on the scaling coefficient to obtain the physical distance in the first coordinate system between the first intersection point and the second intersection point. Map the physical distance in the first coordinate system 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, wherein The obtaining of the first sine value and the second sine value in the second coordinate system 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 based on the endpoint coordinates, the imaging coordinates, the scaling coefficient, the vertical distance, and the mapping coefficient includes: Obtain a second coordinate difference between the target endpoint coordinates and the imaging coordinates; Scale the second coordinate difference based on the scaling coefficient to obtain a target distance in the first 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; Map 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, obtain the target sine value in the second coordinate system of the target included angle between the target light ray and the security inspection channel; Wherein, the target endpoint coordinates are formed by 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, 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.

5. The method according to claim 4, wherein The obtaining of the target sine value in the second coordinate system of the target included angle between the target light ray and the security inspection channel based on the vertical distance and the target distance in the second coordinate system includes: Based on the ratio of the vertical distance to the target distance in the second coordinate system, obtain the target tangent value in the second coordinate system of the target included angle; Perform trigonometric function conversion based on the target tangent value in the second coordinate system of the target included angle to obtain the target sine value in the second coordinate system of the target included angle.

6. The method according to claim 2, wherein The obtaining of 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 expression with the physical radius as the unknown, and based on the vertical distance, construct a second expression 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, construct a first function with the physical radius as the unknown; 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 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 the virtual plane, the virtual plane passes through the center of the object to be measured and is parallel to the security inspection channel, and the second expression represents the physical length of the second line segment, and the second line segment is the perpendicular line segment from the light source to the virtual plane.

7. The method according to claim 6, characterized in that, Constructing the first expression with the physical radius as the unknown based on the first sine value and the second sine value includes: 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 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 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 device parameters are pre-obtained by calibrating the second scanned image of the calibration ruler placed on the security inspection channel by the security inspection machine, and the calibration ruler is perpendicular to the traveling direction of the security inspection channel.

9. The method according to claim 8, characterized in that The device parameters include the vertical distance from the light source to the security inspection channel, and the calibration steps of the vertical distance include: 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 the first distance and the second distance based on the vertex coordinates of each vertex of the calibration ruler on the same cross-section in the second scanned image; Construct a second function based on the first algebraic expression and the distance ratio; 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 intersections of the light source rays on the detector of the security inspection machine after passing through the target edge of the top surface of the calibration ruler, and the second distance is the distance between the intersections of the light source rays on the detector after passing through the target edge of the bottom surface of the calibration ruler.

10. The method according to claim 8, characterized in that, The device parameters include the imaging coordinates of the light source ray perpendicular to the security inspection channel and the vertical distance from the light source to the security inspection channel, and the calibration steps of the imaging coordinates include: Construct a second algebraic expression based on the upper vertex coordinates and the lower vertex coordinates of the calibration ruler on the same height line on the target side in the second scanned image and the unknown representing the imaging coordinates, and obtain the numerical ratio between the physical height of the calibration ruler and the vertical distance; Construct a third function based on the second algebraic expression and the numerical ratio; Solve based on the third function to obtain the imaging coordinates; Wherein, the target side is a side of the calibration ruler close to the light source. The second algebraic expression represents the ratio of a third distance to a fourth distance. The upper vertex coordinate and the lower vertex coordinate are respectively formed by imaging of each light source ray passing through the same altitude 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 altitude line. 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 on the same altitude line and the intersection point of the outgoing ray on the detector of the security inspection machine.

11. The method according to claim 8, wherein The device parameters include the scaling factor during the imaging of the security inspection machine. The calibration steps of the scaling factor include: Obtain the physical width of the calibration ruler, and obtain the difference between the vertex coordinates of two vertices on the bottom edge of the calibration ruler in the same cross-section in the second scanned image as the bottom edge coordinate difference; Based on the ratio of the physical width to the bottom edge coordinate difference, obtain the scaling factor.

12. The method according to claim 8, wherein The device parameters include the scaling factor during the imaging of the security inspection machine. The calibration steps of the scaling factor include: Detect the first pixel coordinates of the upper boundary point of the object to be measured in the first scanned image, and detect 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; Based on the first pixel coordinates and the second pixel coordinates, search for the scale line adjacent to the boundary point in the scale line sequence to obtain the first scale index; Based on the first scale index, the physical distance between adjacent scale lines on the calibration ruler, and the pixel distance between the boundary points, obtain the scaling factor when the security inspection machine images the object to be measured.

13. The method according to claim 12, characterized in that After 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, and before obtaining the scaling factor when the security inspection machine images the object to be measured based on the first scale index, the physical distance between adjacent scale lines on the calibration ruler, and the pixel distance between the boundary points, the method further includes: Obtain the difference between the first pixel coordinates and the second pixel coordinates of the first scale index as the first difference, and obtain the difference between the second pixel coordinates of the reference scale index and the second pixel coordinates of the first scale index as the second difference; wherein, the reference scale index is the scale index after the first scale index; Obtain the ratio of the first difference to the second difference as the additional scale index of the first scale index; The obtaining the scaling factor when the security inspection machine images the object to be measured based on the first scale index, the physical distance between adjacent scale lines on the calibration ruler, and the pixel distance between the boundary points includes: Based on the first scale index, the additional scale index, the physical distance, and the pixel distance, obtain the scaling factor when the security inspection machine images the object to be measured.

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 scanned image.

15. An object size measuring device, characterized in that, It includes: A measurement preparation module, configured 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 direction perpendicular to the traveling direction. A coordinate establishment module, 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; 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 the relative endpoints by imaging. A coefficient determination module, 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; 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. A radius solving module, configured to solve for the physical radius in the second coordinate system based on the endpoint coordinates, the device parameters, and the mapping coefficient.

16. An electronic device, characterized in that, It at least includes a memory and a processor coupled to each other. At least program instructions are stored in the memory, and the processor is configured to execute the program instructions to implement the object size measurement method according to any one of claims 1 to 14.

17. An X-ray security inspection system, characterized in that, It at least includes the electronic device according to claim 16.

18. A computer-readable storage medium, characterized in that, It stores program instructions that can be run by a processor, 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