Methods, apparatus, and computer readable storage media for optical detection

By receiving and processing the characteristic parameters of multi-spot signals, the problem of low robustness in traditional photoelectric detection systems is solved, achieving higher detection accuracy and sensitivity, adapting to various detection scenarios, and reducing system power consumption and equipment upgrade costs.

CN117031479BActive Publication Date: 2026-06-05SHENZHEN SHENPU ELECTRIC CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN SHENPU ELECTRIC CO LTD
Filing Date
2023-05-12
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Traditional photoelectric detection systems have low robustness and are greatly affected by differences in the parts of the object being tested and environmental factors.

Method used

An optical detection method is used to receive at least two light spot signals. Characteristic parameters are obtained through differential or matching processing. By comparing the features between the light spot signals or with standard detection points, and combining color and brightness parameters, the accuracy and sensitivity of the detection are improved.

Benefits of technology

By comparing and processing the features of multi-spot signals, the influence of environmental factors can be eliminated, the accuracy and sensitivity of detection can be improved, different detection scenarios can be adapted, and system power consumption and equipment upgrade costs can be reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117031479B_ABST
    Figure CN117031479B_ABST
Patent Text Reader

Abstract

The application provides a method, device and computer readable storage medium for optical detection, which can improve the accuracy of detecting a to-be-detected object according to photoelectric information. The method is applied to an optical detection system and comprises the following steps: receiving at least two light spot signals; wherein the at least two light spot signals are signals generated by reflection of at least two original light signals emitted by the optical detection system on a to-be-detected object; performing feature comparison processing on the at least two light spot signals to obtain a processing result; and outputting photoelectric information according to the processing result and a threshold value.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202310533228.6 and the original application date is May 12, 2023. The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to the field of electronic technology, and more specifically to an optical detection method, apparatus, and computer-readable storage medium. Background Technology

[0003] Traditional photoelectric detection systems include a transmitter and a receiver. When the light signal emitted by the transmitter shines on the object under test, it will produce a reflected light spot. The receiver acquires the reflected light spot and analyzes the information carried by the reflected light spot. Based on the information carried by the reflected light spot, the characteristics of the object under test are determined.

[0004] However, due to differences in the parts of the object being tested and environmental factors, the detection results of traditional photoelectric detection systems have low robustness. Summary of the Invention

[0005] This application provides a method, apparatus, and computer-readable storage medium for optical detection, which can improve the accuracy of detecting objects under test.

[0006] In a first aspect, an optical detection method is provided, the method comprising: receiving at least two light spot signals; wherein the at least two light spot signals are signals generated by reflection of at least two original light signals emitted by the optical detection system on an object to be tested; performing feature comparison processing on the at least two light spot signals to obtain a processing result; and outputting photoelectric information based on the processing result and a threshold.

[0007] The above method is applied to an optical detection system. By analyzing at least two light spot signals reflected by the object under test, more information can be obtained. If one of the light spot signals has a large error due to environmental interference or other factors, the optical detection system can correct the error through other light spot signals, thereby improving the accuracy of detecting the object under test.

[0008] Optionally, the feature comparison processing of the at least two spot signals includes: performing differential processing or matching processing on the at least two spot signals; wherein, in the case of differential processing, the threshold is a feature parameter between the at least two spot signals; and in the case of matching processing, the threshold is a feature parameter between the at least two spot signals and a standard detection point.

[0009] In this embodiment, the optical detection system can perform differential or matching processing on the information acquired from the spot signals according to different detection requirements, flexibly adapting to different scenarios. Differential processing involves feature comparison between spot signals. When the object under test is affected by the environment, the spot signals are also uniformly affected, but the relative values ​​between the spot signals do not change. Therefore, differential processing can eliminate the influence of environmental factors on the detection results. Matching processing involves feature comparison between the spot signals and standard detection points. Since there are many spot signals, errors in individual spot signals do not affect the final detection result, and users can easily adjust the parameters of the standard detection points and thresholds according to actual needs.

[0010] Optionally, the differential processing of the at least two light spot signals to obtain a processing result includes: acquiring the color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals based on the proportion of each color intensity signal; and the processing result being the first similarity.

