CN112668676A - Package security inspection image processing method, electronic device and storage medium - Google Patents

Package security inspection image processing method, electronic device and storage medium Download PDF

Info

Publication number
CN112668676A
CN112668676A CN202011452584.8A CN202011452584A CN112668676A CN 112668676 A CN112668676 A CN 112668676A CN 202011452584 A CN202011452584 A CN 202011452584A CN 112668676 A CN112668676 A CN 112668676A
Authority
CN
China
Prior art keywords
mask
image
images
security inspection
continuous
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.)
Pending
Application number
CN202011452584.8A
Other languages
Chinese (zh)
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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202011452584.8A priority Critical patent/CN112668676A/en
Publication of CN112668676A publication Critical patent/CN112668676A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application relates to a package security check image processing method, an electronic device and a storage medium, belonging to the technical field of security check, wherein the package security check image processing method comprises the following steps: acquiring a plurality of continuous security inspection images acquired by a security inspection machine; carrying out mask processing on each security inspection image to obtain a plurality of mask images; detecting a mask area in each mask image, and judging whether the mask area in each mask image is communicated with a mask area in an adjacent mask image of the mask image; combining the mutually communicated mask regions in the plurality of mask images to obtain continuous mask regions; generating a parcel image determined by the continuous mask region, and outputting the parcel image. Through the application, the problem that the conventional security inspection machine cannot effectively identify complete parcel images and effectively identify the intensive conditions of a plurality of parcels is solved, and the parcel identification efficiency and accuracy are improved.

Description

