A material detection method and device, and an electronic device
By adjusting the acquisition parameters and repeatedly acquiring material images, the problem of high false judgment rate in machine vision inspection was solved, and efficient material inspection in different environments was achieved.
Patent Information
- Application Number
- CN202211201701.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-09-29
AI Technical Summary
When machine vision inspects materials, the differences in environment and materials lead to large errors in feature information extraction, high misjudgment rate, and low product first pass rate.
By controlling the acquisition device to adjust the acquisition parameters, the material images are repeatedly acquired and feature information is extracted until the matching result determination conditions are met, and the material detection result is determined.
It reduced the false positive rate, increased the first-pass yield of products, adapted to different collection environments, and improved the reliability of detection.
Smart Images

Figure CN115496994B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of material testing, and in particular to a material testing method, apparatus, and electronic device. Background Technology
[0002] In the manufacturing industry, machine vision is generally used to inspect the appearance and placement of materials to determine whether a product is qualified. However, machine vision inspection is affected by environmental and material differences, and may not be able to extract the feature information on the material normally, or the extracted feature information may have a certain error with the actual feature information. When compared with standard feature information, misjudgment will occur, resulting in a decrease in the first pass rate of the product.
[0003] Therefore, how to provide a solution to the above-mentioned technical problems is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this application is to provide a material detection method, apparatus, and electronic equipment that can adapt to the current data collection environment, reduce misjudgments, and improve product first-pass yield.
[0005] To address the aforementioned technical problems, this application provides a material testing method, comprising:
[0006] The control acquisition device acquires images of the material according to the initial acquisition parameters;
[0007] Extract feature information from the image, determine the matching result between the feature information and the target template. If the matching result fails, control the acquisition device to acquire the image of the material according to the new acquisition parameters, and repeat this step until the result determination condition is met.
[0008] The detection result of the material is determined based on the matching result when the result determination condition is met.
[0009] Optionally, the material detection method further includes:
[0010] Multiple alternative acquisition parameters are predetermined;
[0011] The process of controlling the acquisition device to acquire images of the material according to the new acquisition parameters includes:
[0012] One of the candidate acquisition parameters is selected as the new acquisition parameter from a plurality of candidate acquisition parameters, and the acquisition device is controlled to acquire images of the material according to the new acquisition parameter.
[0013] Optionally, the process of determining one of the candidate acquisition parameters as the new acquisition parameter from the plurality of candidate acquisition parameters includes:
[0014] Determine the current environment information for data collection;
[0015] One of the candidate acquisition parameters, which corresponds to the current acquisition environment information, is selected from the plurality of candidate acquisition parameters as the new acquisition parameter.
[0016] Optionally, after pre-determining multiple alternative acquisition parameters, the material detection method further includes:
[0017] Determine the configuration priority of each of the aforementioned alternative acquisition parameters;
[0018] The process of determining one of the candidate acquisition parameters as the new acquisition parameter from a plurality of candidate acquisition parameters includes:
[0019] According to the configuration priority from high to low, one of the candidate acquisition parameters is determined as the new acquisition parameter from a plurality of candidate acquisition parameters.
[0020] Optionally, the process of determining the configuration priority of each of the candidate acquisition parameters includes:
[0021] Determine the current environment information for data collection;
[0022] The configuration priority of each of the candidate acquisition parameters is determined based on the current acquisition environment information.
[0023] Optionally, the process of extracting feature information from the image includes:
[0024] Geometric positioning is performed on the image to determine the target region;
[0025] Feature information is extracted from the target region using OCR.
[0026] Optionally, the acquisition device is a camera;
[0027] The collected parameters include exposure time;
[0028] Alternatively, the acquisition parameters may include exposure time and gamma value.
[0029] Optionally, after determining the detection result of the material based on the matching result when the result determination condition is met, the material detection method further includes:
[0030] The product yield is calculated based on the test results of all the materials, and information corresponding to the product yield is displayed.
[0031] To address the aforementioned technical problems, this application also provides a material detection device, comprising:
[0032] The control module is used to control the acquisition device to acquire images of materials according to the initial acquisition parameters;
[0033] The detection module is used to extract feature information from the image, determine the matching result between the feature information and the target template, and if the matching result fails, trigger the control module until the result determination condition is met, triggering the first determination module.
[0034] The control module is also used to control the acquisition device to acquire images of the material according to the new acquisition parameters and trigger the detection module;
[0035] The first determining module is used to determine the detection result of the material based on the matching result when the result determining condition is met.
[0036] To address the aforementioned technical problems, this application also provides an electronic device, comprising:
[0037] Memory, used to store computer programs;
[0038] A processor for executing the computer program to implement the steps of the material detection method as described in any of the above.
[0039] This application provides a material detection method. First, a data acquisition device is controlled to acquire images of the material according to initial acquisition parameters. If the feature information in the acquired material image fails to match the target template, the acquisition parameters of the acquisition device are adjusted, and the material image is re-acquired. Then, the feature information in the new image is extracted and matched with the target template. If the result determination conditions are met, the detection result is determined based on the matching result. This method can adapt to the current acquisition environment, reduce false judgments, and improve the first-pass yield. This application also provides a material detection device and electronic equipment, which have the same beneficial effects as the above-described material detection method. Attached Figure Description
[0040] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart of the steps of a material testing method provided in this application;
[0042] Figure 2 This application provides a schematic diagram of the structure of an image acquisition system.
[0043] Figure 3 A schematic diagram illustrating the actual extraction of feature information and template matching provided in this application;
[0044] Figure 4This is a schematic diagram of the structure of a material detection device provided in this application. Detailed Implementation
[0045] The core of this application is to provide a material detection method, device, and electronic equipment that can adapt to the current data collection environment, reduce misjudgments, and improve product first-pass yield.
[0046] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] Firstly, please refer to Figure 1 , Figure 1 This application provides a flowchart of a material testing method, which includes:
[0048] S101: Control the acquisition device to acquire images of the material according to the initial acquisition parameters;
[0049] The initial acquisition parameters are compatible with most materials. The acquisition device can be a device equipped with a camera, such as a webcam. Accordingly, the acquisition parameters include, but are not limited to, exposure time and gamma value. The gamma value is used to adjust the image contrast. Please refer to [link / reference]. Figure 2 , Figure 2 The schematic diagram of an image acquisition system provided in this application includes a camera 11, a lens 12, a light source 13, and a placement stage 14. After detecting that the material is placed on the placement stage 14, the acquisition position of the acquisition device (camera 11, lens 12) is determined. After being illuminated by a specific light source 13, the acquisition device is controlled to acquire an image of the material according to the initial acquisition parameters.
[0050] S102: Extract feature information from the image, determine the matching result between the feature information and the target template. If the matching result fails, control the acquisition device to acquire the image of the material according to the new acquisition parameters, and repeat this step until the result determination condition is met.
[0051] S103: Determine the test result of the material based on the matching result when the result determination condition is met.
[0052] Understandably, before executing S102, there is a step to pre-acquire the standard feature information of the material to be tested, and set the standard feature information as a template for subsequent comparison. Understandably, in practical applications, the material may need to enter different testing processes; therefore, the standard feature information required for each testing process can be pre-determined, and corresponding templates can be created. The target template in this step is the template corresponding to the current testing process. Feature information is extracted from the image of the material acquired by the acquisition device, and the extracted feature information is matched with the target template, referring to… Figure 3 As shown, Figure 3 The diagram illustrates the matching of the actual extracted feature information (solid line portion) with the template (dashed line portion).
[0053] As an optional embodiment, the process of extracting feature information from an image includes: geometrically locating the target region in the image, and extracting feature information from the target region using OCR and / or Blob. The feature information includes, but is not limited to, material graphic feature information or material character feature information. It is understood that OCR can be used to extract material character feature information, and Blob can be used to extract material graphic feature information.
[0054] If the extracted feature information matches the target template successfully, the material is deemed qualified. If the matching fails, considering the potential influence of environmental or material differences that could cause the extracted feature information to deviate from the actual situation, the material is not directly deemed unqualified. Instead, the acquisition parameters are reselected, and the acquisition device is controlled to acquire images of the material according to the new parameters. Feature information is extracted from the newly acquired images and matched with the target template. If the match is successful, the material is deemed qualified. If the match fails, the acquisition parameters are selected again, and the image acquisition, feature information extraction, and template matching operations are repeated. Considering the possibility of unqualified materials, the repetition in this embodiment is limited. A preset number of repetitions is set. If the preset number of repetitions is reached, but the extracted feature information still fails to match the target template, the acquisition parameter selection is stopped, and the material is directly deemed unqualified, thereby reducing false judgments and improving the reliability of material detection.
[0055] It is understood that the result determination conditions in this embodiment include: successful matching before reaching a preset number of repeated matching attempts and reaching the preset number of repeated matching attempts. For example, assuming the number of repeated matching attempts is 3, firstly, the acquisition device is controlled to acquire image a of the material according to acquisition parameter a, extract feature information a from image a, and match feature information a with the target template. If the match is successful, the result determination condition is determined to be met, and the subsequent counting steps are executed. If the match is unsuccessful, the acquisition device is controlled to acquire image b of the material according to acquisition parameter b, extract feature information b from image b, and match feature information b with the target template. If the match is successful, the result determination condition is determined to be met, and the subsequent counting steps are executed. If the match is unsuccessful, the acquisition device is controlled to acquire image c of the material according to acquisition parameter c, extract feature information c from image c, and match feature information c with the target template. If the match is successful, the result determination condition is determined to be met, and the subsequent counting steps are executed. If the match is unsuccessful, since this is the third match, the preset number of repeated matching attempts has been reached, the result determination condition is determined to be met, and the subsequent counting steps are executed.
[0056] Since the matching result at the time of the third matching may be a successful match or a failed match, this application determines the test result of the material based on the matching result at the time of the matching result determination condition. If the matching result at the time of the matching result determination condition is a successful match, the test result of the material is determined to be qualified. If the matching result at the time of the matching result determination condition is a failed match, the test result of the material is determined to be unqualified.
[0057] After the batch of tests is completed, all material characteristic information and test results will be sent to the PLC via Socket communication for further processing.
[0058] As can be seen, in this embodiment, the acquisition device is first controlled to acquire images of the material according to the initial acquisition parameters. If the feature information in the acquired material image fails to match the target template, the acquisition parameters of the acquisition device are adjusted, the material image is re-acquired, and then the feature information in the new image is extracted and matched with the target template. When the result determination conditions are met, the detection result is determined according to the matching result. This can adapt to the current acquisition environment, reduce misjudgment, and improve the product first pass rate.
[0059] Based on the above embodiments:
[0060] As an optional embodiment, the material detection method further includes:
[0061] Multiple alternative acquisition parameters are predetermined;
[0062] The process of controlling the acquisition device to acquire images of materials according to the new acquisition parameters includes:
[0063] Select one alternative acquisition parameter from multiple alternative acquisition parameters as the new acquisition parameter, and control the acquisition device to acquire images of the material according to the new acquisition parameter.
[0064] In this embodiment, multiple alternative acquisition parameters are predetermined and can be stored in a parameter configuration library for later use. The initial acquisition parameter can be any one of the alternative acquisition parameters or an acquisition parameter other than the multiple alternative acquisition parameters. It can be set according to the actual engineering needs, and this application does not make specific limitations here.
[0065] If the feature information in the image acquired according to the initial acquisition parameters fails to match the target template, then select one acquisition parameter from the remaining alternative acquisition parameters as the new acquisition parameter. If the feature information in the image acquired based on the new acquisition parameters still fails to match the target template, then select another alternative acquisition parameter from the remaining alternative acquisition parameters as the new acquisition parameter.
[0066] It is understandable that the number of repeated matching times mentioned above can also be determined based on the number of pre-determined alternative acquisition parameters. For example, if there are 5 alternative acquisition parameters stored in advance, the number of repeated matching times can also be set to 5. If the acquisition parameters are changed 5 times to acquire the image of a certain material, and the feature information in the obtained image fails to match the target template, then the material is determined to be unqualified.
[0067] As an optional embodiment, the process of determining a candidate acquisition parameter as the new acquisition parameter from a plurality of candidate acquisition parameters includes:
[0068] Determine the current environment information for data collection;
[0069] Choose one candidate acquisition parameter from multiple candidate acquisition parameters that corresponds to the current acquisition environment information as the new acquisition parameter.
[0070] Specifically, when determining new acquisition parameters, a candidate acquisition parameter can be randomly selected from multiple alternative parameters, or a selection strategy can be pre-defined to determine a candidate acquisition parameter from multiple alternative parameters. This embodiment provides a scheme for determining new acquisition parameters based on current acquisition environment information. Current acquisition environment information includes, but is not limited to, the light intensity at the acquisition site. The correspondence between environmental information and candidate acquisition parameters can be pre-determined. During subsequent selection, the corresponding candidate acquisition parameter can be determined based on the current acquisition environment information and the correspondence, selecting an acquisition parameter suitable for the current environment, which can improve matching efficiency.
[0071] Taking light intensity as an example for collecting environmental information, multiple light intensity ranges can be preset. Each range can correspond to one or more alternative collection parameters. The current light intensity is determined, the range in which the current light intensity is located is determined, and a new collection parameter is selected from one or more alternative collection parameters corresponding to that light intensity range.
[0072] Assuming a light intensity range corresponds to a candidate acquisition parameter, if the feature information in the image acquired by the acquisition device according to the acquisition parameter a1 corresponding to the current light intensity I1 fails to match the target template, the light intensity I2 is acquired again. If the acquired light intensity I2 is in a different light intensity range than the previously acquired light intensity I1, then the new acquisition parameter a2 is determined according to the light intensity range of the new light intensity I2. If the acquired light intensity I2 is in the same light intensity range as the previously acquired light intensity I1, and the image is still acquired according to the acquisition parameter a1, the extracted feature information may still not match the target template. In this case, the relationship between the light intensity I2 and the initial light intensity (the light intensity corresponding to the initial acquisition parameter) I0 can be determined first, and the acquisition parameter corresponding to the corresponding light intensity range can be selected as the new acquisition parameter based on the relationship.
[0073] For example, suppose we pre-set five light intensity intervals, which are Q1, Q2, Q3, Q4, and Q5 in descending order of intensity. This means that all light intensities in Q1 are greater than all light intensities in Q2, and so on. The acquisition parameters corresponding to Q1, Q2, Q3, Q4, and Q5 are a1, a2, a3, a4, and a5, respectively. Assuming the feature information in the material image P0 acquired according to the initial acquisition parameter a0 fails to match the target template, the current illumination intensity I1 is obtained. If the current illumination intensity I1 is in Q3, the acquisition device is controlled to acquire the material image P1 according to the acquisition parameter a3. If the feature information extracted from image P1 fails to match the target template, the current illumination intensity I2 is reacquired. If the reacquired illumination intensity I2 is in a different range from the illumination intensity I1, the acquisition parameter corresponding to the range where illumination intensity I2 is located is determined as the new acquisition parameter. If both the reacquired illumination intensity I2 and illumination intensity I1 are in Q3, the relationship between I2 and I0 is determined. If I2 < I0, the acquisition parameter a4 corresponding to Q4 can be determined as the new acquisition parameter, and the acquisition device is controlled to perform a new round of acquisition and matching according to the acquisition parameter a4. If I2 > I0, the acquisition parameter a2 corresponding to Q2 can be determined as the new acquisition parameter, and the acquisition device is controlled to perform a new round of acquisition and matching according to the acquisition parameter a2, thereby improving the matching efficiency.
[0074] Assuming a light intensity range corresponds to multiple candidate acquisition parameters, priorities can be set for these multiple candidate acquisition parameters in each light intensity range. After determining the light intensity range in which the current light intensity is located, new acquisition parameters are selected from the multiple candidate acquisition parameters corresponding to that light intensity range in descending order of priority, thereby improving matching efficiency.
[0075] For example, the alternative acquisition parameters corresponding to the light intensity range Q3 include a31, a32, and a33. The three alternative acquisition parameters are set in descending order as a31, a32, and a33. If the current light intensity I1 is in the light intensity range Q3, the acquisition device is controlled to first acquire the image of the material according to acquisition parameter a31. If the feature information extracted from the image fails to match the target template, the acquisition device is controlled to acquire the image of the material according to acquisition parameter a32. If the feature information extracted from the image fails to match the target template, the acquisition device is then controlled to acquire the image of the material according to acquisition parameter a33.
[0076] As an optional embodiment, after pre-determining multiple alternative acquisition parameters, the material detection method further includes:
[0077] Determine the configuration priority of each alternative data acquisition parameter;
[0078] The process of selecting one candidate acquisition parameter from multiple alternative acquisition parameters as the new acquisition parameter includes:
[0079] Select one candidate acquisition parameter from multiple alternative acquisition parameters according to the configuration priority from high to low as the new acquisition parameter.
[0080] When determining new acquisition parameters, one can randomly select a candidate acquisition parameter from multiple alternative acquisition parameters as the new acquisition parameter, or a corresponding selection strategy can be pre-defined, and a candidate acquisition parameter can be determined from multiple alternative acquisition parameters as the new acquisition parameter based on the selection strategy. This embodiment provides a scheme for determining new acquisition parameters based on configuration priority.
[0081] Taking the exposure time as an example, the solution of this embodiment will be explained. It is assumed that there are 5 exposure times stored in advance in this application, namely T1, T2, T3, T4 and T5, and that T1 > T2 > T3 > T4 > T5. Let T3 be the initial exposure time, and the priority category can be set as large exposure priority or small exposure priority.
[0082] If small exposure priority is selected, the priority can be configured in descending order as T4, T5, T2, T1. First, the acquisition device is controlled to acquire the image of the material according to T3. If the feature information extracted from the image fails to match the target template, the acquisition device is controlled to acquire the image of the material according to T4. If the feature information extracted from the image still fails to match the target template, the acquisition device is controlled to acquire the image of the material according to T5. If the feature information extracted from the image still fails to match the target template, the acquisition device is controlled to acquire the image of the material according to T2, and so on.
[0083] If the large exposure priority is selected, the priority can be configured in descending order as T2, T1, T4, T5. First, the acquisition device is controlled to acquire the image of the material according to T3. If the feature information extracted from the image fails to match the target template, the acquisition device is controlled to acquire the image of the material according to T2. If the feature information extracted from the image still fails to match the target template, the acquisition device is controlled to acquire the image of the material according to T1. If the feature information extracted from the image still fails to match the target template, the acquisition device is controlled to acquire the image of the material according to T4, and so on.
[0084] Of course, there are cases where the initial exposure time is not within the alternative exposure time. In such cases, the priority of each alternative exposure time corresponding to the large exposure priority or the priority of each alternative exposure time corresponding to the small exposure priority can be determined based on the relationship between the initial exposure time and the alternative exposure time.
[0085] As an optional implementation, the process of determining the configuration priority of each alternative acquisition parameter includes:
[0086] Determine the current environment information for data collection;
[0087] The configuration priority of each alternative acquisition parameter is determined based on the current acquisition environment information.
[0088] To better adapt to different environments and reduce misjudgments, when determining the priority of each alternative acquisition parameter, the configuration priority of each alternative acquisition parameter can be determined based on the current acquisition environment information. For example, if the current acquisition environment has strong light, a small exposure priority configuration scheme can be selected, and if the current acquisition environment has weak light, a large exposure priority configuration scheme can be selected.
[0089] As an optional embodiment, after determining the material detection result based on the matching result when the result determination conditions are met, the material detection method further includes:
[0090] The product yield is calculated based on the test results of all materials, and information corresponding to the product yield is displayed.
[0091] Specifically, once the test result for a certain material is determined, a counting operation is performed based on the test result. If the test result is qualified, the count of qualified products is incremented by 1; if the test result is unqualified, the count of unqualified products is incremented by 1. After the testing of this batch of materials is completed, the product yield is calculated based on the total number of tested products and the number of qualified products, and information corresponding to the product yield is displayed. The information includes the product yield value and may also include the reasons for defects obtained from the analysis, so that the testers can view it.
[0092] In summary, by adopting the solution of this application, when the materials or environment change, reasonable acquisition parameters can be adaptively selected, which can better adapt to different environments, reduce misjudgments, and improve the equipment first-pass yield. At the same time, production data statistics can analyze the equipment status and output value in real time, making the equipment status clear at a glance.
[0093] Secondly, please refer to Figure 4 , Figure 4 This is a schematic diagram of a material detection device provided in this application. The material detection device includes:
[0094] Control module 21 is used to control the acquisition device to acquire images of materials according to the initial acquisition parameters;
[0095] The detection module 22 is used to extract feature information from the image and determine the matching result between the feature information and the target template. If the matching result fails, the control module 21 is triggered until the result determination condition is met, and the first determination module 23 is triggered.
[0096] The control module 21 is also used to control the acquisition device to acquire images of materials according to the new acquisition parameters and trigger the detection module 22;
[0097] The first determining module 23 is used to determine the detection result of the material based on the matching result when the result determination condition is met.
[0098] As can be seen, in this embodiment, the acquisition device is first controlled to acquire images of the material according to the initial acquisition parameters. If the feature information in the acquired material image fails to match the target template, the acquisition parameters of the acquisition device are adjusted, the material image is re-acquired, and then the feature information in the new image is extracted and matched with the target template. When the result determination conditions are met, the detection result is determined according to the matching result. This can adapt to the current acquisition environment, reduce misjudgment, and improve the product first pass rate.
[0099] As an optional embodiment, the material detection device further includes:
[0100] The second determining module is used to predetermine multiple alternative acquisition parameters;
[0101] The process of controlling the acquisition device to acquire images of materials according to the new acquisition parameters includes:
[0102] Select one alternative acquisition parameter from multiple alternative acquisition parameters as the new acquisition parameter, and control the acquisition device to acquire images of the material according to the new acquisition parameter.
[0103] As an optional embodiment, the process of determining a candidate acquisition parameter as the new acquisition parameter from a plurality of candidate acquisition parameters includes:
[0104] Determine the current environment information for data collection;
[0105] Choose one candidate acquisition parameter from multiple candidate acquisition parameters that corresponds to the current acquisition environment information as the new acquisition parameter.
[0106] As an optional embodiment, after pre-determining multiple alternative acquisition parameters, the material detection device further includes:
[0107] The third determining module is used to determine the configuration priority of each candidate acquisition parameter;
[0108] The process of selecting one candidate acquisition parameter from multiple alternative acquisition parameters as the new acquisition parameter includes:
[0109] Select one candidate acquisition parameter from multiple alternative acquisition parameters according to the configuration priority from high to low as the new acquisition parameter.
[0110] As an optional implementation, the process of determining the configuration priority of each alternative acquisition parameter includes:
[0111] Determine the current environment information for data collection;
[0112] The configuration priority of each alternative acquisition parameter is determined based on the current acquisition environment information.
[0113] As an optional embodiment, the process of extracting feature information from an image includes:
[0114] Geometric localization of the image determines the target region;
[0115] OCR is used to extract feature information from the target region.
[0116] As an optional embodiment, the data acquisition device is a camera;
[0117] The parameters collected include exposure time;
[0118] Alternatively, the collected parameters may include exposure time and gamma value.
[0119] As an optional embodiment, after determining the detection result of the material based on the matching result when the result determination condition is met, the material detection device further includes:
[0120] The statistics module is used to calculate the product yield based on the test results of all materials and to display information corresponding to the product yield.
[0121] Thirdly, this application also provides an electronic device, including:
[0122] Memory, used to store computer programs;
[0123] A processor for executing a computer program to implement the steps of the material detection method as described in any of the embodiments above.
[0124] Specifically, electronic devices can be applied to material sorting robots.
[0125] For a description of the electronic device provided in this application, please refer to the above embodiments; further details will not be repeated here.
[0126] The electronic device provided in this application has the same beneficial effects as the material detection method described above.
[0127] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 a process, method, article, or apparatus. Without further limitations, 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 said element.
[0128] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A material detection method, characterized in that, include: The control acquisition device acquires images of the material according to the initial acquisition parameters; Feature information is extracted from the image, and the matching result between the feature information and the target template is determined. If the matching result fails, the acquisition device is controlled to acquire the image of the material according to the new acquisition parameters. This step is repeated until the result determination condition is met. The result determination condition includes successful matching before reaching a preset number of repeated matching attempts or reaching a preset number of repeated matching attempts. The detection result of the material is determined based on the matching result when the result determination condition is met; The material detection method further includes: Multiple alternative acquisition parameters are predetermined, and multiple light intensity ranges are preset, with each light intensity range corresponding to one or more alternative acquisition parameters; The process of controlling the acquisition device to acquire images of the material according to the new acquisition parameters includes: Determine the current environmental information being collected; the current environmental information includes light intensity; When the feature information in the image acquired by the acquisition device according to the acquisition parameters corresponding to the current light intensity fails to match the target template, the light intensity is reacquired. If the light intensity acquired again is in a different light intensity range than the light intensity acquired previously, the new acquisition parameters shall be determined according to the light intensity range of the newly acquired light intensity. If the newly acquired light intensity falls within the same light intensity range as the previously acquired light intensity, the acquisition parameters corresponding to the light intensity range are selected as the new acquisition parameters based on the relationship between the newly acquired light intensity and the light intensity corresponding to the initial acquisition parameters.
2. The material detection method according to claim 1, characterized in that, After pre-determining multiple alternative acquisition parameters, the material detection method further includes: Determine the configuration priority of each of the aforementioned alternative acquisition parameters; The process of determining one of the candidate acquisition parameters as the new acquisition parameter from a plurality of candidate acquisition parameters includes: According to the configuration priority from high to low, one of the candidate acquisition parameters is determined as the new acquisition parameter from a plurality of candidate acquisition parameters.
3. The material detection method according to claim 2, characterized in that, The process of determining the configuration priority of each of the candidate acquisition parameters includes: Determine the current environment information for data collection; The configuration priority of each of the candidate acquisition parameters is determined based on the current acquisition environment information.
4. The material detection method according to claim 1, characterized in that, The process of extracting feature information from the image includes: Geometric positioning is performed on the image to determine the target region; Feature information is extracted from the target region using OCR.
5. The material detection method according to claim 1, characterized in that, The data acquisition device is a camera; The collected parameters include exposure time; Alternatively, the acquisition parameters may include exposure time and gamma value.
6. The material detection method according to any one of claims 1-5, characterized in that, After determining the detection result of the material based on the matching result when the result determination condition is met, the material detection method further includes: The product yield is calculated based on the test results of all the materials, and information corresponding to the product yield is displayed.
7. A material detection device, characterized in that, include: The control module is used to control the acquisition device to acquire images of materials according to the initial acquisition parameters; The detection module is used to extract feature information from the image, determine the matching result between the feature information and the target template, and if the matching result is unsuccessful, trigger the control module until the result determination condition is met, triggering the first determination module; the result determination condition includes successful matching before reaching a preset number of repeated matching attempts or reaching a preset number of repeated matching attempts. The control module is also used to control the acquisition device to acquire images of the material according to the new acquisition parameters and trigger the detection module; The first determining module is used to determine the detection result of the material based on the matching result when the result determining condition is met; The material detection device is also used for: Multiple alternative acquisition parameters are predetermined, and multiple light intensity ranges are preset, with each light intensity range corresponding to one or more alternative acquisition parameters; The process of controlling the acquisition device to acquire images of the material according to the new acquisition parameters includes: Determine the current environmental information being collected; the current environmental information includes light intensity; When the feature information in the image acquired by the acquisition device according to the acquisition parameters corresponding to the current light intensity fails to match the target template, the light intensity is reacquired. If the light intensity acquired again is in a different light intensity range than the light intensity acquired previously, the new acquisition parameters shall be determined according to the light intensity range of the newly acquired light intensity. If the newly acquired light intensity falls within the same light intensity range as the previously acquired light intensity, the acquisition parameters corresponding to the light intensity range are selected as the new acquisition parameters based on the relationship between the newly acquired light intensity and the light intensity corresponding to the initial acquisition parameters.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the material detection method as described in any one of claims 1-6 when executing the computer program.
Citation Information
Patent Citations
Environment detection method and device, electronic equipment and computer readable storage medium
CN111209980A
Fingerprint identification method and device, electronic equipment and storage medium
CN111400686A
Material detection method and system, computer program product and readable storage medium
CN113096111A
Workpiece detection method, system and equipment and storage medium
CN113777109A