CN108716982A - Optical element detection method, device, electronic equipment and storage medium - Google Patents

Optical element detection method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN108716982A
CN108716982A CN201810403817.1A CN201810403817A CN108716982A CN 108716982 A CN108716982 A CN 108716982A CN 201810403817 A CN201810403817 A CN 201810403817A CN 108716982 A CN108716982 A CN 108716982A
Authority
CN
China
Prior art keywords
region
zero level
mean value
luminance mean
speckle pattern
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.)
Granted
Application number
CN201810403817.1A
Other languages
Chinese (zh)
Other versions
CN108716982B (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 Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810403817.1A priority Critical patent/CN108716982B/en
Publication of CN108716982A publication Critical patent/CN108716982A/en
Priority to PCT/CN2019/075386 priority patent/WO2019174435A1/en
Priority to EP19736569.5A priority patent/EP3567851A4/en
Priority to TW108108335A priority patent/TWI696391B/en
Priority to US16/684,299 priority patent/US11348217B2/en
Application granted granted Critical
Publication of CN108716982B publication Critical patent/CN108716982B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M11/00Testing of optical apparatus; Testing structures by optical methods not otherwise provided for

Landscapes

  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)

Abstract

This application involves a kind of optical element detection method, device, electronic equipment and computer readable storage mediums.The method includes:Obtain infrared figure and speckle pattern, the first zero level region of speckle pattern and the luminance mean value in the first zero level region are obtained according to speckle pattern, detect the luminance mean value of first peripheral region of the speckle pattern around the first zero level region, obtain the luminance mean value in the first zero level region and the first peripheral region corresponding second zero level region and the second peripheral region in infrared figure with speckle pattern, when the ratio that the ratio of the luminance mean value in the first zero level region and the luminance mean value of the first peripheral region is more than the luminance mean value of the first preset value and the luminance mean value and the second zero level region in the first zero level region is more than the ratio of the luminance mean value of the first peripheral region and the luminance mean value of the second peripheral region, then judge optical element exception.Due to being detected to optical element according to the luminance mean value of speckle pattern and infrared figure, the accuracy of detection can be improved.

Description

