WO2022082904A1 - 镜头脏污检测方法、装置和设备 - Google Patents

镜头脏污检测方法、装置和设备 Download PDF

Info

Publication number
WO2022082904A1
WO2022082904A1 PCT/CN2020/128608 CN2020128608W WO2022082904A1 WO 2022082904 A1 WO2022082904 A1 WO 2022082904A1 CN 2020128608 W CN2020128608 W CN 2020128608W WO 2022082904 A1 WO2022082904 A1 WO 2022082904A1
Authority
WO
WIPO (PCT)
Prior art keywords
detection
lens
contamination
total
area
Prior art date
Application number
PCT/CN2020/128608
Other languages
English (en)
French (fr)
Inventor
罗涛
Original Assignee
诚瑞光学(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 诚瑞光学(深圳)有限公司 filed Critical 诚瑞光学(深圳)有限公司
Publication of WO2022082904A1 publication Critical patent/WO2022082904A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Definitions

  • the present invention relates to the technical field of lens detection, and in particular, to a method, device and equipment for lens contamination detection.
  • a mobile phone lens consists of a lens, which is an optical device used to form an image on a film. In the process of lens production and lens assembly, there will be defects such as dust and dirt on the lens due to direct or indirect contact.
  • the traditional lens contamination detection method mainly relies on manual identification under a high-power microscope, with a large workload and subjective awareness, which affects the reliability of product detection.
  • a lens contamination detection method comprising: acquiring a lens image captured by a lens to be detected; dividing the lens image to obtain detection areas, and extracting grayscale data of each detection area; Grayscale data, respectively perform contamination detection on each of the detection areas;
  • the step of dividing the lens image to obtain the detection area includes: acquiring the coordinates of the center point obtained by measuring the lens image; and performing image division on the lens image according to the coordinates of the center point and a preset radius value, Obtain a first detection sub-region including the center point, a second detection sub-region surrounding the first detection sub-region, and a total detection region including the first detection sub-region and the second detection sub-region;
  • the performing contamination detection on each of the detection areas according to the grayscale data of each of the detection areas includes: passing a dynamic threshold according to the grayscale data of the first detection area and the second detection area, respectively. Detecting whether the first detection subregion and the second detection subregion are dirty, and obtaining the dirt detection results of the first detection subregion and the second detection subregion; according to the grayscale data of the total detection region, Divide the total detection area to obtain undetermined dirt particles; analyze the undetermined dirt particles to obtain a dirt detection result of the total detection area.
  • the lens image captured by the lens to be detected is obtained, and the image is divided into two partitions and a total area in combination with the coordinates of the center point of the lens image, which is convenient for subsequent partition detection combined with the gray values of different areas. And comprehensive detection is performed according to the gray value of the total detection area.
  • the detection data of the partition and the detection data of the total area are aggregated as the overall detection result of the lens to be detected.
  • the step of segmenting the total detection area to obtain undetermined dirty particles according to the grayscale data of the total detection area includes: calculating the total detection area according to the grayscale data of the total detection area The gray average value and variance of the area; the reference threshold is determined according to the gray average value and variance of the total detection area; the global threshold segmentation is performed according to the reference threshold to obtain undetermined dirty particles.
  • the analyzing the undetermined dirt particles to obtain a dirt detection result in the total detection area includes: performing a closed operation on the undetermined dirt particles to determine aggregated dirt , to obtain the contamination detection result of the total detection area.
  • the analyzing the undetermined dirt particles to obtain the dirt detection result of the total detection area includes: sequentially taking each undetermined dirt particle as the center, analyzing the undetermined dirt particles within a set range. The number or area of dirt particles is analyzed to obtain the dirt detection result of the total detection area.
  • the analyzing the undetermined fouling particles to obtain the fouling detection result of the total detection area includes: analyzing the size or area of the undetermined fouling particles to obtain the Contamination detection results for the total detection area.
  • the step of displaying a contamination detection result is further included.
  • a lens contamination detection device comprising: an image acquisition module for acquiring a lens image captured by a lens to be detected; a data processing module for acquiring the coordinates of a center point obtained by measuring the lens image; The lens image is divided by the coordinates and the preset radius value to obtain a first detection subregion including a center point, a second detection subregion surrounding the first detection subregion, and a second detection subregion including the first detection subregion and the first detection subregion.
  • the total detection area of the two detection zones; the contamination detection module is configured to detect the first detection zone and the second detection zone through a dynamic threshold according to the grayscale data of the first detection zone and the second detection zone, respectively.
  • the above-mentioned lens contamination detection device combined with the coordinates of the center point of the lens image, divides the image into two sub-regions and a total region, which facilitates subsequent sub-regional detection combined with the gray values of different regions, and the gray value of the total detection region.
  • Comprehensive inspection By performing corresponding contamination detection on both the partition and the total detection area including the partition, the detection data of the partition and the detection data of the total area are aggregated as the overall detection result of the lens to be detected.
  • By detecting whether the lens is dirty by image partition automatic detection of lens contamination is realized, detection errors caused by manual identification are avoided, and the detection is more comprehensive, which can improve the reliability of lens contamination detection.
  • the contamination detection module calculates the grayscale average value and variance of the total detection area according to the grayscale data; determines a reference threshold value according to the grayscale average value and variance of the total detection area; performs a global threshold value according to the reference threshold value Divide to obtain pending dirt particles.
  • a lens contamination detection device comprising a camera and a product fixture, the product fixture is used to place the lens to be detected, the camera is used to capture the lens image obtained by the lens to be detected, and the lens contamination is detected according to the above method. contamination detection.
  • the above-mentioned lens contamination detection device combined with the coordinates of the center point of the lens image, divides the image into two partitions and a total area, which is convenient for subsequent partition detection combined with the grayscale values of different areas, and according to the grayscale value of the total detection area.
  • Comprehensive inspection By performing corresponding contamination detection on both the partition and the total detection area including the partition, the detection data of the partition and the detection data of the total area are aggregated as the overall detection result of the lens to be detected.
  • By detecting whether the lens is dirty by image partition automatic detection of lens contamination is realized, detection errors caused by manual identification are avoided, and the detection is more comprehensive, which can improve the reliability of lens contamination detection.
  • the lens contamination detection device further includes a light source, and the light source is used to provide background light for the lens to be detected.
  • FIG. 1 is a flowchart of a lens contamination detection method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of dividing a lens image to obtain a detection area according to an embodiment of the present invention
  • FIG. 3 is a flowchart of performing contamination detection on each detection area according to the grayscale data of each detection area according to an embodiment of the present invention
  • FIG. 4 is a structural block diagram of a lens contamination detection device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a lens contamination detection device according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a lens detection area according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of contamination detection of a lens contamination detection device according to an embodiment of the present invention.
  • a lens contamination detection method is provided, which is suitable for contamination detection of lenses of electronic products such as mobile phones and computers. As shown in Figure 1, the method includes:
  • Step S110 Acquire a lens image captured by the lens to be detected.
  • the lens image can be obtained by shooting the lens to be detected by the camera.
  • the lens to be inspected can be placed on the product fixture, and the light source can be used to provide background light so that the dirt on the lens to be inspected has a better contrast with the background, the camera can be fixed on the bracket and the structural parts can be adjusted so that the camera can Center the captured image of the lens, and then adjust the camera so that the camera can capture a clear image.
  • the camera's main control board can obtain the lens image and perform subsequent image contamination detection, or the camera can send the lens image to an external controller, and the external controller can send the lens image to the external controller. Perform subsequent image analysis detection.
  • the following explanations are given by taking the image contamination detection performed by the main control board inside the camera as an example.
  • Step S120 Divide the lens image to obtain detection regions, and extract grayscale data of each detection region.
  • the lens image may be divided according to a preset dividing line, or the lens image may be divided according to different radii of the lens. Considering that the thickness of the lens gradually changes from the geometric center to the edge, and the thickness of the same radius is the same, the color depth of different radius areas on the lens image will be different.
  • the center coordinate of the lens image is used as the reference point, the lens image is divided according to the set radius size, different detection areas are obtained, and the grayscale data of the detection area is obtained through image analysis. Dividing the lens image according to the radius size can well distinguish the parts with obvious color difference, which is convenient for image analysis combined with grayscale data.
  • step S120 the lens image is divided to obtain a detection area, including steps S122 and S124 .
  • Step S122 Obtain the coordinates of the center point obtained by measuring the lens image.
  • the main control board can perform image analysis on the lens image, extract the lens outline in the image, and calculate the center point coordinates of the lens, or the center point position of the lens can be measured by an external device and then transmitted to the main control board.
  • the coordinates of the center point of the entire detection area in the image are obtained by measuring with a caliper.
  • the lens image can be displayed on the display screen
  • the tester uses a caliper to measure the displayed image, calculates the position of the center point of the lens in the image, and then selects the image by clicking on the touch screen or moving the display cursor with the keys
  • the center point of the lens in the image the main control board determines the coordinates of the center point in the image according to the tester's operation.
  • Step S124 Divide the lens image according to the coordinates of the center point and the preset radius value to obtain a first detection subregion including the center point, a second detection subregion surrounding the first detection subregion, and a first detection subregion and a second detection subregion. The total detection area of the partition.
  • the radius size of different areas of the lens can be preset, and the first detection zone, the first detection zone and the first detection zone can be obtained by dividing according to the obtained center point coordinates and the fixed radius size. Two detection zone and total detection area.
  • the first detection subregion includes the center point of the lens
  • the second detection subregion surrounds the first detection subregion
  • the first detection subregion and the second detection subregion constitute a total detection region.
  • the image is divided into two sub-regions and a total region, which facilitates subsequent sub-regional detection combined with the gray values of different regions, and comprehensive detection based on the gray values of the total detection region.
  • the image may also be divided into more detection areas according to the coordinates of the center point for detection respectively.
  • Step S130 Perform contamination detection on each detection area respectively according to the grayscale data of each detection area.
  • the main control board can analyze whether the pixels in the detection area are different according to the grayscale data of each detection area, and compare the data such as the number of pixel points with differences and the degree of aggregation with the pre-saved judgment parameters to determine whether there is a difference. Analyze each detection area for contamination. Judgment parameters can be learned through sample training. Specifically, by keeping the distance between the camera and the sample and the shooting parameters of the camera unchanged, the camera is used to detect images obtained by shooting different types of dirty samples. Adjust the judgment parameters according to the situation to improve the accuracy of the detection results. In addition, new samples with contamination and samples without contamination can be added for verification.
  • parameters with an accuracy rate that meets the requirements are selected as the final applied parameters.
  • Judgment parameters In the actual detection process, keeping the position of the camera and the shooting parameters unchanged can ensure that the lens to be tested can be accurately and reliably detected by the saved judgment parameters.
  • step S130 includes step S132 , step S134 and step S136 .
  • Step S132 According to the grayscale data of the first detection subregion and the second detection subregion, detect whether there is contamination in the first detection subregion and the second detection subregion through a dynamic threshold, and obtain the contamination in the first detection subregion and the second detection subregion. Test results.
  • the dynamic threshold is based on the local threshold, and the entire detection area is divided into local areas, and each pixel in the local area is compared with the surrounding pixels to determine whether the point is dirty.
  • the main control board divides the first detection zone into a plurality of local areas, it compares the gray value of each pixel in the local area with the gray value of the surrounding pixels, which can be calculated by calculating the average value of the surrounding pixels.
  • the gray value is used as the local threshold, and then the gray value of the pixel is compared with the local threshold. If the difference between the gray value of the pixel and the local threshold exceeds the set threshold, it can be considered that the pixel may be dirty.
  • the contamination information of the first detection subarea can be obtained by combining the contamination pixel points determined in all local areas in the first detection subarea.
  • the ratio of the image size to the actual size can be pre-determined and saved, and the dirty pixel in the image can be obtained according to the number of pixels identified as dirty and the size of each pixel in the image.
  • the actual contamination area of the lens to be detected is calculated based on the saved ratio value.
  • the main control board detects whether there is dirt in the second detection subregion through the dynamic threshold value according to the grayscale data of the second detection subregion is similar to that of the first detection subregion, which will not be repeated here.
  • Step S134 According to the grayscale data of the total detection area, segment the total detection area to obtain undetermined dirty particles.
  • the main control board can calculate the benchmark comparison data according to the grayscale data of the total detection area, compare the grayscale value of each pixel in the total detection area with the benchmark comparison data, and extract the pixels that meet the requirements as possible dirty spots , that is, pending dirt particles.
  • Step S136 Analyze the to-be-determined dirt particles to obtain a dirt detection result in the total detection area.
  • the main control board After dividing and extracting the undetermined dirty particles, the main control board further analyzes each undetermined dirty particle to determine whether it is dirty, and obtains the dirty detection result of the total detection area. Similarly, if there is contamination in the total detection area, the main control board can also count the contamination information such as the location and area of the contamination, so that the tester can check it.
  • the detection data of the sub-area and the detection data of the total area are aggregated as the overall detection result of the lens to be inspected, so that the detection is more comprehensive and improved. Reliability of lens contamination detection.
  • the method may further include a step of displaying the contamination detection result.
  • the contamination detection result can be saved in the memory card, the contamination detection result can also be displayed on the display screen of the camera, or the contamination detection result can be sent by wired or wireless means. It can be displayed on the display screen of the mobile terminal so that the tester can view it.
  • the method of displaying the contamination detection results is not unique. It can be to display information such as the location and area of the contamination spots in different detection areas on the display screen; it can also be to circle the contamination spots on the captured lens image, and at the same time remarks Position coordinates, area and other information, and the image with the marked information will be displayed on the display screen.
  • the above lens contamination detection method combined with the coordinates of the center point of the lens image, divides the image into two partitions and a total area, which is convenient for subsequent partition detection combined with the gray values of different areas, and the gray value of the total detection area.
  • Comprehensive inspection By performing corresponding contamination detection on both the partition and the total detection area including the partition, the detection data of the partition and the detection data of the total area are aggregated as the overall detection result of the lens to be detected. Detect whether the lens is dirty by image partition, realize automatic detection of lens contamination, accurately identify dirt, improve the stability of lens contamination detection, and detect more comprehensively, avoid detection errors caused by manual identification, and improve lens contamination. reliability of contamination detection.
  • step S134 includes: calculating the grayscale average value and variance of the total detection area according to the grayscale data of the total detection area; determining a reference threshold according to the grayscale average value and variance of the total detection area; Threshold segmentation to get undetermined dirty particles.
  • the main control board calculates the gray average value and variance of the entire area according to the gray value of each pixel in the total detection area, and then adjusts the gray average value in combination with the variance to determine the reference threshold, and then calculates the total gray value and variance.
  • the gray value of each pixel in the detection area is compared with the reference threshold, and the pixels whose gray value is greater than the reference threshold are segmented as undetermined dirt particles.
  • step S136 includes: the to-be-determined dirt particles are judged on aggregated dirt through a closed operation to obtain a dirt detection result in the total detection area. .
  • the principle of closing operation is to expand and then corrode, and then perform the expansion operation on the detected points, and then perform the corrosion.
  • the main control board After the main control board performs expansion and corrosion operations on the undetermined dirt particles, it compares the area and longest dimension of the treated undetermined dirty particle points with the set parameters. If the long dimension is greater than the corresponding set parameter, it can be considered that the requirements of aggregated dirt are met, and it is determined to be aggregated dirt, and the actual size and area of the aggregated dirt can be recorded for viewing.
  • step S136 includes: sequentially taking each undetermined contamination particle as the center, analyzing the number or area of the undetermined contamination particle within the set range to obtain the contamination detection result of the total detection area.
  • the main control board can take the undetermined dirt particles as the center, use the pre-saved setting value as the radius to determine the range, and compare the number or area of the undetermined dirt particles within the range with the The pre-saved setting parameters are compared. If the number or area of the undetermined dirt particles is greater than the corresponding setting parameters, it can be considered that the number or area of the undetermined dirt particles within the range where the undetermined dirt particles are located meets the characteristics of dirt. .
  • the contamination detection result of the entire total detection area is obtained by separately detecting the range of each undetermined contamination particle to determine whether the contamination characteristic is satisfied.
  • step S136 includes: analyzing the size or area of the dirt particles to be determined to obtain a dirt detection result of the total detection area.
  • the main control board compares the size or area of each undetermined dirty particle with the saved setting parameters. If the size or area of the undetermined dirty particle is larger than the corresponding set parameter, it can be considered that the undetermined dirty particle Particles meet the characteristics of soiling. By separately analyzing the size or area of each undetermined dirt particle, the dirt detection result of the entire total detection area is finally obtained.
  • step S136 may also include the above three methods for analyzing the undetermined dirt particles at the same time, using different methods to analyze the undetermined dirt particles in the total detection area, The detection data is integrated as the contamination detection result of the total detection area, and the detection is more comprehensive.
  • steps in the flowcharts of FIGS. 1-3 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIGS. 1-3 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. These sub-steps or stages are not necessarily completed at the same time. The order of execution of the steps is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of sub-steps or stages of other steps.
  • a lens contamination detection device is provided, which is suitable for contamination detection of lenses of electronic products such as mobile phones and computers.
  • the apparatus includes an image acquisition module 110 , a data processing module 120 and a contamination detection module 130 .
  • the image acquisition module 110 is used to acquire the lens image captured by the lens to be detected; the data processing module 120 is used to acquire the center point coordinates obtained by measuring the lens image; the lens image is divided into images according to the center point coordinates and the preset radius value to obtain The first detection zone including the center point, the second detection zone surrounding the first detection zone, and the total detection zone including the first detection zone and the second detection zone;
  • the grayscale data of the second detection area is used to detect whether there is contamination in the first detection area and the second detection area through a dynamic threshold, and the contamination detection results of the first detection area and the second detection area are obtained; according to the grayscale of the total detection area According to the data, the total detection area is divided to obtain undetermined dirt particles; the undetermined dirt particles are analyzed to obtain the dirt detection results of the total detection area.
  • the contamination detection module 130 is also used to display the contamination detection result. Specifically, after it is detected that there is contamination, the contamination detection result can be saved in the memory card, the contamination detection result can also be displayed on the display screen of the camera, or the contamination detection result can be sent by wired or wireless means. It can be displayed on the display screen of the mobile terminal so that the tester can view it.
  • the contamination detection module 130 calculates the grayscale average value and variance of the total detection area according to the grayscale data; determines a reference threshold value according to the grayscale average value and variance of the total detection area; performs global threshold segmentation according to the reference threshold value, Get Pending Dirt Particles.
  • the contamination detection module 130 performs the aggregated contamination judgment on the to-be-determined contamination particles through a closed operation, and obtains the contamination detection result of the total detection area.
  • the contamination detection module 130 takes each undetermined contamination particle as the center in turn, analyzes the number or area of the undetermined contamination particle within the set range, and obtains the contamination detection result of the total detection area.
  • the contamination detection module 130 analyzes the size or area of the contamination particles to be determined, and obtains the contamination detection result of the total detection area.
  • the contamination detection module 130 may also include the above three methods for analyzing the contamination particles to be determined at the same time, and use different methods to analyze the contamination particles to be determined in the total detection area.
  • the detection data of each method is integrated as the contamination detection result of the total detection area, and the detection is more comprehensive.
  • Each module in the above-mentioned lens contamination detection device may be implemented in whole or in part by software, hardware and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • the above-mentioned lens contamination detection device combined with the coordinates of the center point of the lens image, divides the image into two sub-regions and a total region, which facilitates subsequent sub-regional detection combined with the gray values of different regions, and the gray value of the total detection region.
  • Comprehensive inspection By performing corresponding contamination detection on both the partition and the total detection area including the partition, the detection data of the partition and the detection data of the total area are aggregated as the overall detection result of the lens to be detected. Detect whether the lens is dirty by image partition, realize automatic detection of lens contamination, accurately identify dirt, improve the stability of lens contamination detection, and detect more comprehensively, avoid detection errors caused by manual identification, and improve lens contamination. reliability of contamination detection.
  • a lens contamination detection device is also provided, which is suitable for contamination detection of the lenses of electronic products such as mobile phones and computers.
  • the device includes a camera and a product jig, the product jig is used to place the lens to be inspected, the camera is used to capture the lens image obtained by the lens to be inspected, and the lens contamination detection is performed according to the above method.
  • the lens contamination detection device further includes a light source, and the light source is used to provide background light for the lens to be detected.
  • the camera 210 can be fixed on the bracket, with the axis of the camera lens 220 as a reference, and the lens image can be centered and captured by adjusting the fastening screws of the structural member.
  • the product fixture 230 is used to place the lens to be inspected to ensure that the product surface can be perpendicular to the axis of the lens during inspection.
  • the camera 210 adopts CMOS (Complementary Metal Oxide Semiconductor (Complementary Metal Oxide Semiconductor) global exposure camera, guaranteeing fast and stable image acquisition. Using the camera to install the workpiece can ensure the movement space of the camera in the three dimensions of XYZ, so as to facilitate debugging and adapt to different products.
  • CMOS Complementary Metal Oxide Semiconductor
  • the camera lens 220 adopts a low-depth and high-resolution bi-telecentric lens to ensure that the dirt can be imaged clearly.
  • the light source 240 specifically adopts a ring light source with a lamp bead installation angle of 70 degrees, which illuminates the back of the lens to be detected along the axis of the lens, so as to satisfy the need for clearer contrast between dirt and background during imaging.
  • the actual contamination detection of the lens to be detected is performed.
  • the lens image captured by the lens to be tested is obtained.
  • Figure 6 shows the schematic diagram of the lens detection area. It can be seen that the gray value of different areas will be different, and the size of each area of the same product can be determined by a fixed value.
  • the center coordinates of the entire detection area are obtained by the method of caliper measurement, and divided according to the obtained center coordinates and the fixed radius size to obtain the first detection zone 1, the second detection zone 2 and the total detection zone 3,
  • the first detection area 1 is a circle with a darker center
  • the second detection area 2 is a light ring
  • the total detection area 3 is the union of the first detection area 1 and the second detection area 2.
  • a dynamic threshold method is used to detect whether there is contamination.
  • the dynamic threshold is a segmentation method to distinguish the fixed threshold. Based on the local threshold, the entire detection area is divided into local areas, and each pixel in the local area is compared with the surrounding pixels to determine whether the point is dirty or not. Sewage.
  • the particles that may be dirty can be segmented by the global threshold segmentation method.
  • the method of judging the particles that may be dirty use the closed operation to judge the contamination of aggregation; take the particles to be detected as the center in turn, and judge whether the number or area within a certain range meets the characteristics of dirt; The area judges whether it satisfies the characteristics of dirt.
  • the global threshold segmentation adopts a fixed threshold, and the points in the detection area are compared with the threshold to determine whether they are dirty.
  • the principle of the closing operation is to dilate and then corrode, and then perform the dilation operation on the detected points before corroding. If the point after the closing operation satisfies the requirements of aggregated contamination in terms of area and longest dimension, it is determined to be aggregated contamination.
  • the above-mentioned lens contamination detection device combined with the coordinates of the center point of the lens image, divides the image into two partitions and a total area, which is convenient for subsequent partition detection combined with the grayscale values of different areas, and according to the grayscale value of the total detection area.
  • Comprehensive inspection By performing corresponding contamination detection on both the partition and the total detection area including the partition, the detection data of the partition and the detection data of the total area are aggregated as the overall detection result of the lens to be detected. Detect whether the lens is dirty by image partition, realize automatic detection of lens contamination, accurately identify dirt, improve the stability of lens contamination detection, and detect more comprehensively, avoid detection errors caused by manual identification, and improve lens contamination. reliability of contamination detection.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

本发明涉及一种镜头脏污检测方法、装置和设备,该方法包括:获取对待检测镜头拍摄得到的镜头图像;结合镜头图像的中心点坐标,将图像划分成两个分区和一个总区域,结合不同区域的灰度值进行分区检测,以及根据总检测区域的灰度值进行综合检测。通过对分区和包含分区的总检测区域均进行相应的脏污检测,将分区检测数据和总区域的检测数据汇总,作为待检测镜头的整体检测结果。通过图像分区检测镜头是否存在脏污,实现对镜头脏污的自动检测,避免人工识别导致的检测误差,且检测更加全面,能够提高镜头脏污检测的可靠性。

Description

镜头脏污检测方法、装置和设备 技术领域
本发明涉及镜头检测技术领域,特别是涉及一种镜头脏污检测方法、装置和设备。
背景技术
随着科技的发展和社会的不断进步,手机在人们日常工作和生活中的使用越来越普遍,带有镜头的手机还可满足用户的拍照和摄影需求。手机镜头由透镜组成,是用于在底片上形成影像的光学装置。在镜片生产和镜头组装的过程中,会因为直接或者间接的接触导致镜头上面存在落尘,脏污等缺陷。
传统的镜头脏污检测方法,主要依赖于人工在高倍显微镜下识别,工作量大且带有主观意识,影响产品检测的可靠性。
技术问题 技术解决方案 有益效果
基于此,有必要克服现有技术的缺陷,提供一种镜头脏污检测方法、装置和设备,能够提高镜头脏污检测的可靠性。
一种镜头脏污检测方法,包括:获取对待检测镜头拍摄得到的镜头图像;对所述镜头图像进行划分得到检测区域,并提取各所述检测区域的灰度数据;根据各所述检测区域的灰度数据,分别对各所述检测区域进行脏污检测;
其中,所述对所述镜头图像进行划分得到检测区域,包括:获取对所述镜头图像测量得到的中心点坐标;根据所述中心点坐标和预设半径值对所述镜头图像进行图像划分,得到包含中心点的第一检测分区,围绕所述第一检测分区的第二检测分区,以及包含所述第一检测分区和所述第二检测分区的总检测区域;
所述根据各所述检测区域的灰度数据,分别对各所述检测区域进行脏污检测,包括:分别根据所述第一检测分区和所述第二检测分区的灰度数据,通过动态阈值检测所述第一检测分区和所述第二检测分区是否存在脏污,得到所述第一检测分区和所述第二检测分区的脏污检测结果;根据所述总检测区域的灰度数据,对所述总检测区域分割得到待定脏污颗粒;对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果。
上述镜头脏污检测方法,获取对待检测镜头拍摄得到的镜头图像,结合镜头图像的中心点坐标,将图像划分成两个分区和一个总区域,方便后续结合不同区域的灰度值进行分区检测,以及根据总检测区域的灰度值进行综合检测。通过对分区和包含分区的总检测区域均进行相应的脏污检测,将分区检测数据和总区域的检测数据汇总,作为待检测镜头的整体检测结果。通过图像分区检测镜头是否存在脏污,实现对镜头脏污的自动检测,避免人工识别导致的检测误差,且检测更加全面,能够提高镜头脏污检测的可靠性。
在其中一个实施例中,所述根据所述总检测区域的灰度数据,对所述总检测区域分割得到待定脏污颗粒,包括:根据所述总检测区域的灰度数据计算所述总检测区域的灰度平均值和方差;根据所述总检测区域的灰度平均值和方差确定基准阈值;根据所述基准阈值进行全局阈值分割,得到待定脏污颗粒。
在其中一个实施例中,所述对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果,包括:对所述待定脏污颗粒,通过闭运算进行聚集性脏污判断,得到所述总检测区域的脏污检测结果。
在其中一个实施例中,所述对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果,包括:依次以各待定脏污颗粒为中心,对设定范围内的待定脏污颗粒的数量或面积进行分析,得到所述总检测区域的脏污检测结果。
在其中一个实施例中,所述对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果,包括:对所述待定脏污颗粒的尺寸或面积进行分析,得到所述总检测区域的脏污检测结果。
在其中一个实施例中,所述根据各所述检测区域的灰度数据,分别对各所述检测区域进行脏污检测之后,还包括显示脏污检测结果的步骤。
一种镜头脏污检测装置,包括:图像获取模块,用于获取对待检测镜头拍摄得到的镜头图像;数据处理模块,用于获取对所述镜头图像测量得到的中心点坐标;根据所述中心点坐标和预设半径值对所述镜头图像进行图像划分,得到包含中心点的第一检测分区,围绕所述第一检测分区的第二检测分区,以及包含所述第一检测分区和所述第二检测分区的总检测区域;脏污检测模块,用于分别根据所述第一检测分区和所述第二检测分区的灰度数据,通过动态阈值检测所述第一检测分区和所述第二检测分区是否存在脏污,得到所述第一检测分区和所述第二检测分区的脏污检测结果;根据所述总检测区域的灰度数据,对所述总检测区域分割得到待定脏污颗粒;对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果。
上述镜头脏污检测装置,结合镜头图像的中心点坐标,将图像划分成两个分区和一个总区域,方便后续结合不同区域的灰度值进行分区检测,以及根据总检测区域的灰度值进行综合检测。通过对分区和包含分区的总检测区域均进行相应的脏污检测,将分区检测数据和总区域的检测数据汇总,作为待检测镜头的整体检测结果。通过图像分区检测镜头是否存在脏污,实现对镜头脏污的自动检测,避免人工识别导致的检测误差,且检测更加全面,能够提高镜头脏污检测的可靠性。
在其中一个实施例中,所述脏污检测模块根据灰度数据计算总检测区域的灰度平均值和方差;根据总检测区域的灰度平均值和方差确定基准阈值;根据基准阈值进行全局阈值分割,得到待定脏污颗粒。
一种镜头脏污检测设备,包括相机和产品治具,所述产品治具用于放置待检测镜头,所述相机用于对待检测镜头进行拍摄得到的镜头图像,并根据上述的方法进行镜头脏污检测。
上述镜头脏污检测设备,结合镜头图像的中心点坐标,将图像划分成两个分区和一个总区域,方便后续结合不同区域的灰度值进行分区检测,以及根据总检测区域的灰度值进行综合检测。通过对分区和包含分区的总检测区域均进行相应的脏污检测,将分区检测数据和总区域的检测数据汇总,作为待检测镜头的整体检测结果。通过图像分区检测镜头是否存在脏污,实现对镜头脏污的自动检测,避免人工识别导致的检测误差,且检测更加全面,能够提高镜头脏污检测的可靠性。
在其中一个实施例中,镜头脏污检测设备还包括光源,所述光源用于为所述待检测镜头提供背景光。
附图说明
构成本申请的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明一实施例的镜头脏污检测方法的流程图;
图2为本发明一实施例的对镜头图像进行划分得到检测区域的流程图;
图3为本发明一实施例的根据各检测区域的灰度数据,分别对各检测区域进行脏污检测的流程图;
图4为本发明一实施例的镜头脏污检测装置的结构框图;
图5为本发明一实施例的镜头脏污检测设备的结构示意图;
图6为本发明一实施例的镜头检测区域示意图;
图7为本发明一实施例的镜头脏污检测设备的脏污检测流程图。
210、相机;220、相机镜头;230、产品治具;240、光源。
本发明的实施方式
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图对本发明的具体实施方式做详细的说明。在下面的描述中阐述了很多具体细节以便于充分理解本发明。但是本发明能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本发明内涵的情况下做类似改进,因此本发明不受下面公开的具体实施例的限制。
在一个实施例中,提供了一种镜头脏污检测方法,适用于对手机、电脑等电子产品的镜头进行脏污检测。如图1所示,该方法包括:
步骤S110:获取对待检测镜头拍摄得到的镜头图像。
其中,可通过相机对待检测镜头进行拍摄得到镜头图像。具体地,可将待检测镜头放在产品治具上,并利用光源提供背景光让待检测镜头上的脏污与背景有较好的对比度,将相机固定在支架上并调节结构件使得相机可以居中采集镜头的图像,然后对相机进行调节使得相机可采集得到清晰的图像。
利用相机拍摄得到待检测镜头的清晰图像后,可以是由相机的主控板获取镜头图像并进行后续的图像脏污检测,也可以是通过相机将镜头图像发送至外部控制器,由外部控制器进行后续的图像分析检测。为便于理解,以下均以相机内部的主控板进行图像脏污检测为例进行解释说明。
步骤S120:对镜头图像进行划分得到检测区域,并提取各检测区域的灰度数据。
主控板得到对待检测镜头拍摄的镜头图像后,可以是按照预设分割线对镜头图像进行分割,也可以按照镜头的不同半径对镜头图像进行分割。考虑到镜头从几何中心到边缘厚度逐步变化,且同一半径上的厚度一致的形状特点,镜头图像上不同半径区域的颜色深浅会有不同。本实施例中,以镜头图像的中心坐标为基准点,根据设定的半径尺寸对镜头图像进行划分,得到不同的检测区域,并通过图像分析得到检测区域的灰度数据。根据半径尺寸对镜头图像进行划分,可以很好的将颜色区别明显的部分区分开来,方便结合灰度数据进行图像分析。
在一个实施例中,如图2所示,步骤S120中对镜头图像进行划分得到检测区域,包括步骤S122和步骤S124。
步骤S122:获取对镜头图像测量得到的中心点坐标。具体地,可以是通过主控板对镜头图像进行图像分析,提取图像中的镜头轮廓并计算出镜头的中心点坐标,也可以是通过外部器件测量得到镜头的中心点位置后传输给主控板。本实施例中,通过卡尺测量得到图像中整个检测区域的中心点坐标。例如,可以是将镜头图像在显示屏上显示,测试人员利用卡尺对显示的图像进行测量,计算图像中镜头的中心点位置,然后通过点击触控显示屏或利用按键移动显示光标的方式选中图像中的镜头中心点,主控板根据测试人员的操作确定图像中的中心点坐标。
步骤S124:根据中心点坐标和预设半径值对镜头图像进行图像划分,得到包含中心点的第一检测分区,围绕第一检测分区的第二检测分区,以及包含第一检测分区和第二检测分区的总检测区域。
由于镜头不同半径区域拍摄得到的图像灰度值会有区别,可预先设定镜头不同区域的半径尺寸,根据得到的中心点坐标和固定的半径尺寸来划分,便可得到第一检测分区、第二检测分区和总检测区域。其中,第一检测分区包含镜头的中心点,第二检测分区围绕第一检测分区,第一检测分区和第二检测分区构成总检测区域。
本实施例中,结合镜头图像的中心点坐标,将图像划分成两个分区和一个总区域,方便后续结合不同区域的灰度值进行分区检测,以及根据总检测区域的灰度值进行综合检测。可以理解,在其他实施例中,也可以是根据中心点坐标将图像划分出更多的检测区域分别进行检测。
步骤S130:根据各检测区域的灰度数据,分别对各检测区域进行脏污检测。
其中,主控板可以是根据各检测区域的灰度数据,分析检测区域中的像素点是否存在差异,结合存在差异的像素点的数量和聚集程度等数据与预先保存的判断参数进行对比,来分析各检测区域中是否存在脏污。判断参数可通过样品训练学习得到,具体地,通过保持相机与样品的距离,以及相机的拍摄参数不变,利用相机对不同类型的脏污样品拍摄得到图像进行检测,根据检测结果与脏污实际情况进行判断参数调整,改善检测结果的准确性。此外,还可加入新的带有脏污的样品和未带脏污的样品进行验证,通过多次迭代调整,选择出准确率符合要求(如准确率在98%以上)的参数作为最后应用的判断参数。在实际检测过程中,保持相机的位置与拍摄参数不变,则可确保能通过保存的判断参数对待检测镜头进行准确可靠的脏污检测。
在一个实施例中,如图3所示,步骤S130包括步骤S132、步骤S134和步骤S136。
步骤S132:分别根据第一检测分区和第二检测分区的灰度数据,通过动态阈值检测第一检测分区和第二检测分区是否存在脏污,得到第一检测分区和第二检测分区的脏污检测结果。
其中,动态阈值基于局部阈值,在整个检测区域划分一个一个局部区域,在局部区域每个像素点与周边像素点进行比较,从而确定该点是否属于脏污。具体地,主控板将第一检测分区划分为多个局部区域后,将局部区域中每个像素点的灰度值与周边像素点的灰度值进行比较,可以是计算周边像素点的平均灰度值作为局部阈值,然后将该像素点的灰度值与局部阈值比较,如果像素点的灰度值与局部阈值的差值超过设定阈值,则可认为该像素点可能属于脏污。
在确定存在脏污后,结合第一检测分区中所有局部区域确定的脏污像素点,便可得到第一检测分区的脏污信息,如脏污位置、面积等。其中,在计算脏污面积时,可以是预先确定图像尺寸与实物尺寸的比例值进行保存,在根据图像中认定为脏污的像素点的数量以及每个像素点的尺寸,得到图像中的脏污面积后,再结合保存的比例值推算出待检测镜头的实际脏污面积。此外,也可以是通过对相机进行聚焦调节使得图像尺寸与实物尺寸相同,这样可直接将计算得到的图像脏污面积作为待检测镜头的实际脏污面积。
可以理解,主控板根据第二检测分区的灰度数据,通过动态阈值检测第二检测分区是否存在脏污的方式与第一检测分区类似,在此不再赘述。
步骤S134:根据总检测区域的灰度数据,对总检测区域分割得到待定脏污颗粒。其中,主控板可根据总检测区域的灰度数据计算得到基准比较数据,将总检测区域中各像素点的灰度值与基准比较数据进行对比,提取符合要求的像素点作为可能的脏污点,即待定脏污颗粒。
步骤S136:对待定脏污颗粒进行分析,得到总检测区域的脏污检测结果。
主控板在分割提取得到待定脏污颗粒后,对每个待定脏污颗粒进行进一步分析判断是否属于脏污,得到总检测区域的脏污检测结果。同样的,如果总检测区域存在脏污,主控板也可以统计脏污位置、面积等脏污信息,以便测试人员查看。
本实施例中,通过对分区和包含分区的总检测区域均进行相应的脏污检测,将分区检测数据和总区域的检测数据汇总,作为待检测镜头的整体检测结果,检测更加全面,提高了对镜头进行脏污检测的可靠性。
此外,步骤S130之后,该方法还可包括显示脏污检测结果的步骤。具体地,在检测到存在脏污后,可以是将脏污检测结果保存在存储卡中,还可将脏污检测结果通过相机的显示屏显示,或者通过有线或无线方式将脏污检测结果发送至移动终端的显示屏进行显示,以便测试人员查看。其中,显示脏污检测结果的方式并不是唯一的,可以是在显示屏显示不同检测区域的脏污点位置、面积等信息;也可以是在拍摄得到的镜头图像上圈中脏污点,同时备注上位置坐标、面积等信息,将标注信息后的图像在显示屏进行显示。
上述镜头脏污检测方法,结合镜头图像的中心点坐标,将图像划分成两个分区和一个总区域,方便后续结合不同区域的灰度值进行分区检测,以及根据总检测区域的灰度值进行综合检测。通过对分区和包含分区的总检测区域均进行相应的脏污检测,将分区检测数据和总区域的检测数据汇总,作为待检测镜头的整体检测结果。通过图像分区检测镜头是否存在脏污,实现对镜头脏污的自动检测,准确识别脏污,提高镜头脏污检测的稳定性,且检测更加全面,避免人工识别导致的检测误差,能够提高镜头脏污检测的可靠性。
在一个实施例中,步骤S134包括:根据总检测区域的灰度数据计算总检测区域的灰度平均值和方差;根据总检测区域的灰度平均值和方差确定基准阈值;根据基准阈值进行全局阈值分割,得到待定脏污颗粒。具体地,主控板根据总检测区域中每个像素点的灰度值,计算得到整个区域的灰度平均值和方差之后,可以结合方差对灰度平均值进行调整确定基准阈值,然后将总检测区域中每个像素点的灰度值与基准阈值进行比较,分割出灰度值大于基准阈值的像素点作为待定脏污颗粒。
对待定脏污颗粒进行分析的具体方式并不是唯一的,在一个实施例中,步骤S136包括:对待定脏污颗粒,通过闭运算进行聚集性脏污判断,得到总检测区域的脏污检测结果。
其中,闭运算原理是先膨胀后腐蚀,对检测到的点进行膨胀操作之后,再进行腐蚀。主控板对待定脏污颗粒进行膨胀和腐蚀操作之后,将处理后的待定脏污颗粒点的面积和最长尺寸与设定参数进行比较,若处理后的待定脏污颗粒点的面积和最长尺寸大于对应的设定参数,则可认为满足聚集性脏污的要求,判定是聚集性脏污,可记录聚集性脏污的实际尺寸和面积以供查看。
在一个实施例中,步骤S136包括:依次以各待定脏污颗粒为中心,对设定范围内的待定脏污颗粒的数量或面积进行分析,得到总检测区域的脏污检测结果。
其中,设定范围的具体设置方式并不唯一,主控板可以待定脏污颗粒为中心,以预先保存的设定值作为半径确定范围,将范围内的待定脏污颗粒的数量或面积,与预先保存的设定参数进行比较,若待定脏污颗粒的数量或面积大于对应的设定参数,则可认为该待定脏污颗粒所在范围内的待定脏污颗粒的数量或面积满足脏污的特征。通过分别对各个待定脏污颗粒所在范围进行检测判断是否满足脏污特征,得到整个总检测区域的脏污检测结果。
在一个实施例中,步骤S136包括:对待定脏污颗粒的尺寸或面积进行分析,得到总检测区域的脏污检测结果。
具体地,主控板将每个待定脏污颗粒的尺寸或面积,与保存的设定参数进行对比,如果待定脏污颗粒的尺寸或面积大于对应的设定参数,则可认为该待定脏污颗粒满足脏污的特征。通过分别对各个待定脏污颗粒的尺寸或面积进行分析,最后得到整个总检测区域的脏污检测结果。
以上即是提供了三种对待定脏污颗粒进行分析的方式,测试人员可根据实际需求选择具体的分析方式。可以理解,在一个实施例中,步骤S136也可以是同时包含以上三种对待定脏污颗粒进行分析的方式,利用不同的方式对总检测区域的待定脏污颗粒进行分析,将各种方式的检测数据进行综合作为总检测区域的脏污检测结果,检测更加全面。
应该理解的是,虽然图1-3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1-3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,提供了一种镜头脏污检测装置,适用于对手机、电脑等电子产品的镜头进行脏污检测。如图4所示,该装置包括图像获取模块110、数据处理模块120和脏污检测模块130。图像获取模块110用于获取对待检测镜头拍摄得到的镜头图像;数据处理模块120用于获取对镜头图像测量得到的中心点坐标;根据中心点坐标和预设半径值对镜头图像进行图像划分,得到包含中心点的第一检测分区,围绕第一检测分区的第二检测分区,以及包含第一检测分区和第二检测分区的总检测区域;脏污检测模块130用于分别根据第一检测分区和第二检测分区的灰度数据,通过动态阈值检测第一检测分区和第二检测分区是否存在脏污,得到第一检测分区和第二检测分区的脏污检测结果;根据总检测区域的灰度数据,对总检测区域分割得到待定脏污颗粒;对待定脏污颗粒进行分析,得到总检测区域的脏污检测结果。
此外,脏污检测模块130还用于显示脏污检测结果。具体地,在检测到存在脏污后,可以是将脏污检测结果保存在存储卡中,还可将脏污检测结果通过相机的显示屏显示,或者通过有线或无线方式将脏污检测结果发送至移动终端的显示屏进行显示,以便测试人员查看。
在一个实施例中,脏污检测模块130根据灰度数据计算总检测区域的灰度平均值和方差;根据总检测区域的灰度平均值和方差确定基准阈值;根据基准阈值进行全局阈值分割,得到待定脏污颗粒。
在一个实施例中,脏污检测模块130对待定脏污颗粒,通过闭运算进行聚集性脏污判断,得到总检测区域的脏污检测结果。
在一个实施例中,脏污检测模块130依次以各待定脏污颗粒为中心,对设定范围内的待定脏污颗粒的数量或面积进行分析,得到总检测区域的脏污检测结果。
在一个实施例中,脏污检测模块130对待定脏污颗粒的尺寸或面积进行分析,得到总检测区域的脏污检测结果。
以上即是提供了三种对待定脏污颗粒进行分析的方式,测试人员可根据实际需求选择具体的分析方式。可以理解,在一个实施例中,脏污检测模块130也可以是同时包含以上三种对待定脏污颗粒进行分析的方式,利用不同的方式对总检测区域的待定脏污颗粒进行分析,将各种方式的检测数据进行综合作为总检测区域的脏污检测结果,检测更加全面。
关于镜头脏污检测装置的具体限定可以参见上文中对于镜头脏污检测方法的限定,在此不再赘述。上述镜头脏污检测装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
上述镜头脏污检测装置,结合镜头图像的中心点坐标,将图像划分成两个分区和一个总区域,方便后续结合不同区域的灰度值进行分区检测,以及根据总检测区域的灰度值进行综合检测。通过对分区和包含分区的总检测区域均进行相应的脏污检测,将分区检测数据和总区域的检测数据汇总,作为待检测镜头的整体检测结果。通过图像分区检测镜头是否存在脏污,实现对镜头脏污的自动检测,准确识别脏污,提高镜头脏污检测的稳定性,且检测更加全面,避免人工识别导致的检测误差,能够提高镜头脏污检测的可靠性。
在一个实施例中,还提供了一种镜头脏污检测设备,适用于对手机、电脑等电子产品的镜头进行脏污检测。该设备包括相机和产品治具,产品治具用于放置待检测镜头,相机用于对待检测镜头进行拍摄得到的镜头图像,并根据上述的方法进行镜头脏污检测。在一个实施例中,镜头脏污检测设备还包括光源,光源用于为待检测镜头提供背景光。
具体地,如图5所示,可将相机210固定在支架上,以相机镜头220的轴线为基准参考,通过调节结构件的紧固螺丝使得镜头图像可以居中采集。产品治具230用于放置待检测镜头,保证产品表面在检测的时候能够与镜头轴向垂直。其中,相机210采用CMOS(Complementary Metal Oxide Semiconductor,互补金属氧化物半导体)全局曝光相机,保证既快速又稳定的获得影像。利用相机安装工件可保障相机在XYZ三个维度下的移动空间,以方便调试和适应不同的产品。相机镜头220采用低景深高分辨率的双远心镜头,保证脏污能够成像清晰。光源240具体采用灯珠安装角度为70度的环形光源,沿镜头轴向照射待检测镜头的背面,满足成像的时候脏污与背景有较清晰的对比度。
首选,准备一批各种类型的脏污样品,调整光源高度和亮度,使得所有脏污能成像清晰,与背景有较好的对比度。对脏污样品进行检测,调整相机210的主控板中算法的判断参数,改善检测结果的准确性。然后,加入新的带有脏污的样品和未带脏污的样品进行算法验证,通过多次迭代调整,选择出准确率在98%以上的判断参数作为最后应用的判断参数。
在判断参数确定之后,进行实际的待检测镜头脏污检测。获取到对待检测镜头拍摄的镜头图像,图6所示为镜头检测区域示意图,可以看到不同的区域灰度值会有区别,且同种产品各个区域的尺寸可以按固定值确定。如图7所示,通过卡尺测量的方法获得整个检测区域的中心坐标,根据得到的中心坐标和固定的半径尺寸来划分,得到第一检测分区1、第二检测分区2和总检测区域3,第一检测分区1为中心颜色较深的圆,第二检测分区2为颜色较淡的圆环,总检测区域3为第一检测分区1和第二检测分区2的并集。在划分得到不同检测区域后,对于第一检测分区1和第二检测分区2,利用动态阈值的方法检测是否存在脏污。其中,动态阈值是区分固定阈值的一种分割方法,其基于局部阈值,在整个检测区域划分一个一个局部区域,在局部区域每个像素点与周边像素点进行比较,从而确定该点是否属于脏污。
对于总检测区域3,先计算区域的灰度平均值和方差,利用灰度平均值和方差计算得到固定阈值,结合固定阈值通过全局阈值分割的方法分割出可能是脏污的颗粒,可利用不同的方法判断可能是脏污的颗粒:利用闭运算判断聚集性的脏污;依次以待检测颗粒为中心,判断一定范围内其个数或面积是否满足脏污的特征;通过单个颗粒的尺寸或面积判断是否满足脏污的特征。其中,全局阈值分割是采用一个固定的阈值,检测区域内的点与该阈值进行比较确定是否属于脏污。闭运算原理是先膨胀后腐蚀,对检测到的点进行膨胀操作之后,再进行腐蚀。如果进行闭运算操作之后的点在面积和最长尺寸上面满足聚集性脏污的要求,就判定是聚集性脏污。
上述镜头脏污检测设备,结合镜头图像的中心点坐标,将图像划分成两个分区和一个总区域,方便后续结合不同区域的灰度值进行分区检测,以及根据总检测区域的灰度值进行综合检测。通过对分区和包含分区的总检测区域均进行相应的脏污检测,将分区检测数据和总区域的检测数据汇总,作为待检测镜头的整体检测结果。通过图像分区检测镜头是否存在脏污,实现对镜头脏污的自动检测,准确识别脏污,提高镜头脏污检测的稳定性,且检测更加全面,避免人工识别导致的检测误差,能够提高镜头脏污检测的可靠性。
 
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (10)

  1. 一种镜头脏污检测方法,其特征在于,包括:
    获取对待检测镜头拍摄得到的镜头图像;
    对所述镜头图像进行划分得到检测区域,并提取各所述检测区域的灰度数据;
    根据各所述检测区域的灰度数据,分别对各所述检测区域进行脏污检测;
    其中,所述对所述镜头图像进行划分得到检测区域,包括:获取对所述镜头图像测量得到的中心点坐标;根据所述中心点坐标和预设半径值对所述镜头图像进行图像划分,得到包含中心点的第一检测分区,围绕所述第一检测分区的第二检测分区,以及包含所述第一检测分区和所述第二检测分区的总检测区域;
    所述根据各所述检测区域的灰度数据,分别对各所述检测区域进行脏污检测,包括:分别根据所述第一检测分区和所述第二检测分区的灰度数据,通过动态阈值检测所述第一检测分区和所述第二检测分区是否存在脏污,得到所述第一检测分区和所述第二检测分区的脏污检测结果;根据所述总检测区域的灰度数据,对所述总检测区域分割得到待定脏污颗粒;对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果。
  2. 根据权利要求1所述的镜头脏污检测方法,其特征在于,所述根据所述总检测区域的灰度数据,对所述总检测区域分割得到待定脏污颗粒,包括:
    根据所述总检测区域的灰度数据计算所述总检测区域的灰度平均值和方差;
    根据所述总检测区域的灰度平均值和方差确定基准阈值;
    根据所述基准阈值进行全局阈值分割,得到待定脏污颗粒。
  3. 根据权利要求1所述的镜头脏污检测方法,其特征在于,所述对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果,包括:
    对所述待定脏污颗粒,通过闭运算进行聚集性脏污判断,得到所述总检测区域的脏污检测结果。
  4. 根据权利要求1所述的镜头脏污检测方法,其特征在于,所述对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果,包括:
    依次以各待定脏污颗粒为中心,对设定范围内的待定脏污颗粒的数量或面积进行分析,得到所述总检测区域的脏污检测结果。
  5. 根据权利要求1所述的镜头脏污检测方法,其特征在于,所述对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果,包括:
    对所述待定脏污颗粒的尺寸或面积进行分析,得到所述总检测区域的脏污检测结果。
  6. 根据权利要求1所述的镜头脏污检测方法,其特征在于,所述根据各所述检测区域的灰度数据,分别对各所述检测区域进行脏污检测之后,还包括显示脏污检测结果的步骤。
  7. 一种镜头脏污检测装置,其特征在于,包括:
    图像获取模块,用于获取对待检测镜头拍摄得到的镜头图像;
    数据处理模块,用于获取对所述镜头图像测量得到的中心点坐标;根据所述中心点坐标和预设半径值对所述镜头图像进行图像划分,得到包含中心点的第一检测分区,围绕所述第一检测分区的第二检测分区,以及包含所述第一检测分区和所述第二检测分区的总检测区域;
    脏污检测模块,用于分别根据所述第一检测分区和所述第二检测分区的灰度数据,通过动态阈值检测所述第一检测分区和所述第二检测分区是否存在脏污,得到所述第一检测分区和所述第二检测分区的脏污检测结果;根据所述总检测区域的灰度数据,对所述总检测区域分割得到待定脏污颗粒;对所述待定脏污颗粒进行分析,得到所述总检测区域的脏污检测结果。
  8. 根据权利要求7所述的镜头脏污检测装置,其特征在于,所述脏污检测模块根据灰度数据计算总检测区域的灰度平均值和方差;根据总检测区域的灰度平均值和方差确定基准阈值;根据基准阈值进行全局阈值分割,得到待定脏污颗粒。
  9. 一种镜头脏污检测设备,其特征在于,包括相机和产品治具,所述产品治具用于放置待检测镜头,所述相机用于对待检测镜头进行拍摄得到的镜头图像,并根据权利要求1-6任意一项所述的方法进行镜头脏污检测。
  10. 根据权利要求9所述的镜头脏污检测设备,其特征在于,还包括光源,所述光源用于为所述待检测镜头提供背景光。
PCT/CN2020/128608 2020-10-20 2020-11-13 镜头脏污检测方法、装置和设备 WO2022082904A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011122158.8A CN111970506B (zh) 2020-10-20 2020-10-20 镜头脏污检测方法、装置和设备
CN202011122158.8 2020-10-20

Publications (1)

Publication Number Publication Date
WO2022082904A1 true WO2022082904A1 (zh) 2022-04-28

Family

ID=73387394

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/128608 WO2022082904A1 (zh) 2020-10-20 2020-11-13 镜头脏污检测方法、装置和设备

Country Status (2)

Country Link
CN (1) CN111970506B (zh)
WO (1) WO2022082904A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114882265A (zh) * 2022-07-12 2022-08-09 济宁昆仑石油化工有限公司 一种成品油质量检测方法
CN115880238A (zh) * 2022-12-01 2023-03-31 华瑞研能科技(深圳)有限公司 一种人工智能画面污迹处理方法和装置
CN115953322A (zh) * 2023-01-15 2023-04-11 山东产研卫星信息技术产业研究院有限公司 一种卫星遥感影像的污点去除方法
CN117876373A (zh) * 2024-03-12 2024-04-12 成都航空职业技术学院 一种变压器故障检测方法
CN117893611A (zh) * 2024-03-14 2024-04-16 浙江华诺康科技有限公司 一种图像传感器的脏污检测方法、装置和计算机设备

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113240672A (zh) * 2021-06-21 2021-08-10 广州文远知行科技有限公司 镜头污染物的检测方法、装置、设备及存储介质
CN113554637B (zh) * 2021-07-30 2022-06-07 上海集成电路制造创新中心有限公司 相机盖板的脏污检测方法及检测装置
CN113570582B (zh) * 2021-07-30 2022-07-29 上海集成电路制造创新中心有限公司 相机盖板清洁度检测方法及检测装置
CN113834823B (zh) * 2021-11-29 2022-04-08 浙江华诺康科技有限公司 内窥镜脏污检测装置以及脏污检测方法
CN114589160B (zh) * 2022-01-25 2023-05-16 深圳大方智能科技有限公司 一种室内施工用摄像头防护方法
CN116012386A (zh) * 2023-03-28 2023-04-25 超音速人工智能科技股份有限公司 一种隔膜覆盖检测方法、***、设备及存储介质
CN117191809B (zh) * 2023-08-30 2024-03-22 宿州绍宸智能科技有限公司 基于数据分析的玻璃检测设备故障监测预警***

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104867159A (zh) * 2015-06-05 2015-08-26 北京大恒图像视觉有限公司 一种数字相机传感器污点检测及分级方法与装置
CN105516694A (zh) * 2015-12-08 2016-04-20 上海集成电路研发中心有限公司 避免产生镜头暗角的方法及***
CN106412573A (zh) * 2016-10-26 2017-02-15 歌尔科技有限公司 一种检测镜头污点的方法和装置
WO2019026457A1 (ja) * 2017-08-03 2019-02-07 パナソニックIpマネジメント株式会社 画像監視装置、画像監視方法、画像監視プログラムおよび記録媒体
EP3489892A1 (en) * 2017-11-24 2019-05-29 Ficosa Adas, S.L.U. Determining clean or dirty captured images
CN110021012A (zh) * 2019-03-27 2019-07-16 安徽皓视光电科技有限公司 基于机器视觉技术的手机镜头视窗玻璃缺陷检测方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3164831A4 (en) * 2014-07-04 2018-02-14 Light Labs Inc. Methods and apparatus relating to detection and/or indicating a dirty lens condition
CN106791807B (zh) * 2014-11-24 2018-10-26 歌尔科技有限公司 一种摄像头模组污点检测的方法和装置
WO2019183902A1 (zh) * 2018-03-29 2019-10-03 深圳达闼科技控股有限公司 检测镜头的方法及装置、电子设备和计算机可读存储介质
CN110446025B (zh) * 2019-06-25 2020-08-07 盐城华昱光电技术有限公司 应用于电子设备的摄像头模组检测***及方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104867159A (zh) * 2015-06-05 2015-08-26 北京大恒图像视觉有限公司 一种数字相机传感器污点检测及分级方法与装置
CN105516694A (zh) * 2015-12-08 2016-04-20 上海集成电路研发中心有限公司 避免产生镜头暗角的方法及***
CN106412573A (zh) * 2016-10-26 2017-02-15 歌尔科技有限公司 一种检测镜头污点的方法和装置
WO2019026457A1 (ja) * 2017-08-03 2019-02-07 パナソニックIpマネジメント株式会社 画像監視装置、画像監視方法、画像監視プログラムおよび記録媒体
EP3489892A1 (en) * 2017-11-24 2019-05-29 Ficosa Adas, S.L.U. Determining clean or dirty captured images
CN110021012A (zh) * 2019-03-27 2019-07-16 安徽皓视光电科技有限公司 基于机器视觉技术的手机镜头视窗玻璃缺陷检测方法

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114882265A (zh) * 2022-07-12 2022-08-09 济宁昆仑石油化工有限公司 一种成品油质量检测方法
CN114882265B (zh) * 2022-07-12 2022-09-06 济宁昆仑石油化工有限公司 一种成品油质量检测方法
CN115880238A (zh) * 2022-12-01 2023-03-31 华瑞研能科技(深圳)有限公司 一种人工智能画面污迹处理方法和装置
CN115880238B (zh) * 2022-12-01 2023-08-15 华瑞研能科技(深圳)有限公司 一种人工智能画面污迹处理方法和装置
CN115953322A (zh) * 2023-01-15 2023-04-11 山东产研卫星信息技术产业研究院有限公司 一种卫星遥感影像的污点去除方法
CN115953322B (zh) * 2023-01-15 2023-07-14 山东产研卫星信息技术产业研究院有限公司 一种卫星遥感影像的污点去除方法
CN117876373A (zh) * 2024-03-12 2024-04-12 成都航空职业技术学院 一种变压器故障检测方法
CN117876373B (zh) * 2024-03-12 2024-05-31 成都航空职业技术学院 一种变压器故障检测方法
CN117893611A (zh) * 2024-03-14 2024-04-16 浙江华诺康科技有限公司 一种图像传感器的脏污检测方法、装置和计算机设备
CN117893611B (zh) * 2024-03-14 2024-06-11 浙江华诺康科技有限公司 一种图像传感器的脏污检测方法、装置和计算机设备

Also Published As

Publication number Publication date
CN111970506B (zh) 2020-12-29
CN111970506A (zh) 2020-11-20

Similar Documents

Publication Publication Date Title
WO2022082904A1 (zh) 镜头脏污检测方法、装置和设备
CN107678192B (zh) 一种基于机器视觉的Mura缺陷检测方法
WO2017020829A1 (zh) 解像力测试方法和解像力测试装置
US10157457B2 (en) Optical measurement of opening dimensions in a wafer
CN112033965A (zh) 基于差分图像分析的3d弧形表面缺陷检测方法
JP5786622B2 (ja) 画質検査方法、画質検査装置及び画質検査プログラム
TWI512284B (zh) 玻璃氣泡瑕疵檢測系統
JPH1163959A (ja) 表面検査装置
CN112070762A (zh) 液晶面板的mura缺陷检测方法、装置、存储介质及终端
CN112102319B (zh) 脏污图像检测方法、脏污图像检测装置及脏污图像检测机构
JP2005345290A (ja) 筋状欠陥検出方法及び装置
US7538750B2 (en) Method of inspecting a flat panel display
TW201617605A (zh) 瑕疵檢測方法及其裝置
CN112465780A (zh) 绝缘层膜厚异常监控方法及装置
JP2005164565A (ja) 低解像度および高解像度映像におけるフラットパネル用光関連板要素の欠陥検出方法
JP4288325B2 (ja) 画像認識による不良検査方法
US11880969B2 (en) Belt examination system and computer-readable non-transitory recording medium having stored belt examination program
US20230138331A1 (en) Motion in images used in a visual inspection process
TWI493177B (zh) 一種檢測具週期性結構光學薄膜的瑕疵檢測方法及其檢測裝置
Chen et al. TFT-LCD Mura defects automatic inspection system using linear regression diagnostic model
JP2004170374A (ja) 表面欠陥検出装置、及び表面欠陥検出方法
JP2006292500A (ja) 表面検査方法及び表面検査装置
JP2009222513A (ja) 欠陥検出装置、および欠陥検出方法
JPH03108638A (ja) 粒子凝集パターン判定方法
CN114324168B (zh) 一种表面缺陷检测方法及***

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20958482

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20958482

Country of ref document: EP

Kind code of ref document: A1