A method, device, medium and electronic equipment based on DR imaging
Patent Information
- Application Number
- CN202610694293.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-20
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2046-05-20
AI Technical Summary
[0006]基于此,本发明的目的是提供一种基于DR成像的分包方法、装置、介质及电子设备,旨在解决传统光障分包易受干扰、稳定性差、图像易缺失或冗余的问题
[0011] In the above technical solution, firstly, an air background frame image is acquired in the unpackaged scanning state, and then continuous frame images are acquired in real time after the detector scans the package. Pure image data is used as the basis for package separation judgment, eliminating reliance on entrance light barrier signals and fundamentally avoiding external interference such as lead curtain swaying, package outward swinging, equipment vibration, and dust accumulation, thus improving the stability and reliability of the package separation process. Then, by segmenting each frame image into regions, the average grayscale value of each segmented region is calculated and compared with a preset air grayscale limit. This accurately distinguishes air regions from package regions, effectively avoiding recognition deviations caused by whole-frame grayscale judgment and improving the accuracy of package detection. Specifically, when the average grayscale value of at least one segmented region image is less than the preset air grayscale limit, object detection information is obtained from the current frame image based on the latest air background frame. This eliminates background grayscale drift interference caused by detector installation deviation, equipment displacement, and ray energy attenuation, ensuring the authenticity and reliability of object detection information. Next, by judging whether the object detection information meets the preset valid object requirements, small noise and invalid interference can be filtered out, further reducing the false judgment rate. Ultimately, when the requirements for a valid object are met, a complete scan image of the corresponding package is generated based on the detection information and a unique package number is assigned. This can accurately identify the beginning and end of the package, avoiding problems such as incomplete scanning or excessive redundant blanks caused by package jamming or timing deviations. This ensures that the package image is complete and clear, providing stable and reliable data support for subsequent person-package association and baggage tracking.
Smart Images