[0011] In this embodiment, the first similarity between light spot signals can be determined through color parameters. For example, the first similarity between light spot signals can be obtained based on the proportion of red, green, and blue channels in each light spot signal. This parameter is easy to obtain, the processing is simple, and the judgment speed is fast. It supports the detection of the target object under special circumstances, such as when the target object itself has a color difference. During the threshold setting process, the color difference is considered as the detection threshold for judging the target object, and only this one threshold needs to be considered. Since the two light spot signals are uniformly affected by the environment, the relative value between the two light spot signals after subtraction can exclude environmental factors, resulting in high robustness in environments with strong interference.

[0012] Optionally, the differential processing of the at least two light spot signals to obtain a processing result includes: acquiring color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals based on the proportion of each color intensity signal; calculating brightness parameters of the at least two light spot signals respectively based on the magnitude of each color intensity signal and the mapping relationship between the first similarity and brightness; acquiring a second similarity between the at least two light spot signals based on the magnitude of each color intensity signal and the brightness parameter; and the processing result is the second similarity.

[0013] In this embodiment, a brightness parameter is added for feature comparison, and the color and brightness of the spot signal are combined for comprehensive judgment, which makes it easier to show differences and improves the sensitivity of detection.

[0014] Optionally, the matching process for the at least two light spot signals to obtain a processing result includes: acquiring the color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring the first similarity between the at least two light spot signals and the standard detection point based on the proportion of each color intensity signal; and the processing result is the first similarity.

[0015] In this embodiment, the first similarity between the light spot signal and the standard detection point can be confirmed through color parameters. For example, the first similarity between each light spot signal and the standard detection point can be obtained based on the proportion of the red, green, and blue channels in the light spot signal. This parameter is easy to obtain, the processing is simple, and the judgment speed is fast.

[0016] This embodiment does not restrict the setting of standard detection points, supporting various personalized detection scenarios. For example, if the overall features of the target object are consistent, any point on the target object can be set as a standard detection point as needed, and the first similarity calculation can be performed between the received multiple light spot signals and this single standard detection point. More parameters are used for judgment, avoiding misjudgments in cases where color parameters are similar. Simultaneously, if the target object itself has regional differences, or if the environment has an uneven influence on the target object, multiple standard detection points can be set specifically, calculating the similarity between each light spot signal and each standard detection point, or between each light spot signal and its corresponding (e.g., positional correspondence) standard detection point. The position, number, and threshold used for judgment of the standard detection points can all be customized by the user. It offers high accuracy in detecting the object and is applicable to a wide range of scenarios.

[0017] Optionally, the matching process for the at least two light spot signals to obtain a processing result includes: acquiring the color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals and the standard detection point based on the proportion of each color intensity signal; calculating the brightness parameters of the at least two light spot signals based on the magnitude of each color intensity signal and the mapping relationship between the first similarity and brightness; acquiring a second similarity between the at least two light spot signals and the standard detection point based on the magnitude of each color intensity signal and the brightness parameter; and the processing result is the second similarity.

[0018] In this embodiment, a brightness parameter is added for feature comparison, and the color and brightness of the spot signal are combined for comprehensive judgment, which makes it easier to show differences and improves the sensitivity of detection.

[0019] Optionally, the at least two original optical signals are emitted by the optical detection system in a time-division manner.

[0020] In this embodiment, when the original optical signals are transmitted in a time-division manner, optical interference between the original optical signals can be avoided, noise can be reduced, and detection errors can be lowered.

[0021] Optionally, the at least two original optical signals are generated by a beam splitter from light emitted by one of the emission sources in the optical detection system.

[0022] In this embodiment, compared to setting up multiple transmitters for a single transmitter, system power consumption can be reduced. Furthermore, minimal modifications are required to existing instruments, which helps reduce equipment upgrade costs.

[0023] In a second aspect, an optical detection apparatus is provided, including a unit for performing any of the methods in the first aspect. The apparatus may be a physical device or a chip within a physical device. The apparatus may include an input unit and a processing unit.

[0024] When the device is a physical device, the processing unit may be a processor, and the input unit may be a photosensitive element or other input device; the physical device may also include a memory for storing computer program code, which, when executed by the processor, causes the physical device to perform any of the methods in the first aspect.

