Method for detecting an obstacle in a parking space and storage medium

By acquiring parking space images and calculating the similarity difference coefficient of texture and color features, the high cost and environmental dependence of existing vehicle automatic parking systems are solved, achieving low-cost and highly adaptable obstacle detection.

CN114550124BActive Publication Date: 2026-05-29SAIC GENERAL MOTORS +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SAIC GENERAL MOTORS
Filing Date
2020-11-25
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing vehicle automatic parking systems, obstacle detection relies on high-cost hardware sensors that are susceptible to environmental factors and require a large amount of computation, making it difficult to meet the requirements of low cost and high accuracy.

Method used

By acquiring parking space images, splitting them into multiple sub-images, calculating the similarity of texture and color features, forming a difference coefficient to determine the presence of obstacles, and using sliding windows and image processing algorithms for obstacle detection.

Benefits of technology

It achieves low-cost, low-hardware-requirement obstacle detection, adapts to various real-world scenarios, and is unaffected by the shape and state of obstacles, thus reducing the requirements for image clarity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114550124B_ABST
    Figure CN114550124B_ABST
Patent Text Reader

Abstract

The application relates to a method for detecting an obstacle in a parking space and a storage medium, the method comprising: collecting a parking space image; splitting the parking space image into a plurality of sub-images; determining texture features and color features of each of the plurality of sub-images; determining texture similarity of adjacent two of the plurality of sub-images with respect to the texture features and color similarity with respect to the color features; forming a difference coefficient of the parking space image according to statistical information of the texture similarity and the color similarity; and judging whether an obstacle exists in the parking space according to the difference coefficient. The method can determine whether an obstacle exists in the parking space according to an image algorithm, so as to guarantee parking safety.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image detection, in particular, to a method for detecting an obstacle in a parking space and a storage medium. BACKGROUND

[0002] At present, in order to meet the needs of car owners for assisted parking and automatic parking, major enterprises and research institutions are developing automatic parking technology. Safety is the primary prerequisite for automatic parking, so the detection of obstacles is an indispensable part of the automatic parking system. When there is an obstacle in the parking space, the vehicle needs to be sent a signal that the parking space is not available in advance, or the parking needs to be stopped immediately after detecting the obstacle.

[0003] There are currently automatic parking systems applied to vehicles. The existing vehicle detection of obstacles mostly relies on sensors such as laser radar and ultrasonic waves. This method has high hardware costs, is easily affected by environmental factors such as weather, and has limited detection distance and coverage.

[0004] With the continuous development of computer vision, the introduction of image detection technology into automatic parking technology is an inevitable development trend. In software, machine learning, especially deep learning, has been able to achieve high-precision detection, but such algorithms have high hardware requirements and require a large amount of computation and database to form a training library. SUMMARY

[0005] Embodiments of the present application provide a method for detecting an obstacle in a parking space and a storage medium, which is used to determine whether there is a foreign object in the parking space according to an image algorithm, thereby ensuring parking safety.

[0006] According to an aspect of the present application, a method for detecting an obstacle in a parking space is provided, comprising: collecting a parking space image; splitting the parking space image into a plurality of sub-images; determining the texture feature and color feature of each of the plurality of sub-images; determining the texture similarity of adjacent two of the plurality of sub-images with respect to the texture feature and the color similarity with respect to the color feature; forming a difference coefficient of the parking space image according to the statistical information of the texture similarity and the color similarity; and determining whether there is an obstacle in the parking space according to the difference coefficient.

[0007] In some embodiments of the present application, optionally, splitting the parking space image into a plurality of sub-images comprises: splitting the parking space image into a plurality of sub-images using a sliding window.

[0008] In some embodiments of the present application, optionally, the size of each dimension of the sliding window is 30% of the size of each dimension of the parking space image; and the sliding step of each dimension of the sliding window is 30% of the length size of the sliding window along the sliding direction.

[0009] In some embodiments of the present application, the texture feature is optionally generated according to a gray level co-occurrence matrix of each of the plurality of sub-images.

[0010] In some embodiments of the present application, the texture similarity of two adjacent ones of the plurality of sub-images is a Euclidean distance of the texture feature.

[0011] In some embodiments of the present application, the color feature is optionally generated according to a color histogram.

[0012] In some embodiments of the present application, the color similarity of two adjacent ones of the plurality of sub-images is a Euclidean distance of the color feature.

[0013] In some embodiments of the present application, forming the difference coefficient of the parking space image according to the statistical information of the texture similarity and the color similarity includes: determining a variance and a mean of the texture similarity and a variance and a mean of the color similarity of each adjacent sub-image of the parking space image; adding the variance of the texture similarity and the variance of the color similarity of each adjacent sub-image to obtain a fused variance; adding the mean of the texture similarity and the mean of the color similarity of each adjacent sub-image to obtain a fused mean; and determining a ratio of the fused variance to the fused mean to form the difference coefficient.

