WO2020019352A1 - 检测摄像头模组的方法、设备、系统、机器可读存储介质 - Google Patents

检测摄像头模组的方法、设备、系统、机器可读存储介质 Download PDF

Info

Publication number
WO2020019352A1
WO2020019352A1 PCT/CN2018/097666 CN2018097666W WO2020019352A1 WO 2020019352 A1 WO2020019352 A1 WO 2020019352A1 CN 2018097666 W CN2018097666 W CN 2018097666W WO 2020019352 A1 WO2020019352 A1 WO 2020019352A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera module
threshold
dirty
image
specific
Prior art date
Application number
PCT/CN2018/097666
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 深圳市大疆创新科技有限公司
Priority to PCT/CN2018/097666 priority Critical patent/WO2020019352A1/zh
Priority to CN201880039292.6A priority patent/CN110800294A/zh
Publication of WO2020019352A1 publication Critical patent/WO2020019352A1/zh

Links

Images

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects

Definitions

  • the present invention relates to the field of image processing technology, and in particular, to a method, a device, a system, and a machine-readable storage medium for detecting a camera module.
  • the dirt detection of the camera module is done manually, and the inspectors use a microscope to check the mirror surface of the camera module and other parts to determine the existence of dirt.
  • the detection efficiency of this method is low, and the subjectivity of manual judgment is too strong, which results in a large error in the detection results.
  • the invention provides a method, a device, a system, and a machine-readable storage medium for detecting a camera module.
  • a method for detecting a camera module including:
  • the specific image includes M specific shapes, and M is a natural number.
  • the specific shape includes at least one of a rectangle, a triangle, and a circle.
  • the brightness distribution is a parameter value of a specified parameter of each pixel in the specific image, and the specified parameter includes at least a brightness value or a grayscale value.
  • the shape feature is a deformation amount of the specific shape.
  • determining whether the camera module is dirty according to the brightness distribution includes:
  • the first threshold and the second threshold are learned based on a big data method or are preset based on experience values.
  • determining whether the camera module is dirty according to the brightness distribution, the first threshold, and the second threshold includes:
  • determining whether the camera module is dirty according to the quantity A includes:
  • the A is greater than or equal to the AA, it is determined that the camera module is dirty; if the A is less than the AA, it is determined that the camera module is not dirty.
  • determining whether the camera module is dirty according to the quantity A includes:
  • ratio C is greater than or equal to a preset first ratio threshold CC, it is determined that the camera module is dirty; if the C is less than the CC, it is determined that the camera module is not dirty.
  • determining whether the camera module is dirty according to the brightness distribution, the first threshold, and the second threshold includes:
  • acquiring the first divided image of the specific image according to the brightness distribution and the first threshold includes:
  • the parameter value of the pixel point is updated to a first set value; if the parameter value is less than the first threshold value, the pixel point's The parameter value is updated to the second set value;
  • acquiring the second segmented image of the specific image according to the brightness distribution and the second threshold includes:
  • the parameter value of the pixel point is updated to a second set value; if the parameter value is greater than the second threshold value, the pixel point's The parameter value is updated to the first set value;
  • determining whether the camera module is dirty according to the first segmented image and the second segmented image includes:
  • E is greater than or equal to a preset second ratio threshold EE, it is determined that the camera module is dirty; if the E is less than the EE, it is determined that the camera module is not dirty.
  • the shape feature refers to a degree of deformation of the specific shape.
  • the degree of deformation is characterized by a filling rate of the specific shape; the filling rate refers to a ratio of an area of a connected domain of the specific shape to an area of a smallest circumscribed shape.
  • obtaining shape features of the specific image includes:
  • N is a natural number
  • the minimal circumscribed shape is the same as the specific shape
  • the shape feature of the specific image is determined according to the connected domain and the corresponding minimum circumscribed figure.
  • obtaining N connected domains in the first segmented image includes:
  • M1 is a positive integer and is greater than or equal to M
  • the preset condition refers to that a center distance of the connected domain and a center distance of the specific image are less than or equal to a preset distance threshold.
  • the attributes of the connected domain include at least one of a central position, an area, a minimum circumscribed graphic, an area of the smallest circumscribed graphic, an aspect ratio, and a mutual position of a boundary of the connected domain and a boundary of the first segmented image.
  • determining the shape feature of the specific image according to the connected domain and the corresponding minimal external shape includes:
  • determining whether the camera module is dirty according to the shape feature includes:
  • a device for detecting a camera module which includes a processor and a memory.
  • the memory stores a plurality of instructions, and the processor reads the instructions from the memory to implement the first Aspect of the method.
  • a system for detecting a camera module including the device for detecting a camera module according to the second aspect, a light source module, and a sealed box; wherein,
  • the light source module is used to provide uniform light output
  • the sealed box is disposed outside the light source module, and is configured to provide the camera module with a detection environment in which only the light source module emits light;
  • the camera module Before the detection, the camera module is placed inside the sealed box, and the normal line of the mirror surface of the camera module is perpendicular to the light emitting surface of the light source module;
  • the device is connected to the camera module and is used to control the camera module to take a specific image and detect whether the camera module is dirty according to the specific image.
  • the light source module includes: a surface light source and a sign transparent plate;
  • the surface light source is provided with a flat light-emitting surface; the sign light-transmitting plate is attached to the light-emitting surface;
  • the logo light-transmitting plate is made of a black light-absorbing material, and the logo light-transmitting plate is provided with a plurality of holes of a specific shape.
  • the light source module includes: a surface light source; the surface light source is provided with a light emitting surface made of a black light absorbing material, and the light emitting surface is provided with a plurality of holes of a specific shape.
  • the specific shape includes at least one of a rectangle, a triangle, and a circle.
  • the plurality of holes having a specific shape are distributed according to a rule.
  • the system further includes a position adjustment module composed of a moving component and a static component; the moving component is configured to be fixed to the light source module or the camera module; the light source module and the The distance between the camera modules is related to the relative position between the moving component and the static component.
  • a position adjustment module composed of a moving component and a static component; the moving component is configured to be fixed to the light source module or the camera module; the light source module and the The distance between the camera modules is related to the relative position between the moving component and the static component.
  • a distance between the light source module and the camera module is less than or equal to a first distance; the first distance is when a light emitting surface of the light source module is full of images captured by the camera module The corresponding distance.
  • the system further includes a display module, which is connected to the device and is used to display at least a dirt detection result of the camera module.
  • a machine-readable storage medium stores a plurality of computer instructions, and when the computer instructions are executed, the steps of the method according to the first aspect are implemented.
  • a specific image captured by the camera module is obtained; then the brightness distribution and / or deformation characteristics of the specific image are obtained; finally, it is determined whether the camera module is dirty according to the brightness distribution and / or deformation characteristics. Sewage. It can be seen that no manual detection is required in this embodiment, so that the detection result is irrelevant to the subjective judgment, which is beneficial to improving the accuracy of the detection result. In addition, the speed of determining the detection result in this embodiment is much faster than the speed of manual detection, which can improve the efficiency of detecting the contamination of the camera module.
  • FIG. 1 is a block diagram of a system for detecting a camera module according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a light source module according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a light source module according to another embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a specific image including M specific shapes according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a positional relationship between a light receiving area of an image sensor and a light emitting surface of a light source module in a camera module according to an embodiment of the present invention; wherein FIG. 5 (a) is a scene in which the light emitting surface is located inside the light sensitive area; FIG. 5 (b) is a scene in which the photosensitive area is located inside the light emitting surface;
  • FIG. 6 is a schematic structural diagram of a position adjustment module according to an embodiment of the present invention
  • FIG. 6 (a) is a top view of the sealed box in FIG. 1 with the top cover (above FIG. 6) removed
  • FIG. 6 (b) Is a front view of the sealed box in FIG. 1 after removing the front side (directly front of FIG. 6);
  • FIG. 7 is a block diagram of a system for detecting a camera module according to another embodiment of the present invention.
  • FIG. 8 is a block diagram of a device for detecting a camera module according to an embodiment of the present invention.
  • FIG. 9 is a schematic flowchart of a method for detecting a camera module according to an embodiment of the present invention.
  • FIG. 10 is a schematic flowchart of a method for detecting a camera module according to another embodiment of the present invention.
  • FIG. 11 is a schematic flowchart of a method for detecting a camera module according to another embodiment of the present invention.
  • FIG. 12 is a schematic flowchart of a method for detecting a camera module according to another embodiment of the present invention.
  • FIG. 13 is a schematic flowchart of a method for detecting a camera module according to another embodiment of the present invention.
  • FIG. 14 is a schematic flowchart of a method for detecting a camera module according to another embodiment of the present invention.
  • FIG. 15 is a schematic diagram of a first segmented image acquisition process according to an embodiment of the present invention.
  • 16 is a schematic diagram of a second segmented image acquisition process according to an embodiment of the present invention.
  • FIG. 17 is a schematic flowchart of a method for detecting a camera module according to another embodiment of the present invention.
  • FIG. 18 is a schematic flowchart of a method for detecting a camera module according to another embodiment of the present invention.
  • FIG. 19 is a schematic diagram of a connected domain of a specific image according to an embodiment of the present invention.
  • 21 is a schematic diagram of a minimum external shape of a connected domain according to an embodiment of the present invention.
  • FIG. 22 is a schematic flowchart of obtaining a fill rate according to an embodiment of the present invention.
  • FIG. 23 is a schematic flowchart of a method for detecting a camera module according to another embodiment of the present invention.
  • FIG. 24 is a schematic flowchart of a method for detecting a camera module according to an embodiment of the present invention.
  • the existing camera module includes at least an image sensor and a lens. During the process of capturing a specific image, light from a light source passes through the lens to the image sensor, and the corresponding image is obtained after the image sensor receives light. If there is no dirt, the air between the lens and the lens and the image sensor can be regarded as a homogeneous medium, so that the light paths of each light reaching the image sensor are equal.
  • the lens of the camera module will be stained with oil, fingerprints, dust, and other dirt, and the image sensor will be dirty with dust and dirt. Air is no longer a homogeneous medium.
  • the light will be refracted accordingly, causing the light to exit to the place where it should not appear, which makes the images formed by dirt and non-dirty different. Therefore, it is necessary to perform a dirt detection on the camera module before configuration.
  • the dirt detection of the camera module is done manually, and the inspectors use a microscope to check the mirror surface of the camera module and other parts to determine the existence of dirt.
  • the detection efficiency of this method is low, and the subjectivity of manual judgment is too strong, which results in a large error in the detection results.
  • FIG. 1 is a block diagram of a system for detecting a camera module according to an embodiment of the present invention.
  • a system for detecting a camera module includes a light source module 11, a sealed box 12, and a device 13 for detecting a camera module. among them:
  • the sealed case 12 is disposed outside the light source module 11, and the camera module 14 to be inspected also needs to be placed inside the sealed case 12 before detection.
  • the normal line 141 of the mirror surface of the camera module 14 is perpendicular to the light emitting surface 112 of the light source module 11.
  • the shape of the light emitting surface is not limited, and may be rectangular, circular, or polygonal. The following description uses the light emitting surface as a circle for example.
  • the light source module 11 may be fixed to the sealed case by means of gluing, bolts, etc., or may be fixed on the moving assembly 151 of the subsequent position adjustment module 15.
  • the camera module 14 can be detachably fixed to the inside of the sealed case 12 by means of pasting, bolts, or the like, and can also be detachably fixed on the moving component 151 of the subsequent position adjustment module 15.
  • the sealed box 12 can prevent light outside the box from entering the inside, that is, when the light source module 11 is turned off (ie, no light is emitted), the inside of the sealed box 12 appears dark; in the light source module 11 After opening, only the light emitted from the light source module 11 exists in the sealed box 12.
  • the light source module 11 can provide uniform light output. From the perspective of the camera module 14, when looking at the light emitting surface of the light source module 11, M specific shapes can be seen, where M is a natural number.
  • the specific shape may include at least one of a rectangle, a triangle, and a circle.
  • the skilled person may also choose the shape of a regular polygon such as a regular pentagon and a regular hexagon instead of the above-mentioned rectangle, etc., and the solution of the present application can also be implemented.
  • M may take a value of 1, that is, a specific shape may be one.
  • M can take multiple values.
  • the structure of the light source module 11 can be adjusted to form a specific shape in a specific image, including the following methods:
  • the light source module 11 may include a surface light source 113 and a marker light transmitting plate 114.
  • the surface light source 113 is provided with a flat light emitting surface; a light transmitting plate 114 is attached to the light emitting surface.
  • the sign transparent plate 114 may also be referred to as a Chart table.
  • the sign transparent plate 114 may be provided with M (a natural number) holes 115 of a specific shape, so that light can pass through the holes 115 and light projected onto the sign transparent plate 114 cannot pass through.
  • the sign transparent plate 114 may be made of a black light absorbing material, such as a black cloth, a carbon nanotube black body material, or graphene.
  • the technician can select the appropriate material to make the sign transparent plate 114 according to the specific scene. Based on the fact that the hole 115 is transparent and the area outside the hole 115 is opaque, the technician selects the sign transparent plate 114 The materials also fall into the protection scope of this application.
  • the light source module 11 may further include an adhesive layer 116.
  • the marker light-transmitting plate 114 can be pasted on the light-emitting surface 112 side of the surface light source 113 through the adhesive layer 116.
  • the adhesive layer 116 may be directly made of a solid material, and the surface light source 113 and the sign transparent plate 114 are placed on both sides of the adhesive layer 116 and then compacted.
  • the adhesive layer 116 can also be formed by using a liquid material to uniformly apply the liquid material on the surface light source 113, and compact the sign transparent plate 114 on the surface light source 113, after the liquid material solidifies.
  • the adhesive layer 116 needs to have better light transmittance, so as to ensure that the light emitted from the surface light source 113 reaches the sign transparent plate 114 as much as possible. In this way, it can be seen that there are M A light-emitting surface of a specific shape.
  • the light source module 11 may include a surface light source 113.
  • the surface light source 113 is provided with a light emitting surface 112 made of a black light absorbing material, and the light emitting surface 112 is provided with M holes 115 of a specific shape. In this way, the light emitted by the surface light source 113 can only pass through the hole 115, and the The position of the group 14 can be seen to include M light-emitting surfaces of a specific shape.
  • the device 13 for detecting the camera module is connected to the camera module 14, and the connection method may include a wired connection and a wireless connection.
  • a technician may select an appropriate connection method according to a specific scenario, which is not limited herein.
  • Buttons can be set on the device 13 that detects the camera module or virtual buttons can be set on the touch screen.
  • the detection personnel can trigger the buttons or virtual buttons on the device 13 to control the camera module 14 to shoot specific images, and the specific images can include images such as The specific shape shown in 4.
  • the camera module 14 may send the captured specific image to the device 13 that detects the camera module.
  • the device 13 for detecting the camera module can detect whether the camera module is dirty according to a specific image.
  • the dirt may include external dirt such as stains, oil stains, fingerprints, or dust, and may also include the dirt of the camera module 14 itself, such as uneven lenses, uneven mirror surfaces, and image sensor problems. That is, the system provided by the present invention can detect the self-contamination and / or external contamination of the camera module 14.
  • the detection method will be described in detail in the subsequent method embodiments, and will not be described here.
  • the positional relationship between the light emitting surfaces of the camera module 14 and the light source module 11, referring to FIG. 5 (a) and FIG. 5 (b), may include:
  • the technician can also adjust the position of the camera module 14, the focal length of the lens in the camera module 14, or the position of the light source module 11, so that the photosensitive area 142 of the image sensor in the camera module 14 is larger than or externally connected.
  • the specific image may include the area around the light emitting surface of the light source module 11.
  • the device 13 for detecting the camera module can adjust the lens angle of the camera module 14 so that at least one specific image can be taken at different angles to obtain multiple specific images. Based on at least one specific image at each angle, the device 13 calls the image recognition algorithm to identify the glossy area, so that it can be determined whether the corresponding area of the camera module 14 is dirty. Then, it can be determined whether the camera module 14 is dirty according to the degree of dirt at multiple angles. It will be described in detail later, and will not be described here.
  • a technician can adjust the position of the camera module 14 or the focal length of the lens in the camera module 14 so that the photosensitive area 142 of the image sensor in the camera module 14 is smaller than or inscribed in the light output of the light source module 11 surface.
  • the specific image may not include the area around the light emitting surface of the light source module 11, that is, the specific image all corresponds to the effective detection area of the light emitting surface of the light source module 11. Therefore, only one specific image is required to detect the camera module 14. Whether it is dirty, thereby reducing the data calculation amount of the device 13 for detecting the camera module, and improving the real-time performance of subsequent detection of dirt.
  • the technician can choose the arrangement shown in FIG. 5 (a) or FIG. 5 (b) according to the specific scene.
  • the technician can also choose other ways to adjust the positional relationship between the camera module 14 and the light emitting surface.
  • the technician can also choose other ways to adjust the positional relationship between the camera module 14 and the light emitting surface.
  • the technician can also choose other ways to adjust the positional relationship between the camera module 14 and the light emitting surface.
  • the specific module can detect whether the camera module is dirty, the corresponding The solution also falls into the protection scope of this application.
  • the system for detecting a camera module further includes a position adjustment module 15 composed of a moving component 151 and a static component 152.
  • the moving component 151 may be fixed to the light source module 11 or the camera module 14 (the fixed camera module 14 is taken as an example in FIG. 6).
  • the distance L between the light source module 11 and the camera module 14 is related to the relative position between the moving component 151 and the static component 152.
  • the relative position between the moving component 151 and the static component 152 can be adjusted, thereby adjusting the position of the light-emitting surface of the light source module 11 in the photosensitive area 142 of the image sensor in the camera module 14.
  • the inspector may adjust the position between the camera module 14 and the light source module 11 through the position adjustment module 15 in advance, so that the light emitting surface of the light source module 11 is at
  • the position of the photosensitive area 142 is shown in FIG. 5 (a) or FIG. 5 (b), and the distance between the light source module 11 and the camera module 14 in this scene is recorded.
  • the distance when the light emitting surface of the light source module 11 immediately fills the photosensitive area 142 (that is, the photosensitive area 142 is cut into the light emitting surface) is referred to as a first distance.
  • the light-emitting surface of the light source module 11 may fill the photosensitive area 142;
  • the light emitting surface cannot fill the photosensitive area 142.
  • the system for detecting a camera module can detect camera modules of different sizes, thereby improving the system's adaptability.
  • the system for detecting a camera module may further include a display module 16.
  • the display module 16 is connected to the device 13 for detecting the camera module, and is used to display at least the dirty detection result of the camera module.
  • the display module 16 can also display specific images captured by the camera module 14 and display previous detection results. The technician can set the display content of the display module according to the specific scene, which is not limited here.
  • FIG. 8 is a block diagram of a device for detecting a camera module according to an embodiment of the present invention.
  • a device 800 for detecting a camera module includes a processor 801 and a memory 802. Among them, the memory 802 stores several instructions, and the processor 801 reads the instructions from the memory 802, thereby implementing the method shown in FIG. 9, including:
  • the device for detecting a camera module provided in this embodiment can automatically determine whether the camera module is dirty and does not need manual detection, so that the detection result is irrelevant to subjective judgment, and is beneficial to improving the accuracy of the detection result.
  • the speed of determining the detection result in this embodiment is much faster than the speed of manual detection, which can improve the efficiency of detecting the contamination of the camera module.
  • the following describes a system for detecting a camera module shown in FIGS. 1 to 7, a device for detecting a camera module shown in FIG. 8, and a schematic flowchart of a method shown in FIG. 9 to describe whether the device for detecting a camera module determines whether the camera module is There is a dirty process, which may include scene one, scene two, scene three, and scene four formed by scene two. Understandably, one camera module can be detected in each scene, and more than two camera module modules can be detected simultaneously. The detection process of two or more camera modules is similar to the detection process of one camera module. For the convenience of description, the following description uses a detection of one camera module as an example.
  • the processor determines whether the camera module is dirty according to the brightness distribution of the specific image. If the camera module is not dirty, the light only passes through the holes on the transparent plate of the sign and is not refracted, so that it can form a specific shape. If the camera module is dirty, the light that passes through the holes will be refracted by the dirt, so that the light exits to the background area (region outside the specific shape) that should be black, making white points on the image Increase, resulting in different bright background.
  • each pixel in a specific image may include parameter values of multiple parameters, such as a brightness value, a grayscale value, and the like.
  • the gray value of each pixel is used as a description parameter.
  • the processor obtains the grayscale value of each pixel in a specific image, for example, the value range of the grayscale value can be 0 to 255, and the brightness distribution of the specific image can be obtained (corresponding to step 902).
  • the gray value of the pixels in a specific shape in a specific image captured is the maximum gray value (for example, 255), and the gray values of pixels in the area outside the specific shape, that is, the background area, are the minimum gray. Value (for example, 0). Due to objective errors such as light output, air, lens uniformity, etc. (in line with standards), the gray value of the pixels in a specific area may not be the maximum value, and the energy loss of the light during the propagation process. The gray value of the point is not the maximum gray value (for example, 200).
  • a threshold value of the gray value that is, a first threshold value and a second threshold value can be set in advance, and the first threshold value is greater than the second threshold value.
  • the gray values of pixels in a specific shape should all be greater than or equal to the second threshold, the gray values of pixels outside a specific shape should all be less than or equal to the first threshold, and no gray value exists in the first The number of pixels between the threshold and the second threshold.
  • the intensity of light everywhere on the light emitting surface of the light source module may be strong or weak and the sign transparent plate is not theoretically pure black, there may be brightness when the light reaches the sign transparent plate, that is, the specific shape
  • the gray value of the pixels in the outer region may be greater than the first threshold.
  • there is an attenuation loss before the light reaches the photosensitive area which causes the gray value of the pixel points in the specific shape to be smaller than the second threshold value, that is, there are very few pixel points with gray value values between the first threshold value and the second threshold value.
  • the camera module is dirty, the light that should reach the specific shape will be attenuated and affected by the dirt, and it will definitely refract and reach the outside of the specific area.
  • the value exceeds the first threshold. In this way, the number of pixels with a gray value greater than the first threshold will be far greater than the number of pixels with a gray value greater than the second threshold.
  • the number of pixels whose gray value is between the first threshold and the second threshold should be 0; if the error allows, the number of pixels whose gray value is between the first threshold and the second threshold The number is small (for example, 1% to 4%); in the case of dirt, the number of pixels whose gray value is between the first threshold and the second threshold is rapidly increased (for example, 10% or more).
  • the first threshold and the second threshold can be learned based on existing big data methods.
  • specific learning methods refer to related technologies, which is not limited herein.
  • the first threshold and the second threshold may be set in advance based on empirical values.
  • the first threshold may be set to 180 and the second threshold may be set to 65.
  • a technician can select the first threshold and the second threshold according to a specific scenario. When the solution of the present application can be implemented, it also falls into the protection scope of the present application.
  • the processor can read the first threshold value and the second threshold value of the gray value from the memory (corresponding to step 1001).
  • the processor can determine whether the camera module is dirty according to the brightness distribution, the first threshold, and the second threshold (corresponding to step 1002).
  • the manner for determining whether the camera module is dirty according to the brightness distribution, the first threshold, and the second threshold may include the first and second modes. among them:
  • Method 1 The principle is: if the number of pixels in a specific image whose gray level is between the first threshold and the second threshold is 0 or less (for example, 1% to 4%), determine whether the camera module is Clean. If the number is large, it is determined that the camera module is dirty.
  • the processor compares the gray value of each pixel with the size of the first threshold and the second threshold, and then counts pixels whose gray value is between the first threshold and the second threshold. The number of points A (corresponding to step 1101). After that, the processor can determine whether the camera module is dirty according to the quantity A (corresponding to step 1102).
  • the processor obtains a preset quantity threshold AA, and compares the quantity threshold AA with the size of the quantity A (corresponding to step 1201). If the quantity A is greater than or equal to the quantity threshold AA, the processor may determine that the camera module is dirty (corresponding to step 1202).
  • the number threshold AA can be learned based on a big data method or can be preset based on experience values. For example, a model of the number threshold AA and the dirty result of the camera module can be established. Under the condition that the accuracy of the dirty result is guaranteed, the value range of the number threshold AA is determined and randomly selected from the value range, or the smallest value is selected. Or the maximum value is taken as the final value of the quantity threshold AA.
  • the processor may calculate the gray value in a specific image at the same time, before, or after counting the number of pixels A whose gray value is between the first threshold and the second threshold. The number B of pixels larger than the first threshold (corresponding to step 1301). Then, the processor calculates a ratio C between the quantity A and the quantity B (corresponding to step 1302). After that, the processor obtains a preset first ratio threshold CC and compares the sizes of C and CC. If C is greater than or equal to CC, the processor determines that the camera module is dirty; if C is less than CC, it determines that the camera module is not There is dirt (corresponding to step 1303).
  • the first ratio threshold CC may be learned based on a big data method or may be preset based on empirical values.
  • the setting method may refer to the setting method of the first threshold and the second threshold, which is not limited herein.
  • the principle is: if the number of pixels whose gray value is between the first threshold and the second threshold is 0 or less, it is determined that the camera module is clean. If the number is large, it is determined that the camera module is dirty.
  • the first threshold as the threshold of the gray value
  • the pixel The gray value of the pixel is adjusted to the maximum gray value (such as 255); if the gray value of the pixel is less than or equal to the first threshold, the gray value of the pixel is adjusted to the minimum gray value (such as 0), so as to obtain
  • the binarized image corresponding to the specific image is the first segmented image.
  • a binary image corresponding to the specific image that is, a second segmented image is obtained. If the camera module is clean, the difference between the number of pixels with a gray value of 255 in the first segmented image and the second segmented image should be 0 or less. If the camera module is dirty, the number difference is large.
  • the number of pixels with a gray value of 255 between the first divided image and the second divided image is used to determine whether the camera module is dirty.
  • a technician can also use a gray value of 0.
  • the number of pixels to determine whether the camera module is dirty Since the gray value of 0 and the gray value of 255 are two gray values of each segmented image, the number of corresponding pixels is complementary, so the pixels with a gray value of 0 in the second segmented image can be used with the first segmentation.
  • the number of pixels with a gray value of 0 changes in the image to determine whether the camera module is dirty. That is, if the camera module is clean, The quantity difference should be 0 or less. If the camera module is dirty, the number difference is large.
  • the processor obtains a first segmented image and a second segmented image according to a brightness distribution of a specific image, a first threshold value, and a second threshold value (corresponding to step 1401).
  • the step that the processor can obtain the first segmented image according to the brightness distribution and the first threshold includes:
  • FIG. 15 (a) is a schematic diagram of a brightness distribution of a specific image.
  • the processor compares the gray value of the pixel with the size of the first threshold to obtain the comparison result shown in Figure 15 (b), where bold and The underlined numbers are the gray values of pixels that are greater than or equal to the first threshold, and the other numbers are the gray values of pixels that are less than the first threshold.
  • the processor updates the gray value of the pixel point greater than or equal to the first threshold value to the first set value, and updates the gray value of the pixel point whose gray value is less than the first threshold value to the second set value, Thereby, a first segmented image as shown in FIG. 15 (c) can be obtained.
  • the first set value can be set to 255, which is the maximum value of the gray value; the second set value can be set to 0, which is the maximum value of the gray value.
  • the first set value can be set to 1, and the second set value can also be set to 0.
  • the technicians can set according to the available scenarios, which is not limited here.
  • the step that the processor can obtain the second segmented image according to the brightness distribution and the second threshold includes:
  • FIG. 16 (a) is a schematic diagram of a brightness distribution of a specific image.
  • the processor compares the gray value of the pixel with the size of the second threshold to obtain the comparison result shown in Figure 16 (b), where bold and The underlined numbers are the gray values of the pixels less than or equal to the second threshold, and the other numbers are the gray values of the pixels greater than the second threshold.
  • the processor updates the gray value of the pixel point less than or equal to the second threshold value to the second set value, and updates the gray value of the pixel point whose gray value is greater than the second threshold value to the first set value, Thereby, a second segmented image as shown in FIG. 16 (c) can be obtained.
  • the processor may determine whether the camera module is dirty according to the first segmented image and the second segmented image (corresponding to step 1402), as shown in FIG. 17, including:
  • the processor may obtain the number D1 of pixels in the first segmented image whose gray value is a first set value (255), and D1 in FIG. 15 (c) is 13. At the same time, the processor may also obtain the number D2 of pixels in the second segmented image whose gray value is the first set value (255), and D2 in FIG. 16 (c) is 14 (corresponding to step 1701).
  • the processor obtains the difference D between D2 and D1, and the corresponding difference D in FIG. 15 (c) and FIG. 16 (c) is 1 (corresponding to step 1702).
  • the processor obtains a preset second ratio threshold EE, and compares the magnitudes of E and EE. If E is greater than or equal to EE, it is determined that the camera module is dirty; if E is less than EE, it is determined that the camera module is not dirty.
  • the second ratio threshold EE is 5%, and the ratio E is greater than EE, the processor may determine that the camera module is dirty.
  • the second ratio threshold EE can be learned based on the big data method or can be preset based on empirical values.
  • the setting method can refer to the setting method of the first threshold and the second threshold, which is not limited here.
  • this embodiment uses the specific image captured by the camera module; then obtains the brightness distribution of the specific image; and finally determines whether the camera module is dirty according to the brightness distribution. It can be seen that no manual detection is required in this embodiment, so that the detection result is irrelevant to the subjective judgment, which is beneficial to improving the accuracy of the detection result. In addition, the speed of determining the detection result in this embodiment is much faster than the speed of manual detection, which can improve the efficiency of detecting the contamination of the camera module.
  • the processor determines whether the camera module is dirty according to the shape feature distribution of the specific image. If the camera module is not dirty, since the camera module is perpendicular to the light emitting surface of the light source module, the specific shape in the specific image is regular and the same as the shape of the hole. If the camera module is dirty, the light will be refracted and cause the edge of the specific shape to change, such as concave or convex, thereby deforming the specific shape. Therefore, in this embodiment, the shape feature of the specific shape refers to the degree of deformation of the specific shape. In one embodiment, the degree of deformation is characterized by the filling rate of a specific shape. Filling ratio is the ratio of the area of a connected area of a specific shape to the area of the smallest circumscribed shape.
  • the processor acquires the shape features of a specific image. Referring to FIG. 18, it includes:
  • the processor obtains N connected domains in the first segmented image, and obtains a connected domain distribution map as shown in FIG. 19. Among them, N is a natural number.
  • the processor may call a preset connected domain algorithm to obtain M1 connected domains in the first segmented image (corresponding to step 2001); where M1 is a positive integer and is greater than or equal to the number of specific shapes M. Then, the processor can obtain the attributes of each of the M1 connected domains (corresponding to step 2002).
  • the attributes include at least one of a central position, an area, a minimum circumscribed shape, an area of the smallest circumscribed shape, an aspect ratio, and a mutual position between a boundary of the connected domain and a boundary of the first segmented image.
  • the processor filters out the connected domains that do not satisfy the preset condition according to the attributes of each connected domain to obtain N connected domains (corresponding to step 2003).
  • connected domain algorithm in this embodiment may be implemented by using the four-connected method or the eight-connected method in related technologies, which is not limited in the present invention.
  • the attributes of the connected domain may be the center position and the aspect ratio.
  • the preset condition may be that the distance between the center position of the connected domain and the center position of the specific image is less than or equal to a preset value. It can be seen that in this embodiment, by setting a preset condition, in a case where the photosensitive region 142 of the image sensor is cut inside the light-emitting surface, the edges of the photosensitive region 142 are divided into connected areas that appear in a specific shape to obtain a specific image. The complete connected domain around the center of the camera helps to improve the accuracy of determining whether the camera module is dirty.
  • the processor obtains a minimum circumscribed graphic of each connected domain in the N connected domains; the minimum circumscribed graphic is the same as the specific shape.
  • the shape of the connected domain 20 in the virtual circle on the lower right side is the same as the specific shape, so its smallest circumscribed figure 22 is still the same as the specified shape. Therefore, in this embodiment, the connected domain is the same as the smallest circumscribed figure. Its minimum external shape is not marked. Continuing to refer to FIG. 21, the connected domain 21 in the virtual circle on the upper right side is deformed, and its smallest external shape 22 is still the same as the specific shape.
  • the processor determines a shape feature of the specific image according to the connected domain and a corresponding minimum external shape.
  • the processor calculates an area of each connected domain and an area of a corresponding minimum external figure (corresponding to step 2201). For example, for the connected domain 21 in the virtual circle on the upper right side of FIG. 21, the processor can calculate the area of the connected domain 21 as 0.0945 square millimeters. At the same time, the processor can also calculate that the area of the smallest external shape of the connected domain 21 is 0.10 Square millimeter. As another example, the area of the connected domain 20 is 0.10 mm 2. Finally, the processor can calculate the ratio F of the area of the connected domain to the area of the corresponding smallest external figure.
  • the ratio F of the connected domain 20 is 100%, and the ratio F corresponding to the connected domain 21 is 94.5%, that is, the ratio F is the connected domain and Fill rate of the smallest external shape.
  • the degree of deformation of the specific image is characterized by the fill ratio in this embodiment, the degree of deformation of the specific image can be obtained in this embodiment, that is, the degree of deformation of the specific image is 94.5%.
  • the processor determines whether the camera module is dirty according to the shape characteristics.
  • the processor obtains a preset deformation threshold FF (corresponding to step 2301).
  • This deformation threshold can be obtained based on a big data learning method, and can also be preset based on experience values.
  • the processor corresponds to the ratio F and the deformation threshold FF. If the ratio F corresponding to each connected domain in the N connected domains is greater than or equal to the preset deformation threshold FF, it is determined that the camera module is not dirty; if N connected If a ratio F corresponding to a connected domain in the domain is smaller than the deformation threshold FF, it is determined that the camera module is dirty (corresponding to step 2302).
  • the deformation threshold FF may be set to 95%. Since the ratio F corresponding to a connected domain in a specific image is 94.5% smaller than the deformation threshold FF (95%), it can be determined that the camera module is dirty based on the specific image.
  • this embodiment uses a specific image captured by the camera module; then obtains the deformation characteristics of the specific image; and finally determines whether the camera module is dirty according to the deformation characteristics. It can be seen that no manual detection is required in this embodiment, so that the detection result is irrelevant to the subjective judgment, which is beneficial to improving the accuracy of the detection result. In addition, the speed of determining the detection result in this embodiment is much faster than the speed of manual detection, which can improve the efficiency of detecting the contamination of the camera module.
  • scenario 1 and scenario 2 can be combined with each other without conflict, thereby forming different solutions, and these solutions also fall into the protection scope of the present application.
  • a combination scheme is described below, see FIG. 24:
  • the processor may first obtain a specific image captured by the camera module, and obtain a brightness distribution of the specific image, as shown in FIG. 15 (a).
  • the processor obtains the first threshold value and the second threshold value of the gray value, and the processor can obtain the first segmented image of the specific image according to the brightness distribution and the first threshold value.
  • the first segmented image can be referred to FIG. 15 (c); and the second segmented image of the specific image can be obtained according to the brightness distribution and the second threshold, and the method of obtaining the second segmented image can refer to FIG. 16 ( a) to FIG. 16 (c), and the second segmented image can refer to FIG. 16 (c).
  • the processor may calculate the number of pixels D1 with the gray value in the first segmented image and the number of pixels with the first value in the second segmented image.
  • the processor calculates a ratio E between the difference D and the quantity D1 according to the difference D between the quantity D1 and the quantity D2.
  • the processor continues to obtain a preset second ratio threshold EE, and compares the magnitude of the ratio E and the second ratio threshold EE. If E is greater than or equal to EE, it is determined that the camera module is dirty; if E is less than EE, then the first segmented image of the specific image is continuously acquired according to the brightness distribution and the first threshold, or the first segmented image obtained previously is used.
  • the processor may call a preset connected domain algorithm to obtain N connected domains in the first segmented image, and for the steps of filtering the connected domains, refer to FIG. 20.
  • the connected domain algorithm can be implemented by the four-connected method or the eight-connected method in related technologies.
  • the processor obtains the minimum circumscribed graphics of each connected domain in the N connected domains, where the minimum circumscribed image is the same as the specific shape in the specific image, and the connected domain and its minimal circumscribed graphics can be seen in FIG. 21.
  • the processor calculates the area of each connected domain and the area of the smallest circumscribed graphic corresponding to each connected domain, and calculates a ratio F based on the two areas, where the ratio F is the fill rate of the specific image.
  • the processor obtains the deformation threshold FF, and compares the ratio F corresponding to each connected domain F with the magnitude of the deformation threshold FF. If the ratio F is greater than or equal to FF, it is determined that the camera module is not dirty; if the ratio F is less than FF, it is determined that the camera module is dirty.
  • this embodiment uses the specific image captured by the camera module; then obtains the brightness distribution and deformation characteristics of the specific image; and finally, determines whether the camera module is dirty according to the brightness distribution and deformation characteristics. It can be seen that no manual detection is required in this embodiment, so that the detection result is irrelevant to the subjective judgment, which is beneficial to improving the accuracy of the detection result. In addition, the speed of determining the detection result in this embodiment is much faster than the speed of manual detection, which can improve the efficiency of detecting the contamination of the camera module.
  • Scenarios 1 to 3 introduce solutions to determine whether the camera module is dirty using a specific image.
  • the processor can also divide the lens in the camera module into X (positive integer) areas, for example, the value of X is 4, so that the processor can control the image sensor to obtain X angles.
  • the result of the dirt in the X regions is combined to obtain whether the camera module is dirty.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)

