Movatterモバイル変換


[0]ホーム

URL:


CN108198175B - Detection method, detection device, computer equipment and computer readable storage medium - Google Patents

Detection method, detection device, computer equipment and computer readable storage medium
Download PDF

Info

Publication number
CN108198175B
CN108198175BCN201711465117.7ACN201711465117ACN108198175BCN 108198175 BCN108198175 BCN 108198175BCN 201711465117 ACN201711465117 ACN 201711465117ACN 108198175 BCN108198175 BCN 108198175B
Authority
CN
China
Prior art keywords
image
optical element
light
camera
module
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201711465117.7A
Other languages
Chinese (zh)
Other versions
CN108198175A (en
Inventor
吴安平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp LtdfiledCriticalGuangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711465117.7ApriorityCriticalpatent/CN108198175B/en
Publication of CN108198175ApublicationCriticalpatent/CN108198175A/en
Priority to PCT/CN2018/123585prioritypatent/WO2019129004A1/en
Application grantedgrantedCritical
Publication of CN108198175BpublicationCriticalpatent/CN108198175B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种光学元件破裂的检测方法。光学元件包括相机模组的相机光学元件,所述检测方法包括:获取第一图像;处理第一图像以判断第一图像是否存在裂纹图案;在第一图像存在裂纹图案时确认相机光学元件破裂。本发明还公开了一种光学元件的破裂的检测装置、计算机设备和计算机可读存储介质。本发明实施方式的检测方法、检测装置、计算机设备和计算机可读存储介质通过识别相机模组获取的第一图像中是否有裂纹图案来判断相机光学元件是否破裂。如此,计算机设备可以自行检测光学元件是否完好,提升了计算机设备的智能性。

Figure 201711465117

The invention discloses a method for detecting the rupture of an optical element. The optical element includes a camera optical element of a camera module, and the detection method includes: acquiring a first image; processing the first image to determine whether a crack pattern exists in the first image; and confirming that the camera optical element is broken when a crack pattern exists in the first image. The invention also discloses a crack detection device of an optical element, a computer device and a computer-readable storage medium. The detection method, detection device, computer equipment, and computer-readable storage medium of the embodiments of the present invention determine whether the optical element of the camera is broken by identifying whether there is a crack pattern in the first image obtained by the camera module. In this way, the computer equipment can detect whether the optical element is in good condition by itself, which improves the intelligence of the computer equipment.

Figure 201711465117

Description

Detection method, detection device, computer equipment and computer readable storage medium
Technical Field
The present invention relates to the field of imaging technologies, and in particular, to a detection method, a detection apparatus, a computer device, and a computer-readable storage medium.
Background
A conventional mobile phone is generally mounted with a device having an optical element such as a camera. During the use of the mobile phone, the optical element may be broken due to external force. However, the current mobile phone does not have the function of self-detecting whether the optical element is broken, and the intelligence of the mobile phone is poor.
Disclosure of Invention
The embodiment of the invention provides a detection method, a detection device, a computer and a computer-readable storage medium.
The invention provides a method for detecting breakage of an optical element. The optical element comprises a camera optical element of a camera module, and the detection method comprises the following steps:
acquiring a first image;
processing the first image to determine whether a crack pattern is present in the first image; and
confirming the camera optical element is broken when a crack pattern is present in the first image.
The invention provides a detection device for optical element breakage. The optical element comprises a camera optical element of a camera module, and the detection device comprises a first acquisition module, a first processing module and a first confirmation module. The first acquisition module is used for acquiring a first image. The first processing module is used for processing the first image to judge whether a crack pattern exists in the first image. The first confirmation module is to confirm that the camera optical element is broken when a crack pattern is present in the first image.
The invention provides a computer device, which comprises a memory and a processor, wherein the memory is stored with computer readable instructions, and the instructions are executed by the processor to cause the processor to execute the detection method.
The present invention provides one or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the detection methods described above.
The detection method, the detection device, the computer equipment and the computer readable storage medium of the embodiment of the invention judge whether the camera optical element is broken or not by identifying whether the crack pattern exists in the first image acquired by the camera module. Therefore, the computer equipment can automatically detect whether the optical element is intact or not, and the intelligence of the computer equipment is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic flow diagram of a detection method according to some embodiments of the present invention.
FIG. 2 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 3 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 4 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 5 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 6 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 7 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 8 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 9 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 10 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 11 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 12 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 13 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 14 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 15 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 16 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 17 is a block diagram of a computer device according to some embodiments of the invention.
FIG. 18 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 19 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 20 is a schematic flow chart of a detection method according to some embodiments of the present invention.
FIG. 21 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 22 is a block diagram of a computer device in accordance with certain embodiments of the invention.
FIG. 23 is a block diagram of image processing circuitry in accordance with certain implementations of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
Referring to fig. 1, fig. 2 and fig. 23, the present invention provides a method for detecting a crack of an optical device. The optical element includes a cameraoptical element 411 of a camera module. The detection method comprises the following steps:
01: acquiring a first image;
02: processing the first image to determine whether the first image has a crack pattern; and
04: the cameraoptical element 411 is confirmed to be broken when the first image has a crack pattern.
Referring to fig. 2, the present invention further provides adevice 10 for detecting a broken optical element. The optical element includes a cameraoptical element 411 of a camera module. The method for detecting a break of an optical element according to the embodiment of the present invention can be realized by theapparatus 10 for detecting a break of an optical element according to the embodiment of the present invention. Thedetection device 10 comprises a first acquisition module 11, afirst processing module 12 and afirst confirmation module 15.Step 01 may be implemented by the first obtaining module 11,step 02 may be implemented by thefirst processing module 12, and step 03 may be implemented by thefirst confirming module 15. That is, the first acquiring module 11 may be used to acquire the first image. Thefirst processing module 12 may be configured to process the first image to determine whether the first image has a crack pattern. Thefirst confirmation module 15 may be used to confirm that the cameraoptical element 411 is broken when the first image has a crack pattern. Further, thefirst confirmation module 15 may be used to confirm that the cameraoptical element 411 is not broken when the first image is absent of a crack pattern.
Referring to fig. 3, the present invention further provides acomputer apparatus 100. Thecomputer apparatus 100 includes amemory 51 and aprocessor 52. Thememory 51 has stored therein computer-readable storage instructions. The computer readable instructions 511, when executed by theprocessor 52, cause theprocessor 52 to perform the operations of acquiring the first image, processing the first image to determine whether the first image has a crack pattern, and confirming that the cameraoptical element 411 is broken when the first image has a crack pattern.
In an embodiment of the present invention, the camera module is aninfrared camera 41, and the first image instep 01 is formed by theinfrared camera 41 capturing infrared light from ambient light reflected by the object. The cameraoptical element 411 of the camera module is a lens component in theinfrared camera 41, such as a filter, a focusing lens, a dustproof lens, and the like.
In some embodiments, thecomputer device 100 may be a cell phone, a tablet computer. Notebook computer, intelligent bracelet, intelligent wrist-watch, intelligent helmet, intelligent glasses etc..
Taking a mobile phone as an example, it can be understood that the existing mobile phone is usually equipped with devices with optical elements, such as a visible light camera, aninfrared camera 41, and a light supplement element. During the use of the mobile phone, the optical element may be broken due to external factors, such as dropping of the mobile phone. However, the current mobile phone does not have the function of self-detecting whether the optical element is broken, and the intelligence of the mobile phone is poor.
Since theinfrared camera 41 photographs the crack pattern on the broken cameraoptical element 411 when the cameraoptical element 411 of theinfrared camera 41 is broken, the detection method, thedetection device 10 and thecomputer apparatus 100 for detecting the broken optical element of the embodiment of the present invention determine whether the cameraoptical element 411 is broken by recognizing whether there is a crack pattern in the first image acquired by the camera module. Thus, thecomputer device 100 can detect whether the optical element is intact by itself, and the intelligence of thecomputer device 100 is improved.
Further, in some embodiments, upon confirming that the cameraoptical element 411 is broken, thedetection apparatus 10 and a prompting module (e.g., a speaker, a display screen) in thecomputer device 100 may prompt the user to replace the broken cameraoptical element 411 by voice or text.
Referring to FIG. 4, in some embodiments, processing 02 the first image to determine whether the first image has a crack pattern includes:
021: constructing a multi-stage crack pattern classifier based on the Haar-like rectangular feature set;
022: training a multi-stage crack pattern classifier by adopting a positive crack pattern sample and a negative crack pattern sample; and
023: and detecting whether the first image has a crack pattern or not by adopting the trained multistage crack pattern classifier.
Referring to fig. 5, in some embodiments, thefirst processing module 12 includes a first constructing unit 121, afirst training unit 122 and a first detecting unit 123. Step 021 may be implemented by the first construction unit 121,step 022 may be implemented by thefirst training unit 122, and step 023 may be implemented by the first detection unit 123. That is, the first construction unit 121 may be configured to construct a multi-stage crack pattern classifier based on a Haar-like rectangular feature set. Thefirst training unit 122 may be used to train a multi-stage crack pattern classifier using positive and negative crack pattern samples. The first detection unit 123 may be configured to detect whether a crack pattern exists in the first image by using the trained multi-stage crack pattern classifier.
Referring back to fig. 3, in some embodiments, the computer readable instructions 511, when executed by theprocessor 52, cause theprocessor 52 to further perform the operations of constructing a multi-stage crack pattern classifier based on the Haar-like rectangular feature set, training the multi-stage crack pattern classifier using the positive crack pattern samples and the negative crack pattern samples, and detecting whether the crack pattern exists in the first image using the trained multi-stage crack pattern classifier.
Specifically, first, a large number of positive crack pattern samples and negative crack pattern samples are selected, wherein the positive crack pattern samples are samples with crack patterns of the cameraoptical element 411, and the negative crack pattern samples are samples with crack patterns of the non-cameraoptical element 411. Secondly, the positive crack pattern sample and the negative crack pattern sample are subjected to resolution normalization calculation to reduce the size of the image, so that the subsequent rapid detection of image features is facilitated. Then, aiming at morphological characteristics of the crack patterns, a Haar-like rectangular feature set capable of detecting line features, center surrounding features, diagonal line features and edge features is adopted to construct a multistage crack pattern classifier. Specifically, for a matrix eigenvalue corresponding to each Haar-like rectangular characteristic calculator, then, a plurality of matrix eigenvalues are selected from the plurality of matrix eigenvalues to form a plurality of weak classifiers, and each weak classifier comprises one or more matrix eigenvalues. The weak classifiers form a plurality of strong classifiers, and each strong classifier comprises a plurality of weak classifiers. All strong classifiers are cascaded to form a multi-stage crack pattern classifier. And then, training the multistage crack pattern classifiers by adopting a large number of positive crack pattern samples and negative crack pattern samples with normalized resolution to correct the weight corresponding to each weak classifier, so that the loss function of the finally output image classification result is smaller than a preset loss value. And finally, detecting whether the first image has the crack pattern by using the trained multistage crack pattern classifier. The multistage crack pattern classifier is formed by cascading a plurality of strong classifiers, each strong classifier is formed by cascading a plurality of weak classifiers, the multistage structure can accurately extract image characteristics, and the accuracy of image classification is improved.
Referring to FIG. 6, in some embodiments, the first image includes a plurality of frames.Step 02 of processing the first image to determine whether the first image has a crack pattern includes:
021: processing the multiple frames of first images to judge whether crack patterns exist in the multiple frames of first images;
the method for detecting the breakage of the optical element further comprises:
031: comparing whether the crack positions of the crack patterns in any two frames of first images are consistent;
032: when the crack positions in any two frames of the first image coincide, it is confirmed that the cameraoptical element 411 is broken.
Referring to fig. 7, in some embodiments, the detectingdevice 10 further includes a first comparingmodule 13. Step 021 may be implemented by thefirst processing module 12,step 031 may be implemented by the first comparingmodule 13, and step 032 may be implemented by the first confirmingmodule 15. That is, thefirst processing module 12 may be further configured to process the plurality of frames of the first image to determine whether the crack pattern exists in each of the plurality of frames of the first image. The first comparingmodule 13 may be configured to compare whether the crack positions of the crack patterns in any two frames of the first image are consistent. Thefirst confirmation module 15 may also be used to confirm that the cameraoptical element 411 is broken when the crack positions in any two frames of the first image coincide. At this time, when the crack pattern exists in all of the plurality of frames of the first image, but the crack positions in any two frames of the first image do not coincide, it is confirmed that the cameraoptical element 411 is not broken.
Referring back to fig. 3, in some embodiments, the computer readable instructions 511, when executed by theprocessor 52, enable theprocessor 52 to further perform the operations of processing the plurality of first images to determine whether crack patterns exist in each of the plurality of first images, comparing whether crack positions of the crack patterns in any two first images are consistent, and confirming that the cameraoptical element 411 is broken when the crack positions in any two first images are consistent.
Specifically, after theinfrared camera 41 captures a plurality of frames of first images, theprocessor 52 may detect each frame of first image by using a trained multi-stage crack pattern classifier to determine whether each frame of first image has a crack pattern. Upon detecting the presence of a crack pattern in each frame of the first image, theprocessor 52 extracts the crack location in the corresponding first image according to each crack pattern identified. Subsequently, theprocessor 52 compares the crack positions in the first images of the plurality of frames two by two, and when each comparison result shows that the crack positions in the corresponding two first images are consistent, the cameraoptical element 411 is considered to be broken. The two first images are divided into two frames, wherein the two first images have the same crack position, and the difference of the distances between the crack positions in the two first images is smaller than a preset distance difference. It is understood that when the cameraoptical element 411 of theinfrared camera 41 is broken, the position of the crack pattern is unchanged in each frame of the first image captured by theinfrared camera 41. Therefore, whether the cameraoptical element 411 is broken or not can be further determined by the crack position, so that the accuracy of the detection of the breakage of the cameraoptical element 411 can be improved.
Referring to fig. 8, in some embodiments, the optical elements further include a fill-in optical element of the infrared fill-inlamp 42. The method for detecting the breakage of the optical element further comprises:
051: when theoptical element 411 of the camera is not damaged, the infrared fill-inlight 42 and theinfrared camera 41 are turned on;
052: acquiring a second image according to the infrared light emitted by the infraredlight supplement lamp 42;
053: processing the second image to determine whether the second image has a light pattern; and
054: and confirming that the light supplementing optical element is broken when the second image has the light pattern.
Referring to fig. 9, in some embodiments, the detectingdevice 10 further includes afirst opening module 21, a second obtainingmodule 22, asecond processing module 23, and a second confirmingmodule 25. Step 051 may be implemented by thefirst opening module 21,step 052 may be implemented by the second obtainingmodule 22,step 053 may be implemented by thesecond processing module 23, and step 054 may be implemented by the second confirmingmodule 25. That is, the first turning-onmodule 21 may be configured to turn on the infrared fill-inlight 42 and theinfrared camera 41 when it is determined that the cameraoptical element 411 is not damaged. The second obtainingmodule 22 may be configured to obtain a second image according to the infrared light emitted by the infrared fill-inlight 42. Thesecond processing module 23 can be used for processing the second image to determine whether the second image has the light pattern. Thesecond confirmation module 25 may be configured to confirm that the fill-in optical element is broken when the second image has the light pattern. Further, the second confirmingmodule 25 may be further configured to confirm that the light supplementing optical element is not broken when the second image does not have the light pattern.
Referring back to fig. 3, in some embodiments, the computer readable instructions 511, when executed by theprocessor 52, cause theprocessor 52 to perform: when theoptical element 411 of the camera is determined not to be damaged, the infrared fill-inlamp 42 and theinfrared camera 41 are turned on, a second image is obtained according to infrared light emitted by the infrared fill-inlamp 42, the second image is processed to determine whether a light pattern exists in the second image, and when the light pattern exists in the second image, the operation of breaking the fill-in optical element is determined.
The method for detecting the breakage of the optical element in the embodiment of the invention can be further used for detecting whether the light supplement optical element of the infraredlight supplement lamp 42 is broken or not. The light supplement optical element of the infraredlight supplement lamp 42 is a lens or a lampshade in the infraredlight supplement lamp 42. Because when the light supplementing optical element is broken, the light emitted by the light supplementing optical element cannot be uniformly diffused into a scene, and because of the existence of cracks of the light supplementing optical element, light fringes can also appear in the infrared light diffused into the scene. Therefore, when it is confirmed that the cameraoptical element 411 of theinfrared camera 41 is not broken, the infrared fill-inlamp 42 and theinfrared camera 41 can be turned on at the same time. Theinfrared camera 41 can capture light emitted by the infrared fill-inlight 42 to capture a second image. Theprocessor 52 processes the second image to detect whether there is a light pattern in the second image, and determines that the fill-in optical element is broken when there is a light pattern in the second image. Therefore, on one hand, thecomputer device 100 can automatically detect the integrity of the light supplementing optical element, and the intelligence of thecomputer device 100 is improved; on the other hand, the light that infraredlight filling lamp 42 sent is infrared laser usually, and when light filling optical element broke, the people's eye was burnt easily to the infrared laser that sends through crack department, consequently, can in time close infraredlight filling lamp 42 whencomputer equipment 100 detected that light filling optical element broke to the situation of avoiding infrared laser to burn people's eye takes place, promotes the security that the user usedcomputer equipment 100, improves user experience.
Referring to fig. 10, in some embodiments, thestep 053 of processing the second image to determine whether the second image has the light pattern includes:
0531: constructing a multi-level optical pattern classifier based on a Haar-like rectangular feature set;
0532: training a multi-stage light pattern classifier by adopting positive light pattern samples and negative light pattern samples; and
0533: and detecting whether the second image has the light pattern or not by adopting the trained multi-stage light pattern classifier.
Referring to fig. 11, in some embodiments, thesecond processing module 23 includes a second constructing unit 231, a second training unit 232, and a second detecting unit 233.Step 0531 may be implemented by the second construction unit 231,step 0532 may be implemented by the second training unit 232, andstep 0533 may be implemented by the second detection unit 233. That is, the second construction unit 231 may be configured to construct a multi-level optical grain pattern classifier based on the Haar-like rectangular feature set. The second training unit 232 may be used to train the multi-stage lightprint pattern classifier using the positive lightprint pattern samples and the negative lightprint pattern samples. The second detecting unit 233 may be configured to detect whether the second image has a light pattern by using the trained multi-stage light pattern classifier.
Referring back to fig. 3, in some embodiments, the computer readable instructions 511, when executed by theprocessor 52, cause theprocessor 52 to further perform operations of constructing a multi-level lightstripe pattern classifier based on the Haar-like rectangular feature set, training the multi-level lightstripe pattern classifier using the positive lightstripe pattern samples and the negative lightstripe pattern samples, and detecting whether a lightstripe pattern exists in the second image using the trained multi-level lightstripe pattern classifier.
Specifically, firstly, a large number of positive light pattern samples and negative light pattern samples are selected, wherein the positive light pattern samples are samples with light patterns, and the negative light pattern samples are samples with non-light patterns. Secondly, the resolution normalization calculation is carried out on the positive light pattern sample and the negative light pattern sample to reduce the size of the image, so that the subsequent rapid detection of the image characteristics is facilitated. Then, aiming at morphological characteristics of the light pattern, a Haar-like rectangular feature set capable of detecting line features, center surrounding features, diagonal features and edge features is adopted to construct a multilevel light pattern classifier. Specifically, for a matrix eigenvalue corresponding to each Haar-like rectangular characteristic calculator, then, a plurality of matrix eigenvalues are selected from the plurality of matrix eigenvalues to form a plurality of weak classifiers, and each weak classifier comprises one or more matrix eigenvalues. The weak classifiers form a plurality of strong classifiers, and each strong classifier comprises a plurality of weak classifiers. All the strong classifiers are cascaded to form a multistage light pattern classifier. And then, training the multi-stage light pattern classifiers by adopting a large number of positive light pattern samples and negative light pattern samples with normalized resolution to correct the weight corresponding to each weak classifier, so that the loss function of the finally output image classification result is smaller than a preset loss value. And finally, detecting whether the second image has the light pattern by using the trained multistage light pattern classifier. The multistage light pattern classifier is formed by cascading a plurality of strong classifiers, each strong classifier is formed by cascading a plurality of weak classifiers, the multistage structure can accurately extract image characteristics, and the accuracy of image classification is improved.
Referring to fig. 12, in some embodiments, the second image comprises a plurality of frames, and thestep 053 of processing the second image to determine whether the second image has the light pattern comprises:
0534: processing the multiple frames of second images to judge whether the multiple frames of second images all have light pattern or not;
the method for detecting the breakage of the optical element further comprises:
0541: comparing whether the positions of the light patterns in any two frames of second images are consistent; and
0542: and when the positions of the light fringes in any two frames of second images are consistent, confirming that the light supplementing optical element is broken.
Referring to fig. 13, in some embodiments, thedetection apparatus 10 further includes a second comparison module 24.Step 0534 may be implemented by thesecond processing module 23.Step 0541 may be performed by the second comparison module 24.Step 0542 may be implemented by thesecond validation module 25. That is, thesecond processing module 23 is further configured to process the plurality of frames of the second image to determine whether the light pattern exists in each of the plurality of frames of the second image. The second comparing module 24 can be used to compare whether the positions of the light stripes in any two frames of the second images are consistent. Thesecond confirmation module 25 may further be configured to confirm that the light supplement optical element is broken when the positions of the light fringes in any two frames of the second image are consistent. Further, thesecond confirmation module 25 may be further configured to confirm that the light supplementing optical element is not broken when the light pattern positions in any two frames of the second image are not consistent.
Referring back to fig. 3, in some embodiments, the computer readable instructions 511 are executed to enable theprocessor 52 to further perform the operations of processing the plurality of frames of the second images to determine whether the light pattern exists in each of the plurality of frames of the second images, comparing whether the positions of the light patterns in any two frames of the second images are consistent, and confirming that the light-filling optical element is broken when the positions of the light patterns in any two frames of the second images are consistent.
Specifically, when it is confirmed that the cameraoptical element 411 of theinfrared camera 41 is not broken, theinfrared fill light 42 and theinfrared camera 41 are turned on at the same time. After theinfrared camera 41 captures infrared light emitted by the infrared fill-inlight 42 to obtain multiple frames of second images, theprocessor 52 may detect each frame of second image by using a trained multi-stage light pattern classifier to determine whether there is a light pattern in each frame of second image. Upon detecting the presence of a light pattern in each frame of the second image,processor 52 extracts the position of the light pattern in the corresponding second image according to each identified light pattern. Subsequently, theprocessor 52 compares the positions of the light fringes in the second images of the multiple frames two by two, and when each comparison result shows that the positions of the light fringes in the corresponding two frames of second images are consistent, the light supplementing optical element is considered to be broken. The consistency of the positions of the light stripes in the two frames of second images means that the distance difference between the positions of the light stripes in the two frames of second images is smaller than a preset distance difference. It can be understood that, when the light supplement optical element of the infraredlight supplement lamp 42 is broken, since the distance between the infraredlight supplement lamp 42 and theinfrared camera 41 is fixed, the position of the crack pattern is not changed in each frame of the second image captured by theinfrared camera 41. Therefore, whether the light supplement optical element of the infraredlight supplement lamp 42 is broken or not can be further judged through the crack position, so that the accuracy of breakage detection of the light supplement optical element can be improved.
Referring to fig. 14, in some embodiments, the optical elements further include structured light optical elements of the structuredlight projector 43, wherein the structured light optical elements refer to collimation, diffraction elements, etc. in the structuredlight projector 43. The method for detecting the breakage of the optical element further comprises:
061: upon confirming that the cameraoptical element 411 is not broken, the structuredlight projector 43 and theinfrared camera 41 are turned on;
062: acquiring a third image from the infrared light emitted from the structuredlight projector 43;
063: processing the third image to judge whether depth abnormal information exists in the third image; and
065: confirming that the structured light optical element is broken when there is depth anomaly information in the third image.
Referring to fig. 15, in some embodiments, thedetection apparatus 10 further includes asecond starting module 31, a third obtainingmodule 32, athird processing module 33, and a third confirmingmodule 35. Step 061 may be implemented by the second enablingmodule 31,step 062 may be implemented by the third obtainingmodule 32,step 063 may be implemented by thethird processing module 33, and step 065 may be implemented by the third confirmingmodule 35. That is, thesecond activation module 31 may be used to activate the structuredlight projector 43 and theinfrared camera 41 upon confirming that the cameraoptical element 411 is not broken. Thethird acquisition module 32 may be configured to acquire a third image based on the infrared light emitted by the structuredlight projector 43. Thethird processing module 33 may be configured to process the third image to determine whether depth anomaly information exists in the third image. Thethird confirmation module 35 may be used to confirm that the structured light optical element is broken when there is depth anomaly information in the third image.
Referring back to fig. 3, in some embodiments, the computer readable instructions 511, when executed by theprocessor 52, cause theprocessor 52 to further perform the operations of turning on the structuredlight projector 43 and theinfrared camera 41 when it is determined that the cameraoptical element 411 is not broken, acquiring a third image based on infrared light emitted from the structuredlight projector 43, processing the third image to determine whether depth anomaly information exists in the third image, and determining that the structured light optical element is broken when the depth anomaly information exists in the third image.
The method for detecting the breakage of an optical element according to the embodiment of the present invention can be further used for detecting whether or not the structured light optical element of the structuredlight projector 43 is broken. The structured light optical element of the structuredlight projector 43 may be a collimating lens or a Diffractive Optical Element (DOE) in the structuredlight projector 43. When the structured light optical element is broken, and theinfrared camera 41 calculates the depth information of the current scene from the captured image and the preset reference image, a certain part of the depth information of the current scene may become abnormally large. Therefore, when it is confirmed that the cameraoptical element 411 of theinfrared camera 41 is not broken, the structuredlight projector 43 and theinfrared camera 41 can be turned on at the same time. Theinfrared camera 41 may capture infrared light projected by the structured-light projector 43 to capture a third image.Processor 52 processes the third image to detect whether depth anomaly information is present in the third image and confirms that the structured light optical element is broken when depth anomaly information is present in the third image. Therefore, on one hand, thecomputer device 100 can automatically detect the integrity of the structured light optical element, and the intelligence of thecomputer device 100 is improved; on the other hand, the light emitted by the structuredlight projector 43 is usually infrared laser, and when the structured light optical element of the structuredlight projector 43 is broken, the infrared laser of the structuredlight projector 43 easily burns the human eyes, so that the structuredlight projector 43 can be closed in time when thecomputer device 100 detects that the structured light optical element is broken, thereby avoiding the situation that the human eyes are burnt by the infrared laser, improving the safety of the user using thecomputer device 100, and improving the user experience.
Referring to fig. 16, in some embodiments, theprocessing 063 of the third image to determine whether depth anomaly information exists in the third image comprises:
0631: calculating the scattered point offset of each pixel point in the third image according to the third image and a preset reference image;
0632: calculating the depth information of each pixel point in the third image according to the scatter offset;
0633: calculating the number of pixel points with adjacent depth information larger than a preset threshold; and
0634: and determining that the depth abnormal information exists in the third image when the number of the adjacent pixel points is larger than the preset number.
Referring to fig. 17, in some embodiments, thethird processing module 33 includes a first calculatingunit 331, asecond calculating unit 332, athird calculating unit 333 and a confirmingunit 334.Step 0631 may be implemented by thefirst calculation unit 331,step 0632 may be implemented by thesecond calculation unit 332,step 0633 may be implemented by thethird calculation unit 333, andstep 0634 may be implemented by thevalidation unit 334. That is to say, the first calculatingunit 331 is configured to calculate a scatter offset of each pixel point in the third image according to the third image and the preset reference image, the second calculatingunit 332 is configured to calculate depth information of each pixel point in the third image according to the scatter offset, the third calculatingunit 333 is configured to calculate the number of pixel points whose adjacent depth information is greater than the preset threshold, and the determiningunit 334 is configured to determine that depth anomaly information exists in the third image when the number of adjacent pixel points is greater than the preset number.
Referring back to fig. 3, in some embodiments, when executed by theprocessor 52, the computer readable instructions 511 enable theprocessor 52 to perform operations of calculating a scatter offset of each pixel point in the third image according to the third image and the preset reference image, calculating depth information of each pixel point in the third image according to the scatter offset, calculating the number of pixel points whose adjacent depth information is greater than a preset threshold, and determining that depth anomaly information exists in the third image when the number of adjacent pixel points is greater than a preset number.
Specifically, first, theprocessor 52 extracts a plurality of input image blocks from the third image, where center points of any two input image blocks are the same and have different sizes, and then theprocessor 52 extracts a plurality of matching search windows from the preset reference image, where the matching search windows are matching blocks extracted within a certain range around a corresponding point in the preset reference image, which is the same as the center point of the input image block, as the center point. Then, the sum SAD of the absolute values of the differences of corresponding pixels between the input image block and a matching block of the same size in the matching search window is calculated by adopting a parallel algorithm, so that the SAD between each input image block and all the matching blocks is obtained. Then, for each input image block, a matching block corresponding to the SAD at the minimum SAD value is selected from the plurality of SADs as a best matching block for the input image block. Then, theprocessor 52 subtracts the coordinate value of the center point of the best matching block from the coordinate value of the center point of the preset reference image to calculate the best offset corresponding to the input image block, where the best offset is the scatter offset of the pixel point where the center point of the corresponding input image block is located, and positive and negative scatter offsets represent the front-back relationship between the depth of the center point of the input image block and the depth of the preset reference pattern, and the larger the scatter offset is, the farther the plane vertical distance between the center point of the input image block and the preset reference pattern with a known depth distance is. Theprocessor 52 calculates the amount of scatter offset for each pixel in the third image one by one according to the above method. Finally, theprocessor 52 calculates the depth information of each pixel point according to the depth calculation formula by combining the known depth distance of the preset reference pattern and the baseline distance between the structuredlight projector 43 and theinfrared camera 41 according to the calculated offset of each pixel point in the third image. Theprocessor 52 determines whether a plurality of adjacent pixel points with depth information greater than a preset threshold exist in the third image according to the calculated depth information, and determines that depth abnormality information exists in the third image when the number of the adjacent pixel points with depth information greater than the preset threshold exceeds a preset number. In this manner, it can be determined whether the structured light optical element of the structuredlight projector 43 is broken based on the determination of the depth anomaly information in the third image.
Referring to fig. 18, in some embodiments, the third image includes a plurality of frames, and thestep 063 of processing the third image to determine whether the depth anomaly information exists in the third image includes:
0635: processing the multiple frames of third images to judge whether depth abnormal information exists in the multiple frames of third images;
the method for detecting the breakage of the optical element further comprises:
0641: comparing whether the position information of the abnormal depth information in any two frames of third images is consistent; and
0642: and confirming that the structured light optical element is broken when the position information of the depth anomaly information in any two frames of third images is consistent.
Referring to fig. 19, in some embodiments, thedetection apparatus 10 further includes a third comparingmodule 34.Step 0635 may be implemented by thethird processing module 33,step 0641 may be implemented by the third comparingmodule 34, andstep 0642 may be implemented by the third confirmingmodule 35. That is, thethird processing module 33 may be configured to process the plurality of frames of the third image to determine whether depth anomaly information exists in the plurality of frames of the third image. The third comparingmodule 34 can be used to compare whether the position information of the abnormal depth information in any two frames of the third image is consistent. The third confirmingmodule 35 may be configured to confirm that the structured light optical element is broken when the position information of the depth anomaly information in any two frames of the third image is consistent.
Referring back to fig. 3, in some embodiments, the computer readable instructions 511, when executed by theprocessor 52, enable theprocessor 52 to further perform the operations of processing the plurality of frames of the third image to determine whether there is depth anomaly information in the plurality of frames of the third image, comparing whether the position information of the anomaly depth information in any two frames of the third image is consistent, and confirming that the structured light optical element is broken when the position information of the depth anomaly information in any two frames of the third image is consistent.
Specifically, upon confirming that the cameraoptical element 411 of theinfrared camera 41 is not broken, the structuredlight projector 43 and theinfrared camera 41 are turned on at the same time. After theinfrared camera 41 captures the infrared laser light projected by the structuredlight projector 43 to capture a plurality of frames of third images, theprocessor 52 detects each frame of third image to determine whether depth anomaly information exists in each frame of third image. Upon detecting that there is depth anomaly information for each frame of the third image,processor 52 extracts its position information in the corresponding third image according to each depth anomaly information identified. Subsequently, theprocessor 52 compares the position information of the depth anomaly information in the third images of the multiple frames two by two, and when each comparison result shows that the position information of the depth anomaly information in the corresponding two frames of third images is consistent, the structured light optical element is considered to be broken. The consistency of the position information of the depth anomaly information in the two frames of third images means that the distance difference between the position information of the depth anomaly information in the two frames of third images is smaller than a preset distance difference. It is understood that when the structured light optical element of the structuredlight projector 43 is broken, the distance between the structuredlight projector 43 and theinfrared camera 41 is fixed because the crack of the structured light optical element is fixed, and therefore, theprocessor 52 calculates the position information of the depth anomaly information of each frame of the third image from each frame of the third image captured by theinfrared camera 41 to be constant. Therefore, whether the structured light optical element of the structuredlight projector 43 is broken or not can be further determined by the position information of the depth anomaly information, so that the accuracy of the detection of the breakage of the structured light optical element can be improved.
In some embodiments, when it is determined that the cameraoptical element 411 of theinfrared camera 41 is not broken, the infrared fill-inlamp 42 and theinfrared camera 41 may be simultaneously turned on, and whether the fill-in optical element of the infrared fill-inlamp 42 is broken or not may be determined according to whether a light pattern exists in each of a plurality of frames of second images captured by theinfrared camera 41 and whether positions of the light patterns in any two frames of second images are consistent or not, and when the fill-in optical element is not broken, the structuredlight projector 43, the infrared fill-inlamp 42 and theinfrared camera 41 are simultaneously turned on, and whether the structured light optical element of the structuredlight projector 43 is broken or not may be determined according to whether depth anomaly information exists in each of a plurality of frames of third images captured by theinfrared camera 41 and whether position information corresponding to the depth anomaly information of any two frames of third images is consistent or not. Therefore, when the light supplement optical element of the light supplement lamp is not broken, the infraredlight supplement lamp 42 can normally execute the light supplement function, the brightness of the third image acquired by theinfrared camera 41 is high, calculation of depth information is facilitated, and the accuracy of structural light optical element breakage detection can be further improved.
Referring to fig. 20, in some embodiments, the method for detecting the breakage of the optical element further includes:
001: acquiring the movement speed of the camera module;
002: and (5) judging whether the movement speed is greater than a preset speed value or not, and entering the step (01) to acquire a first image when the movement speed is greater than the preset movement speed value.
Referring to fig. 21, in some embodiments, thedetection apparatus 10 further includes a fourth obtainingmodule 16 and a fourth processing module 17. Step 001 may be implemented by the fourth obtainingmodule 16 and step 002 may be implemented by the fourth processing module 17. That is, the fourth obtainingmodule 16 may be configured to obtain a moving speed of the camera module, and the fourth processing module 17 may be configured to determine whether the moving speed is greater than a preset speed value, and enterstep 01 to obtain the first image when the moving speed is greater than the preset moving speed value.
Referring to fig. 3, in some embodiments, when the computer readable instructions 511 are executed by theprocessor 52, theprocessor 52 further executes the operation of acquiring the moving speed of the camera module, determining whether the moving speed is greater than the preset speed value, and enteringstep 01 to acquire the first image when the moving speed is greater than the preset moving speed value.
Wherein, the speed sensor can be adopted to detect the movement speed of the camera module. When the movement speed of the camera module is higher, it indicates that the computer device 100 may fall, at this time, the infrared camera 41 is turned on to detect whether the camera optical element 411 of the infrared camera 41 is broken, and when the camera optical element 411 is not broken, the infrared fill-in lamp 42 and the infrared camera 41 are turned on at the same time to detect whether the fill-in optical element of the infrared fill-in lamp 42 is broken, and then the structured light projector 43 and the infrared camera 41 are turned on at the same time to detect whether the structured light optical element of the structured light projector 43 is broken; or, when the camera optical element 411 is not broken, the structured light projector 43 and the infrared camera 41 are turned on at the same time to detect whether the structured light optical element of the structured light projector 43 is broken, and then the infrared fill-in light lamp 42 and the infrared camera 41 are turned on at the same time to detect whether the fill-in light optical element of the infrared fill-in light lamp 42 is broken; or, when the camera optical element 411 is not broken, the infrared fill-in lamp 42 and the infrared camera 41 are turned on simultaneously to detect whether the fill-in optical element of the infrared fill-in lamp 42 is broken, and when the fill-in optical element is not broken, the structured light projector 43, the infrared fill-in lamp 42 and the infrared camera 41 are turned on simultaneously to detect whether the structured light optical element of the structured light projector 43 is broken. In this way, the detection of the breakage of the optical element is performed when the moving speed of thecomputer apparatus 100 is large, without the detection of the breakage of the homogeneous optical element every time the optical element is used, reducing the power consumption of thecomputer apparatus 100.
The present invention also provides a non-transitory computer-readable storage medium containing one or more computer-executable instructions. The computer-executable instructions, when executed by the one ormore processors 52, cause theprocessors 52 to perform the method for detecting a break in an optical element as described in any of the above embodiments.
For example, the computer-executable instructions, when executed by the one ormore processors 52, cause theprocessors 52 to perform the operations of:
01: acquiring a first image;
02: processing the first image to determine whether the first image has a crack pattern; and
04: the cameraoptical element 411 is confirmed to be broken when the first image has a crack pattern.
As another example, the computer-executable instructions, when executed by the one ormore processors 52, cause theprocessors 52 to perform the operations of:
021: constructing a multi-stage crack pattern classifier based on the Haar-like rectangular feature set;
022: training a multi-stage crack pattern classifier by adopting a positive crack pattern sample and a negative crack pattern sample; and
023: and detecting whether the first image has a crack pattern or not by adopting the trained multistage crack pattern classifier.
FIG. 22 is a schematic diagram of internal modules ofcomputer device 100, under an embodiment. As shown in fig. 22, thecomputer apparatus 100 includes aprocessor 52, a memory 51 (e.g., a nonvolatile storage medium), aninternal memory 54, adisplay 55, and aninput device 56, which are connected by asystem bus 53. Thememory 51 of thecomputer device 100 has stored therein an operating system and computer readable instructions 511 (shown in FIG. 3). The computer readable instructions 511 are executable by theprocessor 52 to implement the method for detecting a break in an optical element according to any of the above embodiments. Theprocessor 52 may be used to provide computing and control capabilities to enable the overall operation of thecomputing device 100. Theinternal memory 54 of thecomputer device 100 provides an environment for the computer-readable instructions 511 in thememory 51 to run. Thedisplay 55 of thecomputer device 100 may be a liquid crystal display or an electronic ink display, and theinput device 56 may be a touch layer covered on thedisplay 55, a case, a trackball or a touch pad arranged on the housing of thecomputer device 100, or an external keyboard, a touch pad or a mouse. Thecomputer device 100 may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, or a wearable device (e.g., a smart bracelet, a smart watch, a smart helmet, smart glasses), etc. It will be understood by those skilled in the art that the configuration shown in fig. 22 is only a schematic diagram of a part of the configuration related to the solution of the present invention, and does not constitute a limitation to thecomputer device 100 to which the solution of the present invention is applied, and aspecific computer device 100 may include more or less components than those shown in the figure, or combine some components, or have a different arrangement of components.
Referring to fig. 23, acomputer apparatus 100 according to an embodiment of the invention includes animage processor circuit 80. Theimage processing circuit 80 may be implemented using hardware and/or software. Various Processing units may be included that define an ISP (Image Signal Processing) pipeline. FIG. 23 is a diagram of animage processing circuit 80 in one embodiment. As shown in fig. 23, for convenience of explanation, only aspects of the image processing technique related to the embodiment of the present invention are shown.
As shown in fig. 23, the image processing circuit includes an ISP processor (which may be theprocessor 52 or a part of the processor 52) and control logic. The image data captured by theinfrared camera 41 is first processed by the ISP processor 63, and theISP processor 82 analyzes the image data to capture image statistics that may be used to determine one or more control parameters of theinfrared camera 41. Theinfrared camera 41 may include acamera optics 411 and animage sensor 412, thecamera optics 411 including one or more lenses. Theimage sensor 412 may acquire light intensity and wavelength information captured by each imaging pixel and provide a set of raw image data that may be processed by theISP processor 82. The sensor 81 (e.g., gyroscope) may provide parameters of the acquired image processing (e.g., anti-shake parameters) to theISP processor 82 based on the sensor interface type. The sensor interface may be an SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above.
In addition, theimage sensor 412 may also send raw image data to thesensor 81, thesensor 81 may provide the raw image data to theISP processor 82 based on the sensor interface type, or the sensor may store the raw image data in thememory 51.
TheISP processor 82 processes the raw image data pixel by pixel in a variety of formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and theISP processor 82 may perform one or more image processing operations on the raw image data, gathering statistical information about the image data. Wherein the image processing operations may be performed with the same or different bit depth precision.
TheISP processor 82 may also receive image data from thememory 51. For example, the sensor interface sends raw image data to thememory 51, and the raw image data in thememory 51 is then provided to theISP processor 82 for processing.
Upon receiving raw image data from the image sensor interface or from thesensor 81 interface or from thememory 51, theISP processor 82 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 62 for additional processing before being displayed. TheISP processor 82 receives the processing data from thememory 51 and performs image data processing on the processing data. The image data processed by theISP processor 82 may be output to a display screen for viewing by a user and/or further processed by a Graphics Processing Unit (GPU). In addition, the output of theISP processor 82 may also be sent to theimage memory 82, and thedisplay screen 55 may read the image data from thememory 51. In one embodiment,memory 51 may be configured to implement one or more frame buffers. In addition, the output of theISP processor 82 may be sent to an encoder/decoder 84 for encoding/decoding the image data. The encoded image data may be saved and decompressed before being displayed on thedisplay screen 55. The encoder/decoder 84 may be implemented by a CPU or GPU or coprocessor.
The statistical data determined by theISP processor 82 may be sent to thecontrol logic unit 83. For example, the statistical data may include image sensor statistics such as auto-exposure, auto-focus, flicker detection, black level compensation, lens shading correction, and the like.Control logic 83 may include a processing element and/or microcontroller that executes one or more routines (e.g., firmware) that determine camera control parameters andISP processor 82 control parameters based on the received statistical data. For example, the control parameters of theinfrared camera 41 may includesensor 81 control parameters (e.g., gain, integration time for exposure control, anti-shake parameters, etc.), camera flash control parameters, lens control parameters (e.g., focal length for focusing or zooming), or a combination of these parameters.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above embodiments of the methods. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (22)

Translated fromChinese
1.一种光学元件破裂的检测方法,所述检测方法用于计算机设备,其特征在于,所述计算机设备包括相机模组,所述光学元件包括所述相机模组的相机光学元件,在使用所述检测方法对所述相机光学元件进行检测过程中,所述相机光学元件位于所述相机模组内;所述检测方法包括:1. a detection method of optical element rupture, described detection method is used in computer equipment, it is characterized in that, described computer equipment comprises camera module, and described optical element comprises the camera optical element of described camera module, in using In the process of detecting the camera optical element by the detection method, the camera optical element is located in the camera module; the detection method includes:获取所述相机模组的运动速度;Obtain the motion speed of the camera module;在所述运动速度大于预设运动速度值时,所述相机模组获取第一图像;When the movement speed is greater than the preset movement speed value, the camera module acquires the first image;处理所述第一图像以判断所述第一图像是否存在裂纹图案;和processing the first image to determine whether the first image has a crack pattern; and在所述第一图像存在裂纹图案时确认所述相机光学元件破裂,且所述确认所述相机光学元件破裂发生在所述计算机设备的使用过程中。The cracking of the camera optics is confirmed when a crack pattern is present in the first image, and the confirmation of the cracking of the camera optics occurs during use of the computer device.2.根据权利要求1所述的检测方法,其特征在于,所述相机模组为红外摄像头,所述第一图像是所述红外摄像头摄取物体反射的环境光中的红外光线形成的。2 . The detection method according to claim 1 , wherein the camera module is an infrared camera, and the first image is formed by capturing the infrared light in the ambient light reflected by the object by the infrared camera. 3 .3.根据权利要求1所述的检测方法,其特征在于,所述处理所述第一图像以判断所述第一图像是否存在裂纹图案的步骤包括:3. The detection method according to claim 1, wherein the step of processing the first image to determine whether a crack pattern exists in the first image comprises:基于Haar-like矩形特征集构建多级裂纹图案分类器;Build a multi-level crack pattern classifier based on Haar-like rectangular feature set;采用正裂纹图案样本和负裂纹图案样本训练所述多级裂纹图案分类器;和training the multi-level crack pattern classifier with positive crack pattern samples and negative crack pattern samples; and采用训练后的所述多级裂纹图案分类器检测所述第一图像是否存在裂纹图案。The trained multi-level crack pattern classifier is used to detect whether a crack pattern exists in the first image.4.根据权利要求1所述的检测方法,其特征在于,所述第一图像包括多帧,处理多帧所述第一图像以判断多帧所述第一图像是否均存在裂纹图案,在多帧所述第一图像均存在裂纹图案时,所述检测方法还包括:4 . The detection method according to claim 1 , wherein the first image includes multiple frames, and the multiple frames of the first images are processed to determine whether there is a crack pattern in the multiple frames of the first images. 5 . When a crack pattern exists in the first image of each frame, the detection method further includes:比较任意两帧所述第一图像中的所述裂纹图案所在的裂纹位置是否一致;和comparing whether the crack positions of the crack patterns in any two frames of the first images are consistent; and在任意两帧所述第一图像中的所述裂纹位置一致时,确认所述相机光学元件破裂。When the positions of the cracks in any two frames of the first images are consistent, it is confirmed that the camera optical element is broken.5.根据权利要求2至4任意一项所述的检测方法,其特征在于,所述相机模组为红外摄像头,所述光学元件还包括红外补光灯的补光光学元件,所述检测方法还包括:5. The detection method according to any one of claims 2 to 4, wherein the camera module is an infrared camera, and the optical element further comprises a supplementary optical element for an infrared supplementary light. The detection method Also includes:在确认所述相机光学元件未破坏时,开启所述红外补光灯和所述红外摄像头;When confirming that the optical element of the camera is not damaged, turn on the infrared fill light and the infrared camera;根据所述红外补光灯发出的红外光线获取第二图像;Acquiring a second image according to the infrared light emitted by the infrared fill light;处理所述第二图像以判断所述第二图像是否存在光纹图案;和processing the second image to determine whether the second image has a light pattern; and在所述第二图像存在所述光纹图案时确认所述补光光学元件破裂。When the light fringe pattern exists in the second image, it is confirmed that the supplementary light optical element is broken.6.根据权利要求5所述的检测方法,其特征在于,所述处理所述第二图像以判断所述第二图像是否存在光纹图案的步骤包括:6. The detection method according to claim 5, wherein the step of processing the second image to determine whether there is a light pattern in the second image comprises:基于Haar-like矩形特征集构建多级光纹图案分类器;Build a multi-level light pattern classifier based on Haar-like rectangular feature set;采用正光纹图案样本和负光纹图案样本训练所述多级光纹图案分类器;和training the multi-level light pattern classifier with positive light pattern samples and negative light pattern samples; and采用训练后的所述多级光纹图案分类器检测所述第二图像是否存在光纹图案。The trained multi-level light pattern classifier is used to detect whether there is a light pattern in the second image.7.根据权利要求6所述的检测方法,其特征在于,所述第二图像包括多帧,处理多帧所述第二图像以判断多帧所述第二图像是否均存在光纹图案,在多帧所述第二图像均存在所述光纹图案时,所述检测方法还包括:7 . The detection method according to claim 6 , wherein the second image includes multiple frames, and the multiple frames of the second image are processed to determine whether there is a light pattern in the multiple frames of the second image. 8 . When the light pattern pattern exists in multiple frames of the second images, the detection method further includes:比较任意两帧所述第二图像中的所述光纹图案所在的光纹位置是否一致;和comparing whether the light pattern positions of the light pattern patterns in any two frames of the second image are consistent; and在任意两帧所述第二图像中的所述光纹位置一致时,确认所述补光光学元件破裂。When the positions of the light patterns in any two frames of the second images are the same, it is confirmed that the optical element for supplementary light is broken.8.根据权利要求2至4任意一项所述的检测方法,其特征在于,所述相机模组为红外摄像头,所述光学元件还包括结构光投射器的结构光光学元件,所述检测方法还包括:8. The detection method according to any one of claims 2 to 4, wherein the camera module is an infrared camera, the optical element further comprises a structured light optical element of a structured light projector, and the detection method Also includes:在确认所述相机光学元件未破裂时,开启所述结构光投射器和所述红外摄像头;Turning on the structured light projector and the infrared camera when confirming that the camera optical element is not broken;根据所述结构光投射器发出的红外光线获取第三图像;acquiring a third image according to the infrared light emitted by the structured light projector;处理所述第三图像以判断所述第三图像中是否存在深度异常信息;和processing the third image to determine whether depth anomaly information exists in the third image; and在所述第三图像中存在深度异常信息时确认所述结构光光学元件破裂。It is confirmed that the structured light optical element is broken when depth anomaly information exists in the third image.9.根据权利要求8所述的检测方法,其特征在于,所述处理所述第三图像以判断所述第三图像中是否存在深度异常信息的步骤包括:9 . The detection method according to claim 8 , wherein the step of processing the third image to determine whether depth abnormality information exists in the third image comprises: 10 .根据所述第三图像和预设参考图像计算所述第三图像中各个像素点的散点偏移量;Calculate the scatter offset of each pixel in the third image according to the third image and the preset reference image;根据所述散点偏移量计算所述第三图像中各个像素点的深度信息;Calculate the depth information of each pixel in the third image according to the scatter offset;计算相邻接的所述深度信息大于预设阈值的像素点的个数;和Calculate the number of adjacent pixels whose depth information is greater than a preset threshold; and在所述个数大于预设数量时确定所述第三图像中存在所述深度异常信息。When the number is greater than a preset number, it is determined that the depth anomaly information exists in the third image.10.根据权利要求8所述的检测方法,其特征在于,所述第三图像包括多帧,处理多帧所述第三图像以判断多帧所述第三图像中是否存在所述深度异常信息,在多帧所述第三图像均存在所述深度异常信息时,所述检测方法还包括:10 . The detection method according to claim 8 , wherein the third image includes multiple frames, and the multiple frames of the third image are processed to determine whether the depth anomaly information exists in the multiple frames of the third image. 11 . , when the depth anomaly information exists in the third images of multiple frames, the detection method further includes:比较任意两帧所述第三图像中所述深度异常信息所处的位置信息是否一致;和comparing whether the location information of the depth anomaly information in any two frames of the third image is consistent; and在任意两帧所述第三图像中所述深度异常信息所处的位置信息一致时,确认所述结构光光学元件破裂。When the position information where the depth anomaly information is located in any two frames of the third images is consistent, it is confirmed that the structured light optical element is broken.11.一种光学元件破裂的检测装置,其特征在于,所述光学元件包括计算机设备中相机模组的相机光学元件,在使用所述检测装置对所述相机光学元件进行检测过程中,所述相机光学元件位于所述相机模组内;所述检测装置包括:11. An optical element crack detection device, characterized in that the optical element comprises a camera optical element of a camera module in a computer equipment, and in the process of using the detection device to detect the camera optical element, the The camera optical element is located in the camera module; the detection device includes:第四获取模块,所述第四获取模块用于获取所述相机模组的运动速度;a fourth acquisition module, which is used to acquire the motion speed of the camera module;在所述运动速度大于预设速度值时所述相机模组获取第一图像;The camera module acquires a first image when the movement speed is greater than a preset speed value;第一处理模块,所述第一处理模块用于处理所述第一图像以判断所述第一图像是否存在裂纹图案;和a first processing module for processing the first image to determine whether a crack pattern exists in the first image; and第一确认模块,所述第一确认模块用于在所述第一图像存在裂纹图案时确认所述相机光学元件破裂,且所述确认所述相机光学元件破裂发生在所述计算机设备的使用过程中。a first confirmation module for confirming that the camera optical element is broken when a crack pattern exists in the first image, and the confirming that the camera optical element is broken during use of the computer device middle.12.根据权利要求11所述的检测装置,其特征在于,所述相机模组为红外摄像头,所述第一图像是所述红外摄像头摄取物体反射的环境光中的红外光线形成的。12 . The detection device according to claim 11 , wherein the camera module is an infrared camera, and the first image is formed by capturing the infrared light in the ambient light reflected by the object by the infrared camera. 13 .13.根据权利要求11所述的检测装置,其特征在于,所述第一处理模块包括:13. The detection device according to claim 11, wherein the first processing module comprises:第一构建单元,所述第一构建单元用于基于Haar-like矩形特征集构建多级裂纹图案分类器;a first construction unit, the first construction unit is used to construct a multi-level crack pattern classifier based on the Haar-like rectangular feature set;第一训练单元,所述第一训练单元用于采用正裂纹图案样本和负裂纹图案样本训练所述多级裂纹图案分类器;和a first training unit for training the multi-level crack pattern classifier with positive crack pattern samples and negative crack pattern samples; and第一检测单元,所述第一检测单元用于采用训练后的所述多级裂纹图案分类器检测所述第一图像是否存在裂纹图案。A first detection unit, which is configured to use the trained multi-level crack pattern classifier to detect whether a crack pattern exists in the first image.14.根据权利要求11所述的检测装置,其特征在于,所述第一图像包括多帧,处理多帧所述第一图像以判断多帧所述第一图像是否均存在裂纹图案,在多帧所述第一图像均存在裂纹图案时,所述检测装置还包括:14. The detection device according to claim 11, wherein the first image includes multiple frames, and the multiple frames of the first images are processed to determine whether there is a crack pattern in the multiple frames of the first images. When a crack pattern exists in the first image of each frame, the detection device further includes:第一比较模块,所述第一比较模块用于比较任意两帧所述第一图像中的所述裂纹图案所在的裂纹位置是否一致;a first comparison module, the first comparison module is configured to compare whether the crack positions where the crack patterns are located in any two frames of the first images are consistent;所述第一确认模块还用于在任意两帧所述第一图像中的所述裂纹位置一致时,确认所述相机光学元件破裂。The first confirmation module is further configured to confirm that the camera optical element is broken when the positions of the cracks in any two frames of the first images are consistent.15.根据权利要求12至14任意一项所述的检测装置,其特征在于,所述相机模组为红外摄像头,所述光学元件还包括红外补光灯的补光光学元件,所述检测装置还包括:15. The detection device according to any one of claims 12 to 14, wherein the camera module is an infrared camera, the optical element further comprises a supplementary optical element of an infrared supplementary light, and the detection device Also includes:第一开启模块,所述第一开启模块用于在确认所述相机光学元件未破坏时,开启所述红外补光灯和所述红外摄像头;a first opening module, which is used to turn on the infrared fill light and the infrared camera when it is confirmed that the optical element of the camera is not damaged;第二获取模块,所述第二获取模块用于根据所述红外补光灯发出的红外光线获取第二图像;a second acquisition module, configured to acquire a second image according to the infrared light emitted by the infrared fill light;第二处理模块,所述第二处理模块用于处理所述第二图像以判断所述第二图像是否存在光纹图案;和a second processing module, the second processing module is configured to process the second image to determine whether there is a light pattern in the second image; and第二确认模块,所述第二确认模块用于在所述第二图像存在所述光纹图案时确认所述补光光学元件破裂。A second confirmation module, the second confirmation module is used for confirming that the supplementary light optical element is broken when the light pattern exists in the second image.16.根据权利要求15所述的检测装置,其特征在于,所述第二处理模块包括:16. The detection device according to claim 15, wherein the second processing module comprises:第二构建单元,所属第二构建单元用于基于Haar-like矩形特征集构建多级光纹图案分类器;a second construction unit, which belongs to the second construction unit for constructing a multi-level light pattern classifier based on the Haar-like rectangular feature set;第二训练单元,所述第二训练单元用于采用正光纹图案样本和负光纹图案样本训练所述多级光纹图案分类器;和a second training unit for training the multi-level light pattern classifier using positive light pattern samples and negative light pattern samples; and第二检测单元,所述第二检测单元用于采用训练后的所述多级光纹图案分类器检测所述第二图像是否存在光纹图案。A second detection unit, the second detection unit is configured to use the trained multi-level light pattern classifier to detect whether there is a light pattern in the second image.17.根据权利要求16所述的检测装置,其特征在于,所述第二图像包括多帧,处理多帧所述第二图像以判断多帧所述第二图像是否均存在光纹图案,在多帧所述第二图像均存在所述光纹图案时,所述检测装置还包括:17. The detection device according to claim 16, wherein the second image comprises multiple frames, and the second images of the multiple frames are processed to determine whether there is a light pattern in the second images of the multiple frames. When the light pattern pattern exists in all the multiple frames of the second images, the detection device further includes:第二比较模块,所述第二比较模块用于比较任意两帧所述第二图像中的所述光纹图案所在的光纹位置是否一致;a second comparison module, the second comparison module is configured to compare whether the light pattern positions of the light pattern patterns in any two frames of the second images are consistent;所述第二确认模块用于在任意两帧所述第二图像中的所述光纹位置一致时,确认所述补光光学元件破裂。The second confirmation module is configured to confirm that the optical element for supplementary light is broken when the positions of the light patterns in any two frames of the second images are consistent.18.根据权利要求12至14任意一项所述的检测装置,其特征在于,所述相机模组为红外摄像头,所述光学元件还包括结构光投射器的结构光光学元件,所述检测装置还包括:18. The detection device according to any one of claims 12 to 14, wherein the camera module is an infrared camera, the optical element further comprises a structured light optical element of a structured light projector, and the detection device Also includes:第二开启模块,所述第二开启模块用于在确认所述相机光学元件未破裂时,开启所述结构光投射器和所述红外摄像头;a second opening module, the second opening module is configured to open the structured light projector and the infrared camera when it is confirmed that the optical element of the camera is not broken;第三获取模块,所述第三获取模块用于根据所述结构光投射器发出的红外光线获取第三图像;a third acquisition module, configured to acquire a third image according to the infrared light emitted by the structured light projector;第三处理模块,所述第三处理模块用于处理所述第三图像以判断所述第三图像中是否存在深度异常信息;和a third processing module, the third processing module is configured to process the third image to determine whether depth anomaly information exists in the third image; and第三确认模块,所述第三确认模块用于在所述第三图像中存在深度异常信息时确认所述结构光光学元件破裂。A third confirmation module, the third confirmation module is configured to confirm that the structured light optical element is broken when there is depth abnormality information in the third image.19.根据权利要求18所述的检测装置,其特征在于,所述第三处理模块包括:19. The detection device according to claim 18, wherein the third processing module comprises:第一计算单元,所述第一计算单元用于根据所述第三图像和预设参考图像计算所述第三图像中各个像素点的散点偏移量;a first calculation unit, the first calculation unit is configured to calculate the scatter offset of each pixel in the third image according to the third image and the preset reference image;第二计算单元,所述第二计算单元用于根据所述散点偏移量计算所述第三图像中各个像素点的深度信息;a second calculation unit, configured to calculate the depth information of each pixel in the third image according to the scatter offset;第三计算单元,所述第三计算单元用于计算相邻接的所述深度信息大于预设阈值的像素点的个数;和a third calculation unit, the third calculation unit is configured to calculate the number of adjacent pixels whose depth information is greater than a preset threshold; and确认单元,所述确认单元用于在所述个数大于预设数量时确定所述第三图像中存在所述深度异常信息。a confirmation unit, configured to determine that the depth anomaly information exists in the third image when the number is greater than a preset number.20.根据权利要求18所述的检测装置,其特征在于,所述第三图像包括多帧,处理多帧所述第三图像以判断多帧所述第三图像中是否存在所述深度异常信息,在多帧所述第三图像均存在所述深度异常信息时,所述检测装置还包括:20 . The detection device according to claim 18 , wherein the third image comprises multiple frames, and the multiple frames of the third image are processed to determine whether the depth abnormality information exists in the multiple frames of the third image. 21 . , when the depth anomaly information exists in the third images of multiple frames, the detection device further includes:第三比较模块,所述第三比较模块用于比较任意两帧所述第三图像中所述深度异常信息所处的位置信息是否一致;和a third comparison module, the third comparison module is configured to compare whether the position information where the depth anomaly information is located in any two frames of the third image is consistent; and所述第三确认模块还用于在任意两帧所述第三图像中所述深度异常信息所处的位置信息一致时,确认所述结构光光学元件破裂。The third confirmation module is further configured to confirm that the structured light optical element is broken when the location information of the depth anomaly information in any two frames of the third images is consistent.21.一种计算机设备,包括存储器及处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行权利要求1至10任意一项所述的检测方法。21. A computer device, comprising a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor is caused to perform any one of claims 1 to 10. One of the detection methods described.22.一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行权利要求1至10中任意一项所述的检测方法。22. One or more non-volatile computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform claims 1 to 10 The detection method described in any one of.
CN201711465117.7A2017-12-282017-12-28Detection method, detection device, computer equipment and computer readable storage mediumActiveCN108198175B (en)

Priority Applications (2)

Application NumberPriority DateFiling DateTitle
CN201711465117.7ACN108198175B (en)2017-12-282017-12-28Detection method, detection device, computer equipment and computer readable storage medium
PCT/CN2018/123585WO2019129004A1 (en)2017-12-282018-12-25Detection method, detection device, computer device, and computer readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201711465117.7ACN108198175B (en)2017-12-282017-12-28Detection method, detection device, computer equipment and computer readable storage medium

Publications (2)

Publication NumberPublication Date
CN108198175A CN108198175A (en)2018-06-22
CN108198175Btrue CN108198175B (en)2021-09-10

Family

ID=62585450

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201711465117.7AActiveCN108198175B (en)2017-12-282017-12-28Detection method, detection device, computer equipment and computer readable storage medium

Country Status (2)

CountryLink
CN (1)CN108198175B (en)
WO (1)WO2019129004A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108989710B (en)*2018-07-162020-09-04维沃移动通信有限公司Infrared supplementary lighting module failure detection method, terminal device and computer readable storage medium
CN109063761B (en)*2018-07-202020-11-03北京旷视科技有限公司 Diffuser shedding detection method, device and electronic equipment
CN112287727A (en)*2019-07-242021-01-29云从科技集团股份有限公司Structured light equipment, detection module and electronic terminal
CN110769246B (en)*2019-09-062023-04-11华为技术有限公司Method and device for detecting faults of monitoring equipment
CN112419228B (en)*2020-10-142022-04-05高视科技(苏州)有限公司Method and device for detecting three-dimensional edge defect of cover plate
CN112991264B (en)*2021-02-052023-08-11西安理工大学 A detection method for crack defects in monocrystalline silicon photovoltaic cells
CN116297481B (en)*2023-02-282025-07-29广东利元亨智能装备股份有限公司Detection method, detection device, electronic equipment and computer readable storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102025901A (en)*2009-09-232011-04-20国基电子(上海)有限公司Camera module and detection method thereof
CN101819163A (en)*2010-06-032010-09-01成都精密光学工程研究中心Detection device of subsurface defect of optical element and method thereof
US8766192B2 (en)*2010-11-012014-07-01Asm Assembly Automation LtdMethod for inspecting a photovoltaic substrate
JP2015534734A (en)*2012-06-282015-12-03ペリカン イメージング コーポレイション System and method for detecting defective camera arrays, optical arrays, and sensors
CN203133000U (en)*2013-03-152013-08-14安徽工程大学Image-based glass defect online detection device
CN103399021B (en)*2013-08-152015-11-04厦门大学 A detection method for subsurface cracks in transparent optical components
CN104132944B (en)*2014-07-112017-02-15西安交通大学Method for detecting subsurface damage degree characterization parameters of spherical optical element
CN104777172B (en)*2015-04-302018-10-09重庆理工大学A kind of quick, intelligent detection device of optical lens substandard products and method

Also Published As

Publication numberPublication date
WO2019129004A1 (en)2019-07-04
CN108198175A (en)2018-06-22

Similar Documents

PublicationPublication DateTitle
CN108198175B (en)Detection method, detection device, computer equipment and computer readable storage medium
CN108716983B (en)Optical element detection method and device, electronic device and storage medium
CN107451969B (en)Image processing method, image processing device, mobile terminal and computer readable storage medium
CN107734253B (en)Image processing method, image processing device, mobile terminal and computer-readable storage medium
CN108111749B (en)Image processing method and device
CN102147856B (en) Image recognition device and control method thereof
US9953428B2 (en)Digital camera unit with simultaneous structured and unstructured illumination
CN108600740B (en)Optical element detection method, optical element detection device, electronic equipment and storage medium
CN108716982B (en)Optical element detection method, optical element detection device, electronic equipment and storage medium
US9501691B2 (en)Method and apparatus for detecting blink
CN110572573A (en) Focusing method and apparatus, electronic device, computer-readable storage medium
CN112889062B (en)Face recognition data processing method, device, mobile equipment and computer readable storage medium
US20140169642A1 (en)System and method for passive live person verification using real-time eye reflection
CN109683698B (en)Payment verification method and device, electronic equipment and computer-readable storage medium
CN109327626B (en)Image acquisition method and device, electronic equipment and computer readable storage medium
CN110121031B (en) Image acquisition method and apparatus, electronic device, computer-readable storage medium
CN105303155B (en)Iris identification equipment and its operating method
CN107563979B (en)Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107464225B (en) Image processing method, apparatus, computer-readable storage medium, and mobile terminal
CN108615012A (en)distance reminding method, electronic device and non-volatile computer-readable storage medium
CN104090656A (en)Eyesight protecting method and system for smart device
CN107563329B (en)Image processing method, image processing device, computer-readable storage medium and mobile terminal
CN108760245B (en)Optical element detection method and device, electronic equipment and readable storage medium
US20160034759A1 (en)Apparatus and method for recognizing iris
CN109068060B (en) Image processing method and apparatus, terminal device, and computer-readable storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information
CB02Change of applicant information

Address after:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after:OPPO Guangdong Mobile Communications Co.,Ltd.

Address before:Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before:GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp