Material counting method, system, computer device and storage medium

Through the X-ray machine scanning materials and using the material classification model to identify the material type, the problems of inaccurate material counting and unpacking and packaging in the existing technology are solved, and the rapid and accurate material quantity statistics are achieved to meet the efficient needs of automated production lines.

CN113870168BActive Publication Date: 2025-03-11TRIPLE WIN TECH (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010531014.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-11
Publication Date
2025-03-11
Estimated Expiration
2040-08-20

AI Technical Summary

Technical Problem

In the prior art, the material counting is inaccurate and requires unpacking and packaging for counting, which cannot meet the efficient needs of automated production lines.

Method used

Three-dimensional scanned images of materials were obtained by scanning the X-ray machine, and the material type was identified using a pre-trained material classification model, and the quantity of materials of each type was counted.

Benefits of technology

It realizes the rapid and accurate statistics of the quantity of materials, no need to disassemble and packaging, and does not damage the incoming material status of materials, meeting the efficient needs of automated production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113870168B_ABST
    Figure CN113870168B_ABST
Patent Text Reader

Abstract

The present application provides a material counting method, comprising: receiving a three-dimensional scanning image of a material, wherein the three-dimensional scanning image is obtained by scanning an X-ray machine; preprocessing the three-dimensional scanning image; identifying the type of the material according to the three-dimensional scanning image using a pre-trained material classification model; and counting the number of each type of material to obtain the total number of each type of material. The present application also provides a material counting system, a computer device, and a storage medium. The present application can classify materials and accurately calculate the total number of materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of material counting, and in particular to a material counting method, system, computer device and storage medium. Background Art

[0002] In the process of industrial automation, it is often necessary to count materials, sometimes packaged materials that are used for the first time (such as thermistors). Sometimes various materials are piled together, and workers are required to disperse the piled materials and arrange them neatly according to a regular pattern, and then sort and count them. In the prior art, the materials to be counted can be placed on the counter for counting, but there are problems such as inaccurate counting and the need to unpack the material packaging for counting. It is unable to meet the needs of the increasingly efficient automated production lines. Summary of the invention

[0003] In view of the above, it is necessary to provide a material counting method, system, computer device and storage medium that can quickly and accurately count the number of materials.

[0004] On the one hand, the present application provides a material counting method, the method comprising:

[0005] Receiving a three-dimensional scanned image of a material, wherein the three-dimensional scanned image is obtained by scanning with an X-ray machine;

[0006] Preprocessing the three-dimensional scanned image;

[0007] Identify the type of the material using a pre-trained material classification model according to the three-dimensional scanned image; and

[0008] Count the number of each type of material to get the total number of each type of material.

[0009] Preferably, preprocessing the three-dimensional scanned image includes:

[0010] Gray-scaling the three-dimensional scanned image;

[0011] Perform geometric transformation on the grayscale 3D scanned image;

[0012] Perform image enhancement on the three-dimensional scanned image.

[0013] Preferably, identifying the type of the material using a pre-trained material classification model according to the three-dimensional scanned image comprises:

[0014] Identifying a plurality of materials in the three-dimensional scanned image;

[0015] cutting the three-dimensional scan image according to the plurality of materials;

[0016] The cut image is input into the pre-trained material classification model, and the type of the material is output.

[0017] Preferably, the method further comprises: calculating the qualified rate of the material.

[0018] Preferably, the calculating the qualified rate of the material comprises:

[0019] Compare the cut 3D scanned image with the pre-stored standard material image to confirm whether the material meets the requirements;

[0020] Count the number of materials that meet the requirements;

[0021] The qualified rate of the material is calculated according to the material quantity and the total number of the materials.

[0022] Preferably, the confirming whether the material meets the requirements includes:

[0023] Calculating the similarity between the cut three-dimensional scanned image and a pre-stored standard material image;

[0024] comparing the similarity with a preset similarity;

[0025] When the similarity is greater than or equal to the preset similarity, confirming that the material meets the requirements;

[0026] When the similarity is less than the preset similarity, it is confirmed that the material does not meet the requirements.

[0027] Preferably, after identifying a plurality of materials in the three-dimensional scanned image, the method further comprises:

[0028] The actual dimensions of the plurality of materials are measured.

[0029] A second aspect of the present application provides a material counting system, the system comprising:

[0030] A receiving module, used for receiving a three-dimensional scanning image of a material, wherein the three-dimensional scanning image is obtained by scanning with an X-ray machine;

[0031] A preprocessing module, used for preprocessing the three-dimensional scanned image;

[0032] an identification module, configured to identify the type of the material using a pre-trained material classification model according to the three-dimensional scanned image; and

[0033] The statistics module is used to count the quantity of each type of material and obtain the total number of each type of material.

[0034] A third aspect of the present application provides a computer device, comprising a memory and at least one processor, wherein the memory stores at least one instruction, and when the at least one instruction is executed by the at least one processor, the material counting method is implemented.

[0035] A fourth aspect of the present application provides a computer-readable storage medium storing at least one instruction, which implements the material counting method when executed by a processor.

[0036] Compared with the prior art, the material counting method, system, computer device and storage medium obtain a three-dimensional scan image of the material through X-ray scanning, identify the type of the material according to the three-dimensional scan image using a pre-trained material classification model, and count the number of each type of material to obtain the total number of each type of material. There is no need to disassemble the packaging of the material, the incoming material state is not destroyed, and the total number of materials can be accurately calculated. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a structural diagram of a computer device according to a preferred embodiment of the present invention.

[0038] Figure 2 It is a functional module diagram of a material counting system of a preferred embodiment of the present invention.

[0039] Figure 3 It is a flow chart of a material counting method according to a preferred embodiment of the present invention.

[0040] Main component symbols

[0041] Computer device 1

[0042] Memory 11

[0043] Processor 12

[0044] Scan Device 2

[0045] Material counting system 10

[0046] Receiving module 101

[0047] Preprocessing module 102

[0048] Identification module 103

[0049] Statistics Module 104

[0050] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0051] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0054] See also Figure 1 , which is an architectural diagram of a computer device provided in a preferred embodiment of the present invention.