[0014] In some embodiments of the present application, judging whether there is an obstacle in the parking space according to the difference coefficient includes: if the difference coefficient is greater than or equal to a preset value, determining that there is an obstacle in the parking space; and if the difference coefficient is less than the preset value, determining that there is no obstacle in the parking space.

[0015] According to another aspect of the present application, there is provided a computer readable storage medium having instructions stored therein, wherein the instructions, when executed by a processor, cause the processor to perform any one of the methods described above. BRIEF DESCRIPTION OF DRAWINGS

[0016] The above and other objects and advantages of the present application will become more apparent by describing in detail the following embodiments thereof in connection with the accompanying drawings, in which like reference numerals refer to like elements throughout the several views.

[0017] Figure 1 A method for detecting an obstacle in a parking space according to an embodiment of the present application is shown.

[0018] Figure 2 A schematic diagram for collecting a parking space image according to an embodiment of the present application is shown.

[0019] Figure 3A method for detecting obstacles in a parking space according to an embodiment of this application is shown. Detailed Implementation

[0020] For the purposes of brevity and illustrativeness, the principles of this application are described herein primarily with reference to exemplary embodiments thereof. However, those skilled in the art will readily recognize that the same principles can be equivalently applied to all types of methods and storage media for detecting obstacles in parking spaces, and that these same or similar principles can be implemented therein, without departing from the true spirit and scope of this application.

[0021] Since real-world parking scenarios are numerous and complex, determining the presence of obstacles within a parking space based on the similarity of various sub-images within the space, using real-time captured images, is more adaptable to different real-world scenarios and is not limited to the training library scenarios in existing technologies. The detection mechanism of this invention is unaffected by the shape or state of obstacles (such as upright or fallen). Furthermore, this mechanism has low requirements for hardware computing power and image resolution.

[0022] According to one aspect of this application, a method for detecting obstacles within a parking space is provided. Figure 1 As shown, the obstacle detection method 10 in a parking space includes the following steps: In step S11, a parking space image is acquired; in step S12, the parking space image is divided into multiple sub-images; in step S13, the texture features and color features of each of the multiple sub-images are determined; in step S14, the texture similarity of adjacent sub-images with respect to texture features and the color similarity of adjacent sub-images with respect to color features are determined; in step S15, a difference coefficient of the parking space image is formed based on the statistical information of texture similarity and color similarity; in step S16, the presence of an obstacle in the parking space is determined based on the difference coefficient.

[0023] In step S11, obstacle detection method 10 acquires an image of the parking space. The acquisition of the parking space image can be achieved using image sensors deployed around the vehicle. For example, a camera mounted on the front of the vehicle can capture real-time / near-real-time images of the surrounding environment, and then the parking space image can be extracted from the environmental images in real-time / near-real-time.

[0024] In some examples, the cameras mounted on the vehicles may be ultra-wide-angle or even fisheye lenses, so the captured environmental images may have significant distortion. For example... Figure 2As shown, the left side is the original environmental image, which contains trapezoidal distortion, and in other cases, multiple distortions may be superimposed. In this case, step S11 may include preprocessing the acquired environmental image to correct distortion. Subsequently, the distortion-corrected image can be transformed from a top view to obtain a top view of the parking space. The parking space image referred to in this invention is the rectangular area inside the parking space (excluding the outer frame) obtained through parking space detection from a top-down perspective. Figure 2 The right side shows a cutout image of the parking space (excluding the surrounding frame lines), and the parking space includes the indicated obstacles.

[0025] Step S11 may also include obtaining a parking space image based on the parking space coordinates obtained by a parking space detection algorithm (e.g., corner detection), which will be used as input to the parking space obstacle detection algorithm described in detail below.

[0026] In step S12, obstacle detection method 10 divides the parking space image into multiple sub-images. In some embodiments of this application, an S-shaped sliding window can be used to divide the parking space image into multiple sub-images. The S-shaped sliding window traverses the parking space image to obtain a series of adjacent sub-images. When traversing the parking space image, the S-shaped sliding window algorithm starts from the upper left corner of the image and slides directly downwards after the horizontal traversal is completed, instead of starting from the leftmost end of the horizontal direction every time.

[0027] In some examples, to improve the performance of detection method 10, the window size and step size can be selected as needed. The size of the sliding window is selected as a percentage of the parking space image size. The size of the sliding window mainly controls the size and number of sub-images. Too few sub-images will lead to large judgment errors, while too many sub-images will affect program efficiency. The step size is selected according to the percentage of the sliding window, and the step size determines the proportion of the overlapping part between adjacent sub-images. In some embodiments of this application, the dimensions (length, width) of each dimension of the sliding window are 30% of the dimensions (length, width) of the corresponding parking space image, and the sliding step size of each dimension of the sliding window is 30% of the length dimension of the sliding window along the sliding direction.

