Structured road drivable region visual recognition method
By preprocessing and extracting edge features from structured road images, and combining historical information for multi-dimensional matching, the problem of inaccurate identification caused by wear and tear on signs in traditional methods has been solved, achieving more efficient and accurate identification of drivable areas.
Patent Information
- Application Number
- CN202411813904.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Traditional methods for identifying drivable road zones rely on manually placed road signs, which are prone to inaccurate information due to wear, obstruction, and other factors, making them difficult to adapt to complex and ever-changing actual road conditions and the need for rapid construction and renovation.
By acquiring images of structured roads, preprocessing and extracting edge features, and using grayscale conversion and multi-dimensional matching verification, the grayscale values and edge features of the images are dynamically adjusted, and historical road information is combined for accurate identification.
It significantly improves the accuracy and stability of drivable area identification, reduces the impact of uneven lighting and other factors, and ensures the integrity and reliability of the identification results.
Smart Images

Figure CN119904836B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to a method for visual recognition of drivable areas of structured roads. Background Technology
[0002] With the rapid development of intelligent transportation systems and the gradual transition of autonomous driving technology from theoretical research to practical application, the requirements for the accuracy and reliability of road environment perception are increasing. Accurately identifying drivable areas of structured roads is a crucial task in understanding the entire traffic scenario, directly impacting the safe and efficient operation of vehicles.
[0003] Traditional methods for identifying drivable road zones rely primarily on manually installed road signs and other hardware, but these methods have many limitations. For example, road signs may become inaccurate or unavailable due to wear, obstruction, or inclement weather, making it difficult to adapt to complex and ever-changing real-world road conditions and the rapid construction and renovation needs of different cities and road sections.
[0004] Based on this, the present invention provides a visual recognition method for drivable areas of structured roads to solve the aforementioned technical problems. Summary of the Invention
[0005] The purpose of this invention is to provide a visual recognition method for drivable areas of structured roads. This invention acquires images of structured roads, preprocesses the acquired images to obtain a first image processing result, then extracts edge features from the first image processing result to obtain a second image processing result. Based on the second image processing result, the drivable area of the structured road is determined. This invention enables the grayscale image to more accurately reflect the true structural information of the road, reduces the impact of image quality caused by uneven lighting, and thus helps to more accurately identify drivable areas. Through precise edge feature extraction, the contours of road-related structures can be more completely and accurately delineated, significantly improving the overall recognition accuracy. The location information of the acquired image is used to retrieve corresponding historical road information, and this information is matched and verified with the feature lines extracted from the current image in a multi-dimensional manner, further ensuring the accuracy of drivable area determination.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A first aspect of the present invention provides a visual recognition method for drivable areas of structured roads, comprising the following steps:
[0008] Obtain images of structured roads;
[0009] The acquired image is preprocessed to obtain the first image processing result;
[0010] The edge features of the image obtained from the first image processing result are extracted to obtain the second image processing result;
[0011] Based on the obtained second image processing results, the drivable area of the structured road is determined.
[0012] A further feature of this invention is that the image is acquired using an in-vehicle camera.
[0013] The present invention is further configured such that the preprocessing of the acquired image is as follows:
[0014] The acquired image is converted to grayscale: the acquired image is divided into several non-overlapping sub-regions according to a set window size; the contrast value H of each sub-region is calculated; the obtained contrast value H is compared with a preset grayscale threshold T. If the contrast value H > the preset grayscale threshold T, the weights of the red, green, and blue channels are adjusted, and then the formula Y = α² × R is used. i,j +β2×G i,j +γ2×B i,j In the formula, α2, β2, and γ2 are the adjusted weights of the red, green, and blue channels, respectively, to calculate the grayscale value of the sub-region. Otherwise, the formula Y = α1 × R is used. i,j +β1×G i,j +γ1×B i,j In the formula, α1, β1, and γ1 are the weights of the unadjusted red, green, and blue channels, respectively, and the grayscale value of the sub-region is calculated to obtain the grayscale image;
[0015] Enhancement of the grayscale image: The grayscale image is divided into several non-overlapping sub-regions according to a set window size. The enhancement formula is then used to enhance each sub-region: Z = round[K(i) × 255], where... y(i) represents the frequency of pixels with gray value i within the sub-region, and n represents the total number of pixels within the sub-region.
[0016] The present invention is further configured such that the formula for calculating the contrast value is: In the formula, R i,j G i,j B i.j These are the pixel values of the red, green, and blue channels of pixel point (i, j) within the sub-region, respectively.
[0017] A further feature of this invention is that the formula for adjusting the weights of the red, green, and blue channels is: In the formula, k is a parameter, k∈(0,1).
[0018] The present invention is further configured such that the edge feature extraction process is as follows:
[0019] Obtain the gradient components X of the image in the horizontal and vertical directions. x X y Calculate the gradient magnitude X and gradient direction angle θ for each pixel, where,
[0020] Compare the gradient magnitude of the pixel with the gradient magnitude of its two adjacent pixels in the gradient direction. If the pixel is not the maximum value, set its gradient magnitude to 0.
[0021] Pixels in the image whose gradient magnitude is greater than a first preset threshold are marked as edge points, and pixels whose gradient magnitude is less than a second threshold are removed. At the same time, pixels whose gradient magnitude is between the first and second preset thresholds are also marked as edge points if they are connected to edge points. The first preset threshold is greater than the second preset threshold.
[0022] Connecting the edge points yields an image with extracted edge features.
[0023] The present invention is further configured such that the process of determining the drivable area of the structured road is as follows:
[0024] Extract several feature lines from the image from the edge feature extraction image;
[0025] Based on the location information of the acquired image, retrieve the stored historical road information;
[0026] Obtain road edge spacing, number of lane lines, and lane line spacing from historical road information;
[0027] The obtained road edge spacing, lane number, and lane spacing are matched with several feature lines to obtain the drivable area of the structured road.
[0028] The present invention is further configured such that: if any one of the matching results does not match, the identification of the drivable area of the structured road is performed again, wherein the specific content of the matching is:
[0029] If the difference between the road edge spacing and the spacing between the two outermost feature lines is within the edge difference threshold, then the road edge matching is correct.
[0030] If the number of lane lines is equal to the number of feature lines after removing the road edges, then the number of lane lines matches.
[0031] If the lane spacing and the spacing between adjacent feature lines are within the lane spacing threshold, then the lane spacing is matched.
[0032] A second aspect of the invention also provides a visual recognition device for structured road drivable areas, comprising:
[0033] One or more processors;
[0034] Memory;
[0035] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the above-described structured road drivable area visual recognition method.
[0036] A third aspect of the present invention also provides a computer program product, including computer instructions that instruct a computer device to perform the operation corresponding to the above-described method.
[0037] Compared with the prior art, the beneficial effects of the present invention are:
[0038] This invention acquires images of structured roads, preprocesses them to obtain a first image processing result, and then extracts edge features from the first image processing result to obtain a second image processing result. Based on the second image processing result, the drivable area of the structured road is determined. This invention first dynamically adjusts the weight of grayscale value calculation based on sub-region contrast values, which better adapts to the characteristics of images under different lighting and road scenes. This makes the grayscale image more accurately reflect the true structural information of the road, reducing the impact of image quality caused by uneven lighting and other factors, thus helping to more accurately identify drivable areas. Through precise edge feature extraction, the contours of road-related structures can be delineated more completely and accurately, avoiding drivable area identification errors caused by edge misjudgment, significantly improving the overall recognition accuracy. The invention utilizes the positioning information of the acquired images to retrieve corresponding historical road information and performs multi-dimensional matching verification with the feature lines extracted from the current image. This fully leverages prior knowledge to compensate for the information limitations that may exist in a single image, further ensuring the accuracy of drivable area determination and minimizing the occurrence of misidentification. Attached Figure Description
[0039] Figure 1 This is a flowchart of a visual recognition method for structured road drivable areas according to the present invention. Detailed Implementation
[0040] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0041] Example:
[0042] like Figure 1 As shown, this embodiment provides a visual recognition method for drivable areas of structured roads, including the following steps:
[0043] S1. Obtain an image of the structured road.
[0044] The images were acquired using an in-vehicle camera.
[0045] In this embodiment, it should be noted that the vehicle-mounted camera, as the source of image acquisition, can capture real-time images of the actual scene of the structured road ahead or around the vehicle during its journey, providing fundamental data for the subsequent identification of the entire drivable area. These images contain rich road information, such as road boundaries, lane lines, road surface conditions, and the surrounding environment, serving as the raw material for subsequent precise analysis and identification. Moreover, the viewing angle of the images acquired by the vehicle-mounted camera is closely related to the vehicle's driving direction, meeting the needs for determining drivable areas in actual driving scenarios, and providing intuitive and crucial visual evidence for autonomous driving or assisted driving systems to accurately plan driving paths and avoid collisions.
[0046] S2. Preprocess the acquired image to obtain the first image processing result.
[0047] The preprocessing of the acquired images is as follows:
[0048] The acquired image is converted to grayscale: the acquired image is divided into several non-overlapping sub-regions according to a set window size; the contrast value H of each sub-region is calculated; the obtained contrast value H is compared with a preset grayscale threshold T. If the contrast value H > the preset grayscale threshold T, the weights of the red, green, and blue channels are adjusted, and then the formula Y = α² × R is used. i,j +β2×G i,j +γ2×B i,j In the formula, α2, β2, and γ2 are the adjusted weights of the red, green, and blue channels, respectively, to calculate the grayscale value of the sub-region. Otherwise, the formula Y = α1 × R is used. i,j +β1×G i,j +γ1×B i,jIn the formula, α1, β1, and γ1 are the weights of the unadjusted red, green, and blue channels, respectively, and the grayscale value of the sub-region is calculated to obtain the grayscale image;
[0049] Enhancement of the grayscale image: The grayscale image is divided into several non-overlapping sub-regions according to a set window size. The enhancement formula is then used to enhance each sub-region: Z = round[K(i) × 255], where... y(i) represents the frequency of pixels with gray value i within the sub-region, and n represents the total number of pixels within the sub-region.
[0050] Furthermore, the formula for calculating the contrast ratio is: In the formula, R i,j G i,j B i.j These are the pixel values of the red, green, and blue channels of pixel point (i, j) within the sub-region, respectively.
[0051] The formula for adjusting the weights of the red, green, and blue channels is as follows: In the formula, k is a parameter, k∈(0,1).
[0052] In this embodiment, it should be noted that dividing the image into several non-overlapping sub-regions according to a set window size and then calculating the contrast value of each sub-region can enable the processing of pixel color changes in different local areas. Different road scenes, lighting conditions and other factors can cause significant differences in the visual performance of different parts of the image. Through this calculation of local contrast, we can gain a more detailed understanding of the image's microscopic features.
[0053] By comparing the contrast value of a sub-region with a preset grayscale threshold, it is determined whether to adjust the weights of the red, green, and blue channels before calculating the grayscale value. A higher contrast value indicates a significant color change in the pixels of that region. Adjusting the weights allows the grayscale image to better reflect real road structure and other information, avoiding the loss of some key features or the introduction of unnecessary interference due to uniform processing. As one implementation method in this embodiment, α1, β1, and γ1 can be set to 0.299, 0.587, and 0.114, respectively.
[0054] By using an enhancement formula, the pixel grayscale value is adjusted according to the frequency of pixels with different grayscale values within a sub-region, making the grayscale distribution in each sub-region of the image more reasonable. This enhances the contrast and clarity of the overall image, which helps to accurately extract the edge features of the image and determine the drivable area, thereby improving the accuracy and reliability of recognition.
[0055] S3. Extract the edge features of the image obtained from the first image processing result to obtain the second image processing result.
[0056] The process of edge feature extraction is as follows:
[0057] Obtain the gradient components X of the image in the horizontal and vertical directions. x X y Calculate the gradient magnitude X and gradient direction angle θ for each pixel, where,
[0058] Compare the gradient magnitude of the pixel with the gradient magnitude of its two adjacent pixels in the gradient direction. If the pixel is not the maximum value, set its gradient magnitude to 0.
[0059] Pixels in the image whose gradient magnitude is greater than a first preset threshold are marked as edge points, and pixels whose gradient magnitude is less than a second threshold are removed. At the same time, pixels whose gradient magnitude is between the first and second preset thresholds are also marked as edge points if they are connected to edge points. The first preset threshold is greater than the second preset threshold.
[0060] Connecting the edge points yields an image with extracted edge features.
[0061] In this embodiment, it should be noted that, as one implementation method, the Sobel operator template in the horizontal direction is as follows: X is obtained by convolving with the image x The template in the vertical direction is: X is obtained after convolution y By setting a first preset threshold and a second preset threshold, pixels in the image with gradient magnitudes greater than the first preset threshold are directly marked as edge points, while pixels with gradient magnitudes less than the second threshold are removed. Pixels with gradient magnitudes between the two thresholds and connected to the identified edge points are also marked as edge points. This dual-threshold mechanism allows for more flexible and accurate edge determination. On the one hand, it preserves obvious strong edges, and on the other hand, it incorporates pixels with relatively low gradient magnitudes but associated with strong edges and belonging to true edges by reasonably utilizing the correlation between thresholds. This avoids missing some edge information, ultimately resulting in a relatively complete and accurate edge feature extraction image, providing clear boundary lines for identifying key elements such as road boundaries and lane lines when determining drivable areas.
[0062] S4. Based on the obtained second image processing results, determine the drivable area of the structured road.
[0063] The process of determining the drivable area of a structured road is as follows:
[0064] Extract several feature lines from the image from the edge feature extraction image;
[0065] Based on the location information of the acquired image, retrieve the stored historical road information;
[0066] Obtain road edge spacing, number of lane lines, and lane line spacing from historical road information;
[0067] The obtained road edge spacing, lane number, and lane spacing are matched with several feature lines to obtain the drivable area of the structured road.
[0068] Furthermore, if any match is found in the matching results, the identification of the drivable area of the structured road is performed again. The specific content of the matching is as follows:
[0069] If the difference between the road edge spacing and the spacing between the two outermost feature lines is within the edge difference threshold, then the road edge matching is correct.
[0070] If the number of lane lines is equal to the number of feature lines after removing the road edges, then the number of lane lines matches.
[0071] If the lane spacing and the spacing between adjacent feature lines are within the lane spacing threshold, then the lane spacing is matched.
[0072] In this embodiment, it should be noted that the acquired road edge spacing, lane number, and lane spacing are matched with several feature lines, and the drivable area is accurately determined through clearly defined matching rules. Known road structure standards are then used to verify and define the drivable range, ensuring that the final determined area conforms to the actual road layout and traffic rules. This provides accurate and reliable drivable area data for applications such as path planning for autonomous vehicles and violation detection in intelligent transportation systems. If any matching result is inconsistent, the drivable area identification of the structured road is re-performed. Through this iterative verification and error correction mechanism, the accuracy and stability of the identification results are further improved, ensuring that the entire identification process can still output reliable drivable area information in complex and ever-changing road environments.
[0073] Furthermore, this embodiment also provides a structured road drivable area visual recognition device, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more application programs are configured to perform the above-described structured road drivable area visual recognition method.
[0074] This embodiment also provides a computer program product, including computer instructions, which instruct a computer device to perform the operation corresponding to the above method.
[0075] Embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), it performs the functions defined above in the system of this application.
[0076] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0077] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0078] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A visual recognition method for drivable areas of structured roads, characterized in that, Includes the following steps: Obtain images of structured roads; The acquired image is preprocessed to obtain the first image processing result; The edge features of the image obtained from the first image processing result are extracted to obtain the second image processing result; Based on the obtained second image processing results, the drivable area of the structured road is determined; The preprocessing procedure for the acquired image is as follows: The acquired image is converted to grayscale: the acquired image is divided into several non-overlapping sub-regions according to a set window size; the contrast value of each sub-region is calculated. The obtained contrast value With preset grayscale threshold Compare them, if the contrast value Preset grayscale threshold At that time, adjust the weights of the red, green, and blue channels, and then use the formula. In the formula, , , The grayscale value of the sub-region is calculated by assigning the adjusted weights to the red, green, and blue channels; otherwise, the grayscale value is calculated using the formula... In the formula, , , These are the unadjusted weights for the red, green, and blue channels, respectively. , , These are the pixels within the sub-region ( , The pixel values of the red, green, and blue channels of the image are used to calculate the grayscale value of the sub-region; thus, a grayscale image is obtained. Enhancement of the grayscale image: The grayscale image is divided into several non-overlapping sub-regions according to a set window size. An enhancement formula is then used to enhance each sub-region. The enhancement formula is as follows: In the formula, , The grayscale value of this sub-region pixel frequency, This represents the total number of pixels within the sub-region. The process of determining the drivable area of a structured road is as follows: Extract several feature lines from the image from the edge feature extraction image; Based on the location information of the acquired image, retrieve the stored historical road information; Obtain road edge spacing, number of lane lines, and lane line spacing from historical road information; The obtained road edge spacing, lane number, and lane spacing are matched with several feature lines to obtain the drivable area of the structured road. If any match is found in the matching results, the identification of the drivable area of the structured road is performed again. The specific content of the matching is as follows: If the difference between the road edge spacing and the spacing between the two outermost feature lines is within the edge difference threshold, then the road edge matching is correct. If the number of lane lines is equal to the number of feature lines after removing the road edges, then the number of lane lines matches. If the lane spacing and the spacing between adjacent feature lines are within the lane spacing threshold, then the lane spacing is matched.
2. The method for visual recognition of drivable areas of structured roads according to claim 1, characterized in that, The images are acquired using an in-vehicle camera.
3. The method for visual recognition of drivable areas of structured roads according to claim 1, characterized in that, The formula for calculating the contrast value is: .
4. The method for visual recognition of drivable areas of structured roads according to claim 1, characterized in that, The formula for adjusting the weights of the red, green, and blue channels is as follows: In the formula, For parameters, .
5. The method for visual recognition of drivable areas of structured roads according to claim 1, characterized in that, The process of edge feature extraction is as follows: Obtain the gradient components of the image in the horizontal and vertical directions. , Calculate the gradient magnitude of each pixel. and gradient direction angle ,in, , ; Compare the gradient magnitude of the pixel with the gradient magnitude of its two adjacent pixels in the gradient direction. If the pixel is not the maximum value, set its gradient magnitude to 0. Pixels in the image whose gradient magnitude is greater than a first preset threshold are marked as edge points, and pixels whose gradient magnitude is less than a second threshold are removed. At the same time, pixels whose gradient magnitude is between the first and second preset thresholds are also marked as edge points if they are connected to edge points. The first preset threshold is greater than the second preset threshold. Connecting the edge points yields an image with extracted edge features.
6. A visual recognition device for structured road drivable areas, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the structured road drivable area visual recognition method as described in any one of claims 1 to 5.
7. A computer program product, characterized in that, Includes computer instructions that instruct a computer device to perform an operation corresponding to the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Structured road identification method based on image processing
CN111626259A
Lane line detection method based on OpenCV
CN111652033A