# US 2024/0203133 A1 · Lane line recognition method, electronic device and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0203133 A1
- Document ID: US20240203133A1
- Status: Published application
- Kind: A1
- Application number: 18/125,676
- Filed: 2023-03-23
- Published: 2024-06-20
- Earliest claimed: 2022-12-20
- Assignees: Hon Hai Precision Industry Co., Ltd.
- Applicants: Hon Hai Precision Industry Co., Ltd.
- Inventors: YU-HSUAN CHIEN; CHIN-PIN KUO
- Web page: https://patentgrep.com/patent/US20240203133A1

## CPC

- G06V 20/588: {Recognition of the road, e.g. of lane markings; Recognition of the vehicle driving pattern in relation to the road}
- G06T 5/80: Geometric correction
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

A lane line recognition method applied to an electronic device is provided. In the method, the electronic device converts a first foreground image into a bird's-eye view (BEV) image and determines the initial positions of the left lane line and the right lane line of the BEV image and fits a first curve and a second curve after a first sliding window slid each time and fits a third curve and a fourth curve after a second sliding window slid each time. The electronic device recognizes the left lane line according to the second curve and the right lane line according to the fourth curve. The method improves accuracy for recognizing lane lines of a road when a vehicle is moving on the road.

## Claims

### Claim 1

A lane line recognition method using an electronic device, the method comprising:
obtaining a first foreground image while a vehicle is travelling, and converting the first foreground image into a bird's eye view (BEV) image;
determining a first initial position of a left lane line and a second initial position of a right lane line of the BEV image;
sliding a first sliding window on the BEV image from the first initial position, and fitting a first curve and a second curve after sliding the first sliding window each time, the first curve being fitted by a plurality of non-zero pixels covered by the first sliding window before arriving at a current position of the BEV image, the second curve being fitted by the first curve and a plurality of non-zero pixels covered by the first sliding window at the current position of the BEV image;
sliding a second sliding window on the BEV image from the second initial position, and fitting a third curve and a fourth curve after sliding the second sliding window each time, the third curve being fitted by a plurality of non-zero pixels covered by the second sliding window before arriving at the current position of the BEV image, the fourth curve being fitted by the third curve and a plurality of non-zero pixels covered by the second sliding window at the current position of the BEV image; and
recognizing the left lane line according to the second curve and the right lane line according to the fourth curve.

### Claim 2 (depends on 1)

The lane line recognition method according to claim 1, wherein converting the first foreground image into the BEV image comprises:
obtaining a first corrected image by performing a distortion correction on the first foreground image; and
obtaining the BEV image by performing a perspective transformation on the first corrected image.

### Claim 3 (depends on 2)

The lane line recognition method according to claim 2, wherein obtaining the first corrected image by performing the distortion correction on the first foreground image comprises:
acquiring first coordinate values of each non-zero pixel in the first foreground image in an image coordinate system, the image coordinate system being established based on the first foreground image;
acquiring a plurality of internal parameters of a camera device of a photographing apparatus of the electronic device;
determining second coordinate values corresponding to the first coordinate values according to the plurality of internal parameters, coordinates corresponding to the second coordinate values being undistorted coordinates;
calculating a distortion distance between the first coordinate values and coordinate values of a center point of the first foreground image;
calculating an image complexity of the first foreground image according to a grayscale value of each pixel of the first foreground image;
calculating a correction parameter of the first foreground image according to the image complexity;
determining a smoothing processing coefficient corresponding to the distortion distance and the correction parameter according to a preset smoothing processing function; and
obtaining the first corrected image by performing a smoothing correction on the first coordinate values based on the smoothing processing coefficient and the second coordinate values.

### Claim 4 (depends on 3)

The lane line recognition method according to claim 3, wherein performing smoothing correction on the first coordinate values based on the smoothing processing coefficient and the second coordinate values comprises:
determining a first weight of the first coordinate values and a second weight of the second coordinate values based on the smoothing processing coefficient;
calculating a first product of the first weight and the first coordinate values, and calculating a second product of the second weight and the second coordinate values; and
performing the smoothing correction on the first coordinate values based on a sum of the first product and the second product.

### Claim 5 (depends on 2)

The lane line recognition method according to claim 2, wherein performing the perspective transformation on the first corrected image comprises:
obtaining an inverse perspective transformation matrix by using a coordinate transformation formula on each target point of the first corrected image, each target point being set by each non-zero pixel of the first corrected image; and
performing the perspective transformation on the first corrected image according to the inverse perspective transformation matrix.

### Claim 6 (depends on 1)