[0028] In step S13, obstacle detection method 10 determines the texture and color features of each of the multiple sub-images. Texture and color features are two measures of an image; combining them can more objectively and comprehensively reflect the overall and detailed characteristics of the image, thus facilitating the identification of obstacles in the image.

[0029] In some embodiments of this application, texture features can be generated based on the gray-level co-occurrence matrix (GLCM) of each of multiple sub-images. The GLCM is a matrix function relating pixel distance and angle; it reflects comprehensive information about the image in terms of direction, distance, magnitude of change, and speed by calculating the correlation between the gray levels of two pixels separated by a certain distance and in a certain direction. When calculating texture features, an RGB color gamut image can be converted to a grayscale image. Using a lower quantization level can further control the complexity of the algorithm; therefore, for example, the grayscale can be quantized to 16 levels.

[0030] In some examples, after calculating the gray-level co-occurrence matrix (GLCM), texture features such as contrast, ASM energy, entropy, and correlation can be further calculated to represent the texture features. In some examples, the GLCM p can be determined by setting the distance value d to 3 and the angle value to 90 degrees. If the gray level is quantized to order 16, then the size of the GLCM is 16×16.

[0031] In some embodiments of this application, color features can be generated based on color histograms. A color histogram is a method of representing color features; it represents the distribution of colors in an image, i.e., the probability of each color appearing. In some examples, the image can be converted from the RGB color space to the HSV color space, which is more consistent with human perception of color. A color histogram can be represented by the following function expression:

[0032]

[0033] Where k is the color feature value of the image, and L is the range of possible values. For example, after converting to HSV space, L can take the value 256. N is the total number of pixels in the image. This represents the number of pixels with a feature value of k.

[0034] The obstacle detection method 10 determines the texture similarity of two adjacent images with respect to texture features and the color similarity of two adjacent images with respect to color features in step S14.

[0035] In some embodiments of this application, the texture similarity between adjacent sub-images is the Euclidean distance of texture features. When determining the texture similarity between two adjacent sub-images with respect to texture features, if the gray-level co-occurrence matrix of one sub-image is p1 and the gray-level co-occurrence matrix of another sub-image is p2, the texture similarity between the two can be obtained by calculating the Euclidean distance between matrices p1 and p2. For example, the texture similarity measure between adjacent sub-images is the standardized Euclidean distance of texture features between them, and the smaller the standardized Euclidean distance, the greater the similarity. N sub-images will yield N-1 similarity measure results.

[0036] In some embodiments of this application, the color similarity between adjacent images in multiple sub-images is represented by the Euclidean distance of their color features. Two n-dimensional vectors and The standardized Euclidean distance between them is shown in the following formula:

[0037]

[0038] in, Let H be the standard deviation of the sample set. When determining the color similarity between two adjacent sub-images regarding color features, if the color histogram of one sub-image is H1 and the color histogram of another sub-image is H2, then the color similarity between the two can be obtained by calculating the Euclidean distance between vectors H1 and H2. For example, the color similarity measure between adjacent sub-images is the standardized Euclidean distance of their color features, and the smaller the standardized Euclidean distance, the greater the similarity. N sub-images will yield N-1 similarity measure results.

[0039] In step S15, obstacle detection method 10 generates a difference coefficient for the parking space image based on statistical information of texture similarity and color similarity. The statistical information of texture similarity and color similarity refers to the mathematical statistical information of texture similarity and color similarity among adjacent sub-images in the parking space image. This information reflects the texture similarity and color similarity across the entire parking space image. The statistical information of this invention includes, but is not limited to, mean, median, variance, and standard deviation. Furthermore, the difference coefficient of the parking space image can be obtained by fusing the statistical information of texture similarity and color similarity. This fusing refers to mathematically associating the two to form a single index for measuring the presence of obstacles in the image. The fusing of this invention includes, but is not limited to, addition and weighted summation.

[0040] In some embodiments of this application, such as Figure 3 As shown, the difference coefficient can be determined through the following steps. First, in step S31, the variance and mean of texture similarity and color similarity of each adjacent sub-image in the parking space image are determined, using the variance and mean as statistical information for texture similarity and color similarity. Second, in step S32, the variance of texture similarity and the variance of color similarity of each adjacent sub-image are added together to obtain the fusion variance. Then, in step S33, the mean of texture similarity and the mean of color similarity of each adjacent sub-image are added together to obtain the fusion mean. Finally, in step S34, the ratio of the fusion variance to the fusion mean is determined to form the difference coefficient.