[0025] When the device is a chip within a physical device, the processing unit can be an internal processing unit of the chip, and the input unit can be an input / output interface, pin, or circuit, etc.; the chip may also include memory, which can be memory within the chip (e.g., registers, cache, etc.) or memory located outside the chip (e.g., read-only memory, random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, it causes the chip to execute any of the methods in the first aspect.

[0026] Thirdly, a computer-readable storage medium is provided that stores computer program code, which, when run by an optical detection device, causes the device to perform any of the methods in the first aspect. Attached Figure Description

[0027] Figure 1 This is a schematic diagram illustrating the state of a signal as presented on an oscilloscope in a related technology.

[0028] Figure 2 This is a schematic diagram of the optical detection method provided in this application;

[0029] Figure 3 This is a schematic diagram of one embodiment of the optical detection method provided in this application;

[0030] Figure 4 This is a schematic diagram of the signal from the optical detection method provided in this application;

[0031] Figure 5 This is a schematic diagram of one embodiment of the optical detection method provided in this application;

[0032] Figure 6 This is a schematic diagram of a mapping relationship for the optical detection method provided in this application;

[0033] Figure 7 This is a schematic diagram of one embodiment of the optical detection method provided in this application;

[0034] Figure 8 This is a schematic diagram of the optical detection device provided in this application;

[0035] Figure 9 This is a schematic diagram of the electronic device for optical detection provided in this application. Detailed Implementation

[0036] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0037] Figure 1 To address the single-source drive signal (L) and corresponding reflected light intensity signal of a detection sensor, the sensor's receiving module integrates three color receiving tubes: R (red), G (green), and B (blue). When the driven white beam shines on the object being detected, the light intensity signal reflected from the object to the receiving unit contains R, G, and B components. By processing the data from these three RGB channels, color differentiation and detection can be performed. The drive period of the drive signal is t1. In this sensor, color similarity S(C) (color) is primarily used as the signal output condition. For example, for a target object P, when the original beam shines on the surface of P, the reflected RGB values ​​are R1%, G1%, and B1%, respectively. The setting function is invoked, and this information value is recorded. This RGB ratio information is used as the trigger threshold. After setting, the sensor's original beam is emitted towards the surface of the object being tested and the reflected light spot is received. When a value greater than or equal to the threshold appears, the sensor's trigger output condition is met.

[0038] This scheme can only handle single detection information, which leads to the following problems: when objects of similar color pass by, the RGB similarity can easily meet the triggering conditions, and the signal will also trigger the output; in addition, when a target object has problems such as color difference or overall inconsistency, this method is difficult to detect and judge.

[0039] Below, we will combine Figure 2 The optical detection method 200 provided in this application is described in detail. It should be noted that in this application, terms such as "first" and "second" are used to distinguish different individuals within the same type of object. For example, first similarity and second similarity represent two different similarity types, and there are no other limitations.

[0040] Method 200 can be derived from Figure 8 The device shown performs this function and is applied to an optical inspection system. For example... Figure 2 As shown, method 200 includes the following.

[0041] S201, receive at least two light spot signals; wherein, the at least two light spot signals are signals generated by the reflection of at least two original light signals emitted by the optical detection system on the object under test. In this embodiment, receiving at least two light spot signals reflected by the object under test means that information about at least two points on the object under test can be obtained, resulting in a larger amount of information for detecting the object under test, which is beneficial to improving the accuracy of detection.

[0042] It is understandable that the acquired at least two spot signals will have positional differences. After receiving at least two spot signals, noise reduction processing such as filtering can be performed on the spot signals.

[0043] Optionally, the at least two original optical signals are emitted by the optical detection system in a time-division manner.

[0044] In this embodiment, in order to make the object under test reflect at least two light spot signals, the optical detection system includes at least two emission sources. Each emission source emits multiple original light signals in a time-division manner, which can avoid light interference between the original light signals and further reduce detection errors.

[0045] The time period for this time-division transmission can be set to an integer multiple of the original optical signal drive period, reducing the parameters that need to be modified and facilitating transmission control. For example... Figure 4 As shown, the driving period of the original optical signals L1 and L2 was originally t1. The period of time-division transmission was set to t2, where t2 = 2t1. Therefore, within one time period of complete time-division transmission, one beam of the original optical signal L1 will be transmitted at 1 / 2 t2 period (i.e., time t3 in the figure), and another beam of the original optical signal L2 will be transmitted at the beginning of the complete t2 period.

[0046] Meanwhile, when the optical detection system includes at least two emission sources, it supports setting only one light-receiving element.

