Express carton detection method, system and electronic device based on internet of things platform
The express delivery carton detection method using the Internet of Things platform, which utilizes affine transformation and HSV color mode, achieves accurate identification and classification of express delivery cartons, solving the problem of insufficient accuracy in existing technologies and improving the degree of automation and recycling efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING EASPRING MATERIAL TECH CO LTD
- Filing Date
- 2023-08-09
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies for classifying and identifying express delivery boxes suffer from insufficient accuracy, low automation, and a lack of user participation.
An IoT-based method for detecting express delivery cartons is adopted. By acquiring carton images, using affine transformation algorithms and HSV color mode, the rotation angle and length data of the cartons are identified. Combined with preset length and area relationships, accurate identification of cartons is achieved.
It improves the accuracy and automation of cardboard box inspection, reduces manpower and material resources, and promotes the green recycling and reusability of express delivery cardboard.
Smart Images

Figure CN117036283B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cardboard box inspection technology, specifically to a method for inspecting express cardboard boxes based on an Internet of Things (IoT) platform, an express cardboard box inspection system based on an IoT platform, and an electronic device. Background Technology
[0002] As online shopping becomes an indispensable part of people's lives, discarded express delivery packaging not only causes huge environmental and safety hazards, but is also difficult to recycle effectively. Although existing technologies exist for recycling cardboard boxes and have achieved a certain degree of automation, they suffer from many problems such as inaccurate classification results, low automation, and lack of user participation.
[0003] HSV color model (Hue, Saturation, Value) is a color space created by ARSmith in 1978 based on the intuitive characteristics of color. It is also known as the hexagonal pyramid model. Summary of the Invention
[0004] The purpose of this invention is to provide a method and system for detecting express delivery cartons based on an Internet of Things (IoT) platform. By optimizing the carton detection algorithm, the accuracy of carton integrity identification is improved, thereby at least solving some of the problems in the background art.
[0005] To achieve the above objectives, this invention provides a method for detecting express delivery cardboard boxes based on an Internet of Things (IoT) platform. The method includes: acquiring a cardboard box image; obtaining the rotation angle of the cardboard box relative to a preset direction based on the outline coordinates of the cardboard box in the image; processing the cardboard box image using an affine transformation algorithm based on the rotation angle to obtain an intermediate image containing the cardboard box conforming to the preset direction; obtaining length data of each part of the cardboard box based on the intermediate image; determining whether the length data satisfies a preset length relationship and / or whether the area data based on the length data satisfies a preset area relationship, thereby obtaining the detection result of the cardboard box.
[0006] Preferably, obtaining the rotation angle of the cardboard box relative to a preset direction based on the outline coordinate information of the cardboard box in the cardboard box image includes: fitting the outline of the cardboard box in the cardboard box image with a minimum bounding rectangle; obtaining the vertex coordinates of the minimum bounding rectangle of the cardboard box in the cardboard box image, respectively (A... x A y ), (B x B y ), (C x C y ), (D x D y );
[0007] When D x >A x At that time, rotation angle
[0008] Otherwise, rotation angle
[0009] in,
[0010] Preferably, the carton image is processed using an affine transformation algorithm based on the rotation angle to obtain an intermediate image containing the carton conforming to the preset direction. This includes: obtaining the matrix type of the affine transformation matrix based on the linear transformation matrix and translation vector required for the affine transformation; determining the values of the elements in the affine transformation matrix based on the rotation angle, the width and height of the minimum bounding rectangle; obtaining a rotation transformation matrix based on the affine transformation matrix after the element values are determined; and performing calculations on the carton image using the rotation transformation matrix to obtain an intermediate image containing the carton conforming to the preset direction.
[0011] Preferably, before obtaining the length data of each part of the carton based on the intermediate image, the method further includes: converting the intermediate image from RGB color mode to HSV color mode; and increasing the hue corresponding to the respective color channel according to the color of the carton.
[0012] Preferably, determining whether the area data based on the length data satisfies a preset area relationship to obtain the detection result of the carton includes: obtaining the following area data based on the length data: the area of the smallest bounding rectangle and the actual area occupied by the carton in the smallest bounding rectangle; calculating the ratio of the actual occupied area to the area of the smallest bounding rectangle; and obtaining the detection result of the carton based on the comparison result of the calculated ratio and the preset area relationship.
[0013] Preferably, the method further includes: adjusting at least one of the judgment conditions in the preset length relationship and the preset area relationship based on the systematic error present in the detection results of the carton.
[0014] This invention also provides a cardboard box detection system based on an Internet of Things (IoT) platform. The system includes: a cardboard box detection front end for acquiring cardboard box images; a vision processing module for detecting the cardboard box images according to the aforementioned cardboard box detection method based on an IoT platform to obtain the detection results of the cardboard box; and a database for storing the data generated by the cardboard box detection front end and the vision processing module.
[0015] Preferably, the carton detection front end includes: a modular programmable controller, and a stepper motor, a DC motor, an indicator light, a proximity switch, a photoelectric sensor, and a button electrically connected to the modular programmable controller; the modular programmable controller also provides a control interface for communicating with an external applet, the control interface being used to receive control commands from the external applet.
[0016] Preferably, the carton detection front end is located in the intranet, and the carton detection front end communicates with the vision processing module and database located in the extranet through the intranet penetration module.
[0017] The present invention also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the steps of the aforementioned express carton detection method based on an Internet of Things platform by executing the instructions stored in the memory.
[0018] The present invention also provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the steps of the aforementioned method for detecting express carton based on an Internet of Things platform.
[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the aforementioned method for detecting express carton based on an Internet of Things platform.
[0020] The above technical solution has the following beneficial effects:
[0021] (1) The detection method in the embodiments provided by the present invention has a high degree of matching with the target model feature detection results and significantly improves the accuracy of the detection results.
[0022] (2) The embodiments provided by the present invention combine the Internet of Things application to design an intelligent recycling system for express delivery cardboard boxes. This system can achieve accurate identification and classification of express delivery cardboard boxes. This system can greatly reduce manpower and material resources, effectively improve the recycling rate of waste cardboard boxes, and thus promote the green recycling and recyclability of express delivery cardboard boxes.
[0023] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0024] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings:
[0025] Figure 1 The schematic diagram illustrates the steps of a method for detecting express delivery cartons based on an Internet of Things platform according to an embodiment of the present invention.
[0026] Figure 2 This diagram schematically shows a plan view of the cardboard box after it has been unfolded.
[0027] Figure 3 This illustration schematically shows the structure of the front end of the express carton detection system based on an Internet of Things platform according to an embodiment of the present invention;
[0028] Figure 4 The schematic diagram illustrates the structure of an express carton detection device based on an Internet of Things platform according to an embodiment of the present invention. Detailed Implementation
[0029] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.
[0030] Figure 1 The illustration schematically depicts the steps of a method for detecting express delivery cartons based on an Internet of Things (IoT) platform according to an embodiment of the present invention. Figure 1 As shown, a method for detecting express delivery cardboard boxes based on an Internet of Things (IoT) platform includes:
[0031] S01. Obtain the image of the cardboard box;
[0032] S02. Obtain the rotation angle of the carton relative to the preset direction based on the outline coordinate information of the carton in the carton image;
[0033] S03. The carton image is processed using an affine transformation algorithm based on the rotation angle to obtain an intermediate image containing the carton conforming to the preset direction;
[0034] S04. Obtain the length data of each part of the carton based on the intermediate image;
[0035] S05. Determine whether the length data satisfies a preset length relationship and / or whether the area data based on the length data satisfies a preset area relationship, and obtain the detection result of the carton.
[0036] The above implementation methods enable accurate identification of express delivery cardboard boxes, significantly reducing manpower and material resources, effectively improving the recycling rate of waste cardboard boxes, and thus promoting the green recycling and reusability of cardboard boxes. Results show that the detection algorithm in this implementation method has a high matching degree with the target model feature detection results and demonstrates significant effectiveness.
[0037] During the cardboard box inspection process, no limiting action was taken when the cardboard box was placed in the system. Therefore, the final identified sample will rotate, causing errors in length and area data. To eliminate cardboard box rotation, it is first necessary to identify the rotation angle. The method provided in this implementation is as follows: Find the smallest rectangle that encloses the cardboard box and obtain the rectangle's coordinates (A...). x A y ), (B x B y ), (C x C y ), (D x D y For example, the horizontal direction is used as the aforementioned preset direction to facilitate subsequent calculations. This preset direction can be flexibly selected according to different scenarios. The calculation formulas for the width (W) and height (H) of the smallest bounding rectangle of the cardboard box and the rotation angle (θ) are as follows:
[0038]
[0039] This yields the rotation angle θ, providing angle parameters for subsequent rotation transformations.
[0040] In some embodiments of the present invention, the cardboard box image is processed using an affine transformation algorithm based on the rotation angle to obtain an intermediate image containing the cardboard box conforming to the preset orientation. This includes: obtaining the matrix type of the affine transformation matrix based on the linear transformation matrix and translation vector required for the affine transformation; determining the values of the elements in the affine transformation matrix based on the rotation angle, the width and height of the minimum bounding rectangle; obtaining a rotation transformation matrix based on the affine transformation matrix with the determined element values; and performing calculations on the cardboard box image using the rotation transformation matrix to obtain an intermediate image containing the cardboard box conforming to the preset orientation. Specifically:
[0041] After calculating the length, width, and rotation angle of the circumscribed rectangle, an affine transformation is used to find the relationship between the two images. A linear matrix transformation is then performed to achieve the image rotation effect. A typical method for representing an affine transformation is to use a 2×3 matrix, with A and B transforming the 2D vectors. Given a target image X, which is linearly transformed and rotated into the desired image T, the following algorithm is designed:
[0042]
[0043]
[0044]
[0045]
[0046]
[0047] An affine transformation matrix for a two-dimensional image is obtained using geometric image transformation. The matrix type is:
[0048]
[0049] Where α = cosθ (8)
[0050] β=sinθ (9)
[0051] When performing a combined transformation around a specified point, the homogeneous coordinate representation of the combined transformation of the reference point p(m, n) rotating clockwise by θ (counterclockwise by -θ) is expressed by the following formula:
[0052]
[0053] This implementation uses two algorithms—affine transformation and geometric image transformation—to achieve the required rotation of the cardboard box, increasing the accuracy and completeness of cardboard box recognition. It also identifies the morphology of the circumscribed rectangle of the cardboard box, providing relevant data for subsequent algorithm calculations.
[0054] In some embodiments of the present invention, before obtaining the length data of each part of the cardboard box based on the intermediate image, the method further includes: converting the intermediate image from RGB color mode to HSV color mode; and increasing the hue corresponding to the respective color channel according to the color of the cardboard box. For example, because the R, G, and B components of an object's color in a digital image are related to the amount of light hitting the object, image descriptions based on these components make object identification difficult. To facilitate visual inspection, BGR needs to be converted to HSV to make the image description regarding hue (H), saturation (S), and lightness (V) more relevant. To make the identification of yellow (a common color of cardboard boxes) more sensitive, the coefficients of R and G for hue (H) in the algorithm are increased. The algorithm is as follows:
[0055] V = max {R, G, B} (11)
[0056]
[0057]
[0058] The color enhancement algorithms described above can improve the recognizability of subsequent visual recognition and detection, thereby enhancing detection accuracy.
[0059] In some embodiments provided by this invention, determining whether the area data based on the length data satisfies a preset area relationship to obtain the detection result of the cardboard box includes: obtaining the following area data based on the length data: the area of the smallest bounding rectangle and the actual area occupied by the cardboard box within the smallest bounding rectangle; calculating the ratio of the actual occupied area to the area of the smallest bounding rectangle; and obtaining the detection result of the cardboard box based on the comparison result of the calculated ratio and the preset area relationship. For example, both length data and area data can be used for judgment. For instance, when the cardboard box simultaneously meets the following conditions, the detection result is "qualified". Figure 2 The diagram schematically shows a planar view of the unfolded cardboard box. The dotted lines and "slots" in the diagram represent creases and slots, respectively, and also correspond to the edges of the box in its three-dimensional state. The lengths marked in the diagram (a) x b x c x ) and area ratio (S p After testing, calculations are performed. If the following requirements are met, the test result is considered to be: "Meets the carton conditions".
[0060]
[0061] The above combination of judgment conditions is only an example; users can adjust these conditions according to different carton specifications. Judgment conditions also include separate use for length data judgment and area data judgment. For example: as long as 2*a x =b x and c x >b x If the length data meets the preset length relationship, the inspection result for the carton is considered "qualified" or "compliant". If the length relationship is not met, the inspection result is considered "unqualified" or "non-compliant". Note that the above 2*a... x =b x and c x >b x This is based on the length relationship set according to the type of cardboard box. In actual scenarios, adjustments need to be made according to different cardboard box types to obtain more accurate detection results. For example, using only area data for judgment, as long as the area percentage S... p Satisfying 0.95>S p If the value is greater than 0.85, the test result of the carton is considered "qualified" or "compliant"; otherwise, the test result is "unqualified" or "non-compliant".
[0062] In some implementations, the area data judgment condition and the length data judgment condition are set in a specific order. For example, after the area data judgment condition is met, the length data judgment condition is then judged.
[0063] In some embodiments provided by this invention, the method further includes: adjusting at least one judgment condition among the preset length relationship and the preset area relationship based on the systematic error present in the detection result of the cardboard box. For example, the above algorithm considers whether the area of the input cardboard box and the edge length of the cardboard shell meet the RSC cardboard box requirements, and adopts the following adjustment strategy: 1) When the systematic error is large, but the edge length ratio of the cardboard box is correct, the area with the color proportion is slightly reduced to increase the target action threshold range of the cardboard box, thereby increasing the target action threshold of the target cardboard shell and improving the stability of the color recognition algorithm result of the cardboard box. 2) When the systematic error is large, but the color recognition threshold range is relatively large, the systematic error of the edge detection result is increased within a controllable range, which has a positive impact on the calculation of the edge algorithm of the cardboard shell.
[0064] In some embodiments provided by this invention, a cardboard box detection system based on an Internet of Things (IoT) platform is provided. The system includes: a cardboard box detection front-end for acquiring cardboard box images; a vision processing module for detecting the cardboard box images using the aforementioned IoT-based cardboard box detection method to obtain detection results; and a database for storing data generated by the cardboard box detection front-end and the vision processing module. The cardboard box detection front-end can be a self-service paper product machine in the prior art, which includes an image acquisition device for acquiring cardboard box images.
[0065] Figure 3 This diagram schematically illustrates the structure of the front-end of a cardboard box inspection system based on an Internet of Things (IoT) platform according to an embodiment of the present invention. Figure 3As shown, the carton detection front end includes: a modular programmable controller, and a stepper motor, a DC motor, indicator lights, proximity switches, photoelectric sensors, and buttons electrically connected to the modular programmable controller. The S7-200 SMART PLC is a modular programmable controller capable of combining various functional modules according to requirements. It uses floating-point arithmetic to achieve complex arithmetic functions, offering high flexibility, high accuracy, and powerful communication capabilities. It can provide different types of CPU modules with a rich number of I / O points, with a maximum of 60 I / O points per unit, meeting the control needs of most small automated equipment. Furthermore, standard and economical CPU modules are available for users to choose from, offering more flexible product configurations for different application needs and minimizing control costs. The CPU module itself integrates up to 3 high-speed pulse outputs with a frequency up to 100kHz, supporting PWM / PTO output modes and multiple motion modes, and allowing for free setting of motion envelopes. It also features a user-friendly wizard setup function for quick implementation of equipment speed adjustment, positioning, and other functions. Each S7-200 SMART CPU module integrates one RS485 interface, enabling communication with third-party devices such as frequency converters and touch screens. If additional serial ports are needed, they can be achieved by expanding the CM01 signal board. The signal board supports free conversion between RS232 and RS485 and supports up to 4 devices.
[0066] The modular programmable controller also provides a control interface for communicating with an external mini-program, which is used to receive control commands from the external mini-program. This carton detection front-end can be used in conjunction with a WeChat mini-program, allowing users to operate the carton detection front-end on their mobile devices to complete operations such as carton feeding.
[0067] Users submit cardboard boxes via a WeChat mini-program. This physical platform processes images of the boxes placed on the gimbal and uploads the corresponding information to an external database. Then, through a server-mapped internal PLC address, the data is transmitted from the server to the internal PLC. The internal PLC receives the data and controls the stepper motors, DC motors, photoelectric sensors, proximity switches, buttons, and indicator lights to achieve the sorting and storage of the cardboard boxes. Simultaneously, a host computer reads data from the database for product management.
[0068] In some embodiments of the present invention, the carton detection front-end is located within an intranet, and communicates with a vision processing module and a database located on an external network via an intranet penetration module. In one scenario, both the vision processing module and the database communication are located in the cloud; when the carton detection front-end needs to access the vision processing module and the database, it needs to do so through the intranet penetration module. This deployment method ensures the security of the carton detection front-end within the intranet while providing data interoperability with the external network.
[0069] In some embodiments of the present invention, an electronic device is also provided, comprising: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which executes the steps of the aforementioned method for detecting express carton based on an Internet of Things platform. The control module or processor here has numerical calculation and logical operation functions, and at least has a central processing unit (CPU) with data processing capabilities, random access memory (RAM), read-only memory (ROM), multiple I / O ports, and an interrupt system. The processor contains a kernel that retrieves corresponding program units from the memory. One or more kernels can be configured, and the aforementioned method can be implemented by adjusting kernel parameters. The memory may include non-permanent memory in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and includes at least one memory chip.
[0070] Based on the same inventive concept, the present invention also provides a cardboard box detection device based on an Internet of Things platform. Figure 4 The diagram illustrates the structure of a courier carton detection device based on an Internet of Things (IoT) platform according to an embodiment of the present invention. Figure 4 As shown, the device includes: an image acquisition module for acquiring an image of a cardboard box; an angle calculation module for obtaining the rotation angle of the cardboard box relative to a preset direction based on the outline coordinate information of the cardboard box in the image; a rotation transformation module for processing the cardboard box image using an affine transformation algorithm based on the rotation angle to obtain an intermediate image containing the cardboard box conforming to the preset direction; a length recognition module for obtaining length data of each part of the cardboard box based on the intermediate image; and a result judgment module for judging whether the length data satisfies a preset length relationship and / or whether the area data based on the length data satisfies a preset area relationship, thereby obtaining the detection result of the cardboard box.
[0071] In some optional embodiments, the rotation angle of the cardboard box relative to a preset direction is obtained based on the outline coordinate information of the cardboard box in the cardboard box image, including: adapting the outline of the cardboard box in the cardboard box image to a minimum bounding rectangle; obtaining the vertex coordinates of the minimum bounding rectangle of the cardboard box in the cardboard box image, respectively (A... x A y ), (B x B y ), (C x C y ), (D x D y );
[0072] When D x>A x At that time, rotation angle
[0073] Otherwise, rotation angle
[0074] in,
[0075] In some optional embodiments of the present invention, the cardboard box image is processed using an affine transformation algorithm based on the rotation angle to obtain an intermediate image containing the cardboard box conforming to the preset direction. This includes: obtaining the matrix type of the affine transformation matrix based on the linear transformation matrix and translation vector required for the affine transformation; determining the values of the elements in the affine transformation matrix based on the rotation angle, the width and height of the minimum bounding rectangle; obtaining a rotation transformation matrix based on the affine transformation matrix after the element values are determined; and performing calculations on the cardboard box image using the rotation transformation matrix to obtain an intermediate image containing the cardboard box conforming to the preset direction.
[0076] In some optional embodiments of the present invention, before obtaining the length data of each part of the carton based on the intermediate image, the method further includes: converting the intermediate image from RGB color mode to HSV color mode; and increasing the hue corresponding to the corresponding color channel according to the color of the carton.
[0077] In some optional embodiments of the present invention, determining whether the area data based on the length data satisfies a preset area relationship to obtain the detection result of the carton includes: obtaining the following area data based on the length data: the area of the minimum bounding rectangle and the actual area occupied by the carton in the minimum bounding rectangle; calculating the ratio of the actual occupied area to the area of the minimum bounding rectangle; and obtaining the detection result of the carton based on the comparison result of the calculated ratio and the preset area relationship.
[0078] In some optional embodiments of the present invention, the device further includes: a condition adjustment module, used to adjust at least one of the judgment conditions of the preset length relationship and the preset area relationship based on the systematic error present in the detection result of the carton.
[0079] The specific limitations of each functional module in the aforementioned IoT-based express carton detection device can be found in the limitations of the IoT-based express carton detection method described above, and will not be repeated here. Each module in the device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, allowing the processor to call and execute the corresponding operations. It can also achieve accurate identification and classification of express cartons, and has the advantages of high matching degree of target model feature detection results and significant effectiveness.
[0080] In one embodiment of the present invention, a machine-readable storage medium is provided, on which instructions are stored, which, when executed by a processor, cause the processor to be configured to perform the steps of the aforementioned express carton detection method based on an Internet of Things platform.
[0081] In one embodiment of the present invention, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the aforementioned express carton detection method based on an Internet of Things platform.
[0082] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0083] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0084] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0085] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0086] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0087] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0088] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0089] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0090] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for detecting express delivery cardboard boxes based on an Internet of Things (IoT) platform, characterized in that, The method includes: Get the image of the cardboard box; The rotation angle of the cardboard box relative to the preset direction is obtained based on the outline coordinate information of the cardboard box in the image of the cardboard box. The cardboard box image is processed using an affine transformation algorithm based on the rotation angle to obtain an intermediate image containing the cardboard box conforming to the preset direction; The length data of each part of the cardboard box are obtained based on the intermediate image; Determine whether the length data satisfies a preset length relationship and / or whether the area data based on the length data satisfies a preset area relationship to obtain the detection result of the carton integrity identification; The preset length relationship includes: 2*a x =b x and c x >b x ; wherein, the a x b x c x These represent the length of the slot after the carton is unfolded, the length of the short side crease that is not collinear with the slot, and the length of the long side crease that is not collinear with the slot, respectively. Determining whether the area data based on the length data satisfies a preset area relationship to obtain the detection result of the carton integrity identification includes: obtaining the following area data based on the length data: the area of the minimum bounding rectangle and the actual area occupied by the carton in the minimum bounding rectangle; calculating the ratio of the actual occupied area to the area of the minimum bounding rectangle, i.e., S. p According to the calculated ratio S p The comparison result with the preset area relationship yields the detection result of the carton. The preset area relationship includes: 0.95>S p >0.85; Before obtaining the length data of each part of the carton based on the intermediate image, the method further includes: Convert the intermediate image from RGB color mode to HSV color mode; Based on the color of the cardboard box, the hue corresponding to the relevant color channel is increased. The algorithm is as follows: ; ; 。 2. The method according to claim 1, characterized in that, The rotation angle of the cardboard box relative to a preset direction is obtained based on the outline coordinate information of the cardboard box in the image of the cardboard box, including: The outline of the carton in the carton image is adapted to the smallest bounding rectangle; Obtain the vertex coordinates of the smallest bounding rectangle of the cardboard box in the image of the cardboard box, which are (A... x A y ), (B x B y ), (C x C y ), (D x D y ); When D x >A x When, the rotation angle θ= ; Otherwise, the rotation angle θ = ; in, W = .
3. The method according to claim 1, characterized in that, The cardboard box image is processed using an affine transformation algorithm based on the rotation angle to obtain an intermediate image containing the cardboard box conforming to the preset orientation, including: The matrix type of the affine transformation matrix is obtained from the linear transformation matrix and translation vector required by the affine transformation; The values of the elements in the affine transformation matrix are determined based on the rotation angle, the width of the minimum bounding rectangle, and the height of the rectangle. The rotation transformation matrix is obtained based on the values of the elements in the determined affine transformation matrix; The rotation transformation matrix is used to perform calculations on the cardboard box image to obtain an intermediate image containing the cardboard box conforming to the preset orientation.
4. The method according to claim 1, characterized in that, The method further includes: Based on the systematic errors present in the detection results of the cardboard box, at least one of the judgment conditions in the preset length relationship and the preset area relationship is adjusted.
5. A cardboard box inspection system for express delivery based on an Internet of Things (IoT) platform, characterized in that, The system includes: The front end for detecting cardboard boxes is used to capture images of the cardboard boxes; A visual processing module is used to detect the cardboard box image according to the IoT platform-based express cardboard box detection method according to any one of claims 1 to 4, and obtain the detection result of the cardboard box; A database is used to store the data generated by the carton detection front end and the vision processing module.
6. The system according to claim 5, characterized in that, The carton detection front end includes: Modular programmable controllers, and The stepper motor, DC motor, indicator light, proximity switch, photoelectric sensor, and button are electrically connected to the modular programmable controller. The modular programmable controller also provides a control interface for communicating with external applets, which is used to receive control commands from the external applets.
7. The system according to claim 5, characterized in that, The carton detection front end is located in the intranet, and it communicates with the vision processing module and database located in the extranet through the intranet penetration module.
8. An electronic device, characterized in that, include: At least one processor; A memory connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the express carton detection method based on the Internet of Things platform as described in any one of claims 1 to 4 by executing the instructions stored in the memory.