Optical element detection method, device, electronic equipment and storage medium
Technical field
This application involves field of computer technology, more particularly to a kind of optical element detection method, device, electronic equipment And computer readable storage medium.
Background technology
With the development of computer technology, depth image technology is widely used in intelligent electronic device.Electronic equipment can be with It is irradiated on object by diffraction optical element by Laser video camera head acquisition laser and is formed by speckle pattern, obtain image object Depth information, to be applied to the scenes such as face or object identification, 3D printing, human-computer interaction.
However, when diffraction optics is damaged, laser irradiation can cause serious injury human eye to when human eye, traditional technology In the detection of optical element is easy to be influenced by object infrared emittance, there is a problem of that detection accuracy is low.
Invention content
A kind of optical element detection method of the embodiment of the present application offer, device, electronic equipment and computer-readable storage medium Matter can improve the accuracy of optical element detection.
A kind of optical element detection method, the method includes:
Infrared figure and speckle pattern are obtained, the speckle pattern is that the laser that light source generates in the projector passes through institute after optical element The image of formation;
The first zero level region of the speckle pattern and the luminance mean value in the first zero level region, institute are obtained according to the speckle pattern It is the maximum region of brightness to state zero level region;
Detect the luminance mean value of first peripheral region of the speckle pattern around first zero level region;
The brightness for obtaining the first zero level region corresponding second zero level region in the infrared figure with the speckle pattern is equal Value, and the second peripheral region corresponding with the first peripheral region of the speckle pattern luminance mean value;
When the ratio of the luminance mean value of the luminance mean value and first peripheral region in first zero level region is more than the When one preset value and zero level area ratio are more than peripheral region ratio, then judge that the optical element is abnormal;Wherein, the zero level Area ratio is the ratio of the luminance mean value in first zero level region and the luminance mean value in the second zero level region, the peripheral region Domain ratio is the ratio of the luminance mean value of first peripheral region and the luminance mean value of the second peripheral region.
A kind of optical element detection device, described device include:
Image collection module, for obtaining infrared figure and speckle pattern, the speckle pattern is the sharp of light source generation in the projector Light after optical element by being formed by image;
Zero level region acquisition module, the first zero level region and first for obtaining the speckle pattern according to the speckle pattern The luminance mean value in zero level region, the zero level region are the maximum region of brightness;
First brightness detection module, for detecting first peripheral region of the speckle pattern around first zero level region The luminance mean value in domain;
Second brightness detection module, it is corresponding with the first zero level region of the speckle pattern in the infrared figure for obtaining The luminance mean value in the second zero level region, and the second peripheral region corresponding with the first peripheral region of the speckle pattern brightness Mean value;
Determination module, the luminance mean value for luminance mean value and first peripheral region when first zero level region Ratio when being more than the first preset value and zero level area ratio and being more than peripheral region ratio, then judge that the optical element is abnormal; Wherein, the zero level area ratio is the ratio of the luminance mean value in first zero level region and the luminance mean value in the second zero level region Value, the peripheral region ratio are the ratio of the luminance mean value of first peripheral region and the luminance mean value of the second peripheral region Value.
A kind of electronic equipment, including memory and processor are stored with computer program, the calculating in the memory When machine program is executed by the processor so that the processor executes following steps:
Infrared figure and speckle pattern are obtained, the speckle pattern is that the laser that light source generates in the projector passes through institute after optical element The image of formation;
The first zero level region of the speckle pattern and the luminance mean value in the first zero level region, institute are obtained according to the speckle pattern It is the maximum region of brightness to state zero level region;
Detect the luminance mean value of first peripheral region of the speckle pattern around first zero level region;
The brightness for obtaining the first zero level region corresponding second zero level region in the infrared figure with the speckle pattern is equal Value, and the second peripheral region corresponding with the first peripheral region of the speckle pattern luminance mean value;
When the ratio of the luminance mean value of the luminance mean value and first peripheral region in first zero level region is more than the When one preset value and zero level area ratio are more than peripheral region ratio, then judge that the optical element is abnormal;Wherein, the zero level Area ratio is the ratio of the luminance mean value in first zero level region and the luminance mean value in the second zero level region, the peripheral region Domain ratio is the ratio of the luminance mean value of first peripheral region and the luminance mean value of the second peripheral region.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor Following steps are realized when row:
Infrared figure and speckle pattern are obtained, the speckle pattern is that the laser that light source generates in the projector passes through institute after optical element The image of formation;
The first zero level region of the speckle pattern and the luminance mean value in the first zero level region, institute are obtained according to the speckle pattern It is the maximum region of brightness to state zero level region;
Detect the luminance mean value of first peripheral region of the speckle pattern around first zero level region;
The brightness for obtaining the first zero level region corresponding second zero level region in the infrared figure with the speckle pattern is equal Value, and the second peripheral region corresponding with the first peripheral region of the speckle pattern luminance mean value;
When the ratio of the luminance mean value of the luminance mean value and first peripheral region in first zero level region is more than the When one preset value and zero level area ratio are more than peripheral region ratio, then judge that the optical element is abnormal;Wherein, the zero level Area ratio is the ratio of the luminance mean value in first zero level region and the luminance mean value in the second zero level region, the peripheral region Domain ratio is the ratio of the luminance mean value of first peripheral region and the luminance mean value of the second peripheral region.
Above-mentioned optical element detection method, device, electronic equipment and computer readable storage medium, can obtain infrared figure The laser generated with light source in the projector obtains the of speckle pattern by being formed by speckle pattern after optical element, according to speckle pattern One zero level region and corresponding first zero level regional luminance mean value, detection speckle pattern around the first zero level region first around Luminance mean value, obtain the first zero level region and the first peripheral region corresponding second zero level region with speckle pattern in infrared figure With the luminance mean value of the second peripheral region, when the ratio of the luminance mean value of the luminance mean value and the first peripheral region in the first zero level region Value is more than the first peripheral region more than the first preset value and the first zero level region and the ratio of the luminance mean value in the second zero level region When with the ratio of the luminance mean value of the second peripheral region, then optical element exception is judged.Due to can be according to the zero level of speckle pattern The luminance mean value of region zero level region corresponding with the luminance mean value of peripheral region and infrared figure and peripheral region is to optical element It is detected, the accuracy of detection can be improved.
Description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with Obtain other attached drawings according to these attached drawings.
Fig. 1 is the application scenario diagram of optical element detection method in one embodiment;
Fig. 2 is the flow chart of optical element detection method in one embodiment;
Fig. 3 is the flow chart that speckle pattern zero level region is obtained in one embodiment;
Fig. 4 is the flow chart that speckle pattern is detected in one embodiment;
Fig. 5 is the schematic diagram for the peripheral region that speckle pattern zero level region is obtained in one embodiment;
Fig. 6 is the flow chart that infrared figure different zones luminance mean value is obtained in one embodiment;
Fig. 7 is the flow chart of optical element detection method in another embodiment;
Fig. 8 is the structure diagram of optical element detection device in one embodiment;
Fig. 9 is the schematic diagram of image processing circuit in one embodiment.
Specific implementation mode
It is with reference to the accompanying drawings and embodiments, right in order to make the object, technical solution and advantage of the application be more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, and It is not used in restriction the application.
It is appreciated that term " first " used in this application, " second " etc. can be used to describe herein various elements, But these elements should not be limited by these terms.These terms are only used to distinguish first element and another element.Citing comes It says, in the case where not departing from scope of the present application, the first client can be known as the second client, and similarly, can incite somebody to action Second client is known as the first client.First client and the second client both client, but it is not same visitor Family end.
Fig. 1 is the application scenario diagram of optical element detection method in one embodiment.As shown in Figure 1, electronic equipment 10 can Including camera module 110, second processing unit 120, first processing units 130.Above-mentioned second processing unit 120 can be CPU (Central Processing Unit, central processing unit) module.Above-mentioned first processing units 130 can be MCU (Microcontroller Unit, micro-control unit) module 130 etc..Wherein, first processing units 130 are connected to second processing Between unit 120 and camera module 110, above-mentioned first processing units 130 can control Laser video camera head in camera module 110 112, floodlight 114 and color-changing lamp 118, above-mentioned second processing unit 120 can control RGB cameras in camera module 110 116。
Camera module 110 include Laser video camera head 112, floodlight 114, RGB (Red/Green/Blue, red green/ Blue color pattern) camera 116 and color-changing lamp 118.Above-mentioned Laser video camera head 112 is infrared camera, for obtaining infrared figure Picture.Above-mentioned floodlight 114 is the area source that infrared light can occur;Above-mentioned color-changing lamp 118 is that the point light source of laser can occur and be With figuratum point light source.Wherein, when floodlight 114 emits area source, Laser video camera head 112 can be according to the light being reflected back Obtain infrared image.When color-changing lamp 118 emits point light source, Laser video camera head 112 can obtain speckle according to the light being reflected back Image.Above-mentioned speckle image is the image that pattern deforms upon after the figuratum point light source of band that color-changing lamp 118 emits is reflected.
First processing units 130 include PWM (Pulse Width Modulation, pulse width modulation) module 132, SPI/I2C (Serial Peripheral Interface/Inter-Integrated Circuit, Serial Peripheral Interface (SPI)/bis- To two-wire system synchronous serial interface) interface 134, RAM (Random Access Memory, random access memory) module 136 With depth engine 138.Above-mentioned PWM module 132 can emit pulse to camera module, control floodlight 114 or color-changing lamp 118 is opened It opens so that Laser video camera head 112 can collect infrared image or speckle image.Above-mentioned SPI/I2C interfaces 134 are for receiving second The face acquisition instructions that processing unit 120 is sent.Above-mentioned depth engine 138 can handle speckle image to obtain depth parallax Figure.
When second processing unit 120 receives the data acquisition request of application program, for example, when application program need into When the unlock of pedestrian's face, face payment, face can be sent to first processing units 130 by operating in the CPU core under TEE environment Acquisition instructions.After first processing units 130 receive face acquisition instructions, impulse wave control can be emitted by PWM module 132 Floodlight 114 is opened and acquires infrared image, control camera module 110 by Laser video camera head 112 in camera module 110 Middle color-changing lamp 118 is opened and acquires speckle image by Laser video camera head 112.Camera module 110 can will be collected infrared Image and speckle image are sent to first processing units 130.First processing units 130 can be at the infrared image that receives Reason obtains infrared disparity map;The speckle image received is handled to obtain speckle disparity map or depth parallax figure.Wherein, It refers to carrying out school to infrared image or speckle image that one processing unit 130 carries out processing to above-mentioned infrared image and speckle image Just, influence of the inside and outside parameter to image in camera module 110 is removed.Wherein, first processing units 130 can be set to different The image of pattern, different mode output is different.When first processing units 130 are set as speckle chart-pattern, first processing units 130 pairs of speckle image processings obtain speckle disparity map, and target speckle image can be obtained according to above-mentioned speckle disparity map;At first When reason unit 130 is set as depth chart-pattern, first processing units 130 obtain depth parallax figure to speckle image processing, according to Depth image can be obtained in above-mentioned depth parallax figure, and above-mentioned depth image refers to the image with depth information.First processing units 130 can be sent to above-mentioned infrared disparity map and speckle disparity map second processing unit 120, and first processing units 130 can also incite somebody to action Above-mentioned infrared disparity map and depth parallax figure are sent to second processing unit 120.Second processing unit 120 can be according to above-mentioned infrared Disparity map obtains Infrared Targets image, obtains depth image according to above-mentioned depth parallax figure.Further, second processing unit 120 can detect according to Infrared Targets image, depth image to carry out recognition of face, face matching, In vivo detection and acquisition Face depth information.
Communicated between first processing units 130 and second processing unit 120 is by fixed safe interface, to ensure The safety of transmission data.As shown in Figure 1, the data that second processing unit 120 is sent to first processing units 130 are to pass through peace Full serial Peripheral Interface or bidirectional two-line synchronous serial interface (SECURE SPI/I2C) 140, first processing units 130 are sent Data to second processing unit 120 be by safety moving Industry Processor Interface (SECURE MIPIMobile, Industry Processor Interface)150。
In one embodiment, first processing units 130 are by controlling floodlight 114 and radium-shine in camera module 110 Lamp 118 is opened and acquires corresponding infrared figure and speckle pattern by Laser video camera head 112, and camera module 110 can be by acquisition Infrared figure and speckle pattern are sent to first processing units 130, and first processing units 130 can be obtained according to speckle pattern in speckle pattern The maximum region of the brightness i.e. luminance mean value in the first zero level region and the first zero level region, and speckle pattern is detected in the first zero level area The luminance mean value of the first peripheral region around domain, first processing units 130 can also obtain with speckle pattern in infrared figure The luminance mean value in one zero level region and the first peripheral region corresponding second zero level region and the second peripheral region, when the first zero level The ratio of the luminance mean value in region and the luminance mean value of the first peripheral region is more than the first preset value and zero level area ratio is more than When peripheral region ratio, first processing units 130 judge that optical element is abnormal, and wherein zero level area ratio is the first zero level region Luminance mean value and the second zero level region luminance mean value ratio, peripheral region ratio be the first peripheral region luminance mean value With the ratio of the luminance mean value of the second peripheral region.
Fig. 2 is the flow chart of optical element detection method in one embodiment.As shown in Fig. 2, the optical element detection side Method includes step 202 to step 210.
Step 202, infrared figure and speckle pattern are obtained, speckle pattern is that the laser that light source generates in the projector passes through optical element After be formed by image.
Infrared figure refers to that electronic equipment is emitted by controlling floodlight on Infrared irradiation to object, and passes through Laser video camera The infrared image that head is acquired according to the light being reflected back.Floodlight is the area source that infrared light can occur.Speckle pattern refers to laser The laser of camera acquisition generated by light source in the projector, which is irradiated to by optical element on object, is formed by speckle image. The projector of electronic equipment can be color-changing lamp.The projector includes light source, collimating mirror and optical element.Wherein, light source can be face Emit laser, vertical cavity surface laser (VCSEL, Vertical Cavity Surface Emitting Laser) array.Optics Element can be both DOE (Diffractive Optical Elements, diffraction optical element), frosted glass or the insides group Close etc..Laser video camera head includes imaging sensor, lens etc., and imaging sensor can be CMOS (Complementary Metal Oxide Semiconductor, complementary metal oxide semiconductor), CCD (Charge-coupled Device, Charged Couple Element) etc..
Electronic equipment is irradiated to the light reflected on object by Laser video camera head acquisition floodlight and is formed by infrared figure The laser generated with light source in the projector, which is irradiated to by optical element on object, is formed by speckle pattern.
Step 204, according to speckle pattern obtain speckle pattern the first zero level region and the first zero level region luminance mean value, zero Grade region is the maximum region of brightness.
Zero level region refers to the maximum region of brightness value in speckle pattern.In the case where optical element is abnormal, due to The optical characteristics of laser can cause the brightness of picture centre region abnormal.Specifically, it is influenced by shooting distance, speckle pattern Zero level region is likely located at the center of speckle pattern, it is also possible to be located at the center of speckle pattern position to the right.Specifically, electronic equipment The search box that size can be preset by setting traverses speckle pattern, and the region where the maximum search box of brightness value is made For the first zero level region of speckle pattern, and obtain the luminance mean value in the first zero level region.The luminance mean value in the first zero level region is Refer to the average value of the brightness of each pixel in the first zero level region.
Electronic equipment is used as the zero level region of speckle pattern by searching for the maximum region of brightness in speckle pattern, and obtains zero level The luminance mean value in region.
Step 206, the luminance mean value of first peripheral region of the detection speckle pattern around the first zero level region.
First peripheral region of the speckle pattern around the first zero level region refers in speckle pattern in addition to where zero level region Other regions outside region.Specifically, electronic equipment can detect whole region of the speckle pattern around the first zero level region Luminance mean value can also obtain the part around the first zero level region by extracting the subregion around the first zero level region The luminance mean value in region.Electronic equipment to the extraction quantity in the region around zero level region can according to the demand of practical application and Detection result determines.Specifically, electronic equipment to the extraction quantity in the region around zero level region can be 4,8,12 It is a etc. without being limited thereto.
Electronic equipment is by obtaining region of the speckle pattern around zero level region, each picture in region around detection zero level region The brightness value of vegetarian refreshments, and calculate luminance mean value of the average value as the region around zero level region of the brightness of each pixel.
Step 208, the brightness for obtaining the first zero level region corresponding second zero level region in infrared figure with speckle pattern is equal Value, and the second peripheral region corresponding with the first peripheral region of speckle pattern luminance mean value.
Electronic equipment obtains the first zero level region position corresponding second zero level area with speckle pattern in infrared figure The luminance mean value in domain.Electronic equipment obtains second week corresponding with the first peripheral region position of speckle pattern in infrared figure Enclose the luminance mean value in region.Specifically, when the whole region outside the first zero level region that electronic equipment obtains speckle pattern is as scattered When the first peripheral region of spot figure, then the luminance mean value of the whole region outside corresponding the second zero level region for obtaining infrared figure is made For the luminance mean value of the second peripheral region.When electronic equipment obtains subregion of the speckle pattern outside the first zero level region as the When one peripheral region, then the luminance mean value of the subregion outside corresponding the second zero level region for obtaining infrared figure.Electronic equipment Extraction number to the extraction quantity of the second peripheral region of infrared figure, extraction area size etc. with the first peripheral region of speckle pattern The one-to-one correspondence such as amount, extraction area size.Electronic equipment by obtain in infrared figure with the first zero level region and the first peripheral region The brightness value of the corresponding each pixel in domain position calculates the luminance mean value in the second zero level region and the second peripheral region.
Step 210, when the ratio of the luminance mean value of the luminance mean value and the first peripheral region in the first zero level region is more than the When one preset value and zero level area ratio are more than peripheral region ratio, then optical element exception is judged;Wherein, zero level area ratio For the ratio of the luminance mean value of the luminance mean value and the second zero level region in the first zero level region, peripheral region ratio is around first The ratio of the luminance mean value of the luminance mean value in region and the second peripheral region.
First preset value can be determined according to experimental data and practical application effect.First preset value can work as optics There is perforation on element or there are when cut, the laser that light source generates in the projector is irradiated on object when institute by optical element The ratio of the luminance mean value in zero level region and peripheral region in the speckle pattern of formation.Electronic equipment is working as the bright of the first zero level region The ratio for spending the luminance mean value of mean value and the first peripheral region is more than the first preset value and zero level area ratio is more than peripheral region When ratio, then judge optical element exception, at this time optical element there may be perforation or cut, electronic equipment can to user into Row is reminded and testing result is uploaded to server.When the brightness of the luminance mean value and the first peripheral region in the first zero level region is equal When the ratio of value is more than the first preset value but zero level area ratio and is not greater than peripheral region ratio, the first zero level region at this time The ratio of luminance mean value and the first peripheral region luminance mean value may be due to existing to red in speckle pattern more than the first preset value Caused by the reasons such as the high material of outer luminous emissivity, then electronic equipment judgement optical element is without abnormal.
Optical element detection method in the embodiment of the present application is swashed by what light source in the infrared figure of acquisition and the projector generated Light obtains the first zero level region and corresponding first of speckle pattern according to speckle pattern by being formed by speckle pattern after optical element Zero level regional luminance mean value, detection speckle pattern around the first zero level region first around luminance mean value, obtain infrared figure In with the brightness in the first zero level region and the first peripheral region corresponding second zero level region and the second peripheral region of speckle pattern Mean value, when the ratio of the luminance mean value of the luminance mean value and the first peripheral region in the first zero level region is more than the first preset value and the One zero level region is more than the brightness of the first peripheral region and the second peripheral region with the ratio of the luminance mean value in the second zero level region When the ratio of mean value, then optical element exception is judged.Due to can be according to the zero level region of speckle pattern and the brightness of peripheral region Mean value and the luminance mean value of the corresponding zero level region of infrared figure and peripheral region are detected optical element, avoid because there are red Speckle pattern zero level regional luminance variation caused by high object of outer emissivity etc. influences the testing result of optical element, can improve The accuracy of detection.
In one embodiment, zero level region and the zero level that speckle pattern is obtained in a kind of optical element detection method are provided The process of the luminance mean value in region may include:
Step 302, it is traversed in the predeterminable area of speckle pattern using the posting of default size.
The predeterminable area of speckle pattern refers to the maximum magnitude of preset zero level region region.Default size is determined Position frame refers to the search box set according to the size in zero level region.Specifically, the size and posting of the predeterminable area of speckle pattern Default size can be determined according to the demand in experimental data or practical application.Posting is in the predeterminable area of speckle pattern Traversal mode can be lateral traversal, can also be vertical traversal.Electronic equipment can also be according to posting institute in ergodic process Position where prejudging zero level region in the brightness value of position determines the different zones in predeterminable area according to judging result Traversal number.For example, in the speckle pattern of a 1000*1000 pixel, predeterminable area can be pixel value be 600*600 and in The region that heart point is overlapped with speckle pattern, the posting of default size can be the postings that pixel value is 30*30, and electronic equipment can The posting of 30*30 to be traversed in predeterminable area, if normal in the case of the number that laterally traverses be 100 times, primary horizontal During traversal, the brightness value that electronic equipment is located at right side according to posting in ergodic process is located at left side more than posting When brightness value, it can be determined that zero level region position be speckle pattern right side, and according to judging result to traversal number into Row adjustment, reduces the traversal number of left area.
Step 304, using the maximum posting region of luminance mean value as the first zero level region of speckle pattern.
The traversal of predeterminable area of the electronic equipment using the posting of default size in speckle pattern simultaneously obtains in ergodic process The luminance mean value of posting region, using the region where the maximum posting of luminance mean value as the first zero level of speckle pattern Region, while obtaining the luminance mean value in the first zero level region.
It is traversed in the predeterminable area of speckle pattern by using the posting of default size, by the maximum posting of brightness value Region can improve acquisition zero level as the first zero level region of speckle pattern and the luminance mean value in the first zero level region of acquisition The efficiency in region.
As shown in figure 4, in one embodiment, a kind of optical element detection method provided can also include:
Step 402, the first quantity region around the first zero level region of speckle pattern is obtained.
Specifically, the first quantity region around zero level region can be region identical with the size in zero level region, It can also be the different regions from zero level area size, such as can be region more twice than zero level area size, also may be used To be the region etc. smaller than zero level region.Electronic equipment obtain the peripheral region in zero level region the first quantity can with 4,8, 10 etc. without being limited thereto.
Step 404, when the ratio of the luminance mean value and the luminance mean value in the first quantity region in the first zero level region is big When the first preset value, then judge that the ratio of the luminance mean value and the luminance mean value of the first peripheral region in the first zero level region is more than First preset value.
When region around the first zero level region of electronic equipment acquisition has multiple, if the luminance mean value in the first zero level region When being all higher than the first preset value with the luminance mean value of multiple regions around, then the luminance mean value and first in the first zero level region is judged The ratio of the luminance mean value of peripheral region is more than the first preset value.When the luminance mean value and surrounding multiple regions in the first zero level region Luminance mean value ratio there are one be less than the first preset value, then judge the luminance mean value and the first peripheral region in the first zero level region The luminance mean value in domain is not more than the first preset value.For example, electronic equipment obtains the brightness in 4 regions around the first zero level region Mean value is respectively 80,88,93,100, and the first preset value is 2, if the luminance mean value in the first zero level region is 220, the first zero level Region and the ratio of the luminance mean value in 4 regions of surrounding are respectively 2.75,2.50,2.44,2.2, are all higher than the first preset value, then Judge that the ratio of the luminance mean value in the first zero level region and the luminance mean value of the first peripheral region is more than the first preset value, if first The brightness in zero level region is 180, then the ratio of the luminance mean value in the first zero level region and 4 regions of surrounding be respectively 2.25, 2.05,1.94,1.8, since there are the ratios of luminance mean value to be less than 2, then judge the luminance mean value and first in the first zero level region The luminance mean value of peripheral region is not more than the first preset value.
By extracting the first quantity region around the first zero level region, when the luminance mean value in zero level region and first count When the ratio of the luminance mean value in amount region is more than the first preset value, then judge the first zero level region luminance mean value and first week The ratio for enclosing the luminance mean value in region is more than the first preset value, can be to avoid the part week caused by time for exposure, object reflection etc. The brightness for enclosing region is excessive and detects the problem of mistake, improves the accuracy of detection.
In one embodiment, the first zero level region week of speckle pattern is provided in a kind of optical element detection method provided The the first quantity region enclosed includes:It obtains and is no more than 0 with the horizontal distance in the first zero level region of speckle pattern and vertical range The first quantity region
No more than 0 refer in the horizontal direction, obtaining the side in region with the horizontal distance in the first zero level region of speckle pattern The coincident of edge and the first zero level region or the first zero level region.Likewise, vertical with the first zero level region of speckle pattern Distance refers to the edge and the edge in the first zero level region or the first zero level region for obtaining region in vertical direction no more than 0 It overlaps.Obtain the first quantity region institute no more than 0 with the horizontal distance in the first zero level region of speckle pattern and vertical range Position cannot be overlapped with the position where the first zero level region.First quantity region that electronic equipment obtains can be with It is that 2 regions, 4 regions, 8 regions etc. are without being limited thereto.The size in the first quantity region that electronic equipment obtains can be with First zero level region it is in the same size, can also be more than or less than the first zero level region size.It is bright when the first zero level region When degree mean value and the luminance mean value in the first quantity region are all higher than the first preset value, then judge that the brightness in the first zero level region is equal Value and the ratio of the luminance mean value of the first peripheral region are more than the first preset value.When the luminance mean value and first in the first zero level region There are one the first preset value is less than in the ratio of the luminance mean value in quantity region, then the luminance mean value in the first zero level region is judged It is not more than the first preset value with the luminance mean value of the first peripheral region.
As shown in figure 5, for the region around the first zero level region of electronic equipment acquisition and speckle pattern in one embodiment Schematic diagram.First zero level region 502 is the maximum region of luminance mean value in speckle pattern, and 8 regions 504 of surrounding are and the 1st The horizontal distance in grade region and 8 regions that vertical range is no more than 0 and size is consistent with the first zero level region.Electronic equipment The luminance mean value that 8 regions 504 around can be detected, when the around luminance mean value in 8 regions 504 and the first zero level region 502 The ratio of luminance mean value when being all higher than the first preset value, then judge the luminance mean value and the first peripheral region in the first zero level region Luminance mean value ratio be more than the first preset value.In other embodiments, the first peripheral region that electronic equipment obtains can be with It is that 4 regions therein, 6 regions etc. are without being limited thereto.
As shown in fig. 6, in one embodiment, the second of infrared figure is obtained in a kind of optical element detection method provided The process of the luminance mean value in zero level region and the second peripheral region includes:
Step 602, it is obtained and the first zero level region of speckle pattern and the first peripheral region corresponding second according to infrared figure Zero level region and the second peripheral region.
Electronic equipment obtains the first zero level region position corresponding second zero level area with speckle pattern in infrared figure Domain.The location information in the second zero level region of infrared figure and the location information in the first zero level region of speckle pattern are to correspond 's.Electronic equipment obtains the second peripheral region corresponding with the first peripheral region position of speckle pattern in infrared figure.When When electronic equipment obtains first peripheral region of the whole region outside the first zero level region of speckle pattern as speckle pattern, then correspond to The infrared figure of acquisition the second zero level region outside second peripheral region of the whole region as infrared figure.When electronic equipment obtains It is when subregion of the speckle pattern outside the first zero level region is as the first peripheral region, then corresponding to obtain the 2nd 0 of infrared figure Second peripheral region of the subregion as infrared figure outside grade region.Electronic equipment is carried to the second peripheral region of infrared figure The one-to-one correspondence such as access amount, the extraction quantity of extraction area size etc. and the first peripheral region of speckle pattern, extraction area size.
Step 604, the luminance mean value in the second zero level region and the second peripheral region is detected.
Luminance mean value refers to the average brightness of whole pixels of wanted detection zone.Electronic equipment is obtaining infrared figure The second zero level region and the second peripheral region after, can obtain each pixel in the second zero level region brightness value calculate second The luminance mean value in zero level region, and obtain the brightness of the second peripheral region of brightness value calculating of each pixel in the second peripheral region Mean value.
In one embodiment, in a kind of optical element detection method provided, after judging optical element exception, may be used also To include:When judging optical element exception, the frequency of abnormity of optical element is increased by 1.
When optical element frequency of abnormity refers to that electronic equipment carries out abnormality detection optical element according to speckle pattern, light is judged Learn the number of element exception.Electronic equipment obtains speckle pattern and is detected to optical element, can receive three-dimensional image acquisition When request obtain speckle pattern carry out abnormality detection, can also in face recognition process In vivo detection by when obtain speckle pattern into Row abnormality detection out-of-date can also obtain speckle In vivo detection is obstructed when face information and camera are more than pre-determined distance value Figure carries out abnormality detection optical element.Electronic equipment can record the abnormality detection knot to optical element under different situations Fruit.
When judging optical element exception, electronic equipment can record the frequency of abnormity of optical element, and optical element is different Normal number increases by 1.
As shown in fig. 7, in one embodiment, a kind of optical element detection method provided can also include:
Step 702, when judging optical element exception, the frequency of abnormity of optical element is increased by 1.
Step 704, when the frequency of abnormity of optical element is more than preset times, forbid the use of the projector.
The projector includes light source, collimating mirror and optical element.Laser is irradiated on object by optical element and forms speckle Image, when optical component damage, the laser intensity for being irradiated to object increases, and can be caused to human eye seriously when being irradiated to human eye Injury.Electronic equipment forbids the use of the projector, it is possible to reduce because of light when optical element frequency of abnormity is more than preset times It learns element exception and causes the injury to human eye.When optical element frequency of abnormity is less than preset times, electronic equipment can be right User sends out optical component damage prompting, reduces use of the user to three-dimensional image acquisition function or face identification functions etc., and The frequency of abnormity for recording optical element, server is uploaded to by the result of optical element exception.Preset times can be according to reality Demand during use determines.Specifically, in order to improve safety in utilization, preset times can be a smaller number Value, such as 3 times, 5 times are without being limited thereto.
When the frequency of abnormity of optical element is more than preset times, forbid the use of the projector.Due to can repeatedly examine It surveys and determines that optical element is abnormal and forbid the use of the projector when frequency of abnormity is more than preset times, detection can taken into account The safety in utilization of the projector is improved while accuracy.
In one embodiment, a kind of optical element detection method is provided, realizes that this method is as follows institute It states:
First, electronic equipment obtains infrared figure and speckle pattern, and speckle pattern is that the laser that light source generates in the projector passes through light It is formed by image after learning element.Infrared figure refers to that electronic equipment is emitted by controlling floodlight on Infrared irradiation to object, And by Laser video camera head according to the infrared image for the light acquisition being reflected back.Floodlight is the area source that infrared light can occur. Speckle pattern refers to that the laser of Laser video camera head acquisition generated by light source in the projector is irradiated to institute on object by optical element The speckle image of formation.The projector of electronic equipment can be color-changing lamp.The projector includes light source, collimating mirror and optical element. Wherein, light source can be surface-emission laser, vertical cavity surface laser array.Optical element can be both DOE, frosted glass or the inside Combination etc..Laser video camera head includes imaging sensor, lens etc., and imaging sensor can be CMOS, CCD etc..
Then, electronic equipment is equal according to the brightness in the first zero level region and the first zero level region of speckle pattern acquisition speckle pattern Value, zero level region are the maximum region of brightness.In the case where optical element is abnormal, due to the optical characteristics of laser, meeting Cause the brightness of picture centre region abnormal.It is influenced by shooting distance, the zero level region of speckle pattern is likely located at speckle pattern Center, it is also possible to be located at the center of speckle pattern position to the right.Electronic equipment can preset the search box pair of size by setting Speckle pattern is traversed, and using the region where the maximum search box of brightness value as the first zero level region of speckle pattern, and is obtained The luminance mean value in the first zero level region.The luminance mean value in the first zero level region refers to the brightness of each pixel in the first zero level region Average value.
Optionally, electronic equipment may be used the posting of default size and be traversed in the predeterminable area of speckle pattern, will be bright First zero level region of the maximum posting region of angle value as speckle pattern.The predeterminable area of speckle pattern refers to presetting Zero level region region maximum magnitude.The posting of default size refers to the search set according to the size in zero level region Frame.It can be lateral traversal that posting traverses mode in the predeterminable area of speckle pattern, can also be vertical traversal.Electronic equipment The position where zero level region can also be prejudged according to the brightness value of posting position in ergodic process, according to judgement As a result it determines the traversal number of the different zones in predeterminable area, and obtains the brightness of posting region in ergodic process Value, using the region where the maximum posting of brightness value as the first zero level region of speckle pattern.
Optionally, electronic equipment can also obtain brightness value of the speckle pattern in predeterminable area, reduce predeterminable area, and obtain Take the brightness value of the predeterminable area after reducing, the brightness value of predeterminable area after diminution bright with adjacent last predeterminable area When angle value difference is less than preset difference value, using the predeterminable area after diminution as the first zero level region of speckle pattern.Speckle pattern it is pre- If region is the maximum magnitude of zero level region region in preset speckle pattern.Electronic equipment can be by obtaining speckle The brightness value of figure each pixel in predeterminable area is recycled to reduce and be preset to obtain brightness value of the speckle pattern in predeterminable area Region is to reduce zero level region region range, the brightness value of predeterminable area after diminution and adjacent last preset areas The brightness value of predeterminable area when the brightness value difference in domain is less than preset difference value, that is, after diminution and adjacent last preset areas The brightness value in domain is identical or close, using the predeterminable area after diminution as the first zero level region of speckle pattern.
Then, the luminance mean value of first peripheral region of the electronic equipment detection speckle pattern around the first zero level region.It dissipates First peripheral region of the spot figure around the first zero level region refers to its in speckle pattern other than the region where zero level region His region.Specifically, electronic equipment can detect the luminance mean value of whole region of the speckle pattern around the first zero level region, also It can be by extracting the subregion around the first zero level region, the brightness for obtaining the subregion around the first zero level region is equal Value.Electronic equipment can be according to the demand and detection result of practical application come really to the extraction quantity in the region around zero level region It is fixed.Specifically, electronic equipment to the extraction quantity in the region around zero level region can be 4,8,12 etc. it is without being limited thereto.
Optionally, electronic equipment can obtain the first quantity region around the first zero level region of speckle pattern.First The first quantity region around zero level region can be region identical with the size in the first zero level region, can also be and the The different regions of one zero level area size, such as can be region more twice than the first zero level area size, can also be The region etc. smaller than the first zero level region.
Optionally, electronic equipment can also be obtained with the horizontal distance in the first zero level region of speckle pattern and vertical range not The first quantity region more than 0.No more than 0 refer in the horizontal direction with the horizontal distance in the first zero level region of speckle pattern On, obtain the coincident at the edge and the first zero level region or the first zero level region in region.Likewise, the zero level with speckle pattern The vertical range in region refers to obtaining the edge and the first zero level region or the first zero level in region in vertical direction no more than 0 The coincident in region.Obtain the first number no more than 0 with the horizontal distance in the first zero level region of speckle pattern and vertical range Position where amount region cannot be overlapped with the position where the first zero level region.
Then, electronic equipment obtains the bright of the first zero level region corresponding second zero level region with speckle pattern in infrared figure Spend mean value, and the luminance mean value of the second peripheral region corresponding with the first peripheral region of speckle pattern.Electronic equipment is by obtaining The brightness value of each pixel corresponding with the first zero level region and the first peripheral region position in infrared figure is taken to calculate the The luminance mean value in two zero level regions and the second peripheral region.Specifically, when electronic equipment obtains the first zero level region of speckle pattern It is when first peripheral region of the outer whole region as speckle pattern, then complete outside corresponding the second zero level region for obtaining infrared figure Luminance mean value of the luminance mean value in portion region as the second peripheral region.When electronic equipment obtains speckle pattern in the first zero level region When outer subregion is as the first peripheral region, then subregion outside corresponding the second zero level region for obtaining infrared figure Luminance mean value.Electronic equipment is to the extraction quantity of the second peripheral region of infrared figure, extraction area size etc. and speckle pattern first The extraction quantity of peripheral region extracts the one-to-one correspondence such as area size.
Optionally, electronic equipment obtains corresponding with the first zero level region of speckle pattern and the first peripheral region according to infrared figure The second zero level region and the second peripheral region, detect the second zero level region and the second peripheral region luminance mean value.Electronics is set It is standby obtain in infrared figure with the first zero level region position corresponding second zero level region of speckle pattern.The second of infrared figure The location information in zero level region and the location information in the first zero level region of speckle pattern are one-to-one.Electronic equipment obtains red The second peripheral region corresponding with the first peripheral region position of speckle pattern in outer figure.When electronic equipment obtains speckle pattern The first zero level region outside first peripheral region of the whole region as speckle pattern when, then it is corresponding to obtain the second of infrared figure Second peripheral region of the whole region as infrared figure outside zero level region.When electronic equipment obtains speckle pattern in the first zero level area When overseas subregion is as the first peripheral region, then the subregion outside corresponding the second zero level region for obtaining infrared figure The second peripheral region as infrared figure.Luminance mean value refers to the average brightness of whole pixels of wanted detection zone.Electricity Sub- equipment can obtain each pixel in the second zero level region behind the second zero level region and the second peripheral region for obtaining infrared figure The brightness value of point calculates the luminance mean value in the second zero level region, and obtains the brightness value calculating of each pixel in the second peripheral region The luminance mean value of second peripheral region.
Then, when the ratio of the luminance mean value of the luminance mean value and the first peripheral region in the first zero level region is more than first in advance If value and when zero level area ratio is more than peripheral region ratio, electronic equipment judges that optical element is abnormal;Wherein, zero level region ratio It is worth the ratio for the luminance mean value in the first zero level region and the luminance mean value in the second zero level region, peripheral region ratio is first week Enclose the ratio of the luminance mean value in region and the luminance mean value of the second peripheral region.First preset value can be deposited on optical element It is perforating or there are when cut, is being formed by when the laser of light source generation is irradiated to by optical element on object in the projector scattered The ratio of the luminance mean value in zero level region and peripheral region in spot figure.Electronic equipment when the first zero level region luminance mean value with When the ratio of the luminance mean value of first peripheral region is more than the first preset value and zero level area ratio and is more than peripheral region ratio, then Judge that optical element is abnormal, there may be perforation or cut, electronic equipment to be reminded simultaneously user for optical element at this time Testing result is uploaded to server.When the ratio of the luminance mean value of the luminance mean value and the first peripheral region in the first zero level region When being not greater than peripheral region ratio more than the first preset value but zero level area ratio, the luminance mean value in the first zero level region at this time More than the first preset value may be due to existing to infrared light emission in speckle pattern with the ratio of the first peripheral region luminance mean value Caused by the reasons such as the high material of rate, then electronic equipment judgement optical element is without abnormal.
Optionally, electronic equipment can also when the first zero level region luminance mean value and the first peripheral region brightness it is equal When the ratio of value is more than the second preset value more than the odds ratio of the first preset value and zero level area ratio and peripheral region ratio, then Judge that optical element is abnormal.Second preset value can be according to the determination of experimental data, such as can be 1.1,1.2 etc..First The ratio of the luminance mean value of the luminance mean value in zero level region and the first peripheral region is more than the first preset value and zero level area ratio When being more than the second preset value with the odds ratio of peripheral region ratio, judgement optical element is abnormal, it is possible to reduce influence because of environment or The situation brighter than the second zero level of infrared figure region of speckle pattern the first zero level region caused by detection error, improves the accurate of detection Property.
Optionally, when judging optical element exception, the frequency of abnormity of optical element can be increased by 1 by electronic equipment.Light When element frequency of abnormity refers to that electronic equipment carries out abnormality detection optical element according to speckle pattern, judgement optical element is abnormal Number.Electronic equipment obtains speckle pattern and is detected to optical element, can be obtained when receiving three-dimensional image acquisition request Speckle pattern carries out abnormality detection, can also in face recognition process In vivo detection by when obtain speckle pattern and carry out abnormal inspection It surveys, it can also be in the obstructed out-of-date acquisition speckle pattern when face information and camera are more than pre-determined distance value of In vivo detection to optics Element carries out abnormality detection.Electronic equipment can record the abnormality detection result to optical element under different situations.
Optionally, electronic equipment can also forbid the projector when the frequency of abnormity of optical element is more than preset times Use.The projector includes light source, collimating mirror and optical element.Preset times can according to demand in actual use come It determines.Specifically, in order to improve safety in utilization, preset times can be a smaller numerical value, such as 3 times, be not limited to for 5 times This.Laser is irradiated on object by optical element and forms speckle image, when optical component damage, is irradiated to the laser of object Intensity increases, and can be caused serious injury to human eye when being irradiated to human eye.Electronic equipment is more than in optical element frequency of abnormity When preset times, forbid the use of the projector, it is possible to reduce the injury to human eye is caused because of optical element exception.When optics member When part frequency of abnormity is less than preset times, electronic equipment can send out user optical component damage prompting, reduce user couple three The use of image collecting function or face identification functions etc. is tieed up, and records the frequency of abnormity of optical element, by optical element exception Result be uploaded to server.
Although it should be understood that Fig. 2-5,7 flow chart in each step shown successively according to the instruction of arrow, Be these steps it is not that the inevitable sequence indicated according to arrow executes successively.Unless expressly stating otherwise herein, these steps There is no stringent sequences to limit for rapid execution, these steps can execute in other order.Moreover, in Fig. 2-5,7 extremely Few a part of step may include that either these sub-steps of multiple stages or stage are not necessarily same to multiple sub-steps Moment executes completion, but can execute at different times, and the execution sequence in these sub-steps or stage is also not necessarily It carries out successively, but can either the sub-step of other steps or at least part in stage in turn or are handed over other steps Alternately execute.
Fig. 8 is the structure diagram of the optical element detection device of one embodiment.As shown in figure 8, the device includes:
Image collection module 802, for obtaining infrared figure and speckle pattern, speckle pattern is the laser that light source generates in the projector By being formed by image after optical element;
Zero level region acquisition module 804, the first zero level region and the first zero level for obtaining speckle pattern according to speckle pattern The luminance mean value in region, zero level region are the maximum region of brightness;
First brightness detection module 806, for detecting first peripheral region of the speckle pattern around the first zero level region Luminance mean value;
Second brightness detection module 808, for obtaining the first zero level region corresponding second in infrared figure with speckle pattern The luminance mean value in zero level region, and the second peripheral region corresponding with the first peripheral region of speckle pattern luminance mean value;
Determination module 810 is used for the ratio when the luminance mean value in the first zero level region and the luminance mean value of the first peripheral region When value is more than peripheral region ratio more than the first preset value and zero level area ratio, then optical element exception is judged;Wherein, zero level Area ratio is the ratio of the luminance mean value in the first zero level region and the luminance mean value in the second zero level region, and peripheral region ratio is The ratio of the luminance mean value of the luminance mean value of first peripheral region and the second peripheral region.
In one embodiment, zero level region acquisition module 804 can be also used for dissipating using the posting of default size Traversal in the predeterminable area of spot figure, using the region where the maximum posting of luminance mean value as the first zero level area of speckle pattern Domain.
In one embodiment, the first brightness detection module 806 can be also used for obtaining the first zero level region of speckle pattern First quantity region of surrounding, determination module 810 are additionally operable to the luminance mean value when the first zero level region and the first quantity area When the ratio of the luminance mean value in domain is all higher than the first preset value, then the luminance mean value and the first peripheral region in the first zero level region are judged The ratio of the luminance mean value in domain is more than the first preset value.
In one embodiment, the first brightness detection module 806 can be also used for obtaining the first zero level area with speckle pattern The horizontal distance and vertical range in domain are no more than 0 the first quantity region.
In one embodiment, the second brightness detection module 808 can be also used for being obtained and speckle pattern according to infrared figure First zero level region and the first peripheral region corresponding second zero level region and the second peripheral region, detection the second zero level region and The luminance mean value of second peripheral region.
In one embodiment, a kind of optical element detection device provided further includes 812 exception of exception processing module It manages module to be used for when judging optical element exception, the frequency of abnormity of optical element is increased by 1.
In one embodiment, exception processing module 812 can be used for being more than default time when the frequency of abnormity of optical element When number, forbid the use of the projector.
Above-mentioned optical element detection device can obtain the laser that light source generates in infrared figure and the projector and pass through optics member It is formed by speckle pattern after part, the first zero level region of speckle pattern and corresponding first zero level regional luminance are obtained according to speckle pattern Mean value, detection speckle pattern around the first zero level region first around luminance mean value, obtain in infrared figure with speckle pattern The luminance mean value in the first zero level region and the first peripheral region corresponding second zero level region and the second peripheral region, when the 1st The ratio of the luminance mean value of luminance mean value and first peripheral region in grade region be more than the first preset value and the first zero level region and When the ratio of the luminance mean value in the second zero level region is more than the ratio of the luminance mean value of the first peripheral region and the second peripheral region, Then judge optical element exception.Due to can be according to the zero level region of speckle pattern and the luminance mean value of peripheral region and infrared figure pair The luminance mean value in the zero level region and peripheral region answered is detected optical element, can improve the accuracy of detection.
The division of modules is only used for for example, in other embodiments in above-mentioned optical element detection device, can Optical element detection device is divided into different modules as required, with complete above-mentioned optical element detection device whole or Partial function.
Specific about optical element detection device limits the limit that may refer to above for optical element detection method Fixed, details are not described herein.Modules in above-mentioned optical element detection device can fully or partially through software, hardware and its It combines to realize.Above-mentioned each module can be embedded in or in the form of hardware independently of in the processor in electronic equipment, can also be with Software form is stored in the memory in electronic equipment, and the corresponding behaviour of the above modules is executed in order to which processor calls Make.
The realization of modules in the optical element detection device provided in the embodiment of the present application can be computer program Form.The computer program can be run in terminal or server.The program module that the computer program is constituted is storable in On the memory of terminal or server.When the computer program is executed by processor, side described in the embodiment of the present application is realized The step of method.
The embodiment of the present application also provides a kind of computer readable storage mediums.One or more is executable comprising computer The non-volatile computer readable storage medium storing program for executing of instruction, when the computer executable instructions are executed by one or more processors When so that the processor executes the step of optical element detection method.
A kind of computer program product including instruction, when run on a computer so that computer executes optics Element testing method.
The embodiment of the present application also provides a kind of electronic equipment.Above-mentioned electronic equipment includes image processing circuit, at image Managing circuit can utilize hardware and or software component to realize, it may include define ISP (Image Signal Processing, figure As signal processing) the various processing units of pipeline.Fig. 9 is the schematic diagram of image processing circuit in one embodiment.Such as Fig. 9 institutes Show, for purposes of illustration only, only showing the various aspects with the relevant image processing techniques of the embodiment of the present application.
As shown in figure 9, image processing circuit includes ISP processors 940 and control logic device 950.Imaging device 910 captures Image data handled first by ISP processors 940, ISP processors 940 to image data analyzed with capture can be used for really The image statistics of fixed and/or imaging device 910 one or more control parameters.Imaging device 910 may include thering is one The camera of a or multiple lens 912 and imaging sensor 914.Imaging sensor 914 may include colour filter array (such as Bayer filters), imaging sensor 914 can obtain the luminous intensity captured with each imaging pixel of imaging sensor 914 and wavelength Information, and the one group of raw image data that can be handled by ISP processors 940 is provided.Sensor 920 (such as gyroscope) can be based on passing The parameter (such as stabilization parameter) of the image procossing of acquisition is supplied to ISP processors 940 by 920 interface type of sensor.Sensor 920 Interface can utilize SMIA (Standard Mobile Imaging Architecture, Standard Mobile Imager framework) interface, The combination of other serial or parallel camera interfaces or above-mentioned interface.
In addition, raw image data can be also sent to sensor 920 by imaging sensor 914, sensor 920 can be based on passing 920 interface type of sensor is supplied to ISP processors 940 or sensor 920 to deposit raw image data raw image data It stores up in video memory 930.
ISP processors 940 handle raw image data pixel by pixel in various formats.For example, each image pixel can Bit depth with 8,10,12 or 14 bits, ISP processors 940 can carry out raw image data at one or more images Reason operation, statistical information of the collection about image data.Wherein, image processing operations can be by identical or different bit depth precision It carries out.
ISP processors 940 can also receive image data from video memory 930.For example, 920 interface of sensor will be original Image data is sent to video memory 930, and the raw image data in video memory 930 is available to ISP processors 940 It is for processing.Video memory 930 can be independent special in a part, storage device or electronic equipment for memory device With memory, and it may include DMA (Direct Memory Access, direct direct memory access (DMA)) feature.
When receiving from 914 interface of imaging sensor or from 920 interface of sensor or from video memory 930 When raw image data, ISP processors 940 can carry out one or more image processing operations, such as time-domain filtering.Treated schemes As data can be transmitted to video memory 930, to carry out other processing before shown.ISP processors 940 are from image Memory 930 receives processing data, and is carried out in original domain and in RGB and YCbCr color spaces to the processing data Image real time transfer.Treated that image data may be output to display 970 for ISP processors 940, for user's viewing and/or It is further processed by graphics engine or GPU (Graphics Processing Unit, graphics processor).In addition, ISP processors 940 output also can be transmitted to video memory 930, and display 970 can read image data from video memory 930.? In one embodiment, video memory 930 can be configured as realizing one or more frame buffers.In addition, ISP processors 940 Output can be transmitted to encoder/decoder 960, so as to encoding/decoding image data.The image data of coding can be saved, And it is decompressed before being shown in 970 equipment of display.Encoder/decoder 960 can be real by CPU or GPU or coprocessor It is existing.
The statistical data that ISP processors 940 determine, which can be transmitted, gives control logic device Unit 950.For example, statistical data can wrap Include the image sensings such as automatic exposure, automatic white balance, automatic focusing, flicker detection, black level compensation, 912 shadow correction of lens 914 statistical information of device.Control logic device 950 may include the processor and/or micro-control that execute one or more routines (such as firmware) Device processed, one or more routines can determine the control parameter and ISP processors of imaging device 910 according to the statistical data of reception 940 control parameter.For example, the control parameter of imaging device 910 may include 920 control parameter of sensor (such as gain, exposure The time of integration, stabilization parameter of control etc.), camera flash control parameter, 912 control parameter of lens (such as focus or zoom With focal length) or these parameters combination.ISP control parameters may include for automatic white balance and color adjustment (for example, in RGB During processing) 912 shadow correction parameter of gain level and color correction matrix and lens.
In the embodiment of the present application, the application is realized when which executes the computer program of storage on a memory In embodiment the step of optical element detection method.
Used in this application may include to any reference of memory, storage, database or other media is non-volatile And/or volatile memory.Suitable nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), Electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include arbitrary access Memory (RAM), it is used as external cache.By way of illustration and not limitation, RAM is available in many forms, such as It is static RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM).
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously Cannot the limitation to the application the scope of the claims therefore be interpreted as.It should be pointed out that for those of ordinary skill in the art For, under the premise of not departing from the application design, various modifications and improvements can be made, these belong to the guarantor of the application Protect range.Therefore, the protection domain of the application patent should be determined by the appended claims.

Claims (10)

1. a kind of optical element detection method, the method includes:
Infrared figure and speckle pattern are obtained, the speckle pattern is the laser of light source generation in the projector by being formed after optical element Image;
Obtain the first zero level region of the speckle pattern and the luminance mean value in the first zero level region according to the speckle pattern, described zero Grade region is the maximum region of brightness;
Detect the luminance mean value of first peripheral region of the speckle pattern around first zero level region;
The luminance mean value for obtaining the first zero level region corresponding second zero level region in the infrared figure with the speckle pattern, with And the luminance mean value of the second peripheral region corresponding with the first peripheral region of the speckle pattern;
When the ratio of the luminance mean value of the luminance mean value and first peripheral region in first zero level region is more than first in advance If value and when zero level area ratio is more than peripheral region ratio, then judge that the optical element is abnormal;Wherein, the zero level region Ratio is the ratio of the luminance mean value in first zero level region and the luminance mean value in the second zero level region, the peripheral region ratio It is worth the ratio for the luminance mean value of first peripheral region and the luminance mean value of the second peripheral region.
2. according to the method described in claim 1, it is characterized in that, described obtain the of the speckle pattern according to the speckle pattern The luminance mean value in one zero level region and the first zero level region, the zero level region are the maximum region of brightness, including:
It is traversed in the predeterminable area of the speckle pattern using the posting of default size;
Using the region where the maximum posting of luminance mean value as the first zero level region of the speckle pattern.
3. according to the method described in claim 1, it is characterized in that, the method further includes:
Obtain the first quantity region around the first zero level region of the speckle pattern;
When the ratio of the luminance mean value of the luminance mean value and first quantity region in first zero level region is all higher than When one preset value, then the ratio of the luminance mean value in first zero level region and the luminance mean value of first peripheral region is judged More than the first preset value.
4. according to the method described in claim 3, it is characterized in that, around the first zero level region for obtaining the speckle pattern The first quantity region, including:
Obtain the first quantity area no more than 0 with the horizontal distance in the first zero level region of the speckle pattern and vertical range Domain.
5. according to the method described in claim 1, it is characterized in that, described obtain the first of the infrared figure and the speckle pattern The luminance mean value of the luminance mean value and the second peripheral region in zero level region and the first peripheral region corresponding second zero level region, packet It includes:
The second zero level corresponding with the first zero level region of the speckle pattern and the first peripheral region is obtained according to the infrared figure Region and the second peripheral region;
Detect the luminance mean value in second zero level region and the second peripheral region.
6. according to the method described in claim 1, it is characterized in that, the method further includes:
When judging the optical element exception, the frequency of abnormity of the optical element is increased by 1.
7. according to the method described in claim 6, it is characterized in that, the method further includes:
When the frequency of abnormity of the optical element is more than preset times, forbid the use to the projector.
8. a kind of optical element detection device, which is characterized in that described device includes:
Image collection module, for obtaining infrared figure and speckle pattern, the speckle pattern is that the laser that light source generates in the projector is logical It is formed by image after crossing optical element;
Zero level region acquisition module, the first zero level region and the first zero level for obtaining the speckle pattern according to the speckle pattern The luminance mean value in region, the zero level region are the maximum region of brightness;
First brightness detection module, for detecting first peripheral region of the speckle pattern around first zero level region Luminance mean value;
Second brightness detection module, for obtaining the first zero level region corresponding second in the infrared figure with the speckle pattern The luminance mean value in zero level region, and the brightness of the second peripheral region corresponding with the first peripheral region of the speckle pattern are equal Value;
Determination module, the ratio of the luminance mean value for the luminance mean value and first peripheral region when first zero level region When value is more than peripheral region ratio more than the first preset value and zero level area ratio, then judge that the optical element is abnormal;Wherein, The zero level area ratio is the ratio of the luminance mean value in first zero level region and the luminance mean value in the second zero level region, institute State the ratio of the luminance mean value around the luminance mean value and second that peripheral region ratio is first peripheral region.
9. a kind of electronic equipment, including memory and processor, the memory are stored with computer program, which is characterized in that The processor realizes the step of any one of claim 1 to 7 the method when executing the computer program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any one of claim 1 to 7 is realized when being executed by processor.
CN201810403817.1A 2018-03-12 2018-04-28 Optical element detection method, optical element detection device, electronic equipment and storage medium Expired - Fee Related CN108716982B (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
CN201810403817.1A CN108716982B (en) 2018-04-28 2018-04-28 Optical element detection method, optical element detection device, electronic equipment and storage medium
PCT/CN2019/075386 WO2019174435A1 (en) 2018-03-12 2019-02-18 Projector and test method and device therefor, image acquisition device, electronic device, readable storage medium
EP19736569.5A EP3567851A4 (en) 2018-03-12 2019-02-18 Projector and test method and device therefor, image acquisition device, electronic device, readable storage medium
TW108108335A TWI696391B (en) 2018-03-12 2019-03-12 Projector, detection method and detection device thereof, image capturing device, electronic device, and computer readable storage medium
US16/684,299 US11348217B2 (en) 2018-03-12 2019-11-14 Projector, detection method thereof, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810403817.1A CN108716982B (en) 2018-04-28 2018-04-28 Optical element detection method, optical element detection device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108716982A true CN108716982A (en) 2018-10-30
CN108716982B CN108716982B (en) 2020-01-10

Family

ID=63899485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810403817.1A Expired - Fee Related CN108716982B (en) 2018-03-12 2018-04-28 Optical element detection method, optical element detection device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108716982B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726708A (en) * 2019-03-13 2019-05-07 东软睿驰汽车技术(沈阳)有限公司 A kind of Lane detection method and device
CN109948504A (en) * 2019-03-13 2019-06-28 东软睿驰汽车技术(沈阳)有限公司 A kind of Lane detection method and device
CN110012206A (en) * 2019-05-24 2019-07-12 Oppo广东移动通信有限公司 Image acquiring method, image acquiring device, electronic equipment and readable storage medium storing program for executing
WO2019174435A1 (en) * 2018-03-12 2019-09-19 Oppo广东移动通信有限公司 Projector and test method and device therefor, image acquisition device, electronic device, readable storage medium
CN112784649A (en) * 2019-11-11 2021-05-11 北京君正集成电路股份有限公司 Infrared living body detection equipment and method for detecting whether infrared living body detection equipment works normally
CN113138067A (en) * 2021-04-20 2021-07-20 奥比中光科技集团股份有限公司 Detection method, device and equipment for diffraction optical device
CN113515022A (en) * 2021-07-28 2021-10-19 华虹半导体(无锡)有限公司 Method for detecting damage of illuminating system of photoetching machine
CN113711229A (en) * 2019-05-31 2021-11-26 Oppo广东移动通信有限公司 Control method of electronic device, and computer-readable storage medium
CN113936315A (en) * 2021-10-14 2022-01-14 北京的卢深视科技有限公司 DOE (design of optical element) shedding detection method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013188520A3 (en) * 2012-06-12 2014-03-06 Yale University Multimode optical fiber spectrometer
CN106529545A (en) * 2016-09-26 2017-03-22 北京林业大学 Speckle image quality recognition method and system based on image feature description
CN107402215A (en) * 2016-05-18 2017-11-28 波音公司 Devices, systems, and methods for Non-Destructive Testing
CN107911584A (en) * 2017-11-28 2018-04-13 信利光电股份有限公司 A kind of image capture device and a kind of terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013188520A3 (en) * 2012-06-12 2014-03-06 Yale University Multimode optical fiber spectrometer
CN107402215A (en) * 2016-05-18 2017-11-28 波音公司 Devices, systems, and methods for Non-Destructive Testing
CN106529545A (en) * 2016-09-26 2017-03-22 北京林业大学 Speckle image quality recognition method and system based on image feature description
CN107911584A (en) * 2017-11-28 2018-04-13 信利光电股份有限公司 A kind of image capture device and a kind of terminal

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11348217B2 (en) 2018-03-12 2022-05-31 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Projector, detection method thereof, and electronic device
WO2019174435A1 (en) * 2018-03-12 2019-09-19 Oppo广东移动通信有限公司 Projector and test method and device therefor, image acquisition device, electronic device, readable storage medium
CN109726708B (en) * 2019-03-13 2021-03-23 东软睿驰汽车技术(沈阳)有限公司 Lane line identification method and device
CN109948504A (en) * 2019-03-13 2019-06-28 东软睿驰汽车技术(沈阳)有限公司 A kind of Lane detection method and device
CN109726708A (en) * 2019-03-13 2019-05-07 东软睿驰汽车技术(沈阳)有限公司 A kind of Lane detection method and device
WO2020238481A1 (en) * 2019-05-24 2020-12-03 Oppo广东移动通信有限公司 Image acquisition method, image acquisition device, electronic device and readable storage medium
CN110012206A (en) * 2019-05-24 2019-07-12 Oppo广东移动通信有限公司 Image acquiring method, image acquiring device, electronic equipment and readable storage medium storing program for executing
CN113711229A (en) * 2019-05-31 2021-11-26 Oppo广东移动通信有限公司 Control method of electronic device, and computer-readable storage medium
EP3975034A4 (en) * 2019-05-31 2022-06-15 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Control method of electronic equipment, electronic equipment and computer readable storage medium
US11836956B2 (en) 2019-05-31 2023-12-05 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Control method for electronic device, electronic device and computer readable storage medium
CN113711229B (en) * 2019-05-31 2024-03-12 Oppo广东移动通信有限公司 Control method of electronic device, and computer-readable storage medium
CN112784649A (en) * 2019-11-11 2021-05-11 北京君正集成电路股份有限公司 Infrared living body detection equipment and method for detecting whether infrared living body detection equipment works normally
CN113138067A (en) * 2021-04-20 2021-07-20 奥比中光科技集团股份有限公司 Detection method, device and equipment for diffraction optical device
CN113138067B (en) * 2021-04-20 2024-05-03 奥比中光科技集团股份有限公司 Method, device and equipment for detecting diffraction optical device
CN113515022A (en) * 2021-07-28 2021-10-19 华虹半导体(无锡)有限公司 Method for detecting damage of illuminating system of photoetching machine
CN113515022B (en) * 2021-07-28 2023-12-01 华虹半导体(无锡)有限公司 Damage detection method for lighting system of photoetching machine
CN113936315A (en) * 2021-10-14 2022-01-14 北京的卢深视科技有限公司 DOE (design of optical element) shedding detection method and device, electronic equipment and storage medium
CN113936315B (en) * 2021-10-14 2022-03-25 北京的卢深视科技有限公司 DOE (design of optical element) shedding detection method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN108716982B (en) 2020-01-10

Similar Documents

Publication Publication Date Title
CN108716983B (en) Optical element detection method and device, electronic equipment, storage medium
CN108716982A (en) Optical element detection method, device, electronic equipment and storage medium
CN108600740A (en) Optical element detection method, device, electronic equipment and storage medium
US11145071B2 (en) Image processing method, non-transitory computer-readable storage medium, and electronic apparatus
CN108769509B (en) Control method, apparatus, electronic equipment and the storage medium of camera
CN107977940B (en) Background blurring processing method, device and equipment
US10616459B2 (en) Method and device for dual-camera-based imaging and storage medium
EP3849170B1 (en) Image processing method, electronic device, and computer-readable storage medium
US20190164257A1 (en) Image processing method, apparatus and device
CN110519489B (en) Image acquisition method and device
KR102281149B1 (en) APPARATUS FOR TRACKING EYE POINT OPERABLE AT HIGH intensity of illumination AND LOW intensity of illumination AND METHOD THEREOF
US11196919B2 (en) Image processing method, electronic apparatus, and computer-readable storage medium
CN110149482A (en) Focusing method, device, electronic equipment and computer readable storage medium
KR20200031689A (en) Image processing methods, devices and devices
CN110213494B (en) Photographing method and device, electronic equipment and computer readable storage medium
CN108760245B (en) Optical element detection method and device, electronic equipment, readable storage medium storing program for executing
CN110536068A (en) Focusing method and device, electronic equipment, computer readable storage medium
CN102959942B (en) Image capture device for stereoscopic viewing-use and control method thereof
CN110533709B (en) Depth image acquisition method, device and system and image acquisition equipment
CN110191287A (en) Focusing method and device, electronic equipment, computer readable storage medium
CN107172352A (en) Focusing control method, device, computer can storage medium and mobile terminal
CN107197152A (en) Focusing method, device, computer-readable recording medium and mobile terminal
CN109559353A (en) Camera module scaling method, device, electronic equipment and computer readable storage medium
CN108805025A (en) Laser output control method and device, electronic equipment, storage medium
CN107948619B (en) Image processing method, device, computer readable storage medium and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200110