[0047] Multiple light sources emit raw light signals in a time-division multiplexing manner, with time differences between each signal. Therefore, the light spot information reflected by the object under test does not arrive at the receiving element simultaneously. That is, the receiving element can receive the multiple light spot signals reflected by the object under test one by one according to the time difference, without requiring highly complex functions such as simultaneously receiving and distinguishing multiple light spot signals, thus reducing the design difficulty and production cost of the receiving element. Furthermore, using only a single receiving element can also reduce the industrial cost and process complexity of the optical detection system. For example... Figure 3 The above is an exemplary physical device of this embodiment. The receiving unit supports only one light-receiving element, while the multiple transmitting units can be equipped with at least two transmitting sources.

[0048] Optionally, the at least two original optical signals are generated by a beam splitter from light emitted by one of the emission sources in the optical detection system.

[0049] In this embodiment, compared to setting multiple emission sources in the optical detection system, the power consumption of the emission sources is reduced; in addition, the modifications to the existing detection device are minor, which helps to reduce equipment upgrade costs.

[0050] It is understood that the emission source in this application may be an emission light source or a light source used to send raw light information to the object under test.

[0051] S202, feature comparison processing is performed on the at least two light spot signals to obtain the processing result. In this embodiment, feature parameters are extracted from the acquired at least two light spot signals, and calculations are performed based on the feature parameters to obtain parameters used to complete the detection as the processing result.

[0052] Optionally, feature comparison processing is performed on the at least two spot signals, including: differential processing or matching processing of the at least two spot signals; wherein, in the case of differential processing, the threshold is a feature parameter between the at least two spot signals; in the case of matching processing, the threshold is a feature parameter between the at least two spot signals and a standard detection point.

[0053] In this embodiment, the optical detection system can perform differential or matching processing on the information acquired from the spot signals according to different detection requirements, flexibly adapting to different scenarios. Differential processing involves feature comparison between spot signals. When the object under test is affected by the environment, the spot signals are also uniformly affected, but the relative values ​​between the spot signals do not change. Therefore, differential processing can eliminate the influence of environmental factors on the detection results. Matching processing involves feature comparison between the spot signals and standard detection points. Since there are many spot signals, errors in individual spot signals do not affect the final detection result, and users can easily adjust the parameters of the standard detection points and thresholds according to actual needs.

[0054] Optionally, the differential processing of the at least two light spot signals to obtain a processing result includes: acquiring the color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; obtaining a first similarity between the at least two light spot signals based on the proportion of each color intensity signal; and the processing result being the first similarity. (Refer to...) Figure 5 This is a flowchart illustrating the differential processing procedure. L1 and L2 represent two sets of original optical signals, and LA and LB represent two spot signals received from the object under test.

[0055] In this embodiment, the first similarity between light spot signals can be determined through color parameters. For example, the first similarity between light spot signals can be obtained based on the proportion of red, green, and blue channels in each light spot signal. This parameter is easy to obtain, the processing is simple, and the judgment speed is fast. It supports the detection of the target object under special circumstances, such as when the target object itself has color differences. During the threshold setting process, the color difference is considered as the detection threshold for judging the target object, and only this one threshold needs to be considered. Since the two light spot signals are uniformly affected by the environment, the relative value between the two light spot signals after subtraction can exclude environmental factors, exhibiting high robustness to environmental factors. The first similarity, for example, is color-related similarity.

[0056] Specifically, taking two light spot signals A and B as an example, the first similarity calculation process can be as follows:

[0057]

[0058]

[0059] Parameter description:

[0060] R(A / B)ratio represents the proportion of light intensity signal in the R channel. The proportion is calculated as follows:

[0061]

[0062] S(C) represents the similarity of C(color), with a numerical reference range of [0-999]; the ABS() formula is used to calculate the absolute value.

[0063] In differential processing, formula (1) calculates the difference in the proportions of R, G, and B values ​​between two light spot signals. Taking the R channel as an example: RE is the absolute value of the difference in the proportion of light intensity signals between the R channels of the two light spot signals. For ease of calculation, the proportion is multiplied by 1000. Formula (2) calculates the first similarity between two light spot signals. To fully represent the difference between the colors of two points, formula ① sums the differences in the proportions of each RGB channel and uses DIFF(C) to represent it. The larger the difference, the larger DIFF(C). To intuitively represent the similarity overlap, formula ② uses 999-DIFF(C) to obtain the final similarity value S(C). Among them, DIFF() is used to calculate the total color difference value, and C refers to color. It can be understood that the subtraction 999 in formula (2)② can be changed to parameters such as 1000 to reduce the computational complexity.

