CN118052236A - Package acquisition method, package acquisition device, electronic equipment and readable storage medium - Google Patents
Package acquisition method, package acquisition device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN118052236A CN118052236A CN202211406697.3A CN202211406697A CN118052236A CN 118052236 A CN118052236 A CN 118052236A CN 202211406697 A CN202211406697 A CN 202211406697A CN 118052236 A CN118052236 A CN 118052236A
- Authority
- CN
- China
- Prior art keywords
- image
- camera
- package
- target
- abnormal
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 87
- 230000002159 abnormal effect Effects 0.000 claims abstract description 163
- 238000012545 processing Methods 0.000 claims abstract description 34
- 238000013507 mapping Methods 0.000 claims description 36
- 238000004590 computer program Methods 0.000 claims description 15
- 238000004422 calculation algorithm Methods 0.000 claims description 12
- 238000001514 detection method Methods 0.000 description 16
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 238000006073 displacement reaction Methods 0.000 description 5
- 238000009434 installation Methods 0.000 description 5
- 238000011144 upstream manufacturing Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000000605 extraction Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000005299 abrasion Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/10544—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
- G06K7/10821—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
- G06K7/10861—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices sensing of data fields affixed to objects or articles, e.g. coded labels
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/1439—Methods for optical code recognition including a method step for retrieval of the optical code
- G06K7/1443—Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/10—Image acquisition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Multimedia (AREA)
- General Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Medical Informatics (AREA)
- Evolutionary Computation (AREA)
- Databases & Information Systems (AREA)
- Toxicology (AREA)
Abstract
The application discloses a package acquisition method, a package acquisition device, electronic equipment and a readable storage medium, wherein the package acquisition method comprises the following steps: acquiring a first image shot by the first camera and a second image shot by the second camera; performing bar code identification processing on the first image to obtain a first target image containing an abnormal bar code; matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image; and acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image. The method improves the accuracy rate when acquiring the abnormal bar code due to bar code identification on the gray level image, and has higher accuracy rate when acquiring the abnormal package due to the fact that the package information contained in the color image is more abundant on one hand and the acquired abnormal bar code is more accurate on the other hand.
Description
Technical Field
The application relates to the technical field of express sorting, in particular to a package acquisition method, a package acquisition device, electronic equipment and a readable storage medium.
Background
With the development of the logistics industry, automatic sorting is widely applied to logistics transfer links. When sorting, the packages are required to be sorted to specific areas according to the information of the packages such as the bill number, the destination and the like and the business rule. However, in special cases, due to problems of the code pasting device, there may be a missing code on the package, so that the package missing the code in the package sorting device needs to be identified for manual or machine code complement.
However, the existing method for identifying the package with the missing code is low in accuracy, whether the package is missing the code or not is difficult to accurately judge, and false detection and missing detection are easy to occur.
Disclosure of Invention
The application provides a package acquisition method, a package acquisition device, electronic equipment and a readable storage medium, and aims to solve the technical problems that the existing package acquisition method is low in accuracy, whether packages lack codes or not is difficult to accurately judge, and false detection and missing detection are easy to occur.
In a first aspect, the present application provides a package acquisition method, including:
Acquiring a first image shot by the first camera and a second image shot by the second camera;
Performing bar code identification processing on the first image to obtain a first target image containing an abnormal bar code;
Matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image;
and acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image.
In one possible implementation manner of the present application, the obtaining, according to the first location information of the abnormal barcode in the first target image, the target package in the second target image includes:
Performing package identification processing on the second target image to obtain each candidate package in the second target image and second position information of each candidate package;
determining mapping position information of the abnormal bar code in the second target image according to first position information of the abnormal bar code in the first target image and a preset position mapping relation between the first camera and the second camera;
and matching the mapping position information with each second position information, and acquiring a target package from each candidate package.
In one possible implementation manner of the present application, the performing barcode recognition processing on the first image to obtain a first target image including an abnormal barcode includes:
Acquiring a target bar code in the first image;
And decoding the target bar code through a preset decoding algorithm, and acquiring a first target image containing abnormal bar codes failing to decode from the first image.
In one possible implementation manner of the present application, before the matching the acquisition time of the first target image with the acquisition time of the second image to obtain the second target image in the second image, the method further includes:
Acquiring a reference camera corresponding to the first camera and a third image shot by the reference camera;
Acquiring a reference image associated with the first target image from each third image according to the acquisition time of the first target image and the acquisition time of each third image;
and if the decoding result of the bar code in the reference image is decoding failure, executing the step of matching the acquisition time of the first target image with the acquisition time of the second image to obtain a second target image in the second image.
In one possible implementation manner of the present application, after the acquiring, according to the acquiring time of the first target image and the acquiring time of each third image, the acquiring, from each third image, the reference image associated with the first target image further includes:
If the decoding result of the bar code in the reference image is that the decoding is successful, acquiring a first camera position of the reference camera;
Predicting an abnormal area in the parcel sorting device according to the first camera position and the second camera position of the first camera;
And outputting the abnormal region to a target terminal.
In one possible implementation manner of the present application, before the acquiring the first image captured by the first camera and the second image captured by the second camera, the method includes:
Acquiring the number of packages to be sorted;
If the number of packages is smaller than a preset number threshold, a second camera is started, and a target package carrying an abnormal bar code is obtained through the second camera;
And if the number of packages is greater than or equal to a preset number threshold, starting a first camera and a second camera, and executing the steps of acquiring a first image shot by the first camera and a second image shot by the second camera.
In one possible implementation manner of the present application, after the acquiring the package in the second target image is a target package, the method further includes:
acquiring a first image number of the second target image and a second image number of the second image;
determining an abnormal parcel duty ratio according to the first image quantity and the second image quantity;
if the abnormal package duty ratio is larger than a preset duty ratio threshold, outputting abnormal alarm information of the camera;
And if the abnormal package duty ratio is smaller than or equal to a preset duty ratio threshold, outputting abnormal alarm information of the code pasting device.
In a second aspect, the present application provides a package acquisition apparatus comprising:
A first acquisition unit configured to acquire a first image captured by the first camera and a second image captured by the second camera;
The identification processing unit is used for carrying out bar code identification processing on each first image to obtain a first target image containing an abnormal bar code;
The matching unit is used for matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image;
the second acquisition unit is used for acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image.
In a possible implementation of the present application, the second obtaining unit is further configured to:
Performing package identification processing on the second target image to obtain each candidate package in the second target image and second position information of each candidate package;
determining mapping position information of the abnormal bar code in the second target image according to first position information of the abnormal bar code in the first target image and a preset position mapping relation between the first camera and the second camera;
and matching the mapping position information with each second position information, and acquiring a target package from each candidate package.
In a possible implementation of the application, the identification processing unit is further configured to:
Acquiring a target bar code in the first image;
And decoding the target bar code through a preset decoding algorithm, and acquiring a first target image containing abnormal bar codes failing to decode from the first image.
In a possible implementation of the application, the matching unit is further configured to:
Acquiring a reference camera corresponding to the first camera and a third image shot by the reference camera;
Acquiring a reference image associated with the first target image from each third image according to the acquisition time of the first target image and the acquisition time of each third image;
and if the decoding result of the bar code in the reference image is decoding failure, executing the step of matching the acquisition time of the first target image with the acquisition time of the second image to obtain a second target image in the second image.
In a possible implementation of the application, the matching unit is further configured to:
If the decoding result of the bar code in the reference image is that the decoding is successful, acquiring a first camera position of the reference camera;
Predicting an abnormal area in the parcel sorting device according to the first camera position and the second camera position of the first camera;
And outputting the abnormal region to a target terminal.
In a possible implementation of the application, the matching unit is further configured to:
Acquiring the number of packages to be sorted;
If the number of packages is smaller than a preset number threshold, a second camera is started, and a target package carrying an abnormal bar code is obtained through the second camera;
And if the number of packages is greater than or equal to a preset number threshold, starting a first camera and a second camera, and executing the steps of acquiring a first image shot by the first camera and a second image shot by the second camera.
In a possible implementation of the present application, the second obtaining unit is further configured to:
acquiring a first image number of the second target image and a second image number of the second image;
determining an abnormal parcel duty ratio according to the first image quantity and the second image quantity;
if the abnormal package duty ratio is larger than a preset duty ratio threshold, outputting abnormal alarm information of the camera;
And if the abnormal package duty ratio is smaller than or equal to a preset duty ratio threshold, outputting abnormal alarm information of the code pasting device.
In a third aspect, the present application also provides an electronic device, the electronic device comprising a processor, a memory and a computer program stored in the memory and executable on the processor, the processor executing the steps of any of the package acquisition methods provided by the present application when calling the computer program in the memory.
In a fourth aspect, the present application also provides a readable storage medium having stored thereon a computer program which when executed by a processor performs steps in any of the package acquisition methods provided by the present application.
In summary, the package obtaining method provided by the embodiment of the present application includes: acquiring a first image shot by the first camera and a second image shot by the second camera; performing bar code identification processing on the first image to obtain a first target image containing an abnormal bar code; matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image; and acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image.
According to the method, the bar code identification is carried out on the gray level image, so that the accuracy rate of acquiring the abnormal bar code is improved, and the abnormal package is acquired from the color image according to the position of the abnormal bar code.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of an application scenario of a package obtaining method according to an embodiment of the present application;
FIG. 2 is a schematic view of a package-sorting apparatus according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a method for acquiring packages according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of acquiring a target package according to an embodiment of the present application;
FIG. 5 is another flow chart of a method for acquiring packages provided in an embodiment of the present application;
FIG. 6 is a schematic flow chart of a method for acquiring packages provided in an embodiment of the present application;
FIG. 7 is a schematic flow chart of outputting alarm information provided in an embodiment of the present application;
FIG. 8 is a schematic diagram illustrating the construction of one embodiment of a package acquisition apparatus provided in an embodiment of the present application;
Fig. 9 is a schematic structural diagram of an embodiment of an electronic device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
In describing embodiments of the present application, it should be understood that the terms "first," "second," and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or number of features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the embodiments of the present application, the meaning of "plurality" is two or more, unless explicitly defined otherwise.
The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known processes have not been described in detail in order to avoid unnecessarily obscuring the description of the embodiments of the application. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The embodiment of the application provides a package acquisition method, a package acquisition device, electronic equipment and a readable storage medium. The package obtaining device can be integrated in electronic equipment, and the electronic equipment can be a server, a terminal and other equipment.
The execution main body of the package obtaining method in the embodiment of the present application may be a package obtaining device provided in the embodiment of the present application, or different types of electronic devices such as a server device, a physical host, or a special effect maker device (UE) that are integrated with the package obtaining device, where the package obtaining device may be implemented in a hardware or software manner, and the UE may specifically be a terminal device such as a smart phone, a tablet computer, a notebook computer, a palm computer, a desktop computer, or a Personal digital assistant (Personal DIGITAL ASSISTANT, PDA).
The electronic device may be operated in a single operation mode, or may also be operated in a device cluster mode.
Referring to fig. 1, fig. 1 is a schematic view of a package acquisition system according to an embodiment of the present application. The package obtaining system may include an electronic device 100, where a package obtaining apparatus is integrated in the electronic device 100.
In addition, as shown in FIG. 1, the package acquisition system may also include a memory 101 for storing data, such as text data.
It should be noted that, the schematic view of the scenario of the package obtaining system shown in fig. 1 is only an example, and the package obtaining system and scenario described in the embodiment of the present application are for more clearly describing the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application, and those skilled in the art can know that, with the evolution of the package obtaining system and the appearance of a new service scenario, the technical solution provided by the embodiment of the present application is equally applicable to similar technical problems.
In the following, a package obtaining method provided by an embodiment of the present application is described, in the embodiment of the present application, an electronic device is used as an execution body, and for simplicity and convenience of description, in a subsequent method embodiment, the execution body is omitted, and the package obtaining method includes: acquiring a first image shot by the first camera and a second image shot by the second camera; performing bar code identification processing on the first image to obtain a first target image containing an abnormal bar code; matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image; and acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image.
The package obtaining method provided by the embodiment of the application is applied to a package sorting device, and referring to fig. 2, a schematic structural diagram of a package sorting device 200 is shown in fig. 2:
The package sorting device 200 comprises a package transporting device 201, a camera mounting device 202, a first camera 203, a second camera 204 and a data processing device 205.
The package transporter 201 is for carrying and transporting packages, for example, the package transporter 201 may be a belt conveyor.
The camera mounting apparatus 202 is for mounting a first camera 203 and a second camera 204, for example, the camera mounting apparatus 202 may be a gantry.
The first camera 203 is used to capture the package transporter 201 and identify a barcode in the captured image, for example, the first camera 203 may be a grayscale camera used to capture grayscale images.
The second camera 204 is used to capture the package transporter 201 and identify the package in the captured image. It should be noted that, the shooting range of the second camera 204 and the shooting range of the first camera 203 on the same camera mounting device 202 may have a coincidence range, so as to ensure that the barcode shot by the first camera is at least the barcode carried by one package shot by the second camera. For ease of understanding, reference may be made to fig. 2. In fig. 2, the photographing range of the first camera 203 is 206, the photographing range of the second camera 204 is 207, and it is seen that there is at least one overlapping range 208 between 206 and 207. It should be noted that the overlapping range should not be too small, and at least it should be ensured that the barcode of the package captured by the second camera 204 can be captured by the first camera 203 at the current time.
In some embodiments, there may be no overlapping range between the shooting range of the second camera 204 and the shooting range of the first camera 203, which is only required to ensure that the barcode shot by the first camera is at least the barcode carried by one package shot by the second camera. For example, the shooting range 206 of the first camera 203 in fig. 2 may be translated along the moving direction of the package transporting device 201, resulting in another shooting range that does not coincide with the shooting range 207.
The data processing device 205 is configured to receive the barcode captured by the first camera, obtain a decoding result of the barcode, and if the barcode is an abnormal barcode that fails to be decoded, determine, from the target image captured by the second camera, a package including the barcode according to the image position of the barcode, and use the package as an abnormal package that needs a complement. The explanation of the abnormal bar code is specifically described below, and will not be described herein.
If not specifically stated, it is considered that both the first camera and the second camera are in the on state, that is, the first camera 203 and the second camera 204 shoot the package transportation device 201 at the same time.
In addition, in the package sorting device 200, there may be a plurality of camera mounting devices 202 to which the first camera 203 and the second camera 204 are mounted, for example, one camera mounting device 202 to which the first camera 203 and the second camera 204 are mounted may be provided at a distance from each other on the package transporting device 201.
Referring to fig. 3, fig. 3 is a schematic flow chart of a package obtaining method according to an embodiment of the present application. It should be noted that although a logical order is depicted in the flowchart, in some cases the steps depicted or described may be performed in a different order than presented herein. The package acquisition method specifically may include the following steps 301-304, in which:
301. And acquiring a first image shot by the first camera and a second image shot by the second camera.
Wherein the first camera is a camera for photographing a gray image, and the second camera is a camera for photographing a color image. Thus, the first image refers to a grayscale image captured by the first camera, and the second image refers to a color image captured by the second camera.
For example, the electronic device may acquire the latest image captured by the first camera and the image captured by the second camera in the preset first history period as the first image and the second image, respectively. For example, the electronic device may read a background database of the factory where the package sorting device is located, obtain the latest image captured by the first camera from the background database as a first image, and then read the image captured by the second camera within N minutes of the current time and before the current time from the background database as a second image, where there is only one first image and multiple second images. Or images respectively shot by the first camera and the second camera in a preset historical time period can be acquired as the first image and the second image. For example, the electronic device may read a background database of the factory where the package sorting device is located, obtain, from the background database, an image captured by the first camera at the current time and N minutes before the current time, as a first image, and obtain, as a second image, an image captured by the second camera at the current time and M minutes before the current time, where the first image and the second image each have multiple images, and it may be understood that N may be the same or different from M.
For ease of understanding and description hereinafter, the default first image is only one unless specifically stated.
302. And performing bar code identification processing on the first image to obtain a first target image containing an abnormal bar code.
The bar code identification process refers to acquiring bar code information from the first image. For example, a region of a detection frame (ROI) containing a barcode in the first image may be acquired through an image detection algorithm or an image detection model, and image information in the region is used as a result of barcode recognition processing, that is, information of the barcode in the first image.
In some embodiments, the first image may be input into a trained barcode recognition model, and barcode recognition processing may be performed by the trained barcode recognition model to obtain barcode information in the first image. The electronic equipment can take AlexNet and other open-source target detection models as initial bar code recognition models, and train the initial bar code recognition models through a preset first sample data set to obtain trained bar code recognition models. The trained bar code recognition model can output image information corresponding to the bar code in the first image and image position information of the bar code.
In other embodiments, considering that the first image is a gray-scale image, a method of connected domain extraction (Connected Component Analysis) may be used to perform barcode recognition processing on the first image, so as to improve the accuracy of the barcode recognition processing. For example, after preprocessing such as gaussian filtering is performed on the first image, the first image may be processed by a connected domain extraction algorithm such as a Two-Pass method (Two-Pass), so as to obtain a detection frame area including a barcode in an image, and image information in the area is used as information of the barcode in the first image.
The connected domain extraction is to find and mark each connected region in the image, and is particularly suitable for extracting information in binary images such as gray level images.
After the information of the bar code in the first image is obtained, the bar code can be decoded through a decoding algorithm to judge whether the decoding is successful or not, if the decoding is unsuccessful, the bar code is used as an abnormal bar code, and the first image is used as a first target image containing the abnormal bar code. Namely, the step of performing bar code recognition processing on the first image to obtain a first target image containing an abnormal bar code comprises the following steps:
(1.1) acquiring a target barcode in the first image.
The method for obtaining the target barcode may refer to the above, for example, may obtain the target barcode in the first image by a method for extracting a connected domain.
And (1.2) decoding the target bar code through a preset decoding algorithm, and acquiring a first target image containing abnormal bar codes failing to decode from the first image.
The embodiment of the application does not limit the decoding algorithm, the preset decoding algorithm can be stored in a background database of a factory where the package sorting device is located, and when the step (1.2) is executed, the electronic equipment can directly read the decoding algorithm from the background database.
After the target bar code is decoded, one of two decoding results can be obtained: decoding success or decoding failure. If the decoding result is that the decoding is successful, the electronic device may obtain the package information included in the target barcode, for example, may obtain the waybill number, the destination, the origin, and the like of the package. Conversely, if the decoding result is decoding failure, it is indicated that the target bar code cannot be decoded due to abrasion, misattachment or other reasons, so that the package corresponding to the target bar code is set with an abnormal package to be complemented.
Therefore, when the step (1.2) is executed, if the decoding result obtained after the decoding processing is performed on the target bar code is that the decoding is failed, the first image can be used as the first target image, and the target bar code can be used as the abnormal bar code.
303. And matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image.
The acquisition time of the image may refer to a photographing time when the camera photographs. For example, the electronic device may read a timestamp carried by the first target image, determine the acquisition time of the first target image, and read a timestamp carried by each second image to determine the acquisition time of each second image.
Matching the acquisition time of the first target image with the acquisition time of each second image may mean that an image whose acquisition time is identical to the acquisition time of the first target image is acquired from the second images, and thus, the second target image obtained by step 303 is the second image whose acquisition time is identical to the acquisition time of the first target image. This method may be employed to acquire the second target image, for example, when the photographing range of the first camera is 206 in fig. 2 and the photographing range of the second camera is 207 in fig. 2.
In other embodiments, if the shooting range of the first camera does not overlap with the shooting range of the second camera, for example, if the shooting range of the first camera is 209 in fig. 2, and the shooting range of the second camera is 207 in fig. 2, the shooting time deviation may be calculated in advance according to the moving speed of the package on the package transportation device 201 and the distance between the shooting range 209 and the shooting range 207, and the second target image with the acquisition time before the acquisition time of the first target time and the time interval between the acquisition time and the acquisition time of the first target time is the shooting time deviation may be selected from the second images according to the acquisition time of the first target time.
The purpose of the above acquisition time matching is to acquire a second target image captured by the second camera at the same time when the first camera captures the first target image, and since the first target image includes the abnormal bar code, as can be seen from the description of the package sorting device 200 above, the abnormal package carrying the abnormal bar code should be in the second target image, so that the abnormal package can be determined by processing the second target image.
304. And acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image.
The target package may refer to an abnormal package carrying an abnormal barcode. For the definition of anomalies, reference is made to the above, and details are not described here.
The electronic device may obtain a preset first position mapping relationship from a background database of a factory where the package sorting device is located, convert first position information in a first target image into actual position information of an abnormal barcode through the first position mapping relationship, then obtain a preset second position mapping relationship from the background database, convert the actual position information of the abnormal barcode into second position information in a second target image through the second position mapping relationship, match the position information of the package in the second target image with the second position information, and determine that an image area corresponding to the position information contains an abnormal package of an image area corresponding to the second position information, and use the abnormal package as the target package.
The first position mapping relation is used for carrying out interconversion on the image position and the actual position in the image shot by the first camera, and the second position mapping relation is used for carrying out interconversion on the image position in the image shot by the second camera. The first position mapping relation can be obtained by manually calibrating the first camera and stored in the background database, and the method for obtaining the second position mapping relation is the same and is not repeated.
When step 304 is executed, the electronic device may obtain the package in the second target image through the trained package detection model. For example, a AlexNet-class open-source target detection model may be used as an initial package detection model, and the initial package detection model may be trained by using a preset second sample data set to obtain a trained package detection model. The trained parcel detection model may output location information for the parcel in the second target image.
In some embodiments, in order to improve the detection accuracy of the barcode, a gray-scale camera with higher resolution and smaller field of view may be used as the first camera to exclude information that may interfere with barcode recognition. In contrast, because the image information contained in the color image is rich, the algorithm for detecting the packages in the color image is mature, and the accuracy is high, in order to reduce the cost, the color camera with lower resolution can be used as the second camera, and in order to ensure that the whole information of each package can be acquired, the color image is prevented from containing only a part of the information of each package, and the color camera with larger visual field can be used as the second camera.
It can be appreciated that the beneficial effects of the method are: firstly, carrying out bar code identification processing on a gray image, and then determining abnormal packages from a color image according to the obtained positions of the abnormal bar codes, so compared with the current method of directly carrying out abnormal package obtaining through a single camera, on one hand, compared with the method of adopting the single color camera, the method has the advantages that the information (such as package self information) which is easy to interfere with bar code identification in the gray image is less, the image information of the bar code is clearer, thereby improving the identification accuracy of the abnormal bar codes, on the other hand, compared with the method of adopting the single gray camera, the boundary of the package in the gray image is not obvious with the package transmission device, the boundary of the package in the color image is obvious with the package transmission device, and more package information which cannot be presented in the gray image is contained, thereby improving the package identification accuracy.
In addition, compared with a method for acquiring a color image through a color camera and converting the color image into a gray image and then identifying a bar code, the method for acquiring the package provided by the embodiment of the application has the advantages that the image conversion is not needed, so that the speed for acquiring the abnormal package is higher.
In summary, the package obtaining method provided by the embodiment of the present application includes: acquiring a first image shot by the first camera and a second image shot by the second camera; performing bar code identification processing on the first image to obtain a first target image containing an abnormal bar code; matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image; and acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image.
According to the method, the bar code identification is carried out on the gray level image, so that the accuracy rate of acquiring the abnormal bar code is improved, and the abnormal package is acquired from the color image according to the position of the abnormal bar code.
In some embodiments, in order to reduce the time required for acquiring the abnormal parcel and improve the parcel acquisition efficiency, the position mapping between the first camera and the second camera may be calibrated in advance to obtain the position mapping relationship between the image shot by the first camera and the image shot by the second camera, and when the abnormal parcel is acquired, the target parcel is acquired directly through the position mapping relationship, without converting the first position information of the abnormal parcel in the first target image to the actual position. Referring to fig. 4, at this time, the step of "obtaining the target package in the second target image according to the first position information of the abnormal barcode in the first target image" includes:
401. and carrying out package identification processing on the second target image to obtain each candidate package in the second target image and second position information of each candidate package.
The method for obtaining the candidate packages and the second location information of each candidate package may refer to the description in step 304, which is not described in detail herein.
402. And determining the mapping position information of the abnormal bar code in the second target image according to the first position information of the abnormal bar code in the first target image and the preset position mapping relation between the first camera and the second camera.
The position mapping relation between the first camera and the second camera is the position mapping relation obtained after the position mapping between the first camera and the second camera is calibrated. After the acquiring, the position mapping relation between the first camera and the second camera may be directly read from a background database of a factory where the package sorting device is located by the electronic device when the step 402 is executed.
Through the position mapping relation, the electronic equipment can map the first position information into the second target image to obtain the mapping position information of the abnormal bar code in the second target image.
403. And matching the mapping position information with each second position information, and acquiring a target package from each candidate package.
Matching the mapping location information with each second location information may mean that first a first image area corresponding to the mapping location information in the second target image is acquired, then a second image area corresponding to each second location information in the second target image is acquired, a target image area including the first image area is acquired from the second image area, and the second location information corresponding to the target image area is used as target location information matched with the mapping location information.
After the target position information is obtained, the electronic device can take the candidate package corresponding to the target position information as a target package, namely, an abnormal package carrying an abnormal bar code.
It can be seen that, by the method from step 401 to step 403, the position information of the abnormal bar code in the second target image can be obtained only by one time of position mapping, and compared with the method in step 304, the method has the advantages of faster speed and higher efficiency.
In some embodiments, considering that the barcodes on the package may be multiple, when the placement posture of the package is changed during transportation, the barcodes containing package information may be shot in the first image shot by the first camera, and the irrelevant barcodes containing non-package information such as popularization information, advertisement information, preferential information and the like are shot, so that the reference camera which is positioned at the upstream of the first camera in the package transportation direction and is also used for shooting gray images can be acquired, whether the decoding result of the gray images shot by the reference camera is decoding failure or not is judged, if decoding failure is judged, the placement posture of the package is not changed during transportation, and the step of matching the acquisition time of the first target image with the acquisition time of the second image to obtain the second target image in the second image is performed. Referring to fig. 5, at this time, before the step of "matching the acquisition time of the first target image with the acquisition time of the second image to obtain the second target image in the second image", the method further includes:
501. And acquiring a reference camera corresponding to the first camera and a third image shot by the reference camera.
The reference camera corresponding to the first camera refers to a camera that is also used to take a grayscale image upstream of the first camera in the package transport direction. For example, the electronic device may obtain a preset camera correspondence table from a background database of a factory where the package sorting device is located, and according to the camera number of the first camera, query the camera correspondence table to obtain a camera which is located upstream of the first camera in the package transportation direction and is also used for capturing a grayscale image, and select at least one of the cameras as a reference camera corresponding to the first camera.
The preset camera corresponding table is stored with camera information for photographing gray level images in the package transportation direction, which is also stored in a background database of a factory where the package sorting device is located after being preset by a person, and when the step 501 is executed, the electronic device can directly read the preset camera corresponding table from the background database.
In other embodiments, the reference camera corresponding to the first camera may also be determined according to the first camera mounting position of the first camera and the second camera mounting positions of other candidate cameras for capturing gray-scale images in the sorting factory. For example, the first camera installation position may be taken as an origin, the displacement between the origin and each second camera installation position in the package transportation direction may be calculated, and the candidate camera whose displacement is negative, that is, located upstream of the first camera installation position in the package transportation direction, may be taken as the reference camera corresponding to the first camera, and the specific calculation method is not repeated.
The third image photographed by the reference camera may refer to a historical gray scale image photographed by the reference camera. For example, a history gray-scale image photographed by the reference camera in a preset second history period may be selected as the third image photographed by the first reference image.
It should be noted that the second history period should be related to the displacement between the reference camera and the first camera in the package transportation direction. So as to ensure that the bar code contained in at least one image in the third image and the abnormal bar code in the first target image belong to the same package. For example, a displacement in the package transporting direction between the reference camera and the first camera may be acquired, then a preset transporting speed of the package transporting device is acquired, a minimum target history period is calculated according to the displacement and the preset transporting speed, then the target history period is taken as a second history period, or a duration of a history time included in the target history period is slightly increased, and the target history period after the increased duration is taken as the second history period. For example, if the calculated target history period is N minutes, that is, the third image is obtained according to the target history period, where the third image is the current time and the first gray scale image captured by the reference camera within N minutes before the current time, the first gray scale image may be used as the third image, or the second gray scale image captured by the reference camera between n+n minutes before the current time and N minutes before the current time may be continuously obtained, and the first gray scale image and the second gray scale image are used as the third image, so as to ensure that the bar code included in at least one image in the third image and the abnormal bar code in the first target image belong to the same package.
502. And acquiring a reference image associated with the first target image from each third image according to the acquisition time of the first target image and the acquisition time of each third image.
The description of acquiring the reference image may refer to step 303, and is not specifically described.
It can be appreciated that the reference image is a third image of the same package that contains the bar code and the abnormal bar code in the first target image.
503. And if the decoding result of the bar code in the reference image is decoding failure, executing the step of matching the acquisition time of the first target image with the acquisition time of the second image to obtain a second target image in the second image.
The description of the decoding result may refer to the above, and detailed description is omitted.
If the decoding result of the bar code in the reference image is decoding failure, the decoding failure is not caused by that the placement posture of the package is changed in the transportation process, so that the first image shot by the first camera shoots irrelevant bar codes, and therefore, in order to acquire abnormal packages, the step of matching the acquisition time of the first target image with the acquisition time of the second image to obtain a second target image in the second image can be performed.
If the decoding result of the bar code in the reference image is that the decoding is successful, the decoding failure is indicated because the placement posture of the package is changed in the transportation process, so that the irrelevant bar code is shot in the first image shot by the first camera. Therefore, the area which is easy to change the placing posture of the package in the package sorting device can be determined according to the camera mounting position of the first camera and the camera mounting position of the reference camera, and the area is prompted to a worker.
The reason for judging whether the irrelevant bar codes are shot is that a plurality of first cameras are usually arranged for the package sorting device in an actual application scene so as to ensure that all abnormal packages can be acquired, however, under the condition of the plurality of first cameras, if abnormal conditions of the change of the gesture of the package occur, the wrong abnormal packages are easily output, and by the method, the situation of the plurality of first cameras can be ensured, and the wrong abnormal packages cannot be output due to the gesture change of the package in the whole transportation process of the package on the package transportation device.
Therefore, the step of acquiring the reference image associated with the first target image from each of the third images according to the acquisition time of the first target image and the acquisition time of each of the third images further includes:
and (2.1) if the decoding result of the bar code in the reference image is that the decoding is successful, acquiring a first camera position of the reference camera.
The first camera position of the reference camera refers to a camera mounting position of the reference camera.
If the decoding result of the bar code in the reference image is that the decoding is successful, the decoding failure is indicated because the placement posture of the package is changed in the transportation process, so that the camera installation position of the reference camera can be obtained, and the camera installation position is taken as the first camera position.
(2.2) Predicting an anomaly area in the package sort device based on the first camera position and a second camera position of the first camera.
The second camera position of the first camera refers to the camera mounting position of the first camera.
The abnormal area in the parcel sorting device refers to an area in the parcel sorting device where the placement posture of the parcel is easily changed. For example, the electronic device may treat an area of the package-sorting device between the first camera location and the second camera location as an abnormal area in the package-sorting device. Or because the corner area on the package conveying device is easier to change than the straight line area, the corner area in the area can be used as an abnormal area in the package sorting device after the area of the package conveying device between the first camera position and the second camera position is acquired, so that the area of the abnormal area is reduced, and the confirmation by workers is facilitated.
(2.3) Outputting the abnormal region to a target terminal.
The target terminal may refer to a smart phone, a personal computer of a worker, or refer to a management platform of a factory where the package sorting device is located, etc.
In some embodiments, to reduce energy consumption, the abnormal parcels may be acquired only by the second camera when the number of parcels to be sorted is small and the interference information in the color image captured by the second camera is small. And when the number of packages is large and interference information in the color images shot by the second camera is large, the first camera and the second camera are started simultaneously, and abnormal packages are acquired through the first camera and the second camera simultaneously. Referring to fig. 6, at this time, before the step of "acquiring the first image captured by the first camera and the second image captured by the second camera", it includes:
601. And acquiring the number of packages to be sorted.
The number of packages to be sorted may refer to the number of packages to be sorted within a preset time period. For example, the number of packages to be sorted on a day may be determined as the number of packages to be sorted before the packages are sorted by the daily sorting mill. For example, a background database of a sorting factory at which the package sorting apparatus is sorted may be queried, and the total amount of packages sorted on the day before the day is taken as the number of packages to be sorted on the day.
602A, if the number of packages is smaller than a preset number threshold, starting a second camera, and acquiring a target package carrying an abnormal bar code through the second camera.
Wherein the quantity threshold is used to evaluate the extent to which the quantity of parcels to be sorted is sized. If the number of packages is smaller than the number threshold, the number of packages to be sorted is smaller, the number of packages in the color image shot by the second camera is smaller, and the interval between the packages is larger, so that information which is easy to interfere with bar code recognition is smaller, and abnormal packages can be acquired only through the second camera without the situation that abnormal bar codes cannot be recognized.
The specific value of the preset quantity threshold may be set according to the actual scene requirement and stored in a background database of the factory where the package sorting device is located, and when the step 602A is executed, the electronic device may directly read the quantity threshold from the background database.
602B, if the number of packages is greater than or equal to a preset number threshold, starting a first camera and a second camera, and executing the steps of acquiring a first image shot by the first camera and a second image shot by the second camera.
If the number of packages is greater than or equal to the number threshold, the number of packages to be sorted is larger, the number of packages in the color image shot by the second camera is larger, and the interval between the packages is smaller, so that information which is easy to interfere with bar code identification is larger, and in order to ensure the identification accuracy of the abnormal bar code, the first camera and the second camera are required to be started simultaneously to acquire the abnormal packages.
In some embodiments, the method may also be used for determining an abnormal device, and considering that the abnormal bar code and the occurrence probability of the abnormal package are low, if the number of abnormal packages is large, the abnormal package may be considered to be a fault of the camera itself, and if the number of abnormal packages is small, the abnormal package may be considered to be an abnormality of the preset code pasting device. It may be understood that, at this time, there should be multiple first images and multiple second target images, and referring to fig. 7, after the step of "obtaining the package in the second target image as the target package", the method further includes:
701. A first number of images of the second target image and a second number of images of the second image are acquired.
The first image number refers to the total amount of images of the second target image, and the second image number refers to the total amount of images of the second image.
702. And determining the abnormal parcel duty ratio according to the first image quantity and the second image quantity.
The abnormal parcel duty ratio refers to the duty ratio of an abnormal parcel including an abnormal barcode among parcels to be sorted.
For example, a ratio between the first number of images and the second number of images may be calculated to obtain an abnormal parcel duty cycle. Because each second target image contains abnormal packages, the method can be used for guaranteeing the total quantity of the abnormal packages, the quantity of the second images can be used for representing the total quantity of the packages to be sorted, and therefore the ratio between the quantity of the first images and the quantity of the second images can be used for estimating the proportion of the abnormal packages in the packages to be sorted.
703A, outputting abnormal alarm information of the camera if the abnormal package duty ratio is larger than a preset duty ratio threshold.
The preset duty cycle threshold is used for evaluating the degree of the abnormal parcel duty cycle. When the abnormal parcel duty ratio is larger than the duty ratio threshold value, the abnormal parcel duty ratio is larger, and the abnormal bar code is considered, and the occurrence probability of the abnormal parcel is lower, so that the abnormal parcel duty ratio can be considered to be that the camera fails, and excessive abnormal parcels are acquired. At this time, abnormal camera warning information may be output, where the abnormal camera warning information may include at least one of warning information in different manners, such as sound warning information, text warning information, and the like.
The specific value of the duty ratio threshold may be set according to the requirement of the actual scenario, and then stored in a background database of the factory where the package sorting device is located, and when the step 703A is executed, the duty ratio threshold may be directly read from the background database.
703B, outputting abnormal alarm information of the code pasting device if the abnormal package duty ratio is smaller than or equal to a preset duty ratio threshold value.
When the abnormal package occupation ratio is smaller than or equal to the occupation ratio threshold value, the abnormal package occupation ratio is smaller, so that the problem is judged to occur in the code pasting process, and abnormal alarm information of the code pasting device is output, wherein the abnormal alarm information of the code pasting device can also comprise at least one of alarm information in different modes such as sound alarm information, text alarm information and the like.
In order to better implement the package obtaining method according to the embodiment of the present application, on the basis of the package obtaining method, a package obtaining device is further provided in the embodiment of the present application, as shown in fig. 8, which is a schematic structural diagram of an embodiment of the package obtaining device according to the embodiment of the present application, where the package obtaining device 800 includes:
a first acquiring unit 801 configured to acquire a first image captured by the first camera and a second image captured by the second camera;
the recognition processing unit 802 is configured to perform barcode recognition processing on each of the first images to obtain a first target image including an abnormal barcode;
A matching unit 803, configured to match the acquisition time of the first target image with the acquisition time of each second image, so as to obtain a second target image in each second image;
A second obtaining unit 804, configured to obtain the target package in the second target image according to the first position information of the abnormal barcode in the first target image.
In a possible implementation manner of the present application, the second obtaining unit 804 is further configured to:
Performing package identification processing on the second target image to obtain each candidate package in the second target image and second position information of each candidate package;
determining mapping position information of the abnormal bar code in the second target image according to first position information of the abnormal bar code in the first target image and a preset position mapping relation between the first camera and the second camera;
and matching the mapping position information with each second position information, and acquiring a target package from each candidate package.
In a possible implementation of the present application, the identification processing unit 802 is further configured to:
Acquiring a target bar code in the first image;
And decoding the target bar code through a preset decoding algorithm, and acquiring a first target image containing abnormal bar codes failing to decode from the first image.
In a possible implementation of the present application, the matching unit 803 is further configured to:
Acquiring a reference camera corresponding to the first camera and a third image shot by the reference camera;
Acquiring a reference image associated with the first target image from each third image according to the acquisition time of the first target image and the acquisition time of each third image;
and if the decoding result of the bar code in the reference image is decoding failure, executing the step of matching the acquisition time of the first target image with the acquisition time of the second image to obtain a second target image in the second image.
In a possible implementation of the present application, the matching unit 803 is further configured to:
If the decoding result of the bar code in the reference image is that the decoding is successful, acquiring a first camera position of the reference camera;
Predicting an abnormal area in the parcel sorting device according to the first camera position and the second camera position of the first camera;
And outputting the abnormal region to a target terminal.
In a possible implementation of the present application, the matching unit 803 is further configured to:
Acquiring the number of packages to be sorted;
If the number of packages is smaller than a preset number threshold, a second camera is started, and a target package carrying an abnormal bar code is obtained through the second camera;
And if the number of packages is greater than or equal to a preset number threshold, starting a first camera and a second camera, and executing the steps of acquiring a first image shot by the first camera and a second image shot by the second camera.
In a possible implementation manner of the present application, the second obtaining unit 804 is further configured to:
acquiring a first image number of the second target image and a second image number of the second image;
determining an abnormal parcel duty ratio according to the first image quantity and the second image quantity;
if the abnormal package duty ratio is larger than a preset duty ratio threshold, outputting abnormal alarm information of the camera;
And if the abnormal package duty ratio is smaller than or equal to a preset duty ratio threshold, outputting abnormal alarm information of the code pasting device.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
The package obtaining device can execute the steps in the package obtaining method in any embodiment, so that the beneficial effects of the package obtaining method in any embodiment of the application can be realized, and detailed descriptions are omitted herein.
In addition, in order to better implement the package obtaining method in the embodiment of the present application, on the basis of the package obtaining method, the embodiment of the present application further provides an electronic device, and referring to fig. 9, fig. 9 shows a schematic structural diagram of the electronic device in the embodiment of the present application, and specifically, the electronic device provided in the embodiment of the present application includes a processor 901, where the processor 901 is configured to implement each step of the package obtaining method in any embodiment when executing a computer program stored in a memory 902; or the processor 901 is configured to implement the functions of the respective modules in the corresponding embodiment as shown in fig. 8 when executing the computer program stored in the memory 902.
By way of example, a computer program may be partitioned into one or more modules/units that are stored in the memory 902 and executed by the processor 901 to accomplish an embodiment of the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing particular functions to describe the execution of the computer program in a computer device.
Electronic devices may include, but are not limited to, a processor 901, a memory 902. It will be appreciated by those skilled in the art that the illustrations are merely examples of electronic devices and are not limiting of electronic devices, and may include more or fewer components than illustrated, or may combine certain components, or different components.
The Processor 901 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center for an electronic device, with various interfaces and lines connecting various parts of the overall electronic device.
The memory 902 may be used to store computer programs and/or modules, and the processor 901 implements various functions of the computer device by running or executing the computer programs and/or modules stored in the memory 902 and invoking data stored in the memory 902. The memory 902 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the electronic device, and the like. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart memory card (SMART MEDIA CARD, SMC), secure Digital (SD) card, flash memory card (FLASH CARD), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the package obtaining apparatus, the electronic device and the corresponding modules described above may refer to the description of the package obtaining method in any embodiment, and the description is not repeated herein.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions or by controlling associated hardware, which may be stored on a readable storage medium and loaded and executed by a processor.
Therefore, an embodiment of the present application provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs steps in a package obtaining method according to any embodiment of the present application, and specific operations may refer to descriptions of the package obtaining method according to any embodiment, which are not described herein.
Wherein the readable storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in the package obtaining method in any embodiment of the present application may be executed by the instructions stored in the readable storage medium, so that the beneficial effects that can be achieved by the package obtaining method in any embodiment of the present application may be achieved, which are described in detail in the foregoing description and are not repeated herein.
The foregoing describes in detail a package obtaining method, apparatus, storage medium and electronic device provided in the embodiments of the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.
Claims (10)
1. The method for acquiring the package is characterized by being applied to a package sorting device, the package sorting device comprises a first camera and a second camera, an image shot by the first camera is a gray image, and an image shot by the second camera is a color image, and the method comprises the following steps:
Acquiring a first image shot by the first camera and a second image shot by the second camera;
Performing bar code identification processing on the first image to obtain a first target image containing an abnormal bar code;
Matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image;
and acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image.
2. The package acquisition method according to claim 1, wherein the acquiring the target package in the second target image according to the first position information of the abnormal barcode in the first target image includes:
Performing package identification processing on the second target image to obtain each candidate package in the second target image and second position information of each candidate package;
determining mapping position information of the abnormal bar code in the second target image according to first position information of the abnormal bar code in the first target image and a preset position mapping relation between the first camera and the second camera;
and matching the mapping position information with each second position information, and acquiring a target package from each candidate package.
3. The package acquisition method according to claim 1, wherein the performing barcode recognition processing on the first image to obtain a first target image including an abnormal barcode includes:
Acquiring a target bar code in the first image;
And decoding the target bar code through a preset decoding algorithm, and acquiring a first target image containing abnormal bar codes failing to decode from the first image.
4. The package acquisition method according to claim 1, wherein the matching the acquisition time of the first target image with the acquisition time of the second image, before obtaining the second target image in the second image, further comprises:
Acquiring a reference camera corresponding to the first camera and a third image shot by the reference camera;
Acquiring a reference image associated with the first target image from each third image according to the acquisition time of the first target image and the acquisition time of each third image;
and if the decoding result of the bar code in the reference image is decoding failure, executing the step of matching the acquisition time of the first target image with the acquisition time of the second image to obtain a second target image in the second image.
5. The package acquisition method according to claim 4, wherein after the acquiring the reference image associated with the first target image from each of the third images according to the acquisition time of the first target image and the acquisition time of each of the third images, further comprising:
If the decoding result of the bar code in the reference image is that the decoding is successful, acquiring a first camera position of the reference camera;
Predicting an abnormal area in the parcel sorting device according to the first camera position and the second camera position of the first camera;
And outputting the abnormal region to a target terminal.
6. The package acquisition method of claim 1, wherein the acquiring the first image captured by the first camera and the second image captured by the second camera is preceded by:
Acquiring the number of packages to be sorted;
If the number of packages is smaller than a preset number threshold, a second camera is started, and a target package carrying an abnormal bar code is obtained through the second camera;
And if the number of packages is greater than or equal to a preset number threshold, starting a first camera and a second camera, and executing the steps of acquiring a first image shot by the first camera and a second image shot by the second camera.
7. The method of claim 1-6, wherein after the acquiring the package in the second target image is a target package, further comprising:
acquiring a first image number of the second target image and a second image number of the second image;
determining an abnormal parcel duty ratio according to the first image quantity and the second image quantity;
if the abnormal package duty ratio is larger than a preset duty ratio threshold, outputting abnormal alarm information of the camera;
And if the abnormal package duty ratio is smaller than or equal to a preset duty ratio threshold, outputting abnormal alarm information of the code pasting device.
8. A package acquisition device, comprising:
A first acquisition unit configured to acquire a first image captured by the first camera and a second image captured by the second camera;
The identification processing unit is used for carrying out bar code identification processing on each first image to obtain a first target image containing an abnormal bar code;
The matching unit is used for matching the acquisition time of the first target image with the acquisition time of each second image to obtain a second target image in each second image;
the second acquisition unit is used for acquiring the target package in the second target image according to the first position information of the abnormal bar code in the first target image.
9. An electronic device comprising a processor, a memory and a computer program stored in the memory and executable on the processor, the processor implementing the steps in the package acquisition method of any one of claims 1 to 7 when the computer program is executed by the processor.
10. A readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the package acquisition method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211406697.3A CN118052236A (en) | 2022-11-10 | 2022-11-10 | Package acquisition method, package acquisition device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211406697.3A CN118052236A (en) | 2022-11-10 | 2022-11-10 | Package acquisition method, package acquisition device, electronic equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118052236A true CN118052236A (en) | 2024-05-17 |
Family
ID=91045313
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211406697.3A Pending CN118052236A (en) | 2022-11-10 | 2022-11-10 | Package acquisition method, package acquisition device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118052236A (en) |
-
2022
- 2022-11-10 CN CN202211406697.3A patent/CN118052236A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20130033617A1 (en) | Generating an image presegmented into regions of interest and regions of no interest | |
CN111767908B (en) | Character detection method, device, detection equipment and storage medium | |
CN111597857B (en) | Logistics package detection method, device, equipment and readable storage medium | |
CN112001200A (en) | Identification code identification method, device, equipment, storage medium and system | |
US20230096532A1 (en) | Machine learning system, learning data collection method and storage medium | |
CN112052702A (en) | Method and device for identifying two-dimensional code | |
CN117671548A (en) | Abnormal sorting detection method and device, electronic equipment and storage medium | |
CN108898196B (en) | Logistics patrol monitoring method and device and patrol terminal | |
CN118052236A (en) | Package acquisition method, package acquisition device, electronic equipment and readable storage medium | |
CN111046820A (en) | Statistical method and device for vehicles in automobile roll-on-roll-off ship and intelligent terminal | |
CN116128853A (en) | Production line assembly detection method, system, computer and readable storage medium | |
CN111460198A (en) | Method and device for auditing picture timestamp | |
CN115138596A (en) | Visual detection method and device | |
CN115496894A (en) | Detection method and detection terminal for PCBA | |
CN114708214A (en) | Cigarette case defect detection method, device, equipment and medium | |
CN111160330B (en) | Training method for improving image recognition accuracy with assistance of electronic tag recognition | |
CN113361341A (en) | Luggage re-identification method, device, equipment and readable storage medium | |
CN112862409A (en) | Picking bill verification method and device | |
CN114239632B (en) | Wire and bar label identification method, system, electronic equipment and medium | |
CN117010806B (en) | Goods acceptance method, device, equipment and computer readable storage medium | |
CN117853390A (en) | Logistics object detection method, device, electronic equipment and readable medium | |
US11335007B2 (en) | Method to generate neural network training image annotations | |
CN115937184B (en) | Article assembly detection method and device and terminal equipment | |
CN118279811A (en) | Abnormal stacking identification method and device for television, electronic equipment and storage medium | |
CN117852782A (en) | Abnormal parcel processing method and device, electronic equipment and storage medium |
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 |