[0055] In this embodiment, the computer device 1 includes a memory 11 and at least one processor 12 which are electrically connected to each other.

[0056] Those skilled in the art should understand that Figure 1 The structure of the computer device 1 shown does not constitute a limitation of the embodiment of the present invention. The computer device 1 may also include Figure 1 More or less other hardware or software, or a different arrangement of components.

[0057] It should be noted that the computer device 1 is only an example, and other existing or future computer devices that are adaptable to the present invention should also be included in the protection scope of the present invention and included herein by reference.

[0058] In some embodiments, the memory 11 can be used to store the program code of the computer program and various data. For example, the memory 11 can be used to store the material counting system 10 installed in the computer device 1, and realize high-speed and automatic access to the program or data during the operation of the computer device 1. The memory 11 can include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other non-volatile computer-readable storage medium that can be used to carry or store data.

[0059] In some embodiments, the at least one processor 12 may be composed of an integrated circuit. For example, it may be composed of a single packaged integrated circuit, or it may be composed of multiple packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The at least one processor 12 is the control core (Control Unit) of the computer device 1, and uses various interfaces and lines to connect the various components of the entire computer device 1. By executing programs, modules, or instructions stored in the memory 11, and calling data stored in the memory 11, it can execute various functions of the computer device 1 and process data, such as the material counting function (for details, see the following). Figure 3 ).

[0060] In this embodiment, the computer device 1 is connected to a scanning device 2. The scanning device 2 may be an X-ray scanning machine, which is used to scan a material, obtain a three-dimensional image of the material, and send the three-dimensional image of the material to the computer device 1. In one embodiment, the scanning device 2 may also be a three-dimensional laser scanner.

[0061] In this embodiment, the material counting system 10 may include multiple modules, which are stored in the memory 11 and executed by at least one or more processors (processor 12 in this embodiment) to implement the function of material counting (for details, see the following). Figure 3 In this embodiment, the material counting system 10 can be divided into multiple modules according to the functions it performs. Figure 2 As shown, the multiple modules include a receiving module 101, a preprocessing module 102, a recognition module 103 and a statistical module 104. The module referred to in the present invention refers to a series of computer-readable instruction segments that can be executed by at least one processor (such as processor 12) and can complete fixed functions, which are stored in a memory (such as memory 11 of computer device 1). In this embodiment, the functions of each module will be described in detail later in conjunction with Figure 3 Describe in detail.