[0064] Optionally, the differential processing of the at least two light spot signals to obtain a processing result includes: acquiring the color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals based on the proportion of each color intensity signal; calculating the brightness parameters of the at least two light spot signals respectively based on the magnitude of each color intensity signal and the mapping relationship between the first similarity and brightness; acquiring a second similarity between the at least two light spot signals based on the magnitude of each color intensity signal and the brightness parameter; and the processing result is the second similarity.

[0065] In this embodiment, a brightness parameter is added for feature comparison, and the color and brightness of the spot signal are combined for comprehensive judgment, which makes it easier to show differences and improves the sensitivity of detection.

[0066] Specifically, to improve the detection sensitivity of differences between multi-spot signals, a CI (color-light) calculation method is introduced, which combines color and brightness. The specific implementation is as follows:

[0067]

[0068]

[0069] In differential mode

[0070] Formula (4) is used to calculate the maximum light intensity signal values ​​of the R, G, and B channels of light spot signal A and light spot signal B respectively, which are used as LA and LB.

[0071] Formula (5) is used to complete the second similarity calculation. The proportion of light intensity signals of the colors of A and B are different, and their brightness is also different. Formula (5)① represents the difference between the maximum light intensity signals of A and B. Formula (5)② mainly calculates the mapping from the first similarity S(C) to the brightness parameter E2(I), where I represents brightness. Formula (5)② is physically the mapping relationship between the first similarity and the brightness parameter. The mapping result shows that when the colors of the light spot signals of A and B are similar, E2(I) becomes smaller, and the subtrahend in Formula (5)④ becomes smaller. Explanation of Formula (5)②: S(C) is the mapped value, S(C) min This represents the lower limit of the mapped value, which is 0 in actual calculations, S(C). max This represents the upper limit of the mapped value, which is 999 in actual calculations, CIKP. min This represents the lower bound of the mapping target, which is 0 in actual computation, CIKP. max This represents the upper limit of the mapping target, which is set according to the system settings, for example, it can be set to [0-10]. The CIKP parameter is used to identify the proportional relationship between color and brightness. The mapping result of S(C) and CIKP is that the closer the first similarity S(C) of the two light spot signals are, i.e., S(C) is close to 999, the smaller the resulting CIKP value. A schematic diagram illustrating the relationship between S(C) and CIKP is shown below. Figure 6 As shown.

[0072] Equation (5)③E1(I) represents the real-time brightness difference between two light spot signals. The result obtained by multiplying it by the coefficient of E2(I) is the comprehensive difference E3(I). The magnitude of the E3(I) value changes inversely with the S(C) value. The inverse relationship means that if the light intensity information reflected by the two light spot signals is similar or the same color, the calculated E3(I) will not change much, thus maintaining a good detection range. That is, it can automatically filter environmental parameters such as distance / external light signals. Equation (5)④ is the difference between the first similarity and the comprehensive difference. Under the action of the above proportional factor, the obtained S(CI) similarity can distinguish between standard detection points and non-standard detection points in a friendly manner, thus completing the detection. The second similarity is, for example, S(CI).

[0073] Optionally, the matching process for the at least two light spot signals to obtain a processing result includes: acquiring the color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals and the standard detection point based on the proportion of each color intensity signal; the processing result is the first similarity. (Refer to...) Figure 7 This is a schematic diagram of the matching process.

[0074] In one example, the difference value can also be calculated based on S(CI) for judgment, such as formula (6):

[0075] D = 999 - S(CI)(6)

[0076] D represents the difference between at least two light spot signals. Similarly, a relevant threshold can be set to determine whether the object under test is the target object.

[0077] In this embodiment, the first similarity between the light spot signal and the standard detection point can be confirmed through color parameters. For example, the first similarity between each light spot signal and the standard detection point can be obtained based on the proportion of the red, green, and blue channels in the light spot signal. This parameter is easy to obtain, the processing is simple, and the judgment speed is fast.

[0078] This embodiment does not restrict the setting of standard detection points, supporting various personalized detection scenarios. For example, if the overall features of the target object are consistent, any point on the target object can be set as a standard detection point as needed, and the first similarity calculation can be performed between the received multiple light spot signals and this single standard detection point. More parameters are used for judgment, avoiding misjudgments in cases where color parameters are similar. Simultaneously, if the target object itself has regional differences, or if the environment has an uneven influence on the target object, multiple standard detection points can be set specifically, calculating the similarity between each light spot signal and each standard detection point, or between each light spot signal and its corresponding (e.g., positional correspondence) standard detection point. The position, number, and threshold used for judgment of the standard detection points can all be customized by the user. It offers high accuracy in detecting the object and is applicable to a wide range of scenarios.