Abstract

一种检测摄像头模组的方法、设备、系统、机器可读存储介质。其中所述方法包括:获取摄像头模组所拍摄的特定图像;获取所述特定图像的亮度分布和/或形状特征;根据所述亮度分布和/或形状特征判断所述摄像头模组是否存在脏污。本方法中无需人工检测,从而使检测结果与主观判断无关,有利于提升检测结果的准确度。另外,本方法确定检测结果的速度远远大于人工检测的速度,能够提升检测摄像头模组脏污的效率。

Description

检测摄像头模组的方法、设备、系统、机器可读存储介质 技术领域
本发明涉及图像处理技术领域,尤其涉及检测摄像头模组的方法、设备、系统、机器可读存储介质。
背景技术
现有的电子设备大部分配置有摄像头模组。在组装过程中,灰尘、毛发等异物可能会落入感光芯片上或者镜面存在不平整、油污等情形,都会使图像脏污,因此在配置之前需要对摄像头模组进行脏污检测。
目前,摄像头模组的脏污检测由人工完成,检测人员采用显微镜查看摄像头模组的镜面等部位,以判断出存在的脏污。但是,该方法检测效率较低,且人工判断主观性太强,导致检测结果的误差较大。
发明内容
本发明提供一种检测摄像头模组的方法、设备、系统、机器可读存储介质。
根据本发明的第一方面,提供一种检测摄像头模组的方法,包括:
获取摄像头模组所拍摄的特定图像;
获取所述特定图像的亮度分布和/或形状特征;
根据所述亮度分布和/或形状特征判断所述摄像头模组是否存在脏污。
可选地,所述特定图像包括M个特定形状,M为自然数。
可选地,所述特定形状包括矩形、三角形、圆形中的至少一种。
可选地,所述亮度分布为所述特定图像中各像素点的指定参数的参数值,所述指定参数至少包括亮度值或者灰度值。
可选地,所述形状特征为所述特定形状的形变量。
可选地,根据所述亮度分布判断所述摄像头模组是否存在脏污包括:
获取所述指定参数的第一阈值和第二阈值;
根据所述亮度分布、所述第一阈值和所述第二阈值判断所述摄像头模组是否存在脏污。
可选地,所述第一阈值和所述第二阈值基于大数据方式学习得到或者基于经验值预先设置。
可选地,根据所述亮度分布、所述第一阈值和所述第二阈值判断所述摄像头模组是否存在脏污包括:
获取所述特定图像中指定参数的参数值位于所述第一阈值和所述第二阈值之间的像素点的数量A;所述第一阈值大于所述第二阈值;
根据所述数量A判断所述摄像头模组是否存在脏污。
可选地,根据所述数量A判断所述摄像头模组是否存在脏污包括:
对比所述数量A和预先设置的数量阈值AA;
若所述A大于或等于所述AA,则确定所述摄像头模组存在脏污;若所述A小于所述AA,则确定所述摄像头模组未存在脏污。
可选地,根据所述数量A判断所述摄像头模组是否存在脏污包括:
获取所述特定图像中指定参数的参数值大于所述第一阈值的像素点的数量B;
计算所述数量A和所述数量B的比值C;
若所述比值C大于或等于预先设置的第一比值阈值CC,则确定所述摄像头模组存在脏污;若所述C小于所述CC,则确定所述摄像头模组未存在脏污。
可选地,根据所述亮度分布、所述第一阈值和所述第二阈值判断所述摄像头模组是否存在脏污包括:
根据所述亮度分布和所述第一阈值获取所述特定图像的第一分割图像,以及根据所述亮度分布和所述第二阈值获取所述特定图像的第二分割图像;
根据所述第一分割图像和所述第二分割图像判断所述摄像头模组是否存在脏污。
可选地,根据所述亮度分布和所述第一阈值获取所述特定图像的第一分 割图像包括:
针对所述特定图像中每个像素点,比较所述像素点的指定参数的参数值与所述第一阈值;
若所述参数值大于或者等于所述第一阈值,则将所述像素点的参数值更新为第一设定值;若所述参数值小于所述第一阈值,则将所述像素点的参数值更新为第二设定值;
根据所述每个像素点更新后的参数值,形成第一分割图像。
可选地,根据所述亮度分布和所述第二阈值获取所述特定图像的第二分割图像包括:
针对所述特定图像中每个像素点,比较所述像素点的指定参数的参数值与预设的第二阈值;
若所述参数值小于或者等于所述第二阈值,则将所述像素点的参数值更新为第二设定值;若所述参数值大于所述第二阈值,则将所述像素点的参数值更新为第一设定值;
根据所述每个像素点更新后的参数值,形成第二分割图像。
可选地,根据所述第一分割图像和所述第二分割图像判断所述摄像头模组是否存在脏污包括:
获取所述第一分割图像中指定参数的参数值为第一设定值的像素点的数量D1,以及所述第二分割图像中指定参数的参数值为第一设定值的像素点的数量D2;
获取所述D2和所述D1的差值D;
获取所述D和所述D1的比值E;
若所述E大于或等于预先设置的第二比值阈值EE,则确定所述摄像头模组存在脏污;若所述E小于所述EE,则确定所述摄像头模组未存在脏污。
可选地,所述形状特征是指所述特定形状的形变程度。
可选地,所述形变程度通过所述特定形状的填充率来表征;所述填充率是指,所述特定形状的连通域面积和最小外接图形的面积的比值。
可选地,获取所述特定图像的形状特征包括:
获取第一分割图像内的N个连通域;N为自然数;
获取所述N个连通域中每个连通域的最小外接图形;所述最小外接图形与所述特定形状相同;
根据所述连通域和对应的最小外接图形确定所述特定图像的形状特征。
可选地,获取第一分割图像内的N个连通域包括:
获取所述第一分割图像内的M1个连通域;M1为正整数,且大于或者等于M;
获取所述M1个连通域中每个连通域的属性;
根据所述每个连通域的属性滤除所述M1个连通域中不满足预设条件的连通域,得到N个连通域;
所述预设条件是指连通域的中心距离与所述特定图像的中心距离小于或者等于预先设置的距离阈值。
可选地,所述连通域的属性包括:中心位置、面积、最小外接图形、最小外接图形的面积、宽高比、连通域边界与第一分割图像边界的相互位置中的至少一种。
可选地,根据所述连通域和对应的最小外接图形确定所述特定图像的形状特征包括:
分别计算所述每个连通域的面积与对应的所述最小外接图形的面积;
计算所述每个连通域的面积与对应的所述最小外接图形的面积的比值F,所述比值F为所述特定图像的填充率。
可选地,根据所述形状特征判断所述摄像头模组是否存在脏污包括:
若所述N个连通域中每个连通域对应的比值F大于或等于预先设置的形变阈值FF,则确定所述摄像头模组未存在脏污;
若所述N个连通域中存在一个连通域对应的比值F小于所述形变阈值FF,则确定所述摄像头模组存在脏污。
根据本发明的第二方面,提供一种检测摄像头模组的设备,包括处理器 和存储器,所述存储器中存储若干指令,所述处理器从所述存储器中读取指令,用于实现第一方面所述方法的步骤。
根据本发明的第三方面,提供一种检测摄像头模组的系统,包括第二方面所述的检测摄像头模组的设备、光源模组和密封箱体;其中,
所述光源模组用于提供均匀的出光;
所述密封箱体设置在所述光源模组的外部,用于为所述摄像头模组提供一个仅有所述光源模组出光的检测环境;
在检测前,将所述摄像头模组放置在所述密封箱体内部,且所述摄像头模组中镜面的法线与所述光源模组的出光面垂直;
所述设备与所述摄像头模组连接,用于控制所述摄像头模组拍摄特定图像,并根据所述特定图像检测所述摄像头模组是否脏污。
可选地,所述光源模组包括:面光源和标志透光板;
所述面光源设置有平整的出光面;所述出光面上贴附有所述标志透光板;
所述标志透光板采用黑色吸光材料制成,且所述标志透光板上设有若干个特定形状的孔洞。
可选地,所述光源模组包括:面光源;所述面光源设置有采用黑色吸光材料制成的出光面,且所述出光面上设有若干个特定形状的孔洞。
可选地,所述特定形状包括:矩形、三角形、圆形中的至少一种。
可选地,所述若干个特定形状的孔洞按照规则分布。
可选地,所述系统还包括由动组件和静组件构成的位置调整模组;所述动组件用于固定在所述光源模组或者所述摄像头模组;所述光源模组和所述摄像头模组之间的距离与所述动组件和所述静组件之间的相对位置相关。
可选地,所述光源模组和所述摄像头模组之间的距离小于或者等于第一距离;所述第一距离为所述光源模组的出光面充满所述摄像头模组拍摄的图像时对应的距离。
可选地,所述系统还包括显示模组,所述显示模组与所述设备连接,至少用于显示所述摄像头模组的脏污检测结果。
根据本发明的第四方面,提供一种机器可读存储介质,所述机器可读存储介质上存储有若干计算机指令,所述计算机指令被执行时实现第一方面所述方法的步骤。
由上述的技术方案可见,本实施例通过摄像头模组所拍摄的特定图像;然后获取特定图像的亮度分布和/或形变特征;最后,根据亮度分布和/或形变特征判断摄像头模组是否存在脏污。可见,本实施例中无需人工检测,从而使检测结果与主观判断无关,有利于提升检测结果的准确度。另外,本实施例确定检测结果的速度远远大于人工检测的速度,能够提升检测摄像头模组脏污的效率。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本发明一实施例提供的一种检测摄像头模组的系统的框图;
图2是本发明一实施例提供的一种光源模组的结构示意图;
图3是本发明另一实施例提供的一种光源模组的结构示意图;
图4是本发明一实施例提供的一种包含M个特定形状的特定图像的示意图;
图5是本发明一实施例提供的摄像头模组中图像传感器的感光区域和光源模组的出光面之间位置关系的示意图;其中,图5(a)是出光面位于感光区域内部的场景;图5(b)是感光区域位于出光面内部的场景;
图6是本发明一实施例提供的一种位置调整模组的结构示意图;其中图6(a)是图1中密封箱体去掉顶盖(图6的上方)之后的俯视图;图6(b)是图1中密封箱体去掉前侧面(图6的正前方)之后的正视图;
图7是本发明另一实施例提供的一种检测摄像头模组的系统的框图;
图8是本发明一实施例提供的一种检测摄像头模组的设备的框图;
图9是本发明一实施例提供的一种检测摄像头模组的方法的流程示意图;
图10是本发明另一实施例提供的一种检测摄像头模组的方法的流程示意图;
图11是本发明又一实施例提供的一种检测摄像头模组的方法的流程示意图;
图12是本发明再一实施例提供的一种检测摄像头模组的方法的流程示意图;
图13是本发明再一实施例提供的一种检测摄像头模组的方法的流程示意图;
图14是本发明又一实施例提供的一种检测摄像头模组的方法的流程示意图;
图15是本发明一实施例提供的第一分割图像获取过程的示意图;
图16是本发明一实施例提供的第二分割图像获取过程的示意图;
图17是本发明又一实施例提供的一种检测摄像头模组的方法的流程示意图;
图18是本发明又一实施例提供的一种检测摄像头模组的方法的流程示意图;
图19是本发明一实施例提供的特定图像的连通域的示意图;
图20是本发明一实施例提供的获取连通域的流程示意图;
图21是本发明一实施例提供的连通域的最小外接图形的示意图;
图22是本发明一实施例提供的获取填充率的流程示意图;
图23是本发明又一实施例提供的一种检测摄像头模组的方法的流程示意图;
图24是本发明一实施例提供的一种检测摄像头模组的方法的流程示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
现有的摄像头模组至少包括图像传感器和镜头两部分,在拍摄特定图像的过程中,来自光源的光线会通过镜头到达图像传感器,由图像传感器感光后得到相应的图像。若不存在脏污,镜头和镜头与图像传感器之间空气可看成均匀介质,这样各光线到达图像传感器的光程相等。
实际应用中,在生产、制造、检测等过程中摄像头模组的镜头上会沾有油污、指纹、灰尘等脏污、图像传感器上会有灰尘等脏污,使得镜头或者镜头与图像传感器之间空气不再是均匀介质,为保证光程相等,光线会发生相应的折射,导致光线出射到不应该出现的位置,从而使得有脏污和无脏污所形成的图像存在不同。因此在配置之前需要对摄像头模组进行脏污检测。
目前,摄像头模组的脏污检测由人工完成,检测人员采用显微镜查看摄像头模组的镜面等部位,以判断出存在的脏污。但是,该方法检测效率较低,且人工判断主观性太强,导致检测结果的误差较大。
为此,本发明实施例提供了一种解决上述问题的检测摄像头模组的系统,图1是本发明一实施例提供的一种检测摄像头模组的系统的框图。参见图1,一种检测摄像头模组的系统包括:光源模组11、密封箱体12和检测摄像头模组的设备13。其中:
密封箱体12设置在光源模组11的外部,被检测的摄像头模组14也需要在检测前放置在密封箱体12的内部。并且摄像头模组14镜面的法线141与光源模组11的出光面112垂直。其中,出光面的形状不作限定,可以为矩形、圆形或多边形等,后续以出光面为圆形为例进行描述。光源模组11可以以粘贴、螺栓等方式固定在密封箱体上,也可以固定在后续的位置调整模组15的 动组件151之上。摄像头模组14可以粘贴、螺栓等方式可以拆卸地固定在密封箱体12的内部,也可以可拆卸地固定在后续的位置调整模组15的动组件151之上。
本实施例中,密封箱体12能够避免箱体之外的光线进入其内部,即:在光源模组11关闭(即无出光)时,密封箱体12内部呈现黑暗状态;在光源模组11开启后,密封箱体12内部仅存在光源模组11的出光。
本实施例中,光源模组11可以提供均匀的出光。从摄像头模组14的角度看向光源模组11的出光面,可以看到M个特定形状,M为自然数。
在一实施例中,特定形状可以包括:矩形、三角形、圆形中的至少一种。当然,技术人员还可以选择例如正五边形、正六边形等正多边形的形状来替代上述矩形等,同样可以实现本申请的方案。
本实施例中,M可以取值为1,即特定形状可以为一个。当然,为提高检测精度,M可以取值为多个,此时特定形状可以为多个,这些特定形状可以按照规则布置多个,例如,按行排列、按列排列、按照图形排列,从而尽可能多的布置孔洞。为方便说明,后续实施例中以正方形为例说明。
在又一实施例中,可以通过调整光源模组11的结构,从而形成特定图像中的特定形状,包括以下方式:
方式一,参见图2,光源模组11可以包括:面光源113和标志透光板114。其中,面光源113设置有平整的出光面;出光面上贴附有标志透光板114。通常情况下,标志透光板114还可以称之为Chart表。标志透光板114上可以设有M(为自然数)个特定形状的孔洞115,从而使光线从孔洞115中透过以及投射到标志透光板114上的光线无法透过。为此,标志透光板114可以采用黑色吸光材料制成,例如黑色布、纳米碳管黑体材料、或者石墨烯等。技术人员可以根据具体场景选择合适的材料制成标志透光板114,在能够实现孔洞115透光且孔洞115之外区域不透光的基础上,技术人员所选择的制成标志透光板114的材料也落入本申请的保护范围。
在一实施例中,光源模组11还可以包括粘贴层116。这样,可以通过粘 贴层116将标志透光板114粘贴在面光源113的出光面112一侧。该粘贴层116可以为固态材料直接制成,将面光源113和标志透光板114分别置于粘贴层116的两侧后压实即可。当然,该粘贴层116也可以采用液态材料形成将液态材料均匀的涂抹在面光源113上,将标志透光板114压实在面光源113上,等液态材料凝固后即可。可理解的是,该粘贴层116需要有较好的透光性,从而保证面光源113的出光尽可能多的到达标志透光板114,这样在摄像头模组14的位置可以看到包含M个特定形状的出光面。
方式二,参见图3,光源模组11可以包括:面光源113。面光源113设置有采用黑色吸光材料制成的出光面112,且出光面112上设有M个特定形状的孔洞115,这样面光源113发出的光线仅可以透过孔洞115出射,从而在摄像头模组14的位置可以看到包含M个特定形状的出光面。
本实施例中,检测摄像头模组的设备13与摄像头模组14连接,连接方式可以包括有线连接和无线连接,技术人员可以根据具体场景选择合适的连接方式,在此不作限定。
检测摄像头模组的设备13上可以设置按钮或者触摸屏上可以设置有虚拟按钮,检测人员可以触发设备13上的按钮或者虚拟按钮,控制摄像头模组14拍摄特定图像,且特定图像中可以包括如图4所示的特定形状。摄像头模组14可以将所拍摄的特定图像发送给检测摄像头模组的设备13。之后,检测摄像头模组的设备13可以根据特定图像检测摄像头模组是否有脏污。其中脏污可以包括污渍、油污、指纹痕迹或者灰尘等外部脏污,还可以包括镜头不均匀、镜面不平整、图像传感器感光有问题等摄像头模组14的自身脏污。即本发明提供的系统可以检测摄像头模组14的自身脏污和/或外部脏污,检测方式在后续的方法实施例中会作详细描述,在此先不作说明。
本实施例中,摄像头模组14和光源模组11的出光面的位置关系,参见图5(a)和图5(b),可以包括:
参见图5(a),技术人员还可以调整摄像头模组14的位置、摄像头模组14中镜头的焦距或者光源模组11的位置,使摄像头模组14中图像传感器的 感光区域142大于或者外接于光源模组11的出光面。这样,特定图像中可以包括光源模组11的出光面周围区域。
本实施例中,检测摄像头模组的设备13可以通过调整摄像头模组14的镜头角度,这样可以在不同角度拍摄至少一张特定图像,得到多张特定图像。基于每个角度的至少一张特定图像,设备13调用图像识别算法可以识别出出光面区域,从而可以确定出摄像头模组14对应区域是否脏污。然后,可以结合多个角度的脏污程度确定摄像头模组14是否脏污。后续作详细描述,在此先不作说明。
参见图5(b),技术人员可以调整摄像头模组14的位置或者摄像头模组14中镜头的焦距,使摄像头模组14中图像传感器的感光区域142小于或者内切于光源模组11的出光面。这样,特定图像中可以不包括光源模组11的出光面周围的区域,即特定图像全部对应光源模组11出光面的有效检测区域,因此仅需要一张特定图像即可检测出摄像头模组14是否脏污,从而降低检测摄像头模组的设备13的数据计算量,提高后续检测脏污的实时性。
需要说明的是,技术人员可以根据具体场景选择图5(a)或者图5(b)所示的布置方式。当然,技术人员还可以选择其他方式调整摄像头模组14和出光面的位置关系,在实现获取到特定图像的情况下,并且利用特定图像能够检测出摄像头模组是否脏污的情况下,相应的方案同样落入本申请的保护范围。
由于摄像头模组有不同的尺寸,导致摄像头模组14和光源模组11的出光面之间的位置关系发生变化。参见图6(a)和图6(b),在一实施例中,检测摄像头模组的系统还包括由动组件151和静组件152构成的位置调整模组15。其中,动组件151可以固定在光源模组11或者摄像头模组14(图6中以固定摄像头模组14为例)。光源模组11和摄像头模组14之间的距离L与动组件151和静组件152之间的相对位置相关。可理解的是,通过移动动组件151,可以调整动组件151和静组件152之间的相对位置,从而调整光源模组11的出光面在摄像头模组14中图像传感器的感光区域142的位置。
在另一实施例中,在检测摄像头模组14之前,检测人员可以预先通过位置调整模组15,调整摄像头模组14和光源模组11之间的位置,使光源模组11的出光面在感光区域142的位置呈现图5(a)或者图5(b)所示,并记录下此场景下光源模组11和摄像头模组14之间的距离。在一实施例中,可以将光源模组11的出光面刚充满感光区域142(即感光区域142内切于出光面)时的距离称之为第一距离。例如,在光源模组11和摄像头模组14之间的距离L小于或等于第一距离时,光源模组11的出光面可以充满感光区域142;在大于第一距离时,光源模组11的出光面无法充满感光区域142。
可见,通过设置位置调整模组,本实施例中可以使检测摄像头模组的系统检测不同尺寸的摄像头模组,从而提高系统的适应范围。
在一实施例中,参见图7,检测摄像头模组的系统还可以包括显示模组16。显示模组16与检测摄像头模组的设备13连接,至少用于显示摄像头模组的脏污检测结果。当然,该显示模组16还可以显示摄像头模组14所拍摄的特定图像,以及显示历次检测结果等,技术人员可以根据具体场景设置显示模组的显示内容,在此不作限定。
本发明一实施例还提供了一种检测摄像头模组的设备,图8是本发明一实施例提供的一种检测摄像头模组的设备的框图。参见图8,检测摄像头模组的设备800包括处理器801和存储器802。其中,存储器802中存储若干指令,处理器801从存储器802中读取指令,从而实现如图9所示的方法,包括:
901,获取到摄像头模组所拍摄的特定图像;
902,获取特定图像的亮度分布和/或形状特征;
903,最后根据特定图像的亮度分布和/或形状特征判断摄像头模组是否存在脏污。
可见,本实施例提供的检测摄像头模组的设备可以自动确定摄像头模组是否存在脏污,无需人工检测,从而使检测结果与主观判断无关,有利于提升检测结果的准确度。另外,本实施例确定检测结果的速度远远大于人工检测的速度,能够提升检测摄像头模组脏污的效率。
下面结合图1~图7所示的检测摄像头模组的系统、图8所示的检测摄像头模组的设备以及图9所示的方法流程示意图,描述检测摄像头模组的设备确定摄像头模组是否存在脏污的过程,可以包括场景一、场景二、场景一和场景二形成的场景三和场景四。可理解的是,各场景可以检测一个摄像头模组,还可以同时检测两个以上的摄像头模组模组。其中,两个以上的摄像头模组的检测过程和一个摄像头模组检测过程相似,为方便描述,后续以检测一个摄像头模组为例进行说明。
场景一
本场景中,处理器根据特定图像的亮度分布判断摄像头模组是否存在脏污。若摄像头模组未存在脏污,则光线仅透过标志透光板上的孔洞且无折射,从而可以形成特定形状。若摄像头模组存在脏污,则光线穿过孔洞的光线会受到脏污的影响发生折射,从而使光线出射到本应该为黑色的背景区域(特定形状之外的区域),使得图像上白点增多,导致背景异亮。
需要说明的是,特定图像中各像素点可以包括多个参数的参数值,例如亮度值、灰度值等等。本实施例中以各像素点的灰度值作为指定参数进行描述。
参见图10,处理器通过获取特定图像中各像素点的灰度值,例如灰度值的取值范围可以为0~255,可以得到特定图像的亮度分布(对应步骤902)。
理想情况下,拍摄的特定图像中特定形状内像素点的灰度值都为灰度最大值(例如255),特定形状之外的区域即背景区域内像素点的灰度值都为灰度最小值(例如为0)。由于光源模组的出光、空气、镜头均匀度等(符合标准的)客观误差造成特定区域内像素点的灰度值不一定为最大值,以及传播过程中光线能量损耗,到达背景区域后对应白点的灰度值也不是灰度最大值(例如200)。
为保证能够选取出背景异亮时位于背景区域内的白点,本实施例中可以预先设置灰度值的阈值即第一阈值和第二阈值,且第一阈值大于第二阈值。理想情况下,特定形状内像素点的灰度值应该全部大于或等于第二阈值,特 定形状之外像素点的灰度值应该全部小于或等于第一阈值,并且不存在灰度值位于第一阈值和第二阈值之间的像素点。实际应用中,由于光源模组出光面的各处光线的强度可能有强有弱以及标志透光板并不是理论上的纯黑,使光线到达标志透光板时可能存在亮度,即特定形状之外区域的像素点的灰度值可能大于第一阈值。或者,光线在到达感光区域之前存在衰减损耗,导致特定形状内像素点的灰度值小于第二阈值,即存在灰度值位于第一阈值和第二阈值之间的极少数像素点。
另外,若摄像头模组脏污,应该到达特定形状内光线受到脏污的影响肯定会衰减并发生折射而到达特定区域之外,使特定区域之外的区域内像素点(白点)的灰度值超过第一阈值,这样,灰度值大于第一阈值的像素点的数量会远大于灰度值大于第二阈值的像素点的数量。
换言之,理想情况下,灰度值位于第一阈值和第二阈值之间的像素点数量应该为0;在误差允许的情况下,灰度值位于第一阈值和第二阈值之间的像素点数量是较少(例如占比1%~4%);在脏污的情况下,灰度值位于第一阈值和第二阈值之间的像素点数量迅速增加(例如占比10%以上)。
其中,第一阈值和第二阈值可以基于现有的大数据方式学习得到,具体学习方式可以参考相关技术,在此不作限定。
当然,第一阈值和第二阈值可以基于经验值预先设置。例如,第一阈值可以设置为180,第二阈值可以设置为65。技术人员可以根据具体场景选择第一阈值和第二阈值,在能够实现本申请的方案的情况下,同样落入本申请的保护范围。
因此,处理器可以从存储器内读取灰度值的第一阈值和第二阈值(对应步骤1001)。
最后,处理器根据亮度分布、第一阈值和第二阈值可以判断摄像头模组是否存在脏污(对应步骤1002)。
本实施例中,根据亮度分布、第一阈值和第二阈值判断摄像头模组是否存在脏污的方式可以包括方式一和方式二。其中:
方式一,原理为:若特定图像中灰度值位于第一阈值和第二阈值之间的像素点的数量为0或者较少(例如占比1%~4%),则确定摄像头模组是干净的。若数量较多,则确定摄像头模组是脏污的。
参见图11,针对特定图像中各像素点,处理器对比各像素点的灰度值与第一阈值和第二阈值的大小,然后统计灰度值位于第一阈值和第二阈值之间的像素点的数量A(对应步骤1101)。之后,处理器可以根据数量A判断出摄像头模组是否存在脏污(对应步骤1102)。
在一实施例中,参见图12,处理器获取预先设置的数量阈值AA,对比数量阈值AA和数量A的大小(对应步骤1201)。若数量A大于或等于数量阈值AA,则处理器可以确定摄像头模组存在脏污(对应步骤1202)。
其中,数量阈值AA可以基于大数据方式学习得到或者可以基于经验值预先设置。例如,可以建立数量阈值AA与摄像头模组的脏污结果的模型,在保证脏污结果准确率的情况下,确定数量阈值AA的取值范围,并从取值范围内随机选择,或者选择最小或最大的值作为数量阈值AA的最终取值。
在另一实施例中,参见图13,处理器可以在统计灰度值位于第一阈值和第二阈值之间的像素点的数量A的同时、之前或之后,统计出特定图像中灰度值大于第一阈值的像素点的数量B(对应步骤1301)。然后,处理器计算数量A和数量B的比值C(对应步骤1302)。之后,处理器获取预先设置的第一比值阈值CC,并对比C和CC的大小,若C大于或者等于CC,处理器确定摄像头模组存在脏污;若C小于CC,则确定摄像头模组未存在脏污(对应步骤1303)。
需要说明的是,第一比值阈值CC可以基于大数据方式学习得到或可以基于经验值预先设置,其设置方式可以参考第一阈值和第二阈值的设置方式,在此不作限定。
方式二,原理为:若特定图像中灰度值位于第一阈值和第二阈值之间的像素点的数量为0或者较少的,则确定摄像头模组是干净的。若数量较多,则确定摄像头模组是脏污的。继续延伸,对于同一帧特定图像,以第一阈值 为灰度值的临界点,然后调整特定图像中各像素点的灰度值:若像素点的灰度值大于该第一阈值,则像素点的灰度值调整为灰度最大值(如255);若像素点的灰度值小于或等于该第一阈值,则像素点的灰度值调整灰度最小值(如0),从而获取到特定图像对应的二值化图像即第一分割图像。同理,以第二阈值为灰度值的临界点,获取到特定图像对应的二值化图像即第二分割图像。若摄像头模组是干净的,那么第一分割图像和第二分割图像中灰度值为255的像素点的数量差值应该为0或较少。若摄像头模组是脏污的,则数量差值较多。
需要说明的是,第一分割图像、第二分割图像两者之间灰度值为255的像素点的数量来判断摄像头模组是否脏污的构思,技术人员还可以利用灰度值为0的像素点的数量来判断摄像头模组是否脏污。由于灰度值0和灰度值255为各分割图像的两个灰度值,对应像素点的数量是互补的,因此可以利用第二分割图像中灰度值为0的像素点与第一分割图像灰度值为0的像素点的数量变化来判断摄像头模组是否脏污,即若摄像头模组是干净的,那么第一分割图像和第二分割图像中灰度值为0的像素点的数量差值应该为0或较少。若摄像头模组是脏污的,则数量差值较多。
参见图14,处理器根据特定图像的亮度分布、第一阈值和第二阈值获取第一分割图像和第二分割图像(对应步骤1401)。
首先,参见图15,处理器可以根据亮度分布和第一阈值获取第一分割图像的步骤包括:
图15(a)是特定图像的亮度分布的示意图。针对特定图像中每个像素点,假设第一阈值为180,处理器比较像素点的灰度值和第一阈值的大小,得到如图15(b)所示的对比结果,其中加粗和加下划线的数字为大于或者等于第一阈值的像素点的灰度值,其他数字为小于第一阈值的像素点的灰度值。最后,处理器将大于或者等于第一阈值的像素点的灰度值更新为第一设定值,并且将灰度值小于第一阈值的像素点的灰度值更新为第二设定值,从而可以得到如图15(c)所示的第一分割图像。
其中,第一设定值可以设置为255,即灰度值最大值;第二设定值可以设置为0,即灰度值最大值。当然,第一设定值可以设置为1,第二设定值还可以设置为0。技术人员可以根据具备场景进行设置,在此不作限定。
参见图16,处理器可以根据亮度分布和第二阈值获取第二分割图像的步骤包括:
图16(a)是特定图像的亮度分布的示意图。针对特定图像中每个像素点,假设第二阈值为65,处理器比较像素点的灰度值和第二阈值的大小,得到如图16(b)所示的对比结果,其中加粗和加下划线的数字为小于或者等于第二阈值的像素点的灰度值,其他数字为大于第二阈值的像素点的灰度值。最后,处理器将小于或者等于第二阈值的像素点的灰度值更新为第二设定值,并且将灰度值大于第二阈值的像素点的灰度值更新为第一设定值,从而可以得到如图16(c)所示的第二分割图像。
然后,处理器可以根据第一分割图像和第二分割图像判断摄像头模组是否存在脏污(对应步骤1402),参见图17,包括:
第一,处理器可以获取第一分割图像中灰度值为第一设定值(255)的像素点的个数D1,图15(c)中D1为13。同时,处理器还可以获取第二分割图像中灰度值为第一设定值(255)的像素点的个数D2,图16(c)中D2为14(对应步骤1701)。
第二,处理器获取D2和D1的差值D,图15(c)和图16(c)对应差值D为1(对应步骤1702)。
第三,处理器获取差值D和第一分割图像中灰度值为第一设定值的像素点的个数D1的比值E(对应步骤1702),图15对应比值E为1/13*100%=7.69%。
第四,处理器获取预先设置的第二比值阈值EE,并对比E和EE的大小。若E大于或等于EE,则确定摄像头模组存在脏污;若E小于EE,则确定摄像头模组未存在脏污。例如第二比值阈值EE为5%,比值E大于EE,则处理器可以确定摄像头模组存在脏污。
需要说明的是,第二比值阈值EE可以基于大数据方式学习得到或可以基 于经验值预先设置,其设置方式可以参考第一阈值和第二阈值的设置方式,在此不作限定。
由上述的技术方案可见,本实施例通过摄像头模组所拍摄的特定图像;然后获取特定图像的亮度分布;最后根据亮度分布判断摄像头模组是否存在脏污。可见,本实施例中无需人工检测,从而使检测结果与主观判断无关,有利于提升检测结果的准确度。另外,本实施例确定检测结果的速度远远大于人工检测的速度,能够提升检测摄像头模组脏污的效率。
场景二
本场景中,处理器根据特定图像的形状特征分布判断摄像头模组是否存在脏污。若摄像头模组不存在脏污,由于摄像头模组与光源模组的出光面垂直,因此特定图像中特定形状是规则的,与孔洞的形状相同。若摄像头模组存在脏污,光线会折射并导致特定形状的边缘发生变化,如内凹或者外凸,从而使特定形状存在形变。因此,本实施例中,特定形状的形状特征是指特定形状的形变程度。在一实施例中,形变程度通过特定形状的填充率来表征。填充率是指,特定形状的连通域面积和最小外接图形的面积的比值。
首先,本实施例中处理器获取特定图像的形状特征,参见图18,包括:
1801,处理器获取第一分割图像内的N个连通域,得到如图19所示的连通域分布图。其中,N为自然数。
本实施例中,参见图20,处理器可以调用预先设置的连通域算法获取第一分割图像内的M1个连通域(对应步骤2001);其中M1为正整数,且大于或者等于特定形状的数量M。然后,处理器可以获取M1个连通域中每个连通域的属性(对应步骤2002)。其中,属性包括:中心位置、面积、最小外接图形、最小外接图形的面积、宽高比、连通域边界与第一分割图像边界的相互位置中的至少一种。之后,处理器根据每个连通域的属性滤除所述M1个连通域中不满足预设条件的连通域,得到N个连通域(对应步骤2003)。
需要说明的是,本实施例中连通域算法可以采用相关技术中的四连通法或者八连通法实现,本发明不作限定。
需要说明的是,在一实施例中连通域的属性可以为中心位置和宽高比,此时预设条件可以是连通域的中心位置与特定图像的中心位置之间的距离小于或者等于预先设置的距离阈值,可见本实施例中通过设置预设条件可以滤除图像传感器的感光区域142内切于出光面的情况下,感光区域142的边缘分割特定形状而出现的连通域,从而得到特定图像的中心位置周围且完整的连通域,有利于提升确定摄像头模组是否脏污的准确度。
1802,处理器获取N个连通域中每个连通域的最小外接图形;所述最小外接图形与所述特定形状相同。参见图21,右侧下方虚线圈内的连通域20的形状与特定形状相同,因此其最小外接图形22与特定形状仍然相同,因此,本实施例中对于连通域与最小外接图形相同的连通域未标出其最小外接图形。继续参见图21,右侧上方虚线圈内的连通域21发生形变,其最小外接图形22仍然与特定形状相同。
1803,处理器根据所述连通域和对应的最小外接图形确定所述特定图像的形状特征。在一实施例中,参见图22,处理器计算每个连通域的面积与对应的最小外接图形的面积(对应步骤2201)。例如,对于图21右侧上方虚线圈内的连通域21,处理器可以计算出连通域21的面积为0.0945平方毫米,同时,处理器还可以计算出连通域21的最小外接图形的面积为0.10平方毫米。又如,连通域20的面积为0.10平方毫米。最后,处理器可以计算出连通域的面积与对应的最小外接图形的面积的比值F。继续以连通域20、连通域21和最小外接图形22的比值F,其中,连通域20对应的比值F为100%,而连通域21对应的比值F为94.5%,即比值F为连通域与最小外接图形的填充率。
由于本实施例中通过填充率表征特定图像的形变程度,因此本实施例可以得到特定图像的形变程度,即特定图像的形变程度为94.5%。
其次,处理器根据形状特征判断摄像头模组是否存在脏污。参见图23,处理器获取预先设置的形变阈值FF(对应步骤2301),此形变阈值可以基于大数据方式学习方式得到,还可以基于经验值预先设置。之后,处理器对应比值F和形变阈值FF,若N个连通域中每个连通域对应的比值F大于或等于 预先设置的形变阈值FF,则确定摄像头模组未存在脏污;若N个连通域中存在一个连通域对应的比值F小于形变阈值FF,则确定摄像头模组存在脏污(对应步骤2302)。
例如,形变阈值FF可以设置为95%。由于特定图像中存在一个连通域对应的比值F为94.5%小于形变阈值FF(95%),因此基于该特定图像可以确定出摄像头模组存在脏污。
由上述的技术方案可见,本实施例通过摄像头模组所拍摄的特定图像;然后获取特定图像的形变特征;最后根据形变特征判断摄像头模组是否存在脏污。可见,本实施例中无需人工检测,从而使检测结果与主观判断无关,有利于提升检测结果的准确度。另外,本实施例确定检测结果的速度远远大于人工检测的速度,能够提升检测摄像头模组脏污的效率。
场景三
可理解的是,场景一和场景二中的各特征在不冲突的情况下,可以互相组合,从而构成不同的方案,这些方案同样落入本申请的保护范围。下面描述一种组合方案,参见图24:
首先,处理器可以先获取摄像头模组所拍摄的特定图像,并获取特定图像的亮度分布,亮度分布可以参见图15(a)所示。
然后,处理器获取灰度值的第一阈值和第二阈值,并且处理器可以根据亮度分布和第一阈值获取到特定图像的第一分割图像,获取第一分割图像的方式可以参考图15(a)~图15(c),第一分割图像可以参见图15(c);以及根据亮度分布和第二阈值获取特定图像的第二分割图像,获取第二分割图像的方式可以参考图16(a)~图16(c),并且第二分割图像可以参见图16(c)。
之后,处理器可以计算出第一分割图像中灰度值为第一设定值的像素点的数量D1以及第二分割图像中灰度值为第一设定值的像素点的数量D2。
再者,处理器根据数量D1和数量D2的差值D,并计算差值D和数量D1的比值E。处理器继续获取预先设置的第二比值阈值EE,对比比值E和第二比值阈值EE的大小。若E大于或者等于EE,则确定摄像头模组存在脏 污;若E小于EE,则根据亮度分布和第一阈值继续获取特定图像的第一分割图像,或者采用之前获取的第一分割图像。
然后,处理器可以调用预先设置的连通域算法获取第一分割图像内的N个连通域,其中滤除连通域步骤可以参见图20。该连通域算法可以采用相关技术中的四连通法或者八连通法实现。处理器获取N个连通域中每个连通域的最小外接图形,其中最小外接图像与特定图像中特定形状相同,连通域及其最小外接图形可以参见图21。
继续,处理器计算每个连通域的面积以及每个连通域对应的最小外接图形的面积,并基于两个面积计算比值F,该比值F为特定图像的填充率。
最后,处理器获取形变阈值FF,对比每个连通域F对应的比值F和形变阈值FF的大小。若比值F大于或者等于FF,则确定摄像头模组未存在脏污;若比值F小于FF,则确定摄像头模组存在脏污。
由上述的技术方案可见,本实施例通过摄像头模组所拍摄的特定图像;然后获取特定图像的亮度分布和形变特征;最后,根据亮度分布和形变特征判断摄像头模组是否存在脏污。可见,本实施例中无需人工检测,从而使检测结果与主观判断无关,有利于提升检测结果的准确度。另外,本实施例确定检测结果的速度远远大于人工检测的速度,能够提升检测摄像头模组脏污的效率。
场景四
场景一~场景三介绍了利用一张特定图像确定摄像头模组是否存在脏污的方案。
当摄像头模组的尺寸较大时,处理器还可以将摄像头模组中镜头分为X(为正整数)个区域,例如X取值4,这样处理器可以控制图像传感器分别获取X个角度中每个角度对应的特定图像,然后针对每个角度的特定图像,确定镜头对应的区域是否脏污。最终结合X个区域的脏污结果,从而可以得到摄像头模组是否脏污。处理器确定摄像头模组各区域是否脏污的方案可以参考场景一、场景二和场景三的方案,在此不再赘述。
可见,本实施例通过将摄像头模组的镜头划分为多个区域,无需增加图像传感器的分辨率,也无需调整摄像头模组与图像传感器之间的距离(即无需增加检测摄像头模组的系统中密封箱体的尺寸),还可以使本方案适用于不同尺寸的摄像头模组的检测场景。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上对本发明实施例所提供的检测装置和方法进行了详细介绍,本发明中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (31)

  1. 一种检测摄像头模组的方法,其特征在于,所述方法包括:
    获取摄像头模组所拍摄的特定图像;
    获取所述特定图像的亮度分布和/或形状特征;
    根据所述亮度分布和/或形状特征判断所述摄像头模组是否存在脏污。
  2. 根据权利要求1所述的方法,其特征在于,所述特定图像包括M个特定形状,M为自然数。
  3. 根据权利要求2所述的方法,其特征在于,所述特定形状包括矩形、三角形、圆形中的至少一种。
  4. 根据权利要求1所述的方法,其特征在于,所述亮度分布为所述特定图像中各像素点的指定参数的参数值,所述指定参数至少包括亮度值或者灰度值。
  5. 根据权利要求2所述的方法,其特征在于,所述形状特征为所述特定形状的形变量。
  6. 根据权利要求4所述的方法,其特征在于,根据所述亮度分布判断所述摄像头模组是否存在脏污包括:
    获取所述指定参数的第一阈值和第二阈值;
    根据所述亮度分布、所述第一阈值和所述第二阈值判断所述摄像头模组是否存在脏污。
  7. 根据权利要求6所述的方法,其特征在于,所述第一阈值和所述第二阈值基于大数据方式学习得到或者基于经验值预先设置。
  8. 根据权利要求6所述的方法,其特征在于,根据所述亮度分布、所述第一阈值和所述第二阈值判断所述摄像头模组是否存在脏污包括:
    基于所述亮度分布,获取所述特定图像中指定参数的参数值位于所述第一阈值和所述第二阈值之间的像素点的数量A;所述第一阈值大于所述第二阈值;
    根据所述数量A判断所述摄像头模组是否存在脏污。
  9. 根据权利要求8所述的方法,其特征在于,根据所述数量A判断所述摄像头模组是否存在脏污包括:
    对比所述数量A和预先设置的数量阈值AA;
    若所述A大于或等于所述AA,则确定所述摄像头模组存在脏污;若所述A小于所述AA,则确定所述摄像头模组未存在脏污。
  10. 根据权利要求8所述的方法,其特征在于,根据所述数量A判断所述摄像头模组是否存在脏污包括:
    获取所述特定图像中指定参数的参数值大于所述第一阈值的像素点的数量B;
    计算所述数量A和所述数量B的比值C;
    若所述比值C大于或等于预先设置的第一比值阈值CC,则确定所述摄像头模组存在脏污;若所述C小于所述CC,则确定所述摄像头模组未存在脏污。
  11. 根据权利要求6所述的方法,其特征在于,根据所述亮度分布、所述第一阈值和所述第二阈值判断所述摄像头模组是否存在脏污包括:
    根据所述亮度分布和所述第一阈值获取所述特定图像的第一分割图像,以及根据所述亮度分布和所述第二阈值获取所述特定图像的第二分割图像;
    根据所述第一分割图像和所述第二分割图像判断所述摄像头模组是否存在脏污。
  12. 根据权利要求11所述的方法,其特征在于,根据所述亮度分布和所述第一阈值获取所述特定图像的第一分割图像包括:
    针对所述特定图像中每个像素点,比较所述像素点的指定参数的参数值与所述第一阈值;
    若所述参数值大于或者等于所述第一阈值,则将所述像素点的参数值更新为第一设定值;若所述参数值小于所述第一阈值,则将所述像素点的参数值更新为第二设定值;
    根据所述每个像素点更新后的参数值,形成第一分割图像。
  13. 根据权利要求11所述的方法,其特征在于,根据所述亮度分布和所述第二阈值获取所述特定图像的第二分割图像包括:
    针对所述特定图像中每个像素点,比较所述像素点的指定参数的参数值与预设的第二阈值;
    若所述参数值小于或者等于所述第二阈值,则将所述像素点的参数值更新为第二设定值;若所述参数值大于所述第二阈值,则将所述像素点的参数值更新为第一设定值;
    根据所述每个像素点更新后的参数值,形成第二分割图像。
  14. 根据权利要求11所述的方法,其特征在于,根据所述第一分割图像和所述第二分割图像判断所述摄像头模组是否存在脏污包括:
    获取所述第一分割图像中指定参数的参数值为第一设定值的像素点的数量D1,以及所述第二分割图像中指定参数的参数值为第一设定值的像素点的数量D2;
    获取所述D2和所述D1的差值D;
    获取所述D和所述D1的比值E;
    若所述E大于或等于预先设置的第二比值阈值EE,则确定所述摄像头模组存在脏污;若所述E小于所述EE,则确定所述摄像头模组未存在脏污。
  15. 根据权利要求2所述的方法,其特征在于,所述形状特征是指所述特定形状的形变程度。
  16. 根据权利要求15所述的方法,其特征在于,所述形变程度通过所述特定形状的填充率来表征;所述填充率是指,所述特定形状的连通域面积和最小外接图形的面积的比值。
  17. 根据权利要求16所述的方法,其特征在于,获取所述特定图像的形状特征包括:
    获取第一分割图像内的N个连通域;N为自然数;
    获取所述N个连通域中每个连通域的最小外接图形;所述最小外接图形与所述特定形状相同;
    根据所述连通域和对应的最小外接图形确定所述特定图像的形状特征。
  18. 根据权利要求17所述的方法,其特征在于,获取第一分割图像内的N个连通域包括:
    获取所述第一分割图像内的M1个连通域;M1为正整数,且大于或者等于M;
    获取所述M1个连通域中每个连通域的属性;
    根据所述每个连通域的属性滤除所述M1个连通域中不满足预设条件的连通域,得到N个连通域;
    所述预设条件是指连通域的中心距离与所述特定图像的中心距离小于或者等于预先设置的距离阈值。
  19. 根据权利要求18所述的方法,其特征在于,所述连通域的属性包括:中心位置、面积、最小外接图形、最小外接图形的面积、宽高比、连通域边界与第一分割图像边界的相互位置中的至少一种。
  20. 根据权利要求17所述的方法,其特征在于,根据所述连通域和对应的最小外接图形确定所述特定图像的形状特征包括:
    分别计算所述每个连通域的面积与对应的所述最小外接图形的面积;
    计算所述每个连通域的面积与对应的所述最小外接图形的面积的比值F,所述比值F为所述特定图像的填充率。
  21. 根据权利要求20所述的方法,其特征在于,根据所述形状特征判断所述摄像头模组是否存在脏污包括:
    若所述N个连通域中每个连通域对应的比值F大于或等于预先设置的形变阈值FF,则确定所述摄像头模组未存在脏污;
    若所述N个连通域中存在一个连通域对应的比值F小于所述形变阈值FF,则确定所述摄像头模组存在脏污。
  22. 一种检测摄像头模组的设备,其特征在于,所述设备包括处理器和存储器,所述存储器中存储若干指令,所述处理器从所述存储器中读取指令,用于实现权利要求1~21任一项所述方法的步骤。
  23. 一种检测摄像头模组的系统,其特征在于,所述系统包括权利要求22所述的检测摄像头模组的设备、光源模组和密封箱体;其中,
    所述光源模组用于提供均匀的出光;
    所述密封箱体设置在所述光源模组的外部,用于为所述摄像头模组提供一个仅有所述光源模组出光的检测环境;
    在检测前,将所述摄像头模组放置在所述密封箱体内部,且所述摄像头模组中镜面的法线与所述光源模组的出光面垂直;
    所述设备与所述摄像头模组连接,用于控制所述摄像头模组拍摄特定图像,并根据所述特定图像检测所述摄像头模组是否脏污。
  24. 根据权利要求23所述的系统,其特征在于,所述光源模组包括:面光源和标志透光板;
    所述面光源设置有平整的出光面;所述出光面上贴附有所述标志透光板;
    所述标志透光板采用黑色吸光材料制成,且所述标志透光板上设有若干个特定形状的孔洞。
  25. 根据权利要求23所述的系统,其特征在于,所述光源模组包括:面光源;所述面光源设置有采用黑色吸光材料制成的出光面,且所述出光面上设有若干个特定形状的孔洞。
  26. 根据权利要求24或25所述的系统,其特征在于,所述特定形状包括:矩形、三角形、圆形中的至少一种。
  27. 根据权利要求24或25所述的系统,其特征在于,所述若干个特定形状的孔洞按照规则分布。
  28. 根据权利要求23所述的系统,其特征在于,所述系统还包括由动组件和静组件构成的位置调整模组;所述动组件用于固定在所述光源模组或者所述摄像头模组;所述光源模组和所述摄像头模组之间的距离与所述动组件和所述静组件之间的相对位置相关。
  29. 根据权利要求28所述的系统,其特征在于,所述光源模组和所述摄像头模组之间的距离小于或者等于第一距离;所述第一距离为所述光源模组 的出光面充满所述摄像头模组拍摄的图像时对应的距离。
  30. 根据权利要求23所述的系统,其特征在于,所述系统还包括显示模组,所述显示模组与所述设备连接,至少用于显示所述摄像头模组的脏污检测结果。
  31. 一种机器可读存储介质,其特征在于,所述机器可读存储介质上存储有若干计算机指令,所述计算机指令被执行时实现权利要求1~21任一项所述方法的步骤。
