CN108760042B - Optical sensor calibration method and device, mobile device, medium and electronic device - Google Patents

Optical sensor calibration method and device, mobile device, medium and electronic device Download PDF

Info

Publication number
CN108760042B
CN108760042B CN201810525549.0A CN201810525549A CN108760042B CN 108760042 B CN108760042 B CN 108760042B CN 201810525549 A CN201810525549 A CN 201810525549A CN 108760042 B CN108760042 B CN 108760042B
Authority
CN
China
Prior art keywords
illumination
value
reading
ideal
illuminance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810525549.0A
Other languages
Chinese (zh)
Other versions
CN108760042A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201810525549.0A priority Critical patent/CN108760042B/en
Publication of CN108760042A publication Critical patent/CN108760042A/en
Application granted granted Critical
Publication of CN108760042B publication Critical patent/CN108760042B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter

Abstract

The invention discloses a method and a device for calibrating an optical sensor, mobile equipment, a medium and electronic equipment, and relates to the technical field of sensor testing. The optical sensor calibration method of the present disclosure includes: obtaining a current illumination reading of the light sensor; acquiring a corresponding relation between the test reading of the optical sensor and the ideal illumination value; and determining a calibrated illumination value according to the current illumination reading and the corresponding relation. The illumination value detected by the optical sensor can be corrected more accurately by the method.

Description

Optical sensor calibration method and device, mobile device, medium and electronic device
Technical Field
The present disclosure relates to the field of sensor testing technologies, and in particular, to a method for calibrating an optical sensor, an apparatus for calibrating an optical sensor, a mobile device, a storage medium, and an electronic device.
Background
With the continuous progress of scientific technology, the application scene of the sensor has been expanded to various industries. Among them, the optical sensor has been applied to fields such as tunnel detection, intelligent lighting system, vehicle detection, etc., as a key element for realizing photoelectric conversion in various photoelectric detection systems. In addition, the light sensor is widely used in mobile devices (e.g., mobile phones, tablets, etc.), for example, the light sensor may detect ambient light, automatically adjust the brightness of a screen according to the detection result, and the like.
At present, different mobile devices are different in the position where the optical sensor is installed, and the size of the light sensing range of the optical sensor is also different. Thus, the actual reading of the light sensor may be inaccurate and may vary from the results provided by the manufacturer due to the factors described above.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the present disclosure is to provide a method for calibrating a light sensor, a device for calibrating a light sensor, a mobile device, a storage medium, and an electronic device, thereby overcoming, at least to some extent, the problem of inaccurate actual reading of a light sensor due to the limitations and disadvantages of the related art.
According to an aspect of the present disclosure, there is provided a light sensor calibration method, including: obtaining a current illumination reading of the light sensor; acquiring a corresponding relation between the test reading of the optical sensor and the ideal illumination value; and determining a calibrated illumination value according to the current illumination reading and the corresponding relation.
In an exemplary embodiment of the present disclosure, the light sensor calibration method further includes: acquiring a plurality of test readings of the optical sensor under different illuminance of a test light source; constructing a calibration line graph using the plurality of test readings and the ideal illuminance value for the different illuminance; and taking the piecewise function corresponding to the calibration line graph as the corresponding relation.
In an exemplary embodiment of the present disclosure, the test light source is a light source capable of setting an illuminance value, and the set illuminance value is taken as the ideal illuminance value; or reading readings of the test light source under different illumination intensities by adopting an illumination meter to serve as the ideal illumination value.
In an exemplary embodiment of the present disclosure, determining a calibrated illuminance value according to the current illuminance reading and the correspondence comprises: if the current illumination reading only corresponds to one ideal illumination value in the corresponding relation, taking the only corresponding ideal illumination value in the corresponding relation as a calibrated illumination value; if the current illumination reading corresponds to a limited number of ideal illumination values except one in the corresponding relation, taking the average value of the limited ideal illumination values as a calibrated illumination value; and if the current illumination reading corresponds to a plurality of ideal illumination values in the corresponding relation, taking the average value of the maximum value and the minimum value in the plurality of ideal illumination values as the calibrated illumination value.
In an exemplary embodiment of the present disclosure, the light sensor calibration method further includes: calculating an error of the piecewise function; and taking the calculated error as an accuracy reference of the illumination value after the current illumination reading is calibrated.
In an exemplary embodiment of the present disclosure, calculating the error of the piecewise function includes: integrating the absolute value of the difference value of the segmentation function and the ideal illumination function to obtain a first integration result; integrating the ideal illumination function to obtain a second integration result; and taking the ratio of the first integration result to the second integration result as the error of the piecewise function.
According to an aspect of the present disclosure, there is provided a light sensor calibration apparatus including: the current illumination acquisition module is used for acquiring the current illumination reading of the optical sensor; the corresponding relation acquisition module is used for acquiring the corresponding relation between the test reading of the optical sensor and the ideal illumination value; and the calibration determining module is used for determining a calibrated illumination value according to the current illumination reading and the corresponding relation.
In an exemplary embodiment of the present disclosure, the light sensor calibration apparatus further includes: the test reading acquisition module is used for acquiring a plurality of test readings of the optical sensor under different illuminance of the test light source; a line graph construction module for constructing a calibration line graph using the plurality of test readings and the ideal illumination values for the different illuminations; and taking the piecewise function corresponding to the calibration line graph as the corresponding relation.
In an exemplary embodiment of the present disclosure, the test light source is a light source capable of setting an illuminance value, and the set illuminance value is taken as the ideal illuminance value; or reading readings of the test light source under different illumination intensities by adopting an illumination meter to serve as the ideal illumination value.
In an exemplary embodiment of the present disclosure, the calibration determination module includes: a first calculating unit, configured to, if the current illuminance reading corresponds to only one ideal illuminance value in the correspondence, take only one ideal illuminance value corresponding to the correspondence as a calibrated illuminance value; a second calculation unit, configured to, if the current illuminance reading corresponds to a limited number of ideal illuminance values other than one in the correspondence, take an average value of the limited number of ideal illuminance values as a calibrated illuminance value; and a third calculating unit, configured to, if the current illuminance reading corresponds to an infinite number of ideal illuminance values in the correspondence, take an average value of a maximum value and a minimum value of the infinite number of ideal illuminance values as a calibrated illuminance value.
In an exemplary embodiment of the present disclosure, the light sensor calibration apparatus further includes: an error calculation module for calculating an error of the piecewise function; and the error application module is used for taking the calculated error as the precision reference of the illumination value after the current illumination reading is calibrated.
In an exemplary embodiment of the present disclosure, the error calculation module includes: a first integration result obtaining unit, configured to integrate an absolute value of a difference between the piecewise function and the ideal illuminance function to obtain a first integration result; a second integration result obtaining unit, configured to integrate the ideal illuminance function to obtain a second integration result; an error calculation unit, configured to use a ratio of the first integration result and the second integration result as an error of the piecewise function.
According to an aspect of the present disclosure, there is provided a mobile device comprising a light sensor, the mobile device comprising the light sensor calibration apparatus of any one of the above.
According to an aspect of the present disclosure, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements a light sensor calibration method as described in any one of the above.
According to an aspect of the present disclosure, there is provided an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any of the light sensor calibration methods described above via execution of the executable instructions.
In the technical solutions provided in some embodiments of the present disclosure, the illuminance value after the current illuminance reading is calibrated is determined by testing the correspondence between the reading and the ideal illuminance value, on one hand, the present disclosure can more accurately correct the illuminance value detected by the optical sensor; on the other hand, the method has no limitation condition on the type and the principle of the optical sensor, the operating system of the mobile equipment and other test environments, and the universality of the calibration process of the optical sensor is stronger; on the other hand, the light sensor does not need to be taken out of the mobile device during the test, and does not need to be assisted by any other additional device.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. In the drawings:
FIG. 1 schematically illustrates a flow chart of a method of calibrating a light sensor according to an exemplary embodiment of the present disclosure;
FIG. 2 shows a schematic diagram of a light sensor receiving illumination;
FIG. 3 schematically illustrates a calibration line graph constructed using test readings and ideal illumination values according to an exemplary embodiment of the present disclosure;
FIG. 4 schematically illustrates a manner of determining a calibrated illuminance value in one instance of an exemplary embodiment of the present disclosure;
FIG. 5 schematically illustrates a manner of determining a calibrated illuminance value in another instance of an exemplary embodiment of the present disclosure;
FIG. 6 schematically illustrates a manner of determining a calibrated illuminance value in accordance with yet another aspect of an exemplary disclosed embodiment;
FIG. 7 schematically illustrates a comparison of a calibration line graph to an ideal illumination value;
FIG. 8 schematically illustrates a block diagram of a light sensor calibration apparatus according to an exemplary embodiment of the present disclosure;
FIG. 9 schematically illustrates a block diagram of another light sensor calibration apparatus according to an exemplary embodiment of the present disclosure;
FIG. 10 schematically illustrates a block diagram of a calibration determination module according to an exemplary embodiment of the present disclosure;
FIG. 11 schematically illustrates a block diagram of yet another optical sensor calibration apparatus according to an exemplary embodiment of the present disclosure;
FIG. 12 schematically illustrates a block diagram of an error calculation module according to an exemplary embodiment of the present disclosure;
FIG. 13 shows a schematic diagram of a storage medium according to an example embodiment of the present disclosure; and
fig. 14 schematically shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the steps. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Currently, there are some schemes for calibrating and error testing optical sensors. For example, in some techniques, a light sensor receives illumination with reference to a maximum brightness value, and obtains an actual light quantity value from the illumination; reading an actual calibration factor and an obtained actual light value in a microprocessor of the optical sensor, wherein the ratio of the actual calibration factor to the actual light value is a constant; recalculating according to the target light quantity value to be calibrated and the ratio of the actual calibration factor to the actual light quantity value to obtain a target calibration factor; the target calibration factor is written into a microprocessor of the optical sensor, the obtained target calibration factor is written into the optical sensor as the calibration factor used by the optical sensor, and the light quantity measured by the optical sensor is calibrated by the target calibration factor, so that the calibration of the optical sensor is realized. However, the calibration of the optical sensor only uses the illumination with the maximum brightness value, and the calibration effect is not good.
In other techniques, a method of verifying a light sensor may include: the method comprises the steps of obtaining light source data sensed by a light sensor from a standard light source within a preset time period, filtering the light source data by using a preset filtering rule to obtain target light source data, and calibrating the light sensor according to the target light source data. However, this solution only solves the problem that the light source for calibration has abnormal data.
In view of this, the present disclosure provides the following light sensor calibration method. In addition, although the light sensor described in the present disclosure is applied to a mobile device, it is easily understood that the light sensor calibration method described in the present disclosure can also be applied to other scenarios besides a mobile device.
Fig. 1 schematically illustrates a flow chart of a method of calibrating a light sensor of an exemplary embodiment of the present disclosure. Referring to fig. 1, the light sensor calibration method may include the steps of:
s12, obtaining the current illumination reading of the optical sensor.
Taking the mobile device as a mobile phone, the light sensor may be generally installed on the top of the mobile device, however, the light sensor is not limited thereto, and may be configured at any position of the mobile device. In addition, a control can be used to control the turning on and off of the light sensor, for example, a user can set the turning on and off of the light sensor on an interface of the mobile device related to the setting.
After the light sensor detects the current illumination, first, the light sensor may send the detected illumination reading (i.e., the detected illumination value) to a storage unit, where the storage unit may be used alone to store a file of the sensor reading, or may be a unit for storing data of other users. The processor of the mobile device may then retrieve the current illumination reading of the light sensor from the memory unit.
In addition, the light sensor may directly send the current illumination reading to the processor of the mobile device after detecting the current illumination.
S14, acquiring the corresponding relation between the test reading of the optical sensor and the ideal illumination value.
The test reading may be a set of readings from which the light sensor was previously tested. In addition, the ideal illuminance value corresponds to the test reading, which can be understood as the actual value of the illuminance. Specifically, in some embodiments of the present disclosure, a light source that can set an illuminance value may be employed as the test light source, in which case the set illuminance value may be taken as the ideal illuminance value. In other embodiments of the present disclosure, the test light source may not be a settable illuminance light source, in which case an illuminometer may be used to take readings of the test light source at different illuminances and take these readings as the desired illuminance value.
To ensure the accuracy of the calibration, the test light source of the present disclosure may be a parallel light source. That is, the light sensing surface of the light sensor of the mobile device may be placed facing the parallel light source. Referring to fig. 2, the test light may be sensitive light in the graph, wherein the sensitive light may be illumination directed directly to the light sensor. In addition, it is readily understood that the insensitive light described in FIG. 2 is not detectable or is rarely detectable by the light sensor.
In an exemplary embodiment of the present disclosure, when testing the light sensor using the test light source, on one hand, the processor of the mobile device may obtain an ideal illuminance value at the time of the test; alternatively, the processor of the mobile device may obtain a test reading of the light sensor. Taking an Android 6.0 system as an example, the reading and related information of the optical sensor may be stored in Android.
TABLE 1
Figure BDA0001675861040000071
Where timestamp is the timestamp, values [0] is the illuminance of the ambient light, in Lux (Lux or Lx).
N sets of tests may be performed on the light sensor, where N may be a positive integer greater than 1. N sets of test readings and corresponding ideal illumination levels may be obtained. The following description will be given by taking N ═ 6 as an example. Specifically, 6 sets of data recorded are shown in table 2:
TABLE 2
Ideal illuminance value L1 L2 L3 L4 L5 L6
Test readings D1 D2 D3 D4 D5 D6
Next, a calibration line graph can be constructed using the data in Table 2, specifically, the line graph is shown in FIG. 3. In addition, the piecewise function to which the calibration line graph corresponds may be used as the correspondence between the test reading and the ideal illumination value. The piecewise function can be expressed as equation 1:
Figure BDA0001675861040000081
it is readily understood that the mobile device can save all the data in equation 1, i.e., a1、a2、…、aN;b1、b2、…、bN;L1、L2、…、LN. Acquiring the correspondence may be understood as acquiring these data.
Additionally, obtaining a correspondence between the test reading and the ideal illumination value for the light sensor may further include directly saving the test reading and the corresponding ideal illumination value to a data table. Especially in the case of small test illumination intervals, the relationship between the reading displayed by the light sensor and the actual reading can be directly determined by means of table lookup.
And S16, determining a calibrated illuminance value according to the current illuminance reading and the corresponding relation.
In an exemplary embodiment of the present disclosure, a calibrated illuminance value for the current illuminance reading may be determined using equation 1 above.
According to some embodiments of the present disclosure, in the case where the current illuminance reading is acquired in step S12, by solving the equation using equation 1 above, if there is only one solution, the solution is taken as the calibrated illuminance value. For example, referring to FIG. 4, the current illumination reading is 15 lux, at which point equation 1 has only one solution.
According to some other embodiments, where the current illuminance reading is acquired in step S12, by solving the equation using equation 1 above, if there are a finite number of solutions other than one, the average of the finite number of solutions may be taken as the calibrated illuminance value. Specifically, when the equation has multiple solutions x1、x2、…、xNThe calibrated illumination value may be expressed as:
Figure BDA0001675861040000091
for example, referring to FIG. 5, taking the example where there are two solutions, the current illumination reading is 15 lux, and the calibrated illumination value is the average of the two solutions.
According to some other embodiments, by solving the equation using equation 1 above in the case where the current illuminance reading is obtained in step S12, if there are a myriad of ideal illuminance values, the maximum value x of the myriad of ideal illuminance values will bemaxAnd the minimum value xminAs a calibrated illuminance value. In this case, the calibrated illumination value may be expressed as:
Figure BDA0001675861040000092
for example, referring to FIG. 6, the current illumination reading is 30 lux, and the 30 lux line graph corresponding to equation 1 has an infinite number of solutions between 30 lux and 40 lux, so in this case, the calibrated illumination value is 35 lux.
Through the calibration process, on one hand, the illumination value detected by the optical sensor can be corrected more accurately by the method; on the other hand, the method has no limitation condition on the type and the principle of the optical sensor, the operating system of the mobile equipment and other test environments, and the universality of the calibration process of the optical sensor is stronger; on the other hand, the light sensor does not need to be taken out of the mobile device during the test, and does not need to be assisted by any other additional device.
In an exemplary embodiment of the present disclosure, the present disclosure also includes a scheme of light sensor error calculation. Specifically, the error may be calculated according to the test result, and more specifically, the optical sensor error may be calculated by using the above formula 1.
Referring to fig. 7, the result of integrating the ideal illuminance function divided by the subtraction of the absolute value of the difference between the piecewise function f (x) and the ideal illuminance function y ═ x is taken as an error.
Specifically, in one aspect, the absolute value of the difference between f (x) and y ═ x may be integrated to obtain the first integration result CdReferring to equation 2, the first integration result CdCan be expressed as:
Figure BDA0001675861040000093
alternatively, the ideal luminance function may be integrated to obtain a second integration result CiReferring to equation 3, the second integration result CiCan be expressed as:
Figure BDA0001675861040000094
the first integration result C may then be useddAnd a second integration result CiAs the error D of the piecewise function, i.e. the error of the light sensor. Wherein the error D can be expressed as formula 4:
Figure BDA0001675861040000101
after the error is determined, the error can be determinedThe error is used as a precision reference for the illuminance value after the current illuminance reading is calibrated. Specifically, the calibrated illuminance value calculated in step S16 is XmThe error calculated by equation 4 is DmThe final result after calibration can be expressed as Xm±DmFor example, if the calculated illuminance value after calibration is 100 and the error calculated by equation 4 is 5, the final result after calibration can be expressed as 100 ± 5.
It should be noted that the calibrated illumination values may be applied directly to other processing scenarios. For example, automatically adjusting screen brightness, etc. The present disclosure is not particularly limited in its application to calibrated luminance value output.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Further, the present exemplary embodiment also provides a light sensor calibration apparatus, and the light sensor may be applied to a mobile device.
Fig. 8 schematically illustrates a block diagram of a light sensor calibration apparatus of an exemplary embodiment of the present disclosure. Referring to fig. 8, the light sensor calibration apparatus 8 according to an exemplary embodiment of the present disclosure may include a current illuminance acquisition module 81, a correspondence acquisition module 83, and a calibration determination module 85.
Specifically, the current illuminance acquisition module 81 may be configured to acquire a current illuminance reading of the light sensor; the correspondence obtaining module 83 may be configured to obtain a correspondence between a test reading of the optical sensor and an ideal illuminance value; the calibration determination module 85 may be configured to determine a calibrated illuminance value according to the current illuminance reading and the corresponding relationship.
In the light sensor calibration device provided in some embodiments of the present disclosure, on one hand, the present disclosure can more accurately correct the illuminance value detected by the light sensor; on the other hand, the method has no limitation condition on the type and the principle of the optical sensor, the operating system of the mobile equipment and other test environments, and the universality of the calibration process of the optical sensor is stronger; on the other hand, the light sensor does not need to be taken out of the mobile device during the test, and does not need to be assisted by any other additional device.
According to an exemplary embodiment of the present disclosure, referring to fig. 9, the light sensor calibration apparatus 9 may further include a test reading acquisition module 91 and a line graph construction module 93, in addition to the current illuminance acquisition module 81, the correspondence acquisition module 83, and the calibration determination module 85, compared to the light sensor calibration apparatus 8.
Specifically, the test reading acquiring module 91 may be configured to acquire a plurality of test readings of the optical sensor under different illuminance of the test light source; the line graph construction module 93 may be configured to construct a calibration line graph using the plurality of test readings and the desired illumination values for different illuminations; and taking the section function corresponding to the calibration line graph as the corresponding relation.
According to an exemplary embodiment of the present disclosure, the test light source is a light source that can set an illuminance value, and the set illuminance value is taken as an ideal illuminance value; or reading readings of the test light source under different illumination intensities by adopting an illumination meter to serve as an ideal illumination value.
According to an exemplary embodiment of the present disclosure, referring to fig. 10, the calibration determination module 85 may include a first calculation unit 101, a second calculation unit 103, and a third calculation unit 105.
Specifically, the first calculating unit 101 may be configured to, if the current illuminance reading corresponds to only one ideal illuminance value in the corresponding relationship, take only the corresponding one ideal illuminance value in the corresponding relationship as the calibrated illuminance value; the second calculating unit 103 may be configured to take an average value of the limited ideal illuminance values as the calibrated illuminance value if the current illuminance reading corresponds to a limited number of ideal illuminance values other than one in the correspondence; the third calculation unit 105 may be configured to take an average of a maximum value and a minimum value of the infinite ideal illuminance values as the calibrated illuminance value if the current illuminance reading corresponds to the infinite ideal illuminance values in the correspondence.
According to an exemplary embodiment of the present disclosure, referring to fig. 11, the light sensor calibration apparatus 9 may include an error calculation module 111 and an error application module 113, in addition to the current illuminance acquisition module 81, the correspondence acquisition module 83, and the calibration determination module 85, compared to the light sensor calibration apparatus 8.
Specifically, the error calculation module 111 may be configured to calculate an error of the piecewise function; the error application module 113 may be configured to use the calculated error as an accuracy reference for the calibrated illuminance value for the current illuminance reading.
According to an exemplary embodiment of the present disclosure, referring to fig. 12, the error calculation module 111 may include a first integration result obtaining unit 1201, a second integration result obtaining unit 1203, and an error calculation unit 1205.
Specifically, the first integration result obtaining unit 1201 may be configured to integrate an absolute value of a difference between the segmentation function and the ideal illumination function to obtain a first integration result; the second integration result obtaining unit 1203 may be configured to integrate the ideal illuminance function to obtain a second integration result; the error calculation unit 1205 may be configured to use a ratio of the first integration result and the second integration result as an error of the piecewise function.
Since each functional module of the program operation performance analysis apparatus according to the embodiment of the present invention is the same as that in the embodiment of the present invention, it is not described herein again.
Further, a mobile device including a light sensor is also provided in the present exemplary embodiment. The mobile device may comprise any of the light sensor calibration means described above.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 13, a program product 1300 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1400 according to this embodiment of the invention is described below with reference to fig. 14. The electronic device 1400 shown in fig. 14 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 14, the electronic device 1400 is embodied in the form of a general purpose computing device. The components of the electronic device 1400 may include, but are not limited to: the at least one processing unit 1410, the at least one memory unit 1420, the bus 1430 that connects the various system components (including the memory unit 1420 and the processing unit 1410), and the display unit 1440.
Wherein the storage unit stores program code that is executable by the processing unit 1410, such that the processing unit 1410 performs steps according to various exemplary embodiments of the present invention described in the above section "exemplary methods" of the present specification. For example, the processing unit 1410 may perform steps S12 to S16 as shown in fig. 1.
The storage unit 1420 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)14201 and/or a cache memory unit 14202, and may further include a read only memory unit (ROM) 14203.
Storage unit 1420 may also include a program/utility 14204 having a set (at least one) of program modules 14205, such program modules 14205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1430 may be any type of bus structure including a memory cell bus or memory cell controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 1400 may also communicate with one or more external devices 1500 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1400, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1400 to communicate with one or more other computing devices. Such communication can occur via an input/output (I/O) interface 1450. Also, the electronic device 1400 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 1460. As shown, the network adapter 1460 communicates with the other modules of the electronic device 1400 via the bus 1430. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 1400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (8)

1. A method of calibrating a light sensor, comprising:
obtaining a current illumination reading of the light sensor;
obtaining a correspondence between the test reading of the light sensor and an ideal illumination value, wherein the step of determining the correspondence comprises: acquiring a plurality of test readings of the optical sensor under different illuminance of a test light source, constructing a calibration line graph by using the plurality of test readings and ideal illuminance values of the different illuminance, and determining a piecewise function corresponding to the calibration line graph as the corresponding relation;
and determining a calibrated illumination value according to the current illumination reading and the corresponding relation, and taking an error as a precision reference of the illumination value after the current illumination reading is calibrated, wherein the error is determined by calculating the error of the piecewise function.
2. The method of claim 1, wherein the test light source is a light source capable of setting an illumination value, and the set illumination value is used as the ideal illumination value; or
And reading readings of the test light source under different illumination intensities by adopting an illumination meter to serve as the ideal illumination value.
3. The method of claim 1, wherein determining a calibrated illuminance value based on the current illuminance reading and the correspondence comprises:
if the current illumination reading only corresponds to one ideal illumination value in the corresponding relation, taking the only corresponding ideal illumination value in the corresponding relation as a calibrated illumination value;
if the current illumination reading corresponds to a limited number of ideal illumination values except one in the corresponding relation, taking the average value of the limited ideal illumination values as a calibrated illumination value;
and if the current illumination reading corresponds to a plurality of ideal illumination values in the corresponding relation, taking the average value of the maximum value and the minimum value in the plurality of ideal illumination values as the calibrated illumination value.
4. The method of claim 1, wherein calculating the error of the piecewise function comprises:
integrating the absolute value of the difference value of the segmentation function and the ideal illumination function to obtain a first integration result;
integrating the ideal illumination function to obtain a second integration result;
and taking the ratio of the first integration result to the second integration result as the error of the piecewise function.
5. A light sensor calibration device, comprising:
the current illumination acquisition module is used for acquiring the current illumination reading of the optical sensor;
a correspondence obtaining module configured to obtain a correspondence between a test reading of the optical sensor and an ideal illuminance value, wherein the step of determining the correspondence includes: acquiring a plurality of test readings of the optical sensor under different illuminance of a test light source, constructing a calibration line graph by using the plurality of test readings and ideal illuminance values of the different illuminance, and determining a piecewise function corresponding to the calibration line graph as the corresponding relation;
and the calibration determination module is used for determining a calibrated illumination value according to the current illumination reading and the corresponding relation, and taking an error as a precision reference of the illumination value after the current illumination reading is calibrated, wherein the error is determined by calculating the error of the piecewise function.
6. A mobile device comprising a light sensor, wherein the mobile device comprises the light sensor calibration apparatus of claim 5.
7. A storage medium having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, implements the light sensor calibration method of any one of claims 1 to 4.
8. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the light sensor calibration method of any one of claims 1 to 4 via execution of the executable instructions.
CN201810525549.0A 2018-05-28 2018-05-28 Optical sensor calibration method and device, mobile device, medium and electronic device Active CN108760042B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810525549.0A CN108760042B (en) 2018-05-28 2018-05-28 Optical sensor calibration method and device, mobile device, medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810525549.0A CN108760042B (en) 2018-05-28 2018-05-28 Optical sensor calibration method and device, mobile device, medium and electronic device

Publications (2)

Publication Number Publication Date
CN108760042A CN108760042A (en) 2018-11-06
CN108760042B true CN108760042B (en) 2020-11-24

Family

ID=64002992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810525549.0A Active CN108760042B (en) 2018-05-28 2018-05-28 Optical sensor calibration method and device, mobile device, medium and electronic device

Country Status (1)

Country Link
CN (1) CN108760042B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111811786A (en) * 2020-08-20 2020-10-23 深圳市路美康尔医疗科技有限公司 Exposure intensity calibration method for ultraviolet disinfection cabinet
CN116075019B (en) * 2023-03-27 2023-06-13 厦门普为光电科技有限公司 Illuminance calibration device and method thereof

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011137731A2 (en) * 2011-04-29 2011-11-10 华为终端有限公司 Method for controlling light-emitting device in terminal equipment, apparatus thereof and terminal equipment
CN102322946B (en) * 2011-07-22 2014-01-22 惠州Tcl移动通信有限公司 Calibration method and system for optical sensor of mobile phone
JP6276783B2 (en) * 2012-12-26 2018-02-07 コーニンクレッカ フィリップス エヌ ヴェKoninklijke Philips N.V. Photodetection system and method for calibrating a photodetection device
CN103678070B (en) * 2013-12-27 2018-07-17 上海斐讯数据通信技术有限公司 Optical sensor calibration method, test method and the manufacturing method of mobile terminal
US10145733B2 (en) * 2015-09-02 2018-12-04 Qualcomm Incorporated Auto-calibrating light sensor data of a mobile device

Also Published As

Publication number Publication date
CN108760042A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
CN105651381B (en) light sensor calibration method and device
US8610007B2 (en) Portable electronic device and method for measuring object weight using the portable electronic device
CN108287633B (en) Calibration method and device of pressure sensor
US20140311209A1 (en) System and method for determining sensor accuracy of a portable electronic device
CN105866781B (en) Data processing method and electronic equipment
CN112333898B (en) Lamp brightness adjusting method and device, lamp and storage medium
US20110116104A1 (en) Locating Method of Optical Touch Device and Optical Touch Device
CN109257507B (en) Method for adjusting screen brightness, mobile terminal and storage medium
CN110146161B (en) Method and device for detecting ambient illumination intensity and terminal
CN109327258A (en) Calibration method, device and the readable storage medium storing program for executing of optical module receiving end optical power
CN108760042B (en) Optical sensor calibration method and device, mobile device, medium and electronic device
WO2021143878A1 (en) Method for calibrating proximity sensor, calibration apparatus, and mobile terminal
KR20170143351A (en) Method for controlling spectrometric sensor and electronic device implementing the same
CN109444060B (en) Solution concentration detection method, device, equipment and storage medium
CN112084658B (en) Target temperature detection method, system, equipment and medium
CN110736807A (en) Method for detecting gas concentration and gas detection device
CN112584057B (en) Illuminance detection method and device
CN108362650B (en) Liquid chromaticity detection method and device
EP3370074A1 (en) Method for detecting background noise of sensor, and device thereof
WO2016188496A1 (en) Touchscreen terminal and weight measurement method thereof
CN110596020A (en) Substance detection method and device, storage medium, and communication terminal
CN116187470A (en) Tongue diagnosis image color correction model training method, color correction method and equipment
CN114038372B (en) Gamma adjustment method, related device and storage medium
CN112365833B (en) Method for detecting and correcting brightness adjustment value of light sensation under screen
CN114063964A (en) Volume compensation optimization method and device, electronic equipment and readable storage medium

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