[0079] In one example, when calculating the similarity between each light spot signal and each standard detection point does not establish a corresponding relationship, a proportional threshold can be set in addition to the similarity threshold. When the proportion of similarities satisfying the similarity threshold exceeds the proportional threshold, the object to be detected can be determined as the target object. For example, the colors of the first and second regions of the target object are inconsistent. Standard detection point n is located in the first region, and standard detection point m is located in the second region, indicating a color difference between the first and second regions. Receiving light spot signals A and B, setting the proportional threshold to 50%, and obtaining four sets of similarities (A and n, A and m, B and n, B and m), the similarity thresholds are satisfied by the similarity between A and n and the similarity between B and m. When the proportion reaches 50%, the object to be detected is determined as the target object.

[0080] In one example, the reliability of spot information can also be screened. For instance, when the overall features of the target object are consistent, three spot signals are received: spot E1, spot E2, and spot E3. Similarity calculations are performed between each spot. Spots E1 and E2 show a high similarity, while the similarity between E1 and E3 is relatively low. The low similarity between E2 and E3 indicates that spot E3 is significantly affected by environmental interference and has a large error. Therefore, spot E3 can be ignored when calculating similarity with the standard detection point; only the similarity between spots E1 and E2 and the standard detection point is calculated, ultimately completing the matching detection.

[0081] Each standard detection point and threshold can be customized by the user to meet the needs of high-precision detection, and can be adjusted in real time according to the environment and different target objects.

[0082] Specifically, the formula for calculating the first similarity can be found in the above embodiment. Here, A represents the received spot signal, and B represents the standard detection point. The first similarity between at least two sets of spot signals and the standard detection point is calculated respectively.

[0083] The similarity between matching and differential processing is that the S(CI) calculation method is the same, both generating a brightness parameter from S(C). The difference is that in differential mode, the benchmark for calculating similarity is the RGB ratio of other received spot signals, and the calculated brightness parameter refers to the difference between two spot signals; while in matching mode, at least two spot signals are acquired, the RGB information of each spot signal is recorded, and the brightness parameter value of each is calculated based on the standard detection point.

[0084] It is understood that the threshold in this embodiment can be directly obtained by processing the target object using an optical detection system. For example, by acquiring a standard detection point from the target object once, and then conducting a second transmission and reception while keeping the object stationary, the S(CI) calculated in both cases will be 999 or other parameters that are completely identical, and this value can be set as S(CI). SET To facilitate the triggering of photoelectric information, 999-30 can be set to S(CI). SET Alternatively, a standard detection point can be obtained by sampling the target object once. Then, to increase the tolerance range, a second transmission and reception can be performed on another object with slight differences. The calculated S(CI) is then used as S(CI). SET In other words, the threshold in this embodiment can be directly obtained from the target object or other reference objects, without the need for manual input.

[0085] Optionally, the matching process for the at least two light spot signals to obtain a processing result includes: acquiring the color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals and the standard detection point based on the proportion of each color intensity signal; calculating the brightness parameters of the at least two light spot signals based on the magnitude of each color intensity signal and the mapping relationship between the first similarity and brightness; acquiring a second similarity between the at least two light spot signals and the standard detection point based on the magnitude of each color intensity signal and the brightness parameter; and the processing result is the second similarity.

[0086] In this embodiment, a brightness parameter is added for feature comparison, and the color and brightness of the spot signal are combined for comprehensive judgment, which makes it easier to show differences and improves the sensitivity of detection.

[0087] Specifically, the formula for calculating the second similarity can be found in the above embodiment. Here, A represents the received spot signal, and B represents the standard detection point. The second similarity between at least two sets of spot signals and the standard detection point is calculated respectively.

[0088] When the dual-spot signal is moved to a non-standard detection point, the calculated difference E3(I) becomes more significantly larger because both S(C) (decreases) and the brightness parameter (increases) change synchronously.

[0089] S203, output photoelectric information based on the processing result and the threshold.

[0090] Specifically, the processing results include either a first similarity score or a second similarity score. Different similarity scores are then compared with their corresponding thresholds (S()). SET If the object to be detected meets the standard according to the threshold, then the object to be detected is determined to be the target object.

