Image processing method and device
By obtaining road path data from the preview interface of the mobile phone, and adaptively adjusting the anti-shake strategy, the problem of poor anti-shake effect in the existing technology is solved, and better anti-shake effect and natural pictures are achieved.
Patent Information
- Application Number
- CN202210131660.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-11
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-02-11
AI Technical Summary
Due to the storage and processing capabilities of existing mobile phones, due to the limitations of storage and processing power in terms of video recording, only some future frames can be cached for analysis, resulting in poor anti-shake effect.
By obtaining the path data of the road traveling, including road curvature and flatness, the electronic anti-shake strategy is adaptively adjusted to optimize the anti-shake effect.
Improve the video anti-shake effect, making the shooting image more natural and stable, and adapting to the anti-shake needs of different road types.
Smart Images

Figure CN114531545B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of camera technology, and specifically relates to an image processing method and an image processing device. Background Art
[0002] With the rise of multiple short video applications, short video shooting has become an important function of smartphones. However, when taking photos, the photographer often shakes the lens due to hand shaking, and it is even more difficult to control the lens shaking when shooting videos, so the video anti-shake function of the mobile phone is very important.
[0003] Currently, mobile phones can support caching and analyzing future frame images to plan stabilization routes for video recording. However, due to the limitations of mobile phone storage and processing, they only cache some future frames for analysis to plan stabilization routes in the next 1 second or even less, and the stabilization effect is not good. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide an image processing method and device that can solve the problem of poor anti-shake effect in the existing environment.
[0005] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:
[0006] When the photo preview interface is displayed, the path data of the road being traveled is obtained;
[0007] Performing electronic image stabilization processing on the preview image according to the path data;
[0008] The path data includes road curvature and road flatness.
[0009] In a second aspect, an embodiment of the present application provides an image processing device, the device comprising:
[0010] An acquisition module, used to acquire path data of the traveling road when displaying the photo preview interface;
[0011] A processing module, used for performing electronic image stabilization processing on the preview image according to the path data;
[0012] The path data includes road curvature and road flatness.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0016] In the embodiment of the present application, when displaying the photo preview interface, it will obtain the path data of the road being traveled, and perform electronic image stabilization on the preview image according to the path data. Since the path data includes the curvature and flatness of the road, that is, when displaying the photo preview interface, it can adaptively adjust the electronic image stabilization strategy based on the path data of the road being traveled, such as the curvature and flatness of the road being traveled, so that the image stabilization effect is better and the shooting picture is more natural. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flowchart of an image processing method provided in an embodiment of the present application;
[0018] Figure 2 It is a schematic diagram of the interface display of an electronic device provided in an embodiment of the present application;
[0019] Figure 3 is a schematic diagram of an interface display of an electronic device provided by another embodiment of the present application;
[0020] Figure 4 is a schematic diagram of an interface display of an electronic device provided by another embodiment of the present application;
[0021] Figure 5 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;
[0022] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0023] Figure 7 It is a structural schematic diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0025] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0026] The image processing method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0027] Please see Figure 1 , which is a flow chart of an image processing method provided in an embodiment of the present application. The method can be applied to an electronic device, which can be a mobile phone, a tablet computer, a laptop computer, etc. Figure 1 As shown, the method may include steps 1100 to 1200, which are described in detail below.
[0028] Step 1100, when displaying the photo preview interface, obtain the path data of the road being traveled.
[0029] The photo preview interface may be an interface displayed after entering a photo application. The photo preview interface may be a video recording interface for video recording, or an image capture interface for image capture, that is, the image processing method of this embodiment may be performed during video recording or during image capture.
[0030] The path data may include the curvature of the road and the flatness of the road. The path data may also include the current travel distance of the target object on the travel road. The target object may be a user traveling on the travel road.
[0031] In one example, the path data includes road curvature and road flatness. In this example, obtaining the path data of the traveling road in step 1100 may further include:
[0032] Method 1: The image of the road is captured by a first camera, the image of the road is recognized, and the path data of the road is obtained.
[0033] The first camera may be a rear main camera. In this method, the image of the road can be collected by the rear main camera. The image can be Figure 2 or Figure 3The image shown in the figure is used to identify the image of the road to be traveled, and the path data of the road to be traveled, such as the road curvature and road flatness of the road to be traveled, is obtained.
[0034] Method 2: Obtain the path data through a map application.
[0035] The map application may be any map navigation application in an electronic device. In this manner, when it is necessary to obtain path data, the user may actively open the map application and obtain the road curvature and road flatness of the road being traveled through the map application.
[0036] In one example, the path data includes not only the curvature and flatness of the road, but also the current travel distance of the target object on the road. In this example, obtaining the path data of the road in step 1100 may further include the following steps 1110 to 1130:
[0037] Step 1110, collecting an image of the road through a wide-angle camera, identifying the image of the road, and obtaining the road curvature and road flatness.
[0038] A wide-angle camera can recognize a wider range and increase the field of view. In this example, a wide-angle camera can be used to collect images of the road. The image can be Figure 4 The image shown in the figure is used to identify the image of the road to be traveled, and the path data of the road to be traveled, such as the road curvature and road flatness of the road to be traveled, is obtained.
[0039] Step 1120: Acquire depth information of the image of the road and motion data of the electronic device.
[0040] The depth information is used to indicate the actual distance between the electronic device and each point on the road displayed on the currently captured image, wherein the actual distance may include, for example, the distance between the electronic device and the end point of the road displayed on the currently captured image by the wide-angle camera.
[0041] In this step 1120, a depth image corresponding to the image of the road can be obtained first, and the depth information of each pixel point of the road in the depth image can be obtained as the actual distance between the electronic device and each point on the road displayed on the currently captured image.
[0042] In this step 1120, after obtaining the actual distance between the electronic device and each point on the road displayed on the currently captured image, combined with the motion data collected by the gyroscope, accelerometer, etc. in the electronic device, the current distance of the target object on the road can be calculated in real time.
[0043] In this example, after obtaining the depth information of the road, the wide-angle camera is turned off; when the current travel distance exceeds the total travel distance of the road, the wide-angle camera is turned on to collect images of the road again through the wide-angle camera.
[0044] The total travel distance of the road can be the distance between the electronic device and the end point of the road displayed on the current image captured by the wide-angle camera. After acquiring the depth information of the road to obtain the real distance between the electronic device and each point on the road displayed on the current image, the wide-angle camera can be turned off to reduce the power consumption of the wide-angle camera. At the same time, if the current travel distance exceeds the total travel distance of the road, indicating that the travel distance of the target object on the road exceeds the range of the current image captured, it is necessary to turn on the wide-angle camera again to capture the image of the road, which can greatly optimize power consumption.
[0045] Step 1130: Determine the current travel distance of the target object on the travel road according to the depth information and the motion data.
[0046] In this step 1130, after obtaining the depth image corresponding to the image of the road according to the above steps to obtain the actual distance between the electronic device and each point on the road displayed on the currently captured image, the current distance of the target object on the road can be calculated in real time in combination with the motion data collected by the gyroscope, accelerometer, etc. in the electronic device.
[0047] When the photo preview interface is displayed, after obtaining the path data of the road you are traveling, enter:
[0048] Step 1200: Perform electronic image stabilization processing on the preview image according to the path data.
[0049] In this embodiment, after the path data of the traveling road is obtained, the electronic anti-shake strategy can be determined according to the path data, and then the preview image can be electronically anti-shake processed.
[0050] In one example, the path data includes road curvature and road flatness. In step 1200, performing electronic image stabilization processing on the preview image according to the path data may further include the following steps 1210a to 1240a:
[0051] Step 1210a: Determine the path type of the travel road according to the road curvature and the road flatness.
[0052] Step 1220a: When the path type is a curved path, perform electronic image stabilization on the preview image according to a first electronic image stabilization strategy.
[0053] The anti-shake strength of the first electronic anti-shake strategy is less than a set anti-shake strength threshold, wherein the set anti-shake strength threshold may be a preset anti-shake strength.
[0054] In this step 1220a, when the path type is a curved path, such as Figure 2 As shown, the preview image may be electronically anti-shake processed based on an EIS electronic anti-shake strategy in which the anti-shake strength is less than a set anti-shake strength threshold, so as to increase the smoothness of the picture and ensure that the picture is smooth during the turning process.
[0055] Step 1230a: When the path type is a straight path, perform electronic image stabilization processing on the preview image according to a second electronic image stabilization strategy.
[0056] The anti-shake strength of the second electronic anti-shake strategy is greater than the set anti-shake strength threshold.
[0057] In this step 1230a, when the path type is a straight path, such as Figure 3 As shown, the preview image may be electronically anti-shake processed based on an EIS electronic anti-shake strategy whose anti-shake strength is greater than a set anti-shake strength threshold, so as to maintain the stability of the picture to the greatest extent possible.
[0058] In one example, the path data includes not only the road curvature and the road flatness, but also the current travel distance of the target object on the road. In step 1200, electronic image stabilization processing of the preview image according to the path data may further include the following steps 1210b to 1240b:
[0059] Step 1210b: Determine the path type of the traveling road according to the road curvature and the road flatness.
[0060] Path types include the above curved paths and straight paths.
[0061] Step 1220b: Determine a target electronic image stabilization strategy according to the path type and the current travel distance of the target object on the path.
[0062] In step 1220b, when the traveling road is a curved path, a matching EIS electronic anti-shake strategy can be determined in real time according to the position of the target object on the curved path as the target electronic anti-shake strategy. For example, when the target object travels to a position with a larger turn on the curved path, the preview image can be electronically anti-shake processed based on the EIS electronic anti-shake strategy with a smaller anti-shake strength to ensure that the image is smooth when turning.
[0063] In step 1220b, when the road is a straight path, the matching EIS electronic anti-shake strategy can be determined in real time according to the position of the target object on the straight path as the target electronic anti-shake strategy. In this example, for example, when the target object travels to a straighter position on the straight path, the preview image can be electronically anti-shake processed based on the EIS electronic anti-shake strategy with a greater anti-shake strength to maximize the image stability.
[0064] Step 1230b: Perform electronic image stabilization processing on the preview image according to the target electronic image stabilization strategy.
[0065] According to the method of the embodiment of the present application, when displaying the photo preview interface, the path data of the road being traveled is obtained, and the preview image is electronically stabilized according to the path data. Since the path data includes the curvature and flatness of the road, that is, when displaying the photo preview interface, the electronic anti-shake strategy can be adaptively adjusted based on the path data of the road being traveled, such as the curvature and flatness of the road being traveled, so that the anti-shake effect is better and the shooting picture is more natural.
[0066] Next, an example of an image processing method is shown. In this example, the image processing method includes the following steps:
[0067] Step 2100, during the video recording process, an image of the road is collected by the rear main camera, and the image of the road is recognized to obtain the road curvature and road flatness of the road.
[0068] Step 2200, determining the path type of the travel road according to the road curvature and road flatness.
[0069] Step 2300: When the path type is a curved path, electronic image stabilization is performed on the preview image according to a first electronic image stabilization strategy.
[0070] Step 2400: When the path type is a straight path, electronic image stabilization is performed on the preview image according to the second electronic image stabilization strategy.
[0071] According to this example, during the video recording process, it is possible to identify the path type of the road being traveled, and then optimize the preset electronic anti-shake processing to obtain the best electronic anti-shake strategy, making the video image more natural and the anti-shake effect better.
[0072] Next, another example of an image processing method is shown. In this example, the image processing method includes the following steps:
[0073] Step 3100, during the video recording process, the image of the traveling road is collected by a wide-angle camera, the image of the traveling road is recognized, and the road curvature and road flatness of the traveling road are obtained.
[0074] Step 3200, obtaining depth information of the image of the road to obtain the actual distance between the electronic device and each point on the road displayed on the currently captured image, and turning off the wide-angle camera.
[0075] Step 3300, obtaining motion data of the electronic device.
[0076] Step 3400, determining the current travel distance of the target object on the travel road according to the actual distance between the electronic device and each point on the travel road displayed on the currently captured image and the motion data.
[0077] Step 3500, determine the path type of the road according to the road curvature and road flatness; determine the target electronic image stabilization strategy according to the path type and the current travel distance of the target object on the road; and perform electronic image stabilization processing on the preview image according to the target electronic image stabilization strategy.
[0078] Step 3600: When the current travel distance exceeds the total travel distance of the road, the wide-angle camera is turned on to collect images of the road again through the wide-angle camera.
[0079] According to this example, the addition of a wide-angle camera can determine the target electronic anti-shake strategy according to the curvature and flatness of the road and the trajectory of the target object on the road, thereby improving the accuracy of the electronic anti-shake strategy adjustment.
[0080] Corresponding to the above embodiment, see Figure 5 The embodiment of the present application further provides an image processing device 500, comprising:
[0081] The acquisition module 510 is used to acquire the path data of the traveled road when displaying the photo preview interface.
[0082] The processing module 520 is used to perform electronic image stabilization processing on the preview image according to the path data.
[0083] The path data includes road curvature and road flatness.
[0084] In one embodiment, the acquisition module 510 is specifically used to: collect the image of the road through a first camera, identify the image of the road, and obtain the path data of the road; or, obtain the path data through a map application.
[0085] In one embodiment, the path data also includes the current travel distance of the target object on the road, and the acquisition module 510 is specifically used to: collect the image of the road through a wide-angle camera, identify the image of the road, and obtain the road curvature and road flatness of the road; obtain the depth information of the image of the road and the motion data of the electronic device; and determine the current travel distance of the target object on the road based on the depth information and the motion data.
[0086] The processing module 520 is also used to turn on the wide-angle camera after the acquisition module 510 acquires the path data, when the current travel distance exceeds the total travel distance of the travel road, so as to collect the image of the travel road again through the wide-angle camera.
[0087] In one embodiment, the processing module 520 is specifically used to: determine the path type of the road according to the road curvature and the road flatness; determine the target electronic image stabilization strategy according to the path type and the current travel distance of the target object on the path; and perform electronic image stabilization processing on the preview image according to the target electronic image stabilization strategy.
[0088] In one embodiment, the processing module 520 is specifically used to: determine the path type of the traveling road according to the road curvature and the road flatness; when the path type is a curved path, perform electronic anti-shake processing on the preview image according to a first electronic anti-shake strategy; when the path type is a straight path, perform electronic anti-shake processing on the preview image according to a second electronic anti-shake strategy.
[0089] The anti-shake strength of the first electronic anti-shake strategy is less than a set anti-shake strength threshold, and the anti-shake strength of the second electronic anti-shake strategy is greater than the set anti-shake strength threshold.
[0090] According to the embodiment of the present application, when displaying the photo preview interface, the path data of the road being traveled will be obtained, and the preview image will be electronically stabilized according to the path data. Since the path data includes the curvature and flatness of the road, that is, when displaying the photo preview interface, the electronic anti-shake strategy can be adaptively adjusted based on the path data of the road being traveled, such as the curvature and flatness of the road being traveled, so that the anti-shake effect is better and the shooting picture is more natural.
[0091] The image processing device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0092] The image processing in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0093] The image processing provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.
[0094] Corresponding to the above embodiment, optionally, Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601, a memory 602, and a program or instruction stored in the memory 602 and executable on the processor 601. When the program or instruction is executed by the processor 601, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0095] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0096] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0097] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
[0098] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0099] The processor 710 is used to obtain the path data of the road being traveled when displaying the photo preview interface; and perform electronic image stabilization processing on the preview image according to the path data; wherein the path data includes the curvature and flatness of the road.
[0100] In one embodiment, the processor 710 is further configured to capture an image of the road through a first camera, identify the image of the road, and obtain path data of the road; or, obtain the path data through a map application.
[0101] In one embodiment, the path data further includes the current travel distance of the target object on the travel road.
[0102] The processor 710 is further configured to collect an image of the road through a wide-angle camera, identify the image of the road, obtain the curvature and flatness of the road, obtain depth information of the image of the road and motion data of the electronic device, and determine the current travel distance of the target object on the road according to the depth information and the motion data. And, after obtaining the depth information of the road, turn off the wide-angle camera; when the current travel distance exceeds the total travel distance of the road, turn on the wide-angle camera to collect the image of the road again through the wide-angle camera.
[0103] In one embodiment, the processor 710 is further used to determine the path type of the road according to the road curvature and the road flatness; determine the target electronic image stabilization strategy according to the path type and the current travel distance of the target object on the path; and perform electronic image stabilization processing on the preview image according to the target electronic image stabilization strategy.
[0104] In one embodiment, the processor 710 is further used to determine the path type of the traveling road according to the road curvature and the road flatness; when the path type is a curved path, the preview image is electronically anti-shake processed according to a first electronic anti-shake strategy; when the path type is a straight path, the preview image is electronically anti-shake processed according to a second electronic anti-shake strategy; wherein the anti-shake strength of the first electronic anti-shake strategy is less than a set anti-shake strength threshold, and the anti-shake strength of the second electronic anti-shake strategy is greater than the set anti-shake strength threshold.
[0105] According to the embodiment of the present application, when displaying the photo preview interface, the path data of the road being traveled will be obtained, and the preview image will be electronically stabilized according to the path data. Since the path data includes the curvature and flatness of the road, that is, when displaying the photo preview interface, the electronic anti-shake strategy can be adaptively adjusted based on the path data of the road being traveled, such as the curvature and flatness of the road being traveled, so that the anti-shake effect is better and the shooting picture is more natural.
[0106] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 709 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 710 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 710.
[0107] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0108] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0109] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0110] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0111] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0113] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An image processing method, characterized in that: include: When the photo preview interface is displayed, the path data of the road being traveled is obtained; Performing electronic image stabilization processing on the preview image according to the path data; Among them, the path data includes road curvature and road flatness, and the road curvature and road flatness are used to determine the path type of the travel road. When the path type is a curved path, the road curvature is inversely proportional to the anti-shake strength of the electronic anti-shake processing. When the path type is a straight path, the road flatness is directly proportional to the anti-shake strength.
2. The method according to claim 1, characterized in that The step of obtaining the path data of the traveling road comprises: Capturing an image of the travel road through a first camera, recognizing the image of the travel road, and obtaining path data of the travel road; Alternatively, the route data may be obtained through a map application.
3. The method according to claim 1, characterized in that The path data also includes the current travel distance of the target object on the travel road. The step of obtaining the path data of the traveling road comprises: The image of the road is collected by a wide-angle camera, the image of the road is recognized, and the curvature and flatness of the road are obtained; Acquiring depth information of the image of the traveling road and motion data of the electronic device; Determining a current travel distance of the target object on the travel road according to the depth information and the motion data; After acquiring the depth information of the traveling road, the method further includes: Turning off the wide-angle camera; When the current travel distance exceeds the total travel distance of the travel road, the wide-angle camera is turned on to collect the image of the travel road again through the wide-angle camera.
4. The method according to claim 3, characterized in that The electronic image stabilization processing of the preview image according to the path data includes: Determining the path type of the traveling road according to the road curvature and the road flatness; Determining a target electronic image stabilization strategy according to the path type and the current travel distance of the target object on the travel road; According to the target electronic anti-shake strategy, electronic anti-shake processing is performed on the preview image.
5. The method according to claim 1, characterized in that The electronic image stabilization processing of the preview image according to the path data includes: Determining the path type of the traveling road according to the road curvature and the road flatness; When the path type is a curved path, performing electronic anti-shake processing on the preview image according to a first electronic anti-shake strategy; When the path type is a straight path, performing electronic anti-shake processing on the preview image according to a second electronic anti-shake strategy; The anti-shake strength of the first electronic anti-shake strategy is less than a set anti-shake strength threshold, and the anti-shake strength of the second electronic anti-shake strategy is greater than the set anti-shake strength threshold.
6. An image processing device, characterized in that: include: An acquisition module, used to acquire path data of the traveling road when displaying the photo preview interface; A processing module, used for performing electronic image stabilization processing on the preview image according to the path data; Among them, the path data includes road curvature and road flatness, and the road curvature and road flatness are used to determine the path type of the travel road. When the path type is a curved path, the road curvature is inversely proportional to the anti-shake strength of the electronic anti-shake processing. When the path type is a straight path, the road flatness is directly proportional to the anti-shake strength.
7. The device according to claim 6, characterized in that The acquisition module is specifically used for: Capturing an image of the travel road through a first camera, recognizing the image of the travel road, and obtaining path data of the travel road; Alternatively, the route data may be obtained through a map application.
8. The device according to claim 6, characterized in that The path data also includes the current travel distance of the target object on the travel road. The acquisition module is specifically used to: The image of the road is collected by a wide-angle camera, the image of the road is recognized, and the curvature and flatness of the road are obtained; Acquiring depth information of the image of the traveling road and motion data of the electronic device; Determining a current travel distance of the target object on the travel road according to the depth information and the motion data; The processing module is also used to: after the acquisition module acquires the path data of the road, when the current travel distance exceeds the total travel distance of the road, turn on the wide-angle camera to collect the image of the road again through the wide-angle camera.
9. The device according to claim 8, characterized in that The processing module is specifically used for: Determining the path type of the traveling road according to the road curvature and the road flatness; Determining a target electronic image stabilization strategy according to the path type and the current travel distance of the target object on the travel road; According to the target electronic anti-shake strategy, electronic anti-shake processing is performed on the preview image.
10. The device according to claim 6, characterized in that The processing module is specifically used for: Determining the path type of the traveling road according to the road curvature and the road flatness; When the path type is a curved path, performing electronic anti-shake processing on the preview image according to a first electronic anti-shake strategy; When the path type is a straight path, performing electronic anti-shake processing on the preview image according to a second electronic anti-shake strategy; The anti-shake strength of the first electronic anti-shake strategy is less than a set anti-shake strength threshold, and the anti-shake strength of the second electronic anti-shake strategy is greater than the set anti-shake strength threshold.
