Foreign matter detection method, device and system and electronic equipment
By acquiring bright-field images of the sensor-detected surface, analyzing response characteristics, and identifying deviation information, the problems of high cost and poor versatility of sensor foreign object detection are solved, and low-cost automated detection is achieved.
Patent Information
- Application Number
- CN202511170251.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-12-16
AI Technical Summary
In existing technologies, foreign object detection by sensors relies on high-cost optical inspection systems. These systems are complex and difficult to integrate into automated production lines, resulting in high costs and poor versatility.
By acquiring bright-field images of the sensor-detected surface, analyzing response characteristics, determining the background response baseline, and comparing pixel response characteristics with the baseline to identify deviation information, foreign object detection can be achieved without the need for additional specialized tooling.
It enables automated detection of foreign objects on the sensor surface, reduces detection costs, improves the versatility and adaptability of detection, and can effectively identify tiny foreign objects.
Smart Images

Figure CN121141684A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of foreign matter detection, and particularly relates to a foreign matter detection method, device, system and electronic equipment. BACKGROUND
[0002] In the manufacturing and use process of precision sensing devices, the sensor surface is extremely easy to be contaminated by foreign matters such as particles and stains. These foreign matters can cause abnormal local response of the sensor, interfere with subsequent signal processing and correction algorithm, and finally lead to the decline of output data quality. Therefore, effective detection of the cleanliness of the sensor surface is crucial in the production and quality inspection links.
[0003] At present, sensor foreign matter detection mainly relies on special high-cost optical detection systems, and the special systems are complex in equipment, high in cost and poor in universality, which are difficult to integrate into automatic production lines. SUMMARY
[0004] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, the present application proposes a foreign matter detection method, device, system and electronic equipment, which can realize automatic detection of foreign matters on the surface of a sensor without additional special tooling.
[0005] In a first aspect, the present application provides a foreign matter detection method, which comprises:
[0006] obtaining a bright field image of a detection surface of a target sensor;
[0007] determining a background response baseline corresponding to the detection surface in the bright field image based on a response feature of the bright field image;
[0008] comparing the response feature of each pixel in the bright field image with the background response baseline to obtain deviation information between each pixel and the corresponding pixel of the detection surface;
[0009] obtaining a foreign matter detection result of the target sensor based on each of the deviation information.
[0010] According to the foreign matter detection method of the present application, by obtaining a bright field image of a detection surface of a target sensor, analyzing the response feature of the corresponding bright field image of the detection surface under uniform excitation, identifying the local abnormal area significantly deviating from the smooth background, and determining it as the area corresponding to the foreign matter, the automatic detection of foreign matters on the surface of the sensor can be realized without additional special tooling.
[0011] According to one embodiment of the present application, the obtaining of the foreign matter detection result of the target sensor based on each of the deviation information comprises:
[0012] obtaining a first deviation threshold based on a plurality of the deviation information;
[0013] Each of the aforementioned deviation information is compared with the first deviation threshold to obtain the foreign object detection result.
[0014] According to one embodiment of this application, obtaining the first deviation threshold based on a plurality of deviation information includes:
[0015] The first deviation threshold is obtained based on the statistical characteristics of the differences among the multiple deviation information.
[0016] According to one embodiment of this application, comparing each of the deviation information with the first deviation threshold to obtain the foreign object detection result includes:
[0017] Pixels whose deviation information is greater than the first deviation threshold are identified as candidate foreign object pixels;
[0018] Based on the candidate foreign object pixels, the foreign object detection result is determined.
[0019] According to one embodiment of this application, determining the foreign object detection result based on the candidate foreign object pixels includes:
[0020] Based on the candidate foreign object pixels, a first foreign object region in the bright field image is determined;
[0021] The two first foreign object regions with a distance less than the first distance threshold are merged to obtain the second foreign object region;
[0022] Remove the second foreign object region whose size is smaller than the foreign object size threshold;
[0023] Based on the information corresponding to the retained second foreign object region, the foreign object detection result is determined.
[0024] According to one embodiment of this application, determining the background response baseline corresponding to the detection surface in the bright-field image based on the response features of the bright-field image includes:
[0025] The response features of the bright field image are smoothed or fitted to obtain the background response baseline.
[0026] Secondly, this application provides a foreign object detection device, which includes:
[0027] The acquisition module is used to acquire bright-field images of the detection surface of the target sensor;
[0028] The first processing module is used to determine the background response baseline corresponding to the detection surface in the bright field image based on the response characteristics of the bright field image;
[0029] The second processing module is used to compare the response features of each pixel in the bright field image with the background response baseline to obtain the deviation information between each pixel and the corresponding pixel on the detection surface.
[0030] The third processing module is used to obtain the foreign object detection result of the target sensor based on each of the deviation information.
[0031] According to the foreign object detection device of this application, by acquiring a bright field image of the detection surface of the target sensor, analyzing the response characteristics of the corresponding bright field image of the detection surface under uniform excitation, identifying local abnormal areas that deviate significantly from the smooth background, and determining them as the areas corresponding to foreign objects, the device can achieve automated detection of foreign objects on the sensor surface without the need for additional special tooling.
[0032] Thirdly, this application provides a foreign object detection system, including:
[0033] Image acquisition equipment used to acquire bright-field images of the detection surface of a target sensor;
[0034] As described in the second aspect above, the foreign object detection device is connected to the image acquisition device.
[0035] According to the foreign object detection system of this application, by acquiring the bright field image of the detection surface of the target sensor, analyzing the response characteristics of the corresponding bright field image of the detection surface under uniform excitation, identifying local abnormal areas that deviate significantly from the smooth background, and determining them as the areas corresponding to foreign objects, the system can achieve automated detection of foreign objects on the sensor surface without the need for additional special tooling.
[0036] According to one embodiment of this application, the aperture size of the lens of the image acquisition device is smaller than the aperture size threshold.
[0037] Fourthly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the foreign object detection method as described in the first aspect above.
[0038] Fifthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the foreign object detection method as described in the first aspect above.
[0039] Sixthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the foreign object detection method as described in the first aspect above.
[0040] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0041] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0042] Figure 1 This is a flowchart illustrating the foreign object detection method provided in the embodiments of this application;
[0043] Figure 2 This is a schematic diagram of the foreign object detection device provided in the embodiments of this application;
[0044] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0046] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0047] The foreign object detection method, foreign object detection device, foreign object detection system, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0048] Among them, the foreign object detection method can be applied to the terminal, and can be executed by the hardware or software in the terminal.
[0049] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0050] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
[0051] The foreign object detection method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the foreign object detection method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices. The foreign object detection method provided in this application embodiment is described below using an electronic device as the execution subject.
[0052] like Figure 1 As shown, the foreign object detection method includes steps 110-140.
[0053] Step 110: Obtain a bright-field image of the detection surface of the target sensor.
[0054] Among them, the target sensor is the sensor to be detected as a foreign object, which can be a pressure sensor, an image sensor, or a temperature sensor, etc. The detection surface of the target sensor is the surface on which the target sensor directly contacts or interacts with the object being measured in order to receive the physical quantity to be measured.
[0055] Bright-field images are images formed when light passes directly through or is reflected from a sample. Areas that are not scattered or absorbed by the sample appear bright, while areas that are scattered or absorbed appear dark. The sample may contain foreign matter.
[0056] In this step, under specific imaging conditions that are conducive to highlighting the features of foreign objects, for example, by adjusting the optical system parameters to improve imaging sharpness, the detection surface of the target sensor is photographed to obtain the corresponding bright field image.
[0057] Step 120: Based on the response characteristics of the bright field image, determine the background response baseline corresponding to the detected surface in the bright field image.
[0058] Among them, the response characteristics of bright-field images can characterize the response properties of the detection surface to light, including visual attributes such as brightness, contrast and color. The response characteristics of bright-field images can reflect the physical properties of the detection surface, such as reflectivity, absorptivity and scattering characteristics.
[0059] The background response baseline is the average response level of the background region in the bright field image when no foreign objects are present. The background region in the bright field image is the region corresponding to the detection surface.
[0060] In this step, the average or median of the response features corresponding to the detected surface in the bright field image is statistically analyzed and used as the background response baseline corresponding to the detected surface.
[0061] Step 130: Compare the response features of each pixel in the bright field image with the background response baseline to obtain the deviation information between each pixel and the corresponding pixel on the detection surface.
[0062] The deviation information is used to characterize the degree of deviation of the response features of each pixel in the bright field image from the background response baseline.
[0063] In this step, the absolute or relative difference between the response features of each pixel in the bright field image and the background response baseline is calculated, and the difference is used as deviation information.
[0064] Step 140: Based on the various deviation information, obtain the foreign object detection results of the target sensor.
[0065] Among them, the foreign object detection result is used to indicate the location and shape of foreign objects on the detection surface of the target sensor.
[0066] In this embodiment, the deviation information can be compared with a set threshold, and the pixels with deviation information greater than the set threshold are identified as the pixels corresponding to foreign objects, thereby obtaining the foreign object detection result.
[0067] In related technologies, foreign object detection by sensors mainly relies on dedicated, high-cost optical detection systems. These dedicated systems are complex, expensive, and have poor versatility, making them difficult to integrate into automated production lines.
[0068] In this embodiment, a bright-field image of the detection surface of the target sensor is acquired. Based on the response characteristics of the bright-field image, the background response baseline corresponding to the detection surface in the bright-field image is determined. The response characteristics of each pixel in the bright-field image are compared with the background response baseline to obtain the deviation information between each pixel and the corresponding pixel on the detection surface. Based on the deviation information, the foreign object detection result of the target sensor is obtained. No additional special tooling is required, and the automated detection of foreign objects on the sensor surface can be realized.
[0069] According to the foreign object detection method provided in the embodiments of this application, by acquiring the bright field image of the detection surface of the target sensor, analyzing the response characteristics of the corresponding bright field image of the detection surface under uniform excitation, identifying the local abnormal area that deviates significantly from the smooth background, and determining it as the area corresponding to the foreign object, no additional special tooling is required, and the automatic detection of foreign objects on the sensor surface can be realized.
[0070] In some embodiments, the foreign object detection result of the target sensor is obtained based on various deviation information, including:
[0071] Based on multiple deviation information, the first deviation threshold is obtained;
[0072] Each deviation information is compared with the first deviation threshold to obtain the foreign object detection result.
[0073] The first deviation threshold is a value set based on multiple deviation information to distinguish between the pixel corresponding to the foreign object and the pixel corresponding to the detection surface.
[0074] In this embodiment, multiple deviation information can be statistically analyzed, and a first deviation threshold can be determined based on the results of the statistical analysis.
[0075] The deviation information is compared with the first deviation threshold, and the pixels with deviation information greater than the first deviation threshold are identified as the pixels corresponding to foreign objects, thereby obtaining the foreign object detection result.
[0076] In some embodiments, obtaining the first deviation threshold includes:
[0077] The first deviation threshold is obtained based on the statistical characteristics of the differences between multiple deviation information.
[0078] Among them, the statistical characteristics of difference are numerical indicators that describe the degree of difference between various deviation information, such as range, standard deviation, and coefficient of variation.
[0079] In this embodiment, the standard deviation among multiple deviation information can be calculated as a first deviation threshold.
[0080] In some embodiments, each deviation information is compared with a first deviation threshold to obtain a foreign object detection result, including:
[0081] Pixels with deviation information greater than the first deviation threshold are identified as candidate foreign object pixels;
[0082] Based on candidate foreign object pixels, the foreign object detection result is determined.
[0083] Among them, candidate foreign object pixels are pixels that may contain foreign objects.
[0084] In this embodiment, the deviation information corresponding to each pixel is compared with a first deviation threshold. Pixels with deviation information greater than the first deviation threshold are identified as candidate foreign object pixels. From the candidate foreign object pixels, a selection is made according to the set conditions, and a foreign object detection result is formed based on the selected pixels.
[0085] In some embodiments, determining the foreign object detection result based on candidate foreign object pixels includes:
[0086] Based on candidate foreign object pixels, determine the first foreign object region in the bright field image;
[0087] The two first foreign object regions with a distance less than the first distance threshold are merged to obtain the second foreign object region;
[0088] Remove the second foreign object region whose size is smaller than the foreign object size threshold;
[0089] Based on the information corresponding to the retained second foreign object region, the foreign object detection result is determined.
[0090] The first foreign object region is the region corresponding to the candidate foreign object pixel, and the second foreign object region is the region obtained by merging the first foreign object regions whose distance is less than the first distance threshold.
[0091] The first distance threshold and the foreign object size threshold are preset values, which can be set according to the actual size and shape of the foreign object.
[0092] In this embodiment, the region corresponding to the candidate foreign object pixel is determined as the first foreign object region. The distance between each first foreign object region is calculated and compared with a first distance threshold. Two first foreign object regions with a distance less than the first distance threshold are merged to obtain the second foreign object region.
[0093] The second foreign object region with a size smaller than the foreign object size threshold is removed, and the second foreign object region with a size greater than or equal to the foreign object size threshold is retained. The second foreign object region can be the actual area where the foreign object exists. The foreign object detection result is obtained based on the size and location of the second foreign object region.
[0094] In some embodiments, determining the background response baseline corresponding to the detected surface in the bright-field image based on the response characteristics of the bright-field image includes:
[0095] The response characteristics of the bright field image are smoothed or fitted to obtain the background response baseline.
[0096] In this embodiment, the response features of the bright field image are smoothed or fitted to remove local fluctuations or interference in the bright field image, thereby extracting the background response baseline.
[0097] The following is a specific embodiment of a foreign object detection method.
[0098] The main inputs to the foreign object detection method provided in this application are the bright field image to be detected, and some key configuration parameters, such as the physical specifications of the target sensor (for parameter adaptation) and the detection sensitivity control factor (for adjusting the threshold).
[0099] The main outputs are the number of foreign objects detected, and the precise location information of each foreign object (such as coordinates, bounding box, etc.).
[0100] Step 1: Image acquisition under controlled conditions. Under specific imaging conditions that are conducive to highlighting the features of foreign objects, for example, by adjusting the optical system parameters to improve imaging sharpness, a uniform scene image of the detection surface of the target sensor, i.e. a bright field image, is acquired. For multi-channel sensors, each channel can be acquired separately.
[0101] Step 2: Feature Extraction and Background Baseline Estimation. The acquired bright-field image is processed to extract feature data that reflects the spatial response changes in the bright-field image. At the same time, by applying a smoothing or fitting algorithm, such as median filtering or polynomial fitting, to the feature data, an ideal background response baseline free from foreign object interference is estimated. The parameters of the relevant algorithms can be adaptively adjusted according to the physical specifications of the target sensor, such as the pixel size.
[0102] Step 3: Extraction and analysis of deviation signals. The response characteristics of the bright field image are compared with the estimated background response baseline. The difference is calculated to obtain deviation information, which can significantly amplify the local response anomalies caused by foreign objects.
[0103] Step 4: Dynamic threshold determination and foreign object identification. Based on the statistical characteristics of the deviation information, such as the standard deviation, a judgment threshold is dynamically calculated. This dynamic threshold can adapt to the noise level of the image itself, improve the robustness of detection, and identify the area in the deviation information that exceeds the threshold as the candidate foreign object area, i.e., the first foreign object area. The foreign object detection result is obtained based on the candidate foreign object area.
[0104] Step 5: Post-processing and result output. The identified candidate foreign object regions are post-processed. For example, adjacent discrete points are merged into a continuous region to obtain the second foreign object region, and artifacts that are too small or may be caused by random noise are removed. For multi-channel sensors, this step also includes fusing the detection results of each channel. Finally, quantitative information such as the number and precise location of foreign objects is output.
[0105] The following describes a specific embodiment of another foreign object detection method.
[0106] Step 1: Under the preset imaging conditions, acquire a bright-field image of the detection surface of the target sensor.
[0107] Step 2: Extract response features from the bright-field image and estimate a background response baseline free from foreign object interference based on the response features of the bright-field image.
[0108] Step 3: Calculate the deviation information between the response characteristics of the bright field image and the background response baseline.
[0109] Step 4: Based on the statistical characteristics of the deviation information, dynamically determine a discrimination threshold, namely the first deviation threshold.
[0110] Step 5: Identify the first foreign object region whose deviation information exceeds the first deviation threshold as a foreign object and output its location information.
[0111] In this embodiment, the background response baseline can be obtained by low-pass filtering or curve / surface fitting of the response features. The first deviation threshold can be set according to a statistical discrete measure of the deviation information, such as the standard deviation.
[0112] After step five, there is also a post-processing step of merging and size screening the identified first foreign object region to obtain the second foreign object region and generate the foreign object detection result.
[0113] The preset imaging conditions include using a small aperture lens or other optical configurations that can improve image sharpness.
[0114] Foreign object detection methods can adaptively adjust internal algorithm parameters based on the physical parameters of the target sensor, such as pixel size.
[0115] For multi-channel images, detection is performed independently for each channel, and the results are then fused.
[0116] The foreign object detection method provided in this application is based on a framework of background modeling, deviation analysis, and dynamic thresholding, which enables adaptive detection of foreign objects in the sensor.
[0117] It should be noted that the background response baseline can be constructed using smoothing filtering techniques such as Gaussian filtering and bilateral filtering, or more complex fitting models such as spline fitting.
[0118] The dynamic threshold, or first deviation threshold, can be set based on other robust statistics, such as quantiles and absolute median difference, to cope with different noise distributions.
[0119] Before detecting bright-field images, image enhancement steps, such as contrast stretching and the Retinex algorithm, can be added to improve the visibility of foreign objects.
[0120] Other optical configurations that can enhance the contrast of foreign objects can be used, such as parallel light illumination, oblique illumination, or polarized light imaging.
[0121] The foreign object detection method provided in this application is low-cost and easy to integrate. It does not require dedicated hardware and can be directly used with existing imaging equipment, making it easy to embed into production or quality inspection processes.
[0122] It features high sensitivity and strong adaptability, effectively detecting minute foreign objects, and is compatible with sensors of different specifications through an adaptive mechanism.
[0123] It features high robustness and configurability, effectively reducing false alarms and false negatives through strategies such as dynamic thresholds, and key parameters can be flexibly adjusted.
[0124] It features quantitative output, providing precise location and quantity analysis results for foreign objects.
[0125] In related technologies, foreign object detection by sensors mainly relies on manual visual inspection or dedicated, high-cost optical inspection systems. Manual methods are highly subjective, inefficient, and inconsistent; dedicated systems are complex, expensive, and lack versatility, making them difficult to integrate into automated production lines.
[0126] While some technologies attempt to identify foreign objects using general image processing methods (such as simple edge detection or statistical analysis), these methods generally suffer from the following problems:
[0127] It is highly sensitive to environmental changes, such as changes in lighting conditions and optical system configuration, which leads to unstable detection results.
[0128] Lacking adaptability, the algorithm parameters are usually fixed and cannot automatically adapt to different models and specifications of sensors, making deployment and maintenance difficult.
[0129] Setting thresholds is difficult, and fixed thresholds are often used, making it hard to balance false alarms and missed alarms, especially in real-world scenarios where noise levels vary.
[0130] The positioning and statistics are not precise, and can only give a rough location of the foreign object, but cannot provide accurate quantitative information such as location and quantity.
[0131] Insufficient multi-channel information fusion: For multi-channel sensors (such as color cameras), there is a lack of effective cross-channel information integration strategies.
[0132] The foreign object detection method provided in this application acquires a bright-field image of the detection surface of a target sensor. Based on the response characteristics of the bright-field image, it determines the background response baseline corresponding to the detection surface in the bright-field image. It compares the response characteristics of each pixel in the bright-field image with the background response baseline to obtain the deviation information between each pixel and the corresponding pixel on the detection surface. Based on the deviation information, it obtains the foreign object detection result of the target sensor. According to the bright-field image of the detection surface of the target sensor, it analyzes the response characteristics of the detection surface under uniform excitation to identify local abnormal areas that deviate significantly from the smooth background and determines them as the areas corresponding to foreign objects. Without the need for additional special tooling, it can realize the automated detection of foreign objects on the sensor surface.
[0133] The foreign object detection method provided in this application can be executed by a foreign object detection device. This application uses a foreign object detection device executing the foreign object detection method as an example to illustrate the foreign object detection device provided in this application.
[0134] This application also provides a foreign object detection device.
[0135] like Figure 2 As shown, the foreign object detection device includes:
[0136] The acquisition module 210 is used to acquire a bright-field image of the detection surface of the target sensor;
[0137] The first processing module 220 is used to determine the background response baseline corresponding to the detected surface in the bright field image based on the response characteristics of the bright field image;
[0138] The second processing module 230 is used to compare the response features of each pixel in the bright field image with the background response baseline to obtain the deviation information between each pixel and the corresponding pixel on the detection surface.
[0139] The third processing module 240 is used to obtain the foreign object detection results of the target sensor based on the various deviation information.
[0140] According to the foreign object detection device provided in the embodiments of this application, by acquiring the bright field image of the detection surface of the target sensor, analyzing the response characteristics of the corresponding bright field image of the detection surface under uniform excitation, identifying the local abnormal area that deviates significantly from the smooth background, and determining it as the area corresponding to the foreign object, the device can realize the automated detection of foreign objects on the sensor surface without the need for additional special tooling.
[0141] In some embodiments, the third processing module 240 is used to obtain a first deviation threshold based on multiple deviation information.
[0142] Each deviation information is compared with the first deviation threshold to obtain the foreign object detection result.
[0143] In some embodiments, the third processing module 240 is used to obtain a first deviation threshold based on the statistical characteristics of the differences between multiple deviation information.
[0144] In some embodiments, the third processing module 240 is used to determine pixels whose deviation information is greater than a first deviation threshold as candidate foreign object pixels.
[0145] Based on candidate foreign object pixels, the foreign object detection result is determined.
[0146] In some embodiments, the third processing module 240 is used to determine a first foreign object region in the bright field image based on candidate foreign object pixels;
[0147] The two first foreign object regions with a distance less than the first distance threshold are merged to obtain the second foreign object region;
[0148] Remove the second foreign object region whose size is smaller than the foreign object size threshold;
[0149] Based on the information corresponding to the retained second foreign object region, the foreign object detection result is determined.
[0150] In some embodiments, the first processing module 220 is used to smooth or fit the response features of the bright field image to obtain a background response baseline.
[0151] The foreign object detection device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.
[0152] The foreign object detection device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0153] The foreign object detection device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0154] This application also provides a foreign object detection system.
[0155] The foreign object detection system includes an image acquisition device and the aforementioned foreign object detection apparatus.
[0156] The image acquisition device is used to acquire bright-field images of the detection surface of the target sensor, and the foreign object detection device is connected to the image acquisition device.
[0157] According to the foreign object detection system provided in the embodiments of this application, by acquiring the bright field image of the detection surface of the target sensor, analyzing the response characteristics of the corresponding bright field image of the detection surface under uniform excitation, identifying local abnormal areas that deviate significantly from the smooth background, and determining them as the areas corresponding to foreign objects, the system can achieve automated detection of foreign objects on the sensor surface without the need for additional special tooling.
[0158] In some embodiments, the aperture size of the lens of the image acquisition device is smaller than an aperture size threshold.
[0159] The aperture size threshold is a preset value that can be set according to the lighting conditions of the shooting scene and the quality requirements of bright-field images.
[0160] In this embodiment, the aperture size of the lens of the image acquisition device is smaller than the aperture size threshold, which can improve the sharpness of the bright field image.
[0161] In some embodiments, such as Figure 3 As shown, this application embodiment also provides an electronic device 300, including a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301. When the program is executed by the processor 301, it implements the various processes of the above-described foreign object detection method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0162] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0163] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described foreign object detection method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0164] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0165] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described foreign object detection method.
[0166] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0167] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described foreign object detection method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0168] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0169] It should be noted that, in this document, 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 that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0170] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0171] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0172] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0173] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for detecting foreign objects, characterized in that, include: Acquire a bright-field image of the detection surface of the target sensor; Based on the response characteristics of the bright-field image, the background response baseline corresponding to the detection surface in the bright-field image is determined; The response features of each pixel in the bright field image are compared with the background response baseline to obtain the deviation information between each pixel and the corresponding pixel on the detection surface. Based on the aforementioned deviation information, the foreign object detection result of the target sensor is obtained.
2. The foreign object detection method according to claim 1, characterized in that, The process of obtaining the foreign object detection result of the target sensor based on each of the aforementioned deviation information includes: Based on the multiple deviation information, a first deviation threshold is obtained; Each of the aforementioned deviation information is compared with the first deviation threshold to obtain the foreign object detection result.
3. The foreign object detection method according to claim 2, characterized in that, The process of obtaining a first deviation threshold based on multiple deviation information includes: The first deviation threshold is obtained based on the statistical characteristics of the differences among the multiple deviation information.
4. The foreign object detection method according to claim 2, characterized in that, The step of comparing each of the deviation information with the first deviation threshold to obtain the foreign object detection result includes: Pixels whose deviation information is greater than the first deviation threshold are identified as candidate foreign object pixels; Based on the candidate foreign object pixels, the foreign object detection result is determined.
5. The foreign object detection method according to claim 4, characterized in that, Determining the foreign object detection result based on the candidate foreign object pixels includes: Based on the candidate foreign object pixels, a first foreign object region in the bright field image is determined; The two first foreign object regions with a distance less than the first distance threshold are merged to obtain the second foreign object region; Remove the second foreign object region whose size is smaller than the foreign object size threshold; Based on the information corresponding to the retained second foreign object region, the foreign object detection result is determined.
6. The foreign object detection method according to any one of claims 1-5, characterized in that, Determining the background response baseline corresponding to the detection surface in the bright-field image based on the response features of the bright-field image includes: The response features of the bright-field image are smoothed or fitted to obtain the background response baseline.
7. A foreign object detection device, characterized in that, include: The acquisition module is used to acquire bright-field images of the detection surface of the target sensor; The first processing module is used to determine the background response baseline corresponding to the detection surface in the bright field image based on the response characteristics of the bright field image; The second processing module is used to compare the response features of each pixel in the bright field image with the background response baseline to obtain the deviation information between each pixel and the corresponding pixel on the detection surface. The third processing module is used to obtain the foreign object detection result of the target sensor based on each of the deviation information.
8. A foreign object detection system, characterized in that, include: Image acquisition equipment used to acquire bright-field images of the detection surface of a target sensor; The foreign object detection device as described in claim 7 is connected to the image acquisition device.
9. The foreign object detection system according to claim 8, characterized in that, The aperture size of the lens of the image acquisition device is smaller than the aperture size threshold.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the foreign object detection method as described in any one of claims 1-6.