The lane line recognition method according to claim 1, further comprising:
obtaining a second foreground image taken by the photographing apparatus while the vehicle is moving, the second foreground image being taken at a next moment of the first foreground image;
obtaining a second corrected image by performing a distortion correction on the second foreground image;
obtaining a first boundary by extending the left lane line in a first direction according to a predetermined extension distance;
obtaining a second boundary by extending the right lane line in a second direction according to the predetermined extension distance; and
determining the area where the lane lines are located in the second correction image by performing an area division on the second correction image according to the first boundary and the second boundary.

### Claim 7 (depends on 1)

The lane line recognition method according to claim 1, wherein fitting the second curve according to the first curve and the plurality of non-zero pixels covered by the first sliding window at the current position of the BEV image comprises:
obtaining the non-zero pixels corresponding to the first curve;
calculating a first total number of the non-zero pixels covered by the first sliding window at the current position; and
obtaining the second curve by fitting the non-zero pixels corresponding to the first curve and the non-zero pixels covered by the first sliding window at the current position in response that the first total number is greater than or equal to a predetermined number.

### Claim 8 (depends on 1)

The lane line recognition method according to claim 1, wherein fitting the fourth curve based on the third curve and the non-zero pixels covered by the second sliding window at the current position includes:
obtaining the non-zero pixels corresponding to the third curve;
calculating a second total number of the non-zero pixels covered by the second sliding window at the current position, in response that the second total number is greater than or equal to the predetermined number; and
obtaining the fourth curve by fitting the non-zero pixels corresponding to the third curve and the non-zero pixels covered by the second sliding window at the current position.

### Claim 9

An electronic device comprising:
a storage device;
at least one processor; and
the storage device storing one or more computer instructions, which when executed by the at least one processor, cause the at least one processor to:
obtain a first foreground image while a vehicle is travelling, and converting the first foreground image into a bird's eye view (BEV) image;
determine a first initial position of a left lane line and a second initial position of a right lane line of the BEV image;
slide a first sliding window on the BEV image from the first initial position, and fit a first curve and a second curve after sliding the first sliding window each time, the first curve being fitted by a plurality of non-zero pixels covered by the first sliding window before arriving at a current position of the BEV image, the second curve being fitted by the first curve and a plurality of non-zero pixels covered by the first sliding window at the current position of the BEV image;
slide a second sliding window on the BEV image from the second initial position, and fit a third curve and a fourth curve after sliding the second sliding window each time, the third curve being fitted by a plurality of non-zero pixels covered by the second sliding window before arriving at the current position of the BEV image, the fourth curve being fitted by the third curve and a plurality of non-zero pixels covered by the second sliding window at the current position of the BEV image; and
recognize the left lane line according to the second curve and the right lane line according to the fourth curve.

### Claim 10 (depends on 9)

The electronic device according to claim 9, wherein the at least one processor converts the first foreground image into the BEV image by:
obtaining a first corrected image by performing a distortion correction on the first foreground image; and
obtaining the BEV image by performing a perspective transformation on the first corrected image.

### Claim 11 (depends on 10)

The electronic device according to claim 10, wherein the at least one processor obtains the first corrected image by performing the distortion correction on the first foreground image by:
acquiring a first coordinate values of each non-zero pixel in the first foreground image in an image coordinate system, the image coordinate system being established based on the first foreground image;
acquiring a plurality of internal parameters of a camera device of a photographing apparatus of the electronic device;
determining second coordinate values corresponding to the first coordinate values according to the plurality of internal parameters, coordinates corresponding to the second coordinate values being undistorted coordinates;
calculating a distortion distance between the first coordinate values and coordinate values of a center point of the first foreground image;
calculating an image complexity of the first foreground image according to a grayscale value of each pixel of the first foreground image;
calculating a correction parameter of the first foreground image according to the image complexity;
determining a smoothing processing coefficient corresponding to the distortion distance and the correction parameter according to a pre-set smoothing processing function; and
obtaining the first corrected image by performing a smoothing correction on the first coordinate values based on the smoothing processing coefficient and the second coordinate values.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein the at least one processor performs smoothing correction on the first coordinate values based on the smoothing processing coefficient and the second coordinate values by:
determining a first weight of the first coordinate values and a second weight of the second coordinate values based on the smoothing processing coefficient;
calculating a first product of the first weight and the first coordinate values and a second product of the second weight and the second coordinate values; and
performing the smoothing correction on the first coordinate values based on a sum of the first product and the second product.

### Claim 13 (depends on 10)

The electronic device according to claim 10, wherein the at least one processor performs the perspective transformation on the first corrected image by:
obtaining an inverse perspective transformation matrix by using a coordinate transformation formula on each target point of the first corrected image, each target point being set by each non-zero pixel of the first corrected image; and
performing the perspective transformation on the first corrected image according to the inverse perspective transformation matrix.