[0062] In one embodiment, the memory 11 stores standard material images in advance.

[0063] In this embodiment, the integrated unit implemented in the form of a software function module can be stored in a non-volatile readable storage medium. The above-mentioned software function module includes one or more computer-readable instructions, and the computer device 1 or a processor implements part of the method of each embodiment of the present invention by executing the one or more computer-readable instructions, such as Figure 3 Material counting method shown.

[0064] In a further embodiment, in combination Figure 2 The at least one processor 12 can execute various application programs (such as the material counting system 10 ), program codes, etc. installed in the computer device 1 .

[0065] In a further embodiment, the memory 11 stores program codes of a computer program, and the at least one processor 12 can call the program codes stored in the memory 11 to execute related functions. For example, Figure 2 The modules of the material counting system 10 are program codes stored in the memory 11 and executed by the at least one processor 12, thereby realizing the functions of the modules to achieve the purpose of material counting (see below for details). Figure 3 description).

[0066] In one embodiment of the present invention, the memory 11 stores one or more computer-readable instructions, and the one or more computer-readable instructions are executed by the at least one processor 12 to achieve the purpose of material counting. Specifically, the specific implementation method of the at least one processor 12 for the above-mentioned computer-readable instructions is described in detail below. Figure 3 Description.

[0067] Figure 3 It is a flow chart of a material counting method provided by a preferred embodiment of the present invention.

[0068] In this embodiment, the material counting method can be applied to a computer device 1. For a computer device 1 that needs to perform material counting, the function for material counting provided by the method of the present invention can be directly integrated on the computer device 1, or run on the computer device 1 in the form of a software development kit (SDK).

[0069] like Figure 3 As shown, the material counting method specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.

[0070] Step S1: The receiving module 101 receives a three-dimensional scanning image of a material, wherein the three-dimensional scanning image is obtained by scanning with an X-ray machine.

[0071] In one embodiment, when it is necessary to count the types and quantities of materials, the materials are placed in an X-ray machine for scanning. The X-ray machine includes a plurality of cameras and a transmission device. After placing the materials on the transmission device, the plurality of cameras are activated to photograph the materials from multiple angles. The transmission device for the materials in and out can use a spring, a clip, a gear and a chain device, or the materials can be placed manually.

[0072] In one embodiment, multiple rolls of the same material may be placed on the transmission device at the same time, or multiple rolls of different types of materials may be placed on the transmission device at the same time.

[0073] After the X-ray machine scans the three-dimensional scan image of the material, the three-dimensional scan image is sent to the computer device 1 .

[0074] Step S2: the preprocessing module 102 preprocesses the three-dimensional scanned image.

[0075] In order to eliminate irrelevant information in the three-dimensional scanned image, it is necessary to preprocess the three-dimensional scanned image, restore the useful real information in the three-dimensional scanned image, enhance the detectability of relevant information, and simplify the data to the maximum extent, thereby improving the reliability of feature extraction, image segmentation, matching and recognition. Specifically, the preprocessing of the three-dimensional scanned image includes:

[0076] (1) Graying the three-dimensional scanned image. The three-dimensional scanned image is grayed using four methods: component method, maximum value method, average value method and weighted average method.

[0077] (2) Performing geometric transformation on the grayscaled three-dimensional scanned image. For example, the three-dimensional scanned image is processed by geometric transformations such as translation, transposition, mirroring, rotation, and scaling to correct the systematic error of the image X-ray machine and the random error of the instrument position (imaging angle, perspective relationship, and even the lens itself). In addition, in order to solve the problem that the pixels of the output image may be mapped to non-integer coordinates of the input image after the three-dimensional scanned image is geometrically transformed, it is also necessary to use a grayscale interpolation algorithm to process the transformed image. Commonly used grayscale interpolation algorithms include nearest neighbor interpolation, bilinear interpolation, and bicubic interpolation.

[0078] (3) Perform image enhancement on the three-dimensional scanned image. Purposefully emphasize the overall or local characteristics of the three-dimensional scanned image, make the originally unclear image clear or emphasize certain interesting features, expand the difference between the features of different objects in the image, suppress the features that are not of interest, so as to improve the image quality, enrich the amount of information, strengthen the image interpretation and recognition effect, and meet the needs of certain special analysis. Image enhancement algorithms may include: spatial domain method and frequency domain method.

[0079] Step S3: the identification module 103 identifies the type of the material according to the three-dimensional scan image using a pre-trained material classification model.

[0080] In this embodiment, when the scanned materials include materials of different types, it is necessary to first confirm the types of the materials and then count the materials of the same type.

[0081] Specifically, identifying the material type according to the three-dimensional scanning image includes:

[0082] (a) identifying a plurality of materials in the three-dimensional scanned image;

[0083] In one embodiment, the three-dimensional scanning image may include a plurality of different types of materials. Each material in the three-dimensional scanning image is first identified and then classified.

[0084] (b) cutting the three-dimensional scan image according to the plurality of materials;

[0085] In one embodiment, a three-dimensional scanned image containing multiple materials is cut into pictures containing one material. For example, if picture A contains material a, material b, and material c, picture A is cut into picture A1 containing material a, picture A2 containing material b, and picture A3 containing material c.

[0086] (c) Input the cut image into a pre-trained material classification model to output the material type. For example, input image A1, image A2, and image A3 into the pre-trained material classification model to obtain the type of material a, the type of material b, and the type of material c.

[0087] In one embodiment, the material classification model training method comprises the following steps:

[0088] 1) Obtain material type images of positive samples and material type images of negative samples, and label the material type images of positive samples with material categories, so that the material type images of positive samples carry material category labels.

[0089] For example, select 500 material type images corresponding to thermistors, capacitors, and diodes respectively, and label the category of each material type image. "1" can be used as the material type label of thermistors, "2" can be used as the material type label of normal loads, and "3" can be used as the material type label of low loads.

[0090] 2) Randomly divide the material type pictures of the positive samples and the material type pictures of the negative samples into a training set of a first preset ratio and a verification set of a second preset ratio, use the training set to train the material classification model, and use the verification set to verify the accuracy of the trained material classification model.

[0091] First, the training samples in the training set of different material categories are distributed to different folders. For example, the training samples of thermistors are distributed to the first folder, the training samples of capacitors are distributed to the second folder, and the training samples of diodes are distributed to the third folder. Then, the first preset proportion (for example, 70%) of the training samples are extracted from different folders as the total training samples to train the material classification model, and the remaining second preset proportion (for example, 30%) of the training samples are extracted from different folders as the total test samples to verify the accuracy of the trained material classification model.

[0092] 3) If the accuracy rate is greater than or equal to the preset accuracy rate, the training is terminated and the trained material classification model is used as a classifier to identify the category of the material; if the accuracy rate is less than the preset accuracy rate, the number of positive samples and the number of negative samples are increased to retrain the material classification model until the accuracy rate is greater than or equal to the preset accuracy rate.

[0093] In one embodiment, after identifying a plurality of materials in the three-dimensional scan image, the material counting method further includes:

[0094] The actual dimensions of the plurality of materials are measured.

[0095] Specifically, the distance between the focus of the scanning device 2 and the material in the image is obtained; the pixel size of each material is obtained; the minimum pixel size of the reference image and the actual size of the reference image are obtained; and the actual size of the material is calculated according to the distance between the focus and the material in the image, the pixel size of the material and the actual size of the reference image. It can be understood that the method of measuring the sizes of the multiple materials is not limited to the above method.

[0096] Step S4: the statistics module 104 counts the quantity of each type of material.

[0097] In this embodiment, the classified materials are counted again to obtain the quantity of each type of material.

[0098] In one embodiment, the material counting method further includes: a step of calculating the qualified rate of the material. Specifically, the step of calculating the qualified rate of the material includes: comparing the cut 3D scanned image with the standard material image to confirm whether the material meets the requirements; counting the number of materials that meet the requirements; and calculating the qualified rate of the material based on the number of materials that meet the requirements and the total number of materials.

