Camera detection method and device and electronic equipment
By using out-of-focus images to identify camera defects in camera inspection, the problems of high cost and low flexibility in the existing technology are solved, high-accuracy inspection in an open environment is achieved, inspection costs are reduced and flexibility is improved.
Patent Information
- Application Number
- CN202411037405.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-09-24
AI Technical Summary
Existing camera detection methods are costly and have low flexibility, and cannot effectively detect camera defects in equipment in an open environment. Especially in the recycling industry where clean rooms are lacking, the accuracy of detection results is low.
By obtaining the out-of-focus image of the background plate collected by the camera to be inspected, we perform defect feature detection based on the out-of-focus image, ignoring the blurred foreign objects in the image and focusing on the clearly reflected camera defect features, thereby reducing the interference of environmental foreign objects on the detection. , improve detection accuracy and reduce costs.
Even in a dust-free outdoor environment, it can improve the accuracy of camera defect detection, reduce detection costs, enhance detection flexibility, and avoid the use restrictions of clean rooms.
Smart Images

Figure CN118694918A
Abstract
Description
Technical Field
[0001] The present application relates to the field of camera detection technology, and more specifically, to a camera detection method, device and electronic equipment. Background Art
[0002] As an important structure for image acquisition, cameras are increasingly used in various electronic devices, such as mobile phones, tablet computers, laptops, etc. In order to ensure the quality of electronic devices, it is necessary to test the cameras in the devices, whether they are new devices or recycled old devices.
[0003] In current camera detection, in order to avoid interference of foreign objects such as dust on the detection, the detection process needs to be completed in a clean room, but the cost of clean rooms is high, and the detection flexibility is low because the detection area is fixed. Summary of the invention
[0004] Based on the above-mentioned defects and shortcomings of the prior art, the present application proposes a camera detection method, device and electronic equipment, which can solve the problems of high cost and low flexibility of the existing camera detection method.
[0005] According to a first aspect of an embodiment of the present application, a camera detection method is provided, the method comprising:
[0006] Obtain a defocused image of the background plate captured by the camera to be detected;
[0007] Based on the out-of-focus image, defect feature detection is performed on the camera to be detected; wherein the camera defect features include first-category defect features, and the first-category defect features refer to camera defect features whose detection results are affected by foreign objects on the background plate.
[0008] According to a second aspect of an embodiment of the present application, a camera detection device is provided, including:
[0009] The first image acquisition module is used to acquire a defocused image of the background plate captured by the camera to be detected;
[0010] The first defect detection module is used to perform defect feature detection on the camera to be detected based on the out-of-focus image; wherein the camera defect features include first-category defect features, and the first-category defect features refer to camera defect features whose detection results are affected by foreign matter on the background plate.
[0011] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a camera to be detected, a memory, and a processor, wherein the camera to be detected and the memory are respectively connected to the processor,
[0012] The camera to be detected is used to send the image captured from the background plate to the processor;
[0013] The memory is used to store programs;
[0014] The processor is used to implement the camera detection method as described in the first aspect based on the image captured by the camera to be detected by running the program in the memory.
[0015] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the camera detection method as described in the first aspect is implemented.
[0016] According to a fifth aspect of the embodiments of the present application, a computer program product or a computer program is provided, wherein the computer program product includes the computer program, and when the processor of a computer device executes the computer program, the steps in the camera detection method as described in the first aspect are implemented. Optionally, the computer program can be stored in a readable storage medium or a cloud of the computer device; the processor of the computer device reads the computer program from the readable storage medium or the cloud.
[0017] In the technical solution provided in the present application, defect feature detection is performed on the camera to be detected based on the out-of-focus image collected by the camera to be detected on the background plate. In the out-of-focus image, foreign matter (such as dust) on the background plate will become blurred due to the out-of-focus, and for the defects of the camera itself, its defect features will still be clearly reflected in the out-of-focus image. Therefore, in the camera defect detection, the blurred foreign matter in the image will be ignored, and the focus will be on the clearly reflected defect features. This can reduce the interference of foreign matter in the environment on the camera defect detection, so even if a clean room is not used, the accuracy of the detection result can be improved, and since there is no need to use a clean room, the detection cost can be reduced. Since it is not restricted by the dust-free detection environment, the setting of the detection area is more flexible, which makes the detection more flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of a flow chart of a camera detection method provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a background board provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of defect detection results provided in an embodiment of the present application;
[0022] Figure 4 A block diagram of a camera detection device provided in an embodiment of the present application;
[0023] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] Application Overview
[0026] In the current camera defect detection, in order to avoid interference with the detection caused by dust, dirt, etc., the detection process needs to be completed in a clean room. However, the construction cost of a clean room is high, and in the recycling industry (also known as the second-hand industry), equipment quality inspection workshops generally do not have standard clean rooms. However, if camera defect detection is performed in an open environment, the detection process will be greatly affected by environmental dust, and the accuracy of the detection results will be low.
[0027] In order to solve the aforementioned technical problems, the present application provides a camera detection technology, which detects the defect features of the camera based on the out-of-focus image captured by the camera to be detected of the background plate. In the out-of-focus image, foreign objects such as dust from the outside will become blurred due to the out-of-focus, while the defect features of the camera itself will still be clearly reflected in the out-of-focus image. Therefore, in defect detection, the blurred foreign objects in the image will be ignored, and the focus will be on the clearly reflected defect features. This can reduce the interference of foreign objects in the environment on the camera defect detection, and even if a clean room is not used, the accuracy of the detection results can be improved. Moreover, since there is no need to use a clean room, the detection cost can be reduced and the detection flexibility can be improved. Regarding the camera detection technology, the following description is provided for details.
[0028] Exemplary Methods
[0029] An embodiment of the present application provides a camera detection method, and the execution subject may be an electronic device provided with a camera to be detected, such as a mobile phone, a tablet computer, a laptop computer, etc.
[0030] The method is described in detail below through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0031] like Figure 1 As shown, the method may include step 101 and step 102, which are specifically described as follows:
[0032] Step 101: Obtain a defocused image of a background plate captured by a camera to be detected.
[0033] The defocused image described here may refer to an image acquired by focusing the background plate at infinity, in which the background plate and possible foreign matter (such as dust, etc.) on the background plate cannot be clearly presented.
[0034] Among them, the acquisition of the out-of-focus image can be fully manually controlled, for example, an electronic device with a camera to be detected can be handheld, and the electronic device can be manually controlled to collect the out-of-focus image of the background plate; optionally, the acquisition of the out-of-focus image can also be semi-automatic, for example, the electronic device with a camera to be detected can be fixed at the target position by a mechanical arm, and then the electronic device can be manually controlled to collect the out-of-focus image of the background plate; it can be understood that the acquisition of the out-of-focus image can also be fully automatic, that is, the placement of the electronic device and the control of taking pictures are all completed by the machine equipment. The specific acquisition method can be selected according to actual needs.
[0035] The background board described in the embodiment of the present application, the side of the image being captured can be called the background surface, and the background surface can be a white or solid color background close to white, and can preferably be a white background to reduce interference factors. When capturing a defocused image, it is required that the image capture field of view is the background board, that is, the defocused image is all background board images, to avoid interference from other object images to the camera defect detection. Optionally, the background surface of the background board is preferably made of non-reflective material to avoid reducing the image quality due to reflection and affecting the camera defect detection.
[0036] It should be noted that, in the embodiments of the present application, out-of-focus images can be collected in an open environment without being implemented in a clean room. In addition, before collecting out-of-focus images, at least the obvious foreign matter on the background surface can be cleaned, such as removing hair, large-area dirt, obvious dust, etc., to ensure that the background surface is relatively clean. If the obvious foreign matter cannot be removed, the background plate can be replaced and the new background plate can be used for camera defect detection to reduce the interference of external foreign matter on camera defect detection.
[0037] Step 102: Based on the out-of-focus image, defect feature detection is performed on the camera to be inspected.
[0038] The defect features of the camera mentioned here may include the first type of defect features, which refers to the camera defect features whose detection results are affected by foreign matter on the background plate, such as bad pixel features that are not obviously different from foreign matter such as dust, etc. Among them, the bad pixel feature generally refers to the point-shaped feature with a small area, clear edges and solid center. The foreign matter mentioned here may refer to foreign matter that is not easily detected by the naked eye, and can also be understood as tiny foreign matter.
[0039] Optionally, the out-of-focus image can be detected by a target detection algorithm to identify defect features of the camera to be detected. The target detection algorithm can be a traditional target detection algorithm, such as a method based on sliding window region selection, feature extraction (such as extracting scale-invariant feature transform (SIFT) features) and classifier (such as support vector machine (SVM)), or a target detection algorithm based on deep learning, which can be selected according to actual needs.
[0040] In the out-of-focus image, foreign objects that are not obvious on the background plate will become blurred due to the out-of-focus, while the defects of the camera itself will still be clearly reflected in the out-of-focus image. Therefore, in the camera defect detection, the blurred foreign objects in the image will be ignored, and the focus will be on the clearly reflected defect features. This can reduce the interference of foreign objects in the environment on the camera defect detection. Therefore, even if a clean room is not used, the accuracy of the test results can be improved. Since there is no need to use a clean room, the detection cost can also be reduced. Since it is not restricted by the dust-free detection environment, the setting of the detection area is more flexible, which makes the detection more flexible.
[0041] In some optional embodiments, the aforementioned defect features of the camera may include not only the first type of defect features, but also the second type of defect features, which refer to camera defect features whose detection results are not affected by foreign matter on the background plate, such as spot features, texture features, etc. Among them, spot features generally refer to features of lumps with large areas and blurred edges. Texture features generally refer to line features, texture features, such as an obvious black line, image faults, etc.
[0042] As described above, for the defects of the camera itself, its defect features will still be clearly reflected in the out-of-focus image, and the detection of the second type of defect features is not easily affected by foreign objects on the background plate. Therefore, in the embodiment of the present application, the second type of defect feature detection can also be performed on the camera to be detected based on the out-of-focus image of the background plate captured by the camera to be detected. In this way, multiple types of camera defect features can be identified through one frame of image, which is conducive to improving detection efficiency.
[0043] Similarly, the second type of defect feature detection can be performed using a traditional target detection algorithm or a deep learning-based target detection algorithm, and the specific selection can be based on actual needs.
[0044] In some optional embodiments, the camera detection method may further include step A1 and step A2, as described below:
[0045] Step A1: Obtain a focused image of the background plate captured by the camera to be detected.
[0046] The focused image mentioned here may refer to an image acquired when the focus of the camera to be detected is on the background plate. When the focusing function is normal, the background plate in the focused image should be clearly presented. Among them, the acquisition method of the focused image is similar to the acquisition method of the out-of-focus image, such as full manual acquisition, semi-automatic acquisition or full automatic acquisition, etc. The specific acquisition method can be selected according to actual needs.
[0047] Step A2: Based on the focused image, the camera to be inspected performs a second type of defect feature inspection.
[0048] In a defocused image, although the camera defect features are still clearly reflected in the image, some camera defect features (such as spot features) may be affected by the defocus, resulting in reduced clarity and affecting the detection results. In order to improve the accuracy of the detection results, the embodiment of the present application can detect the camera defect features whose defect detection results are not affected by foreign objects on the background plate through the focused image, that is, the second type of defect features.
[0049] There is no limit to the order of collecting the focused image and the defocused image. The focused image may be collected first and then the defocused image, or the defocused image may be collected first and then the focused image.
[0050] Optionally, the focused image and the defocused image can be collected by taking pictures. For example, the focus of the camera to be detected is first controlled to fall on the background plate, and then a frame of image is taken as the focused image. After that, the focal length of the camera to be detected is adjusted to infinity, and then a frame of image is taken as the defocused image. It is understandable that the reverse can also be done, that is: first adjust the focal length of the camera to be detected to infinity, and then take a frame of image as the defocused image; then control the focus of the camera to be detected to fall on the background plate, and then take a frame of image as the focused image.
[0051] Optionally, the focused image and the defocused image can also be collected by shooting a video. For example, at the beginning of the video shooting, the focus of the camera to be detected is controlled to fall on the background board, and then the focal length of the camera to be detected is adjusted to infinity, and then the video shooting is ended. Next, the first frame of the video image can be taken as the focused image and the last frame of the video can be taken as the defocused image. It can be understood that it can also be the other way around, that is: before the video shooting starts, first adjust the focal length of the camera to be detected to infinity, and then trigger the video shooting control to shoot the video; then reduce the focal length of the camera to be detected, control the focus of the camera to be detected to fall on the background board, and end the video shooting. Finally, the first frame of the video image can be taken as the defocused image and the last frame of the video can be taken as the focused image.
[0052] In some optional embodiments, the aforementioned step A2: performing a second type of defect feature detection on the camera to be detected based on the focused image may include steps A21 and A22, which are specifically described as follows:
[0053] Step A21: Based on the focused image, a classification algorithm is used to detect whether there are known second-category defect features in the image.
[0054] Step A22: When it is determined that there is no known second-type defect feature in the image, detect whether there is an unknown second-type defect feature in the focused image by using an anomaly detection algorithm.
[0055] The classification algorithm aims to classify data into different categories and requires labeled training data. The defect features that can be detected are all known defect features. The anomaly detection algorithm focuses on identifying abnormal or unusual data and generally does not require a large amount of labeled data for training. Based on this, in an embodiment of the present application, the classification algorithm can be used to first detect whether the image includes known second-class defect features. When the known second-class defect features are not detected by the classification algorithm, the anomaly detection algorithm can be used to detect whether there are unknown second-class defect features in the image. In this way, the camera defect feature detection can be more comprehensive to avoid omissions.
[0056] It can be understood that, in the case of detecting the second type of defect features based on the out-of-focus image, the second type of defect features can also be detected in the above manner, which will not be described in detail here.
[0057] In some optional embodiments, a target pattern may be drawn on the background plate, and the target pattern is used to detect the focus function of the camera to be detected. For example, whether the focus function of the camera to be detected is normal is determined based on the clarity of the target pattern in the image.
[0058] The specific form of the target pattern can be drawn according to actual needs. For example, the target pattern can be a triangle, a circle, a square, a nine-square grid (such as Figure 2 shown) etc.
[0059] The focused image in the aforementioned step A1 may specifically be an image acquired by focusing the target pattern on the camera to be detected. After obtaining the focused image, the camera detection method may further include steps B1 and B2, as described below:
[0060] Step B1: Determine the clarity of the target pattern in the focused image.
[0061] Step B2: According to the clarity of the target pattern, the focus function of the camera to be tested is tested.
[0062] In the embodiment of the present application, the clarity of the target pattern can be detected by a clarity algorithm. Then, based on the clarity of the target pattern, it is detected whether the focus function of the camera to be detected is normal. If the clarity of the target pattern is greater than or equal to the clarity threshold, it means that the focus function of the camera to be detected is normal and can be clearly focused; conversely, if the clarity of the target pattern is less than the clarity threshold, it means that the focus function of the camera to be detected is abnormal and cannot be clearly focused. The clarity threshold described here can be set according to actual needs, and the embodiment of the present application does not specifically limit this.
[0063] Optionally, the clarity algorithm may include a variance method, that is, evaluating the clarity of an image by calculating the variance or standard deviation of the grayscale values of pixels in the image; the clarity algorithm may also include a frequency domain method, that is, evaluating the clarity of an image by performing frequency domain analysis such as Fourier transform on the image. It is understandable that the clarity algorithm may also include other algorithms that can be used to evaluate the clarity of an image, which may be set according to actual needs.
[0064] Preferably, the target pattern is a pattern with clear boundaries to facilitate clarity evaluation.
[0065] It should be noted that after obtaining the focused image, step B1 and step B2 may be performed first. When it is determined through step B1 and step B2 that the focus function of the camera to be detected is normal, step A1 and step A2 may be performed so that the second type of defect features may be detected based on the clear focused image. When it is determined through step B1 and step B2 that the focus function of the camera to be detected is abnormal, the second type of defect features may be detected based only on the out-of-focus image, and no longer based on the focused image.
[0066] In addition, in order to reduce the negative impact that the target pattern may have on the camera defect feature detection, for example, the target pattern has a bad pixel feature, and the bad pixel feature is located on the line that constitutes the target pattern, in order to facilitate the detection of the bad pixel feature, the color of the target pattern can be distinguished from the color of the camera defect feature. For example, if the color of the camera defect feature is generally gray or black, the color of the target pattern can be red, so that there is a clear difference between the two colors.
[0067] In some optional embodiments, the number of the background plate may be one, and a target pattern is drawn on the background plate.
[0068] As can be seen from the above content, the target pattern may interfere with the camera defect feature. Therefore, when there is a target pattern drawn on the background plate and the number is one, in order to reduce the interference caused by the target pattern, multiple frames of defocused images can be collected for the background plate. Among them, the position and / or size of the target pattern in the image are different in different defocused images. Then, the camera defect feature detection is performed on the image area outside the area where the target pattern is located in each frame of the defocused image to reduce the interference of the target pattern, as described below:
[0069] Step 101: obtaining a defocused image of a background plate captured by a camera to be detected, which may include: obtaining multiple frames of defocused images of a background plate captured by the camera to be detected.
[0070] The position and / or size of the target pattern in each frame of the out-of-focus image is different.
[0071] For example, in the same shooting plane, the positional relationship between the camera to be detected and the background plate can be changed by moving the camera to be detected up, down, left, and right, thereby adjusting the position of the target pattern in the image. For another example, the size of the target pattern in the image can be adjusted by changing the distance between the camera to be detected and the background plate. It is understandable that the above three examples can also be used to adjust the size of the target pattern in the image while adjusting the position of the target pattern in the image. It is also understandable that, for another example, the position and / or size of the target pattern in the image can be adjusted by changing the shooting angle.
[0072] Correspondingly, step 102: performing defect feature detection on the camera to be detected based on the out-of-focus image may include: detecting the camera defect features based on the target image area in each frame of the out-of-focus image; and obtaining the defect features of the camera to be detected based on the detection results of each frame of the out-of-focus image.
[0073] The target image area mentioned here refers to the image area in the out-of-focus image except the area where the target pattern is located.
[0074] Camera defect features generally come from sensors. For example, if a sensor circuit fails, normal imaging cannot be performed. Therefore, the camera defect features will not change their positions in the image due to changes in the camera's shooting angle, position, etc., that is, the position of the camera defect features in the image is fixed. Therefore, in the embodiment of the present application, the position and size of the target pattern in the image can be adjusted by changing the shooting angle, position, etc. of the device to be detected, to obtain multiple frames of out-of-focus images. In the multiple frames of out-of-focus images, the union of the target image area (that is, the non-target pattern area) in each frame of the out-of-focus image can cover more or completely the entire image acquisition field of view. Camera defect feature detection is performed on the target image area in the multiple frames of out-of-focus images, which can better reduce the interference of the target pattern on the camera defect feature detection.
[0075] Optionally, in the process of obtaining the final detection result (i.e., the final determined camera defect feature to be detected) based on the detection result of each frame of the out-of-focus image, the defect features at the same image position in different out-of-focus images can be determined as the same defect feature to avoid repeated statistics.
[0076] It can be understood that when detecting the second type of defect features based on the focused image, it is also possible to collect multiple frames of focused images with different positions and / or sizes of target patterns in the image to perform second type of defect feature detection so as to reduce the interference of the target pattern on the defect feature detection. For details, please refer to the description of camera defect detection based on multiple frames of out-of-focus images, which will not be repeated here.
[0077] In some optional embodiments, there may be two background plates, namely a first background plate and a second background plate, wherein the first background plate is painted with a target pattern, and the second background plate is a solid color background plate without a pattern.
[0078] It can be seen from the foregoing that the target pattern may interfere with the camera defect features. In order to reduce such interference and to enable focus function detection, in an embodiment of the present application, two background plates can also be designed, one background plate with a target pattern drawn on it and the other background plate being a solid color background plate.
[0079] The camera to be detected can focus on the target pattern on the first background plate to obtain a focused image, and the camera to be detected can focus on the second background plate in an infinite distance manner to obtain a defocused image.
[0080] Focus function detection can be performed based on the focused image, and camera defect feature detection can be performed based on the defocused image. Since the defocused image does not include the target pattern, the camera defect feature detection based on the defocused image will not be interfered by the target pattern.
[0081] Optionally, when it is necessary to perform the second type of defect feature detection based on the focused image, if it has been determined that the focus function of the camera to be detected is normal, another focused image can be acquired by focusing the camera to be detected on the second background plate for performing the second type of defect feature detection. Since the focused image does not include the target pattern, the second type of defect feature detection based on the focused image will not be interfered by the target pattern.
[0082] In some optional embodiments, the camera detection method may further include: outputting defect detection results of the camera to be detected.
[0083] The defect detection results described herein may include but are not limited to at least one of the following: the number of defect features, the location of defect features, the size of defect features, etc.
[0084] Optionally, the detection result can be output in text form, such as describing the detection of camera defect features through text; it can also be output in image form, such as Figure 3 As shown in the figure, the detected camera defect features are marked with a dotted rectangular frame; it can also be output in a combination of text and image, which can be set according to actual needs.
[0085] The above is a description of the camera detection method provided in the embodiment of the present application.
[0086] To summarize, the camera detection method provided in the embodiment of the present application can reduce the interference of foreign objects in the environment on camera defect detection by capturing out-of-focus images of the background plate and detecting camera defects based on the out-of-focus images. Even if a clean room is not used, the accuracy of the detection results can be improved. Moreover, since there is no need to use a clean room, the detection cost can also be reduced and the flexibility of inspection can be improved.
[0087] Exemplary Devices
[0088] Correspondingly, an embodiment of the present application also provides a camera detection device, which is applied to an electronic device provided with a camera to be detected, such as a mobile phone, a tablet computer, a laptop computer, etc.
[0089] like Figure 4 As shown, the device may include:
[0090] The first image acquisition module 401 is used to acquire a defocused image of a background plate captured by a camera to be detected.
[0091] The first defect detection module 402 is used to perform defect feature detection on the camera to be detected based on the out-of-focus image.
[0092] Among them, the defect features include first-category defect features, and the first-category defect features refer to camera defect features whose detection results are affected by foreign objects on the background plate.
[0093] Optionally, the defect feature also includes a second type of defect feature, and the second type of defect feature refers to a camera defect feature whose detection result is not affected by foreign matter on the background plate.
[0094] Optionally, the first defect detection module 402 may also be configured to perform a second type of defect feature detection on the camera to be detected based on the out-of-focus image.
[0095] Optionally, the camera detection device may further include:
[0096] The second image acquisition module is used to acquire the focused image of the background plate captured by the camera to be detected.
[0097] The second defect detection module is used to perform a second type of defect feature detection on the camera to be detected based on the focused image.
[0098] Optionally, a target pattern is drawn on the background plate.
[0099] The camera detection device may further include:
[0100] The third image acquisition module is used to acquire a focused image captured by the camera to be detected on the background plate, wherein the focused image includes an image captured by the camera to be detected focusing on the target pattern.
[0101] The clarity determination module is used to determine the clarity of the target pattern in the focused image.
[0102] A focus function detection module is used to detect the focus function of the camera to be detected according to the clarity of the target pattern.
[0103] Optionally, there is one background plate, and a target pattern is drawn on the background plate.
[0104] The first image acquisition module 401 may be specifically used to acquire multiple frames of out-of-focus images captured by the camera to be detected on the background plate, wherein the position and / or size of the target pattern in each frame of the out-of-focus image is different.
[0105] The first defect detection module 402 may be specifically used for:
[0106] Based on the target image area in each frame of the out-of-focus image, defect feature detection is performed on the camera to be detected; wherein the target image area refers to the image area in the out-of-focus image excluding the area where the target pattern is located; based on the detection result of each frame of the out-of-focus image, the defect feature of the camera to be detected is obtained.
[0107] Optionally, the background plate includes a first background plate and a second background plate, the first background plate is painted with a target pattern, and the second background plate is a solid color background plate without a pattern.
[0108] The focused image includes an image captured by the camera to be detected focusing on the target pattern on the first background plate; the defocused image includes an image captured by the camera to be detected on the second background plate.
[0109] Optionally, the second defect detection module may be specifically used for:
[0110] Based on the focused image, a classification algorithm is used to detect whether there are known second-category defect features in the image; when it is determined that the camera to be detected does not have known second-category feature defects, an anomaly detection algorithm is used to detect whether there are unknown second-category defect features in the focused image.
[0111] Optionally, the image features of the first type of defect features include: bad pixel features; the image features of the second type of defect features include at least one of the following: spot features, texture features.
[0112] The camera detection device provided in the embodiment of the present application belongs to the same application concept as the camera detection method provided in the above embodiment of the present application, and can execute the camera detection method provided in any of the above embodiments of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For the technical details not fully described in this embodiment, please refer to the specific processing content of the camera detection method provided in the above embodiment of the present application, and will not be repeated here.
[0113] Exemplary Electronic Devices
[0114] The present application also provides an electronic device, such as Figure 5 As shown, the electronic device includes: a memory 500, a processor 510 and a camera to be detected (not shown in the figure).
[0115] The camera to be detected is connected to the processor 510 and is used to send the image captured from the background plate to the processor.
[0116] The memory 500 is connected to the processor 510 and is used to store programs.
[0117] The processor 510 is used to implement the camera detection method in the above embodiment by running the program stored in the memory 500 and based on the image captured by the camera to be detected.
[0118] Specifically, the electronic device may further include: a communication interface 520 , an input device 530 , an output device 540 and a bus 550 .
[0119] The processor 510, the memory 500, the communication interface 520, the input device 530 and the output device 540 are connected to each other via a bus.
[0120] Bus 550 may include a pathway for transferring information between the various components of the computer system.
[0121] The processor 510 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0122] The processor 510 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0123] The memory 500 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 500 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0124] The input device 530 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0125] Output device 540 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0126] The communication interface 520 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0127] The processor 510 executes the program stored in the memory 500 and calls other devices, which can be used to implement the various steps of the camera detection method provided in the above embodiments of the present application.
[0128] Exemplary computer program products and storage media
[0129] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the camera detection method described in the embodiment of the present application.
[0130] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0131] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0132] In addition, an embodiment of the present application may also be a storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the camera detection method described in the embodiment of the present application.
[0133] For the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations (i.e., step combinations), but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0134] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0135] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0136] The modules and sub-modules in the devices and terminals in the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0137] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0138] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0139] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0140] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0141] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0142] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
Claims
1. A camera detection method, characterized in that: The method comprises: Obtain a defocused image of the background plate captured by the camera to be detected; Based on the out-of-focus image, defect feature detection is performed on the camera to be detected; wherein the defect feature includes a first type of defect feature, and the first type of defect feature refers to a defect feature whose detection result is affected by foreign matter on the background plate.
2. The camera detection method according to claim 1, characterized in that: The defect features also include a second type of defect features, which refer to camera defect features whose detection results are not affected by foreign objects on the background plate.
3. The camera detection method according to claim 2, characterized in that: The method further comprises: Obtaining a focused image of the background plate captured by the camera to be detected; Based on the focused image, a second type of defect feature detection is performed on the camera to be inspected.
4. The camera detection method according to any one of claims 1 to 3, characterized in that: A target pattern is drawn on the background plate, and the method further comprises: Acquire a focused image of the background plate captured by the camera to be detected; wherein the focused image includes an image captured by the camera to be detected focusing on the target pattern; determining a clarity of the target pattern in the focused image; The focus function of the camera to be detected is detected according to the clarity of the target pattern.
5. The camera detection method according to claim 4, characterized in that: The number of the background plate is one, and a target pattern is drawn on the background plate; The step of obtaining a defocused image of a background plate captured by a camera to be detected includes: Acquire multiple frames of out-of-focus images of the background plate captured by the camera to be detected; wherein the position and / or size of the target pattern in each frame of the out-of-focus image is different; The step of performing defect feature detection on the camera to be detected based on the out-of-focus image includes: Based on the target image area in each frame of the out-of-focus image, defect feature detection is performed on the camera to be detected; wherein the target image area refers to the image area in the out-of-focus image except the area where the target pattern is located; According to the detection result of each frame of the out-of-focus image, the defect characteristics of the camera to be detected are obtained.
6. The camera detection method according to claim 4, characterized in that: The background plate includes a first background plate and a second background plate, the first background plate is painted with a target pattern, and the second background plate is a solid color background plate without a pattern; The focused image includes an image captured by the camera to be detected focusing on the target pattern on the first background plate; the defocused image includes an image captured by the camera to be detected on the second background plate.
7. The camera detection method according to claim 3, characterized in that: The step of performing a second type of defect feature detection on the camera to be detected based on the focused image includes: Based on the focused image, detecting whether there is a known second type of defect feature in the image by a classification algorithm; When it is determined that the camera to be detected does not have any known second-category characteristic defects, an abnormality detection algorithm is used to detect whether there are unknown second-category defect characteristics in the focused image.
8. The camera detection method according to claim 2, characterized in that: The image features of the first type of defect features include: bad pixel features; the image features of the second type of defect features include at least one of the following: spot features, texture features.
9. A camera detection device, characterized in that: The device comprises: The first image acquisition module is used to acquire a defocused image of the background plate captured by the camera to be detected; The first defect detection module is used to perform defect feature detection on the camera to be detected based on the out-of-focus image; wherein the camera defect features include first-category defect features, and the first-category defect features refer to camera defect features whose detection results are affected by foreign matter on the background plate.
10. An electronic device, characterized in that: include: A camera to be detected, a memory and a processor, wherein the camera to be detected and the memory are connected to the processor respectively; The camera to be detected is used to send the image captured from the background plate to the processor; The memory is used to store programs; The processor is used to implement the camera detection method as described in any one of claims 1 to 8 based on the image captured by the camera to be detected by running the program in the memory.