Package security inspection image processing method, electronic device and storage medium
Technical Field
The present application relates to the field of security inspection technologies, and in particular, to a method for processing security inspection images of packages, an electronic device, and a storage medium.
Background
In the security inspection industry, X-rays are commonly used for detecting bags and luggage. Security check machines based on X-rays are widely used in airports, railway stations, subway stations, bus stations, hotels, shopping malls, schools, post offices, etc. The image of the X-ray security inspection machine is a false color image obtained by combining the penetration degree of X-ray to articles in the package with a color configuration scheme according to the absorption characteristic difference of different materials to X-ray.
At present, the detection of contraband on a security inspection image requires that a single parcel image is cut out and identified. Compared with a mode of not cutting packages, the accuracy of the security inspection result can be obviously improved by the cut single package image. However, the existing security inspection machine cannot effectively identify a complete parcel image and effectively identify the condition that a plurality of parcels are densely appeared.
Disclosure of Invention
The embodiment provides a package security inspection image processing method, an electronic device and a storage medium, so as to solve the problems that the existing security inspection machine in the related art cannot effectively identify a complete package image and effectively identify the condition that a plurality of packages are densely generated.
In a first aspect, there is provided in this embodiment a method for security image processing of a package, the method comprising:
acquiring a plurality of security inspection images, wherein the security inspection images are obtained by continuously scanning packages conveyed into a security inspection machine by the security inspection machine;
carrying out mask processing on each security inspection image to obtain a plurality of mask images;
detecting a mask area in each mask image, and judging whether the mask area in each mask image is communicated with a mask area in an adjacent mask image of the mask image;
combining the mutually communicated mask regions in the plurality of mask images to obtain continuous mask regions;
generating a parcel image determined by the continuous mask region, and outputting the parcel image.
In some of these embodiments, the masking process includes a binarization process.
In some embodiments, before merging mask regions in the plurality of mask images that are connected to each other to obtain a continuous mask region, the method further comprises:
and if the number of pixels of the mask area in the mask image is lower than a preset threshold value and no point is located on a splicing line of the mask image, deleting the mask area, wherein the splicing line of the mask image is the splicing line of the current mask image and the adjacent mask image.
In some of these embodiments, after determining whether a mask region in each of the mask images is in communication with a mask region in an adjacent one of the mask images, the method further comprises: in the case where a mask region in the mask image and a mask region in an adjacent mask image of the mask image are communicated with each other, the mutually communicated mask regions are marked with the same mark.
Merging mutually communicated mask regions in a plurality of mask images to obtain a continuous mask region, wherein the mask region comprises: and merging the mask areas with the same marks in a plurality of mask images to obtain the continuous mask areas.
In some of these embodiments, after determining whether a mask region in each of the mask images is in communication with a mask region in an adjacent one of the mask images, the method further comprises:
in case a mask region in said mask image is not interconnected with a mask region in an adjacent mask image of that mask image, mask regions which are not interconnected are marked with different marks.
In some embodiments, merging mask regions that are connected to each other in a plurality of said mask images, resulting in a contiguous mask region comprises:
after the mask area in the current mask image is judged to be communicated with the mask area in the previous mask image of the current mask image, judging whether intersection points exist between the mask area in the current mask image and the splicing lines of the mask image or not;
and under the condition that the intersection point between the mask area in the current mask image and at least one splicing line does not exist, combining the mutually communicated mask areas in the current mask image and the mask image before the current mask image into the continuous mask area.
In some of these embodiments, generating the parcel image determined by the continuous mask region comprises:
splicing a plurality of security inspection images to obtain continuous security inspection images;
and according to the continuous mask area, scratching the package image in the continuous security inspection image.
In some of these embodiments, each of the security images in the plurality of security images is stitched from a plurality of X-ray scanlines.
In a second aspect, the present embodiment provides an electronic device for identifying a package, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for processing a security image of a package according to the first aspect when executing the computer program.
In a fourth aspect, in the present embodiment, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the method for security image processing of packages according to the first aspect described above.
Compared with the related art, the package security inspection image processing method, the electronic device and the storage medium provided in the embodiment obtain a plurality of mask images by performing mask processing on a plurality of continuous security inspection images collected by a security inspection machine; detecting a mask area in each mask image, and judging whether the mask area in each mask image is communicated with a mask area in an adjacent mask image of the mask image; combining the mutually communicated mask regions in the plurality of mask images to obtain continuous mask regions; the package image determined by the continuous mask area is generated and output, so that the problems that the complete package image cannot be effectively identified and the condition that a plurality of packages are densely generated is effectively identified are solved, and the effect of improving the package detection accuracy of the security inspection machine is realized.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a block diagram showing a hardware configuration of a terminal of a security inspection image processing method of a package in one embodiment;
FIG. 2 is a first flowchart of a method for identifying a u-turn behavior of a vehicle according to an embodiment;
FIG. 3 is a flow chart diagram of a method for identifying a u-turn behavior of a motor vehicle according to an embodiment;
FIG. 4 is a flowchart III of a method for identifying a u-turn behavior of a motor vehicle according to an embodiment;
FIG. 5 is a first schematic diagram of a security image in a preferred embodiment;
FIG. 6 is a first schematic diagram of a mask image in a preferred embodiment;
FIG. 7 is a second schematic illustration of a mask image in a preferred embodiment.
Detailed Description
For a clearer understanding of the objects, aspects and advantages of the present application, reference is made to the following description and accompanying drawings.
Unless defined otherwise, technical or scientific terms used herein shall have the same general meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of this application do not denote a limitation of quantity, either in the singular or the plural. The terms "comprises," "comprising," "has," "having," and any variations thereof, as referred to in this application, are intended to cover non-exclusive inclusions; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or modules, but may include other steps or modules (elements) not listed or inherent to such process, method, article, or apparatus. Reference throughout this application to "connected," "coupled," and the like is not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference to "a plurality" in this application means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. In general, the character "/" indicates a relationship in which the objects associated before and after are an "or". The terms "first," "second," "third," and the like in this application are used for distinguishing between similar items and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or a similar computing device. For example, the method is executed on a terminal, and fig. 1 is a hardware configuration block diagram of the terminal of the security inspection image processing method for packages according to the embodiment. As shown in fig. 1, the terminal may include one or more processors 102 (only one shown in fig. 1) and a memory 104 for storing data, wherein the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely an illustration and is not intended to limit the structure of the terminal described above. For example, the terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to the security inspection image processing method of the package in the embodiment, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. The network described above includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In the present embodiment, a method for processing a security image of a package is provided, and fig. 2 is a flowchart of the method for processing a security image of a package according to the present embodiment, as shown in fig. 2, the flowchart includes the following steps:
step S201, a plurality of security inspection images are obtained, wherein the security inspection images are obtained by continuously scanning packages conveyed into the security inspection machine by the security inspection machine.
Step S202, each security inspection image is subjected to mask processing to obtain a plurality of mask images.
In step S203, the mask area in each mask image is detected, and it is determined whether the mask area in each mask image and the mask area in the adjacent mask image of the mask image are communicated with each other.
Step S204, combining the mutually communicated mask regions in the plurality of mask images to obtain a continuous mask region.
Step S205, generate the parcel image determined by the continuous mask area, and output the parcel image.
Taking an X-ray security inspection machine as an example, the X-ray security inspection machine scans packages on a conveyor belt of the security inspection machine using the X-ray machine, wherein each scan results in one X-ray scan line pattern, which typically has a pixel width of 1 pixel. Because the conveyor belt carries the package to move relative to the X-ray machine, each vertical line image of the package can be obtained through continuous scanning of the X-ray machine, and finally the security inspection image of the whole package can be obtained.
In this embodiment, the security inspection image may be one X-ray scan line image, or an image obtained by stitching X-ray scan lines scanned in a plurality of continuous times. For example, each security inspection image is formed by stitching X-ray scan lines obtained by 30 consecutive scanning times, and by such processing, 300X-ray scan lines originally need to undergo operations such as mask processing and connectivity determination, whereas when 10 security inspection images obtained by stitching X-ray scan lines obtained by 30 consecutive scanning times are subjected to the security inspection image processing described above, only 10 operations such as mask processing and connectivity determination are required. Therefore, the advantage of splicing a plurality of X-ray scanning line graphs is that the number of security inspection images processed in the security inspection image processing method can be reduced, thereby reducing the operation overhead of a computer.
In the above embodiment, the security inspection image is masked, so that the object region and the non-object region can be distinguished from each mask image, each mask region is analyzed, whether the mask region in each mask image is communicated with the mask region in the adjacent mask image is judged, then the communicated mask regions are combined to obtain a continuous mask region, that is, a plurality of object regions belonging to the same object are connected through the continuous mask region, so that a complete mask region of each parcel is obtained, and then the corresponding parcel image is deducted from the security inspection image.
In the steps, the judgment of the communication relation of all mask images is adopted to further carry out parcel identification. In the whole step, only mask processing is needed to be carried out on the security inspection images, and then the communication relation among all the mask images is judged respectively so as to realize package identification, a model is not needed to be built, feature extraction is not needed, and historical package feature matching is not needed; the processing method is simple to operate, and has small data processing amount and no high requirement on the memory of the computer equipment. Therefore, the package identification is carried out by adopting the steps, so that the complete package image can be effectively identified and the package identification efficiency is improved.
In some of the embodiments, the mask process in step S202 includes a binarization process.
And carrying out binarization processing on the acquired security inspection image to obtain a mask image. Because in the security check image that the security check machine obtained, because the existence of parcel, there are white region and non-white region in whole security check image, namely object existence region and air region. The security inspection image is binarized, and all pixels in a non-white area, that is, an object area are set to 0, and pixels in a white area, that is, an air area are set to 255. Thus, a mask image of the security check image is obtained.
In the steps, the package area is more prominent by performing binarization processing on the security inspection images, so that the communication relation of each security inspection image can be conveniently judged in the future.
In some of these embodiments, prior to step S204, the method further comprises: if the number of pixels of a mask area in a mask image is lower than a preset threshold value and no point is located on a splicing line of the mask image, deleting the mask area, wherein the splicing line of the mask image is the splicing line of the current mask image and the adjacent mask image.
When a security inspection machine acquires a security image, it is possible to capture some electronic noise, i.e., noise, generated by the sensors and circuitry. This noise is not the mask image of any parcel, but is simply a meaningless noisy region. If a detected mask area does not have a point located on the stitching line of the mask image, the number of pixels of the mask area can be detected. If the number of pixels is below a predetermined threshold, indicating that the mask region is generated by noise, the mask region may be deleted.
In the above steps, before further processing the mask area, the interference area is identified and deleted by judging the number and position of pixels of the mask area, so that the efficiency of parcel identification can be improved, and the interference judgment caused by noise points can be avoided.
In some embodiments, merging mask regions that are in communication with each other in the plurality of mask images to obtain a contiguous mask region comprises: after the mask area in the current mask image is judged to be communicated with the mask area in the previous mask image of the current mask image, judging whether intersection points exist between the mask area in the current mask image and the splicing lines of the mask image or not; and under the condition that the intersection point between the mask area in the current mask image and at least one splicing line does not exist, combining the mutually communicated mask areas in the current mask image and the mask image before the current mask image into a continuous mask area.
After determining that the mask region in the current mask image is communicated with the mask region in the previous mask image of the current mask image, it is necessary to determine whether there are other communicated regions in the communicated mask regions. At this time, it is determined whether the connected mask region has an intersection with the stitching line of the video mask image. If an intersection exists, it indicates that there is a possibility that a mask region communicating with a previously connected region exists in the next frame mask image. If no intersection exists, the connected region is a continuous mask region.
Through the above steps, it can be judged whether the merging of the mask regions is completed. If the merging of the mask regions has been completed, the subsequent steps are performed. And if the merging of the mask areas is not completed, continuously merging the mask areas which are communicated with the mask areas in the mask images corresponding to the security inspection images newly scanned by the security inspection machine into the merged mask areas until the continuous mask areas are finally obtained.
In some of these embodiments, generating the parcel image determined by the contiguous mask regions comprises: splicing a plurality of security inspection images to obtain continuous security inspection images; and according to the continuous mask area, the package image is scratched in the continuous security check image. Through the mode, the corresponding parcel images are scratched in the continuous security check images according to the continuous mask area, so that the parcel images of each individual parcel are obtained.
In the package security inspection image processing method, the obtained security inspection images are subjected to mask processing, then the communication relation of all the mask images is judged respectively, and the continuous mask area is obtained, so that the package images determined by the continuous mask area are generated, the package images are output, and the accuracy of package identification is improved.
The embodiment also provides a package security inspection image processing method. Fig. 3 is a flowchart of another security inspection image processing method for packages according to this embodiment, and as shown in fig. 3, the flowchart includes the following steps:
step S301, a plurality of security inspection images are obtained, wherein the security inspection images are obtained by continuously scanning packages conveyed into the security inspection machine by the security inspection machine.
Step S302, each security inspection image is subjected to mask processing to obtain a plurality of mask images.
In step S303, the mask area in each mask image is detected, and it is determined whether the mask area in each mask image and the mask area in the adjacent mask image of the mask image are connected to each other.
Step S304, in the case that the mask area in the mask image and the mask area in the adjacent mask image of the mask image are communicated with each other, marking the communicated mask areas as the same mark;
merging mutually communicated mask regions in the plurality of mask images to obtain a continuous mask region comprises: mask regions having the same mark in the plurality of mask images are merged to obtain a continuous mask region.
Step S305 merges mask regions in the plurality of mask images that are connected to each other, to obtain a continuous mask region.
Step S306, generating the parcel image determined by the continuous mask area, and outputting the parcel image.
And when the plurality of continuous security inspection images are subjected to mask processing, a plurality of mask images are obtained. Then, in the case where the mask regions in the mask images and the mask regions in the mask images adjacent to the mask images are communicated with each other, the communicated mask regions are marked with the same mark, and the mask regions having the same mark are merged. When each security check image is marked, the marking is carried out according to the communication relation of each security check image, so that the security check images belonging to the same package can be combined according to the marking.
In the above steps, after the security inspection image is masked, in the case that the mask regions in the mask image and the mask regions in the mask images adjacent to the mask image are communicated with each other, the mutually communicated mask regions are marked as the same mark, and then the mask regions with the same mark are merged, so that whether the adjacent security inspection images belong to the same parcel or not is easily distinguished, and it is helpful to identify and record all the mask regions of the same parcel. Therefore, package identification is carried out by judging and marking the communication relation of all mask images, and the accuracy of package identification is improved.
The present embodiment is described and illustrated below by means of preferred embodiments.
Fig. 4 is a preferred flowchart of the security inspection image processing method for packages according to the embodiment, and as shown in fig. 4, the security inspection image processing method for packages includes the following steps:
step S401, inputting a security inspection image of the X-ray security inspection machine.
In some of these embodiments, the image of the X-ray security inspection machine is scanned frame by frame along the direction of the conveyor belt, and the false color security inspection image T is obtained by the degree of penetration of the X-ray beam into the items in the package in combination with the color scheme based on the difference in the absorption characteristics of the different materials to the X-ray. Generally, different colors can be used for representation according to different article materials, and the background without an object is white. The width of the minimum security inspection image is the width of 1 pixel point. As shown in fig. 5a, the X-ray security inspection machine scans frame by frame along the running direction of the conveyor belt, and continuous security inspection images T1, T2, T3, T4 and … are obtained. For convenient display, the security inspection image in the image is an amplified result, and the width of the actual minimum security inspection image is 1 pixel point width.
Step S402, synchronously recording the mask image of the security inspection image in the buffer area.
In some embodiments, for the X-ray security inspection machine security inspection image input in step S401, the pixel values of all non-white areas are set to 0 (black), which indicates that there is an object in the area; and setting the pixel value of the rest area to be 255 (white), and indicating that the area is a background without an object, so that a binary mask image of the security inspection image of the X-ray security inspection machine can be obtained. And synchronously recording mask image blocks M with the width of D in the buffer area. Wherein D is more than or equal to a minimum security check image width unit and does not exceed the continuous imaging width W of the X-ray security check machine, namely:
1≤D≤W
as shown in fig. 5b and 5c, assuming that D is 4, the security check images T1, T2, T3 and T4 are processed to obtain binary mask images, and the four mask images are combined to form a mask image block M1Recording the data in a buffer area for judgment.
In step S403, it is determined whether a new mask area appears in the mask image block in the buffer area.
In some of these embodiments, the connected region having a pixel value of 0 is referred to as a mask region. For the mask image block M obtained in step S402, a plurality of mask regions may be obtained. If the mask area and all the mask areas of the previous mask image block cannot form a connected area, the mask area is a new mask area, and the step S404 is executed; otherwise, there is no new mask area, and the process proceeds to step S405. In particular, the first block mask image block M1All the mask areas appeared in (1) are new mask areas.
In some of these embodiments, as shown in FIG. 6, FIG. 6 is M in FIG. 5c1,M2And M3Mask image Block, M1Mask block exists S1 1And S1 2Two connected regions having a pixel value of 0, i.e., two mask regions. M1The mask regions appearing are all new mask regions, so S1 1And S1 2Two new mask regions. M2Mask block exists S2 1And S2 2Two connected regions having a pixel value of 0, i.e., two mask regions. Wherein S2 2With the last mask M1The mask area in (1) can not form a communication area and is a new mask area. In a similar way, in M3Middle S3 2And S3 3Two new mask regions.
In some of these embodiments, as shown in FIG. 7, FIG. 7 is M in FIG. 5c10-M14Mask image Block, M10There are three mask regions, where S10 1And S10 2Two new mask regions. M14Presence of S14 1And S14 2Two mask regions, wherein S14 2Is a new mask area.
Step S404, mark the new mask area as a new parcel.
In some embodiments, the new mask area that appears in step S403 may be from a new parcel or may be a portion of an existing parcel or may be noisy. And if the number of pixels in the new mask area is lower than the set threshold value Q and no point on the right boundary exists, the new mask area is a noise point and is deleted. And judging the rest mask areas as new packages uniformly. As shown in FIG. 6, S1 2,S2 2And S3 2If the number of pixels in the three new mask regions is lower than the set threshold Q and there is no point on the right boundary, the three new mask regions are noise and deleted.
In some of these embodiments, new packages are marked in order of appearance using a number starting with 1. New mask region S1 1And S3 3And marking the package numbers according to the appearance sequence. Wherein S is1 1Is B1, S3 3Is B2. As shown in FIG. 7, S10 1And S10 2The number of pixels of these two new mask regions is below the set threshold Q, but there are points located on the right border, then these two new mask regions are not noise and may be part of a new parcel, marked with parcel numbers in turn according to the order of appearance. In this example, S10 1Is marked as B5, S10 2Is labeled B6. S14 2The parcel number for the new mask field is labeled B7.
In step S405, it is determined whether a continuous mask area exists.
In some embodiments, regarding the mask regions of the mask image block M obtained in step S402, if a certain mask region of the previous mask image block and the mask region therein can constitute a connected region, the mask region is referred to as a continuous mask region. If the continuous mask area exists, go to step S406; otherwise, the process proceeds to step S407.
In some of these embodiments, as shown in FIG. 6, at M2In the mask block, S2 1The mask region can be aligned with M1S of masking block1 1The mask region constitutes a communicating region, so it is one continuous mask region. At M3In the mask block, S3 1The mask region can be aligned with M2S of masking block2 1The mask region constitutes a communicating region, so it is one continuous mask region. For the same reason, S in FIG. 710 3,S11 1,S12 1,S13 1,S14 1Is a continuous mask area.
Step S406, all the continuous mask areas are marked as the same parcel.
In some of these embodiments, for a contiguous mask region of the current mask image block, the same wrap mark is obtained as for the mask region where the last mask image block constitutes a connected area. If the continuous mask area of the current mask block can form a connected area with the plurality of mask areas of the previous mask block, the smallest wrap mark in the plurality of mask areas of the previous mask block is obtained, and a set of equivalent sequences is obtained. Equivalent sequences indicate that the package labels within the group belong to the same package.
In some of these embodiments, S is shown in FIG. 62 1Continuous mask area acquisition and S1 1The same package label, B1. S3 1Continuous mask area acquisition and S2 1The same parcel label, also B1.
In some of these embodiments, as shown in FIG. 7, M11Continuous mask zone S of a mask block11 1With the last mask M10Is masked by a mask region S10 1And S10 2Can form a communication region, S11 1Obtaining S10 1And S10 2The smallest package number marker among them, i.e.B 5, and a set of equivalent sequences (B5, B6) was obtained, which set of equivalent sequences indicated that the mask regions of package number markers B5 and B6 belong to the same package. Can judge S10 3,S12 1,S13 1,S14 1The package numbers of consecutive mask fields are labeled B4, B5, B5, B5, in that order.
In step S407, it is determined whether the continuous mask area is lost.
In some embodiments, for the mask regions of the mask image block M obtained in step S402, if the mask regions with the same parcel number mark are in the current mask block, there is no point on the right boundary; or if the current mask block does not have a certain parcel number marked mask area, the parcel with the parcel number marked loses the continuous mask area. If a certain parcel loses the continuous mask area, the step S408 is executed; otherwise, the process proceeds to step S409.
Step S408, outputting the package image without continuous mask area.
In some of these embodiments, for a parcel that has lost a contiguous mask extent, the mask extents in the cache extent having the same parcel number tag and the mask extents corresponding to the parcel number tags in the same set of equivalent sequences as the parcel number tag are merged as the mask image for the parcel for the output tag. And combining the mask image with the original security inspection image, matting and outputting the corresponding complete parcel image, and removing the corresponding parcel number marks and all parcel number marks in the same group of equivalent sequences.
In some of these embodiments, as shown in FIG. 6, at M3In the mask block, S3 1There is no point on the right boundary for the mask field, and the parcel labeled B1 loses a contiguous mask field. S with the package number labeled B11 1,S2 1,S3 1The mask regions are merged as a mask image of output parcel B1.
In some of these embodiments, as shown in FIG. 7, at M14In the mask block, S14The 1 mask field does not have a point on the right boundary and the parcel labeled B5 loses a contiguous mask field. Because there is an equivalent sequence (B5, B6), then the mask field with parcel number B6 will be merged with the mask field with parcel number B5 as the mask image output by parcel B5. In this embodiment, the mask areas marked with parcel numbers B5 and B6 are S10 1,S10 2,S11 1,S12 1,S13 1,S14 1
And step S409, judging whether to continue to cut the package.
In some embodiments, whether to continue slicing the package is determined by whether there is a package number tag that is not cleared.
In some embodiments, if the package is to be cut continuously, the next frame of security inspection image is input, otherwise, the system is in standby.
And step S410, in a standby state, if the incompletely cut packages exist in the step S409, reminding a user that the incompletely cut packages exist.
In some embodiments, in the standby state, if there is a parcel number mark that is not cleared, the user is reminded that there is an incompletely sliced parcel until all parcel number marks are cleared.
When the security inspection machine detects the packages, a phenomenon that a plurality of packages are inspected simultaneously may occur. The security check machine at this point does not autonomously identify each package in its entirety. However, if the image of the security inspection machine is sliced after being masked, a mask image block consisting of the mask image can be analyzed individually. And judging whether the plurality of mask areas belong to the same parcel or not by judging the continuity of the mask area in each mask image block and the mask areas in the adjacent mask image blocks. When the dense package phenomenon occurs, because a gap is certainly formed between every two packages, by the method, each mask image block is analyzed frame by frame, a complete package image can be identified, and the accuracy of package identification is improved.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here. For example, step S405 and step S406 may be interchanged.
There is also provided in this embodiment an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
and S1, acquiring a plurality of security images, wherein the security images are obtained by continuously scanning the packages conveyed into the security inspection machine by the security inspection machine.
S2, each security inspection image is masked to obtain a plurality of mask images.
S3, the mask area in each mask image is detected, and it is determined whether or not the mask area in each mask image and the mask area in the adjacent mask image of the mask image are connected to each other.
And S4, combining the mutually communicated mask areas in the plurality of mask images to obtain a continuous mask area.
S5, generating a parcel image determined by the continuous mask area, and outputting the parcel image.
It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementations, and details are not described again in this embodiment.
In addition, in combination with the security inspection image processing method for packages provided in the above embodiments, a storage medium may also be provided to implement the security inspection image processing method. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements the method for security image processing of packages of any of the above embodiments.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without any inventive step, shall fall within the scope of protection of the present application.
It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
The term "embodiment" is used herein to mean that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A package security inspection image processing method is characterized by comprising the following steps:
acquiring a plurality of security inspection images, wherein the security inspection images are obtained by continuously scanning packages conveyed into a security inspection machine by the security inspection machine;
carrying out mask processing on each security inspection image to obtain a plurality of mask images;
detecting a mask area in each mask image, and judging whether the mask area in each mask image is communicated with a mask area in an adjacent mask image of the mask image;
combining the mutually communicated mask regions in the plurality of mask images to obtain continuous mask regions;
generating a parcel image determined by the continuous mask region, and outputting the parcel image.
2. The package security inspection image processing method according to claim 1, wherein the mask process includes a binarization process.
3. The package security inspection image processing method of claim 1, wherein before merging mutually connected mask regions in a plurality of said mask images to obtain a continuous mask region, the method further comprises:
and if the number of pixels of the mask area in the mask image is lower than a preset threshold value and no point is located on a splicing line of the mask image, deleting the mask area, wherein the splicing line of the mask image is the splicing line of the current mask image and the adjacent mask image.
4. The package security image processing method according to claim 1,
after determining whether the mask region in each of the mask images and the mask region in the mask image adjacent to the mask image are communicated with each other, the method further includes: in the case where a mask region in the mask image and a mask region in an adjacent mask image of the mask image are communicated with each other, marking the communicated mask regions as the same mark;
merging mutually communicated mask regions in a plurality of mask images to obtain a continuous mask region, wherein the mask region comprises: and merging the mask areas with the same marks in a plurality of mask images to obtain the continuous mask areas.
5. The parcel security inspection image processing method according to claim 4, wherein after determining whether a mask region in each of the mask images and a mask region in an adjacent one of the mask images are connected to each other, the method further comprises:
in case a mask region in said mask image is not interconnected with a mask region in an adjacent mask image of that mask image, mask regions which are not interconnected are marked with different marks.
6. The package security inspection image processing method of claim 1, wherein merging mutually connected mask regions in the plurality of mask images to obtain a continuous mask region comprises:
after the mask area in the current mask image is judged to be communicated with the mask area in the previous mask image of the current mask image, judging whether intersection points exist between the mask area in the current mask image and the splicing lines of the mask image or not;
and under the condition that the intersection point between the mask area in the current mask image and at least one splicing line does not exist, combining the mutually communicated mask areas in the current mask image and the mask image before the current mask image into the continuous mask area.
7. The package security image processing method of claim 1, wherein generating the package image determined by the continuous mask field comprises:
splicing a plurality of security inspection images to obtain continuous security inspection images;
and according to the continuous mask area, scratching the package image in the continuous security inspection image.
8. The package security image processing method of claim 1, wherein each of the plurality of security images is stitched from a plurality of X-ray scanograms.
9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the method of security image processing of packages according to any of claims 1 to 8.
10. A storage medium having a computer program stored thereon, wherein the computer program is configured to execute the method for security image processing of a package according to any of claims 1 to 8 when the computer program is run.
CN202011452584.8A 2020-12-12 2020-12-12 Package security inspection image processing method, electronic device and storage medium Pending CN112668676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011452584.8A CN112668676A (en) 2020-12-12 2020-12-12 Package security inspection image processing method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011452584.8A CN112668676A (en) 2020-12-12 2020-12-12 Package security inspection image processing method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN112668676A true CN112668676A (en) 2021-04-16