Figure CN122223029B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of security inspection technology, and in particular to a method, apparatus, medium and electronic equipment for packaging based on DR imaging. Background Technology
[0002] Digital radiography (DR) is a technology that directly acquires X-ray images using a digital detector based on the attenuation characteristics of X-rays or gamma rays as they penetrate matter. When rays penetrate an object being inspected, the intensity of the rays received by the detector varies depending on the degree of absorption by different parts of the object, thus forming a digital image that reflects the internal structure of the object.
[0003] In the field of security inspection, top-down penetration images of inspected packages are typically obtained using DR (Digital Radio Frequency) detector systems. To achieve person-package correlation, baggage tracking, and the identification of suspicious packages, continuous scanning data needs to be segmented independently for each package, ensuring each package corresponds to a complete scan image. This also involves removing redundant blank pixels at the beginning and end of the image, simplifying data storage, and improving image processing efficiency. In high-speed operation scenarios, packages are continuously transported with short intervals; therefore, a package segmentation algorithm is required to automatically segment the scan data and match package numbers, ensuring the integrity and independence of the package images.
[0004] Currently, the commonly used method is the parcel segmentation method based on the light barrier signal at the entrance of the security checkpoint. Its core working logic is as follows: the beginning and end of the parcel are detected by the light barrier signal at the entrance of the security checkpoint. Combined with the speed of the conveyor belt, the time node when the parcel arrives at the scanning slot of the detector in the channel is calculated. Based on this time, the detector scanning data is captured to complete the segmentation and parcel number generation of a single parcel image.
[0005] However, the light barrier signal is susceptible to external interference, leading to false triggering. Swinging of the lead curtain or dragging of packages can affect signal accuracy and cause sorting anomalies. Furthermore, packages can easily get stuck at the channel entrance, triggering the entrance light barrier but failing to enter the scanning channel properly. This causes a deviation in the equipment's calculation of when the package arrives at the scanning seam, resulting in incomplete package images or large blank areas. In addition, after prolonged use, the light barrier's stability decreases due to vibration, friction within the channel, and dust accumulation, leading to abnormal sorting images and affecting subsequent image interpretation and package sorting. Summary of the Invention
[0006] Based on this, the purpose of the present invention is to provide a packaging method, device, medium and electronic device based on DR imaging, which aims to solve the problems of traditional light barrier packaging being susceptible to interference, having poor stability, and having images that are easily missing or redundant.
[0007] In a first aspect, the present invention provides a sub-packaging method based on DR imaging, the method comprising: Acquire an air background frame image, which is a frame image captured by the detector in a scan state without any envelopment; Real-time acquisition of continuous frame images after the detector scans the package; Each frame of the continuous frame images is segmented into regions to generate multiple segmented region images; Calculate the average gray value of each segmented region image, and compare the average gray value with a preset air gray value limit. If the average grayscale value of all the segmented region images is greater than or equal to the preset air grayscale limit, then the air background frame image is updated to the current frame image; If the average grayscale value of at least one of the segmented region images is less than the preset air grayscale limit, then object detection information is obtained from the current frame image based on the latest air background frame image; Determine whether the object detection information meets the preset valid object requirements; If the preset valid object requirement is not met, the air background frame image is updated to the current frame image; If the preset valid object requirements are met, a complete scan image of the corresponding package is generated based on the object detection information, and a unique package number is assigned to the complete scan image.
[0008] Secondly, the present invention provides a sub-packaging device based on DR imaging, the device comprising: The first acquisition module is used to acquire an air background frame image, which is a frame image acquired by the detector in a scan state without a package. The second acquisition module is used to acquire continuous frame images of the package after the detector scans it in real time. The segmentation module is used to segment each frame of the continuous frame images into regions to generate multiple segmented region images; The first determination module is used to calculate the average gray value of each segmented region image and compare the average gray value with a preset air gray value limit. The first update module is used to update the air background frame image to the current frame image if the average gray value of all the segmented region images is greater than or equal to the preset air gray value limit. The detection module is used to obtain object detection information from the current frame image based on the latest air background frame image if the average gray value of at least one of the segmented region images is less than the preset air gray value limit. The second determination module is used to determine whether the object detection information meets the preset valid object requirements; The second update module is used to update the air background frame image to the current frame image if the object detection information does not meet the preset valid object requirements. The sub-package stitching module is used to generate a complete scan image of the corresponding package based on the object detection information if the object detection information meets the preset valid object requirements, and to assign a unique package number to the complete scan image.
[0009] Thirdly, the present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.
[0010] Fourthly, the present invention provides an electronic device, comprising: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect.
[0011] In the above technical solution, firstly, an air background frame image is acquired in the unpackaged scanning state, and then continuous frame images are acquired in real time after the detector scans the package. Pure image data is used as the basis for package separation judgment, eliminating reliance on entrance light barrier signals and fundamentally avoiding external interference such as lead curtain swaying, package outward swinging, equipment vibration, and dust accumulation, thus improving the stability and reliability of the package separation process. Then, by segmenting each frame image into regions, the average grayscale value of each segmented region is calculated and compared with a preset air grayscale limit. This accurately distinguishes air regions from package regions, effectively avoiding recognition deviations caused by whole-frame grayscale judgment and improving the accuracy of package detection. Specifically, when the average grayscale value of at least one segmented region image is less than the preset air grayscale limit, object detection information is obtained from the current frame image based on the latest air background frame. This eliminates background grayscale drift interference caused by detector installation deviation, equipment displacement, and ray energy attenuation, ensuring the authenticity and reliability of object detection information. Next, by judging whether the object detection information meets the preset valid object requirements, small noise and invalid interference can be filtered out, further reducing the false judgment rate. Ultimately, when the requirements for a valid object are met, a complete scan image of the corresponding package is generated based on the detection information and a unique package number is assigned. This can accurately identify the beginning and end of the package, avoiding problems such as incomplete scanning or excessive redundant blanks caused by package jamming or timing deviations. This ensures that the package image is complete and clear, providing stable and reliable data support for subsequent person-package association and baggage tracking.
[0012] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0013] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 This is a flowchart of a sub-packaging method based on DR imaging provided according to one embodiment of the present disclosure; Figure 2 This is a block diagram of a DR imaging-based sub-packaging device according to one embodiment of the present disclosure; Figure 3 This is a schematic diagram illustrating the segmentation of a frame image according to one embodiment of the present disclosure; Figure 4 This is a diagram showing the effect of preprocessing a frame image that does not contain objects, according to one embodiment of the present disclosure. Figure 5 This is a diagram showing the effect of preprocessing a frame image containing an object according to one embodiment of the present disclosure; Figure 6 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation
[0014] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0015] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0016] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0017] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0018] It should be noted that the terms "one" and "more" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0019] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0020] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0021] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations of this disclosed technical solution.
[0022] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0023] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0024] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0025] Reference Figure 1 The present invention provides a subcontracting method based on DR imaging, comprising steps S100 to S500: Step S100: Obtain the atmospheric background frame image Img_bk; Specifically, before scanning the package, a single frame image is acquired using a DR detector in a package-free scanning state. This image represents the grayscale data of the air when the detector is not scanning any objects under set operating conditions. For example, it can be selected as either a frame image acquired during system power-on initialization or a single frame image acquired after multiple consecutive frames have been determined to be free of objects.
[0026] Step S200: Acquire consecutive frame images of the package in real time after the detector scans it; Specifically, the system uses a DR detector to collect scanning data in real time as the conveyor belt runs. Since a DR detector is typically composed of a one-dimensional linear array of crystals, each trigger acquires one column (i.e., one line) of raw data. The system then arranges and stacks the continuously acquired N lines of data sequentially according to time order (i.e., the spatial direction of the conveyor belt's movement), thereby constructing a two-dimensional digital matrix, which constitutes one frame of image. In this frame, the grayscale value of each pixel corresponds to a digital representation of the degree of ray attenuation at a certain spatial location.
[0027] Step S300: Perform region segmentation on each frame of the image to generate multiple segmented region images; Specifically, each frame of the image is divided into M (M is an integer greater than or equal to 2) segmentation regions according to a preset method, forming multiple segmented region images. Since the height of a single frame image is relatively large, and the package only occupies a local area, the overall grayscale calculation is prone to misjudgment. However, by calculating by region, the accuracy of object recognition can be improved, which is especially suitable for the detection of small-volume, low-attenuation items.
[0028] Among them, such as Figure 3 As shown, a single frame image can be divided into M segmentation regions along the image height direction. Of course, other segmentation methods can also be used.
[0029] Step S400: Calculate the average gray value of each segmented region image and compare the average gray value with the preset air gray value. Specifically, the average grayscale value of all pixels within each segmented region is calculated, and this average grayscale value is compared with a preset air grayscale limit, Air_min. The preset air grayscale limit, Air_min, is a system calibration value and can be obtained by scanning objects with minimal attenuation, such as thin books, empty cloth bags, and foam. It should be noted that objects with minimal attenuation refer to objects that attenuate the scanning rays emitted by the detector to a very small degree; their attenuation characteristics are close to those of air. By scanning these objects with minimal attenuation, grayscale values in areas close to air can be obtained, thereby determining the air grayscale limit, Air_min. This is done to ensure that the system can accurately identify low-attenuation materials and small objects.
[0030] If the grayscale of the entire frame is calculated and then judged, it will cause a large deviation and misjudgment. For example, for some small objects or objects with weak penetration attenuation of the radiation source, the overall calculation will produce a large error. However, calculating the average grayscale value of the region can improve the accuracy of detection.
[0031] When making a specific comparison: If the average gray value of all segmented region images is greater than or equal to Air_min, the current frame is determined to be a pure air frame. The air background frame image is then updated to the current frame image to achieve dynamic adaptation of the air background, in order to adapt to changes in operating conditions such as ray energy attenuation, detector temperature drift, and gray value drift.
[0032] If the average gray value of at least one segmented region image is less than Air_min, it may indicate that there is an object in the region causing ray attenuation. In order to determine whether there is a suspected object in the current frame image, it is necessary to obtain object detection information from the current frame image based on the latest air background frame image.
[0033] Step S500: Determine whether the object detection information meets the preset requirements for valid objects; This step mainly involves judging the validity of the acquired object detection information to filter out invalid targets such as small noise, dust, and interference stripes, and retain only the valid object information corresponding to the actual package.
[0034] When making a specific comparison: If the obtained object detection information does not meet the preset valid object requirements, it is determined to be interference data, and the air background frame image is updated to the current frame image.
[0035] If the obtained object detection information meets the preset valid object requirements, a complete scan image of the corresponding package is generated by stitching together the object detection information, and a unique package number is assigned to the complete scan image, which can then be used for subsequent person-package association, baggage tracking and image storage.
[0036] In some embodiments of the present invention, step S400, obtaining object detection information from the current frame image based on the latest atmospheric background frame image, specifically includes the following steps: Step S410: Perform subtraction on the current frame image Img and the latest air background frame image Img_bk to obtain the difference frame image Img_diff.
[0037] The difference between two images refers to the mathematical process of performing algebraic subtraction on the grayscale values of two identical and spatially aligned digital images, in units of pixels, to generate a new image with the difference.
[0038] In step S410, interference such as background stripes and overall grayscale increase caused by detector installation deviation, equipment vibration, and X-ray energy attenuation is eliminated by differential calculation, highlighting the outline of the real object.
[0039] Step S420: Preprocess the difference frame image to obtain the target frame image; In step S420, preprocessing may include color inversion, Gaussian filtering, and binarization, which can be performed sequentially. Color inversion aims to enhance the contrast of the object region; Gaussian filtering aims to smooth the image and remove high-frequency noise; and binarization aims to convert the image into a black-and-white binary image to highlight the object's outline. After these processes, a clean, smooth target frame image that is easy to extract outlines can be obtained.
[0040] Step S430: Perform contour detection on the target frame image to obtain the contour dimensions of the object; In step S430, all contours in the target frame image can be extracted using contour detection algorithms (such as connected component analysis, Canny contour extraction, etc.), and the contour dimensions such as width, height, and area of each contour can be calculated as object detection information.
[0041] Steps S410 and S420 can be referred to Figure 4 and Figure 5 The processing result is shown in the diagram.
[0042] In some embodiments of the present invention, in step S500, the condition for the object detection information to meet the preset valid object requirements is that the outline size of the object is greater than the preset outline threshold.
[0043] When the detected contour size is greater than a preset contour threshold, it is determined to be a valid object; when the detected contour size is less than the preset contour threshold, it is determined to be noise, loose threads, dust, or other interfering targets and is filtered out. This setting can prevent minor interference from triggering erroneous packet segmentation and improve packet segmentation stability.
[0044] It should be noted that the preset contour threshold can be set according to specific circumstances, such as based on empirical values.
[0045] In some embodiments of the present invention, step S500, generating a complete scan image of the corresponding package based on object detection information, includes the following steps: Step S510: When a first preset number of consecutive frame images all meet the preset valid object requirements, it is determined that a package head has been detected. Starting from the first frame that meets the requirements, frame images are cached and stitched together to form a package image. Step S520: When a second set number of consecutive frame images do not meet the preset valid object requirements, it is determined that the tail of the package has been detected. The stitching stops at the first frame where the requirements are not met, and a complete scan image of the package is finally formed.
[0046] In this embodiment, continuous frame judgment can avoid packet breakage caused by transient interference, ensuring image integrity. At the same time, it ensures that the complete scan image of the packet does not contain a lot of useless pixel data, which is beneficial for image storage.
[0047] In some embodiments of the present invention, after the step of acquiring continuous frame images of the detector after scanning the package in real time, and before the step of performing region segmentation on each frame image in the continuous frame images to generate multiple segmented region images, the following step is included: performing flat field correction on the continuous frame images.
[0048] In this embodiment, flat field correction is used to eliminate problems such as inconsistent response of each crystal unit of the detector, dark current, and non-uniform pixels. It can correct the original image into a standard image with uniform grayscale and regular data, making subsequent grayscale judgment more accurate.
[0049] It should be noted that flat-field correction can employ a brightness-darkness correction algorithm. This algorithm typically uses pre-acquired "dark-field images" (detector response without X-ray irradiation) and "bright-field images" (detector response under uniform radiation field without the measured object) to calculate the correction coefficient for each pixel, thereby performing pixel-level gain and offset compensation on each frame of real-time image. Since brightness-darkness correction algorithms are well-known and common technologies in the fields of X-ray imaging and machine vision, their specific mathematical implementation is not the core innovation of this invention and will not be elaborated here.
[0050] In some embodiments of the present invention, before the step of calculating the average gray value of each segmented region image and comparing the average gray value with the preset air gray value, the following steps are included: removing the head preset pixels and tail preset pixels along the height direction of each frame image after flat field correction.
[0051] Since the detector ends are typically located in the blind zone of the X-ray path, they are susceptible to structural obstruction and interference. In this embodiment, removing these pixels avoids invalid data from affecting grayscale judgment, thereby improving the reliability of the judgment. It should be noted that the number of preset pixels at the beginning and end of each frame is not a fixed value and can be set according to the actual equipment, for example, 20 to 30 pixels.
[0052] In some embodiments of the present invention, several blank frames are added at the beginning and end of the complete scanned image.
[0053] In this embodiment, adding blank frames can prevent the edges, straps, pendants, corners, etc. of the package from being truncated, ensuring that the package image is presented completely and preventing image judgment errors caused by image clipping.
[0054] It should be noted that the number of blank frames can be adjusted according to the actual effect.
[0055] refer to Figure 2 This disclosure also provides a sub-packaging device based on DR imaging, the sub-packaging device 100 based on DR imaging comprising: The first acquisition module 10 is used to acquire an air background frame image, which is a frame image acquired by the detector in a scan state without a package. The second acquisition module 20 is used to acquire continuous frame images of the package after the detector scans it in real time. The segmentation module 30 is used to segment each frame of the continuous frame images into regions to generate multiple segmented region images; The first determination module 40 is used to calculate the average gray value of each segmented region image and compare the average gray value with a preset air gray value limit. The first update module 50 is used to update the air background frame image to the current frame image if the average gray value of all the segmented region images is greater than or equal to the preset air gray value limit. Detection module 60 is used to obtain object detection information from the current frame image based on the latest air background frame image if the average gray value of at least one of the segmented region images is less than the preset air gray value limit. The second determination module 70 is used to determine whether the object detection information meets the preset valid object requirements; The second update module 80 is used to update the air background frame image to the current frame image if the object detection information does not meet the preset valid object requirements. The sub-package stitching module 90 is used to generate a complete scan image of the corresponding package based on the object detection information if the object detection information meets the preset valid object requirements, and to assign a unique package number to the complete scan image.
[0056] In some embodiments of the present invention, the detection module 60 is further configured to: The difference between the current frame image and the latest air background frame image is used to obtain the difference frame image; The difference frame image is preprocessed to obtain the target frame image; Contour detection is performed on the target frame image to obtain the contour dimensions of the object.
[0057] In some embodiments of the present invention, the sub-package splicing module 90 is further configured to: When a first preset number of consecutive frame images all meet the preset valid object requirements, frame images are stitched together starting from the first frame image that meets the preset valid object requirements to form a wrap-around image; When a second preset number of consecutive frame images do not meet the preset valid object requirements, the stitching stops from the first frame image that does not meet the preset valid object requirements, so as to obtain the complete scan image.
[0058] In some embodiments of the present invention, the device further includes a calibration module, the calibration module being used for: After the step of acquiring consecutive frame images of the detector after scanning the package in real time, and before the step of segmenting each frame image in the consecutive frame images to generate multiple segmented region images, the consecutive frame images are flat-field corrected.
[0059] In some embodiments of the present invention, the apparatus further includes a pixel processing module, which is configured to: remove the head preset pixels and tail preset pixels of each frame image along the height direction after flat field correction before the step of calculating the average gray value of each segmented region image and comparing the average gray value with the preset air gray value.
[0060] In some embodiments of the present invention, the pixel processing module is further configured to add several blank frames at the beginning and end of the complete scanned image.
[0061] refer to Figure 6 The diagram illustrates a structural schematic of an electronic device 600 (e.g., a terminal device or a server) suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0062] like Figure 6As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from a storage device into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the electronic device 600. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus. An input / output (I / O) interface 605 is also connected to the bus 604.
[0063] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.
[0064] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0065] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0066] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the internet (e.g., the Internet), and end-to-end networks (e.g., ad-hoc end-to-end networks), as well as any currently known or future-developed networks.
[0067] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0068] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire an air background frame image, wherein the air background frame image is a frame image acquired by the detector in a package-free scanning state; acquire consecutive frame images after the detector scans the package in real time; segment each frame image in the consecutive frame images to generate multiple segmented region images; calculate the average gray value of each segmented region image and compare the average gray value with a preset air gray value limit; if the average gray value of all segmented region images is greater than or equal to the preset air gray value limit, update the air background frame image to the current frame image; if the average gray value of at least one segmented region image is less than the preset air gray value limit, acquire object detection information from the current frame image based on the latest air background frame image; determine whether the object detection information meets a preset valid object requirement; if it does not meet the preset valid object requirement, update the air background frame image to the current frame image; if it meets the preset valid object requirement, generate a complete scan image of the corresponding package based on the object detection information and assign a unique package number to the complete scan image.
[0069] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0070] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0071] The modules described in the embodiments of this disclosure can be implemented in software or in hardware.
[0072] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0073] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0074] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0075] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order or sequence shown. Multitasking and parallel processing may be advantageous in certain environments. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0076] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A subcontracting method based on DR imaging, characterized in that, The method includes: Acquire an air background frame image, which is a frame image captured by the detector in a scan state without any envelopment; Real-time acquisition of continuous frame images after the detector scans the package; Each frame of the continuous frame images is segmented into regions to generate multiple segmented region images; Calculate the average gray value of each segmented region image, and compare the average gray value with a preset air gray value limit. If the average grayscale value of all the segmented region images is greater than or equal to the preset air grayscale limit, then the air background frame image is updated to the current frame image; If the average grayscale value of at least one of the segmented region images is less than the preset air grayscale limit, then object detection information is obtained from the current frame image based on the latest air background frame image; Determine whether the object detection information meets the preset valid object requirements; If the preset valid object requirement is not met, the air background frame image is updated to the current frame image; If the preset valid object requirements are met, a complete scan image of the corresponding package is generated based on the object detection information, and a unique package number is assigned to the complete scan image. The step of generating a complete scanned image of the corresponding package based on the object detection information includes: When a first preset number of consecutive frame images all meet the preset valid object requirements, frame images are stitched together starting from the first frame image that meets the preset valid object requirements to form a wrap-around image; When a second preset number of consecutive frame images do not meet the preset valid object requirements, the stitching stops from the first frame image that does not meet the preset valid object requirements, so as to obtain the complete scan image.
2. The subcontracting method based on DR imaging according to claim 1, characterized in that, The step of obtaining object detection information from the current frame image based on the latest atmospheric background frame image includes: The difference between the current frame image and the latest air background frame image is used to obtain the difference frame image; The difference frame image is preprocessed to obtain the target frame image; Contour detection is performed on the target frame image to obtain the contour dimensions of the object.
3. The subcontracting method based on DR imaging according to claim 2, characterized in that, The condition for the object detection information to meet the preset valid object requirements is that the contour size is greater than the preset contour threshold.
4. The subcontracting method based on DR imaging according to claim 1, characterized in that, After the step of acquiring consecutive frame images of the detector after scanning the package in real time, and before the step of performing region segmentation on each frame image in the consecutive frame images to generate multiple segmented region images, the following steps are included: Flat field correction is performed on the consecutive frame images.
5. The subcontracting method based on DR imaging according to claim 4, characterized in that, Before the step of calculating the average gray value of each segmented region image and comparing the average gray value with a preset air gray value, the method includes: Remove the head and tail preset pixels along the height direction of each frame image after flat field correction.
6. The subcontracting method based on DR imaging according to claim 1, characterized in that, Several blank frames are added at the beginning and end of the complete scanned image.
7. A packaging device based on DR imaging, characterized in that, The device includes: The first acquisition module is used to acquire an air background frame image, which is a frame image acquired by the detector in a scan state without a package. The second acquisition module is used to acquire continuous frame images of the package after the detector scans it in real time. The segmentation module is used to segment each frame of the continuous frame images into regions to generate multiple segmented region images; The first determination module is used to calculate the average gray value of each segmented region image and compare the average gray value with a preset air gray value limit. The first update module is used to update the air background frame image to the current frame image if the average gray value of all the segmented region images is greater than or equal to the preset air gray value limit. The detection module is used to obtain object detection information from the current frame image based on the latest air background frame image if the average gray value of at least one of the segmented region images is less than the preset air gray value limit. The second determination module is used to determine whether the object detection information meets the preset valid object requirements; The second update module is used to update the air background frame image to the current frame image if the object detection information does not meet the preset valid object requirements. The package stitching module is used to generate a complete scan image of the corresponding package based on the object detection information if the object detection information meets the preset valid object requirements, and to assign a unique package number to the complete scan image; wherein, generating a complete scan image of the corresponding package based on the object detection information includes: When a first preset number of consecutive frame images all meet the preset valid object requirements, frame images are stitched together starting from the first frame image that meets the preset valid object requirements to form a wrap-around image; When a second preset number of consecutive frame images do not meet the preset valid object requirements, the stitching stops from the first frame image that does not meet the preset valid object requirements, so as to obtain the complete scan image.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, it implements the steps of the method as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Image sample generating method and system, and target detection method
US20230162342A1
Image processing device for processing grey level images
US5625717A