Image correction method, device and medium
By collecting the angular velocity and pitch angle of the vehicle, judging the bumpy state and correcting the frame image, it solves the problem of screen jitter in vehicle AR navigation under bumpy conditions and improves the user experience.
Patent Information
- Application Number
- CN202211301998.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-24
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-10-24
AI Technical Summary
When the vehicle encounters bumps while driving, the virtual navigation guidance screen of the in-vehicle AR navigation will shake up and down, causing users to feel dizzy and affecting the user experience.
By periodically collecting the angular velocity and pitch angle of the vehicle, the bumpy state is determined, and the time stamp of the frame image is used to determine whether the frame image needs to be corrected, and the road guide line in the frame image is adjusted to a flat road surface to avoid jitter.
It effectively avoids jitter in the virtual navigation guidance screen caused by vehicle bumps, reduces dizziness, and improves user experience.
Smart Images

Figure CN115842958B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle driving technology, and in particular to an image correction method, device and medium. Background Art
[0002] In-vehicle AR navigation refers to capturing the road information in front of the vehicle in real time through the front camera, and then using mobile visual recognition technology to identify various important information of the road ahead, such as lane lines, vehicles ahead, etc., generate virtual navigation guidance signs, and superimpose this rendering on the real scene, so that the driver can see the road scene more clearly and reduce the occurrence of wrong directions due to navigation errors or mistaking the road.
[0003] However, when the car encounters bad road conditions and bumps while driving, the virtual navigation guidance (such as lane lines) of the in-vehicle AR navigation will shake up and down along with the screen, causing dizziness to the user and affecting the user experience. Summary of the invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the defect in the prior art that the virtual navigation guidance screen shakes up and down due to the bumps of the vehicle body, causing dizziness to the user, thereby providing an image correction method, device and medium.
[0005] In a first aspect, the present invention provides an image correction method, comprising:
[0006] During the driving process of the vehicle, the angular velocity of the vehicle in a preset direction is periodically collected; based on the first collection moment, the second collection moment, the angular velocity at the second collection moment, the predetermined pitch angle at the first collection moment, and the predetermined bump state at the first collection moment, the first collection moment is the collection moment corresponding to any cycle in the driving process of the vehicle, and the second collection moment is the next moment of the first collection moment; the frame image and the timestamp of the collected frame image are acquired; when the timestamp is within the closed interval between the first collection moment and the second collection moment, the bump state of the frame image is determined based on the bump state at the first collection moment and / or the bump state at the second collection moment; when the bump state of the frame image is a bump state, the frame image is corrected based on the pitch angle at the first collection moment and / or the pitch angle at the second collection moment.
[0007] The present application determines the bump state at the second acquisition moment by periodically acquiring the angular velocity of the vehicle in a preset direction, the first acquisition moment, the second acquisition moment, the pitch angle at the first acquisition moment, and the bump state at the first acquisition moment, thereby obtaining the actual bump state of the vehicle at each acquisition moment. After that, a frame image recording the road condition of the vehicle and a timestamp corresponding to the frame image are acquired, and the relationship between the timestamp of the frame image and the first acquisition moment and the second acquisition moment is determined. When the timestamp of the frame image is between the first acquisition moment and the second acquisition moment, the bump state of the frame image is determined by the bump state at the first acquisition moment and / or the bump state at the second acquisition moment. Thus, the bump state of the frame image can be known, that is, what kind of bump state the vehicle is in when the frame image is acquired, so that it can be determined whether the frame image needs to be corrected according to the bump state of the frame image when it is acquired. When the frame image is in a bumpy state, the pitch angle of the frame image can be determined by the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment, and the frame image can be corrected according to the pitch angle of the frame image. Thus, the frame image acquired in the bumpy state can be corrected, specifically, the road guide line in the frame image is adjusted to the state when the vehicle is on a flat road. Therefore, in the technical solution formed in the present application, the acquired frame image is corrected in the above manner to avoid the defect of dizziness caused by the up and down shaking of the virtual navigation guidance screen due to the bumping of the vehicle, and the frame image is corrected by determining the pitch angle. Even if the vehicle is in a bumpy state, the picture on the navigator (mainly the road guide line) is still the same as the picture on a flat road, thereby avoiding dizziness and improving the user experience.
[0008] In combination with the first aspect, in a first embodiment of the first aspect, determining the turbulence state at the second collection moment based on the first collection moment, the second collection moment, the angular velocity corresponding to the second collection moment, the predetermined pitch angle at the first collection moment, and the predetermined turbulence state at the first collection moment includes:
[0009] The pitch angle at the second acquisition moment is determined based on the first acquisition moment, the second acquisition moment and the angular velocity corresponding to the second acquisition moment; the bump state at the second acquisition moment is determined based on the bump state at the first acquisition moment, the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment.
[0010] This embodiment determines the pitch angle of the vehicle corresponding to the second acquisition moment through the first acquisition moment, the second acquisition moment and the angular velocity corresponding to the second acquisition moment, and then judges the bump state of the second acquisition moment according to the bump state of the vehicle at the first acquisition moment, the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment, so as to obtain the bump state of the vehicle at each acquisition moment, so as to facilitate the subsequent determination of the bump state of the frame image according to the bump state of the vehicle at each acquisition moment, so as to determine whether the frame image needs to be corrected.
[0011] In combination with the first aspect, in a second embodiment of the first aspect, determining the pitch angle at the second acquisition moment based on the first acquisition moment, the second acquisition moment, and the angular velocity corresponding to the second acquisition moment includes:
[0012] The time difference between the first acquisition moment and the second acquisition moment is determined based on the first acquisition moment and the second acquisition moment; and the pitch angle at the second acquisition moment is determined based on the time difference and the angular velocity corresponding to the second acquisition moment.
[0013] In combination with the first aspect, in a third embodiment of the first aspect, determining the turbulence state at the second collection moment based on the turbulence state at the first collection moment, the pitch angle at the first collection moment, and the pitch angle at the second collection moment includes:
[0014] The pitch angle difference between the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment is determined based on the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment; when the bump state at the first acquisition moment is a bump state, the bump state at the second acquisition moment is determined based on the pitch angle difference and a first preset value; or, when the bump state at the first acquisition moment is a non-bump state, the bump state at the second acquisition moment is determined based on the pitch angle difference and the second preset value.
[0015] In combination with the first aspect, in a fourth embodiment of the first aspect, when the timestamp is within a closed interval between the first acquisition moment and the second acquisition moment, determining the turbulence state of the frame image based on the turbulence state at the first acquisition moment and / or the turbulence state at the second acquisition moment includes:
[0016] When the timestamp is within the opening interval of the first acquisition moment and the second acquisition moment, the bump state of the frame image is determined based on the bump state at the first acquisition moment and the bump state at the second acquisition moment; or, when the timestamp is consistent with the first acquisition moment, the bump state at the first acquisition moment is directly used as the bump state of the frame image;
[0017] Alternatively, when the timestamp is consistent with the second acquisition moment, the jolting state at the second acquisition moment is directly used as the jolting state of the frame image.
[0018] In combination with the first aspect, in a fifth embodiment of the first aspect, the method further includes:
[0019] When the timestamp is not within the closed interval between the first acquisition time and the second acquisition time, it is determined that the jolting state of the frame image is a non-jolting state.
[0020] In combination with the first aspect, in a sixth embodiment of the first aspect, when the bump state of the frame image is a bump state, correcting the frame image based on the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment includes:
[0021] When the bump state of the frame image is a bump state and the timestamp of the frame image is within the open interval of the first acquisition moment and the second acquisition moment, the average of the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment is used as the pitch angle of the frame image; or, when the bump state of the frame image is a bump state and the timestamp of the frame image is consistent with the first acquisition moment, the pitch angle at the first acquisition moment is used as the pitch angle of the frame image; or, when the bump state of the frame image is a bump state and the timestamp of the frame image is consistent with the second acquisition moment, the pitch angle at the second acquisition moment is used as the pitch angle of the frame image; the frame image is corrected based on the pitch angle of the frame image.
[0022] In this embodiment, the actual pitch angle information of the vehicle before and after or when the frame image is obtained is determined through the relationship between the timestamp and the closed interval of the first acquisition moment and the second acquisition moment, thereby improving the accuracy of the pitch angle corresponding to the frame image. Since the frame image is corrected according to the pitch angle, a pitch angle with higher accuracy can make the result of frame image correction closer to the situation when the vehicle is driving on a flat road, making the picture jitter amplitude smaller, greatly reducing the feeling of dizziness, and improving the user experience.
[0023] In combination with the first aspect, in a seventh embodiment of the first aspect, the frame image is corrected based on the pitch angle of the frame image, including: extracting lane lines in the frame image; and correcting the lane lines based on the pitch angle of the frame image.
[0024] In a second aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory being used to store a computer program, and when the computer program is executed by the processor, the processor executes an image correction method as described in any one of the contents of the invention.
[0025] In a third aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, an image correction method as described in any one of the invention contents is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 A flowchart of an image correction method provided by an embodiment of the present invention;
[0028] Figure 2 An example diagram of preset directions provided by an embodiment of the present invention;
[0029] Figure 3 A flow chart for determining the turbulence state at the second acquisition moment provided by an embodiment of the present invention;
[0030] Figure 4 A connection diagram of an image correction device provided by an embodiment of the present invention;
[0031] Figure 5 A computer device connection diagram provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] The present invention discloses a method for correcting an image. Figure 1 As shown, the specific steps include:
[0034] Step S1: periodically collecting the angular velocity of the vehicle in a preset direction during the driving process of the vehicle.
[0035] Specifically, during vehicle driving, the gyroscope can periodically collect angular velocity in a preset direction, wherein the collection period is determined by the output frequency of the gyroscope, the preset direction can be the rotation direction when any coordinate axis is used as the rotation axis, the rotation axis can be any one of the X-axis, Y-axis, and Z-axis, and the collected angular velocity data includes a sign part and a numerical part, the sign part is related to the rotation direction, and the numerical part is related to the rotation angle.
[0036] Specifically, if the output frequency of the gyroscope is 10 Hz, that is, 10 angular velocity data are output in 1 second, then 100 milliseconds is used as a collection cycle to collect the angular velocity.
[0037] For details, please refer to the X-axis, Y-axis, and Z-axis corresponding to the preset direction. Figure 2 Place the phone horizontally on the desktop, with the center of the phone as the origin of the spatial coordinate system, the positive direction of the X-axis pointing vertically to the upper long side of the phone, the Y-axis perpendicular to the X-axis, and the positive direction pointing vertically to the right short side of the phone, the Z-axis perpendicular to the phone screen, and the positive direction is vertically upward.
[0038] In an optional embodiment, the gyroscope periodically collects the angular velocity in the Y-axis direction, that is, the angular velocity generated when the vehicle rotates with the Y-axis as the rotation axis when encountering bumps during driving. It can be stipulated that when the rotation direction is clockwise, the sign of the collected angular velocity is positive, and when the rotation direction is counterclockwise, the sign of the collected angular velocity is negative.
[0039] Step S2: determining the bump state at the second collection time based on the first collection time, the second collection time, the angular velocity at the second collection time, the predetermined pitch angle at the first collection time, and the predetermined bump state at the first collection time.
[0040] Specifically, the first collection time is a collection time corresponding to any cycle in the vehicle driving process, and the second collection time is a time next to the first collection time.
[0041] Specifically, after the angular velocity is collected at the second collection moment, the angle at which the vehicle rotates in the preset direction from the first collection moment to the second collection moment, that is, the pitch angle corresponding to the second collection moment, can be determined based on the first collection moment, the second collection moment, and the angular velocity corresponding to the second collection moment. Then, the bump state at the second collection moment is determined in combination with the bump state at the first collection moment, the pitch angle at the first collection moment, and the pitch angle at the second collection moment. After determining the bump state at the second collection moment, the second collection moment, the bump state at the second collection moment, and the pitch angle at the second collection moment are stored as a new data in the vehicle driving information table in the data cache area. The table is used to store information such as the pitch angle and bump state corresponding to each moment.
[0042] Step S3: Acquire a frame image and a timestamp of the frame image.
[0043] Specifically, when the gyroscope collects the vehicle's angular velocity, the vehicle's image collector also collects the vehicle's current road condition image and collects the timestamp corresponding to the frame image. The frame image collection is also periodic, and its collection period is determined by the frequency of the image collector, which includes but is not limited to a camera installed in front of the vehicle.
[0044] Step S4: when the timestamp is within a closed interval between the first acquisition moment and the second acquisition moment, determining the jolting state of the frame image based on the jolting state at the first acquisition moment and / or the jolting state at the second acquisition moment.
[0045] Specifically, after acquiring the frame image, it is necessary to determine the bumpy state of the car when the frame image is collected. Therefore, it is necessary to compare the timestamp of the frame image with the collection time in the vehicle driving information table to determine whether the timestamp of the frame image is within the closed interval formed by two collection times in the table. When the timestamp is within the closed interval formed by the first collection time and the second collection time, the bumpy state of the current frame image can be determined according to the bumpy state at the first collection time and / or the bumpy state at the second collection time, so as to subsequently determine whether the frame image needs to be corrected according to the bumpy state of the frame image.
[0046] Step S5: when the bump state of the frame image is a bump state, the frame image is corrected based on the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment.
[0047] Specifically, when the bump state of the frame image is a bump state, the frame image needs to be corrected. At this time, the pitch angle of the frame image needs to be determined according to the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment, and then the frame image is adjusted according to the pitch angle of the frame image, and the frame image in the bump state is adjusted to a horizontal state or a state close to the horizontal state, so as to avoid the shaking of the picture, wherein the horizontal state is the state of the frame image when the vehicle is on a flat road.
[0048] The present application periodically obtains the angular velocity of the vehicle in a preset direction, the first acquisition moment, the second acquisition moment, the pitch angle at the first acquisition moment, and the bump state at the first acquisition moment to determine the bump state at the second acquisition moment, thereby obtaining the actual bump state of the vehicle at each acquisition moment. After that, a frame image recording the road condition of the vehicle and a timestamp corresponding to the frame image are obtained, and the relationship between the timestamp of the frame image and the first acquisition moment and the second acquisition moment is determined. When the timestamp of the frame image is between the first acquisition moment and the second acquisition moment, the bump state of the frame image is determined by the bump state at the first acquisition moment and / or the bump state at the second acquisition moment. Thus, the bump state of the frame image, that is, the bump state of the vehicle when the frame image is acquired, can be known, so that it can be determined whether the frame image needs to be corrected according to the bump state of the frame image. When the frame image is in a bumpy state, the pitch angle of the frame image can be determined by the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment, and the frame image is corrected according to the pitch angle of the frame image; the correction of the frame image is specifically the correction of the lane lines in the frame image, that is, the lane lines in the frame image are adjusted to the state when the vehicle is on a flat road. Therefore, in the technical solution formed in the present application, the correction of the captured frame image is completed in the above manner, avoiding the defect of the virtual navigation guidance screen shaking up and down due to the bumping of the vehicle, which causes dizziness to the user. The frame image is corrected by determining the pitch angle, so that even if the vehicle is in a bumpy state, the picture on the navigator (mainly the road guide line) is still the same as the picture on a flat road, thereby avoiding the feeling of dizziness and improving the user experience.
[0049] In an optional implementation, determining the bump state at the second acquisition moment based on the first acquisition moment, the second acquisition moment, the angular velocity corresponding to the second acquisition moment, the predetermined pitch angle at the first acquisition moment, and the predetermined bump state at the first acquisition moment includes:
[0050] The pitch angle at the second acquisition moment is determined based on the first acquisition moment, the second acquisition moment and the angular velocity corresponding to the second acquisition moment; the bump state at the second acquisition moment is determined based on the bump state at the first acquisition moment, the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment.
[0051] For example, when the first acquisition moment is the acquisition moment corresponding to the angular velocity acquired by the gyroscope for the first time after the vehicle starts to travel, only the first acquisition moment may be retained, the angular velocity corresponding to the first acquisition moment may be discarded, the pitch angle of the first acquisition moment is set to 0 degrees by default, the bump state of the first acquisition moment is set to a non-bump state by default, and the first acquisition moment, the pitch angle of the first acquisition moment, and the bump state of the first acquisition moment are stored as a piece of data in a preset list. When the first acquisition moment is not the first acquisition moment of the gyroscope, the angular velocity of the first acquisition moment is retained, and is stored in the preset list together with the pitch angle of the first acquisition moment and the bump state of the first acquisition moment that have been determined.
[0052] At the second acquisition moment, the angular velocity of the vehicle is acquired, and the pitch angle at the second acquisition moment is determined according to the first acquisition moment, the second acquisition moment, and the angular velocity corresponding to the second acquisition moment. After determining the pitch angle at the second acquisition moment, the bump state at the second acquisition moment is determined according to the bump state at the first acquisition moment, the pitch angle at the first acquisition moment, and the pitch angle at the second acquisition moment. The second acquisition moment, the pitch angle at the second acquisition moment, and the bump state at the second acquisition moment are stored in the above list. Thus, the pitch angle and bump state corresponding to each acquisition moment can be obtained, so that the bump state of the frame image can be judged based on this later.
[0053] This embodiment determines the pitch angle of the vehicle corresponding to the second acquisition moment through the first acquisition moment, the second acquisition moment and the angular velocity corresponding to the second acquisition moment, and then judges the bump state of the second acquisition moment according to the bump state of the vehicle at the first acquisition moment, the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment, so as to obtain the bump state of the vehicle at each acquisition moment, so as to facilitate the subsequent determination of the bump state of the frame image according to the bump state of the vehicle at each acquisition moment, so as to determine whether the frame image needs to be corrected.
[0054] In an optional implementation, determining the pitch angle at the second acquisition moment based on the first acquisition moment, the second acquisition moment, and the angular velocity corresponding to the second acquisition moment includes:
[0055] The time difference between the first acquisition moment and the second acquisition moment is determined based on the first acquisition moment and the second acquisition moment; and the pitch angle at the second acquisition moment is determined based on the time difference and the angular velocity corresponding to the second acquisition moment.
[0056] Exemplarily, the pitch angle is implemented as follows:
[0057] y=ω·t
[0058] Wherein, y is the pitch angle at the second acquisition moment (unit: radian), ω is the angular velocity at the second acquisition moment (unit: radian per second), and t is the time difference between the first acquisition moment and the second acquisition moment (unit: second).
[0059] Exemplarily, in one embodiment, the first acquisition time is 14:21:30.04, the second acquisition time is 14:21:30.24, and the angular velocity at the second acquisition time is -5 rad / s.
[0060] Then, in this embodiment, the time difference between the first acquisition moment and the second acquisition moment is determined to be 20ms, i.e., 0.02 seconds, so the pitch angle corresponding to the second acquisition moment is: 0.02*(-5)=0.1(rad), and then, the pitch angle can be converted into an angle according to the conversion formula between angle and radian 1rad=180 / π(°), 0.1rad≈5.7°.
[0061] In an optional implementation manner, determining the bump state at the second acquisition moment based on the bump state at the first acquisition moment, the pitch angle at the first acquisition moment, and the pitch angle at the second acquisition moment includes:
[0062] The pitch angle difference between the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment is determined based on the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment; when the bump state at the first acquisition moment is a bump state, the bump state at the second acquisition moment is determined based on the pitch angle difference and a first preset value; or, when the bump state at the first acquisition moment is a non-bump state, the bump state at the second acquisition moment is determined based on the pitch angle difference and the second preset value.
[0063] For example, after determining the pitch angle at the second acquisition time, it is also necessary to determine the bump state at the second acquisition time. The bump state at the second acquisition time is related to the bump state at the first acquisition time and the pitch angle difference between the first acquisition time and the second acquisition time. The process of determining the bump state at the second acquisition time is as follows: Figure 3 shown.
[0064] In the first step, it is necessary to determine the pitch angle difference according to the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment.
[0065] In the second step, the turbulence state at the second collection moment is determined based on the turbulence state at the first collection moment and the pitch angle difference.
[0066] When the bump state at the first collection moment is a bump state, the pitch angle difference is compared with the first preset value. When the pitch angle difference is greater than or equal to the first preset value, the bump state at the second collection moment is a bump state; when the pitch angle difference is less than the first preset value, the bump state at the second collection moment is a non-bump state.
[0067] When the bump state at the first collection moment is a non-bump state, the pitch angle difference is compared with the second preset value. When the pitch angle difference is greater than or equal to the second preset value, the bump state at the second collection moment is a bump state; when the pitch angle difference is less than the second preset value, the bump state at the second collection moment is a non-bump state.
[0068] The first preset value and the second preset value are related to the frequency of data provided by the gyroscope. When the gyroscope frequency is higher, it means that the data is acquired more frequently, and the gap between the data is smaller, so the first preset value and the second preset value are smaller; similarly, when the gyroscope frequency is lower, the first preset value and the second preset value are larger.
[0069] In an optional implementation, when the timestamp is within a closed interval between the first acquisition moment and the second acquisition moment, determining the jolting state of the frame image based on the jolting state at the first acquisition moment and / or the jolting state at the second acquisition moment includes:
[0070] When the timestamp is within the open interval of the first acquisition moment and the second acquisition moment, the bumpy state of the frame image is determined based on the bumpy state at the first acquisition moment and the bumpy state at the second acquisition moment; or, when the timestamp is consistent with the first acquisition moment, the bumpy state at the first acquisition moment is directly used as the bumpy state of the frame image; or, when the timestamp is consistent with the second acquisition moment, the bumpy state at the second acquisition moment is directly used as the bumpy state of the frame image.
[0071] Exemplarily, after acquiring the frame image and the timestamp of the frame image, it is necessary to match the timestamp of the frame image with the acquisition time in the pre-stored vehicle driving information table. When the timestamp is consistent with the first acquisition time, the bumpy state at the first acquisition time is directly used as the bumpy state of the frame image. When the timestamp is consistent with the second acquisition time, the bumpy state at the second acquisition time can be directly used as the bumpy state of the frame image.
[0072] When the timestamp is within the open interval of the first acquisition moment and the second acquisition moment, the jolting state of the frame image is determined according to the jolting state at the first acquisition moment and the jolting state at the second acquisition moment. The specific determination process is that when the jolting state at the first acquisition moment and the jolting state at the second acquisition moment are both non-jolting states, the jolting state of the frame image is determined as non-jolting state; when there is at least one jolting state between the jolting state at the first acquisition moment and the jolting state at the second acquisition moment, the jolting state of the frame image is determined as jolting state.
[0073] In an optional embodiment, the method further comprises:
[0074] When the timestamp is not within the closed interval between the first acquisition time and the second acquisition time, it is determined that the jolting state of the frame image is a non-jolting state.
[0075] For example, in order to avoid the situation where the system has low computing efficiency due to excessive redundant data in the cache, in this embodiment, only a preset time period or a preset number of angular velocity data will be retained. When the storage space of the data cache area is full, the first data in the storage space will be continuously removed to make room for the latest data. Since the frequencies of the image collector and the gyroscope are not necessarily consistent, there may be a situation where the timestamp of the frame image is not within the acquisition time range corresponding to the current list. In this case, the bumpy state of the frame image can be directly determined as a non-bumpy state.
[0076] For example, there are 10 data in the vehicle driving information table in the current data cache. When the timestamp of the frame image is before the acquisition time corresponding to the first data, or the timestamp of the frame image is after the acquisition time corresponding to the tenth data, the bumpy state of the frame image can be directly determined as a non-bumpy state. Since the storage space of the data cache will store data within 3-5 seconds, and the acquisition frequency of the gyroscope is at the millisecond level, the situation where the timestamp of the frame image is not within the acquisition time range covered by the cache space will almost never occur.
[0077] In an optional implementation, when the jolting state of the frame image is a jolting state, the frame image is corrected based on the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment, including:
[0078] When the bump state of the frame image is a bump state and the timestamp of the frame image is within the open interval of the first acquisition moment and the second acquisition moment, the average of the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment is used as the pitch angle of the frame image; or, when the bump state of the frame image is a bump state and the timestamp of the frame image is consistent with the first acquisition moment, the pitch angle at the first acquisition moment is used as the pitch angle of the frame image; or, when the bump state of the frame image is a bump state and the timestamp of the frame image is consistent with the second acquisition moment, the pitch angle at the second acquisition moment is used as the pitch angle of the frame image; the frame image is corrected based on the pitch angle of the frame image.
[0079] For example, when it is determined that the bump state of the frame image is a bump state, it means that the frame image was collected when the vehicle was bumping, and the frame image needs to be corrected. The correction of the frame image is to adjust the angle of the frame image based on the pitch angle of the frame image, so that the image content in the frame image is in a horizontal state.
[0080] The pitch angle of the frame image is related to the timestamp of the frame image and the first acquisition time and the second acquisition time. When the timestamp of the frame image is between the first acquisition time and the second acquisition time, the average of the pitch angles at the first acquisition time and the second acquisition time can be used as the pitch angle of the frame image. When the timestamp of the frame image is consistent with the first acquisition time, it means that the image was acquired at the first acquisition time, so the pitch angle at the first acquisition time can be directly used as the pitch angle of the frame image. Similarly, when the timestamp of the frame image is consistent with the second acquisition time, the pitch angle at the second acquisition time can be directly used as the pitch angle of the frame image.
[0081] After determining the pitch angle of the frame image, adjust the frame image according to the pitch angle of the frame image. For example, the preset direction is the Y axis, and the Y axis is used as the rotation axis. When the rotation direction is clockwise, the sign is positive, and when the rotation direction is counterclockwise, the sign is negative. The pitch angle of the current frame image is -20°, which means that the frame image is rotated 20° counterclockwise on the basis of the horizontal state to obtain the current frame image. Therefore, to adjust the frame image to a horizontal state, it is necessary to use the Y axis as the rotation axis and rotate 20° clockwise.
[0082] In this embodiment, the actual pitch angle information of the vehicle before and after or when the frame image is obtained is determined through the relationship between the timestamp and the closed interval of the first acquisition moment and the second acquisition moment, thereby improving the accuracy of the pitch angle corresponding to the frame image. Since the frame image is corrected according to the pitch angle, a pitch angle with higher accuracy can make the result of frame image correction closer to the situation when the vehicle is driving on a flat road, making the picture jitter amplitude smaller, greatly reducing the feeling of dizziness, and improving the user experience.
[0083] In an optional embodiment, correcting the frame image based on the pitch angle of the frame image includes:
[0084] Extract lane lines from the frame image; and correct the lane lines based on the pitch angle of the frame image.
[0085] Exemplarily, when the frame image is corrected, the lane lines in the frame image are mainly corrected, that is, the lane lines in the frame image are rotated in a corresponding direction and angle based on the pitch angle of the frame image.
[0086] The specific process of lane line correction is as follows:
[0087] First, it is necessary to use ADAS (advanced driver assistance system) to identify the 3D coordinates of all points on the two lane lines, and arbitrarily extract two non-overlapping points on each lane line, and determine the straight line where the lane line is located in the frame image based on the coordinates of these two points; then, the straight line where each lane line is located is rotated with a certain coordinate axis as the rotation axis (the coordinate axis needs to be consistent with the coordinate axis corresponding to the preset direction when collecting angular velocity, such as the Y axis), and rotated according to the direction corresponding to the symbol in the pitch angle of the frame image by the corresponding angle, so as to press down the upturned lane line, or make the downturned lane line up; so that the 3D coordinates of the lane line are always kept in a stable range, reducing large-scale shaking, thereby achieving an anti-shake effect and reducing visual dizziness.
[0088] The present invention discloses an image correction device, such as Figure 4 As shown, the device includes the following modules:
[0089] The acquisition module 41 is used to periodically acquire the angular velocity of the vehicle in a preset direction during the driving process of the vehicle.
[0090] The first determination module 42 is used to determine the bump state at the second collection moment based on the first collection moment, the second collection moment, the angular velocity at the second collection moment, the predetermined pitch angle at the first collection moment, and the predetermined bump state at the first collection moment. The first collection moment is the collection moment corresponding to any cycle in the vehicle's driving process, and the second collection moment is the next moment of the first collection moment.
[0091] The acquisition module 43 is used to acquire the frame image and the timestamp of the frame image.
[0092] The second determination module 44 is configured to determine the jolting state of the frame image based on the jolting state at the first acquisition moment and / or the jolting state at the second acquisition moment when the timestamp is within a closed interval between the first acquisition moment and the second acquisition moment.
[0093] The correction module 45 is used to correct the frame image based on the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment when the bump state of the frame image is a bump state.
[0094] In an optional implementation, the first determining module includes:
[0095] The first determination submodule is used to determine the pitch angle at the second acquisition moment based on the first acquisition moment, the second acquisition moment and the angular velocity corresponding to the second acquisition moment; the second determination submodule is used to determine the bump state at the second acquisition moment based on the bump state at the first acquisition moment, the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment.
[0096] In an optional implementation, the first determining submodule includes:
[0097] The first determining unit is used to determine the time difference between the first acquisition moment and the second acquisition moment based on the first acquisition moment and the second acquisition moment; the second determining unit is used to determine the pitch angle at the second acquisition moment based on the time difference and the angular velocity corresponding to the second acquisition moment.
[0098] In an optional implementation manner, the second determining submodule includes:
[0099] The first determining unit is used to determine the pitch angle difference between the pitch angle at the first collecting moment and the pitch angle at the second collecting moment based on the pitch angle at the first collecting moment and the pitch angle at the second collecting moment; the second determining unit is used to determine the bumpy state at the second collecting moment based on the pitch angle difference and a first preset value when the bumpy state at the first collecting moment is a bumpy state; the third determining unit is used to determine the bumpy state at the second collecting moment based on the pitch angle difference and the second preset value when the bumpy state at the first collecting moment is a non-bumpy state.
[0100] In an optional implementation manner, the second determining module includes:
[0101] The first determination submodule is used to determine the bumpy state of the frame image based on the bumpy state at the first acquisition moment and the bumpy state at the second acquisition moment when the timestamp is within the open interval between the first acquisition moment and the second acquisition moment; the second determination submodule is used to directly use the bumpy state at the first acquisition moment as the bumpy state of the frame image when the timestamp is consistent with the first acquisition moment; the third determination submodule is used to directly use the bumpy state at the second acquisition moment as the bumpy state of the frame image when the timestamp is consistent with the second acquisition moment.
[0102] In an optional embodiment, the device further comprises:
[0103] The third determination module is used to determine that the jolting state of the frame image is a non-jolting state when the timestamp is not within a closed interval between the first acquisition moment and the second acquisition moment.
[0104] In an optional implementation, the correction module includes:
[0105] The first determining submodule is used for, when the bump state of the frame image is a bump state and the timestamp of the frame image is within the open interval of the first acquisition moment and the second acquisition moment, taking the average of the pitch angle at the first acquisition moment as the pitch angle of the frame image; the second determining submodule is used for, when the bump state of the frame image is a bump state and the timestamp of the frame image is consistent with the first acquisition moment, taking the pitch angle at the first acquisition moment as the pitch angle of the frame image; the third determining submodule is used for, when the bump state of the frame image is a bump state and the timestamp of the frame image is consistent with the second acquisition moment, taking the pitch angle at the second acquisition moment as the pitch angle of the frame image; the correction submodule is used for correcting the frame image based on the pitch angle of the frame image.
[0106] This embodiment provides a computer device, such as Figure 5 As shown, the computer device may include at least one processor 51, at least one communication interface 52, at least one communication bus 53 and at least one memory 54, wherein the communication interface 52 may include a display screen (Display), a keyboard (Keyboard), and the optional communication interface 52 may also include a standard wired interface and a wireless interface. The memory 54 may be a high-speed RAM memory (Random Access Memory, volatile random access memory) or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 54 may also be at least one storage device located away from the aforementioned processor 51. The processor 51 may be combined with Figure 5 In the described device, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 to execute the image correction method of any of the above method embodiments.
[0107] The communication bus 53 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 53 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0108] Among them, the memory 54 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 54 may also include a combination of the above types of memory.
[0109] The processor 51 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.
[0110] The processor 51 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. Optionally, the memory 54 is also used to store program instructions. The processor 51 may call program instructions to implement the image correction method in any embodiment of the present invention.
[0111] This embodiment provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions can execute the image correction method in any of the above method embodiments. The storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0112] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.
Claims
1. A method for correcting an image, characterized in that: include: The angular velocity of the vehicle in a preset direction is periodically collected during the vehicle's driving process; determining the bump state at the second collection moment based on the first collection moment, the second collection moment, the angular velocity at the second collection moment, the predetermined pitch angle at the first collection moment, and the predetermined bump state at the first collection moment, wherein the first collection moment is a collection moment corresponding to any cycle in the driving process of the vehicle, and the second collection moment is a moment next to the first collection moment; Acquire a frame image and a timestamp of acquiring the frame image; When the timestamp is within a closed interval between the first acquisition moment and the second acquisition moment, determining the jolting state of the frame image based on the jolting state at the first acquisition moment and / or the jolting state at the second acquisition moment; When the jolting state of the frame image is a jolting state, correcting the frame image based on the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment; The determining of the turbulence state at the second collection moment based on the first collection moment, the second collection moment, the angular velocity corresponding to the second collection moment, the predetermined pitch angle at the first collection moment, and the predetermined turbulence state at the first collection moment includes: Determine the pitch angle at the second acquisition moment based on the first acquisition moment, the second acquisition moment, and the angular velocity corresponding to the second acquisition moment; determining the turbulence state at the second collection moment based on the turbulence state at the first collection moment, the pitch angle at the first collection moment, and the pitch angle at the second collection moment; The determining the pitch angle at the second acquisition moment based on the first acquisition moment, the second acquisition moment, and the angular velocity corresponding to the second acquisition moment includes: Determine a time difference between the first acquisition time and the second acquisition time based on the first acquisition time and the second acquisition time; Determine the pitch angle at the second acquisition moment based on the time difference and the angular velocity corresponding to the second acquisition moment; The determining the turbulence state at the second collection moment based on the turbulence state at the first collection moment, the pitch angle at the first collection moment, and the pitch angle at the second collection moment includes: Determine a pitch angle difference between the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment based on the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment; When the bump state at the first collection moment is a bump state, determining the bump state at the second collection moment based on the pitch angle difference and a first preset value; Alternatively, when the bump state at the first collection moment is a non-bump state, determining the bump state at the second collection moment based on the pitch angle difference and a second preset value; When the jolting state of the frame image is a jolting state, correcting the frame image based on the pitch angle at the first acquisition moment and / or the pitch angle at the second acquisition moment includes: When the bump state of the frame image is a bump state, and the timestamp of the frame image is within an open interval between the first acquisition moment and the second acquisition moment, an average value of the pitch angle at the first acquisition moment and the pitch angle at the second acquisition moment is taken as the pitch angle of the frame image; Alternatively, when the bump state of the frame image is a bump state, and the timestamp of the frame image is consistent with the first acquisition moment, the pitch angle at the first acquisition moment is used as the pitch angle of the frame image; Alternatively, when the bump state of the frame image is a bump state, and the timestamp of the frame image is consistent with the second acquisition moment, the pitch angle at the second acquisition moment is used as the pitch angle of the frame image; The frame image is corrected based on the pitch angle of the frame image.
2. The image correction method according to claim 1, characterized in that: When the timestamp is within a closed interval between the first acquisition moment and the second acquisition moment, determining the jolting state of the frame image based on the jolting state at the first acquisition moment and / or the jolting state at the second acquisition moment comprises: When the timestamp is within an open interval between the first acquisition moment and the second acquisition moment, determining the jolting state of the frame image based on the jolting state at the first acquisition moment and the jolting state at the second acquisition moment; Alternatively, when the timestamp is consistent with the first acquisition moment, the jolting state at the first acquisition moment is directly used as the jolting state of the frame image; Alternatively, when the timestamp is consistent with the second acquisition moment, the jolting state at the second acquisition moment is directly used as the jolting state of the frame image.
3. The image correction method according to claim 1, characterized in that: The method further comprises: When the timestamp is not within the closed interval between the first acquisition time and the second acquisition time, it is determined that the jolting state of the frame image is a non-jolting state.
4. The image correction method according to claim 1, characterized in that: The correcting the frame image based on the pitch angle of the frame image includes: Extracting lane lines in the frame image; The lane line is corrected based on the pitch angle of the frame image.
5. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory is used to store a computer program, and when the computer program is executed by the processor, the processor executes the image correction method as described in any one of claims 1 to 4.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the image correction method according to any one of claims 1 to 4 is implemented.
