An image processing method and electronic device
Patent Information
- Application Number
- CN202410168675.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2044-02-05
AI Technical Summary
[0003]在手机的相机应用进行拍摄的情况下,若手机发生移动,那么相机应用的取景画面发生变化,相机应用的预览框中显示的预览画面也会发生变化,由此会发生卡顿现象,进而影响用户的拍摄体验
[0030]第三方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面中任一项所述的充电方法。
Smart Images

Figure CN120475249B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic equipment technology, and in particular to an image processing method and an electronic device. Background Technology
[0002] Currently, camera functions are becoming increasingly common on mobile phones. The camera app opens in response to user input, displaying a preview window. Users can then view and confirm the preview. Finally, the camera app takes a picture in response to the user's press of the shutter button.
[0003] When taking pictures using a mobile phone's camera app, if the phone moves, the viewfinder of the camera app will change, and the preview displayed in the preview frame will also change, which will cause lag and thus affect the user's shooting experience. Summary of the Invention
[0004] This application provides an image processing method and electronic device to solve the image stuttering phenomenon that occurs during camera shooting and improve the user's shooting experience.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] Firstly, an image processing method is provided, applicable to an electronic device including a camera. The method includes: the electronic device first acquiring relative motion information between itself and a photographed object; the relative motion information includes the relative velocity between the electronic device and the photographed object, and / or the relative acceleration between the electronic device and the photographed object. After acquiring the relative motion information, the electronic device can adjust its display parameters based on the relative motion information. When the relative motion information is a first type of motion information, the electronic device can display the viewfinder image corresponding to the camera using first display parameters. When the relative motion information is a second type of motion information, the electronic device can display the viewfinder image corresponding to the camera using second display parameters. Wherein, the first motion information is less than the second motion information, the display smoothness corresponding to the first display parameter is less than the display smoothness corresponding to the second display parameter, and the display clarity corresponding to the first display parameter is greater than the display clarity corresponding to the second display parameter. After the electronic device calculates the display parameters to be adjusted based on the motion information, the electronic device adjusts the display parameters to the adjusted display parameters, and the preview interface of the electronic device displays the viewfinder image corresponding to the camera.
[0007] By adopting this technical solution, during the preview process of electronic device shooting, the display parameters of the electronic device can be dynamically adjusted based on the calculated relative motion information between the device and the subject. This ensures that the greater the relative motion information, the smoother the display and the lower the resolution, thus guaranteeing a smooth shooting experience for the user. Conversely, the smaller the relative motion information, the smoother the display and the higher the resolution, ensuring the image quality captured by the user. Therefore, the shooting experience during the preview process of electronic device shooting is improved.
[0008] In one possible implementation of the first aspect, the display parameters of the electronic device may include frame rate and / or bit rate. Then, the first display parameter includes a first frame rate, the second display parameter includes a second frame rate, and the first frame rate is less than the second frame rate; and / or, the first display parameter includes a first bit rate, the second display parameter includes a second bit rate, and the first bit rate is less than the second bit rate.
[0009] In one possible implementation of the first aspect, the relative motion information may include relative velocity, the first motion information includes a first velocity, and the second motion information includes a second velocity. When the relative velocity is the first velocity, the electronic device displays the viewfinder image at a first frame rate; when the relative velocity is the second velocity, the electronic device displays the viewfinder image at a second frame rate. Wherein, the first velocity is less than the second velocity, the display smoothness corresponding to the first frame rate is less than the display smoothness corresponding to the second frame rate, and the display clarity corresponding to the first frame rate is greater than the display clarity corresponding to the second frame rate. And / or,
[0010] When the relative speed is at a first speed, the electronic device displays the viewfinder image at a first bitrate; when the relative speed is at a second speed, the electronic device displays the viewfinder image at a second bitrate. Since the first speed is less than the second speed, the display smoothness corresponding to the first bitrate is less than that corresponding to the second bitrate, and the display clarity corresponding to the first bitrate is greater than that corresponding to the second bitrate.
[0011] In one possible implementation of the first aspect, the electronic device can set a first speed threshold and a second speed threshold for the relative speed. When the relative speed is less than or equal to the first speed threshold, the electronic device displays the viewfinder image using a third display parameter (the minimum supported parameter). The third display parameter includes a third frame rate and / or a third bitrate. The display smoothness corresponding to the third display parameter is less than or equal to the display smoothness corresponding to the first display parameter, and the display sharpness corresponding to the third display parameter is greater than or equal to the display sharpness corresponding to the first display parameter.
[0012] When the relative speed is greater than or equal to the second speed threshold, the electronic device displays the viewfinder image using a fourth display parameter (the maximum supported parameter). The first speed threshold is less than the second speed threshold; the fourth display parameter includes a fourth frame rate and / or a fourth bit rate. The display smoothness corresponding to the fourth display parameter is greater than or equal to the display smoothness corresponding to the second display parameter, and the display clarity corresponding to the fourth display parameter is less than or equal to the display clarity corresponding to the second display parameter.
[0013] It is understandable that when the relative speed is greater than the first speed threshold and less than the second speed threshold, the value of the displayed parameter is proportional to the value of the relative speed. The value of the displayed parameter can be calculated based on the current relative speed, the first speed threshold, the second speed threshold, the minimum supportable parameter, and the maximum supportable parameter.
[0014] In one possible implementation of the first aspect, the relative motion information may include relative acceleration, the first motion information includes a first acceleration, and the second motion information includes a second acceleration. When the relative acceleration is the first acceleration, the electronic device displays the viewfinder image at a first frame rate. When the relative acceleration is the second acceleration, the electronic device displays the viewfinder image at a second frame rate. Wherein, the first acceleration is less than the second acceleration, the display smoothness corresponding to the first frame rate is less than the display smoothness corresponding to the second frame rate, and the display clarity corresponding to the first frame rate is greater than the display clarity corresponding to the second frame rate. And / or,
[0015] When the relative acceleration is the first acceleration, the electronic device displays the viewfinder image at the first bitrate; when the relative acceleration is the second acceleration, the electronic device displays the viewfinder image at the second bitrate; when the first acceleration is less than the second acceleration, the display smoothness corresponding to the first bitrate is less than the display smoothness corresponding to the second bitrate, and the display clarity corresponding to the first bitrate is greater than the display clarity corresponding to the second bitrate.
[0016] In one possible implementation of the first aspect, when the relative acceleration is less than or equal to a first acceleration threshold, the electronic device displays the viewfinder image using a fifth display parameter (the minimum supported parameter); the fifth display parameter includes a fifth frame rate and / or a fifth bitrate. The display smoothness corresponding to the fifth display parameter is less than or equal to the display smoothness corresponding to the first display parameter, and the display clarity corresponding to the fifth display parameter is greater than or equal to the display clarity corresponding to the first display parameter.
[0017] When the relative velocity is greater than or equal to the second acceleration threshold, the electronic device displays the viewfinder image using a sixth display parameter (the maximum supported parameter). The first acceleration threshold is less than the second acceleration threshold; the sixth display parameter includes a sixth frame rate and / or a sixth bitrate. The display smoothness corresponding to the sixth display parameter is greater than or equal to the display smoothness corresponding to the second display parameter, and the display clarity corresponding to the sixth display parameter is less than or equal to the display clarity corresponding to the second display parameter.
[0018] It is understandable that when the relative acceleration is greater than the first acceleration threshold and less than the second acceleration threshold, the value of the displayed parameter is proportional to the value of the relative acceleration. The value of the displayed parameter can be calculated based on the current relative acceleration, the first acceleration threshold, the second acceleration threshold, the minimum supportable parameter, and the maximum supportable parameter.
[0019] In one possible implementation of the first aspect, the method further includes: the maximum supportable parameter is related to the performance of the electronic device, wherein the performance of the electronic device can be evaluated by the remaining memory space of the electronic device. A larger remaining memory space indicates better performance of the electronic device; a smaller remaining memory space indicates poorer performance. Therefore, the electronic device can adjust the maximum supportable parameter based on the remaining memory space. Specifically, the maximum supportable parameter corresponds to the value when the remaining memory space of the electronic device is greater than a preset capacity threshold, and also corresponds to the value when the remaining memory space of the electronic device is less than or equal to the preset capacity threshold.
[0020] In one possible implementation of the first aspect, the method further includes: the fourth display parameter and the sixth display parameter (the maximum supported parameter) are related to the temperature value of the electronic device. A thermal limit (preset temperature limit threshold) can be set within the electronic device. The electronic device adjusts the fourth display parameter and the sixth display parameter according to the temperature value; that is, the electronic device can adjust the fourth display parameter and the sixth display parameter based on whether the current temperature has reached the thermal limit. Specifically, the values of the fourth display parameter and the sixth display parameter when the temperature value of the electronic device is less than the preset temperature limit threshold are greater than the values of the fourth display parameter and the sixth display parameter when the temperature value of the electronic device is greater than or equal to the preset temperature limit threshold.
[0021] In one possible implementation of the first aspect, the electronic device further includes a gyroscope sensor; the electronic device acquires relative motion information between itself and the subject being photographed, including: the electronic device detecting the relative motion information between itself and the subject being photographed via the gyroscope sensor. Generally, if the electronic device moves while the subject being photographed remains stationary, the electronic device can detect the relative motion information using its built-in gyroscope sensor.
[0022] Alternatively, the electronic device can detect the relative motion between itself and the subject being filmed using a camera. Generally, if the electronic device remains stationary while the subject moves, the electronic device can detect the relative motion using its camera.
[0023] Alternatively, the electronic device can detect the relative motion between itself and the subject being filmed using a gyroscope sensor and a camera. Generally, if both the electronic device and the subject are moving, the electronic device can jointly detect the relative motion using its built-in gyroscope sensor and camera. Specifically, the electronic device can detect the relative motion using both the gyroscope sensor and the camera separately, and then take the larger of the two values as the current relative motion information.
[0024] In one possible implementation of the first aspect, the electronic device can further adjust the exposure parameters while ensuring a balance between the base frame rate and the bit rate, so as to ensure the display clarity of the preview image on the mobile phone. The method also includes: when the electronic device is in an indoor scene and a flickering scene, adjusting the camera's exposure duration to a first duration and adjusting the camera's exposure gain to a first gain.
[0025] Alternatively, if the electronic device is in an indoor scene and not in a flickering scene, the electronic device adjusts the camera's exposure duration to a second duration and the camera's exposure gain to a second gain. The second duration is shorter than the first duration.
[0026] In one possible implementation of the first aspect, the method further includes: when the electronic device is in an outdoor scene, if the exposure duration of the camera is greater than a third duration and less than a first duration, the electronic device adjusts the exposure gain of the camera to the maximum gain limit value and adjusts the exposure duration of the camera to a fourth duration; wherein the third duration is less than the second duration.
[0027] Alternatively, if the electronic device is in an outdoor setting and the camera's exposure time is less than or equal to the third duration, the electronic device maintains the camera's exposure time.
[0028] In summary, this solution can dynamically adjust the display parameters of the electronic device based on relative motion information. When the relative motion information is small, it ensures the clarity of the preview interface, and when the relative motion information is large, it ensures the smoothness of the preview interface, thus improving the user's shooting experience.
[0029] In a second aspect, this application provides an electronic device comprising: a communication module, a display screen, a memory, and one or more processors; the communication module, the display screen, the memory, and the processors are coupled; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the method described in any one of the first aspects.
[0030] Thirdly, this application provides a computer-readable storage medium storing instructions that, when executed on a computer, enable the computer to perform the charging method described in any one of the first aspects.
[0031] Fourthly, this application provides a computer program product containing instructions that, when run on a computer, enable the computer to perform the method described in any one of the first aspects above.
[0032] It is understood that the electronic device described in the second aspect, the computer-readable storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to perform the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here. Attached Figure Description
[0033] Figure 1 A schematic diagram illustrating the relationship between a mobile phone's moving speed / acceleration and its smoothness sensitivity and sharpness sensitivity, provided for embodiments of this application;
[0034] Figure 2 A schematic diagram of a scene where the mobile phone moves while the subject being photographed remains stationary, provided as an embodiment of this application;
[0035] Figure 3 This is a schematic diagram illustrating another method of mobile phone movement while the subject being photographed remains stationary, as provided in an embodiment of this application.
[0036] Figure 4 A schematic diagram illustrating an image processing method provided in an embodiment of this application;
[0037] Figure 5 A schematic diagram illustrating the relationship between relative speed and the frame rate to be adjusted, provided for an embodiment of this application;
[0038] Figure 6A schematic diagram illustrating the relationship between relative speed and the bit rate to be adjusted, provided for an embodiment of this application;
[0039] Figure 7 A schematic diagram of a shooting scene provided for an embodiment of this application;
[0040] Figure 8 A schematic diagram illustrating another shooting scenario provided in an embodiment of this application;
[0041] Figure 9 This is a schematic diagram of a mobile phone exposure reduction process provided in an embodiment of this application;
[0042] Figure 10 A schematic diagram of the hardware structure of a mobile phone provided in an embodiment of this application;
[0043] Figure 11 A timing diagram of the software implementation of a charging method provided in an embodiment of this application;
[0044] Figure 12 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature.
[0046] In this embodiment, a mobile phone is used as the electronic device, and the camera application in the mobile phone takes a picture preview in response to the user's operation as an example.
[0047] During the photo preview process, both the phone and the subject can be moved. For example, the phone can move while the subject remains stationary; or the phone can remain stationary while the subject moves; or both the phone and the subject can move.
[0048] When the phone moves and / or the subject moves, the viewfinder of the phone's camera app will change, and the preview displayed in the camera app's preview window will also change. As a result, there will be a stuttering effect during the preview process, which will affect the user's shooting experience.
[0049] Taking the scenario where the phone moves while the subject remains stationary as an example, the user's sensitivity to the smoothness and sharpness of the preview image varies depending on the phone's speed and acceleration. Specifically, the faster the phone moves during the preview, the higher the human eye's sensitivity to the smoothness of the preview image and the lower its sensitivity to the sharpness; conversely, the slower the phone moves, the lower the human eye's sensitivity to the smoothness and the higher its sensitivity to the sharpness.
[0050] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the relationship between a mobile phone's movement speed / acceleration and its smoothness and clarity sensitivity, as provided in an embodiment of this application. Figure 1 It can be seen that as the movement speed / acceleration increases, the smoothness sensitivity also increases, while the clarity sensitivity decreases.
[0051] The relationship between movement speed and smoothness sensitivity and clarity sensitivity can be shown in the table below.
[0052]
[0053] Table 1
[0054] As shown in Table 1, when the moving speed / acceleration is less than x1, the user's eye is less sensitive to smoothness and more sensitive to clarity, so the smoothness index can be set to medium and the clarity index to high. When the moving speed / acceleration is greater than or equal to x1 and less than or equal to x2, the user's eye is more sensitive to smoothness and less sensitive to clarity, so the smoothness index can be set to high and the clarity index to medium. When the moving speed / acceleration is greater than x2, the user's eye is more sensitive to both smoothness and clarity, so the smoothness index can be set to high and the clarity index to low.
[0055] The relationship between x1 and x2 can be referred to Figure 1 .Depend on Figure 1 It can be seen that when the moving speed / acceleration is greater than x2, if the moving speed / acceleration continues to increase, after exceeding a certain speed threshold, the user's eye may become less sensitive to smoothness, and correspondingly, the user's eye will become more sensitive to clarity.
[0056] Please see Figure 2 , Figure 2 This is a schematic diagram illustrating a scene where the mobile phone moves while the subject being photographed remains stationary, as provided in an embodiment of this application. Figure 2 As shown, the vase on the table was photographed by a mobile phone. The vase did not move, but the mobile phone moved from position 1 to position 2.
[0057] Taking the example of a mobile phone moving while the subject remains stationary, the flowchart of an image processing method provided in this application embodiment is shown below. Specific steps may include S101-S102, as follows:
[0058] S101. The mobile phone acquires relative motion information between itself and the subject being photographed.
[0059] The relative motion information includes the relative velocity between the mobile phone and the subject being photographed, and / or the relative acceleration between the mobile phone and the subject being photographed.
[0060] The relative velocity *v* is determined by the distance *s* the phone moves relative to the subject within a preset shooting duration *t*. The preset shooting duration can be one frame. After obtaining the relative velocity *v* using the preset shooting duration and distance, the relative acceleration *a* can be determined based on multiple relative velocities *v*.
[0061] The relative velocity / acceleration between the phone and the subject is actually the relative velocity / acceleration calculated as the length of the path the phone moves between one preview frame and the next preview frame, and it is independent of the direction of the phone's movement.
[0062] For example, if the phone is at position 1 and first moves in the first direction, then its relative velocity 1 in the first direction can be calculated. After the phone moves to position 2 and then moves in the second direction, its relative velocity 2 in the second direction can be calculated.
[0063] Please refer to Figure 3 , Figure 3 The image shows a schematic diagram where the mobile phone moves while the subject remains stationary. (Example:) Figure 3 As shown, the subject of the photograph is a vase. In a scenario where a user is photographing a vase on a table with their phone, if they move the phone first in direction 1 and then in direction 2, the phone can calculate its relative speed 1 in direction 1 and its relative speed 2 in direction 2. The phone's display parameters can then be adjusted based on these calculated relative speeds.
[0064] It's understandable that the preview images displayed on the phone at different locations are images from different frames. The phone's movement speed is calculated from the position of the phone displaying the current frame image and the position of the phone displaying the previous frame image.
[0065] Mobile phones contain a gyroscope sensor, which allows the phone to detect the relative speed between itself and the subject being photographed. Generally, if the phone is moving, it uses the gyroscope to detect relative motion information.
[0066] Therefore, after calculating the relative motion information between the phone and the subject, the phone's display parameters can be adjusted based on this information. After the display parameters are adjusted, the phone's preview interface displays the viewfinder image corresponding to the adjusted parameters.
[0067] S102. The phone's preview screen displays the viewfinder image corresponding to the camera.
[0068] Factors affecting the smoothness of a phone's preview screen include frame rate and / or bitrate. A higher frame rate results in smoother previews, while a lower frame rate results in less smooth previews. Similarly, a higher bitrate results in smoother previews, while a lower bitrate results in less smooth previews.
[0069] Regarding the clarity of the preview image, better smoothness generally results in lower clarity, and vice versa. In other words, lowering the phone's frame rate and bitrate will lead to a less smooth but more clear image in the next frame of the preview, while increasing them will result in a smoother but less clear image in the next frame.
[0070] In this embodiment, the display parameters of the mobile phone may include frame rate and / or bit rate. After calculating the relative motion information between the mobile phone and the subject being photographed, the mobile phone can determine the display parameters to be adjusted based on the relative motion information and adjust the corresponding display parameters of the mobile phone to the adjusted display parameters.
[0071] For the relative motion information of the mobile phone, first motion information and second motion information can also be set. When the relative motion information includes relative speed, then the first motion information includes the first speed, and the second motion information includes the second speed. When the relative speed includes the first speed, the mobile phone can display the viewfinder image at a first frame rate. When the relative speed includes the second speed, the mobile phone can display the viewfinder image at a second frame rate. Where the first speed is less than the second speed, the display smoothness corresponding to the first frame rate is less than the display smoothness corresponding to the second frame rate, and the display clarity corresponding to the first frame rate is greater than the display clarity corresponding to the second frame rate.
[0072] In some examples, when the relative speed includes a first speed, the phone can display the viewfinder image at a first bitrate. When the relative speed includes a second speed, the phone can display the viewfinder image at a second bitrate. Where the first speed is less than the second speed, the display smoothness corresponding to the first bitrate is less than the display smoothness corresponding to the second bitrate, and the display clarity corresponding to the first bitrate is greater than the display clarity corresponding to the second bitrate.
[0073] Understandably, a mobile phone can adjust the bitrate or frame rate based on relative speed, or adjust both bitrate and frame rate simultaneously.
[0074] When the relative motion information includes relative acceleration, then the first motion information includes a first acceleration, and the second motion information includes a second acceleration. When the relative acceleration includes the first acceleration, the phone can display the viewfinder image at a first frame rate. When the relative acceleration includes the second acceleration, the phone can display the viewfinder image at a second frame rate. Where the first acceleration is less than the second acceleration, the display smoothness corresponding to the first frame rate is less than the display smoothness corresponding to the second frame rate, and the display clarity corresponding to the first frame rate is greater than the display clarity corresponding to the second frame rate.
[0075] In some examples, when the relative acceleration includes a first acceleration, the phone can display the viewfinder at a first bitrate. When the relative acceleration includes a second acceleration, the phone can display the viewfinder at a second bitrate. Where the first acceleration is less than the second acceleration, the display smoothness corresponding to the first bitrate is less than the display smoothness corresponding to the second bitrate, and the display clarity corresponding to the first bitrate is greater than the display clarity corresponding to the second bitrate.
[0076] Therefore, the phone can dynamically adjust its display parameters based on the calculated relative motion information between the phone and the subject, better balancing clarity and smoothness, and ensuring the best shooting experience for the user.
[0077] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating an image processing method provided in an embodiment of this application. Figure 4 As shown, taking a vase on a table as the subject of the photograph as an example, the vase remains stationary while the phone moves in direction 1. The phone can acquire relative motion information between itself and the vase. For example, the phone calculates the relative speed of its movement based on positions 1 and 2. After calculating the relative speed, the phone adjusts the display parameter from display parameter 1 to display parameter 2, and then displays the viewfinder image corresponding to the camera's viewfinder in the preview interface using display parameter 2.
[0078] Each display parameter can include a minimum supported parameter and a maximum supported parameter. For example, if the display parameter is frame rate, then there is a frame rate range, with the boundary values of the frame rate range being the minimum and maximum supported frame rates. If the display parameter is bitrate, then there is a bitrate range, with the boundary values of the bitrate range being the minimum and maximum supported bitrates.
[0079] In this embodiment, when the relative motion information includes relative speed, the relative speed also includes a first speed threshold and a second speed threshold. If the relative speed is less than or equal to the first speed threshold, the phone can determine that the display parameter to be adjusted is the minimum supported parameter, and the phone displays the viewfinder with the minimum supported parameter. If the relative speed is greater than or equal to the second speed threshold, the phone can determine that the display parameter to be adjusted is the maximum supported parameter, and the phone displays the viewfinder with the maximum supported parameter. If the relative speed is greater than the first speed threshold and less than the second speed threshold, the value of the phone's relative speed is proportional to the value of the display parameter to be adjusted; that is, the greater the relative speed, the greater the display parameter to be adjusted, and the greater the corresponding display smoothness and the lower the display clarity. Specifically, the phone can calculate the display parameter to be adjusted based on the current relative speed, the first speed threshold, the second speed threshold, the minimum supported parameter, and the maximum supported parameter.
[0080] Please see Figure 5 , Figure 5 This diagram illustrates the relationship between relative speed and the frame rate to be adjusted, as provided in an embodiment of this application. Figure 5 As shown, let the first speed threshold be x1, the second speed threshold be x2, the minimum supported frame rate (third display parameter) be y1, and the maximum supported frame rate (fourth display parameter) be y2. Figure 5 It can be seen that if the calculated relative speed is less than or equal to x1, then the frame rate to be adjusted is y1. If the relative speed is greater than or equal to x2, then the frame rate to be adjusted is y2. If the relative speed is greater than x1 and less than x2, then the frame rate to be adjusted can be calculated using the formula. Figure 5 As shown in the relationship, the frame rate (fps) to be adjusted can be obtained according to the following formula 1:
[0081]
[0082] The frame rate to be adjusted is directly proportional to the relative speed. That is, when the relative speed is greater than x1 and less than x2, the higher the relative speed, the higher the frame rate to be adjusted. Furthermore, the frame rate to be adjusted must be greater than y1 and less than y2. Therefore, a higher relative speed and a higher frame rate result in smoother display but lower display clarity. Conversely, a lower relative speed and a lower frame rate result in less smooth display but higher display clarity.
[0083] The relative speed can range from [0.3, 20], with initial values x1 of 0.3 and x2 of 5. The frame rate can range from [20, 240] frames per second (fps), with initial values y1 of 30 fps and y2 of 240 fps. The relative speed values calculated by the phone using different algorithms can vary.
[0084] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating the relationship between relative speed and the bit rate to be adjusted, provided as an embodiment of this application. Figure 6 As shown, let the first speed threshold be x1, the second speed threshold be x2, the minimum supported bitrate (fifth display parameter) be b1, and the maximum supported bitrate (sixth display parameter) be b2. From... Figure 6 It can be seen that if the calculated relative speed is less than or equal to x1, then the minimum supported bitrate is b1. If the relative speed is greater than or equal to x2, then the bitrate to be adjusted is b2. If the relative speed is greater than x1 and less than x2, then the bitrate to be adjusted can be calculated using the formula. Figure 6 As shown in the relationship, the bitrate BR to be adjusted can be obtained according to the following formula 2:
[0085]
[0086] The bitrate to be adjusted is directly proportional to the relative speed. Specifically, when the relative speed is greater than x1 and less than x2, the higher the relative speed, the higher the bitrate to be adjusted. Furthermore, the bitrate to be adjusted must be greater than b1 and less than b2. Therefore, a higher relative speed coupled with a higher bitrate results in smoother display but lower display clarity. Conversely, a lower relative speed coupled with a lower bitrate results in smoother display but higher display clarity.
[0087] The bit rate can range from [1, 8] to megabits per second (mbps), with initial values b1 of 2 mbps and b2 of 6 mbps.
[0088] In some embodiments, when the relative motion information is relative acceleration, the relative acceleration further includes a first acceleration threshold and a second acceleration threshold. If the relative acceleration is less than or equal to the first acceleration threshold, the phone can determine that the display parameter to be adjusted is the minimum supported parameter, and the phone displays the viewfinder with the minimum supported parameter. If the relative acceleration is greater than or equal to the second acceleration threshold, the phone can determine that the display parameter to be adjusted is the maximum supported parameter, and the phone displays the viewfinder with the maximum supported parameter. If the relative acceleration is greater than the first acceleration threshold and less than the second acceleration threshold, the value of the phone's relative acceleration is proportional to the value of the display parameter to be adjusted; that is, the greater the relative acceleration, the greater the display parameter to be adjusted, and the greater the corresponding display smoothness and the lower the display clarity. Specifically, the phone can calculate the display parameter to be adjusted based on the current relative acceleration, the first acceleration threshold, the second acceleration threshold, the minimum supported parameter, and the maximum supported parameter.
[0089] It is understood that the relationship between relative acceleration and the frame rate to be adjusted can be referred to the relationship between relative speed and the frame rate to be adjusted described above, and the relationship between relative acceleration and the bitrate to be adjusted can be referred to the relationship between relative speed and the frame rate to be adjusted described above. This application will not elaborate on these points here.
[0090] In this embodiment, the maximum supported parameter value can be adjusted according to the phone's performance. Taking memory space as an example, a preset capacity threshold can be set in the phone. If the phone's memory space is greater than the preset capacity threshold, it indicates that the phone's performance is good. If the phone's memory space is less than or equal to the preset capacity threshold, it indicates that the phone's performance is poor.
[0091] When the phone's remaining memory space is greater than the preset capacity threshold (when the phone's performance is good), the maximum supportable parameter value is greater than the maximum supportable parameter value when the phone's remaining memory space is less than or equal to the preset capacity threshold (when the phone's performance is poor).
[0092] If the shooting parameter is frame rate, the maximum supported parameter is the maximum supported frame rate. Assuming the phone's remaining memory space RAMres > the preset capacity threshold Th1, the maximum supported frame rate is set to y2. Assuming the phone's remaining memory space RAMres <= the preset capacity threshold Th1, the maximum supported frame rate is set to y3. Here, y2 is greater than y3. y3 can be 120fps.
[0093] If the phone's remaining memory space RAMres <= the preset capacity threshold Th1, and the calculated relative speed is less than or equal to x1, then the frame rate to be adjusted is y1. If the relative speed is greater than or equal to x2, then the frame rate to be adjusted is y3. If the relative speed is greater than x1 and less than x2, then the frame rate to be adjusted fps can be obtained according to the following formula 3:
[0094]
[0095] If the shooting parameter is bitrate, the maximum supported parameter is the maximum supported bitrate. Assuming the phone's memory capacity RAMres > the preset capacity threshold Th1, the maximum supported bitrate is set to b2. Assuming the phone's memory capacity RAMres <= the preset capacity threshold Th1, the maximum supported bitrate is set to b3. Here, b2 is greater than b3. b3 can be 4 Mbps.
[0096] If the calculated relative velocity is less than or equal to x1, then the bitrate to be adjusted is b1. If the relative velocity is greater than or equal to x2, then the bitrate to be adjusted is b3. If the relative velocity is greater than x1 and less than x2, then the bitrate to be adjusted, BR, can be obtained according to the following formula 4:
[0097]
[0098] In this embodiment, the maximum supported parameter value can also be adjusted based on the phone's temperature. The phone has a thermal limiter (a preset temperature limit threshold). When the phone's temperature is below this thermal limiter, the maximum supported parameter value is greater than the maximum supported parameter value when the phone's temperature is not less than this thermal limiter.
[0099] If the shooting parameter is frame rate, the maximum supported parameter is the maximum supported frame rate. Assuming the phone's temperature value Tem < thermal limit Th2, the maximum supported frame rate is set to y2. Assuming the phone's temperature value Tem >= thermal limit Th2, the maximum supported frame rate is set to y4. Here, y2 is greater than y4, and y4 can be 120fps.
[0100] When the phone's temperature Tem is less than the thermal limit Th2, if the calculated relative speed is less than or equal to x1, then the frame rate to be adjusted is y1. If the relative speed is greater than or equal to x2, then the frame rate to be adjusted is y4. If the relative speed is greater than x1 and less than x2, then the frame rate to be adjusted, fps, can be obtained according to the following formula 5:
[0101]
[0102] If the shooting parameter is bitrate, the maximum supported parameter is the maximum supported bitrate. Assuming the phone's temperature value Tem < thermal limit Th2, the maximum supported bitrate is set to b2. Assuming the phone's temperature value Tem >= thermal limit Th2, the maximum supported bitrate is set to b4. Here, b2 is greater than b4. b4 can be 4 Mbps.
[0103] When the phone's temperature value Tem is greater than or equal to the thermal limit Th2, if the calculated relative speed is less than or equal to x1, then the bitrate to be adjusted is b1. If the relative speed is greater than or equal to x2, then the bitrate to be adjusted is b4. If the relative speed is greater than x1 and less than x2, then the bitrate to be adjusted BR can be obtained according to the following formula 6:
[0104]
[0105] It is understandable that there are no restrictions on the relationship between y3 and y4; y3 can be greater than y4, or y3 can be equal to y4, or y3 can be less than y4. Similarly, there are no restrictions on the relationship between b3 and b4; b3 can be greater than b4, or b3 can be equal to b4, or b3 can be less than b4.
[0106] In some examples, the image processing method provided in this application can also be applied when the phone is stationary and the subject is moving. Please refer to [link / reference]. Figure 7 , Figure 7 A schematic diagram of a shooting scenario is shown. (For example...) Figure 7 As shown, the subject being photographed is a car; the phone is stationary, but the car is moving.
[0107] In other examples, the image processing method provided in this application can also be applied when both the mobile phone and the subject are moving. Please refer to [link / reference]. Figure 8 , Figure 8 A schematic diagram of a shooting scenario is shown. (For example...) Figure 8 As shown, the subject being photographed is a car, and the car is moving as the phone moves.
[0108] In some examples, the mobile phone can detect the relative speed between the phone and the subject being photographed using its camera. Generally, if the subject is moving, the phone detects the relative motion information using its camera. The phone can detect relative speed using the camera via the Lucas-Kanade optical flow method or other conventional methods; specific methods will not be elaborated upon here.
[0109] In other examples, if both the phone and the subject are moving, the phone can detect the relative speed between them using a combination of its camera and gyroscope sensor. In this case, the phone can take the larger of the relative speed detected by the gyroscope sensor and the relative speed detected by the camera as the current relative speed.
[0110] In all scenarios, the phone can adjust its exposure parameters while maintaining a balance between the base frame rate and bit rate to ensure the clarity of the preview image.
[0111] Please see Figure 9 , Figure 9 This is a schematic diagram illustrating a mobile phone exposure reduction process provided in an embodiment of this application. If the mobile phone detects an exposure gain (iso*expo or motion_gain) greater than 1000, it indicates that the phone is currently in an indoor scene. If the mobile phone detects an exposure gain not greater than 1000, it indicates that the phone is currently in an outdoor scene. Figure 9 The steps are as follows:
[0112] Step S901: When the phone is in an indoor scene, it determines whether it is in a flicker (FLK) scene. Step S9011: If the phone detects a flicker scene, it adjusts the current camera exposure duration (motion_expo) to a first duration. The first duration can be 1 / 100th of a second (banding_step). Step S9012: If the phone detects that it is not in a flicker scene, it adjusts the current camera exposure duration to a second duration. The second duration is shorter than the first duration. The second duration can be 1 / 400th of a second.
[0113] After adjusting the camera's exposure time, the phone can calculate the current camera's exposure gain based on the adjusted exposure time. Step S9013: After calculating the camera's exposure gain, the phone determines whether the exposure gain is greater than the maximum gain limit (max_gain_thd). If the exposure gain is greater than the maximum gain limit, the current exposure gain is adjusted to the maximum gain limit, and the corresponding exposure time is calculated based on this maximum gain limit. Thus, the phone's camera applies this gain limit and the corresponding exposure time. The maximum gain limit can be 8xgain.
[0114] If the exposure gain calculated by the phone does not exceed the gain limit, then the phone's camera will apply the adjusted exposure duration and the exposure gain calculated based on that adjusted exposure duration. For example, when the phone adjusts the camera's exposure duration to a first duration, the phone can adjust the camera's exposure gain to the exposure gain under that first duration, which can be set as the first gain. When the phone adjusts the camera's exposure duration to a second duration, the phone can adjust the camera's exposure gain to the exposure gain under that second duration, which can be set as the second gain.
[0115] Step S902: In this embodiment, if the mobile phone detects that the camera's exposure gain is greater than the maximum gain limit, then the mobile phone maintains the current camera exposure duration. If the mobile phone detects that the camera's exposure gain is not greater than the maximum gain limit, then the mobile phone determines whether it is in an indoor scene or an outdoor scene based on the exposure gain.
[0116] Step S903: When the phone is in an outdoor scene, if the camera's exposure duration is greater than the third duration but less than the first duration, the phone adjusts the exposure gain to the maximum gain limit value, calculates the corresponding exposure duration (set as the fourth duration) based on this maximum gain limit value, and adjusts the corresponding exposure duration to this exposure duration; wherein, the third duration is less than the second duration. The third duration can be 1 / 600 second.
[0117] Step S904: When the phone is in an outdoor scene, if the exposure time of the phone camera is less than or equal to the third exposure time, the phone maintains the current exposure time of the camera.
[0118] If the phone calculates an exposure duration that is less than the fourth duration based on the maximum gain limit, the phone sets the camera's corresponding exposure duration to the fourth duration and recalculates the exposure gain based on the fourth duration. Then, the phone adjusts the corresponding exposure gain to this fourth duration. The fourth duration is less than the third duration. The fourth duration can be 1 / 900 of a second.
[0119] In summary, the image processing method provided in this application can calculate the display parameters of the electronic device to be adjusted based on the relative motion information between the electronic device and the subject being photographed. Specifically, the larger the relative motion information, the larger the display parameters, resulting in greater display smoothness but lower display clarity; conversely, the smaller the relative motion information, the smaller the display parameters, resulting in lower display smoothness but higher display clarity. After adjusting the display parameters, the electronic device displays the viewfinder image corresponding to the camera on its preview interface. Therefore, this solution can dynamically adjust the display parameters of the electronic device based on the relative motion information. When the relative motion information is small, the clarity of the preview interface is guaranteed; when the relative motion information is large, the smoothness of the preview interface is guaranteed, thus improving the user's shooting experience. Furthermore, it can ensure the image quality (clarity) of the captured image even when the electronic device and / or the subject are moving.
[0120] It is understandable that the above image processing methods can be applied not only to photo preview scenarios but also to video preview scenarios or during video recording.
[0121] For example, the electronic devices in this application embodiment can be mobile phones, tablets, laptops, ultra-mobile personal computers (UMPCs), handheld computers, wearable electronic devices (e.g., smartwatches, smart bracelets, smart glasses), and most other Android terminal devices. This application embodiment does not impose any restrictions on these.
[0122] The embodiments of this application will now be described in detail with reference to the accompanying drawings. Taking a mobile phone as an example, the hardware structure of the electronic device (such as mobile phone 300) will be described. The hardware structure of the electronic device can be found in the detailed description of mobile phone 300 in the embodiments of this application, and will not be repeated here. Please refer to... Figure 10 , Figure 10 A schematic diagram of the mobile phone structure is shown, such as... Figure 10 As shown, the mobile phone 300 may include: a processor 310, an external memory interface 320, an internal memory 321, a USB interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, a headphone jack 370D, a sensor module 380, buttons 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc.
[0123] The aforementioned sensor module 380 may include sensors such as pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors.
[0124] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the mobile phone 300. In other embodiments, the mobile phone 300 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.
[0125] Processor 310 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. The different processing units may be independent devices or integrated into one or more processors.
[0126] The controller can serve as the nerve center and command center of the mobile phone 300. Based on the instruction operation code and timing signals, the controller can generate operation control signals to control the fetching and execution of instructions.
[0127] The processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can store instructions or data that the processor 310 has just used or that are used repeatedly. If the processor 310 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
[0128] In some embodiments, the processor 310 may include one or more interfaces. Interfaces may include 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.
[0129] It is understood that the interface connection relationships between the modules illustrated in this embodiment are merely illustrative and do not constitute a structural limitation on the mobile phone 300. In other embodiments, the mobile phone 300 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0130] The charging management module 340 is used to receive charging input from the charger. In this embodiment, the charger is a wired charger, and the charging management module 340 can receive the charging input from the wired charger via the USB interface 330 (i.e., the charging interface mentioned above). While charging the battery 342, the charging management module 340 can also supply power to the electronic device via the power management module 341.
[0131] The power management module 341 connects the battery 342, the charging management module 340, and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340, providing power to the processor 310, internal memory 321, external memory, display screen 394, camera 393, and wireless communication module 360. The power management module 341 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 341 may also be located within the processor 310. In other embodiments, the power management module 341 and the charging management module 340 may be housed in the same device.
[0132] The wireless communication function of mobile phone 300 can be realized through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem processor and baseband processor.
[0133] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 300 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0134] The mobile communication module 350 can provide solutions for wireless communication applications including 2G / 3G / 4G / 5G in mobile phones 300. The mobile communication module 350 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation.
[0135] The wireless communication module 360 can provide solutions for wireless communication applications on mobile phones 300, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technology.
[0136] The wireless communication module 360 can be one or more devices integrating at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 310. The wireless communication module 360 can also receive signals to be transmitted from processor 310, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0137] In some embodiments, antenna 1 of mobile phone 300 is coupled to mobile communication module 350, and antenna 2 is coupled to wireless communication module 360, enabling mobile phone 300 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0138] The mobile phone 300 implements display functions through a GPU, a display screen 394, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0139] Display screen 394 is used to display images, videos, etc. Display screen 394 includes a display panel. The display panel can 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.
[0140] The mobile phone 300 can achieve its shooting function through an ISP, camera 393, video codec, GPU, display 394, and application processor. The ISP processes data fed back by the camera 393. The camera 393 captures still images or videos. In some embodiments, the mobile phone 300 may include one or N cameras 393, where N is a positive integer greater than 1. The digital signal processor processes digital signals, including digital image signals and other digital signals. For example, when the mobile phone 300 selects a frequency, the digital signal processor performs Fourier transforms on the frequency energy. The video codec compresses or decompresses digital video. The NPU (Neural-Network Processing Unit) is a neural network (NN) computing processor that, by borrowing from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, rapidly processes input information and can continuously learn. The NPU enables intelligent cognitive applications in the mobile phone 300, such as image recognition, face recognition, speech recognition, and text understanding.
[0141] The external storage interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 300. The external memory card communicates with the processor 310 through the external storage interface 320 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0142] Internal memory 321 can be used to store computer executable program code, which includes instructions. Processor 310 executes various functional applications and data processing of mobile phone 300 by running the instructions stored in internal memory 321. For example, in this embodiment, processor 310 can execute instructions stored in internal memory 321, which may include a program storage area and a data storage area.
[0143] The program storage area can store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.). The data storage area can store data created during the use of the mobile phone 300 (such as audio data, phonebook, etc.). In addition, the internal memory 321 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.
[0144] The mobile phone 300 can achieve audio functions such as music playback and recording through the audio module 370, speaker 370A, receiver 370B, microphone 370C, headphone jack 370D, and application processor.
[0145] Audio module 370 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 370 can also be used for encoding and decoding audio signals. In some embodiments, audio module 370 may be located in processor 310, or some functional modules of audio module 370 may be located in processor 310. Speaker 370A, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. Receiver 370B, also called a "handset," is used to convert audio electrical signals into sound signals. Microphone, also called a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.
[0146] The headphone jack is used to connect wired headphones. The headphone jack can be a USB 330 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, or a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.
[0147] Buttons 390 include a power button, volume buttons, etc. Buttons 390 can be mechanical buttons or touch-sensitive buttons. Motor 391 can generate vibration alerts. Motor 391 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 392 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 395 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 395 to achieve contact and separation with the mobile phone 300. The mobile phone 300 can support one or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 395 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0148] The methods described in the following embodiments can all be implemented in a mobile phone 300 with the above-described hardware structure.
[0149] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to illustrate the software structure of an electronic device.
[0150] Figure 11 This is a software structure block diagram of an electronic device according to an embodiment of this application.
[0151] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer, the Android runtime (ART) and native C / C++ libraries, the Hardware Abstraction Layer (HAL), and the kernel layer.
[0152] The application layer can include a series of application packages.
[0153] like Figure 11 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0154] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0155] like Figure 11As shown, the application framework layer may include a window manager, content provider, view system, resource manager, notification manager, activity manager, input manager, etc.
[0156] The Android runtime consists of the core libraries and the Android runtime itself. The Android runtime is responsible for converting source code into machine code. The Android runtime primarily employs ahead-of-time (AOT) compilation and just-in-time (JIT) compilation techniques.
[0157] The core library primarily provides basic Java class library functionalities, such as libraries for fundamental data structures, mathematics, I / O, tools, databases, and networking. It also provides APIs for users to develop Android applications.
[0158] Native C / C++ libraries can include multiple functional modules. Examples include: surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.
[0159] The Hardware Abstraction Layer (HAL) runs in user space, encapsulates kernel-level drivers, and provides calling interfaces to higher layers. The HAL typically includes at least a display module, a camera module, an audio module, and a sensor module.
[0160] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0161] The following example, using a scene of capturing a photograph, illustrates the workflow of the electronic device's software and hardware.
[0162] When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a touch click as an example, where the corresponding control is the camera application icon, the camera application calls the application framework layer's interface to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.
[0163] This application also provides a chip system, such as... Figure 12As shown, the chip system 900 includes at least one processor 901 and at least one interface circuit 902. The processor 901 and the interface circuit 902 are interconnected via lines. For example, the interface circuit 902 can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, the interface circuit 902 can be used to send signals to other devices (e.g., the processor 901). Exemplarily, the interface circuit 902 can read instructions stored in the memory and send those instructions to the processor 901. When the instructions are executed by the processor 901, the electronic device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete components, and this application embodiment does not specifically limit this.
[0164] This application also provides a computer storage medium that includes computer instructions. When the computer instructions are executed on the electronic device, the electronic device causes the electronic device to perform various functions or steps performed by the mobile phone in the above method embodiment.
[0165] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps performed by the mobile phone in the above method embodiments.
[0166] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0167] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus 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 device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0168] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0169] Furthermore, the functional units in the various embodiments of this application 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.
[0170] 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 readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0171] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An image processing method, characterized in that, Applied to an electronic device, the electronic device including a camera, the method includes: The electronic device acquires relative motion information between itself and the subject being photographed; the relative motion information includes the relative velocity between the electronic device and the subject being photographed, and / or the relative acceleration between the electronic device and the subject being photographed. The preview interface of the electronic device displays the viewfinder image corresponding to the camera; wherein, when the relative motion information is first motion information, the electronic device displays the viewfinder image with first display parameters; when the relative motion information is second motion information, the electronic device displays the viewfinder image with second display parameters; the first motion information is less than the second motion information, the display smoothness corresponding to the first display parameters is less than the display smoothness corresponding to the second display parameters, and the display clarity corresponding to the first display parameters is greater than the display clarity corresponding to the second display parameters; When the electronic device displays the viewfinder with a first display parameter or a second display parameter, When the electronic device is in an indoor scene and a flickering scene, the electronic device adjusts the exposure duration of the camera to a first duration and the exposure gain of the camera to a first gain; or, When the electronic device is in an indoor scene and not in a flickering scene, the electronic device adjusts the exposure duration of the camera to a second duration and adjusts the exposure gain of the camera to a second gain; wherein the second duration is less than the first duration.
2. The method according to claim 1, characterized in that, The first display parameter includes a first frame rate, the second display parameter includes a second frame rate, and the first frame rate is less than the second frame rate; and / or, The first display parameter includes a first bitrate, and the second display parameter includes a second bitrate, wherein the first bitrate is less than the second bitrate.
3. The method according to claim 2, characterized in that, The relative motion information includes relative velocity, the first motion information includes a first velocity, and the second motion information includes a second velocity; When the relative speed is a first speed, the electronic device displays the viewfinder image at a first frame rate; when the relative speed is a second speed, the electronic device displays the viewfinder image at a second frame rate; the first speed is less than the second speed, the display smoothness corresponding to the first frame rate is less than the display smoothness corresponding to the second frame rate, and the display clarity corresponding to the first frame rate is greater than the display clarity corresponding to the second frame rate. And / or, When the relative speed is a first speed, the electronic device displays the viewfinder image at a first bitrate; when the relative speed is a second speed, the electronic device displays the viewfinder image at a second bitrate; the first speed is less than the second speed, the display smoothness corresponding to the first bitrate is less than the display smoothness corresponding to the second bitrate, and the display clarity corresponding to the first bitrate is greater than the display clarity corresponding to the second bitrate.
4. The method according to claim 3, characterized in that, When the relative speed is less than or equal to the first speed threshold, the electronic device displays the viewfinder image with a third display parameter; the third display parameter includes a third frame rate and / or a third bit rate; wherein the display smoothness corresponding to the third display parameter is less than or equal to the display smoothness corresponding to the first display parameter, and the display clarity corresponding to the third display parameter is greater than or equal to the display clarity corresponding to the first display parameter; When the relative speed is greater than or equal to the second speed threshold, the electronic device displays the viewfinder image with a fourth display parameter; the first speed threshold is less than the second speed threshold; the fourth display parameter includes a fourth frame rate and / or a fourth bit rate; wherein, the display smoothness corresponding to the fourth display parameter is greater than or equal to the display smoothness corresponding to the second display parameter, and the display clarity corresponding to the fourth display parameter is less than or equal to the display clarity corresponding to the second display parameter.
5. The method according to any one of claims 2-4, characterized in that, The relative motion information includes relative acceleration, the first motion information includes a first acceleration, and the second motion information includes a second acceleration; When the relative acceleration is a first acceleration, the electronic device displays the viewfinder image at a first frame rate; when the relative acceleration is a second acceleration, the electronic device displays the viewfinder image at a second frame rate; the first acceleration is less than the second acceleration, the display smoothness corresponding to the first frame rate is less than the display smoothness corresponding to the second frame rate, and the display clarity corresponding to the first frame rate is greater than the display clarity corresponding to the second frame rate. And / or, When the relative acceleration is a first acceleration, the electronic device displays the viewfinder image at a first bitrate; when the relative acceleration is a second acceleration, the electronic device displays the viewfinder image at a second bitrate; the first acceleration is less than the second acceleration, the display smoothness corresponding to the first bitrate is less than the display smoothness corresponding to the second bitrate, and the display clarity corresponding to the first bitrate is greater than the display clarity corresponding to the second bitrate.
6. The method according to claim 5, characterized in that, When the relative acceleration is less than or equal to the first acceleration threshold, the electronic device displays the viewfinder image with a fifth display parameter; the fifth display parameter includes a fifth frame rate and / or a fifth bit rate; wherein, the display smoothness corresponding to the fifth display parameter is less than or equal to the display smoothness corresponding to the first display parameter, and the display clarity corresponding to the fifth display parameter is greater than or equal to the display clarity corresponding to the first display parameter; When the relative acceleration is greater than or equal to the second acceleration threshold, the electronic device displays the viewfinder image with a sixth display parameter; the first acceleration threshold is less than the second acceleration threshold; the sixth display parameter includes a sixth frame rate and / or a sixth bit rate; wherein, the display smoothness corresponding to the sixth display parameter is greater than or equal to the display smoothness corresponding to the second display parameter, and the display clarity corresponding to the sixth display parameter is less than or equal to the display clarity corresponding to the second display parameter.
7. The method according to claim 4 or 6, characterized in that, The method further includes: The electronic device adjusts the fourth and sixth display parameters according to the remaining memory space; wherein, the values of the fourth and sixth display parameters when the remaining memory space of the electronic device is greater than a preset capacity threshold are greater than the values of the fourth and sixth display parameters when the remaining memory space of the electronic device is less than or equal to the preset capacity threshold.
8. The method according to claim 4 or 6, characterized in that, The method further includes: The electronic device adjusts the fourth and sixth display parameters according to the temperature value; wherein, the values of the fourth and sixth display parameters corresponding to the condition where the temperature value of the electronic device is less than a preset temperature limit threshold are greater than the values of the fourth and sixth display parameters corresponding to the condition where the temperature value of the electronic device is greater than or equal to the preset temperature limit threshold.
9. The method according to any one of claims 1-4, characterized in that, The electronic device also includes a gyroscope sensor; the electronic device acquires relative motion information between itself and the subject being photographed, including: The electronic device detects the relative motion information between itself and the object being photographed via the gyroscope sensor; and / or The electronic device detects the relative motion information between itself and the object being photographed through the camera.
10. The method according to claim 1, characterized in that, The method further includes: When the electronic device is in an outdoor scene, if the exposure duration of the camera is greater than the third duration and less than the first duration, the electronic device adjusts the exposure gain of the camera to the maximum gain limit value and adjusts the corresponding exposure duration of the camera to the fourth duration; wherein, the third duration is less than the second duration; or, When the electronic device is in an outdoor scene, if the exposure time of the camera is less than or equal to the third duration, the electronic device maintains the exposure time of the camera.
11. An electronic device, characterized in that, The electronic device includes: a communication module, a display screen, a memory, and one or more processors; the communication module, the display screen, the memory, and the processors are coupled; the memory is used to store computer program code, the computer program code including computer instructions, which, when executed by the electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed in an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 10.
13. A computer program product, characterized in that, The computer program product includes instructions that, when executed in an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Method for controlling code rate based on human eye sensing model
CN101534432A
Frame rate adjusting method, device, equipment and system
CN117425064A