Family

ID=75402497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011452584.8A Pending CN112668676A (en) 2020-12-12 2020-12-12 Package security inspection image processing method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112668676A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114602173A (en) * 2022-05-13 2022-06-10 上海英立视电子有限公司 Human body image clearing method and system in real-person game

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105261049A (en) * 2015-09-15 2016-01-20 重庆飞洲光电技术研究院 Quick detection method of image connection area
CN105303189A (en) * 2014-07-29 2016-02-03 阿里巴巴集团控股有限公司 Method and device for detecting specific identification image in predetermined area
CN108345888A (en) * 2018-02-11 2018-07-31 浙江华睿科技有限公司 A kind of connected domain extracting method and device
CN108596944A (en) * 2018-04-25 2018-09-28 普联技术有限公司 A kind of method, apparatus and terminal device of extraction moving target
CN112017218A (en) * 2020-09-09 2020-12-01 杭州海康威视数字技术股份有限公司 Image registration method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105303189A (en) * 2014-07-29 2016-02-03 阿里巴巴集团控股有限公司 Method and device for detecting specific identification image in predetermined area
CN105261049A (en) * 2015-09-15 2016-01-20 重庆飞洲光电技术研究院 Quick detection method of image connection area
CN108345888A (en) * 2018-02-11 2018-07-31 浙江华睿科技有限公司 A kind of connected domain extracting method and device
CN108596944A (en) * 2018-04-25 2018-09-28 普联技术有限公司 A kind of method, apparatus and terminal device of extraction moving target
CN112017218A (en) * 2020-09-09 2020-12-01 杭州海康威视数字技术股份有限公司 Image registration method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王祺奥;叶文华;熊田忠;黄河;黄艰生;卢剑锋;: "废有色金属分选中散布物料动态位置的实时计算", 机电工程, no. 01, pages 1 - 6 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114602173A (en) * 2022-05-13 2022-06-10 上海英立视电子有限公司 Human body image clearing method and system in real-person game
CN114602173B (en) * 2022-05-13 2022-08-05 上海英立视电子有限公司 Human body image clearing method and system in real-person game