[0041] In step S16, obstacle detection method 10 determines whether an obstacle exists in the parking space based on a difference coefficient. In some embodiments of this application, if the difference coefficient is greater than or equal to a preset value, it is determined that an obstacle exists in the parking space; and if the difference coefficient is less than the preset value, it is determined that no obstacle exists in the parking space. If the area where the obstacle is located in the image has significant differences in image features (including texture features and color features) compared to the surrounding area, the difference between adjacent sub-images will be significantly increased, resulting in a large variance in the similarity measurement result and ultimately a large difference coefficient. For example, Figure 2 The right side of the image shows a parking space containing traffic cones, where the area exhibits significant differences in image features compared to the surrounding area. In this invention, obstacles within the parking space mainly include static obstacles such as roadblocks that differ from the parking space in texture and color, and whose size does not prevent the selection of appropriate sliding window parameters for sub-image cropping.

[0042] Furthermore, in some examples, using images to determine whether there are obstacles in the parking space can help determine whether the parking space is available for parking.

[0043] According to another aspect of this application, a computer-readable storage medium is provided, wherein instructions are stored, which, when executed by a processor, cause the processor to perform any of the parking space obstacle detection methods described above. The computer-readable medium referred to in this application includes various types of computer storage media, and can be any available medium accessible by a general-purpose or special-purpose computer. For example, the computer-readable medium may include RAM, ROM, EPROM, E... 2 PROM, registers, hard disks, removable disks, CD-ROMs or other optical disc storage, magnetic disk storage or other magnetic storage devices, or any other temporary or non-temporary medium capable of carrying or storing desired program code units in the form of instructions or data structures and accessible by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. As used herein, disks typically magnetically copy data, while discs optically copy data using lasers. Combinations of the above should also be included within the scope of computer-readable media. An exemplary storage medium is coupled to a processor so that the processor can read and write information from / to the storage medium. In an alternative, the storage medium may be integrated into the processor. The processor and storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and storage medium may reside as discrete components in the user terminal.

[0044] The mechanism of this invention is based on traditional image algorithms, enabling the detection of obstacles within parking spaces. It has low hardware requirements, effectively reducing costs. Furthermore, the mechanism requires no training library, the shape and state of obstacles do not affect the results, and the algorithm does not have high requirements for image clarity. Finally, the judgment criterion in this invention's mechanism comes solely from the difference in image features between the area containing the obstacle and the rest of the parking space.

[0045] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Those skilled in the art can conceive of other feasible variations or substitutions based on the technical scope disclosed in this application, and such variations or substitutions are all covered within the scope of protection of this application. Where there is no conflict, the embodiments and features described in the embodiments of this application can also be combined with each other. The scope of protection of this application is determined by the claims.

Claims

1. A method for detecting obstacles within a parking space, comprising: Capture parking space images; The parking space image is divided into multiple sub-images using an S-shaped sliding window. Determine the texture and color features of each of the plurality of sub-images; Determine the texture similarity and color similarity of adjacent images with respect to the texture features and the color features; The difference coefficient of the parking space image is formed based on the statistical information of the texture similarity and the color similarity; as well as The presence of an obstacle in the parking space is determined based on the difference coefficient. The texture features are generated based on the gray-level co-occurrence matrix of each of the plurality of sub-images; the texture similarity between two adjacent sub-images with respect to the texture features is the Euclidean distance of the texture features. The difference coefficient for forming the parking space image based on the statistical information of texture similarity and color similarity further includes: The variance and mean of texture similarity and the variance and mean of color similarity of each adjacent sub-image in the parking space image are determined, and the variance and mean are used as statistical information of texture similarity and color similarity. The fusion variance is obtained by adding the variance of the texture similarity of each adjacent sub-image to the variance of the color similarity; The average value of the texture similarity of each adjacent sub-image is added to the average value of the color similarity to obtain the fused average value; The difference coefficient is formed by determining the ratio of the fusion variance to the fusion mean.

2. The method according to claim 1, wherein the dimensions of each dimension of the sliding window are 30% of the dimensions of each dimension of the parking space image; and The sliding step size of each dimension of the sliding window is 30% of the length dimension of the sliding window along the sliding direction.

3. The method according to claim 1, wherein the color feature is generated based on a color histogram.

4. The method according to claim 3, wherein the color similarity between adjacent sub-images is the Euclidean distance of the color features.

5. The method according to claim 1, wherein determining whether there is an obstacle in the parking space based on the difference coefficient includes: If the difference coefficient is greater than or equal to a preset value, it is determined that there is an obstacle in the parking space; as well as If the difference coefficient is less than a preset value, it is determined that there are no obstacles in the parking space.

6. A computer-readable storage medium storing instructions, characterized in that, When the instruction is executed by the processor, it causes the processor to perform the method as described in any one of claims 1-5.