A dynamic processing method and device of a UAV aerial image and an intelligent terminal
By dynamically adjusting the screenshot area of drone aerial images, the problem of image resolution mismatch was solved, enabling the switching between horizontal and vertical shooting modes of drone images on mobile devices, reducing hardware costs and improving user experience.
Patent Information
- Application Number
- CN202211174606.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-09-26
AI Technical Summary
The existing drone video transmission system suffers from issues such as image resolution mismatch with mobile device screens, complex mechanical gimbal control algorithms, and high hardware costs.
By acquiring the resolution of drone aerial images and the resolution of the display device, and combining roll and pitch data, the screenshot area is dynamically adjusted to achieve automatic switching between horizontal and vertical shooting modes. The gravity sensor is used to determine the orientation of the display device and control the screenshot resolution and rotation angle, thus avoiding hardware upgrades.
It achieves dynamic adaptation of drone images, meets the horizontal and vertical shooting requirements of mobile devices, reduces hardware costs, and improves user experience.
Smart Images

Figure CN115457419B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing of unmanned aerial vehicle aerial photography, and particularly relates to a dynamic processing method and device of unmanned aerial vehicle aerial photography image and an intelligent terminal. BACKGROUND
[0002] The existing unmanned aerial vehicle video transmission video display is all in horizontal screen display, but mobile device users are used to watching video images in vertical screen, which causes the image resolution of video transmission video and the mobile device screen to be mismatched. Therefore, the demand for vertical screen aerial photography of unmanned aerial vehicles gives rise to a vertical shooting scheme taking a mechanical gimbal as a carrier, that is, by rotating the mechanical gimbal mounted on the unmanned aerial vehicle by 90 degrees to change the shooting angle of the camera, the demand of users for watching video in vertical screen is realized.
[0003] Among the mechanical gimbals, only the 4-axis mechanical gimbal can realize the vertical shooting mode. Three of the four axes are used for video stabilization, that is, to prevent video image shaking, and the other axis is specially used for controlling the shooting angle of the camera to realize vertical shooting. This requires changing the design of the gimbal on the basis of the 2-axis or 3-axis mechanical gimbal, and adding an additional motor to control the rotation of the camera. The control algorithm is complex, and the hardware cost is high.
[0004] Therefore, the prior art still needs to be improved and developed. SUMMARY
[0005] The technical problem to be solved by the present application is to provide a dynamic processing method and device of unmanned aerial vehicle aerial photography image and an intelligent terminal aiming at the above-mentioned defects of the prior art, and aiming at solving the problem of mismatch between the image resolution of video transmission video and the mobile device screen in the prior art, especially the problem of complex control algorithm and high hardware cost of the modified mechanical gimbal.
[0006] The technical scheme adopted by the present application to solve the technical problem is as follows:
[0007] In a first aspect, the present application provides a dynamic processing method of unmanned aerial vehicle aerial photography image, wherein the method comprises:
[0008] obtaining a first image and obtaining the resolution of a display device, obtaining a first starting coordinate according to the resolution of the first image and the resolution of the display device;
[0009] obtaining the roll data and the pitch data of the display device, and obtaining the offset pixel position according to the roll data and the pitch data;
[0010] adjusting the first starting coordinate according to the offset pixel position to obtain a second starting coordinate;
[0011] obtaining a second image by cutting the first image according to the second starting coordinate.
[0012] In an implementation manner, the first image is acquired, and a resolution of the display device is acquired, and a first starting coordinate is obtained according to the resolution of the first image and the resolution of the display device, including:
[0013] Collecting video data of aerial photography of the unmanned aerial vehicle;
[0014] According to each frame image in the video data, the first image is obtained; wherein the resolution of the first image is WxH, and W>H;
[0015] The resolution of the display device is MxN, and M<N<H;
[0016] The first starting coordinate is obtained according to the resolution of the first image and the resolution of the display device
[0017] In an implementation manner, the roll data and the pitch data of the display device are acquired, and an offset pixel position is obtained according to the roll data and the pitch data, including:
[0018] The roll data and the pitch data of the display device are acquired, and a rotation angle is obtained according to the roll data and the pitch data;
[0019] The offset pixel position is obtained according to the rotation angle and a preset sensitivity parameter.
[0020] In an implementation manner, the roll data and the pitch data of the display device are acquired, and a rotation angle is obtained according to the roll data and the pitch data, including:
[0021] According to a reading frequency F, the roll data r i and the pitch data p i of the gyroscope sensor are acquired, i=1, 2,..., n, wherein the reading frequency F is consistent with the frame rate of the unmanned aerial vehicle aerial photography of the video data;
[0022] The rotation angle is obtained according to the roll data and the pitch data i = r i -r i-1 , α i =p i -p i-1 , i=1, 2,..., n; wherein θ i is a horizontal axis rotation angle, and α i is a vertical axis rotation angle.
[0023] In an implementation manner, the offset pixel position is obtained according to the rotation angle and a preset sensitivity parameter, including:
[0024] a preset sensitivity parameter;
[0025] obtaining the offset pixel position off_w i = k x tan (θ i ), off_h i = k x tan (α i ), i = 1, 2,..., n; wherein off_w i is a horizontal axis offset pixel position, off_h i is a vertical axis offset pixel position, k is the preset sensitivity parameter, θ i is a horizontal axis rotation angle, and α i is a vertical axis rotation angle.
[0026] In an implementation manner, the adjusting the first starting coordinate according to the offset pixel position to obtain a second starting coordinate comprises:
[0027] adjusting the first starting coordinate according to the offset pixel position to obtain a second starting coordinate (pos_w i = pos_w i -1 + off_w i , pos_h i = pos_h i -1 + off_h i ), i = 1, 2,..., n.
[0028] In an implementation manner, the obtaining the second image according to the second starting coordinate comprises:
[0029] obtaining a placement posture flag data g i , i = 0, 1, 2, 3; wherein g0 represents a normal vertical screen, g1 represents a left horizontal screen, g2 represents an upside-down vertical screen, and g3 represents a right horizontal screen.
[0030] if the placement posture flag data is g0, obtaining a screenshot resolution as M x N, and performing screenshot in the first image with the second starting coordinate as a starting position, with the screenshot resolution M x N to determine a screenshot size, to obtain the second image;
[0031] if the placement posture flag data is g1, obtaining the screenshot resolution as N x M, and performing screenshot in the first image with the second starting coordinate as a starting position, with the screenshot resolution N x M to determine a screenshot size, to obtain the second image;
[0032] If the placement posture flag data is g2, a screenshot resolution is obtained as MxN, a screenshot size is determined in the first image with the second starting coordinate as a starting position and the screenshot resolution MxN, the obtained screenshot is rotated by 180 degrees to obtain the second image;
[0033] If the placement posture flag data is g3, a screenshot resolution is obtained as NxM, a screenshot size is determined in the first image with the second starting coordinate as a starting position and the screenshot resolution NxM, and the obtained screenshot is rotated by 180 degrees to obtain the second image.
[0034] In a second aspect, an embodiment of the present application further provides a dynamic processing device for a UAV aerial image, wherein the device comprises:
[0035] A first starting coordinate acquisition module is configured to acquire a first image, acquire a resolution of a display device, and obtain a first starting coordinate according to a resolution of the first image and the resolution of the display device;
[0036] An offset pixel position acquisition module is configured to acquire roll data and pitch data of the display device, and obtain an offset pixel position according to the roll data and the pitch data;
[0037] A second starting coordinate acquisition module is configured to adjust the first starting coordinate according to the offset pixel position to obtain a second starting coordinate;
[0038] A second image acquisition module is configured to acquire the first image according to the second starting coordinate to obtain a second image.
[0039] In a third aspect, an embodiment of the present application further provides an intelligent terminal, wherein the display device comprises a memory, a processor, and a dynamic processing program for a UAV aerial image stored in the memory and executable on the processor, and the processor executes the dynamic processing program for the UAV aerial image, thereby realizing the steps of the dynamic processing method for the UAV aerial image according to any one of the above.
[0040] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a dynamic processing program for a UAV aerial image, and the dynamic processing program for the UAV aerial image is executed by a processor, thereby realizing the steps of the dynamic processing method for the UAV aerial image according to any one of the above.
[0041] Beneficial effects: compared with the prior art, the application provides a dynamic processing method of unmanned aerial vehicle aerial image, the application can judge whether the display device is placed horizontally or vertically through a gravity sensing sensor, so as to control the screenshot resolution and rotation angle, realize the automatic switching of the horizontal shooting mode and the vertical shooting mode of the mobile device, dynamically adjust the screenshot area according to the change of the roll data and the pitch data of the display device, and realize the horizontal shooting mode and the vertical shooting mode by taking the second image suitable for the resolution of the display device from the first image collected, so that the dynamic horizontal shooting and vertical shooting functions can be realized according to the real-time state without upgrading the gimbal device hardware, and the hardware cost is saved. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0043] Figure 1 It is a dynamic processing method flow diagram of the aerial image of the unmanned aerial vehicle provided by the embodiment of the present application.
[0044] Figure 2 It is a horizontal screen image interception schematic diagram provided by the embodiment of the present application.
[0045] Figure 3 It is a vertical screen image interception schematic diagram provided by the embodiment of the present application.
[0046] Figure 4 It is a principle block diagram of the dynamic processing device of the aerial image of the unmanned aerial vehicle provided by the embodiment of the present application.
[0047] Figure 5 It is an internal structure principle block diagram of the intelligent terminal provided by the embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical scheme and effect of the present application more clear and definite, the present application will be further described in detail below with reference to the drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0049] Users using mobile devices are used to viewing videos in portrait mode, while existing UAV video display is in landscape mode, so the portrait mode conversion function of UAV video display becomes a hot demand. The existing UAV video display scheme that can realize portrait mode is realized by mechanical gimbal. However, the ordinary mechanical gimbal is 2-axis or 3-axis, and the two mechanical gimbals cannot realize portrait mode. Only by changing the design of the gimbal, adding an additional motor to control the rotation of the camera, and becoming a 4-axis mechanical gimbal, can the portrait mode be realized. The control algorithm of this scheme is more complex than that of 2-axis or 3-axis mechanical gimbal, and the hardware cost is also increased.
[0050] Therefore, in order to solve the above problems, the embodiment provides a dynamic processing method of UAV aerial image. The method can determine whether the display device is placed in landscape mode or portrait mode through a gravity sensing sensor, control the screenshot resolution and rotation angle, realize the automatic switching of the mobile device end landscape mode and portrait mode, dynamically adjust the screenshot area according to the change of the roll data and pitch data of the display device, and realize the landscape mode and portrait mode by taking the second image suitable for the resolution of the display device from the first image, so that the hardware of the gimbal device does not need to be upgraded, the dynamic landscape and portrait functions can be realized according to the real-time state, and the hardware cost is saved. In specific implementation, the first starting coordinate is obtained according to the resolution of the first image and the resolution of the display device, the offset pixel position is obtained through the roll data and the pitch data, the first starting coordinate is adjusted according to the offset pixel position to obtain the second starting coordinate in the final screenshot, and finally the first image is taken according to the second starting coordinate to realize the dynamic adjustment of the screenshot area.
[0051] Exemplary method
[0052] The embodiment provides a dynamic processing method of UAV aerial image, and the embodiment can be applied to a UAV. As shown in the figure, the method comprises the following steps: Figure 1
[0053] In step S100, a first image is acquired, and the resolution of a display device is acquired, and a first starting coordinate is obtained according to the resolution of the first image and the resolution of the display device;
[0054] Specifically, when the first image is acquired, the resolution thereof can be known according to the image attribute. Since the first image is acquired by aerial photography of the UAV, the first image is in landscape mode, i.e., the width is greater than the height. The resolution of the display device is acquired, the display device is used to play the video data of aerial photography of the UAV on the user side, and the resolution of the display device is less than the resolution of the first image. According to the resolution of the first image and the resolution of the display device, the first starting coordinate is calculated, and the first starting coordinate is used to plan the starting position of the screenshot.
[0055] For example, as shown in FIG. 1, the first image acquired by aerial photography of the UAV is shown in FIG. 2, the UAV is in landscape mode (4:3), and the resolution thereof is 4096x3072. The screen of the display device is shown in FIG. 3, the resolution of the display device in the landscape playing mode (16:9) is 2688x1512. According to the resolution 4096x3072 of the first image and the resolution 2688x1512 of the display device, the first starting coordinate is calculated. Figure 2 Figure 2 For example, as shown in FIG. 1, the first image acquired by aerial photography of the UAV is shown in FIG. 2, the UAV is in landscape mode (4:3), and the resolution thereof is 4096x3072. The screen of the display device is shown in FIG. 3, the resolution of the display device in the landscape playing mode (16:9) is 2688x1512. According to the resolution 4096x3072 of the first image and the resolution 2688x1512 of the display device, the first starting coordinate is calculated. Figure 2
[0056] In an implementation manner, the step S100 includes the following steps.
[0057] In an implementation manner, the step S100 includes the following steps.
[0058] In an implementation manner, the step S100 includes the following steps.
[0059] In an implementation manner, the step S100 includes the following steps.
[0060] In an implementation manner, the step S100 includes the following steps.
[0061] Specifically, the unmanned aerial vehicle shoots video data when taking aerial photography, the video data is composed of frames collected at a certain video frame rate, each frame is an image, after collecting the video data of the unmanned aerial vehicle taking aerial photography, the embodiment needs to convert the video data into image data, and then perform image processing, and the frequency of obtaining the first image is the same as the video frame rate, so as to ensure that each frame of image can obtain a first image, and then the resolution of the first image is obtained according to the picture attribute of the first image. Because the resolution of the first image and the resolution of the display device are quite different, if the screen resolution is scaled and then forced to be displayed vertically, the proportion of objects in the picture will be seriously out of adjustment, which affects the visual effect. In order to present the video image to the user without distortion, a second image with the same resolution as the display device needs to be cropped from the first image collected by the camera for vertical screen display, so as to meet the needs of the user for vertical screen viewing and not have the feeling of image proportion distortion. In order to perform image cropping, the starting position of the cropping needs to be known, in the embodiment, the first starting coordinate is calculated according to the resolution of the first image and the resolution of the display device as the basis of the starting position of the starting cropping.
[0062] For example, the video data of the unmanned aerial vehicle taking aerial photography is composed of a plurality of frames, a real-time frame is A1, A1 is taken as the first image, as shown in Figure 3 The resolution of A1 is 4096x3072. The resolution of the display device is 1512x2688, and the first starting coordinate can be obtained according to the calculation formula of the first starting coordinate That is, the first starting coordinate is (1219, 192).
[0063] Step S200, obtaining the roll data and pitch data of the display device, and obtaining the offset pixel position according to the roll data and the pitch data;
[0064] Specifically, the display device will roll and pitch during use, which will cause the viewing field to be offset, so it is necessary to correct the offset pixel position to obtain the best viewing field of the image. The offset pixel position is calculated by the real-time roll data and pitch data of the unmanned aerial vehicle. The roll is the posture of the display device rolling around the longitudinal axis when the two-dimensional coordinate axis is laid on the display device, that is, the roll data reflects the horizontal axis rotation angle, and the pitch is the posture of the display device rotating around the horizontal axis, that is, the pitch data reflects the longitudinal axis rotation angle.
[0065] In one implementation manner, the step S200 of the embodiment includes the following steps:
[0066] Step S201, obtaining the roll data and pitch data of the display device, and obtaining the rotation angle according to the roll data and the pitch data;
[0067] In one implementation, step S201 of this embodiment includes the following steps:
[0068] Step S2011: Obtain the roll data ri and pitch data p from the gyroscope sensor according to the reading frequency F. i , i = 1, 2, ..., n, where the reading frequency F is consistent with the frame rate of the video data captured by the UAV.
[0069] Step S2012: Obtain the rotation angle θ based on the roll data and the pitch data. i =r i -r i-1 α i =p i -p i-1 ,i=1,2,...,n; where, θ i Let α be the rotation angle along the horizontal axis. i The vertical axis is the rotation angle.
[0070] Specifically, if the reading frequency F is consistent with the frame rate of the video data captured by the UAV, it ensures that each frame acquired by the UAV becomes a first image. Each first image corresponds to roll data and pitch data. Furthermore, the roll data and pitch data reflect the rotation angle of the current display device. Roll data r i and pitch data p i It is obtained through a gyroscope. The rotation angle is the rotation angle of the display device when the first image is captured and when the first image is captured last time.
[0071] For example, the gyroscope sensor acquires roll data ri-1 of 5 degrees and pitch data p from the last image acquisition. i -1 represents 5 degrees. The roll data ri acquired during the current image acquisition is 25 degrees, and the pitch data p... i If the degree is 8 degrees, then θ is calculated. i =25-5=5 degrees, αi=8-5=3 degrees.
[0072] Step S202: Obtain the offset pixel position based on the rotation angle and the preset sensitivity parameters.
[0073] In one implementation, step S202 of this embodiment includes the following steps:
[0074] Step S2021: Preset sensitivity parameters;
[0075] Step S2022: Based on the rotation angle and the preset sensitivity parameters, the offset pixel position is obtained as off_w. i =k×tan(θ)i ), off_h i = k x tan(a i ), i = 1, 2,..., n; wherein, off_w i is a horizontal axis offset pixel position, off_h i is a vertical axis offset pixel position, k is a preset sensitivity parameter, θ i is a horizontal axis rotation angle, a i is a vertical axis rotation angle.
[0076] Specifically, the sensitivity parameter is a preset threshold value, and the mobile device is also rotated by 1 degree. If the sensitivity parameter is high, the screenshot offset pixel position is large, and vice versa.
[0077] In the embodiment, three sensitivity gears are preset, which are slow, normal and sensitive. In the slow gear, the mobile device is rotated by 1 degree, and the screenshot offset pixel position is 5 times the pixel value. In the normal gear, the mobile device is rotated by 1 degree, and the screenshot offset pixel position is 10 times the pixel value. In the sensitive gear, the mobile device is rotated by 1 degree, and the screenshot offset pixel position is 20 times the pixel value. The sensitivity parameter can be selected by the user from the three gears preset by the system, or can be set by the user according to the requirement.
[0078] For example, the user selects the sensitive gear in the preset gears, and when the display screen only occurs pitch, the vertical axis rotation angle is 10 degrees, the vertical axis offset pixel position is 20 x tan10°, and the horizontal axis offset pixel position is 0. If the user selects the slow gear in the preset gears at this time, the vertical axis offset pixel position is 5 x tan10°, and the horizontal axis offset pixel position is 0. When the display screen occurs pitch and roll at the same time, the vertical axis rotation angle is 10 degrees and the vertical axis rotation angle is 5 degrees, and if the user sets the sensitivity parameter to 8, the vertical axis offset pixel position is 8 x tan10°, and the horizontal axis offset pixel position is 8 x tan5°.
[0079] Step S300, adjusting the first starting coordinate according to the offset pixel position to obtain a second starting coordinate;
[0080] In an implementation mode, the step S300 of the embodiment includes the following steps:
[0081] Step S301, adjusting the first starting coordinate according to the offset pixel position to obtain a second starting coordinate (pos_w i = pos_w i -1 + off_w i , pos_h i = pos_h i -1 + off_h i), i = 1, 2,..., n.
[0082] Specifically, the horizontal and vertical axes of the first starting coordinates are added to the horizontal and vertical axis offset pixel positions respectively, to obtain the second starting coordinates, thereby determining the starting position of the final screenshot.
[0083] For example, as described in the above example, the first starting coordinates are known to be (1219, 192), the user sets the sensitivity parameter to 8, the vertical axis offset pixel position is 8x tan 10°, and the horizontal axis offset pixel position is 8x tan 5°, so the second starting coordinates are (1219 + 8x tan 5°, 192 + 8x tan 10°) = (1219.7, 197.19).
[0084] Step S400: capturing the first image according to the second starting coordinates to obtain a second image.
[0085] In an implementation manner, the step S400 includes the following steps.
[0086] Step S401: obtaining a placement posture flag data g through a gravity sensing sensor i , i = 0, 1, 2, 3; wherein, g0 represents a normal vertical screen, g1 represents a left horizontal screen, g2 represents an upside-down vertical screen, and g3 represents a right horizontal screen;
[0087] Step S402: if the placement posture flag data is g0, obtaining a screenshot resolution MxN, and capturing a screenshot in the first image with the second starting coordinates as the starting position, with the screenshot resolution MxN to determine the screenshot size, to obtain the second image.
[0088] Step S403: if the placement posture flag data is g1, obtaining the screenshot resolution NxM, and capturing a screenshot in the first image with the second starting coordinates as the starting position, with the screenshot resolution NxM to determine the screenshot size, to obtain the second image.
[0089] Step S404: if the placement posture flag data is g2, obtaining the screenshot resolution MxN, and capturing a screenshot in the first image with the second starting coordinates as the starting position, with the screenshot resolution MxN to determine the screenshot size, and rotating the obtained screenshot by 180 degrees to obtain the second image.
[0090] Step S405: If the placement posture marker data is g3, the screenshot resolution is N×M. In the first image, the second starting coordinate is used as the starting position, and the screenshot size is determined by the screenshot resolution N×M. The obtained screenshot is then rotated 180 degrees to obtain the second image.
[0091] Specifically, by determining the screenshot rotation degree and screenshot resolution based on the placement posture marker data, and using the second starting coordinate as the starting position, the screenshot size is determined according to the screenshot resolution. This achieves the following effects: if the mobile device rotates to the left, a second image is captured in the area slightly to the left of the center of the first image, based on the rotation angle and the set sensitivity parameters; if the mobile device rotates to the right, a second image is captured in the area slightly to the right of the center of the first image, based on the rotation angle and sensitivity parameters; if the mobile device is tilted downwards relative to its initial state, a second image is captured in the area slightly below the center of the first image, based on the pitch angle and sensitivity parameters; if the mobile device is tilted upwards relative to its initial state, a second image is captured in the area slightly above the center of the first image, based on the pitch angle and sensitivity parameters. In portrait mode and landscape mode, the captured screenshot is rotated 180 degrees.
[0092] For example, when using a drone to capture aerial video, if the display device is positioned horizontally... Figure 2 As shown, a second image with a resolution of 2688*1512 is cropped from a 4096x3072 image based on the second starting position. This second image is encoded and compressed, then sent to the display device via a wireless network. The display device receives the second image and decodes it for display. When the display device is detected to be in portrait orientation, the current roll and pitch data are read, the attitude difference between the current attitude and the last time the attitude data was read is calculated, and the second starting position with a resolution of 1512x2688 is calculated from the first image. If the screen is inverted, the cropped image is rotated 180 degrees to obtain the second image. If the display device is detected to be in landscape orientation, a second image with a resolution of 2688x1512 is cropped from the first image based on the second starting position. The left landscape image is set as the normal image, and the right landscape image is obtained by rotating the left landscape image by 180 degrees. The drone and the display device communicate via a wireless Wi-Fi network. Figure 2 As shown, the device switches resolutions, cropping image data from 4096x3072 to 1512*2688 / 2688x1512 resolution. After encoding and compression by the device (drone), the data is sent to the display device via a wireless network, where it is received, decoded, and displayed. If the display device's orientation changes, the captured area also changes, thus achieving dynamic vertical shooting.
[0093] Exemplary apparatus
[0094] As shown in Figure 4 the embodiment, the embodiment further provides a dynamic processing apparatus for aerial images of a UAV, the apparatus comprising:
[0095] a first starting coordinate obtaining module 10, configured to obtain a first image and obtain a resolution of a display device, and obtain a first starting coordinate according to the resolution of the first image and the resolution of the display device;
[0096] an offset pixel position obtaining module 20, configured to obtain roll data and pitch data of the display device, and obtain an offset pixel position according to the roll data and the pitch data;
[0097] a second starting coordinate obtaining module 30, configured to adjust the first starting coordinate according to the offset pixel position, and obtain a second starting coordinate;
[0098] a second image obtaining module 40, configured to obtain a second image by cutting the first image according to the second starting coordinate.
[0099] In an implementation manner, the first starting coordinate obtaining module 10 comprises:
[0100] a video data obtaining unit, configured to collect video data of aerial photography of a UAV;
[0101] a first image obtaining unit, configured to obtain the first image according to each frame of image in the video data; wherein the resolution of the first image is WxH, and W>H;
[0102] a resolution obtaining unit of the display device, configured to obtain the resolution of the display device as MxN, and M<N<H;
[0103] a first starting coordinate obtaining unit, configured to obtain the first starting coordinate as
[0104] In an implementation manner, the offset pixel position obtaining module 20 comprises:
[0105] a rotation angle obtaining unit, configured to obtain the roll data and the pitch data of the display device, and obtain a rotation angle according to the roll data and the pitch data;
[0106] an offset pixel position obtaining unit, configured to obtain the offset pixel position according to the rotation angle and a preset sensitivity parameter.
[0107] In an implementation manner, the rotation angle obtaining unit comprises:
[0108] The attitude data obtaining subunit is configured to obtain the roll data r from the gyro sensor according to a reading frequency F i and the pitch data p i , i = 1, 2,..., n, wherein the reading frequency F is consistent with a frame rate at which the UAV takes the video data;
[0109] The rotation angle obtaining subunit is configured to obtain the rotation angle as θ i = r i - r i - 1, a i = p i - p i - 1, i = 1, 2,..., n; wherein θ i is a horizontal-axis rotation angle, and a i is a vertical-axis rotation angle.
[0110] In an implementation manner, the offset pixel position obtaining unit comprises:
[0111] The sensitivity parameter presetting subunit is configured to preset a sensitivity parameter;
[0112] The offset pixel position obtaining subunit is configured to obtain the offset pixel position as off_w i = k x tan(θ i ), off_h i = k x tan(a i ), i = 1, 2,..., n; wherein off_w i is a horizontal-axis offset pixel position, off_h i is a vertical-axis offset pixel position, k is the preset sensitivity parameter, θ i is the horizontal-axis rotation angle, and a i is the vertical-axis rotation angle.
[0113] In an implementation manner, the second starting coordinate obtaining module 30 comprises:
[0114] The obtaining unit is configured to adjust the first starting coordinate according to the offset pixel position, and obtain the second starting coordinate as (pos_w i = pos_w i - 1 + off_w i , pos_h i = pos_h i - 1 + off_h i ), i = 1, 2,..., n.
[0115] The acquisition unit is configured to acquire the second image by intercepting the first image according to the second starting coordinate.
[0116] In an implementation, the second image acquisition module 40 comprises:
[0117] The posture flag data acquisition unit is configured to acquire posture flag data g i , i = 0, 1, 2, 3; wherein g0 represents normal portrait, g1 represents left landscape, g2 represents upside-down portrait, and g3 represents right landscape.
[0118] The first acquisition unit is configured to, if the posture flag data is g0, acquire a screenshot resolution of MxN, and intercept a screenshot in the first image with the second starting coordinate as a starting position, with the screenshot resolution MxN determining a screenshot size, to obtain the second image.
[0119] The second acquisition unit is configured to, if the posture flag data is g1, acquire the screenshot resolution of NxM, and intercept a screenshot in the first image with the second starting coordinate as a starting position, with the screenshot resolution NxM determining a screenshot size, to obtain the second image.
[0120] The third acquisition unit is configured to, if the posture flag data is g2, acquire the screenshot resolution of MxN, and intercept a screenshot in the first image with the second starting coordinate as a starting position, with the screenshot resolution MxN determining a screenshot size, and rotate the obtained screenshot by 180 degrees, to obtain the second image.
[0121] The fourth acquisition unit is configured to, if the posture flag data is g3, acquire the screenshot resolution of NxM, and intercept a screenshot in the first image with the second starting coordinate as a starting position, with the screenshot resolution NxM determining a screenshot size, and rotate the obtained screenshot by 180 degrees, to obtain the second image.
[0122] Based on the above embodiments, the application further provides an intelligent terminal, a principle block diagram of which can be as shown in Figure 5The intelligent terminal includes a processor, a memory, a network interface, a display screen, and a temperature sensor connected through a system bus. The processor of the intelligent terminal is configured to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The network interface of the intelligent terminal is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a dynamic processing method for aerial images of a UAV. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen. The temperature sensor of the intelligent terminal is pre-installed in the intelligent terminal and is configured to detect the operating temperature of internal devices.
[0123] Those skilled in the art can understand that, Figure 5 The block diagram shown in the drawings is only a block diagram of part of the structure related to the present application, and does not limit the intelligent terminal to which the present application is applied. The specific intelligent terminal can include more or fewer components than those shown in the drawings, or combine some components, or have a different arrangement of components.
[0124] In one embodiment, an intelligent terminal is provided, which includes a memory, a processor, and a dynamic processing program for aerial images of a UAV stored in the memory and executable on the processor. When the processor executes the dynamic processing program for aerial images of a UAV, the following operation instructions are implemented:
[0125] A first image is obtained, and the resolution of a display device is obtained. A first starting coordinate is obtained according to the resolution of the first image and the resolution of the display device.
[0126] Roll data and pitch data of the display device are obtained. An offset pixel position is obtained according to the roll data and the pitch data.
[0127] The first starting coordinate is adjusted according to the offset pixel position to obtain a second starting coordinate.
[0128] The first image is cropped according to the second starting coordinate to obtain a second image.
[0129] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, operating database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0130] In conclusion, the present application discloses a dynamic processing method for aerial images of unmanned aerial vehicles, which comprises: acquiring a first image, and acquiring the resolution of a display device, obtaining a first starting coordinate according to the resolution of the first image and the resolution of the display device; acquiring the roll data and the pitch data of the display device, and obtaining an offset pixel position according to the roll data and the pitch data; adjusting the first starting coordinate according to the offset pixel position to obtain a second starting coordinate; and obtaining a second image by intercepting the first image according to the second starting coordinate. The present application can realize the horizontal shooting and vertical shooting modes by intercepting the second image suitable for the display device from the collected first image, and can realize the automatic switching of the mobile device end horizontal shooting mode and vertical shooting mode by judging whether the horizontal screen is placed or the vertical screen is placed through the gravity sensing sensor to control the screenshot resolution, dynamically adjusting the screenshot area according to the change of the display device posture, and realizing the functions of dynamic horizontal shooting and vertical shooting, thereby saving the hardware cost.
[0131] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A dynamic processing method of a UAV aerial image, characterized in that, The method comprises: acquiring a first image, acquiring a resolution of a display device, and obtaining a first starting coordinate according to the resolution of the first image and the resolution of the display device; acquiring roll data and pitch data of the display device, and obtaining an offset pixel position according to the roll data and the pitch data, the roll data reflecting a horizontal-axis rotation angle, and the pitch data reflecting a vertical-axis rotation angle; adjusting the first starting coordinate according to the offset pixel position to obtain a second starting coordinate; cutting the first image according to the second starting coordinate to obtain a second image; the acquiring of the first image, the acquiring of the resolution of the display device, and the obtaining of the first starting coordinate according to the resolution of the first image and the resolution of the display device comprises: collecting video data taken by a UAV; According to each frame image in the video data, a first image is obtained; wherein a resolution of the first image is ; acquiring a resolution of the display device is ; The first starting coordinates are obtained according to the resolution of the first image and the resolution of the display device as (x0, y0) , ) the acquiring of the roll data and the pitch data of the display device and the obtaining of the offset pixel position according to the roll data and the pitch data comprises: acquiring the roll data and the pitch data of the display device, and obtaining a rotation angle according to the roll data and the pitch data; obtaining the offset pixel position according to the rotation angle and a preset sensitivity parameter; the cutting of the first image according to the second starting coordinate to obtain the second image comprises: Obtaining a posture flag data by a gravity sensor ; wherein represents a normal portrait screen, represents a left landscape screen, represents an upside-down portrait screen, represents a right landscape screen; If the placement posture flag data is , a screenshot resolution is obtained , and a screenshot is performed in the first image with the second starting coordinate as a starting position, with the screenshot resolution to determine a screenshot size, to obtain the second image; If the placement posture flag data is , the screenshot resolution is obtained as , and a screenshot is performed in the first image with the second starting coordinate as a starting position, with the screenshot resolution to determine a screenshot size, to obtain the second image; If the placement posture flag data is , the screenshot resolution is obtained as , and a screenshot is performed in the first image with the second starting coordinate as a starting position, with the screenshot resolution to determine a screenshot size, and the obtained screenshot is rotated by 180 degrees to obtain the second image; If the placement posture flag data is , the screenshot resolution is obtained as , and a screenshot is performed in the first image with the second starting coordinate as a starting position, with the screenshot resolution to determine a screenshot size, and the obtained screenshot is rotated by 180 degrees to obtain the second image. 2.The dynamic processing method of the UAV aerial image according to claim 1, characterized in that, the acquiring of the roll data and the pitch data of the display device and the obtaining of the rotation angle according to the roll data and the pitch data comprises: According to a reading frequency Obtaining the roll data from a gyroscopic sensor And pitch data , Wherein the reading frequency Consistent with the frame rate of the video data taken by the UAV The rotation angle is obtained according to the roll data and the pitch data , , ; wherein, is a horizontal axis rotation angle, is a vertical axis rotation angle. 3.The dynamic processing method of the UAV aerial image according to claim 2, characterized in that, the obtaining of the offset pixel position according to the rotation angle and the preset sensitivity parameter comprises: a preset sensitivity parameter; According to the rotation angle and a preset sensitivity parameter, the offset pixel position is obtained as , , ; wherein, is a horizontal axis offset pixel position, is a vertical axis offset pixel position, is a preset sensitivity parameter, is a horizontal axis rotation angle, is a vertical axis rotation angle. 4.The dynamic processing method of the UAV aerial image according to claim 3, characterized in that, the adjusting of the first starting coordinate according to the offset pixel position to obtain the second starting coordinate comprises: adjusting the first starting coordinate according to the offset pixel position to obtain a second starting coordinate is (x0+dx, y0+dy) , ), .
5. A dynamic processing apparatus for UAV aerial images, characterized in that, the device comprises: a first starting coordinate acquisition module, configured to acquire a first image, acquire a resolution of a display device, and obtain a first starting coordinate according to the resolution of the first image and the resolution of the display device; the acquiring of the first image, the acquiring of the resolution of the display device, and the obtaining of the first starting coordinate according to the resolution of the first image and the resolution of the display device comprises: collecting video data taken by a UAV; According to each frame image in the video data, a first image is obtained; wherein a resolution of the first image is ; acquiring a resolution of the display device is ; The first starting coordinates are obtained according to the resolution of the first image and the resolution of the display device as (x0, y0) , ) an offset pixel position acquisition module, configured to acquire roll data and pitch data of the display device, and obtain an offset pixel position according to the roll data and the pitch data, the roll data reflecting a horizontal-axis rotation angle, and the pitch data reflecting a vertical-axis rotation angle; the acquiring of the roll data and the pitch data of the display device and the obtaining of the offset pixel position according to the roll data and the pitch data comprises: acquiring the roll data and the pitch data of the display device, and obtaining a rotation angle according to the roll data and the pitch data; obtaining the offset pixel position according to the rotation angle and a preset sensitivity parameter; a second starting coordinate acquisition module, configured to adjust the first starting coordinate according to the offset pixel position to obtain a second starting coordinate; a second image acquisition module, configured to cut the first image according to the second starting coordinate to obtain a second image; the cutting of the first image according to the second starting coordinate to obtain the second image comprises: Obtaining a placement posture mark data through a gravity sensing sensor ; wherein, represents a normal vertical screen, represents a left horizontal screen, represents an upside-down vertical screen, represents a right horizontal screen; If the placement posture flag data is , a screenshot resolution is obtained , and a screenshot size is determined in the first image with the second starting coordinate as a starting position and the screenshot resolution to obtain the second image. If the placement posture flag data is , the screenshot resolution is obtained as , and a screenshot is performed in the first image with the second starting coordinate as a starting position, with the screenshot resolution to determine a screenshot size, to obtain the second image. If the placement posture flag data is , the screenshot resolution is obtained as , and a screenshot is performed in the first image with the second starting coordinate as a starting position, with the screenshot resolution to determine a screenshot size, and the obtained screenshot is rotated by 180 degrees to obtain the second image; If the placing posture flag data is , the screenshot resolution is obtained as , and a screenshot is performed in the first image with the second starting coordinate as a starting position, the screenshot resolution , and the obtained screenshot is rotated by 180 degrees to obtain the second image.
6. A smart terminal, characterized by The intelligent terminal comprises a memory, a processor, and a dynamic processing program of the aerial image of the unmanned aerial vehicle stored in the memory and executable on the processor.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores the dynamic processing program of the aerial image of the unmanned aerial vehicle, and the dynamic processing program of the aerial image of the unmanned aerial vehicle is executable on the processor to realize the steps of the dynamic processing method of the aerial image of the unmanned aerial vehicle.
Citation Information
Patent Citations
Fish-eye camera image processing method and system
CN106600548A
Image processing methods and devices for cameras, as well as cameras and display systems.
CN114938469A