### Claim 14 (depends on 9)

The electronic device according to claim 9, wherein the at least one processor is further caused to:
obtain a second foreground image taken by the photographing apparatus while the vehicle is moving, the second foreground image being taken at a next moment of the first foreground image;
obtain a second corrected image by performing a distortion correction on the second foreground image;
obtaining a first boundary by extending the left lane line in a first direction according to a predetermined extension distance;
obtaining a second boundary by extending the right lane line in a second direction according to the predetermined extension distance; and
determining the area where the lane lines are located in the second correction image by performing an area division on the second correction image according to the first boundary and the second boundary.

### Claim 15 (depends on 9)

The electronic device according to claim 9, wherein the at least one processor fits the second curve according to the first curve and the plurality of non-zero pixels covered by the first sliding window at the current position of the BEV image by:
obtaining the non-zero pixels corresponding to the first curve;
calculating a first total number of the non-zero pixels covered by the first sliding window at the current position; and
obtaining the second curve by fitting the non-zero pixels corresponding to the first curve and the non-zero pixels covered by the first sliding window at the current position in response that the first total number is greater than or equal to a predetermined number.

### Claim 16 (depends on 9)

The electronic device according to claim 9, wherein the at least one processor fits the fourth curve based on the third curve and the non-zero pixels covered by the second sliding window at the current position by:
obtaining the non-zero pixels corresponding to the third curve;
calculating a second total number of the non-zero pixels covered by the second sliding window at the current position, in response that the second total number is greater than or equal to the predetermined number; and
obtaining the fourth curve by fitting the non-zero pixels corresponding to the third curve and the non-zero pixels covered by the second sliding window at the current position.

### Claim 17

A non-transitory storage medium having instructions stored thereon, when the instructions are executed by a processor of an electronic device, cause the processor to perform a lane line recognition method, the method comprising:
obtaining a first foreground image while a vehicle is travelling, and converting the first foreground image into a bird's eye view (BEV) image;
determining a first initial position of a left lane line and a second initial position of a right lane line of the BEV image;
sliding a first sliding window on the BEV image from the first initial position, and fitting a first curve and a second curve after sliding the first sliding window each time, the first curve being fitted by a plurality of non-zero pixels covered by the first sliding window before arriving at a current position of the BEV image, the second curve being fitted by the first curve and a plurality of non-zero pixels covered by the first sliding window at the current position of the BEV image;
sliding a second sliding window on the BEV image from the second initial position, and fitting a third curve and a fourth curve after sliding the second sliding window each time, the third curve being fitted by a plurality of non-zero pixels covered by the second sliding window before arriving at the current position of the BEV image, the fourth curve being fitted by the third curve and a plurality of non-zero pixels covered by the second sliding window at the current position of the BEV image; and
recognizing the left lane line according to the second curve and the right lane line according to the fourth curve.

### Claim 18 (depends on 17)

The non-transitory storage medium according to claim 17, wherein the method further comprises:
obtaining a second foreground image taken by the photographing apparatus while the vehicle is moving, the second foreground image being taken at a next moment of the first foreground image;
obtaining a second corrected image by performing a distortion correction on the second foreground image;
obtaining a first boundary by extending the left lane line in a first direction according to a predetermined extension distance;
obtaining a second boundary by extending the right lane line in a second direction according to the predetermined extension distance; and
determining the area where the lane lines are located in the second correction image by performing an area division on the second correction image according to the first boundary and the second boundary.

### Claim 19 (depends on 17)

The non-transitory storage medium according to claim 17, wherein fitting the second curve according to the first curve and the plurality of non-zero pixels covered by the first sliding window at the current position of the BEV image comprises:
obtaining the non-zero pixels corresponding to the first curve;
calculating a first total number of the non-zero pixels covered by the first sliding window at the current position; and
obtaining the second curve by fitting the non-zero pixels corresponding to the first curve and the non-zero pixels covered by the first sliding window at the current position in response that the first total number is greater than or equal to a predetermined number.

### Claim 20 (depends on 17)

The non-transitory storage medium according to claim 17, wherein fitting the fourth curve based on the third curve and the non-zero pixels covered by the second sliding window at the current position includes:
obtaining the non-zero pixels corresponding to the third curve;
calculating a second total number of the non-zero pixels covered by the second sliding window at the current position, in response that the second total number is greater than or equal to the predetermined number; and
obtaining the fourth curve by fitting the non-zero pixels corresponding to the third curve and the non-zero pixels covered by the second sliding window at the current position.