[0091] In related technologies, after acquiring the spot information of a single object to be detected, the color similarity between the single spot information and a single standard detection point is calculated. A threshold is then calculated based on the color similarity, and this threshold is used to determine whether the object to be detected is the target object. However, this method relies on a single criterion and is highly prone to error. For example, using S(C)... SET Threshold calculation is performed using (999 + S(C)) ÷ 2, followed by further judgment. However, the implementation method proposed in this application obtains richer information, diversifies the processing procedures, improves detection sensitivity, and ensures a better user experience.

[0092] In this system, if the physical device is a photoelectric switch, the output photoelectric information indicates whether the switch is open or closed. The system responds by turning on the photoelectric switch when the detected object is identified as the target object; otherwise, it does not respond and the detection process ends. It is understandable that the output photoelectric information could also be other forms of judgment results regarding whether the detected object is the target object.

[0093] The above method is applied to an optical detection system. By analyzing at least two light spot signals reflected by the object under test, more information can be obtained. If one of the light spot signals has a large error due to environmental interference or other factors, the optical detection system can correct the error through other light spot signals, thereby improving the accuracy of detecting the object under test.

[0094] The foregoing has detailed examples of the optical detection methods provided in this application. It is understood that the corresponding apparatus, in order to achieve the above functions, includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0095] This application can divide the optical detection device into functional units based on the above method example. For example, each function can be divided into its own functional unit, or two or more functions can be integrated into one unit. The integrated unit can be implemented in hardware or software. It should be noted that the unit division in this application is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0096] Figure 8 This is a schematic diagram of an optical detection device provided in this application. The device 600 includes a processing unit 610 and an input unit 620, wherein the input unit 620 can perform the acquisition step under the control of the processing unit 610.

[0097] The input unit 620 is configured to: receive at least two light spot signals; wherein the at least two light spot signals are signals generated by the reflection of at least two original light signals emitted by the optical detection system on the object under test;

[0098] The processing unit 610 is used to: perform feature comparison processing on the at least two light spot signals to obtain a processing result; and output photoelectric information based on the processing result and a threshold.

[0099] Optionally, the at least two original optical signals are emitted by the optical detection system in a time-division manner.

[0100] Optionally, the at least two original optical signals are generated by a beam splitter from light emitted by one of the emission sources in the optical detection system.

[0101] Optionally, the processing unit 610 is further configured to: perform feature comparison processing on the at least two spot signals, including: performing differential processing or matching processing on the at least two spot signals; wherein, in the case of differential processing, the threshold is a feature parameter between the at least two spot signals; in the case of matching processing, the threshold is a feature parameter between the at least two spot signals and a standard detection point.

[0102] Optionally, the processing unit 610 is further configured to: perform differential processing on the at least two light spot signals to obtain a processing result, including: acquiring color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals based on the proportion of each color intensity signal; and the processing result being the first similarity.

[0103] Optionally, the processing unit 610 is specifically configured to: perform differential processing on the at least two light spot signals to obtain a processing result, including: acquiring color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals based on the proportion of each color intensity signal; calculating the brightness parameters of the at least two light spot signals respectively based on the magnitude of each color intensity signal and the mapping relationship between the first similarity and brightness; acquiring a second similarity between the at least two light spot signals based on the magnitude of each color intensity signal and the brightness parameter; the processing result is the second similarity.

[0104] Optionally, the processing unit 610 is further configured to: perform matching processing on the at least two light spot signals to obtain a processing result, including: acquiring the color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring the first similarity between the at least two light spot signals and the standard detection point according to the proportion of each color intensity signal; the processing result is the first similarity.

[0105] Optionally, the processing unit 610 is further configured to: perform matching processing on the at least two light spot signals to obtain a processing result, including: acquiring color parameters of the at least two light spot signals respectively; calculating the proportion of each color intensity signal in the color parameters; acquiring a first similarity between the at least two light spot signals and the standard detection point according to the proportion of each color intensity signal; calculating the brightness parameters of the at least two light spot signals according to the mapping relationship between the magnitude of each color intensity signal and the first similarity and brightness; acquiring a second similarity between the at least two light spot signals and the standard detection point according to the magnitude of each color intensity signal and the brightness parameter; the processing result is the second similarity.

[0106] The specific manner in which the device 600 performs optical detection and the beneficial effects thereof can be found in the relevant descriptions in the method embodiments.

[0107] Figure 9 A schematic diagram of the structure of an electronic device for optical detection provided in this application is shown. Figure 9 The dashed lines in the diagram indicate that the unit or module is optional. Device 700 can be used to implement the methods described in the above method embodiments. Device 700 can be a physical device, a server, or a chip.

