Lane keeping and lane changing control method and apparatus for vehicle, device, and medium
By using a greedy algorithm to select lane line detection models and calculate the center pixel of the lane, the problem of wasted computing resources in lane keeping and lane change control is solved, the real-time performance and stability of the system are improved, and driving safety is enhanced.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- CHERY AUTOMOBILE CO LTD
- Filing Date
- 2025-07-25
- Publication Date
- 2026-06-18
Smart Images

Figure CN2025110574_18062026_PF_FP_ABST
Abstract
Description
A method, device, equipment and medium for vehicle lane keeping and lane changing control
[0001] This invention claims priority to Chinese Patent Application No. 202411831340.9, filed on December 12, 2024, entitled "A method, apparatus, device and medium for lane keeping and lane changing control of a vehicle", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This invention belongs to the field of vehicle driving-related technology, and in particular relates to a vehicle lane keeping and lane changing control method, device, equipment and medium. Background Technology
[0003] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0004] Driving is easily affected by surrounding vehicles, road conditions, and the vehicle's own condition, resulting in longer reaction times and significantly impacting road traffic safety. It is understood that traffic accidents caused by lane departure account for approximately 20% of all traffic accidents, and fatal accidents account for approximately 30% of all traffic accidents. To reduce human-caused safety accidents, autonomous driving technology has become a hot topic pursued by research institutions and companies both domestically and internationally in recent years, with lane keeping and lane changing being crucial components. Lane keeping involves using onboard domain control to calculate the relative position of the vehicle and the lane lines read by the front-facing camera, keeping the vehicle within its lane. Lane changing involves altering the vehicle's trajectory to move into an adjacent lane.
[0005] Currently, lane line detection-based methods for controlling vehicle lane keeping or lane changing suffer from wasted computational resources and poor real-time performance and stability. Summary of the Invention
[0006] To overcome the shortcomings of the prior art, the present invention provides a vehicle lane keeping and lane changing control method, device, equipment and medium, which reduces the computational resource requirements of the lane keeping system, improves the real-time performance and stability of the system, and improves the passenger comfort during lane keeping and lane changing.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] In a first aspect, the present invention provides a vehicle lane keeping and lane changing control method, comprising:
[0009] Obtain an image of the road directly in front of the target vehicle;
[0010] The lane lines in the road image directly in front of the target vehicle are detected using a lane line detection model.
[0011] Based on the speed of the target vehicle, determine the pixel reference point in the road image directly in front of the target vehicle;
[0012] A greedy algorithm is used to iterate and filter the pixel group corresponding to each lane line to find the pixel group that is closest to the pixel reference point, thus obtaining the nearest pixel group;
[0013] The pixels in the nearest pixel group are sorted, the average value of the nearest adjacent pixels is calculated based on the sorting result, the lane center pixel is determined, and the lane keeping or lane changing of the target vehicle is controlled based on the determined lane center pixel.
[0014] Furthermore, the acquired road image directly in front of the target vehicle is preprocessed, including image cropping and normalization.
[0015] Furthermore, based on the speed of the target vehicle, a pixel reference point in the road image directly in front of the target vehicle is determined, specifically as follows:
[0016] Determine the center point of the image of the road directly in front of the target vehicle;
[0017] A first pixel is determined above the center point of the image in a direction away from the target vehicle;
[0018] A second pixel is determined below the center point of the image, in a direction close to the target vehicle;
[0019] When the speed of the target vehicle is greater than the first speed threshold, the first pixel is used as the pixel reference point of the target vehicle.
[0020] When the speed of the target vehicle is less than the first speed threshold, the second pixel is used as the pixel reference point of the target vehicle.
[0021] Furthermore, a greedy algorithm is used to iterate and filter the pixel group corresponding to each lane line to find the pixel group that is closest to the pixel reference point, specifically as follows:
[0022] Calculate the distance between the ordinate of the pixel corresponding to each lane line and the ordinate of the pixel reference point of the target vehicle;
[0023] Based on the distance calculation results, determine the pixel in each lane line that is closest to the pixel reference point of the target vehicle.
[0024] Furthermore, the pixels in the nearest pixel group are sorted, and the average value of the nearest adjacent pixels is calculated based on the sorting result to determine the lane center pixel. Based on the determined lane center pixel, the lane keeping or lane changing of the target vehicle is controlled, specifically:
[0025] Based on the x-coordinate of the pixels in the nearest pixel group, the pixels in the nearest pixel group are sorted.
[0026] Calculate the average value of the nearest adjacent pixels based on the sorting results, and determine the center point of the lane pixel;
[0027] Calculate the distance between the center point of the lane pixel and the pixel reference point of the target vehicle;
[0028] Based on the calculated distance, the target vehicle's lane keeping or lane changing is controlled.
[0029] Furthermore, based on the calculated distance, the lane keeping or lane changing of the target vehicle is controlled, specifically: when the center point of the lane pixel is the center point of the target vehicle's driving lane, the target vehicle is controlled to keep driving in the lane; when the center point of the lane pixel is the center point of the lane to the side of the target vehicle, the target vehicle is controlled to change lanes.
[0030] In a second aspect, the present invention provides a vehicle lane keeping and lane changing control device, comprising:
[0031] The acquisition module is configured to acquire an image of the road directly in front of the target vehicle.
[0032] The detection module is configured to: detect lane lines in the acquired road image directly in front of the target vehicle using a lane line detection model;
[0033] The determination module is configured to: determine pixel reference points in the road image directly in front of the target vehicle based on the speed of the target vehicle;
[0034] The filtering module is configured to: use a greedy algorithm to traverse and filter the pixel points of each lane line corresponding to the pixel point group that are closest to the pixel reference point, and obtain the nearest pixel point group;
[0035] The control module is configured to: sort the pixels in the nearest pixel group, calculate the average value of the nearest adjacent pixels based on the sorting result, determine the lane center pixel, and control the lane keeping or lane changing of the target vehicle based on the determined lane center pixel.
[0036] Thirdly, the present invention provides an electronic device including a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the method described in the first aspect.
[0037] Fourthly, the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in the first aspect.
[0038] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0039] The above one or more technical solutions have the following beneficial effects:
[0040] In this invention, lane lines can be detected in the road image directly in front of the target vehicle using an existing lane detection model. Based on the speed of the target vehicle, a pixel reference point in the road image directly in front of the target vehicle is determined. A greedy algorithm is used to iterate and filter the pixel group corresponding to each lane line, selecting the pixel closest to the pixel reference point to obtain the nearest pixel group. The pixels in the nearest pixel group are sorted, and the average value of adjacent nearest pixels is calculated based on the sorting result to determine the lane center pixel. Based on the determined lane center pixel, lane keeping or lane changing of the target vehicle is controlled. This invention reduces the computational resource requirements of the lane keeping system and improves the real-time performance and stability of the system by performing corresponding lane keeping or lane changing control through pixel calculation and comparison. Moreover, the method of determining the pixel reference point based on the target vehicle speed can adapt to the current state of the target vehicle, improving passenger comfort during lane keeping and lane changing while ensuring control accuracy.
[0041] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0042] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0043] Figure 1 is a flowchart of a vehicle lane keeping and lane change control method proposed in an embodiment of the present invention;
[0044] Figure 2 is an overall flowchart of a vehicle lane keeping and lane change control method proposed in an embodiment of the present invention;
[0045] Figure 3 is a schematic diagram of the image processing process of the road directly in front of the target vehicle obtained in an embodiment of the present invention;
[0046] Figure 4 is a schematic diagram of reference pixels in an embodiment of the present invention;
[0047] Figure 5 is a schematic diagram of the greedy algorithm traversal and filtering process in an embodiment of the present invention;
[0048] Figure 6 shows the actual lane lines and the inferred lane lines in an embodiment of the present invention, as well as a schematic diagram of each pixel.
[0049] Figure 7 is a schematic diagram of a vehicle lane keeping and lane changing control device in an embodiment of the present invention;
[0050] Figure 8 is a structural block diagram of a terminal in an embodiment of the present invention. Detailed Implementation
[0051] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0052] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.
[0053] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0054] Currently, lane detection algorithms typically employ two main types: model-based and feature-based methods. These methods are used to detect lane lines and subsequently control vehicle keeping or lane changing. However, model-based methods focus on improving the model to enhance lane detection accuracy, and the application of large models involves significant computational costs. Feature-based methods primarily detect lane lines by utilizing features such as gradients, directions, and grayscale values at lane edge points. However, these methods are susceptible to interference from the road environment, leading to inaccurate lane detection.
[0055] As shown in Figure 1, this embodiment discloses a vehicle lane keeping and lane changing control method, including:
[0056] Obtain an image of the road directly in front of the target vehicle;
[0057] The lane lines in the road image directly in front of the target vehicle are detected using a lane line detection model.
[0058] Based on the speed of the target vehicle, determine the pixel reference point in the road image directly in front of the target vehicle;
[0059] A greedy algorithm is used to iterate and filter the pixel group corresponding to each lane line to find the pixel group that is closest to the pixel reference point, thus obtaining the nearest pixel group;
[0060] The pixels in the nearest pixel group are sorted, the average value of the nearest adjacent pixels is calculated based on the sorting result, the lane center pixel is determined, and the lane keeping or lane changing of the target vehicle is controlled based on the determined lane center pixel.
[0061] In some embodiments, the acquired image of the road directly in front of the target vehicle is preprocessed, and the preprocessing includes image cropping and normalization.
[0062] In some embodiments, a pixel reference point in the road image directly in front of the target vehicle is determined based on the speed of the target vehicle, specifically:
[0063] Determine the center point of the image of the road directly in front of the target vehicle;
[0064] A first pixel is determined above the center point of the image in a direction away from the target vehicle;
[0065] A second pixel is determined below the center point of the image, in a direction close to the target vehicle;
[0066] When the speed of the target vehicle is greater than the first speed threshold, the first pixel is used as the pixel reference point of the target vehicle.
[0067] When the speed of the target vehicle is less than the first speed threshold, the second pixel is used as the pixel reference point of the target vehicle.
[0068] In some embodiments, a greedy algorithm is used to iterate and filter the pixel group corresponding to each lane line to obtain the pixel group that is closest to the pixel reference point, specifically:
[0069] Calculate the distance between the ordinate of the pixel corresponding to each lane line and the ordinate of the pixel reference point of the target vehicle;
[0070] Based on the distance calculation results, determine the pixel in each lane line that is closest to the pixel reference point of the target vehicle.
[0071] In some embodiments, the pixels in the nearest pixel group are sorted, the average value of the nearest adjacent pixels is calculated based on the sorting result, the lane center pixel is determined, and the lane keeping or lane changing of the target vehicle is controlled based on the determined lane center pixel, specifically:
[0072] Based on the x-coordinate of the pixels in the nearest pixel group, the pixels in the nearest pixel group are sorted.
[0073] Calculate the average value of the nearest adjacent pixels based on the sorting results, and determine the center point of the lane pixel;
[0074] Calculate the distance between the center point of the lane pixel and the pixel reference point of the target vehicle;
[0075] Based on the calculated distance, the target vehicle's lane keeping or lane changing is controlled.
[0076] In some embodiments, the lane keeping or lane changing of the target vehicle is controlled based on the calculated distance, specifically: when the center point of the lane pixel is the center point of the target vehicle's driving lane, the target vehicle is controlled to keep driving in the lane; when the center point of the lane pixel is the center point of the lane to the side of the target vehicle, the target vehicle is controlled to change lanes.
[0077] Figure 2 is a flowchart of a vehicle lane keeping and lane change control method proposed in this embodiment. Referring to Figures 1 and 2, the method includes the following steps:
[0078] Step 1: Obtain an image of the road directly in front of the target vehicle.
[0079] Since vehicles typically need to acquire information about the road ahead in order to achieve autonomous driving, a front-facing camera can be mounted above the vehicle's windshield, as shown in Figure 2. In this method, the front-facing camera can acquire an image of the road directly in front of the target vehicle.
[0080] As one implementation method, considering coverage and redundancy, the front-facing camera used is an RGB short-throw camera with a field of view of about 30 degrees. The front-facing camera can be an industrial camera with a resolution of 720x1080 pixels, which is placed above the windshield inside the cockpit to avoid obstruction.
[0081] The front-facing camera should be horizontally parallel to the ground, with the ground occupying at least 50% of the overall frame. During installation, the front-facing camera should be positioned directly in front of the vehicle, ensuring that the center point of the image captured by the camera is aligned with the vehicle's centerline.
[0082] In the vehicle perception system, vehicles primarily rely on ground information for autonomous navigation; information such as the sky and roadside trees is considered clutter in the lane-keeping system. The vehicle control and computing unit used in this embodiment is an NVIDIA Orin domain controller.
[0083] Step 2: Detect lane lines in the road image directly in front of the target vehicle using a lane line detection model.
[0084] This embodiment uses a deep learning-based lane detection model to detect lane information in the road image directly in front of the target vehicle.
[0085] The original road image in front of the target vehicle contains a large amount of information and noise that is invalid for the algorithm. Therefore, this embodiment preprocesses the original road image in front of the target vehicle to remove this invalid information, which can effectively speed up the operation of the lane detection algorithm and improve its robustness.
[0086] As shown in Figure 2, before using the lane detection model for detection, it is necessary to preprocess the original road image directly in front of the target vehicle.
[0087] As shown in Figure 3, the preprocessing of the acquired original road image directly in front of the target vehicle specifically includes:
[0088] Step 201: The image needs to be cropped, retaining the bottom 60% of the image.
[0089] Since lane lines can only appear in the ground information at the bottom of the image, cropping the image can effectively improve the utilization of information and the performance of deep learning models.
[0090] Step 202: Adjust the cropped image to the input size for deep learning, and perform normalization.
[0091] During lane detection model training, normalization can accelerate network convergence and improve network accuracy. Because the image is cropped and enlarged before being input into the lane detection model, the pixel coordinates output by the model are not the pixel coordinates of the original image. They need to be transformed to obtain the original image pixel coordinates. As shown in Figure 3, coordinate transformation is required on the pixel coordinates output by the lane detection model to obtain the lane line pixel coordinates of the original image.
[0092] Step 3: Determine the pixel reference point in the road image directly in front of the target vehicle based on the speed of the target vehicle.
[0093] Take the center point O(x,y) of the image captured by the front-facing camera. In step 1, the camera was adjusted to face directly in front of the target vehicle, so point O(x,y) represents a fixed distance point directly in front of the target vehicle. Then, as shown in Figure 4, based on this center point O, take two points slightly above and slightly below the camera's image, namely the first pixel P1 and the second pixel P2, which represent fixed positions that are farther and closer to the target vehicle, respectively. The selection of pixels is determined by the camera calibration.
[0094] When the target vehicle is traveling at a higher speed than the first speed threshold, the pixel reference point of the target vehicle is selected as the more distant pixel point, i.e., the first pixel point P1. When the vehicle is traveling at a lower speed than the first speed threshold, the pixel reference point of the target vehicle is selected as the more nearby pixel point, i.e., the second pixel point P2.
[0095] The first speed threshold can be determined based on the actual situation.
[0096] Step 4: Use a greedy algorithm to traverse and filter the pixel group corresponding to each lane line and the pixel reference point that is closest to it to obtain the nearest pixel group.
[0097] By using the lane detection model in step 2 to detect the road image directly in front of the target vehicle, multiple lane lines will be obtained, along with the pixel coordinates of each lane line on the original image.
[0098] As shown in Figure 2, after the lane line detection model is used for detection, post-processing is required, namely, calculating the closest point of each lane line to the reference point.
[0099] As shown in Figure 5, for each lane line, a greedy algorithm is used to calculate the pixel D closest to the corresponding pixel of the vehicle pixel reference point P1 or P2, specifically including:
[0100] Step 401: Initialize the result array to store the pixels of the lane lines;
[0101] Step 402: Determine whether the calculation of each lane line has been completed; if yes, end; if no, proceed to step 403.
[0102] Step 403: Initialize the nearest distance to 9999999 and the pixel index to 0;
[0103] Step 404: Determine whether every pixel of a lane line has been calculated. If yes, save the result of this lane line in the result array; otherwise, proceed to step 405.
[0104] Step 405: Calculate the distance between the y-coordinate value of the pixel at this moment and the y-coordinate value of the pixel reference point P1 or P2 of the vehicle;
[0105] Step 406: If this distance is less than the minimum distance, update the latest distance and the corresponding pixel index, and return to step 404.
[0106] Step 5: Sort the pixels in the nearest pixel group, calculate the average value of the nearest adjacent pixels based on the sorting result, determine the lane center pixel, and control the lane keeping or lane changing of the target vehicle based on the determined lane center pixel.
[0107] After obtaining the nearest pixel group D, which consists of the nearest pixels of all lane lines, in step 4, sort pixel group D according to the x-coordinate of the pixel sequence. Then, as shown in Figure 6, calculate the average of D[i] and D[i+1] pairwise. This value is the pixel center point M of each lane. When the vehicle speed is high, the far point, i.e., the first pixel P1, is referenced; when the vehicle speed is low, the near point, i.e., the second pixel P2, is selected. Here, [i] and [i+1] represent the lower coordinate index of the pixel, such as calculating the average between the 0th and 1st pixels, and calculating the average between the 1st and 2nd pixels.
[0108] After obtaining the pixel coordinates of the lane center, these coordinates are transmitted to the control module. As shown in Figure 2, after obtaining the pixel coordinates of the lane center, it is also necessary to minimize the distance from the reference point. Specifically, the Euclidean distance between the lane center pixel M and the reference pixel P in front of the vehicle is calculated, and PID (Proportional Integral Derivative) control is used to reduce the error. The input to the PID is the error between the two points, and the output is the steering angle of the target vehicle. When the lane center pixel M is the center point of the vehicle's driving lane, the vehicle can maintain its lane; when the lane center pixel M is the center point of the lane to the side of the vehicle, the vehicle can change lanes.
[0109] As shown in Figure 7, the purpose of this embodiment is to provide a vehicle lane keeping and lane changing control device, including:
[0110] The acquisition module is configured to acquire an image of the road directly in front of the target vehicle.
[0111] The detection module is configured to: detect lane lines in the acquired road image directly in front of the target vehicle using a lane line detection model;
[0112] The determination module is configured to: determine pixel reference points in the road image directly in front of the target vehicle based on the speed of the target vehicle;
[0113] The filtering module is configured to: use a greedy algorithm to traverse and filter the pixel points of each lane line corresponding to the pixel point group that are closest to the pixel reference point, and obtain the nearest pixel point group;
[0114] The control module is configured to: sort the pixels in the nearest pixel group, calculate the average value of the nearest adjacent pixels based on the sorting result, determine the lane center pixel, and control the lane keeping or lane changing of the target vehicle based on the determined lane center pixel.
[0115] Referring to Figure 8, Figure 8 shows a structural block diagram of a terminal 800 provided in an exemplary embodiment of this application. The terminal 800 can be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The terminal 800 may also be referred to as a user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0116] Typically, terminal 800 includes a processor 801 and a memory 802.
[0117] Processor 801 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 801 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 801 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 801 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 801 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0118] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 802 are used to store at least one line of program code, which is executed by the processor 801 to implement the motor end cap optimization method provided in the method embodiments of this application.
[0119] In some embodiments, the terminal 800 may also optionally include a peripheral device interface 803 and at least one peripheral device. The processor 801, memory 802, and peripheral device interface 803 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 803 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807, and a power supply 808.
[0120] Peripheral device interface 803 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 801 and memory 802. In some embodiments, processor 801, memory 802 and peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 801, memory 802 and peripheral device interface 803 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0121] The radio frequency (RF) circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 804 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 804 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 804 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0122] Display screen 805 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 805 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 801 for processing. In this case, display screen 805 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 805, disposed on the front panel of terminal 800; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 800 or in a folded design; in other embodiments, display screen 805 may be a flexible display screen, disposed on a curved or folded surface of terminal 800. Furthermore, display screen 805 may be configured as a non-rectangular irregular shape, i.e., a non-rectangular screen. Display screen 805 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0123] The camera assembly 806 is used to acquire images or videos. Optionally, the camera assembly 806 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 806 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0124] The audio circuit 807 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 801 for processing, or input to the radio frequency circuit 804 to achieve voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal 800. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 807 may also include a headphone jack.
[0125] Power supply 808 is used to supply power to the various components in terminal 800. Power supply 808 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 808 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0126] In some embodiments, the terminal 800 further includes one or more sensors 809. The one or more sensors 809 include, but are not limited to, an accelerometer 810, a gyroscope 811, a pressure sensor 812, an optical sensor 813, and a proximity sensor 814.
[0127] Accelerometer 810 can detect the magnitude of acceleration on the three coordinate axes of a coordinate system established by terminal 800. For example, accelerometer 810 can be used to detect the components of gravitational acceleration on the three coordinate axes. Processor 801 can control display screen 805 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 810. Accelerometer 810 can also be used for games or for acquiring user motion data.
[0128] The gyroscope sensor 811 can detect the orientation and rotation angle of the terminal 800. The gyroscope sensor 811 can work in conjunction with the accelerometer sensor 810 to collect 3D motion data from the user on the terminal 800. Based on the data collected by the gyroscope sensor 811, the processor 801 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0129] The pressure sensor 812 can be disposed on the side bezel of the terminal 800 and / or the lower layer of the display screen 805. When the pressure sensor 812 is disposed on the side bezel of the terminal 800, it can detect the user's grip signal on the terminal 800, and the processor 801 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 812. When the pressure sensor 812 is disposed on the lower layer of the display screen 805, the processor 801 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 805. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0130] An optical sensor 813 is used to collect ambient light intensity. In one embodiment, the processor 801 can control the display brightness of the display screen 805 based on the ambient light intensity collected by the optical sensor 813. Specifically, when the ambient light intensity is high, the display brightness of the display screen 805 is increased; when the ambient light intensity is low, the display brightness of the display screen 805 is decreased. In another embodiment, the processor 801 can also dynamically adjust the shooting parameters of the camera assembly 806 based on the ambient light intensity collected by the optical sensor 813.
[0131] The proximity sensor 814, also known as a distance sensor, is typically located on the front panel of the terminal 800. The proximity sensor 814 is used to detect the distance between the user and the front of the terminal 800. In one embodiment, when the proximity sensor 814 detects that the distance between the user and the front of the terminal 800 is gradually decreasing, the processor 801 controls the display screen 805 to switch from a screen-on state to a screen-off state; when the proximity sensor 814 detects that the distance between the user and the front of the terminal 800 is gradually increasing, the processor 801 controls the display screen 805 to switch from a screen-off state to a screen-on state.
[0132] Those skilled in the art will understand that the structure shown in FIG8 does not constitute a limitation on the terminal 800, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0133] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one piece of program code that is loaded and executed by a processor to implement the motor end cover optimization method in the above embodiments.
[0134] In an exemplary embodiment, a computer program product is also provided, which stores at least one piece of program code, which is loaded and executed by a processor to implement the motor end cover optimization method in the above embodiments.
[0135] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0136] The above description is only for the purpose of enabling those skilled in the art to understand the technical solution of this application, and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A vehicle lane keeping and lane changing control method, characterized in that, include: Obtain an image of the road directly in front of the target vehicle; The lane lines in the road image directly in front of the target vehicle are detected using a lane line detection model. Based on the speed of the target vehicle, determine the pixel reference point in the road image directly in front of the target vehicle; A greedy algorithm is used to iterate and filter the pixel group corresponding to each lane line to find the pixel group that is closest to the pixel reference point, thus obtaining the nearest pixel group; The pixels in the nearest pixel group are sorted, the average value of the nearest adjacent pixels is calculated based on the sorting result, the lane center pixel is determined, and the lane keeping or lane changing of the target vehicle is controlled based on the determined lane center pixel.
2. The vehicle lane keeping and lane changing control method as described in claim 1, characterized in that, The acquired image of the road directly in front of the target vehicle is preprocessed, including image cropping and normalization.
3. The vehicle lane keeping and lane changing control method as described in claim 1, characterized in that, Based on the speed of the target vehicle, determine the pixel reference point in the road image directly in front of the target vehicle, specifically as follows: Determine the center point of the image of the road directly in front of the target vehicle; A first pixel is determined above the center point of the image in a direction away from the target vehicle; A second pixel is determined below the center point of the image, in a direction close to the target vehicle; When the speed of the target vehicle is greater than the first speed threshold, the first pixel is used as the pixel reference point of the target vehicle. When the speed of the target vehicle is less than the first speed threshold, the second pixel is used as the pixel reference point of the target vehicle.
4. The vehicle lane keeping and lane changing control method as described in claim 1, characterized in that, A greedy algorithm is used to iterate and filter the pixel groups corresponding to each lane line to find the pixels closest to the pixel reference point, resulting in the nearest pixel group. Specifically: Calculate the distance between the ordinate of the pixel corresponding to each lane line and the ordinate of the pixel reference point of the target vehicle; Based on the distance calculation results, determine the pixel in each lane line that is closest to the pixel reference point of the target vehicle.
5. The vehicle lane keeping and lane changing control method as described in claim 1, characterized in that, The pixels in the nearest pixel group are sorted, and the average value of the nearest adjacent pixels is calculated based on the sorting result to determine the lane center pixel. Based on the determined lane center pixel, the lane keeping or lane changing of the target vehicle is controlled, specifically: Based on the x-coordinate of the pixels in the nearest pixel group, the pixels in the nearest pixel group are sorted. Calculate the average value of the nearest adjacent pixels based on the sorting results, and determine the center point of the lane pixel; Calculate the distance between the center point of the lane pixel and the pixel reference point of the target vehicle; Based on the calculated distance, the target vehicle's lane keeping or lane changing is controlled.
6. The vehicle lane keeping and lane changing control method as described in claim 5, characterized in that, Based on the calculated distance, the target vehicle's lane keeping or lane changing is controlled. Specifically, when the center point of the lane pixel is the center point of the target vehicle's driving lane, the target vehicle is controlled to keep driving in its lane; when the center point of the lane pixel is the center point of the lane to the side of the target vehicle, the target vehicle is controlled to change lanes.
7. A vehicle lane keeping and lane changing control device, characterized in that, include: The acquisition module is configured to acquire an image of the road directly in front of the target vehicle. The detection module is configured to: detect lane lines in the acquired road image directly in front of the target vehicle using a lane line detection model; The determination module is configured to: determine pixel reference points in the road image directly in front of the target vehicle based on the speed of the target vehicle; The filtering module is configured to: use a greedy algorithm to traverse and filter the pixel points of each lane line corresponding to the pixel point group that are closest to the pixel reference point, and obtain the nearest pixel point group; The control module is configured to: sort the pixels in the nearest pixel group, calculate the average value of the nearest adjacent pixels based on the sorting result, determine the lane center pixel, and control the lane keeping or lane changing of the target vehicle based on the determined lane center pixel.
8. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the method described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the method described in any one of claims 1-6.