[0099] In this embodiment, confirming whether the material meets the requirements includes:

[0100] Calculate the similarity between the cut three-dimensional scanned image and the pre-stored standard material image; compare the similarity with the preset similarity; when the similarity is greater than or equal to the preset similarity, confirm that the material meets the requirements; when the similarity is less than the preset similarity, confirm that the material does not meet the requirements.

[0101] The material counting method provided by the present application does not require disassembly of packaging, does not destroy the incoming material state, and does not require the entire tray of material to be opened and rolled onto another scroll bar of the counter and then retracted after counting, which can save labor time. In addition, the material counting method can also obtain the size information of the material.

[0102] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0103] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0104] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0105] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A material counting method, characterized in that: The method includes: Receiving a three-dimensional scanned image of a material, wherein the three-dimensional scanned image is obtained by scanning with an X-ray machine; Preprocessing the three-dimensional scanned image; According to the three-dimensional scanned image, the type of the material is identified using a pre-trained material classification model, including: identifying multiple materials in the three-dimensional scanned image and measuring the actual sizes of the multiple materials; cutting the three-dimensional scanned image according to the multiple materials; inputting the cut image into the pre-trained material classification model and outputting the type of the material, wherein measuring the actual sizes of the multiple materials includes: obtaining the distance between the focus of the X-ray machine and the material in the image; obtaining the pixel size of each material; obtaining the minimum pixel size of a reference image and the actual size of the reference image; calculating the actual size of the material according to the distance between the focus and the material in the image, the pixel size of the material and the actual size of the reference image; and Count the number of each type of material to get the total number of each type of material.

2. The material counting method according to claim 1, characterized in that: The preprocessing of the three-dimensional scanned image comprises: Gray-scaling the three-dimensional scanned image; Performing geometric transformation on the grayscaled three-dimensional scanned image; Perform image enhancement on the three-dimensional scanned image.

3. The material counting method according to claim 1, characterized in that: The method further comprises: calculating the qualified rate of the material.

4. The material counting method according to claim 3, characterized in that: The calculating the qualified rate of the material comprises: Compare the cut 3D scanned image with the pre-stored standard material image to confirm whether the material meets the requirements; Count the number of materials that meet the requirements; The qualified rate of the material is calculated according to the material quantity and the total number of the materials.

5. The material counting method according to claim 4, characterized in that: The confirmation of whether the material meets the requirements includes: Calculating the similarity between the cut three-dimensional scanned image and a pre-stored standard material image; comparing the similarity with a preset similarity; When the similarity is greater than or equal to the preset similarity, confirming that the material meets the requirements; or When the similarity is less than the preset similarity, it is confirmed that the material does not meet the requirements.

6. A material counting system, characterized in that: The system includes: A receiving module, used for receiving a three-dimensional scanning image of a material, wherein the three-dimensional scanning image is obtained by scanning with an X-ray machine; A preprocessing module, used for preprocessing the three-dimensional scanned image; an identification module, for identifying the type of the material according to the three-dimensional scanned image using a pre-trained material classification model, comprising: identifying multiple materials in the three-dimensional scanned image, and measuring the actual sizes of the multiple materials; cutting the three-dimensional scanned image according to the multiple materials; inputting the cut image into the pre-trained material classification model, and outputting the type of the material, wherein measuring the actual sizes of the multiple materials comprises: obtaining the distance between the focus of the X-ray machine and the material in the image; obtaining the pixel size of each material; obtaining the minimum pixel size of the reference image and the actual size of the reference image; calculating the actual size of the material according to the distance between the focus and the material in the image, the pixel size of the material, and the actual size of the reference image; and The statistics module is used to count the quantity of each type of material and obtain the total number of each type of material.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the material counting method according to any one of claims 1 to 5 is implemented.

8. A computer device, characterized in that: The computer device includes a memory and at least one processor, wherein a plurality of modules are stored in the memory, and when the plurality of modules are executed by the at least one processor, the material counting method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Cigarette filter online counting and quality detecting method based on machine vision

    CN104537671A

  • Industrial automatic three-dimensional detection system and method

    CN107860338A

  • Production line capacity monitoring method, device and system

    CN110647851A