[0108] The device 700 includes one or more processors 701, which can support the implementation of the methods in the method embodiments. The processor 701 can be a general-purpose processor or a special-purpose processor. For example, the processor 701 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0109] The processor 701 can be used to control the device 700, execute software programs, and process data from the software programs. The device 700 may also include a communication unit 705 for inputting (receiving) and outputting (transmitting) signals.

[0110] For example, device 700 may be a chip, communication unit 705 may be the input and / or output circuit of the chip, or communication unit 705 may be the communication interface of the chip, which may be a component of a physical device, server or other electronic device.

[0111] For example, device 700 can be a physical device, and communication unit 705 can be the transceiver of that physical device, or communication unit 705 can be the transceiver circuit of that physical device.

[0112] The device 700 may include one or more memories 702, on which a program 704 is stored. The program 704 can be executed by a processor 701 to generate instructions 703, causing the processor 701 to execute the method described in the above method embodiments according to the instructions 703. Optionally, the memory 702 may also store data. Optionally, the processor 701 may also read data stored in the memory 702, which may be stored at the same memory address as the program 704, or it may be stored at a different memory address than the program 704.

[0113] The processor 701 and memory 702 can be configured separately or integrated together, for example, integrated on a system-on-chip (SOC) of a physical device.

[0114] This application also provides a computer program product that, when executed by processor 701, implements the methods described in any of the method embodiments of this application.

[0115] The computer program product can be stored in memory 702, for example, program 704. Program 704 is finally converted into an executable object file that can be executed by processor 701 after processing such as preprocessing, compilation, assembly and linking.

[0116] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, implements the methods described in any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.

[0117] The computer-readable storage medium is, for example, memory 702. Memory 702 can be volatile memory or non-volatile memory, or memory 702 can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0118] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process and technical effects of the above-described apparatus and equipment can be referred to the corresponding processes and technical effects in the foregoing method embodiments, and will not be repeated here.

[0119] In the several embodiments provided in this application, the systems, apparatuses, and methods disclosed can be implemented in other ways. For example, some features of the method embodiments described above can be omitted or not performed. The apparatus embodiments described above are merely illustrative; the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Multiple units or components can be combined or integrated into another system. Furthermore, the coupling between units or components can be direct coupling or indirect coupling, including electrical, mechanical, or other forms of connection.

[0120] It should be understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0121] Furthermore, the terms "system" and "network" are often used interchangeably in this paper. The term "and / or" in this paper merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this paper generally indicates that the preceding and following related objects have an "or" relationship.

[0122] In summary, the above description is merely a preferred embodiment of the technical solution of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for optical detection, characterized in that, The method, applied to an optical inspection system, includes: Receive at least two light spot signals; wherein, the at least two light spot signals are signals generated by the reflection of at least two original light signals emitted by the optical detection system on the object under test; The at least two light spot signals are subjected to feature comparison processing to obtain the processing result; Based on the processing result and the threshold, output photoelectric information; The step of performing feature comparison processing on the at least two light spot signals to obtain the processing result includes: The at least two spot signals are matched to obtain the processing result; wherein, when matching is performed, the threshold is a feature parameter between the at least two spot signals and the standard detection point; The step of matching the at least two light spot signals to obtain the processing result includes: Obtain the color parameters of the at least two light spot signals respectively; Calculate the proportion of each color light intensity signal in the color parameters; Based on the proportion of each color light intensity signal, the first similarity between the at least two light spot signals and the standard detection point is obtained respectively; Based on the magnitude of each color light intensity signal and the mapping relationship between the first similarity and brightness, the brightness parameters of the at least two light spot signals are calculated respectively. Based on the magnitude of each color light intensity signal and the brightness parameter, a second similarity is obtained between the at least two light spot signals and the standard detection point; the processing result is the second similarity.

2. The method according to claim 1, characterized in that, The at least two original optical signals are emitted by the optical detection system in a time-division manner.

3. The method according to claim 1, characterized in that, The at least two original optical signals are generated by a beam splitter from light emitted by one of the emission sources in the optical detection system.

4. An apparatus for an optical detection method, characterized in that, The device includes a processor and a memory coupled together, the memory being used to store a computer program that, when executed by the processor, causes the device to perform the method of any one of claims 1 to 3.

5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the method of any one of claims 1 to 3.