PCT/CN2018/097666 2018-07-27 2018-07-27 检测摄像头模组的方法、设备、系统、机器可读存储介质 WO2020019352A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/097666 WO2020019352A1 (zh) 2018-07-27 2018-07-27 检测摄像头模组的方法、设备、系统、机器可读存储介质
CN201880039292.6A CN110800294A (zh) 2018-07-27 2018-07-27 检测摄像头模组的方法、设备、系统、机器可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/097666 WO2020019352A1 (zh) 2018-07-27 2018-07-27 检测摄像头模组的方法、设备、系统、机器可读存储介质

Publications (1)

Publication Number Publication Date
WO2020019352A1 true WO2020019352A1 (zh) 2020-01-30

Family

ID=69181213

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/097666 WO2020019352A1 (zh) 2018-07-27 2018-07-27 检测摄像头模组的方法、设备、系统、机器可读存储介质

Country Status (2)

Country Link
CN (1) CN110800294A (zh)
WO (1) WO2020019352A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111678673A (zh) * 2020-05-25 2020-09-18 歌尔光学科技有限公司 镜片检测方法、装置和可读存储介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111175221A (zh) * 2020-02-28 2020-05-19 西安石油大学 金属制品腐蚀性用检测装置
CN111724383A (zh) * 2020-06-30 2020-09-29 重庆盛泰光电有限公司 基于转盘的摄像头模组黑斑检测系统
CN111882540A (zh) * 2020-07-28 2020-11-03 歌尔科技有限公司 摄像头保护罩的污迹检测方法、装置以及设备
CN111787315A (zh) * 2020-08-05 2020-10-16 昆山软龙格自动化技术有限公司 一种基于fpga的嵌入式高速运算网卡装置
CN112235565A (zh) * 2020-09-25 2021-01-15 横店集团东磁有限公司 一种配合平面光源进行Flare异常检测的装置及方法
CN112255239B (zh) * 2020-10-22 2022-09-20 青岛歌尔声学科技有限公司 污染位置检测方法、装置、设备及计算机可读存储介质
CN114390225A (zh) * 2022-01-20 2022-04-22 上海安翰医疗技术有限公司 胶囊内窥镜脏污检测方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103179428A (zh) * 2011-12-23 2013-06-26 鸿富锦精密工业(深圳)有限公司 相机模组污点测试系统及其测试方法
CN104463827A (zh) * 2013-09-17 2015-03-25 联想(北京)有限公司 一种图像采集模块的自动检测方法及相应的电子设备
CN205005200U (zh) * 2015-10-22 2016-01-27 潍坊歌尔电子有限公司 一种镜头罩检测装置
CN105991996A (zh) * 2015-02-15 2016-10-05 宁波舜宇光电信息有限公司 一种摄像模组检测系统及检测方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103501435B (zh) * 2013-09-27 2015-09-02 上海半导体照明工程技术研究中心 用密闭led光源灯箱测试摄像机动态范围的方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103179428A (zh) * 2011-12-23 2013-06-26 鸿富锦精密工业(深圳)有限公司 相机模组污点测试系统及其测试方法
CN104463827A (zh) * 2013-09-17 2015-03-25 联想(北京)有限公司 一种图像采集模块的自动检测方法及相应的电子设备
CN105991996A (zh) * 2015-02-15 2016-10-05 宁波舜宇光电信息有限公司 一种摄像模组检测系统及检测方法
CN205005200U (zh) * 2015-10-22 2016-01-27 潍坊歌尔电子有限公司 一种镜头罩检测装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111678673A (zh) * 2020-05-25 2020-09-18 歌尔光学科技有限公司 镜片检测方法、装置和可读存储介质

