CN112149658B - Target size determination method, system, electronic device and storage medium - Google Patents

Target size determination method, system, electronic device and storage medium Download PDF

Info

Publication number
CN112149658B
CN112149658B CN202011341673.5A CN202011341673A CN112149658B CN 112149658 B CN112149658 B CN 112149658B CN 202011341673 A CN202011341673 A CN 202011341673A CN 112149658 B CN112149658 B CN 112149658B
Authority
CN
China
Prior art keywords
size
pixel size
reference object
target object
placing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011341673.5A
Other languages
Chinese (zh)
Other versions
CN112149658A (en
Inventor
王凯
支洪平
郑伟伟
高少丹
诸鑫强
管睿
胡克任
李玉笛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Iflytek Suzhou Technology Co Ltd
Original Assignee
Iflytek Suzhou Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Iflytek Suzhou Technology Co Ltd filed Critical Iflytek Suzhou Technology Co Ltd
Priority to CN202011341673.5A priority Critical patent/CN112149658B/en
Publication of CN112149658A publication Critical patent/CN112149658A/en
Application granted granted Critical
Publication of CN112149658B publication Critical patent/CN112149658B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • G06V10/12Details of acquisition arrangements; Constructional details thereof
    • G06V10/14Optical characteristics of the device performing the acquisition or on the illumination arrangements
    • G06V10/143Sensing or illuminating at different wavelengths
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention provides a method and a system for determining the size of a target object, electronic equipment and a storage medium, which are used for detecting the target object in a security inspection image to obtain the placing angle and the pixel size of the target object, and determining the real size of the target object without any manual intervention by combining the pixel size of a reference object corresponding to the placing angle of the target object and the real size of the reference object, so that the determination result is more accurate. Moreover, the processing flow is shortened, the requirement of real-time performance is met, the working efficiency is improved, and the problems of missing report and personnel congestion are reduced. In addition, the embodiment of the invention utilizes the pixel size and the actual size of the reference object, can be suitable for different security inspection machines, and has stronger adaptability.

Description

Target size determination method, system, electronic device and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and a system for determining a size of an object, an electronic device, and a storage medium.
Background
With the rapid development of image processing technology, image processing and other technologies have been applied to various industries, such as the fields of security, human-computer interaction, medical images and the like, wherein the X-ray image processing technology in the security field is valued by more and more students and experts, how to further improve the X-ray image scanning security inspection efficiency has become a problem of general attention for industry intelligence upgrading. How to rapidly and automatically determine the size of the target object is an urgent problem to be solved.
In the existing solution, a passenger places an article carried with him on a conveyor belt of a security check machine, a related image of the article is displayed through a set display screen, a security check worker observes the displayed image to determine whether an object with a size required to be confirmed exists, if so, a package opening instruction is sent to a package opener, and the package opener opens a package to confirm the size of the object.
The method for determining the size of the target object has strong artificial subjective factors and long treatment process, and when a large number of images need to be processed, the processing speed is low, the method cannot adapt to real-time performance, and the security inspection efficiency is low.
Disclosure of Invention
To overcome the above problems or at least partially solve the above problems, embodiments of the present invention provide a method, a system, an electronic device, and a storage medium for determining a size of an object.
In a first aspect, an embodiment of the present invention provides a method for determining a size of an object, including:
detecting a target object in the security inspection image to obtain the placing angle and the pixel size of the target object;
and determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object and the actual size of the reference object.
Preferably, the pixel size of the reference object corresponding to the placing angle of the target object is determined by the following method:
selecting a reference placing angle closest to the placing angle of the target object from a plurality of placing angles of the reference object;
and taking the reference pixel size corresponding to the reference placing angle as the pixel size of the reference object corresponding to the placing angle of the target object.
Preferably, the reference pixel size corresponding to the reference placement angle is determined by the following method:
obtaining the placing positions of the reference objects in a plurality of sample security inspection images with placing angles as the reference placing angles;
and filtering the sample security inspection images with the placing positions as edge positions, and determining the reference pixel size corresponding to the reference placing angle based on the pixel sizes of the reference objects in all the filtered sample security inspection images.
Preferably, the actual size of the reference object is determined by the following method:
determining the actual size of the reference object based on the pixel size of the reference object in the sample security inspection image and the corresponding relation between the pixel size of the reference object and the actual size;
the corresponding relation between the pixel size of the reference object and the actual size is determined based on belt conveyor movement information of a security inspection machine and frame output rate and pixel movement information corresponding to a sample security inspection image.
Preferably, the correspondence between the pixel size of the reference object and the actual size is determined by the following method:
calculating the product of the frame rate and the number of the moving pixels in the pixel moving information;
and determining the corresponding relation between the pixel size of the reference object in the sample security inspection image and the actual size based on the ratio of the moving speed in the belt conveyor moving information to the product.
Preferably, the determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object, and the actual size of the reference object specifically includes:
determining a multiple relation between the pixel size of the target object and the pixel size of a reference object corresponding to the placing angle of the target object;
and determining the actual size of the target object based on the multiple relation and the actual size of the reference object.
Preferably, the security inspection image includes inspection images at a plurality of viewing angles, and the placement angle and the pixel size of the target include a placement angle and a pixel size at each viewing angle.
In a second aspect, an embodiment of the present invention provides an object size determining system, including:
the target detection module is used for detecting a target of the security inspection image to obtain the placing angle and the pixel size of the target;
and the size determining module is used for determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object and the actual size of the reference object.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement any of the steps of the object size determination method described above.
In a fourth aspect, embodiments of the present invention further provide a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the steps of the object size determination method according to any one of the above.
According to the method, the system, the electronic device and the storage medium for determining the size of the target object, provided by the embodiment of the invention, the target object detection is carried out on the security inspection image to obtain the placing angle and the pixel size of the target object, and the real size of the target object can be determined without any manual intervention by combining the pixel size of the reference object corresponding to the placing angle of the target object and the real size of the reference object, so that the determination result is more accurate. Moreover, the processing flow is shortened, the requirement of real-time performance is met, the working efficiency is improved, and the problems of missing report and personnel congestion are reduced. In addition, the embodiment of the invention utilizes the pixel size and the actual size of the reference object, can be suitable for different security inspection machines, and has stronger adaptability.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for determining a size of an object according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a target object sizing system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, when security check personnel perform security check, whether a target object with a size needing to be confirmed exists is determined by observing an image displayed by a security check machine, if so, a package opening instruction is sent to a package opener, and the size of the target object is confirmed by the package opener. The method for determining the size of the target object mainly depends on manual inspection to determine the size of the target object, so that not only does a great deal of training in advance for security personnel and experience accumulation of personal X-ray security images be required, but also the problem that the determined size of the target object is inaccurate due to subjective factors of the security personnel exists. Meanwhile, after the security check personnel find the target object with the size needing to be confirmed, the size of the target object can be judged only by transmitting the target object to a bag opener for bag opening confirmation, so that the disposal process is long. Moreover, if the size of the target object cannot be determined in time when the security check image is generated, there is a high possibility that the passenger has already left the security check area and cannot track the passenger. Especially in the peak period, if the packet inspection is not opened, the problem of missing report is easy to occur; if the target objects are met, all the objects are subjected to packet opening inspection one by one, the problem of personnel congestion is easily caused. Therefore, the embodiment of the invention provides a method for determining the size of a target object, so as to solve the technical problem.
Fig. 1 is a schematic flow chart of a method for determining a size of an object according to an embodiment of the present invention. As shown in fig. 1, the method for determining the size of the target object in the embodiment of the present invention includes:
s1, carrying out target object detection on the security inspection image to obtain the placing angle and the pixel size of the target object;
and S2, determining the actual size of the target object based on the pixel size of the target object, the pixel size of the reference object corresponding to the placing angle of the target object and the actual size of the reference object.
Specifically, in the method for determining the size of the target object provided in the embodiment of the present invention, an execution main body is a processor, which may specifically be a local processor, and may also be a cloud processor, where the local processor may specifically be a computer, a smart phone, a tablet computer, and the like. The processor is in communication connection with a camera device arranged on the security inspection machine, and the camera device is used for acquiring a security inspection image, wherein the security inspection image is an image of a package conveyed on a belt conveyor comprising the security inspection machine.
Step S1 is performed first. The target object refers to an article with a size to be determined contained in the security inspection image, and the step of detecting the target object on the security inspection image refers to identifying the security inspection image through an image identification method, so that the target object in the security inspection image is detected, and the placing angle and the pixel size of the target object are determined. The safety inspection image can be a two-dimensional image, the movement direction of the belt conveyor of the safety inspection machine is taken as the horizontal direction of the safety inspection image, and the included angle between the target object and the horizontal direction can be taken as the placing angle of the target object. In the security inspection image, the target object may be represented by a minimum bounding rectangle, and the minimum bounding rectangle may be a maximum range which is represented by two-dimensional coordinates and includes all line segments and two-dimensional shapes on the target object, that is, a rectangle obtained by taking end points of all line segments on the target object and a maximum abscissa, a minimum abscissa, a maximum ordinate and a minimum ordinate of all vertices of the two-dimensional shapes as boundaries. The two-dimensional shape may specifically comprise a polygon. Accordingly, the placing angle of the target object may specifically be an included angle between the longest edge of the minimum bounding rectangle representing the target object and the horizontal direction.
The pixel size is a size of the target object expressed in units of pixels (px) in the security inspection image, and may specifically include a length of a longest side of a minimum bounding rectangle of the target object in units of pixels and an area of the minimum bounding rectangle of the target object in units of pixels by pixels.
Then, step S2 is executed. In order to determine the actual size of the target object, a reference object needs to be set, and the reference object can be an article in a package conveyed on the belt conveyor or an article fixed at fixed positions on two sides of the belt conveyor. Because the sample security inspection image is a two-dimensional image obtained by projecting the three-dimensional stereo reference object, the placing angle of the reference object and the pixel size of the reference object have a one-to-one correspondence relationship. The pixel size of the reference object and the placing angle of the reference object can be determined in advance by carrying out reference object identification on the sample security inspection image, and the corresponding relation between the pixel size and the placing angle of the reference object can be determined.
The range of the placing angles of the reference object can be from 0 degree to 180 degrees, the interval angle between two adjacent placing angles can be determined according to the accuracy of the size of the target object, and the smaller the interval angle is, the higher the accuracy is. For example, the spacing angle may be set to 5 degrees. Since the pixel size of the reference can also be expressed as: the length of the longest side of the minimum bounding rectangle of the reference object in units of pixels and the area of the minimum bounding rectangle of the reference object in units of pixels by pixels. Therefore, the correspondence between the pixel size of the reference object and the placement angle of the reference object may be a correspondence between the placement angle of the reference object and the longest side length of the minimum bounding rectangle representing the reference object and the area of the minimum bounding rectangle, and may be specifically represented by a combination including three elements. For example, (0, 300, 40) indicates that the placement angle of the reference is 0, the area of the minimum bounding rectangle is 300 (px × px), and the length of the longest side of the minimum bounding rectangle is 40 (px).
The corresponding relation has universality, namely the corresponding relation not only can be suitable for a reference object, but also can be suitable for all articles in the packages conveyed on the belt conveyor. Further, from the angle of the target object to be placed obtained in step S1, the pixel size of the reference object corresponding to the angle of the target object to be placed can be determined from the above correspondence.
The actual size of the reference object can be obtained through actual measurement, and can also be determined through the corresponding relation between the pixel size in the security inspection image and the actual size and combining the pixel size of the reference object. It should be noted that the actual size of the reference object may be in units of millimeters or square millimeters.
Finally, after the pixel size of the target object, the pixel size of the reference object corresponding to the placing angle of the target object and the actual size of the reference object are determined, as the same corresponding relation exists between the pixel sizes and the actual sizes of different articles for the same security inspection machine, the actual size of the target object can be finally determined by combining the actual sizes of the reference object and the target object through the proportional relation between the pixel sizes of the target object and the reference object.
According to the target object size determining method provided by the embodiment of the invention, the placing angle and the pixel size of the target object are obtained by detecting the target object on the security inspection image, and the real size of the target object can be determined without any manual intervention by combining the pixel size of the reference object corresponding to the placing angle of the target object and the real size of the reference object, so that the determining result is more accurate. Moreover, the processing flow is shortened, the requirement of real-time performance is met, the working efficiency is improved, and the problems of missing report and personnel congestion are reduced. In addition, the embodiment of the invention utilizes the pixel size of the reference object corresponding to the placing angle of the target object and the actual size of the reference object, can be suitable for different security inspection machines, and has strong adaptability.
On the basis of the foregoing embodiment, in the method for determining a size of an object provided in an embodiment of the present invention, the pixel size of the reference object corresponding to the placement angle of the object is specifically determined by the following method:
selecting a reference placing angle closest to the placing angle of the target object from a plurality of placing angles of the reference object;
and taking the reference pixel size corresponding to the reference placing angle as the pixel size of the reference object corresponding to the placing angle of the target object.
Specifically, in the embodiment of the invention, when the pixel size of the reference object corresponding to the placement angle of the target object is determined, the sample security inspection images of the reference object at different included angles with the belt conveyor can be obtained, then the placement angle of the reference object in each sample security inspection image is obtained, and the placement angle closest to the placement angle of the target object is selected from the obtained multiple placement angles of the reference object as the reference placement angle. The most approximate meaning is that the obtained placing angle of the reference object is different from the placing angle of the target object, and the obtained absolute value of the difference is minimum. For example, when the plurality of placement angles of the reference object are 20 degrees, 35 degrees, and 40 degrees, respectively, and the placement angle of the target object is 32 degrees, the absolute values of the differences between the placement angles of the reference object and the placement angles of the target object are 12 degrees, 3 degrees, and 8 degrees, respectively, and the placement angle closest to the placement angle of the target object is 35 degrees, that is, the reference placement angle is 35 degrees.
Since the placement angle of the reference object corresponds to the pixel size of the reference object one by one, the placement angle of the reference object also corresponds to a pixel size, and the placement angle of the reference object is used as the reference pixel size. And finally, the size of the reference pixel can be used as the pixel size of the reference object corresponding to the placing angle of the target object.
In the embodiment of the invention, when the pixel size of the reference object corresponding to the placing angle of the target object is determined, the reference pixel size corresponding to the reference placing angle closest to the placing angle of the target object is equivalent to the pixel size of the reference object corresponding to the placing angle of the target object from the corresponding relation between the placing angle of the reference object and the pixel size, so that the determination process can be simplified, and the accuracy of the finally determined actual size of the target object can be ensured.
On the basis of the above embodiment, the reference pixel size corresponding to the reference placement angle is specifically determined by the following method:
obtaining the placing positions of the reference objects in a plurality of sample security inspection images with placing angles as the reference placing angles;
and filtering the sample security inspection images with the placing positions as edge positions, and determining the reference pixel size corresponding to the reference placing angle based on the pixel sizes of the reference objects in all the filtered sample security inspection images.
Specifically, when the reference pixel size corresponding to the reference placement angle is determined, since the reference object located at the edge position may not completely appear in the sample security inspection image, if the reference object located at the edge position is considered, a deviation will occur in the determined reference pixel size, and therefore to eliminate an influence of the pixel size of the reference object located at the edge position on the determination of the reference pixel size, the placement positions of the reference object in the plurality of sample security inspection images with the placement angle being the reference placement angle may be first obtained, and then the sample security inspection images with the placement positions being the edge positions may be filtered, that is, the sample security inspection images with the reference object located at the edge position are removed from the plurality of sample security inspection images.
And then, determining the reference pixel size corresponding to the reference placing angle according to the pixel sizes of the reference objects in all the filtered sample security inspection images. Specifically, statistical parameters of the pixel size of the reference object in all the filtered sample security inspection images, such as median, mean, or mode, may be calculated. It should be noted that, in order to ensure the reliability of the statistical parameters, the number of the sample security inspection images may be greater than a preset threshold, and a specific value of the preset threshold may be set as needed, for example, 5. And after calculating the statistical parameters, taking the statistical parameters as the reference pixel sizes corresponding to the reference placing angles.
In the embodiment of the invention, the sample security inspection image with the reference object at the edge position, which possibly causes interference, is filtered, and then the statistical parameters of the pixel size of the reference object in all the filtered sample security inspection images are used as the reference pixel size corresponding to the reference placement angle, so that the obtained reference pixel size has higher objectivity and higher accuracy, and the influence brought by the pixel size of the reference object in the single sample security inspection image is reduced.
On the basis of the foregoing embodiment, in the method for determining the size of the target object provided in the embodiment of the present invention, the actual size of the reference object is specifically determined by the following method:
determining the actual size of the reference object based on the pixel size of the reference object in the sample security inspection image and the corresponding relation between the pixel size of the reference object and the actual size;
the corresponding relation between the pixel size of the reference object and the actual size is determined based on belt conveyor movement information of a security inspection machine and frame output rate and pixel movement information corresponding to a sample security inspection image.
Specifically, when the actual size of the reference object is determined, the actual size can be obtained by actual measurement on the one hand, and on the other hand, the actual size can also be determined by the correspondence between the pixel size in the security inspection image and the actual size. In the embodiment of the invention, the corresponding relation can be determined by the related information corresponding to the sample security inspection image containing the reference object and the belt conveyor related information of the security inspection machine. According to the corresponding relation, the actual size of the reference object can be determined by combining the pixel size of the reference object in the sample security inspection image determined by the image identification method.
When determining the corresponding relationship between the pixel size of the reference object and the actual size, the belt conveyor movement information of the security inspection machine, the frame output rate corresponding to the sample security inspection image, and the pixel movement information corresponding to each frame of sample security inspection image may be determined first. The belt conveyor movement information specifically comprises belt conveyor movement speed, and the unit is millimeter per second. The frame output rate corresponding to the sample security inspection image refers to the number of generated image frames per second, and the unit is fps, namely frames per second. The pixel movement information corresponding to each frame of sample security inspection image refers to the position change of the article on the fixed position of the belt conveyor on different frame images, and the unit is a pixel. Taking the reference object as an example, the pixel movement information corresponding to each frame of the sample security inspection image refers to the number of moving pixels of each frame of the reference object.
After the belt conveyor movement information, the frame output rate and the pixel movement information are determined, the corresponding relationship between the pixel size and the actual size can be determined according to the conversion relationship among the units of the belt conveyor movement information, the frame output rate and the pixel movement information, and the corresponding relationship can also be realized in other ways. For example, the obtained correspondence between the pixel size and the actual size is: 1 (px) = k (mm), that is, when the pixel size is 1 (px), the corresponding actual size is k (mm). If the pixel size of the reference object is: the longest edge of the minimum circumscribed rectangle representing the reference object is H (px), the shortest edge is W (px), and the actual size of the reference object is as follows: the longest side L = H × k (mm), the shortest side W × k (mm), and the projected area on the horizontal plane when the reference level is placed on the belt conveyor of the security inspection machine is S = k × W × H.
In the embodiment of the invention, the actual size of the reference object can be automatically determined by combining the pixel size of the reference object with the corresponding relation between the pixel size and the actual size, and compared with an actual measurement mode, the method is more accurate, and the introduction of measurement errors is avoided.
On the basis of the foregoing embodiment, in the target object size determining method provided in the embodiment of the present invention, the correspondence between the pixel size of the reference object and the actual size is specifically determined by the following method:
calculating the product of the frame rate and the number of the moving pixels in the pixel moving information;
and determining the corresponding relation between the pixel size of the reference object in the sample security inspection image and the actual size based on the ratio of the moving speed in the belt conveyor moving information to the product.
Specifically, when determining the correspondence between the pixel size and the actual size of the reference object in the sample security inspection image, the product of the frame rate and the number of moving pixels in the pixel movement information may be calculated, and if the frame rate is F (fps), the number of moving pixels is M (px), and the product of the frame rate and the number of moving pixels is F (fps) px. And then, combining the moving speed in the moving information of the belt conveyor, specifically calculating the ratio of the moving speed to the product. Let the moving speed be V (mm/s), there is V/(M × F) (mm/(frame × px)), that is, there is 1 (px) = V/(M × F) (mm/frame), that is, it means that the pixel size in each image is 1 (px), and the corresponding actual size is V/(M × F) (mm), that is, there is k = V/(M × F).
In the embodiment of the invention, the corresponding relation between the pixel size of the reference object and the actual size can be automatically determined through the belt conveyor movement information, the frame output rate and the pixel movement information, so that the actual size of the reference object can be accurately determined.
On the basis of the foregoing embodiment, the method for determining a size of an object according to an embodiment of the present invention includes, based on a pixel size of the object, a pixel size of a reference object corresponding to a placement angle of the object, and an actual size of the reference object, determining the actual size of the object, specifically:
determining a multiple relation between the pixel size of the target object and the pixel size of a reference object corresponding to the placing angle of the target object;
and determining the actual size of the target object based on the multiple relation and the actual size of the reference object.
Specifically, in the embodiment of the present invention, when determining the actual size of the target object, a multiple relationship between the pixel size of the target object and the pixel size of the reference object corresponding to the placement angle of the target object may be determined, that is, a ratio between the pixel size of the target object and the pixel size of the reference object corresponding to the placement angle of the target object is determined, and the ratio is set to be N. The actual size of the target object can be determined according to the ratio N and the actual size of the reference object. For example, the longest side in the actual size of the target is L '= L × N, and the projected area on the horizontal plane in the actual size of the target is S' = S × N.
In the embodiment of the invention, the actual size of the target object is determined according to the multiple relation between the pixel size of the target object and the pixel size of the reference object corresponding to the placing angle of the target object, and an artificial measuring process is not required to be introduced, so that the result is more reliable.
On the basis of the above embodiment, in the target size determining method provided in the embodiment of the present invention, the security inspection image includes detection images of a plurality of viewing angles, and the placement angle and the pixel size of the target include a placement angle and a pixel size at each viewing angle.
Specifically, as the mainstream security inspection machines in the current market are basically single-view angle machines, under the condition that the placing angle of the target object is not proper, the security inspection personnel cannot judge the size of the target object according to the security inspection image; even with a dual-view machine, a security inspector cannot simultaneously observe the frames of the two screens to determine the size of the target object. Due to factors such as the color and the size of an X-ray image of each security check machine manufacturer, the adaptability of security check personnel is not strong, and the security check machines of different brands and models cannot be compatible. For this reason, the security inspection image adopted in the embodiment of the present invention may specifically include a detection image of a plurality of viewing angles, and the plurality of viewing angles may specifically include a front viewing angle and a side viewing angle. Wherein, the front view angle is that the camera device that sets up in security check machine inboard upper portion and optical axis are located vertical side can acquire the security check image that includes the parcel on the belt feeder directly below, and the side view angle sets up on the lateral wall of security check machine inboard and the camera device that optical axis and vertical direction become certain contained angle, can acquire the security check image that includes the parcel on the belt feeder in certain azimuth. Correspondingly, the obtained placing angle and pixel size of the target object can be specifically the placing angle and pixel size at each visual angle, so that the actual size of the target object at each visual angle is determined, and the three-dimensional actual size of the target object is comprehensively determined.
In the embodiment of the invention, the multi-view data source is used as the data set, so that the data volume is richer, and the accuracy of the size estimation result is effectively improved.
As shown in fig. 2, on the basis of the above embodiment, an embodiment of the present invention provides an object size determining system, including: an object detection module 21 and a size determination module 22. Wherein the content of the first and second substances,
the target object detection module 21 is used for detecting a target object in the security inspection image to obtain a placing angle and a pixel size of the target object;
the size determining module 22 is configured to determine the actual size of the target object based on the pixel size of the target object, the pixel size of the reference object corresponding to the placing angle of the target object, and the actual size of the reference object.
Specifically, the functions of the modules in the target object size determining system provided in the embodiment of the present invention correspond to the operation flows of the steps in the method embodiments one to one, and the achieved effects are also consistent.
On the basis of the above embodiment, an embodiment of the present invention provides an object size determining system, further including a pixel size determining module, configured to:
selecting a reference placing angle closest to the placing angle of the target object from a plurality of placing angles of the reference object;
and taking the reference pixel size corresponding to the reference placing angle as the pixel size of the reference object corresponding to the placing angle of the target object.
On the basis of the foregoing embodiment, an embodiment of the present invention provides an object size determining system, where the pixel size determining module specifically includes a reference pixel size determining submodule, configured to:
obtaining the placing positions of the reference objects in a plurality of sample security inspection images with placing angles as the reference placing angles;
and filtering the sample security inspection images with the placing positions as edge positions, and determining the reference pixel size corresponding to the reference placing angle based on the pixel sizes of the reference objects in all the filtered sample security inspection images.
On the basis of the above embodiment, an embodiment of the present invention provides an object size determining system, further including an actual size module, configured to:
determining the actual size of the reference object based on the pixel size of the reference object in the sample security inspection image and the corresponding relation between the pixel size of the reference object and the actual size;
the corresponding relation between the pixel size of the reference object and the actual size is determined based on belt conveyor movement information of a security inspection machine and frame output rate and pixel movement information corresponding to a sample security inspection image.
On the basis of the above embodiment, an embodiment of the present invention provides a target object size determining system, further including a correspondence determining module, configured to:
calculating the product of the frame rate and the number of the moving pixels in the pixel moving information;
and determining the corresponding relation between the pixel size of the reference object in the sample security inspection image and the actual size based on the ratio of the moving speed in the belt conveyor moving information to the product.
On the basis of the above embodiments, an embodiment of the present invention provides a target object size determining system, where the size determining module is specifically configured to:
determining a multiple relation between the pixel size of the target object and the pixel size of a reference object corresponding to the placing angle of the target object;
and determining the actual size of the target object based on the multiple relation and the actual size of the reference object.
On the basis of the above embodiments, an embodiment of the present invention provides a target size determination system, where the security inspection image includes detection images of multiple viewing angles, and the placement angle and the pixel size of the target include a placement angle and a pixel size at each viewing angle.
Fig. 3 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 3: a processor (processor)310, a communication Interface (communication Interface)320, a memory (memory)330 and a communication bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 communicate with each other via the communication bus 340. Processor 310 may invoke logic instructions in memory 330 to perform a method of object sizing, the method comprising: detecting a target object in the security inspection image to obtain the placing angle and the pixel size of the target object; and determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object and the actual size of the reference object.
It should be noted that, when being implemented specifically, the electronic device in this embodiment may be a server, a PC, or other devices, as long as the structure includes the processor 310, the communication interface 320, the memory 330, and the communication bus 340 shown in fig. 3, where the processor 310, the communication interface 320, and the memory 330 complete mutual communication through the communication bus 340, and the processor 310 may call the logic instruction in the memory 330 to execute the above method. The embodiment does not limit the specific implementation form of the electronic device.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, an embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the method for determining the size of an object provided by the above-mentioned method embodiments, and the method includes: detecting a target object in the security inspection image to obtain the placing angle and the pixel size of the target object; and determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object and the actual size of the reference object.
In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented by a processor to execute the method for determining the size of an object provided in the foregoing embodiments, and the method includes: detecting a target object in the security inspection image to obtain the placing angle and the pixel size of the target object; and determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object and the actual size of the reference object.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. A method of determining a size of an object, comprising:
detecting a target object in the security inspection image to obtain the placing angle and the pixel size of the target object;
determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object and the actual size of the reference object;
the actual size of the reference object is determined by the following method:
determining the actual size of the reference object based on the pixel size of the reference object in the sample security inspection image and the corresponding relation between the pixel size of the reference object and the actual size;
the corresponding relation between the pixel size of the reference object and the actual size is determined based on belt conveyor movement information of a security inspection machine and frame output rate and pixel movement information corresponding to a sample security inspection image;
the corresponding relation between the pixel size and the actual size of the reference object is determined by the following method:
calculating the product of the frame rate and the number of the moving pixels in the pixel moving information;
determining the corresponding relation between the pixel size of the reference object in the sample security inspection image and the actual size based on the ratio of the moving speed in the belt conveyor moving information to the product;
the pixel size of the reference object corresponding to the placing angle of the target object is determined by the following method:
selecting a reference placing angle closest to the placing angle of the target object from a plurality of placing angles of the reference object;
taking the reference pixel size corresponding to the reference placing angle as the pixel size of the reference object corresponding to the placing angle of the target object;
the reference pixel size corresponding to the reference placing angle is specifically determined by the following method:
obtaining the placing positions of the reference objects in a plurality of sample security inspection images with placing angles as the reference placing angles;
filtering the sample security inspection images with the placing positions as edge positions, and determining the reference pixel size corresponding to the reference placing angle based on the pixel sizes of the reference objects in all the filtered sample security inspection images;
the selecting a reference placing angle closest to the placing angle of the target object from the plurality of placing angles of the reference object further includes:
identifying a reference object on a sample security inspection image, determining the pixel size of the reference object and the placement angle of the reference object, and determining the corresponding relation between the pixel size of the reference object and the placement angle of the reference object;
the correspondence between the pixel size of the reference object and the placement angle of the reference object is a correspondence between the placement angle of the reference object, the longest side length of the minimum bounding rectangle representing the reference object, and the area of the minimum bounding rectangle, and is represented by a combination including three elements.
2. The method for determining the size of the target object according to claim 1, wherein the determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object, and the actual size of the reference object specifically comprises:
determining a multiple relation between the pixel size of the target object and the pixel size of a reference object corresponding to the placing angle of the target object;
and determining the actual size of the target object based on the multiple relation and the actual size of the reference object.
3. The method of any one of claims 1-2, wherein the security image comprises a plurality of inspection images from a plurality of viewing angles, and the angle of view and the pixel size of the object comprise the angle of view and the pixel size at each viewing angle.
4. An object sizing system, comprising:
the target detection module is used for detecting a target of the security inspection image to obtain the placing angle and the pixel size of the target;
the size determining module is used for determining the actual size of the target object based on the pixel size of the target object, the pixel size of a reference object corresponding to the placing angle of the target object and the actual size of the reference object;
the actual size determining module is used for determining the actual size of the reference object based on the pixel size of the reference object in the sample security inspection image and the corresponding relation between the pixel size of the reference object and the actual size;
the corresponding relation between the pixel size of the reference object and the actual size is determined based on belt conveyor movement information of a security inspection machine and frame output rate and pixel movement information corresponding to a sample security inspection image;
a pixel size determining module, configured to calculate a product of the frame rate and a number of moving pixels in the pixel movement information; determining the corresponding relation between the pixel size of the reference object in the sample security inspection image and the actual size based on the ratio of the moving speed in the belt conveyor moving information to the product;
further comprising a pixel size determination module for:
selecting a reference placing angle closest to the placing angle of the target object from a plurality of placing angles of the reference object;
taking the reference pixel size corresponding to the reference placing angle as the pixel size of the reference object corresponding to the placing angle of the target object;
the pixel size determination module specifically includes a reference pixel size determination submodule configured to:
obtaining the placing positions of the reference objects in a plurality of sample security inspection images with placing angles as the reference placing angles;
filtering the sample security inspection images with the placing positions as edge positions, and determining the reference pixel size corresponding to the reference placing angle based on the pixel sizes of the reference objects in all the filtered sample security inspection images;
the pixel size determination module is further to:
identifying a reference object on a sample security inspection image, determining the pixel size of the reference object and the placement angle of the reference object, and determining the corresponding relation between the pixel size of the reference object and the placement angle of the reference object;
the correspondence between the pixel size of the reference object and the placement angle of the reference object is a correspondence between the placement angle of the reference object, the longest side length of the minimum bounding rectangle representing the reference object, and the area of the minimum bounding rectangle, and is represented by a combination including three elements.
5. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the object sizing method according to any of claims 1 to 2 are performed when the program is executed by the processor.
6. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the object dimensioning method according to one of claims 1 to 2.
CN202011341673.5A 2020-11-26 2020-11-26 Target size determination method, system, electronic device and storage medium Active CN112149658B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011341673.5A CN112149658B (en) 2020-11-26 2020-11-26 Target size determination method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011341673.5A CN112149658B (en) 2020-11-26 2020-11-26 Target size determination method, system, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN112149658A CN112149658A (en) 2020-12-29
CN112149658B true CN112149658B (en) 2021-03-26

Family

ID=73887409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011341673.5A Active CN112149658B (en) 2020-11-26 2020-11-26 Target size determination method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112149658B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765696B (en) * 2021-04-06 2021-06-29 浙江大胜达包装股份有限公司 Automatic paper product packaging matching design method and platform based on product image analysis
CN113960075A (en) * 2021-10-14 2022-01-21 科大讯飞(苏州)科技有限公司 Security check equipment, article size determination method, storage medium and equipment
CN115423996B (en) * 2022-08-18 2023-09-22 成都智元汇信息技术股份有限公司 Method, electronic equipment and medium for extracting parcel pictures based on parcel movement

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108288288A (en) * 2018-01-16 2018-07-17 华东交通大学 Accurate shaft size measurement method, the device and system of view-based access control model identification
CN109405736A (en) * 2018-10-09 2019-03-01 东莞市北井光控科技有限公司 Semiconducter IC component size measurement method, device and terminal device
CN111985266A (en) * 2019-05-21 2020-11-24 顺丰科技有限公司 Scale map determination method, device, equipment and storage medium
CN111986250A (en) * 2019-05-22 2020-11-24 顺丰科技有限公司 Object volume measuring method, device, measuring equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110246124B (en) * 2019-05-24 2021-05-28 西安交通大学 Target size measuring method and system based on deep learning
CN110935644B (en) * 2019-12-27 2020-12-29 江南大学 Bearing needle roller size detection system and method based on machine vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108288288A (en) * 2018-01-16 2018-07-17 华东交通大学 Accurate shaft size measurement method, the device and system of view-based access control model identification
CN109405736A (en) * 2018-10-09 2019-03-01 东莞市北井光控科技有限公司 Semiconducter IC component size measurement method, device and terminal device
CN111985266A (en) * 2019-05-21 2020-11-24 顺丰科技有限公司 Scale map determination method, device, equipment and storage medium
CN111986250A (en) * 2019-05-22 2020-11-24 顺丰科技有限公司 Object volume measuring method, device, measuring equipment and storage medium

Also Published As

Publication number Publication date
CN112149658A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN112149658B (en) Target size determination method, system, electronic device and storage medium
US10706525B2 (en) Methods and systems for improved quality inspection
US20190362480A1 (en) Methods and system for improved quality inspection
EP2848002B1 (en) Apparatus and method for processing 3d information
US10445868B2 (en) Method for detecting a defect on a surface of a tire
EP3434626A1 (en) Projection instruction device, parcel sorting system, and projection instruction method
JP2013530380A5 (en)
EP3434622A1 (en) Instruction projecting device, package sorting system and instruction projecting method
DE112016005287T5 (en) METHOD AND SYSTEMS FOR TANK ASSESSMENT
CN114694064B (en) Graph cutting method and system based on target recognition
EP3434621A1 (en) Instruction projecting device, package sorting system and instruction projecting method
CN105092473A (en) Polysilicon thin film quality detection method and system
WO2020079694A1 (en) Optimizing defect detection in an automatic visual inspection process
CN113393448A (en) Deformation detection method, device and equipment and computer readable storage medium
CN111524136A (en) Boxing abnormality detection system and method
CN113960075A (en) Security check equipment, article size determination method, storage medium and equipment
CN113391776A (en) Article information display method, article information display device, electronic device, and storage medium
US11921494B2 (en) Rapid automation system and method for line clearance
CN112396649A (en) Image processing method, image processing apparatus, computer system, and readable storage medium
CN115880365A (en) Double-station automatic screw screwing detection method, system and device
CN105530505A (en) Three-dimensional image conversion method and device
CN114861846A (en) Code scanning acquisition method and device, storage medium and electronic device
CN115457330A (en) Method, device and equipment for identifying broken wire state of packing wire and storage medium
CN112139050B (en) Cooperative light inspection method and system for high-speed product transmission
CN211669096U (en) Bubble cap type packaged medicine defect online detection device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant