Temperature compensation method for deep focusing, electronic equipment and chip system
By using a temperature compensation coefficient to compensate for the focus position during the depth focusing process, the problem of the focusing accuracy of the depth focusing algorithm being affected by temperature is solved, thereby improving focusing accuracy and speed and enhancing shooting results.
Patent Information
- Application Number
- CN202411299404.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2026-03-24
AI Technical Summary
The focusing accuracy of depth autofocus algorithms is easily affected by device temperature, causing the focus position to deviate from the true focus position, resulting in a blurred subject.
By acquiring the current temperature of the camera module, the target burning temperature, and the object distance, the focus position compensation value is determined, and the temperature compensation coefficient is used to compensate the depth focusing algorithm to ensure focusing accuracy.
It improves the focusing accuracy and speed of depth focus, enhances the sharpness of the subject, and improves the user's shooting experience.
Smart Images

Figure CN121728334A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of shooting, and particularly relates to a temperature compensation method for depth focusing, an electronic device, a chip system, a computer readable storage medium and a computer program product. BACKGROUND
[0002] With the massive popularity and rapid development of electronic devices such as smart phones, the functions of the electronic devices such as smart phones are also becoming more and more perfect. For example, users can take photos through smart phones. In many shooting scenes, in order to make the imaging picture clear and shooting more convenient, the subject can be automatically focused to meet the higher shooting needs of users. Common automatic focusing methods include phase focusing, contrast focusing and depth focusing. The phase focusing method and the contrast focusing method have high focusing accuracy, but the focusing speed is low; the depth focusing algorithm has the characteristics of fast focusing speed.
[0003] In the related art, since the depth focusing algorithm has fast focusing speed, in shooting scenes such as focusing on a moving object that need fast focusing, the depth focusing algorithm is usually used for focusing. However, since the focusing accuracy of the depth focusing algorithm is easily affected by the temperature of the device, and the depth laser device is easy to heat up, when the actual object distance is constant, the focusing position calculated by the depth focusing algorithm will change with the temperature, so that the depth focusing position deviates from the focus position, is easy to be out of focus, makes the shooting subject blurred, and affects the user's shooting experience. SUMMARY
[0004] The embodiments of the application provide a temperature compensation method for depth focusing, an electronic device, a chip system, a computer readable storage medium and a computer program product, which can solve the problem that the focusing accuracy of the depth focusing algorithm is easily affected by the temperature of the device, so that the depth focusing position deviates from the focus position, is easy to be out of focus, and makes the shooting subject blurred.
[0005] In a first aspect, the embodiments of the application provide a temperature compensation method for depth focusing, comprising: in the case that a target camera module in a target device performs depth focusing, acquiring a current temperature corresponding to the target camera module, a target burning temperature and a current object distance corresponding to a focusing area, wherein the current object distance is measured by a depth laser device corresponding to the target camera module; determining an initial focusing position corresponding to the focusing area according to the current object distance; determining a focusing position compensation value corresponding to the target camera module according to the current temperature, the target burning temperature and the current object distance; and determining a compensated target focusing position according to the initial focusing position and the focusing position compensation value.
[0006] Therefore, by determining the deviation of the focusing position caused by the difference between the current temperature of the camera module and the target temperature for burning-in at the current distance, and compensating the depth focusing position according to the deviation of the focusing position, the accurate focusing position of the focusing area is obtained, so that the influence of temperature fluctuation on the depth focusing accuracy is eliminated, the focusing accuracy of depth focusing is improved, and the clarity of the photographed subject is improved, and the user's shooting experience is improved.
[0007] In a possible implementation manner of the first aspect, the determination of the focusing position compensation value corresponding to the target camera module according to the current temperature, the target temperature for burning-in and the current distance comprises:
[0008] determining a current temperature compensation coefficient corresponding to the target camera module according to the current temperature, the target temperature for burning-in and the current distance;
[0009] determining the focusing position compensation value according to the current temperature, the target temperature for burning-in and the current temperature compensation coefficient.
[0010] Therefore, because the amount of deviation of the depth focusing position caused by temperature fluctuation and the fluctuation amplitude of the temperature have a certain linear relationship, the current temperature compensation coefficient corresponding to the camera module can be determined according to the current temperature, the target temperature for burning-in and the current distance, so as to represent the linear relationship between the current temperature fluctuation and the amount of deviation of the focusing position at the current distance by the current temperature compensation coefficient, and then the focusing position compensation value corresponding to the camera module is determined according to the current temperature, the target temperature for burning-in and the current temperature compensation coefficient, so as to compensate the depth focusing position. Therefore, the linear relationship between the temperature change and the deviation of the focusing position is represented by the temperature compensation coefficient, and the compensation value of the depth focusing position is determined according to the temperature compensation coefficient, so that the focusing accuracy of the depth focusing is improved, and the processing process and the calculation amount of the temperature compensation are simplified, and the efficiency of the temperature compensation and the speed of the depth focusing are further improved.
[0011] Optionally, in another possible implementation manner of the first aspect, the determination of the focusing position compensation value according to the current temperature, the target temperature for burning-in and the current temperature compensation coefficient comprises:
[0012] determining a current temperature difference between the current temperature and the target temperature for burning-in;
[0013] determining the focusing position compensation value according to the product of the current temperature difference and the current temperature compensation coefficient.
[0014] Thus, since there is a certain linear relationship between the deviation of the depth focus position caused by temperature fluctuation and the amplitude of temperature fluctuation, after determining the current temperature compensation coefficient representing this linear relationship, the current temperature difference between the current temperature of the camera module and the target burning temperature can be determined. Based on the product of the current temperature difference and the current temperature compensation coefficient, the corresponding focus position compensation value of the camera module can be determined. This not only improves the focusing accuracy of depth focus, but also simplifies the temperature compensation process and calculation, further improving the efficiency of temperature compensation and the speed of depth focus.
[0015] Optionally, in another possible implementation of the first aspect, determining the current temperature compensation coefficient corresponding to the target camera module based on the current temperature, the target burning temperature, and the current object distance includes:
[0016] Obtain the temperature compensation coefficient index table corresponding to the target camera module. The temperature compensation coefficient index table includes the correspondence between multiple reference object distances and reference temperature compensation coefficients. Each reference object distance includes a first reference temperature compensation coefficient and a second reference temperature compensation coefficient.
[0017] Based on the current object distance, obtain the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance from the temperature compensation coefficient index table;
[0018] If the current temperature is less than or equal to the target burning temperature, the first temperature compensation coefficient is determined as the current temperature compensation coefficient.
[0019] If the current temperature is higher than the target burning temperature, the second temperature compensation coefficient will be determined as the current temperature compensation coefficient.
[0020] Thus, by pre-establishing a temperature compensation coefficient index table containing the correspondence between reference object distance and reference temperature compensation coefficient, and when performing depth focusing temperature compensation on the camera module, the temperature compensation coefficient matching the current temperature, target burning temperature, and current object distance is determined by looking up the table. Furthermore, when the current temperature is greater than the target burning temperature and less than or equal to the target burning temperature, different temperature compensation coefficients are used to perform temperature compensation on the depth focusing results, thereby further improving the accuracy of temperature compensation and thus further improving the focusing precision of depth focusing. Moreover, determining the temperature compensation coefficient by looking up the table further simplifies the processing of temperature compensation for depth focusing, thereby further improving the efficiency of temperature compensation and the focusing speed of depth focusing.
[0021] Optionally, in another possible implementation of the first aspect, the above-mentioned obtaining a first temperature compensation coefficient and a second temperature compensation coefficient matching the current object distance from the temperature compensation coefficient index table based on the current object distance includes:
[0022] If the temperature compensation coefficient index table contains the current object distance, the first reference temperature compensation coefficient and the second reference temperature compensation coefficient corresponding to the current object distance in the temperature compensation coefficient index table are determined as the first temperature compensation coefficient and the second temperature compensation coefficient, respectively.
[0023] If the current object distance is not included in the temperature compensation coefficient index table, the temperature compensation coefficient index table is interpolated based on the current object distance to determine the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance.
[0024] Thus, since the actual object distance of the focus area changes randomly during actual shooting, and the temperature compensation coefficient index table may not contain the temperature compensation coefficients corresponding to all object distances, when the temperature compensation coefficient index table does not contain the current object distance corresponding to the focus area, interpolation processing can be performed on the temperature compensation coefficient index table to determine the temperature compensation coefficient that matches the current object distance. This further ensures the accuracy of temperature compensation and the focusing accuracy of depth focusing, and also reduces the data size of the temperature compensation coefficient index table, further reducing the computational complexity and resource consumption of temperature compensation, thereby further improving the efficiency of temperature compensation and the focusing speed of depth focusing.
[0025] Optionally, in another possible implementation of the first aspect, the aforementioned temperature compensation coefficient index table is generated in the following manner:
[0026] Obtain the test programming temperature corresponding to the test camera module in the test equipment;
[0027] Obtain the contrast-based focus position and depth-based focus position of the test camera module at N different reference object distances under M test temperatures, where M and N are both integers greater than 1;
[0028] Determine the temperature difference between each test temperature and the test programming temperature;
[0029] For the j-th reference object distance, based on the contrast focusing position and depth focusing position of the j-th test object at each of the M test temperatures, the test focusing position difference of the j-th test object at each test temperature is determined. Here, the j-th test object refers to the test object at the j-th reference object distance, and j is an integer greater than or equal to 1 and less than or equal to N.
[0030] Based on the difference in the test focus position of the j-th test object at each test temperature and the difference in test temperature between each test temperature and the test burning temperature, determine the reference temperature compensation coefficient corresponding to the j-th reference object distance;
[0031] A temperature compensation coefficient index table is generated based on the reference temperature compensation coefficients corresponding to N reference object distances.
[0032] Thus, by setting test objects at different reference distances and driving the test equipment to perform contrast-detection focusing and depth focusing on each test object at different test temperatures, the accurate contrast-detection focusing position and depth focusing position of the test equipment under different temperatures and object distances are obtained. Then, based on the difference between the contrast-detection focusing position and the depth focusing position corresponding to each reference object distance at each test temperature, and the temperature difference between each test temperature and the test burning temperature, the relationship between the temperature change of the camera module and the deviation of the depth focusing position is determined, i.e., the reference temperature compensation coefficient. Then, the reference temperature compensation coefficients corresponding to each reference object distance are used to construct a temperature compensation coefficient index table. By pre-establishing the temperature compensation coefficient index table, not only is the accuracy of temperature compensation guaranteed, but the focusing accuracy of depth focusing is further improved. Moreover, the temperature compensation process is simplified, further improving the efficiency of temperature compensation and the focusing speed of depth focusing.
[0033] Optionally, in another possible implementation of the first aspect, the determination of the reference temperature compensation coefficient corresponding to the j-th reference object distance based on the difference in the test focus position of the j-th test object at each test temperature and the test temperature difference between each test temperature and the test burning temperature includes:
[0034] Based on the difference in the test focus position of the j-th test object at each first test temperature and the difference in test temperature between each first test temperature and the test burning temperature, the first reference temperature compensation coefficient corresponding to the j-th reference object distance is determined. Here, the first test temperature refers to each test temperature that is less than or equal to the test burning temperature.
[0035] Based on the difference in the test focus position of the j-th test object at each second test temperature and the difference in test temperature between each second test temperature and the test burning temperature, the second reference temperature compensation coefficient corresponding to the j-th reference object distance is determined. Here, the second test temperature refers to each test temperature that is greater than the test burning temperature.
[0036] Thus, since the relationship between temperature fluctuation and depth focusing position deviation may differ when the real-time temperature of the camera module is higher or lower than its burning temperature, the temperature compensation coefficient index table can be established by determining the low-temperature compensation coefficient and high-temperature compensation coefficient (i.e., the first reference temperature compensation coefficient and the second reference temperature compensation coefficient) corresponding to each reference object distance based on the data collected when the test temperature is lower than or equal to the test burning temperature and the data collected when the test temperature is higher than the test burning temperature. This further improves the accuracy of temperature compensation and, consequently, the focusing accuracy of depth focusing.
[0037] Optionally, in another possible implementation of the first aspect, the aforementioned focus area includes a moving object; correspondingly, after determining the compensated target focus position based on the initial focus position and the focus position compensation value, the method further includes:
[0038] The target focus position is sent to the motor corresponding to the target camera module, so that the motor drives the target camera module to focus on the moving object.
[0039] In this way, by performing temperature compensation on the focus position of depth focusing, the focusing accuracy of depth focusing is improved, and the compensated target focus position is sent to the motor of the target camera module, enabling the motor to quickly and accurately push the target camera module to the focus position, so as to achieve fast and accurate focusing on moving objects in the focus area, thereby improving the tracking accuracy of moving objects and the image clarity, and further enhancing the user's shooting experience.
[0040] Secondly, embodiments of this application provide a temperature compensation device for depth focusing, comprising: a first acquisition module, configured to acquire, when a target camera module in a target device is performing depth focusing, the current temperature of the target camera module, the target burning temperature, and the current object distance corresponding to the focusing area, wherein the current object distance is measured by a depth laser device corresponding to the target camera module; a first determination module, configured to determine the initial focusing position corresponding to the focusing area based on the current object distance; a second determination module, configured to determine the focusing position compensation value corresponding to the target camera module based on the current temperature, the target burning temperature, and the current object distance; and a third determination module, configured to determine the compensated target focusing position based on the initial focusing position and the focusing position compensation value.
[0041] Thus, during depth focusing, the current focus position compensation value of the camera module is determined based on the current temperature of the camera module, the target burning temperature, and the current object distance corresponding to the focus area. This compensation value is then used to compensate for the initial focus position calculated by the depth focusing algorithm, resulting in an accurate target focus position. By identifying the focus position deviation caused by the difference between the current temperature of the camera module and the burning temperature at the current object distance, and compensating for this deviation to obtain the accurate focus position of the focus area, the impact of temperature fluctuations on depth focusing accuracy is eliminated, improving the focus accuracy of depth focusing, thereby enhancing the sharpness of the subject and improving the user's shooting experience.
[0042] In one possible implementation of the second aspect, the second determining module includes:
[0043] The first determining unit is used to determine the current temperature compensation coefficient corresponding to the target camera module based on the current temperature, the target burning temperature and the current object distance.
[0044] The second determining unit is used to determine the focus position compensation value based on the current temperature, the target burning temperature, and the current temperature compensation coefficient.
[0045] Therefore, since there is a linear relationship between the deviation in the depth focus position caused by temperature fluctuations and the amplitude of temperature fluctuations, the current temperature compensation coefficient for the camera module can be determined based on the current temperature of the camera module, the target burning temperature, and the current object distance. This coefficient represents the linear relationship between the current temperature fluctuation and the deviation in the focus position at the current object distance. Furthermore, based on the current temperature, the target burning temperature, and the current temperature compensation coefficient, the corresponding focus position compensation value for the camera module can be determined to compensate for the temperature at the depth focus position. Thus, by using the temperature compensation coefficient to represent the linear relationship between temperature change and focus position deviation, and determining the compensation value for the depth focus position based on the temperature compensation coefficient, not only is the focusing accuracy of depth focusing improved, but the processing and computation of temperature compensation are also simplified, further enhancing the efficiency of temperature compensation and the speed of depth focusing.
[0046] Optionally, in another possible implementation of the second aspect, the aforementioned second determining unit is specifically used for:
[0047] Determine the current temperature difference between the current temperature and the target programming temperature;
[0048] The focus position compensation value is determined by multiplying the current temperature difference by the current temperature compensation coefficient.
[0049] Thus, since there is a certain linear relationship between the deviation of the depth focus position caused by temperature fluctuation and the amplitude of temperature fluctuation, after determining the current temperature compensation coefficient representing this linear relationship, the current temperature difference between the current temperature of the camera module and the target burning temperature can be determined. Based on the product of the current temperature difference and the current temperature compensation coefficient, the corresponding focus position compensation value of the camera module can be determined. This not only improves the focusing accuracy of depth focus, but also simplifies the temperature compensation process and calculation, further improving the efficiency of temperature compensation and the speed of depth focus.
[0050] Optionally, in another possible implementation of the second aspect, the aforementioned first determining unit is specifically used for:
[0051] Obtain the temperature compensation coefficient index table corresponding to the target camera module. The temperature compensation coefficient index table includes the correspondence between multiple reference object distances and reference temperature compensation coefficients. Each reference object distance includes a first reference temperature compensation coefficient and a second reference temperature compensation coefficient.
[0052] Based on the current object distance, obtain the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance from the temperature compensation coefficient index table;
[0053] If the current temperature is less than or equal to the target burning temperature, the first temperature compensation coefficient is determined as the current temperature compensation coefficient.
[0054] If the current temperature is higher than the target burning temperature, the second temperature compensation coefficient will be determined as the current temperature compensation coefficient.
[0055] Thus, by pre-establishing a temperature compensation coefficient index table containing the correspondence between reference object distance and reference temperature compensation coefficient, and when performing depth focusing temperature compensation on the camera module, the temperature compensation coefficient matching the current temperature, target burning temperature, and current object distance is determined by looking up the table. Furthermore, when the current temperature is greater than the target burning temperature and less than or equal to the target burning temperature, different temperature compensation coefficients are used to perform temperature compensation on the depth focusing results, thereby further improving the accuracy of temperature compensation and thus further improving the focusing precision of depth focusing. Moreover, determining the temperature compensation coefficient by looking up the table further simplifies the processing of temperature compensation for depth focusing, thereby further improving the efficiency of temperature compensation and the focusing speed of depth focusing.
[0056] Optionally, in another possible implementation of the second aspect, the first determining unit is further configured to:
[0057] If the temperature compensation coefficient index table contains the current object distance, the first reference temperature compensation coefficient and the second reference temperature compensation coefficient corresponding to the current object distance in the temperature compensation coefficient index table are determined as the first temperature compensation coefficient and the second temperature compensation coefficient, respectively.
[0058] If the current object distance is not included in the temperature compensation coefficient index table, the temperature compensation coefficient index table is interpolated based on the current object distance to determine the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance.
[0059] Thus, since the actual object distance of the focus area changes randomly during actual shooting, and the temperature compensation coefficient index table may not contain the temperature compensation coefficients corresponding to all object distances, when the temperature compensation coefficient index table does not contain the current object distance corresponding to the focus area, interpolation processing can be performed on the temperature compensation coefficient index table to determine the temperature compensation coefficient that matches the current object distance. This further ensures the accuracy of temperature compensation and the focusing accuracy of depth focusing, and also reduces the data size of the temperature compensation coefficient index table, further reducing the computational complexity and resource consumption of temperature compensation, thereby further improving the efficiency of temperature compensation and the focusing speed of depth focusing.
[0060] Optionally, in another possible implementation of the second aspect, the aforementioned temperature compensation coefficient index table is generated in the following manner:
[0061] Obtain the test programming temperature corresponding to the test camera module in the test equipment;
[0062] Obtain the contrast-based focus position and depth-based focus position of the test camera module at N different reference object distances under M test temperatures, where M and N are both integers greater than 1;
[0063] Determine the temperature difference between each test temperature and the test programming temperature;
[0064] For the j-th reference object distance, based on the contrast focusing position and depth focusing position of the j-th test object at each of the M test temperatures, the test focusing position difference of the j-th test object at each test temperature is determined. Here, the j-th test object refers to the test object at the j-th reference object distance, and j is an integer greater than or equal to 1 and less than or equal to N.
[0065] Based on the difference in the test focus position of the j-th test object at each test temperature and the difference in test temperature between each test temperature and the test burning temperature, determine the reference temperature compensation coefficient corresponding to the j-th reference object distance;
[0066] A temperature compensation coefficient index table is generated based on the reference temperature compensation coefficients corresponding to N reference object distances.
[0067] Thus, by setting test objects at different reference distances and driving the test equipment to perform contrast-detection focusing and depth focusing on each test object at different test temperatures, the accurate contrast-detection focusing position and depth focusing position of the test equipment under different temperatures and object distances are obtained. Then, based on the difference between the contrast-detection focusing position and the depth focusing position corresponding to each reference object distance at each test temperature, and the temperature difference between each test temperature and the test burning temperature, the relationship between the temperature change of the camera module and the deviation of the depth focusing position is determined, i.e., the reference temperature compensation coefficient. Then, the reference temperature compensation coefficients corresponding to each reference object distance are used to construct a temperature compensation coefficient index table. By pre-establishing the temperature compensation coefficient index table, not only is the accuracy of temperature compensation guaranteed, but the focusing accuracy of depth focusing is further improved. Moreover, the temperature compensation process is simplified, further improving the efficiency of temperature compensation and the focusing speed of depth focusing.
[0068] Optionally, in another possible implementation of the second aspect, the determination of the reference temperature compensation coefficient corresponding to the j-th reference object distance based on the difference in the test focus position of the j-th test object at each test temperature and the test temperature difference between each test temperature and the test burning temperature includes:
[0069] Based on the difference in the test focus position of the j-th test object at each first test temperature and the difference in test temperature between each first test temperature and the test burning temperature, the first reference temperature compensation coefficient corresponding to the j-th reference object distance is determined. Here, the first test temperature refers to each test temperature that is less than or equal to the test burning temperature.
[0070] Based on the difference in the test focus position of the j-th test object at each second test temperature and the difference in test temperature between each second test temperature and the test burning temperature, the second reference temperature compensation coefficient corresponding to the j-th reference object distance is determined. Here, the second test temperature refers to each test temperature that is greater than the test burning temperature.
[0071] Thus, since the relationship between temperature fluctuation and depth focusing position deviation may differ when the real-time temperature of the camera module is higher or lower than its burning temperature, the temperature compensation coefficient index table can be established by determining the low-temperature compensation coefficient and high-temperature compensation coefficient (i.e., the first reference temperature compensation coefficient and the second reference temperature compensation coefficient) corresponding to each reference object distance based on the data collected when the test temperature is lower than or equal to the test burning temperature and the data collected when the test temperature is higher than the test burning temperature. This further improves the accuracy of temperature compensation and, consequently, the focusing accuracy of depth focusing.
[0072] Optionally, in another possible implementation of the second aspect, the above-mentioned apparatus further includes:
[0073] The focusing module is used to send the target focus position to the motor corresponding to the target camera module, so that the motor drives the target camera module to focus on the moving object.
[0074] In this way, by performing temperature compensation on the focus position of depth focusing, the focusing accuracy of depth focusing is improved, and the compensated target focus position is sent to the motor of the target camera module, enabling the motor to quickly and accurately push the target camera module to the focus position, so as to achieve fast and accurate focusing on moving objects in the focus area, thereby improving the tracking accuracy of moving objects and the image clarity, and further enhancing the user's shooting experience.
[0075] Thirdly, embodiments of this application provide an electronic device, including: one or more processors, and a memory; the memory is coupled to one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the temperature compensation method for depth focusing as described above.
[0076] Fourthly, embodiments of this application provide a chip system applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the temperature compensation method for depth focusing as described above.
[0077] Fifthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the temperature compensation method for depth focusing as described above.
[0078] Sixthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the temperature compensation method for depth focusing as described above.
[0079] The technical effects achieved by the second, third, fourth, fifth, and sixth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0080] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0081] Figure 1 This is a schematic flowchart of a temperature compensation method for depth focusing provided in an embodiment of this application;
[0082] Figure 2 This is a schematic diagram of the rear appearance of an electronic device provided in an embodiment of this application;
[0083] Figure 3 This is a schematic diagram of the front appearance of an electronic device provided in an embodiment of this application;
[0084] Figure 4 This is a schematic flowchart of a temperature compensation method for depth focusing provided in another embodiment of this application;
[0085] Figure 5 This is a fitting graph of the difference in focus position and the difference in temperature corresponding to a reference object distance provided in an embodiment of this application;
[0086] Figure 6 This is a schematic diagram illustrating the verification of depth focusing temperature compensation results provided in an embodiment of this application;
[0087] Figure 7 This is an overall data processing flowchart of the temperature compensation algorithm for depth focusing provided in one embodiment of this application;
[0088] Figure 8 This is an overall flowchart of the temperature compensation algorithm for depth focusing provided in another embodiment of this application;
[0089] Figure 9 This is a schematic diagram of the structure of a temperature compensation device for depth focusing provided in an embodiment of this application;
[0090] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0091] The following description, with reference to the accompanying drawings, details the temperature compensation method, apparatus, electronic device, chip system, storage medium, and computer program for depth focusing provided in this application.
[0092] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a temperature compensation method for depth focusing according to an embodiment of this application. The method may include some or all of the following:
[0093] Step 101: When the target camera module in the target device is performing depth focusing, obtain the current temperature of the target camera module, the target burning temperature, and the current object distance corresponding to the focusing area. The current object distance is measured by the depth laser device corresponding to the target camera module.
[0094] It should be noted that the temperature compensation method for depth focusing in this application embodiment can be executed by the temperature compensation device for depth focusing in this application embodiment. The temperature compensation device for depth focusing in this application embodiment can be configured in any electronic device with depth focusing functionality to execute the temperature compensation method for depth focusing in this application embodiment. For example, the temperature compensation device for depth focusing in this application embodiment can be configured in a mobile phone with a camera module having depth focusing functionality to perform temperature compensation on the depth focusing results in shooting scenarios where the mobile phone needs to perform depth focusing.
[0095] The target device can refer to an electronic device that is equipped with the temperature compensation method for depth focusing according to the embodiments of this application and that needs to perform depth focusing. For example, if a user opens the preview interface of a camera application on a mobile phone equipped with the temperature compensation method for depth focusing according to the embodiments of this application, and determines that a depth focusing algorithm is needed to focus based on the subject in the preview interface, then the mobile phone can be the target device in the embodiments of this application.
[0096] The target camera module can refer to the camera module in the target device that is currently performing a shooting task. For example, in the mobile phone example above, assuming the user is using the rear camera to take a picture, the target camera module could be the rear camera in the target device.
[0097] The depth laser device corresponding to the target camera module can refer to a depth laser device used in conjunction with the target camera module. For example, if the target device includes a front-facing camera and a rear-facing camera, depth laser devices can be installed near both the front-facing and rear-facing cameras to work with them respectively, enabling depth focusing functions of the front-facing and rear-facing cameras, or other functions of the electronic device (such as ranging).
[0098] For example, such as Figure 2The diagram shown is a rear view of an electronic device according to an embodiment of this application. The electronic device includes a flash, three rear cameras (rear camera 1, rear camera 2, and rear camera 3), and a depth laser device for ranging installed in the depth laser device mounting position 1. This depth laser device can work with any of the rear cameras in operation to achieve depth focusing. Figure 3 The diagram shown is a front view of an electronic device provided in an embodiment of this application. The electronic device includes a front-facing camera and a depth laser device for ranging is installed in the depth laser device mounting position. The depth laser device can cooperate with the front-facing camera to achieve depth focusing when the front-facing camera is working.
[0099] It should be noted that the depth laser device in the embodiments of this application can be any type of laser device capable of laser ranging, and the embodiments of this application are not limited thereto. For example, the depth laser device in the embodiments of this application can be a direct time of flight (dTOF) sensor.
[0100] The current temperature can refer to the real-time temperature of the target camera module when it is performing depth focusing.
[0101] One possible approach is to install a temperature sensor (such as a thermistor) near the target camera module to collect its current temperature in real time during use. As an example, since temperature fluctuations of the motor corresponding to the target camera module have a significant impact on the depth focusing position, a temperature sensor can be installed at the motor corresponding to the target camera module.
[0102] The target programming temperature can refer to the device temperature of the target camera module during installation and programming on the production line. It should be noted that the programming temperature of the target camera module can be stored in a register during production line installation, so that the target programming temperature can be directly read from the register during the use of the target camera module.
[0103] The current object distance corresponding to the focus area can refer to the distance between the object currently being focused by the target camera module and the target camera module.
[0104] In the embodiments of this application, phase detection autofocus (PDAF) can be used for focusing in some shooting scenarios. However, since phase detection autofocus requires individual pixel detection, it has higher requirements for lighting conditions. In low-light environments, the focusing speed of PDAF often slows down due to insufficient light in the focusing sampling area. In such cases, electronic devices can generally choose to use depth autofocus. Furthermore, in some shooting scenarios involving capturing or tracking moving objects, the high speed of the moving objects necessitates faster focusing. In these scenarios, depth autofocus is usually prioritized to improve focusing speed and thus ensure the sharpness of the moving objects. However, depth focusing requires the use of a depth laser device for distance measurement, and this device can easily cause the electronic device to overheat. Furthermore, the accuracy of the depth focusing algorithm is easily affected by temperature fluctuations, leading to out-of-focus images and blurry subjects. Therefore, when performing depth focusing on a target camera module in a target device, the current temperature of the target camera module can be collected by its corresponding temperature sensor. The burning temperature of the target camera module can be read from its corresponding register, and the depth laser device can be driven to perform distance measurement to determine the depth value of the focus area, i.e., the current object distance. Based on this data, temperature compensation can be performed on the focus position of depth focusing.
[0105] Step 102: Determine the initial focus position corresponding to the focus area based on the current object distance.
[0106] The initial focus position can refer to the depth focus position obtained by converting the current object distance corresponding to the focus area.
[0107] It should be noted that the focus position mentioned in the embodiments of this application can be used to represent the actual displacement of the motor corresponding to the target camera module when the lens group of the target camera module is pushed to the focus position; after further conversion of the focus position, the actual displacement of the motor can be obtained, and the actual displacement can be sent to the motor so that the motor can push the lens group of the target camera module according to the actual displacement.
[0108] In this embodiment of the application, after the current object distance corresponding to the focus area is measured by the depth laser device corresponding to the target camera module, the current object distance can be converted according to the depth focusing algorithm to generate the depth focusing position corresponding to the focus area, i.e., the initial focusing position.
[0109] It should be noted that in actual use, a suitable depth focusing algorithm can be selected to convert the current object distance into a depth focusing position according to actual needs and specific application scenarios. This application embodiment does not limit this.
[0110] Step 103: Determine the focus position compensation value corresponding to the target camera module based on the current temperature, target burning temperature and current object distance.
[0111] The focus position compensation value can refer to the deviation in depth focus position caused by the current temperature fluctuation of the target camera module.
[0112] In this embodiment, since the various components and depth focusing algorithms in the target camera module are calibrated based on the target burning temperature of the target camera module before the electronic device leaves the factory, when the current temperature of the target camera module is inconsistent with the target burning temperature, the initial focus position calculated by the depth focusing algorithm will be inaccurate. Furthermore, when the difference between the current temperature and the target burning temperature is the same but the current object distance is different, the offset of the depth focusing position caused by temperature fluctuation may also be different. Therefore, when compensating for the depth focusing position, the focus position compensation value corresponding to the target camera module can be determined based on the current temperature, the target burning temperature, and the current object distance of the target camera module.
[0113] As one possible approach, a focus position compensation model can be pre-trained to learn the relationship between the current temperature of the target camera module, the target burning temperature, the current object distance, and the focus position compensation value. Then, when performing depth focus temperature compensation, the current temperature of the target camera module, the target burning temperature, and the current object distance can be input into the pre-trained focus position compensation model, and the output of the focus position compensation model can be used as the focus position compensation value for the target camera module.
[0114] As one possible implementation, a focus position compensation value index table can be pre-established. This index table can contain the correspondence between real-time temperature, burning temperature, and object distance and the focus position compensation value. Therefore, after determining the current temperature, target burning temperature, and current object distance corresponding to the target camera module, the focus position compensation value matching the current temperature, target burning temperature, and current object distance can be determined by looking up the focus position compensation value index table, and used as the focus position compensation value corresponding to the target camera module.
[0115] It should be noted that the methods for determining the focus position compensation value listed above are merely exemplary and should not be considered as limitations on this application. In actual use, other suitable methods can be selected according to actual needs and specific application scenarios to determine the focus position compensation value corresponding to the target camera module, and this application embodiment does not limit this.
[0116] Step 104: Determine the compensated target focus position based on the initial focus position and the focus position compensation value.
[0117] In this embodiment of the application, after determining the focus position compensation value corresponding to the target camera module, the initial focus position can be compensated using the focus position compensation value to determine the compensated target focus position.
[0118] As one possible approach, the sum of the initial focus position and the focus position compensation value corresponding to the target camera module can be used to determine the compensated target focus position.
[0119] Furthermore, after temperature compensation for the focus position of depth focusing, the compensated target focus position can be sent to the motor of the target camera module, enabling the motor to quickly and accurately push the target camera module to the focus position. This achieves fast and accurate focusing on moving objects in the focus area, thereby improving the accuracy of tracking moving objects and the clarity of the image, further enhancing the user's shooting experience. In one possible implementation of this application embodiment, the focus area includes a moving object; correspondingly, after step 104, the following may also be included:
[0120] The target focus position is sent to the motor corresponding to the target camera module, so that the motor drives the target camera module to focus on the moving object.
[0121] As one possible approach, given the high focusing speed requirements in scenarios involving capturing or tracking moving objects, depth focusing is typically prioritized for focusing on the moving object. Therefore, when performing depth focusing on a moving object, after temperature compensation of the initial focus position obtained through depth focusing, an accurate depth focusing position is achieved. This compensated target focus position can then be sent to the corresponding motor in the target camera module, causing the motor to move according to the target focus position, thereby moving the lens assembly of the target camera module to the tracking focus position, allowing the target camera module to focus on the moving object. Alternatively, the target focus position can be converted to obtain the actual displacement of the motor, and this actual displacement can be sent to the motor, causing the motor to push the lens assembly of the target camera module to the focusing position according to this actual displacement, thus enabling the target camera module to focus on the moving object.
[0122] The temperature compensation method for depth focusing provided in this application determines the current focus position compensation value of the camera module based on the current temperature of the camera module, the target burning temperature, and the current object distance corresponding to the focus area during depth focusing. This compensation value is then used to compensate for the initial focus position calculated by the depth focusing algorithm, resulting in an accurate target focus position. Therefore, by determining the focus position deviation caused by the difference between the current temperature of the camera module and the burning temperature during camera module burning at the current object distance, and compensating for this deviation to obtain the accurate focus position of the focus area, the method eliminates the impact of temperature fluctuations on depth focusing accuracy, improves depth focusing accuracy, enhances the sharpness of the subject, and improves the user's shooting experience.
[0123] Please refer to Figure 4 , Figure 4 This is a flowchart illustrating a temperature compensation method for depth focusing according to another embodiment of this application. The method may include some or all of the following:
[0124] Step 401: When the target camera module in the target device is performing depth focusing, obtain the current temperature of the target camera module, the target burning temperature, and the current object distance corresponding to the focusing area. The current object distance is measured by the depth laser device corresponding to the target camera module.
[0125] Step 402: Determine the initial focus position corresponding to the focus area based on the current object distance.
[0126] The specific implementation process and principle of steps 401-402 above can be found in the detailed description of the above embodiments, and will not be repeated here.
[0127] Step 403: Determine the current temperature compensation coefficient corresponding to the target camera module based on the current temperature, target burning temperature and current object distance.
[0128] The current temperature compensation coefficient can be used to represent the linear relationship between the temperature change of the target camera module and the deviation of the depth focus position caused by the temperature change.
[0129] In this embodiment, because the deviation of the depth focus position caused by temperature fluctuations has a certain linear relationship with the amplitude of temperature fluctuations, the current temperature compensation coefficient of the camera module at the current object distance can be determined based on the current temperature of the camera module, the target burning temperature, and the current object distance. This coefficient represents the linear relationship between the current temperature fluctuation amplitude and the deviation of the depth focus position at the current object distance. Furthermore, the focus position compensation value corresponding to the camera module is determined based on the current temperature, the target burning temperature, and the current temperature compensation coefficient, thus performing temperature compensation for the depth focus position. Therefore, by using the temperature compensation coefficient to represent the linear relationship between temperature change and focus position deviation, and determining the compensation value for the depth focus position based on the temperature compensation coefficient, the focusing accuracy of depth focusing is improved, and the processing and calculation of temperature compensation are simplified, further enhancing the efficiency of temperature compensation and the speed of depth focusing.
[0130] As one possible approach, a temperature compensation coefficient prediction model can be pre-trained to learn the relationship between real-time temperature, burning temperature, object distance, and temperature compensation coefficient. Thus, when performing temperature compensation for depth focusing, the current temperature of the target camera module, the target burning temperature, and the current object distance can be input into the temperature compensation coefficient prediction model, and the output of the temperature compensation coefficient prediction model can be used as the current temperature compensation coefficient of the target camera module.
[0131] As one possible implementation, since the temperature compensation coefficient can be used to represent the linear relationship between temperature change and focus position deviation, a temperature compensation coefficient prediction model can be pre-trained to predict the difference between the real-time temperature and the burning temperature, as well as the relationship between the object distance and the temperature compensation coefficient. That is, the trained temperature compensation coefficient prediction model can predict the current temperature compensation coefficient corresponding to the target camera module based on the difference between the real-time temperature and the burning temperature, and the object distance. Therefore, the difference between the current temperature and the target burning temperature can be determined first based on the current temperature of the target camera module and the target burning temperature. This difference, along with the current object distance, is then input into the temperature compensation coefficient prediction model, and the output of the model is used as the current temperature compensation coefficient.
[0132] As one possible implementation, a temperature compensation coefficient index table containing the correspondence between reference object distance and reference temperature compensation coefficient can be pre-established. When performing depth focusing temperature compensation on the camera module, the temperature compensation coefficient matching the current temperature, target burning temperature, and current object distance can be determined by looking up the table. Furthermore, different temperature compensation coefficients are used to compensate the depth focusing result when the current temperature is greater than or less than or equal to the target burning temperature, thereby further improving the accuracy of temperature compensation and thus further improving the focusing precision of depth focusing. Determining the temperature compensation coefficient by looking up the table further simplifies the depth focusing temperature compensation process, thereby further improving the efficiency of temperature compensation and the focusing speed of depth focusing. That is, in one possible implementation of this application embodiment, step 403 above may include:
[0133] Obtain the temperature compensation coefficient index table corresponding to the target camera module. The temperature compensation coefficient index table includes the correspondence between multiple reference object distances and reference temperature compensation coefficients. Each reference object distance includes a first reference temperature compensation coefficient and a second reference temperature compensation coefficient.
[0134] Based on the current object distance, obtain the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance from the temperature compensation coefficient index table;
[0135] If the current temperature is less than or equal to the target burning temperature, the first temperature compensation coefficient is determined as the current temperature compensation coefficient.
[0136] If the current temperature is higher than the target burning temperature, the second temperature compensation coefficient will be determined as the current temperature compensation coefficient.
[0137] The reference object distance can refer to the various object distances included in the temperature compensation coefficient index table.
[0138] The reference temperature compensation coefficient can refer to the temperature compensation coefficient corresponding to each object distance included in the temperature compensation coefficient index table.
[0139] The first reference temperature compensation coefficient can be the temperature compensation coefficient applicable when the current temperature of the target camera module is less than or equal to the target burning temperature; the second reference temperature compensation coefficient can be the temperature compensation coefficient applicable when the current temperature of the target camera module is greater than the target burning temperature.
[0140] It should be noted that since the temperature change and the focus position deviation of depth focusing may satisfy different linear relationships in the low temperature range (i.e., the real-time temperature of the camera module is less than or equal to the burning temperature) and the high temperature range (i.e., the real-time temperature of the camera module is greater than the burning temperature), the real-time temperature of the camera module can be divided into two temperature ranges, a low temperature range and a high temperature range, according to the target burning temperature. The low temperature compensation coefficient (i.e., the first reference temperature compensation coefficient) and the high temperature compensation coefficient (i.e., the second reference temperature compensation coefficient) corresponding to each reference object distance can be determined to further improve the accuracy of depth focusing temperature compensation, thereby further improving the focusing accuracy of depth focusing.
[0141] In one possible implementation of this application embodiment, a temperature compensation coefficient index table can be pre-established and stored in the target device before it leaves the factory. Therefore, when performing depth focusing temperature compensation, the temperature compensation coefficient index table corresponding to the target camera module can be directly obtained. Since the temperature compensation coefficient index table contains multiple correspondences between reference object distances and the first and second reference temperature compensation coefficients, the first and second temperature compensation coefficients corresponding to the current object distance can be obtained from the temperature compensation coefficient index table based on the current object distance corresponding to the focusing area. Then, based on the relationship between the current temperature of the target camera module and the target burning temperature, the determined first or second temperature compensation coefficient can be used as the current temperature compensation coefficient. That is, when the current temperature of the target camera module is less than or equal to the target burning temperature (i.e., the current temperature is in the low-temperature range), the first temperature compensation coefficient is determined as the current temperature compensation coefficient; when the current temperature of the target camera module is greater than the target burning temperature (i.e., the current temperature is in the high-temperature range), the second temperature compensation coefficient is determined as the current temperature compensation coefficient.
[0142] For example, as shown in Table 1, this is an example of a temperature compensation coefficient index table provided in an embodiment of this application. This index table includes a first reference temperature compensation coefficient (slope1) and a second reference temperature compensation coefficient (slope2) corresponding to reference object distances of 15, 25, 50, 100, and 300 (unit: cm). Assuming the current object distance corresponding to the focusing area is 50 cm, the current temperature of the target camera module is 35°C, and the target burning temperature is 30°C, then slope1 and slope2 corresponding to the reference object distance of 50 cm in Table 1 can be determined as the first temperature compensation coefficient and the second temperature compensation coefficient, respectively, based on the current object distance. Furthermore, since the current temperature is greater than the target burning temperature, the second temperature compensation coefficient (i.e., slope2 corresponding to the reference object distance of 50 cm) can be determined as the current temperature compensation coefficient.
[0143] It should be noted that T in Table 1 represents the real-time temperature and T0 represents the burning temperature. Furthermore, T and T0 do not represent the real-time temperature and burning temperature of a specific camera module (including the target camera module and the camera module used when establishing the temperature compensation coefficient index table). They are only used to distinguish the applicable scenarios of slope1 and slope2 corresponding to each reference object distance. That is, slope1 is applicable to scenarios where the current temperature of the target camera module is less than or equal to the target burning temperature, and slope2 is applicable to scenarios where the current temperature of the target camera module is greater than the target burning temperature.
[0144] Table 1
[0145]
[0146] It should be noted that when the target device contains multiple camera modules, each camera module can use the same temperature compensation coefficient index table, or different temperature compensation coefficient index tables can be constructed for the performance of each camera module (such as zoom range). This application embodiment does not limit this.
[0147] Furthermore, since the actual object distance in the focus area changes randomly during actual shooting, and the temperature compensation coefficient index table may not contain temperature compensation coefficients corresponding to all object distances, when the temperature compensation coefficient index table does not contain the current object distance corresponding to the focus area, interpolation processing can be performed on the temperature compensation coefficient index table to determine the temperature compensation coefficient matching the current object distance. This further ensures the accuracy of temperature compensation and the focusing accuracy of depth focusing, and reduces the data size of the temperature compensation coefficient index table, further reducing the computational complexity and resource consumption of temperature compensation, thereby further improving the efficiency of temperature compensation and the focusing speed of depth focusing. That is, in one possible implementation of the embodiments of this application, the above-mentioned obtaining the first temperature compensation coefficient and the second temperature compensation coefficient matching the current object distance from the temperature compensation coefficient index table according to the current object distance may include:
[0148] If the temperature compensation coefficient index table contains the current object distance, the first reference temperature compensation coefficient and the second reference temperature compensation coefficient corresponding to the current object distance in the temperature compensation coefficient index table are determined as the first temperature compensation coefficient and the second temperature compensation coefficient, respectively.
[0149] If the current object distance is not included in the temperature compensation coefficient index table, the temperature compensation coefficient index table is interpolated based on the current object distance to determine the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance.
[0150] As one possible implementation, if the temperature compensation coefficient index table contains a reference object distance equal to the current object distance, then the first reference temperature compensation coefficient and the second reference temperature compensation coefficient corresponding to that reference object distance can be determined as the first temperature compensation coefficient and the second temperature compensation coefficient matching the current object distance, respectively. If the temperature compensation coefficient index table does not contain a reference object distance equal to the current object distance, then interpolation can be performed based on each reference object distance and its corresponding first reference temperature compensation coefficient, as well as the current object distance, to determine the first temperature compensation coefficient corresponding to the current object distance. And interpolation can be performed based on each reference object distance and its corresponding second reference temperature compensation coefficient, as well as the current object distance, to determine the second temperature compensation coefficient corresponding to the current object distance.
[0151] It should be noted that in actual use, an appropriate interpolation algorithm (such as linear interpolation) can be selected to interpolate the index table according to actual needs and specific application scenarios to determine the first temperature compensation coefficient and the second temperature compensation coefficient. This application embodiment does not limit this.
[0152] Furthermore, when constructing the temperature compensation coefficient index table, test objects can be set at different reference object distances, and the test equipment can be driven to perform contrast focusing and depth focusing on each test object at different test temperatures. This allows for obtaining the accurate contrast focusing and depth focusing positions of the test equipment at different temperatures and object distances. Then, based on the difference between the contrast focusing and depth focusing positions corresponding to each reference object distance at each test temperature, and the temperature difference between each test temperature and the test burning temperature, the relationship between the temperature change of the camera module and the deviation of the depth focusing position is determined, i.e., the reference temperature compensation coefficient. The reference temperature compensation coefficients corresponding to each reference object distance are then used to construct the temperature compensation coefficient index table. By pre-establishing the temperature compensation coefficient index table, not only is the accuracy of temperature compensation ensured, but the focusing accuracy of depth focusing is further improved. Furthermore, the temperature compensation process is simplified, further improving the efficiency of temperature compensation and the focusing speed of depth focusing. In one possible implementation of this application embodiment, the above-mentioned temperature compensation coefficient index table can be generated in the following way:
[0153] Obtain the test programming temperature corresponding to the test camera module in the test equipment;
[0154] Obtain the contrast-based focus position and depth-based focus position of the test camera module at N different reference object distances under M test temperatures, where M and N are both integers greater than 1;
[0155] Determine the temperature difference between each test temperature and the test programming temperature;
[0156] For the j-th reference object distance, based on the contrast focusing position and depth focusing position of the j-th test object at each of the M test temperatures, the test focusing position difference of the j-th test object at each test temperature is determined. Here, the j-th test object refers to the test object at the j-th reference object distance, and j is an integer greater than or equal to 1 and less than or equal to N.
[0157] Based on the difference in the test focus position of the j-th test object at each test temperature and the difference in test temperature between each test temperature and the test burning temperature, determine the reference temperature compensation coefficient corresponding to the j-th reference object distance;
[0158] A temperature compensation coefficient index table is generated based on the reference temperature compensation coefficients corresponding to N reference object distances.
[0159] Among them, the testing equipment can refer to electronic devices used to collect data during the process of constructing the temperature compensation coefficient index table.
[0160] Among them, the test camera module can refer to the camera module in the test equipment used to collect data.
[0161] The test programming temperature refers to the device temperature of the test camera module during installation and programming on the production line. It should be noted that the programming temperature corresponding to the test camera module can be stored in a register during production line installation, so that the test programming temperature can be directly read from the register during the use of the test camera module.
[0162] The test temperature can be the real-time temperature of the test camera module that is pre-selected and required to be used for data acquisition with the test equipment.
[0163] As an example, the test equipment can be frozen for a period of time until its temperature drops to a certain level (such as 0℃, -10℃, -20℃, etc.) and then taken out. During the heating process of the test equipment, the real-time temperature of the test camera module is collected, and the test camera is driven to collect data when the real-time temperature of the test camera module reaches the selected test temperatures.
[0164] For example, the test temperature can be selected in the temperature range [0℃, 50℃] with a step size of 1℃, with 51 test temperatures (0℃, 1℃, ..., 49℃, 50℃).
[0165] The reference object distance refers to the pre-selected distance between the test object and the test camera module during data acquisition using the test equipment. As an example, the reference object distance can vary depending on the type of test camera module. For instance, when the test camera module is a main camera, the selected reference object distances can be 15, 25, 50, 100, and 300 cm, meaning the test object can be placed sequentially at distances of 15cm, 25cm, 50cm, 100cm, and 300cm from the test camera module during data acquisition. Similarly, when the test camera module is a telephoto camera, the selected reference object distances can also be 15, 25, 50, 100, 300, and 500 cm, meaning the test object can be placed sequentially at distances of 15cm, 25cm, 50cm, 100cm, 300cm, and 50cm from the test camera module during data acquisition.
[0166] It should be noted that the specific values and quantities of the test temperatures, as well as the specific values and quantities of the reference object distances, can be determined according to actual needs and specific application scenarios. That is, the values of M and N can be determined according to actual needs and specific application scenarios, and this application embodiment does not limit them. Furthermore, the temperature compensation coefficient index table constructed using different types of test camera modules can be used for depth focusing temperature compensation of corresponding types of target camera modules; for example, if the test camera module is a telephoto camera, the temperature compensation coefficient index table generated using the data collected by the test camera module can be used for depth focusing temperature compensation of the telephoto camera.
[0167] The test object can be a test board of a type such as a checkerboard.
[0168] The contrast-detection autofocus position corresponding to the test object can refer to the focus position obtained by driving the test camera module to focus using contrast-detection autofocus. It should be noted that because the contrast-detection autofocus position has high accuracy, it can be used as an accurate focus position to measure the offset of the depth focus position.
[0169] As one possible implementation, to make the obtained contrast-detection focusing position more accurate, the search step size of the test camera module can be reduced, and the size ratio of the focus area corresponding to the test object to the original image data acquired by the test camera module can be adjusted. For example, the size ratio of the focus area corresponding to the test object to the original image data can be 0.1 × 0.1. Furthermore, when driving the test camera module to perform contrast-detection focusing on the test object, the motor search step size of the test camera module can be driven to traverse the motor stroke along the test object, so that the motor moves from near focus to far focus, thereby determining the contrast-detection focusing position of the test camera module on the test object.
[0170] The depth focus position corresponding to the test object can refer to the focus position generated by converting the object distance measured by the depth device of the test camera module.
[0171] As one possible implementation, during data acquisition, for N reference object distances, the test object can be placed at the first reference object distance. When the temperature of the test camera module reaches the first test temperature, the test camera module is driven to perform contrast-detection focusing and depth focusing on the first test object to determine the contrast-detection focusing position and depth focusing position of the test camera module on the first test object at the first test temperature. Then, when the temperature of the test camera module reaches the second test temperature, the test camera module is driven to perform contrast-detection focusing and depth focusing on the first test object again to determine the contrast-detection focusing position and depth focusing position of the test camera module on the first test object at the second test temperature. This process is repeated until M test temperatures are traversed, thus determining the contrast-detection focusing position and depth focusing position of the test camera module on the first test object at each of the M test temperatures. Next, the test object is placed at the second reference object distance, and the contrast focusing position and depth focusing position of the test camera module for the second test object at M test temperatures are determined in the same way as above; and so on, until N reference object distances are traversed, then the data acquisition is completed.
[0172] After data acquisition is complete, for a given reference object distance, M sets of contrast-detection focus positions and depth focus positions can be acquired. That is, each test temperature corresponds to one set of contrast-detection focus positions and depth focus positions. Then, the differences between the contrast-detection focus positions and depth focus positions corresponding to each test temperature, as well as the differences between each test temperature and the test burning temperature, can be fitted to obtain a linear relationship between the focus position difference and the temperature difference, thereby determining the reference temperature compensation coefficient corresponding to that reference object distance. Similarly, by fitting the M sets of contrast-detection focus positions and depth focus positions corresponding to each reference object distance in the same way, N reference temperature compensation coefficients can be obtained for each reference object distance. Finally, a temperature compensation coefficient index table can be constructed using the reference temperature compensation coefficients corresponding to the N reference object distances.
[0173] Furthermore, since the relationship between temperature fluctuation and depth focusing position deviation may differ when the real-time temperature of the camera module is higher or lower than its burning temperature, the temperature compensation coefficient index table can be established by determining the low-temperature compensation coefficient and high-temperature compensation coefficient (i.e., the first reference temperature compensation coefficient and the second reference temperature compensation coefficient) corresponding to each reference object distance based on data collected when the test temperature is lower than or equal to the test burning temperature and data collected when the test temperature is higher than the test burning temperature, respectively. This further improves the accuracy of temperature compensation and thus further improves the focusing accuracy of depth focusing. In one possible implementation of this application embodiment, the determination of the reference temperature compensation coefficient corresponding to the j-th reference object distance based on the test focusing position difference of the j-th test object at each test temperature and the test temperature difference between each test temperature and the test burning temperature includes:
[0174] Based on the difference in the test focus position of the j-th test object at each first test temperature and the difference in test temperature between each first test temperature and the test burning temperature, the first reference temperature compensation coefficient corresponding to the j-th reference object distance is determined. Here, the first test temperature refers to each test temperature that is less than or equal to the test burning temperature.
[0175] Based on the difference in the test focus position of the j-th test object at each second test temperature and the difference in test temperature between each second test temperature and the test burning temperature, the second reference temperature compensation coefficient corresponding to the j-th reference object distance is determined. Here, the second test temperature refers to each test temperature that is greater than the test burning temperature.
[0176] As one possible implementation, to improve the reliability of the temperature compensation coefficient index table, the temperature range can be divided into a low-temperature range and a high-temperature range based on the test burning temperature of the test camera module. When determining the reference temperature compensation coefficient, for a given reference object distance, the differences between the contrast-detection focusing positions and depth focusing positions collected within the low-temperature range, and the differences between each test temperature and the target burning temperature within the low-temperature range, can be fitted to obtain a linear relationship between the focusing position difference and the temperature difference within the low-temperature range, thereby determining the low-temperature compensation coefficient (i.e., the first reference temperature compensation coefficient) corresponding to that reference object distance. Similarly, the differences between the contrast-detection focusing positions and depth focusing positions collected within the high-temperature range, and the differences between each test temperature and the target burning temperature within the high-temperature range, can be fitted to obtain a linear relationship between the focusing position difference and the temperature difference within the high-temperature range, thereby determining the high-temperature compensation coefficient (i.e., the second reference temperature compensation coefficient) corresponding to that reference object distance.
[0177] For example, such as Figure 5 The image shows a fitted graph of the focus position difference and temperature difference corresponding to a reference object distance of 500cm. The vertical axis represents the difference Δcode between the contrast-detection focus position and the depth-detection focus position, and the horizontal axis represents the test temperature in °C. The test burning temperature was 30°C. Figure 5 As can be seen, there is a fitting curve 501 in the low temperature range where the test temperature is less than or equal to 30℃, and a fitting curve 502 in the high temperature range where the test temperature is greater than 30℃. The slope of the fitting curve 501 is the first reference temperature compensation coefficient corresponding to the reference object distance of 500cm, and the slope of the fitting curve 502 is the second reference temperature compensation coefficient corresponding to the reference object distance of 500cm.
[0178] It should be noted that, Figure 5 The fitting graphs shown are merely illustrative; fitting graphs for other reference object distances are not shown and should not be considered as limitations on this application. In actual use, the first reference temperature compensation coefficient and the second reference temperature compensation coefficient corresponding to a reference object distance may also be the same, that is, the fitting graph corresponding to the reference object distance is fitted to a straight line over the entire temperature range. This application does not limit this aspect.
[0179] Step 404: Determine the focus position compensation value based on the current temperature, the target burning temperature, and the current temperature compensation coefficient.
[0180] As one possible implementation, since the temperature compensation coefficient is used to represent the linear relationship between the amount of temperature change and the resulting deviation in the depth focus position, after determining the current temperature compensation coefficient representing this linear relationship, the current temperature difference between the current temperature of the camera module and the target burning temperature can be determined. Based on the product of the current temperature difference and the current temperature compensation coefficient, the corresponding focus position compensation value for the camera module is determined. This not only improves the focusing accuracy of depth focusing but also simplifies the temperature compensation process and computational load, further improving the efficiency of temperature compensation and the speed of depth focusing. That is, in one possible implementation of this application embodiment, step 404 above may include:
[0181] Determine the current temperature difference between the current temperature and the target programming temperature;
[0182] The focus position compensation value is determined by multiplying the current temperature difference by the current temperature compensation coefficient.
[0183] As an example, the product of the current temperature difference between the current temperature and the target burning temperature and the current temperature compensation coefficient can be used to determine the focus position compensation value corresponding to the target camera module. That is, the focus position compensation value can be determined by the following formula:
[0184] Δcode = slope × (T - T0)
[0185] Where Δcode is the focus position compensation value corresponding to the target camera module, slope is the current temperature compensation coefficient, T is the current temperature corresponding to the target camera module, and T0 is the target burning temperature corresponding to the target camera module.
[0186] For example, such as Figure 6 The diagram shown is a verification schematic of the depth focusing temperature compensation result provided in an embodiment of this application. The horizontal axis represents temperature in °C, and the vertical axis represents the absolute value of the difference between the depth focusing position and the contrast focusing position (curve 601). Curve 601 shows the change of the absolute value of the difference between the depth focusing position and the contrast focusing position before temperature compensation with temperature. Curve 602 shows the absolute value of the difference between the depth focusing position and the contrast focusing position after temperature compensation. Figure 6 As can be seen, the difference between the depth focus position and the contrast focus position after temperature compensation is significantly reduced, verifying that the temperature compensation method for depth focusing in this embodiment can effectively improve the focusing accuracy of depth focusing.
[0187] It should be noted that the method used to generate Figure 6 The device used to demonstrate the verification results can be the target device, the test device, or any other device equipped with the temperature compensation method for depth focusing according to the embodiments of this application. The embodiments of this application do not limit this.
[0188] The other specific implementation processes and principles of step 404 can be found in the detailed description of the above embodiments, and will not be repeated here.
[0189] Step 405: Determine the compensated target focus position based on the initial focus position and the focus position compensation value.
[0190] As one possible implementation, the sum of the initial focus position and the focus position compensation value can be used to determine the compensated target focus position. That is, the target focus position can be determined by the following formula:
[0191] code = depth2code + Δcode
[0192] Where code is the target focus position, depth2code is the initial focus position, and Δcode is the focus position compensation value.
[0193] Other specific implementation processes and principles of step 405 above can be found in the detailed description of the above embodiments, and will not be repeated here.
[0194] Figure 7A flowchart illustrating the overall data processing flow of a temperature compensation algorithm for depth focusing provided in an embodiment of this application is shown below. Figure 7 The overall process of the temperature compensation algorithm in the embodiments of this application will be explained as follows:
[0195] The process involves several steps: First, the image sensor acquires raw image data and transmits it to the image signal processing front end (IFE). After processing by the IFE, the raw image data is transmitted to the image signal processing post end (IPE) and the autofocus (AF) module. The IPE processes the image data and transmits it to the super image technology node (SITNode). The SITNode then transmits the image data to the image detection algorithm to detect the focus area within the image data, which is then transmitted to the AF module. Next, the depth laser device corresponding to the image sensor transmits the acquired ranging data via the lightweight IFE (IFElite) node and the depth node to the non-camera sensor (NCS) processing node to obtain the current object distance to the focus area, which is then transmitted to the AF module. Finally, the AF module acquires the current temperature of the target camera module and the target burning temperature. Based on the acquired current object distance, image data, and focus area data, it performs temperature compensation on the depth focus position and sends the temperature-compensated target focus position to the motor to achieve automatic depth focusing.
[0196] As an example, the AF module can perform actions such as Figure 8 The process shown demonstrates temperature compensation for depth focusing and automatic depth focusing of the focusing area. First, the AF module obtains the current object distance corresponding to the focusing area through a depth laser device, and acquires the target burning temperature and current temperature of the target camera module. Then, based on the temperature compensation coefficient index table, it determines the first and second temperature compensation coefficients corresponding to the current object distance. Furthermore, when the current temperature is less than or equal to the target burning temperature, the first temperature compensation coefficient is determined as the current temperature compensation coefficient; when the current temperature is greater than the target burning temperature, the second temperature compensation coefficient is determined as the current temperature compensation coefficient. Next, the focus position compensation value is calculated: Δcode = slope × (T - T0). Then, the target focus position is calculated: code = depth²code + Δcode, and the target focus position is sent to the motor to drive the motor to push the lens group of the target camera module to the focusing position.
[0197] It should be noted that Figure 7 and Figure 8Other specific implementation processes and principles can be found in the detailed description of the foregoing embodiments, and will not be repeated here.
[0198] The temperature compensation method for depth focusing provided in this application embodiment has a linear relationship between the deviation of the depth focusing position caused by temperature fluctuations and the amplitude of temperature fluctuations. Therefore, based on the current temperature of the camera module, the target burning temperature, and the current object distance, a current temperature compensation coefficient corresponding to the camera module can be determined. This coefficient represents the linear relationship between the current temperature fluctuation and the deviation of the focusing position at the current object distance. Furthermore, based on the current temperature, the target burning temperature, and the current temperature compensation coefficient, a compensation value for the focusing position of the camera module is determined to compensate for the temperature at the depth focusing position. Thus, by using the temperature compensation coefficient to represent the linear relationship between temperature change and focusing position deviation, and determining the compensation value for the depth focusing position based on the temperature compensation coefficient, the focusing accuracy of depth focusing is improved, the temperature compensation process and computational workload are simplified, and the efficiency of temperature compensation and the speed of depth focusing are further enhanced.
[0199] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0200] Corresponding to the temperature compensation method for depth focusing described in the above embodiments, Figure 9 A structural block diagram of the temperature compensation device for depth focusing provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0201] Reference Figure 9 The device 90 includes:
[0202] The first acquisition module 91 is used to acquire the current temperature of the target camera module, the target burning temperature, and the current object distance corresponding to the focusing area when the target camera module in the target device is performing depth focusing. The current object distance is measured by the depth laser device corresponding to the target camera module.
[0203] The first determining module 92 is used to determine the initial focusing position corresponding to the focusing area based on the current object distance;
[0204] The second determining module 93 is used to determine the focus position compensation value corresponding to the target camera module based on the current temperature, the target burning temperature and the current object distance;
[0205] The third determining module 94 is used to determine the compensated target focus position based on the initial focus position and the focus position compensation value.
[0206] In practical use, the temperature compensation device for depth focusing provided in this application embodiment can be configured in any electronic device to perform the aforementioned temperature compensation method for depth focusing.
[0207] The temperature compensation device for depth focusing provided in this application determines the current focus position compensation value of the camera module based on the current temperature of the camera module, the target burning temperature, and the current object distance corresponding to the focus area during depth focusing. It then compensates for the initial focus position calculated by the depth focusing algorithm based on this compensation value to obtain an accurate target focus position. Thus, by determining the focus position deviation caused by the difference between the current temperature of the camera module and the burning temperature during camera module burning at the current object distance, and compensating for this focus position deviation to obtain the accurate focus position of the focus area, the device eliminates the impact of temperature fluctuations on depth focusing accuracy, improves depth focusing accuracy, enhances the sharpness of the subject being photographed, and improves the user's shooting experience.
[0208] In one possible implementation of this application, the second determining module 93 includes:
[0209] The first determining unit is used to determine the current temperature compensation coefficient corresponding to the target camera module based on the current temperature, the target burning temperature and the current object distance.
[0210] The second determining unit is used to determine the focus position compensation value based on the current temperature, the target burning temperature, and the current temperature compensation coefficient.
[0211] Furthermore, in another possible implementation of this application, the aforementioned second determining unit is specifically used for:
[0212] Determine the current temperature difference between the current temperature and the target programming temperature;
[0213] The focus position compensation value is determined by multiplying the current temperature difference by the current temperature compensation coefficient.
[0214] Furthermore, in another possible implementation of this application, the aforementioned first determining unit is specifically used for:
[0215] Obtain the temperature compensation coefficient index table corresponding to the target camera module. The temperature compensation coefficient index table includes the correspondence between multiple reference object distances and reference temperature compensation coefficients. Each reference object distance includes a first reference temperature compensation coefficient and a second reference temperature compensation coefficient.
[0216] Based on the current object distance, obtain the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance from the temperature compensation coefficient index table;
[0217] If the current temperature is less than or equal to the target burning temperature, the first temperature compensation coefficient is determined as the current temperature compensation coefficient.
[0218] If the current temperature is higher than the target burning temperature, the second temperature compensation coefficient will be determined as the current temperature compensation coefficient.
[0219] Furthermore, in yet another possible implementation of this application, the aforementioned first determining unit is further configured to:
[0220] If the temperature compensation coefficient index table contains the current object distance, the first reference temperature compensation coefficient and the second reference temperature compensation coefficient corresponding to the current object distance in the temperature compensation coefficient index table are determined as the first temperature compensation coefficient and the second temperature compensation coefficient, respectively.
[0221] If the current object distance is not included in the temperature compensation coefficient index table, the temperature compensation coefficient index table is interpolated based on the current object distance to determine the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance.
[0222] Furthermore, in yet another possible implementation of this application, the aforementioned temperature compensation coefficient index table is generated in the following manner:
[0223] Obtain the test programming temperature corresponding to the test camera module in the test equipment;
[0224] Obtain the contrast-based focus position and depth-based focus position of the test camera module at N different reference object distances under M test temperatures, where M and N are both integers greater than 1;
[0225] Determine the temperature difference between each test temperature and the test programming temperature;
[0226] For the j-th reference object distance, based on the contrast focusing position and depth focusing position of the j-th test object at each of the M test temperatures, the test focusing position difference of the j-th test object at each test temperature is determined. Here, the j-th test object refers to the test object at the j-th reference object distance, and j is an integer greater than or equal to 1 and less than or equal to N.
[0227] Based on the difference in the test focus position of the j-th test object at each test temperature and the difference in test temperature between each test temperature and the test burning temperature, determine the reference temperature compensation coefficient corresponding to the j-th reference object distance;
[0228] A temperature compensation coefficient index table is generated based on the reference temperature compensation coefficients corresponding to N reference object distances.
[0229] Furthermore, in another possible implementation of this application, the determination of the reference temperature compensation coefficient corresponding to the j-th reference object distance based on the difference in the test focus position of the j-th test object at each test temperature and the test temperature difference between each test temperature and the test burning temperature includes:
[0230] Based on the difference in the test focus position of the j-th test object at each first test temperature and the difference in test temperature between each first test temperature and the test burning temperature, the first reference temperature compensation coefficient corresponding to the j-th reference object distance is determined. Here, the first test temperature refers to each test temperature that is less than or equal to the test burning temperature.
[0231] Based on the difference in the test focus position of the j-th test object at each second test temperature and the difference in test temperature between each second test temperature and the test burning temperature, the second reference temperature compensation coefficient corresponding to the j-th reference object distance is determined. Here, the second test temperature refers to each test temperature that is greater than the test burning temperature.
[0232] Furthermore, in another possible implementation of this application, the aforementioned device 90 further includes:
[0233] The focusing module is used to send the target focus position to the motor corresponding to the target camera module, so that the motor drives the target camera module to focus on the moving object.
[0234] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0235] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0236] To implement the above embodiments, this application also proposes an electronic device.
[0237] Figure 10 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.
[0238] See Figure 10 The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0239] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0240] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0241] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0242] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0243] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0244] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0245] The charging management module 140 is used to receive charging input from the charger. The charger can be a wireless charger or a wired charger.
[0246] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0247] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0248] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on electronic devices 100.
[0249] A modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal.
[0250] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0251] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is an integer greater than 1.
[0252] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0253] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, and the image sensor transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 193.
[0254] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0255] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions, such as saving music, video, and other files on the external memory card.
[0256] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0257] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D and application processor.
[0258] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F for distance measurement to achieve rapid depth focusing.
[0259] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0260] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0261] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the temperature compensation method for depth focusing in the embodiments of this application, and will not be repeated here.
[0262] This application also provides a chip system for use in an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to perform the steps in the above-described method embodiments.
[0263] This application also provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the steps described in the various method embodiments above.
[0264] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform the steps described in the various method embodiments above.
[0265] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0266] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0267] In the above embodiments, specific details such as particular system structures and techniques have been set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary details.
[0268] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0269] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0270] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0271] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0272] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0273] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0274] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0275] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0276] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A temperature compensation method for depth focusing, characterized in that, include: When the target camera module in the target device is performing depth focusing, the current temperature, target burning temperature and current object distance corresponding to the focus area of the target camera module are obtained, wherein the current object distance is measured by the depth laser device corresponding to the target camera module. Based on the current object distance, determine the initial focus position corresponding to the focus area; Based on the current temperature, the target burning temperature, and the current object distance, determine the focus position compensation value corresponding to the target camera module; The compensated target focus position is determined based on the initial focus position and the focus position compensation value.
2. The method as described in claim 1, characterized in that, The step of determining the focus position compensation value corresponding to the target camera module based on the current temperature, the target burning temperature, and the current object distance includes: Based on the current temperature, the target burning temperature, and the current object distance, determine the current temperature compensation coefficient corresponding to the target camera module; The focus position compensation value is determined based on the current temperature, the target burning temperature, and the current temperature compensation coefficient.
3. The method as described in claim 2, characterized in that, The step of determining the focus position compensation value based on the current temperature, the target burning temperature, and the current temperature compensation coefficient includes: Determine the current temperature difference between the current temperature and the target programming temperature; The focus position compensation value is determined by multiplying the current temperature difference value by the current temperature compensation coefficient.
4. The method as described in claim 2 or 3, characterized in that, The step of determining the current temperature compensation coefficient corresponding to the target camera module based on the current temperature, the target burning temperature, and the current object distance includes: Obtain the temperature compensation coefficient index table corresponding to the target camera module. The temperature compensation coefficient index table includes multiple correspondences between reference object distances and reference temperature compensation coefficients. Each reference object distance includes a first reference temperature compensation coefficient and a second reference temperature compensation coefficient. Based on the current object distance, obtain the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance from the temperature compensation coefficient index table; If the current temperature is less than or equal to the target burning temperature, the first temperature compensation coefficient is determined as the current temperature compensation coefficient; If the current temperature is greater than the target burning temperature, the second temperature compensation coefficient is determined as the current temperature compensation coefficient.
5. The method as described in claim 4, characterized in that, The step of obtaining a first temperature compensation coefficient and a second temperature compensation coefficient matching the current object distance from the temperature compensation coefficient index table based on the current object distance includes: If the current object distance is included in the temperature compensation coefficient index table, the first reference temperature compensation coefficient and the second reference temperature compensation coefficient corresponding to the current object distance in the temperature compensation coefficient index table shall be determined as the first temperature compensation coefficient and the second temperature compensation coefficient, respectively. If the current object distance is not included in the temperature compensation coefficient index table, the temperature compensation coefficient index table is interpolated based on the current object distance to determine the first temperature compensation coefficient and the second temperature compensation coefficient that match the current object distance.
6. The method as described in claim 4 or 5, characterized in that, The temperature compensation coefficient index table is generated in the following manner: Obtain the test programming temperature corresponding to the test camera module in the test equipment; The contrast-detection focusing position and depth-detection focusing position of the test camera module at N different reference object distances are obtained at M test temperatures, where M and N are both integers greater than 1. Determine the test temperature difference between each of the test temperatures and the test programming temperature; For the j-th reference object distance, based on the contrast focusing position and depth focusing position of the j-th test object at each of the M test temperatures, the test focusing position difference of the j-th test object at each of the test temperatures is determined. Here, the j-th test object refers to the test object at the j-th reference object distance, and j is an integer greater than or equal to 1 and less than or equal to N. Based on the difference in the test focus position of the j-th test object at each test temperature and the difference in test temperature between each test temperature and the test burning temperature, determine the reference temperature compensation coefficient corresponding to the j-th reference object distance; A temperature compensation coefficient index table is generated based on the reference temperature compensation coefficients corresponding to the N reference object distances.
7. The method as described in claim 6, characterized in that, The step of determining the reference temperature compensation coefficient corresponding to the j-th reference object distance based on the difference in the test focus position of the j-th test object at each test temperature and the test temperature difference between each test temperature and the test burning temperature includes: Based on the difference in the test focus position corresponding to the j-th test object at each first test temperature and the test temperature difference between each first test temperature and the test burning temperature, the first reference temperature compensation coefficient corresponding to the j-th reference object distance is determined, wherein the first test temperature refers to each of the test temperatures that is less than or equal to the test burning temperature. Based on the difference in the test focus position corresponding to the j-th test object at each second test temperature, and the difference in test temperature between each second test temperature and the test burning temperature, a second reference temperature compensation coefficient corresponding to the j-th reference object distance is determined, wherein the second test temperature refers to each test temperature that is greater than the test burning temperature.
8. The method according to any one of claims 1-7, characterized in that, The focusing area includes a moving object. After determining the compensated target focusing position based on the initial focusing position and the focusing position compensation value, the method further includes: The target focus position is sent to the motor corresponding to the target camera module, so that the motor drives the target camera module to focus on the moving object.
9. An electronic device, characterized in that, The electronic device includes: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-8.
10. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-8.