Also Published As

Publication number Publication date
CN110800294A (zh) 2020-02-14

Similar Documents

Publication Publication Date Title
WO2020019352A1 (zh) 检测摄像头模组的方法、设备、系统、机器可读存储介质
JP3560694B2 (ja) レンズ検査のシステムと方法
AU2008237532B2 (en) Method and system for inspecting optical devices
CN110261410A (zh) 一种玻璃透镜缺陷的检测装置及方法
TWI480578B (zh) 偵測廣角鏡頭之光學中心的方法以及光學中心偵測裝置
CN111784684B (zh) 基于激光辅助的透明产品内部缺陷定深检测方法及装置
TWI512284B (zh) 玻璃氣泡瑕疵檢測系統
CN108548825A (zh) 一种基于二维光照的透明平板缺陷检测装置及方法
CA2880145A1 (fr) Procede de controle non destructif d'une preforme d'aube
JP2022533848A (ja) カメラ部品が損傷しているかどうかを判定するためのシステムおよび方法
JPH05223746A (ja) 透明物体の欠陥検出方法とその装置
JP2012237585A (ja) 欠陥検査方法
CN109612408B (zh) 半导体激光器发射角度测试方法、装置及可读存储介质
CN116237266A (zh) 一种法兰尺寸测量方法及其设备
US20190072784A1 (en) Contact lens inspection method and system
CN114219758A (zh) 缺陷检测方法、系统、电子设备和计算机可读存储介质
CN111815705B (zh) 激光跟踪仪滤光保护镜片污染识别方法、装置及电子设备
CN114384089A (zh) 检测智能显示屏的系统、方法及可读存储介质
JP3231592B2 (ja) 光学部材検査装置
JP2007285868A (ja) 輝度勾配検出方法、欠陥検出方法、輝度勾配検出装置および欠陥検出装置
TWI510776B (zh) 玻璃氣泡瑕疵檢測處理方法
JP5380223B2 (ja) 円形レンズの検査装置及び方法
JPH0933342A (ja) 照明輝度管理方法および光学部材検査装置
KR102584696B1 (ko) 표시 패널의 광학 검사 방법
TWI776275B (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: 18927524

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: 18927524

Country of ref document: EP

Kind code of ref document: A1