Similar Documents

Publication Publication Date Title
CN109583535B (en) Vision-based logistics barcode detection method and readable storage medium
US8660373B2 (en) PDF de-chunking and object classification
CN107871122A (en) Safety check detection method, device, system and electronic equipment
CN114255436B (en) Security check image recognition system and method based on artificial intelligence
CN109977877B (en) Intelligent auxiliary image judging method, system and system control method for security inspection
CN110796412B (en) Parcel tracking method and related device
CN108073849B (en) Bar code detection method, device and system
CN102393397A (en) System and method for detecting surface defects of magnetic shoe
JPH07200770A (en) Tablet inspection system
CN204314911U (en) Based on identification label, the article of checked people are carried out to the system of safety inspection
JP2000011089A (en) Binarizing method for optical character recognition system
CN111461133B (en) Express delivery surface single item name identification method, device, equipment and storage medium
CN113139950A (en) Target object identification method and device
CN109427062A (en) Roadway characteristic labeling method, device, computer equipment and readable storage medium storing program for executing
CN112668676A (en) Package security inspection image processing method, electronic device and storage medium
US6516097B1 (en) Image segmentation system
CN114419006A (en) Method and system for removing watermark of gray level video characters changing along with background
CN105448095B (en) Method and apparatus are surveyed in a kind of yellow mark car test
KR100194776B1 (en) Surface inspection system
CN109508572A (en) A kind of object pose detection method, device, electronic equipment and storage medium
KR100498763B1 (en) The bar code reader and high-speed extraction system of bar code locating, the control method of this system
Ozturk et al. Core segmentation and fracture path detection using shadows
Sutheebanjard Decision tree for 3-D connected components labeling
CN113781327A (en) Security inspection image artifact removing method and device, security inspection machine, electronic device and medium
US7346193B2 (en) Method for detecting object traveling direction

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