Method, device, storage medium and terminal for determining light transmittance of an object
By calculating the reflection coefficient of the optical signal emitted by the terminal on the object, the problem of poor model mobility in the existing technology is solved, the transmittance detection of any object is realized, and the usability and accuracy of detection are improved.
Patent Information
- Application Number
- CN202111056593.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-09
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-09-09
AI Technical Summary
In the existing technology, the model of the transmittance detection method lacks mobility, and different models need to be established for different objects, resulting in the unavailability of transmittance detection for objects without established models, which reduces the usability of detection.
By obtaining the first light intensity of the optical signal emitted by the terminal, the second light intensity of the optical signal after being reflected by the object to be detected, and the distance between the object and the terminal, the target reflection coefficient of the target object is calculated, and the light transmission is determined based on the reflection coefficient degree without the need to build a model for each object.
It realizes the light transmittance detection of any object, improves the usability and accuracy of detection, and simplifies the detection process.
Smart Images

Figure CN115801945B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of terminal technology, and in particular to a method, device, storage medium and terminal for determining the light transmittance of an object. Background Art
[0002] Currently, some application manufacturers have launched applications with transmittance detection function. If the detection application is installed in a mobile terminal such as a mobile phone, the user can use the detection application to perform transmittance detection.
[0003] In the related art, a model corresponding to the object is pre-established, and the image information of the object is captured by a mobile phone to detect the transmittance of the object. However, the model of this detection method is not portable. Different models need to be established for different objects. For objects without established models, their transmittance cannot be detected, resulting in poor usability of transmittance detection. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a method, device, storage medium and terminal for determining the transmittance of an object.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for determining light transmittance of an object is provided, which is applied to a terminal, and the method includes:
[0006] Acquire a first light intensity of an optical signal emitted by the terminal, a second light intensity of light reflected by the optical signal after being reflected by a target object to be detected, and a distance between the target object and the terminal;
[0007] determining a target reflection coefficient corresponding to the target object according to the first light intensity, the second light intensity, and the distance;
[0008] The light transmittance of the target object is determined according to the target reflection coefficient.
[0009] Optionally, determining a target reflection coefficient corresponding to the target object according to the first light intensity, the second light intensity, and the distance includes:
[0010] Inputting the distance into a pre-trained distance coefficient acquisition model to obtain a distance coefficient;
[0011] The target reflection coefficient is determined according to the first light intensity, the second light intensity, and the distance coefficient.
[0012] Optionally, the distance coefficient acquisition model includes multiple ones, and before inputting the distance into the pre-trained distance coefficient acquisition model to obtain the distance coefficient, the method further includes:
[0013] determining a target distance coefficient acquisition model from a plurality of distance coefficient acquisition models according to the second light intensity;
[0014] The step of inputting the distance into a pre-trained distance coefficient acquisition model to obtain the distance coefficient comprises:
[0015] The distance is input into the target distance coefficient acquisition model to obtain the distance coefficient.
[0016] Optionally, determining the target distance coefficient acquisition model from a plurality of distance coefficient acquisition models according to the second light intensity includes:
[0017] Acquire a plurality of preset reflected light intensities, wherein different preset reflected light intensities correspond to different distance coefficient acquisition models;
[0018] Acquire a light intensity difference between the second light intensity and each of the preset reflected light intensities;
[0019] The distance coefficient acquisition model corresponding to the preset reflected light intensity with the smallest light intensity difference is used as the target distance coefficient acquisition model.
[0020] Optionally, obtaining a second light intensity of the light signal after being reflected by a target object to be detected includes:
[0021] Collecting a third light intensity including ambient light and light corresponding to the reflected light;
[0022] determining an ambient light intensity of the ambient light according to the third light intensity;
[0023] The second light intensity is determined according to the third light intensity and the ambient light intensity.
[0024] Optionally, the third light intensity includes at least one; and determining the ambient light intensity of the ambient light according to the third light intensity includes:
[0025] At least one of the third light intensities is input into a pre-trained ambient light intensity acquisition model to obtain the ambient light intensity.
[0026] Optionally, determining the second light intensity according to the third intensity and the ambient light intensity includes:
[0027] determining a target light intensity based on at least one of the third light intensities;
[0028] Determine a target light intensity difference between the target light intensity and the ambient light intensity;
[0029] The target light intensity difference is used as the second light intensity.
[0030] Optionally, determining the light transmittance of the target object according to the target reflection coefficient includes:
[0031] According to the target reflection coefficient, the transmittance of the target object is determined by a preset transmittance correlation relationship, wherein the transmittance correlation relationship includes a correspondence between different reflection coefficients and transmittances.
[0032] According to a second aspect of an embodiment of the present disclosure, there is provided a device for determining light transmittance of an object, which is applied to a terminal, and the device includes:
[0033] A light intensity acquisition module, configured to acquire a first light intensity of an optical signal emitted by the terminal, a second light intensity of light reflected by the optical signal after being reflected by a target object to be detected, and a distance between the target object and the terminal;
[0034] a reflection coefficient determination module, configured to determine a target reflection coefficient corresponding to the target object according to the first light intensity, the second light intensity and the distance;
[0035] The transmittance determination module is configured to determine the transmittance of the target object according to the target reflection coefficient.
[0036] Optionally, the reflection coefficient determination module is further configured to:
[0037] Inputting the distance into a pre-trained distance coefficient acquisition model to obtain a distance coefficient;
[0038] The target reflection coefficient is determined according to the first light intensity, the second light intensity, and the distance coefficient.
[0039] Optionally, the distance coefficient acquisition model includes multiple ones, and the device further includes:
[0040] a model determination module, configured to determine a target distance coefficient acquisition model from a plurality of distance coefficient acquisition models according to the second light intensity;
[0041] The reflection coefficient determination module is further configured to:
[0042] The distance is input into the target distance coefficient acquisition model to obtain the distance coefficient.
[0043] Optionally, the model determination module is further configured to:
[0044] Acquire a plurality of preset reflected light intensities, wherein different preset reflected light intensities correspond to different distance coefficient acquisition models;
[0045] Acquire a light intensity difference between the second light intensity and each of the preset reflected light intensities;
[0046] The distance coefficient acquisition model corresponding to the preset reflected light intensity with the smallest light intensity difference is used as the target distance coefficient acquisition model.
[0047] Optionally, the light intensity acquisition module is further configured to:
[0048] Collecting a third light intensity including ambient light and light corresponding to the reflected light;
[0049] determining an ambient light intensity of the ambient light according to the third light intensity;
[0050] The second light intensity is determined according to the third light intensity and the ambient light intensity.
[0051] Optionally, the third light intensity includes at least one; and the light intensity acquisition module is further configured to:
[0052] At least one of the third light intensities is input into a pre-trained ambient light intensity acquisition model to obtain the ambient light intensity.
[0053] Optionally, the light intensity acquisition module is further configured to:
[0054] determining a target light intensity based on at least one of the third light intensities;
[0055] Determine a target light intensity difference between the target light intensity and the ambient light intensity;
[0056] The target light intensity difference is used as the second light intensity.
[0057] Optionally, the transmittance determination module is further configured to:
[0058] According to the target reflection coefficient, the transmittance of the target object is determined by a preset transmittance correlation relationship, wherein the transmittance correlation relationship includes a correspondence between different reflection coefficients and transmittances.
[0059] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the method for determining the transmittance of an object provided in the first aspect of the present disclosure are implemented.
[0060] According to a fourth aspect of an embodiment of the present disclosure, a terminal is provided, including:
[0061] a memory having a computer program stored thereon;
[0062] A processor is used to execute the computer program in the memory to implement the steps of the method for determining the transmittance of an object provided in the first aspect of the present disclosure.
[0063] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: by obtaining the first light intensity of the optical signal emitted by the terminal, the second light intensity of the reflected light after the optical signal is reflected by the target object to be detected, and the distance between the target object and the terminal; according to the first light intensity, the second light intensity and the distance, the target reflection coefficient corresponding to the target object is determined; according to the target reflection coefficient, the light transmittance of the target object is determined. In other words, there is no need to establish a corresponding model for each object, and the light transmittance of the object can be determined only by the calculated reflection coefficient. In this way, light transmittance detection can be performed on any object, thereby improving the availability of light transmittance detection.
[0064] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] 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 present disclosure.
[0066] Figure 1 is a flow chart showing a method for determining light transmittance of an object according to an exemplary embodiment;
[0067] Figure 2 is a flow chart showing another method for determining light transmittance of an object according to an exemplary embodiment;
[0068] Figure 3 is a schematic diagram of an optical sensor of a terminal according to an exemplary embodiment;
[0069] Figure 4 is a diagram showing a field of view angle of an optical sensor of a terminal according to an exemplary embodiment;
[0070] Figure 5 is a block diagram of a device for determining light transmittance of an object according to an exemplary embodiment;
[0071] Figure 6 is a block diagram of another device for determining light transmittance of an object according to an exemplary embodiment;
[0072] Figure 7 It is a block diagram of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION
[0073] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0074] The present disclosure is described below in conjunction with specific embodiments.
[0075] Figure 1 is a flow chart of a method for determining light transmittance of an object according to an exemplary embodiment. Figure 1 As shown, the method is used in a terminal, comprising:
[0076] S101, acquiring a first light intensity of an optical signal emitted by a terminal, a second light intensity of light reflected by the optical signal after being reflected by a target object to be detected, and a distance between the target object and the terminal.
[0077] The optical signal may be light emitted by a flashlight of the terminal, light emitted by a display screen of the terminal, or light emitted by an optical transmitter module in the terminal. The optical transmitter module may be an infrared module, which is not limited in the present disclosure.
[0078] In this step, if the optical signal is the light emitted by the flashlight of the terminal, the first light intensity of the optical signal can be determined according to the light intensity corresponding to the flashlight preset by the terminal, that is, the light intensity corresponding to the flashlight is taken as the first light intensity; if the optical signal is the light emitted by the display screen of the terminal, the first light intensity of the optical signal can be determined according to the current brightness level of the display screen of the terminal, that is, the intensity corresponding to the light emitted by the display screen is taken as the first light intensity. When obtaining the second light intensity of the reflected light after the optical signal is reflected by the target object to be detected, the terminal can be placed in a dark room. In the absence of ambient light interference, the intensity of the light collected by the optical sensor of the terminal is the second light intensity.
[0079] The terminal can obtain the distance between the target object and the terminal through a SAR (Specific Absorption Rate) sensor or a distance sensor. When the distance between the target object and the terminal is far, the distance between the target object and the terminal can also be obtained through an infrared sensor. The present disclosure does not limit the specific method of obtaining the distance between the target object and the terminal.
[0080] S102: Determine a target reflection coefficient corresponding to the target object according to the first light intensity, the second light intensity, and the distance.
[0081] In this step, after obtaining the first light intensity, the second light intensity and the distance, the distance can be input into a pre-trained distance coefficient acquisition model to obtain a distance coefficient, and then the target reflection coefficient can be determined based on the first light intensity, the second light intensity and the distance coefficient.
[0082] S103: Determine the light transmittance of the target object according to the target reflection coefficient.
[0083] In this step, after obtaining the target reflection coefficient corresponding to the target object, the transmittance of the target object can be determined according to the target reflection coefficient through a preset transmittance correlation relationship, and the transmittance correlation relationship includes the correspondence between different reflection coefficients and transmittances. The correspondence between different reflection coefficients and transmittances can be obtained in advance through experimental tests, and different reflection coefficients correspond to different transmittances. It can be understood that different objects have different transmittances. After determining the transmittance of the target object, it can be determined what kind of object the target object is, that is, it can be determined whether the target object is hair, skin, clothes or jade, etc.
[0084] By adopting the above method, there is no need to establish a corresponding model for each object, and the transmittance of the object can be determined only by the calculated reflection coefficient. In this way, the transmittance detection can be performed on any object, thereby improving the availability of the transmittance detection.
[0085] Figure 2 is a flow chart showing another method for determining the light transmittance of an object according to an exemplary embodiment. Figure 2 As shown, the method includes:
[0086] S201 : Collect a third light intensity including the ambient light and the light corresponding to the reflected light.
[0087] In this step, the third light intensity may be collected by an optical sensor of the terminal, wherein the third light intensity includes ambient light and reflected light, and the optical sensor may include at least one, different optical sensors are used to collect the third light intensity of the terminal in different directions. Figure 3 is a schematic diagram of an optical sensor of a terminal according to an exemplary embodiment. Figure 3 As shown, taking the terminal as a mobile phone as an example, the mobile phone includes a front light sensor (front light sensor), a rear light sensor (rear light sensor) and a top light sensor (top light sensor), Figure 4 is a diagram showing a field of view of an optical sensor of a terminal according to an exemplary embodiment. Figure 4 As shown, the front light sensing angle is the range of light intensity collected by the front light sensing, and the rear light sensing angle is the range of light intensity collected by the rear light sensing.
[0088] When determining the light transmittance of an object through the terminal, for example, after the terminal receives a user's start-up operation for an application program for determining the light transmittance of an object, the third light intensity may be collected through at least one optical sensor of the terminal. Figure 3 Taking the optical sensor shown as an example, the terminal collects a third front light intensity through the front optical sensor, collects a third rear light intensity through the rear optical sensor, and collects a third top light intensity through the top optical sensor.
[0089] It should be noted that the terminal can determine the target light sensor from at least one light sensor according to the type of application, and collect the third light intensity through the target light sensor. For example, if the application obtains the detection image of the object to be detected through the rear camera of the terminal, the target light sensor can be determined to be the rear light sensor and the top light sensor; if the application obtains the detection image of the object to be detected through the front camera of the terminal, the target light sensor can be determined to be the front light sensor and the top light sensor. In addition, when obtaining the detection image of the object to be detected through the front camera of the terminal, considering that the intensity of the light signal emitted by the terminal through the flashlight is relatively large, the light signal will also be reflected to the front and top of the terminal. In order to improve the accuracy of the collected third light intensity, the target light sensor can be determined to be the front light sensor, the rear light sensor and the top light sensor. The above-mentioned method of determining the target light sensor is only an example, and the target light sensor can also be determined by other methods, which is not limited by the present disclosure.
[0090] S202: Determine the ambient light intensity of the ambient light according to the third light intensity.
[0091] It should be noted that if the terminal is used in a dark room, the interference from the ambient light is relatively small, and the third light intensity collected by the optical sensor of the terminal is substantially the same as the first light intensity of the optical signal emitted by the terminal. However, in general, the use environment of the terminal is relatively complex, and a completely dark room environment will limit the application scope of the terminal. Therefore, after collecting the third light intensity, the terminal can determine the ambient light intensity of the ambient light in the environment where the terminal is currently located according to the third light intensity.
[0092] In this step, after the third light intensity is collected by at least one optical sensor of the terminal, at least one third light intensity can be input into a pre-trained ambient light intensity acquisition model to obtain the ambient light intensity. The ambient light intensity acquisition model can be trained in the following manner:
[0093] S1. Transmitting a plurality of sample optical signals through the terminal, wherein different sample optical signals correspond to different first sample light intensities.
[0094] S2. For each sample light signal emitted by the terminal, collect a third sample light intensity including ambient light and light corresponding to sample reflected light after the sample light signal is reflected by the target object.
[0095] S3. Place the terminal in a dark room, and for each sample light signal emitted by the terminal, collect a second sample light intensity of the sample reflected light after the sample light signal is reflected by a sample object through at least one light sensor of the terminal, and obtain at least one second sample light intensity corresponding to each sample signal light. The sample object is of the same type as the target object, and the sample object may include multiple different objects. For example, if the target object is skin, then the sample object is also skin. For example, the target object is the skin of Ms. A, and the sample object is the skin of Mr. B.
[0096] It should be noted that, in order to improve the accuracy of the ambient light intensity acquisition model, the sample object may include multiple different objects. For example, if the sample object is skin, the sample object may be the skin of multiple people of different ages and genders.
[0097] S4. According to at least one second sample light intensity, at least one third sample light intensity and the first sample light intensity, the first target neural network model is trained to obtain the ambient light intensity acquisition model.
[0098] In the case where the target light sensor corresponding to the terminal includes a front light sensor, a rear light sensor, and a top light sensor, the mathematical model corresponding to the first target neural network model may be:
[0099] y 环 =(e1*c1^n+e2*c1^(n-1)+..+en)+(f1*c2^n+f2*c2^(n-1)+..+fn)+(g1*c3^n+g2*c3^(n-1)+..+gn) (1)
[0100] Among them, y 环 is the sample ambient light, c1 is the third front sample light intensity, c2 is the third rear sample light intensity, c3 is the third top sample light intensity, e1, e2, …, en are the first preset light intensity coefficient set, f1, f2, …, fn are the second preset light intensity coefficient set, g1, g2, …, gn are the third preset light intensity coefficient set, and n is the number of the preset light intensity coefficients.
[0101] In the case where the target light sensor corresponding to the terminal includes a front light sensor and a top light sensor, the mathematical model corresponding to the first target neural network model may be:
[0102] y 环=(e1*c1^n+e2*c1^(n-1)+..+en)+(g1*c3^n+g2*c3^(n-1)+..+gn) (2)
[0103] For each sample light signal, the second target sample light intensity corresponding to the sample light signal can be determined based on at least one second sample light intensity corresponding to the sample light signal, and the third target sample light intensity corresponding to the sample light signal can be determined based on at least one third sample light intensity corresponding to the sample light signal and the first sample light intensity. Thereafter, the sample light intensity difference between the second target sample light intensity and the third target sample light intensity is calculated, and the sample light intensity difference is used as the sample ambient light corresponding to the sample light signal.
[0104] Furthermore, after obtaining the sample ambient light corresponding to each sample light signal, the above-mentioned first target neural network model can be optimized through multiple sample ambient lights and at least one third sample light intensities, that is, the above-mentioned first preset light intensity coefficient set, the second preset light intensity coefficient set and the multiple preset light intensity coefficients in the third preset light intensity coefficient set are determined to obtain the ambient light intensity acquisition model.
[0105] It should be noted that the mathematical model corresponding to the above-mentioned first target neural network model is only an example, and the first target neural network model may also be other mathematical models, which is not limited in the present disclosure.
[0106] S203: Determine the second light intensity according to the third light intensity and the ambient light intensity.
[0107] In this step, after obtaining the ambient light intensity and at least one third light intensity, the target light intensity can be determined according to the at least one third light intensity, and the target light intensity difference between the target light intensity and the ambient light intensity can be determined, and the target light intensity difference can be used as the second light intensity.
[0108] For example, Figure 3 Taking the light sensor of the terminal shown as an example, if the terminal includes a front light sensor, a rear light sensor and a top light sensor, and the third light intensity includes a third front light intensity, a third rear light intensity and a third top light intensity, then the average value of the third front light intensity, the third rear light intensity and the third top light intensity can be used as the target light intensity; if the terminal includes a front light sensor and a top light sensor, and the third light intensity includes a third front light intensity and a third top light intensity, then the average value of the third front light intensity and the third top light intensity can be used as the target light intensity.
[0109] It should be noted that the above method of determining the target light intensity is only an example, and the present disclosure can also determine the weights corresponding to different third light intensities according to the influence of the third light intensities in different directions, and determine the target light intensity according to the third light intensities and the weights. For example, if the terminal includes a front light sensor and a top light sensor, the third light intensity includes a third front light intensity and a third top light intensity, the first weight corresponding to the third front light intensity is 0.7, and the third weight corresponding to the third top light intensity is 0.3, then the first product of the third front light intensity and the first weight, the second product of the third top light intensity and the third weight can be calculated, and the sum of the first product and the second product is used as the target light intensity.
[0110] Further, after the target light intensity is determined, a target light intensity difference between the target light intensity and the ambient light intensity may be calculated, and the target light intensity difference may be used as the second light intensity.
[0111] S204: Acquire a first light intensity of the optical signal emitted by the terminal and a distance between the target object to be detected and the terminal.
[0112] In this step, the terminal can obtain the distance between the target object and the terminal through a SAR sensor or a distance sensor. When the distance between the target object and the terminal is far, the distance between the target object and the terminal can also be obtained through an infrared sensor. The present disclosure does not limit the specific method of obtaining the distance between the target object and the terminal.
[0113] S205: Input the distance into a pre-trained distance coefficient acquisition model to obtain a distance coefficient.
[0114] Among them, the distance coefficient acquisition model can be trained in the following way:
[0115] S1. Obtain a first sample light intensity of a sample light signal emitted by the terminal.
[0116] S2. Place the terminal in a dark room, and collect, through the optical sensor of the terminal, a second sample light intensity of the sample reflected light at different preset distances after the sample light signal is reflected by the sample object. The preset distance is the distance between the sample object and the terminal, and the preset distance can be a plurality of different distances set in advance. The sample reflected light is the light of the sample light signal emitted by the terminal that is reflected by the sample object to the terminal. The sample object is of the same type as the target object. For example, if the target object is skin, then the sample object is also skin. For example, the target object is the skin of Ms. A, and the sample object is the skin of Mr. B.
[0117] By way of example, the distance between the sample object and the terminal can be set to L1, and the second sample light intensity y1 of the sample reflected light is collected by the optical sensor of the terminal; the distance between the sample object to be detected and the terminal can be set to L2, and the second sample light intensity y2 of the sample reflected light is collected by the optical sensor of the terminal, ..., the distance between the sample object to be detected and the terminal can be set to Ln, and the second sample light intensity yn of the sample reflected light is collected by the optical sensor of the terminal.
[0118] S3. Obtain a preset reflection coefficient of the sample object.
[0119] The preset reflection coefficients corresponding to different objects may be different, and the preset reflection coefficients of the sample objects may be obtained through experimental testing.
[0120] S4. According to the first sample light intensity, multiple second sample light intensities, the preset reflection coefficient and the preset distance, the second target neural network model is trained to obtain the distance coefficient acquisition model.
[0121] The mathematical model corresponding to the second target neural network model can be:
[0122] I Y =a1*L Y ^n+a2*L Y ^(n-1)+...+an (3)
[0123] Among them, I Y is the sample distance coefficient, L Y is the preset distance, a1, a2, ..., an are the fourth preset light intensity coefficient set.
[0124] For each second sample light intensity, the sample distance coefficient corresponding to the second sample light intensity can be calculated according to the first sample light intensity, the second sample light intensity and the preset reflection coefficient by the following formula:
[0125] I Y =y F / y Y / X Y (4)
[0126] Among them, y F is the second sample light intensity, y Y is the first sample light intensity, X Y is the preset reflection coefficient, and “ / ” represents division.
[0127] Further, after obtaining multiple sample distance coefficients, the fourth preset light intensity coefficient set can be adjusted by the multiple sample distance coefficients and the preset distance, so as to optimize the second target neural network model and obtain the distance coefficient acquisition model. The method for adjusting the fourth preset light intensity coefficient set can refer to the model training method of the related technology, which will not be repeated here.
[0128] It should be noted that the mathematical model corresponding to the above-mentioned second target neural network model is only an example, and the second target neural network model may also be other mathematical models, which is not limited in the present disclosure. In addition, when training the distance coefficient acquisition model, the average value of multiple second sample light intensities can be used as the preset reflected light intensity, and a model association relationship is established. The model association relationship includes the correspondence between different preset sample reflected light intensities and the distance coefficient acquisition model, so that the terminal determines the target distance coefficient acquisition model from multiple distance coefficient acquisition models.
[0129] In this step, the distance coefficient acquisition model may include multiple ones. Before inputting the distance into the distance coefficient acquisition model, the target distance coefficient acquisition model can be determined from the multiple distance coefficient acquisition models according to the second light intensity, and the distance is input into the target distance coefficient acquisition model to obtain the distance coefficient.
[0130] In one possible implementation, multiple preset reflected light intensities can be obtained, and different preset reflected light intensities correspond to different distance coefficient acquisition models. The light intensity difference between the second light intensity and each preset reflected light intensity is obtained, and the distance coefficient acquisition model corresponding to the preset reflected light intensity with the smallest light intensity difference is used as the target distance coefficient acquisition model.
[0131] By way of example, in the case where the terminal includes at least one light sensor, the second light intensity also includes at least one. The method for determining the target light intensity in step S203 can be referred to, and the second target light intensity can be determined based on at least one second light intensity. Thereafter, the light intensity difference between the second target light intensity and each preset reflected light intensity is obtained, and the target preset reflected light intensity with the smallest light intensity difference is determined. The target distance coefficient acquisition model corresponding to the target preset reflected light intensity is determined through the model association relationship.
[0132] S206: Determine the target reflection coefficient according to the first light intensity, the second light intensity and the distance coefficient.
[0133] In this step, after obtaining the first light intensity, the second light intensity and the distance coefficient, the target reflection coefficient can be determined by the following formula:
[0134] X M =YF / Y Y / I (5)
[0135] Among them, X M is the target reflection coefficient, Y F is the second light intensity, Y Y is the first light intensity, I is the distance coefficient, and “ / ” represents division.
[0136] S207: Determine the transmittance of the target object according to the target reflection coefficient and a preset transmittance correlation relationship.
[0137] The transmittance correlation relationship includes the corresponding relationship between different reflectance coefficients and transmittances. For example, the transmittance correlation relationship can be obtained by pre-testing through experiments.
[0138] In this step, a level association relationship may also be established in advance, and the level association relationship includes a correspondence between different transmittances and transmittance levels. After determining the transmittance of the target object, the transmittance level of the target object may be determined through the level association relationship, so as to facilitate the user to determine the transmittance of the target object. For example, if the transmittance level of the target object is level 1, it means that the transmittance of the target object is good, and if the transmittance level of the target object is level 5, it means that the transmittance of the target object is poor. For example, if the target object is skin, when the transmittance level of the target object is 1, it means that the skin condition is relatively good, and when the transmittance level of the target object is level 5, it means that the skin condition is relatively poor. In this way, after obtaining the transmittance level, the user can more easily determine the quality of the target object.
[0139] By adopting the above method, there is no need to establish a corresponding model for each object. The transmittance of the object can be determined only by calculating the reflection coefficient. In this way, transmittance detection can be performed on any object, thereby improving the usability of transmittance detection; in the process of determining the transmittance of the target object, the interference of ambient light can be filtered out, thereby improving the accuracy of transmittance detection.
[0140] Figure 5 is a block diagram of a device for determining light transmittance of an object according to an exemplary embodiment. Figure 5 As shown, the device is used in a terminal, comprising:
[0141] The light intensity acquisition module 501 is configured to acquire a first light intensity of the light signal emitted by the terminal, a second light intensity of the light reflected by the light signal after being reflected by the target object to be detected, and a distance between the target object and the terminal;
[0142] A reflection coefficient determination module 502 is configured to determine a target reflection coefficient corresponding to the target object according to the first light intensity, the second light intensity and the distance;
[0143] The transmittance determination module 503 is configured to determine the transmittance of the target object according to the target reflection coefficient.
[0144] Optionally, the reflection coefficient determination module 502 is further configured to:
[0145] The distance is input into a pre-trained distance coefficient acquisition model to obtain a distance coefficient;
[0146] The target reflection coefficient is determined according to the first light intensity, the second light intensity and the distance coefficient.
[0147] Optionally, the distance coefficient acquisition model includes multiple, Figure 6 is a block diagram of another device for determining light transmittance of an object according to an exemplary embodiment. Figure 6 As shown, the device also includes:
[0148] A model determination module 504 is configured to determine a target distance coefficient acquisition model from a plurality of distance coefficient acquisition models according to the second light intensity;
[0149] The reflection coefficient determination module 502 is further configured to:
[0150] The distance is input into the target distance coefficient acquisition model to obtain the distance coefficient.
[0151] Optionally, the model determination module 504 is further configured to:
[0152] Acquire a plurality of preset reflected light intensities, wherein different preset reflected light intensities correspond to different distance coefficient acquisition models;
[0153] Obtaining a light intensity difference between the second light intensity and each of the preset reflected light intensities;
[0154] The distance coefficient acquisition model corresponding to the preset reflected light intensity with the smallest light intensity difference is used as the target distance coefficient acquisition model.
[0155] Optionally, the light intensity acquisition module 501 is further configured to:
[0156] Collecting a third light intensity including ambient light and light corresponding to the reflected light;
[0157] determining the ambient light intensity of the ambient light according to the third light intensity;
[0158] The second light intensity is determined according to the third light intensity and the ambient light intensity.
[0159] Optionally, the third light intensity includes at least one; the light intensity acquisition module 501 is further configured to:
[0160] At least one of the third light intensities is input into a pre-trained ambient light intensity acquisition model to obtain the ambient light intensity.
[0161] Optionally, the light intensity acquisition module 501 is further configured to:
[0162] determining a target light intensity according to at least one of the third light intensities;
[0163] Determine a target light intensity difference between the target light intensity and the ambient light intensity;
[0164] The target light intensity difference is used as the second light intensity.
[0165] Optionally, the transmittance determination module 503 is further configured to:
[0166] According to the target reflection coefficient, the transmittance of the target object is determined through a preset transmittance correlation relationship, and the transmittance correlation relationship includes a correspondence between different reflection coefficients and transmittances.
[0167] Through the above device, there is no need to establish a corresponding model for each object, and the transmittance of the object can be determined only by calculating the reflection coefficient. In this way, the transmittance detection can be performed on any object, thereby improving the availability of transmittance detection.
[0168] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0169] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon. When the program instructions are executed by a processor, the steps of the method for determining the light transmittance of an object provided by the present disclosure are implemented.
[0170] Figure 7 is a block diagram of a terminal 700 according to an exemplary embodiment. For example, the terminal 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0171] Reference Figure 7 The terminal 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .
[0172] The processing component 702 generally controls the overall operation of the terminal 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method for determining the light transmittance of an object. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.
[0173] The memory 704 is configured to store various types of data to support operations at the terminal 700. Examples of such data include instructions for any application or method operating on the terminal 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.
[0174] Power component 706 provides power to various components of terminal 700. Power component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal 700.
[0175] The multimedia component 708 includes a screen that provides an output interface between the terminal 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the terminal 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0176] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the terminal 700 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.
[0177] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0178] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the terminal 700. For example, the sensor assembly 714 can detect the open / closed state of the terminal 700, the relative positioning of the components, such as the display and keypad of the terminal 700, and the sensor assembly 714 can also detect the position change of the terminal 700 or a component of the terminal 700, the presence or absence of contact between the user and the terminal 700, the orientation or acceleration / deceleration of the terminal 700, and the temperature change of the terminal 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0179] The communication component 716 is configured to facilitate wired or wireless communication between the terminal 700 and other devices. The terminal 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0180] In an exemplary embodiment, terminal 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned method for determining the transmittance of an object.
[0181] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by the processor 720 of the terminal 700 to complete the above method of determining the light transmittance of the object. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0182] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned method for determining the transmittance of an object when executed by the programmable device.
[0183] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0184] It should be understood that the present disclosure is not limited to the exact structures that have been 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 limited only by the appended claims.
Claims
1. A method for determining the light transmittance of an object, characterized in that: Applied to a terminal, the method comprises: Acquire a first light intensity of an optical signal emitted by the terminal, a second light intensity of light reflected by the optical signal after being reflected by a target object to be detected, and a distance between the target object and the terminal; determining a target reflection coefficient corresponding to the target object according to the first light intensity, the second light intensity, and the distance; Determining the light transmittance of the target object according to the target reflection coefficient; The determining, according to the first light intensity, the second light intensity, and the distance, a target reflection coefficient corresponding to the target object comprises: Inputting the distance into a pre-trained distance coefficient acquisition model to obtain a distance coefficient; determining the target reflection coefficient according to the first light intensity, the second light intensity and the distance coefficient; The distance coefficient acquisition model is trained in the following way: Acquire a first sample light intensity of a sample light signal emitted by the terminal; The terminal is placed in a dark room, and a light sensor of the terminal is used to collect second sample light intensities of sample reflected light at different preset distances after the sample light signal is reflected by a sample object, wherein the sample object is of the same type as the target object, and the preset distance is the distance between the sample object and the terminal; Obtaining a preset reflection coefficient of the sample object; According to the first sample light intensity, multiple second sample light intensities, the preset reflection coefficient and the preset distance, the second target neural network model is trained to obtain the distance coefficient acquisition model, and the second target neural network model is a preset mathematical model.
2. The method according to claim 1, characterized in that The distance coefficient acquisition model includes multiple ones. Before inputting the distance into the pre-trained distance coefficient acquisition model to obtain the distance coefficient, the method further includes: determining a target distance coefficient acquisition model from a plurality of distance coefficient acquisition models according to the second light intensity; The step of inputting the distance into a pre-trained distance coefficient acquisition model to obtain the distance coefficient comprises: The distance is input into the target distance coefficient acquisition model to obtain the distance coefficient.
3. The method according to claim 2, characterized in that Determining a target distance coefficient acquisition model from a plurality of distance coefficient acquisition models according to the second light intensity comprises: Acquire a plurality of preset reflected light intensities, wherein different preset reflected light intensities correspond to different distance coefficient acquisition models; Acquire a light intensity difference between the second light intensity and each of the preset reflected light intensities; The distance coefficient acquisition model corresponding to the preset reflected light intensity with the smallest light intensity difference is used as the target distance coefficient acquisition model.
4. The method according to claim 1, characterized in that: Acquiring a second light intensity of the light signal after being reflected by the target object to be detected includes: Collecting a third light intensity including ambient light and light corresponding to the reflected light; determining an ambient light intensity of the ambient light according to the third light intensity; determining the second light intensity according to the third light intensity and the ambient light intensity; The third light intensity includes at least one; and determining the ambient light intensity of the ambient light according to the third light intensity includes: At least one of the third light intensities is input into a pre-trained ambient light intensity acquisition model to obtain the ambient light intensity.
5. The method according to claim 4, characterized in that The determining the second light intensity according to the third light intensity and the ambient light intensity comprises: determining a target light intensity based on at least one of the third light intensities; Determine a target light intensity difference between the target light intensity and the ambient light intensity; The target light intensity difference is used as the second light intensity.
6. The method according to any one of claims 1 to 5, characterized in that: Determining the light transmittance of the target object according to the target reflection coefficient includes: According to the target reflection coefficient, the transmittance of the target object is determined by a preset transmittance correlation relationship, wherein the transmittance correlation relationship includes a correspondence between different reflection coefficients and transmittances.
7. A device for determining the light transmittance of an object, characterized in that: Applied to a terminal, the device comprises: A light intensity acquisition module, configured to acquire a first light intensity of an optical signal emitted by the terminal, a second light intensity of light reflected by the optical signal after being reflected by a target object to be detected, and a distance between the target object and the terminal; a reflection coefficient determination module, configured to determine a target reflection coefficient corresponding to the target object according to the first light intensity, the second light intensity and the distance; a transmittance determination module, configured to determine the transmittance of the target object according to the target reflection coefficient; The reflection coefficient determination module is further configured to: Inputting the distance into a pre-trained distance coefficient acquisition model to obtain a distance coefficient; determining the target reflection coefficient according to the first light intensity, the second light intensity and the distance coefficient; The distance coefficient acquisition model is trained in the following way: Acquire a first sample light intensity of a sample light signal emitted by the terminal; The terminal is placed in a dark room, and a light sensor of the terminal is used to collect second sample light intensities of sample reflected light at different preset distances after the sample light signal is reflected by a sample object, wherein the sample object is of the same type as the target object, and the preset distance is the distance between the sample object and the terminal; Obtaining a preset reflection coefficient of the sample object; According to the first sample light intensity, multiple second sample light intensities, the preset reflection coefficient and the preset distance, the second target neural network model is trained to obtain the distance coefficient acquisition model, and the second target neural network model is a preset mathematical model.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
9. A terminal, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.
