Parking space identification method, system and device and storage medium

By inverting, decomposing and synthesizing the parking space images, the problem of low accuracy in parking space recognition in complex scenarios is solved, and the accuracy and reliability of parking space recognition are improved.

CN119832745APending Publication Date: 2025-04-15HUANENG REAL ESTATE CO LTD HEBEI XIONGAN BRANCH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411996269.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the prior art, the parking space recognition method has low accuracy in complex scenarios, especially in environments where light is weak at night or contrasting brightness and darkness are strong, the image contrast is low and the edges are blurred, resulting in inaccurate parking space recognition.

Method used

By inverting and decomposing the parking space image into chromaticity, saturation and brightness images, filtering and intensity enhancement are used using the reference saturation image, and then inverting and superimposing it with the brightness image to generate a grayscale image to determine whether there are vehicles on the parking space.

Benefits of technology

It improves the contrast and brightness of parking space images in complex scenes, enhances parking space characteristics, and improves the accuracy and reliability of parking space recognition, especially under low illumination conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832745A_ABST
    Figure CN119832745A_ABST
Patent Text Reader

Abstract

The invention discloses a parking space identification method, system and device and a storage medium. The method comprises the steps that negation is carried out on a first parking space image to obtain a second parking space image, the second parking space image is decomposed to obtain a first chromaticity image, a first saturation image and a first brightness image, and the first parking space image is used for indicating a to-be-recognized parking space; performing image processing on the first saturation image by using the reference saturation image to obtain a second saturation image, and correcting the first brightness image to obtain a second brightness image; and synthesizing the second saturation image, the second brightness image and the first chromaticity image, performing negation, performing processing to obtain a first grayscale image, and determining that a vehicle exists on the to-be-identified parking space under the condition that pixel points in the first grayscale image meet a preset condition. The technical problem that a parking space identification method provided by the related technology is low in accuracy in a complex scene is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and more specifically, to a parking space recognition method, system, device and storage medium. Background Art

[0002] With the increase in the number of motor vehicles, accurate identification of parking spaces is an unavoidable issue in vehicle management. Whether it is intelligent driving methods such as automatic parking carried by the vehicle, or identification and management methods of parking spaces in scenarios such as parking lots that provide parking spaces, accurate identification of parking spaces is a prerequisite.

[0003] In the related art, the human visual characteristics can be simulated by sensors to process images with a large dynamic range and true colors. However, in the related art, the image information of the frequency component is usually considered. In scenes such as weak light at night and strong contrast between light and dark, the road image often presents low contrast and blurred edges. The frequency component can easily lead to excessive enhancement or distortion of the image, resulting in the problem of low accuracy of the parking space recognition method in the related art in complex scenes.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a parking space recognition method, system, device and storage medium to at least solve the technical problem that the parking space recognition method provided by the related art has low accuracy in complex scenarios.

[0006] According to one aspect of an embodiment of the present application, a parking space recognition method is provided, including: inverting a first parking space image to obtain a second parking space image, and decomposing the second parking space image to obtain a first chromaticity image, a first saturation image and a first brightness image, wherein the first parking space image is used to indicate a parking space to be recognized; performing image processing on the first saturation image using a reference saturation image to obtain a second saturation image, and correcting the first brightness image to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on a saturation channel; synthesizing the second saturation image, the second brightness image and the first chromaticity image and then inverting them to obtain a third parking space image, and superimposing the third parking space image and the first parking space image to obtain a fourth parking space image; processing the fourth parking space image to obtain a first grayscale image, and determining that a vehicle exists in the parking space to be recognized when a pixel point in the first grayscale image meets a preset condition.

[0007] Optionally, the above-mentioned image processing of the first saturation image using the reference saturation image to obtain the second saturation image includes: filtering the first saturation image using the reference saturation image to obtain a third saturation image; and intensity enhancing the third saturation image to obtain the second saturation image.

[0008] Optionally, the above-mentioned filtering processing of the first saturation image using the reference saturation image to obtain the third saturation image includes: performing the following operations for the i-th pixel in the first saturation image: determining the spatial Gaussian kernel according to the distance between the i-th pixel and each pixel in the first saturation image; determining the range Gaussian kernel according to the grayscale value of the i-th pixel and the grayscale value of each pixel in the first saturation image; determining the joint Gaussian kernel according to the grayscale value of the i-th pixel in the reference saturation image and the grayscale value in the reference saturation image; calculating the normalization factor of the i-th pixel according to the spatial Gaussian kernel, the range Gaussian kernel and the joint Gaussian kernel, and determining the filtered value of the i-th pixel according to the normalization factor, wherein i is an integer greater than 0; after performing the above operations on all pixels in the first saturation image, the third saturation image is obtained.

[0009] Optionally, the above-mentioned intensity enhancement of the third saturation image to obtain the second saturation image includes: determining the maximum intensity value and the minimum intensity value in the third saturation image; performing the following operation on the j-th pixel in the third saturation image, where j is an integer greater than 0: multiplying the ratio of the difference between the intensity value of the j-th pixel and the minimum intensity value to the difference between the maximum intensity value and the minimum intensity value by a preset intensity value to obtain the enhanced intensity value of the j-th pixel; and after enhancing each pixel in the third saturation image, obtaining the second saturation image.

[0010] Optionally, the above-mentioned correction of the first brightness image to obtain the second brightness image includes: obtaining a correction coefficient based on the average brightness of the first brightness image; for the kth pixel in the first brightness image, performing the following operation, where k is an integer greater than 0: obtaining an adjustment coefficient by using the correction coefficient as an exponent of the ratio of the brightness of the kth pixel to a preset brightness, and obtaining the corrected brightness of the kth pixel by multiplying the adjustment coefficient by the preset brightness; and obtaining the second brightness image after enhancing each pixel in the first brightness image.

[0011] Optionally, the above-mentioned processing of the fourth parking space image to obtain the first grayscale image includes: converting the fourth parking space image into a fifth parking space image in RGB space, and decomposing the fifth parking space image to obtain a red channel image, a green channel image and a blue channel image; calculating the first reflection component corresponding to the red channel image, the second reflection component corresponding to the green channel image, and the third reflection component corresponding to the blue channel image; synthesizing and transforming the first reflection component, the second reflection component and the third reflection component to obtain a sixth parking space image; processing the sixth parking space image to obtain the first grayscale image.

[0012] Optionally, the above calculation of the first reflection component corresponding to the red channel image, the second reflection component corresponding to the green channel image, and the third reflection component corresponding to the blue channel image includes: taking any one channel of the red channel image, the green channel image, and the blue channel image as the target channel image, and performing the following operations: convolving the target channel image with a center-surround function to obtain an illumination component; and obtaining a reflection component based on the target channel image and the illumination component.

[0013] Optionally, the above processing the sixth parking space image to obtain the first grayscale image includes: rotating the sixth parking space image to obtain an adjusted sixth parking space image; converting the adjusted sixth parking space image into a second grayscale image; and deleting white dots in the second grayscale image to obtain the first grayscale image.

[0014] According to another aspect of an embodiment of the present application, a parking space recognition device is further provided, including: a channel decomposition unit, used to invert a first parking space image to obtain a second parking space image, and decompose the second parking space image to obtain a first chromaticity image, a first saturation image and a first brightness image, wherein the first parking space image is used to indicate a parking space to be recognized; a channel processing unit, used to perform image processing on the first saturation image using a reference saturation image to obtain a second saturation image, and correct the first brightness image to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on the saturation channel; an image superposition unit, used to synthesize the second saturation image, the second brightness image and the first chromaticity image and then invert them to obtain a third parking space image, and superimpose the third parking space image and the first parking space image to obtain a fourth parking space image; a parking space recognition unit, used to process the fourth parking space image to obtain a first grayscale image, and determine that a vehicle exists in the parking space to be recognized when the pixel points in the first grayscale image meet preset conditions.

[0015] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned parking space recognition method when running.

[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer instruction being stored in a computer-readable storage medium. A processor of a computer device reads the computer program / instruction from the computer-readable storage medium, and the processor executes the computer program / instruction, so that the computer device performs the above parking space recognition method.

[0017] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the above-mentioned parking space recognition method is executed when the processor executes the computer program.

[0018] In an embodiment of the present application, the first parking space image is inverted to obtain a second parking space image, and the second parking space image is decomposed to obtain a first chromaticity image, a first saturation image and a first brightness image, wherein the first parking space image is used to indicate the parking space to be identified; the first saturation image is image processed using a reference saturation image to obtain a second saturation image, and the first brightness image is corrected to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on the saturation channel; the second saturation image, the second brightness image and the first chromaticity image are synthesized and inverted to obtain a third parking space image, and the third parking space image and the first parking space image are superimposed to obtain a fourth parking space image; the fourth parking space image is processed to obtain a first grayscale image, and when the pixel points in the first grayscale image meet the preset conditions, it is determined that there is a vehicle in the parking space to be identified. The parking space image can be decomposed, and the saturation channel and brightness channel obtained by the decomposition can be processed to enhance the contrast and brightness of the parking space image, thereby improving the quality of the low-light image. The parking space image in complex scenes can be processed, thus solving the technical problem that the parking space recognition method provided by the related technology has low accuracy in complex scenes. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a schematic diagram of a hardware environment of an optional parking space recognition method according to an embodiment of the present application;

[0021] Figure 2 is a flow chart of an optional parking space identification method according to an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of an optional parking space recognition method according to an embodiment of the present application;

[0023] Figure 4 is a schematic diagram of an optional parking space recognition device according to an embodiment of the present application;

[0024] Figure 5 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] According to one aspect of an embodiment of the present application, a parking space recognition method is provided. As an optional implementation, the parking space recognition method can be but is not limited to being applied to Figure 1 The parking space recognition system in the hardware environment shown. The parking space recognition system may include but is not limited to a terminal device 102, a network 110, a server 112, and a database 114. The terminal device 102 runs a target client (such as Figure 1 As shown, the target client is a client for managing parking spaces as an example). The terminal device 102 includes a display 108, a processor 106 and a memory 104. The display 108 can be used to display the occupancy status of the parking space and the overall data of the parking space, and is also used to provide a human-computer interaction interface to receive human-computer interaction operations of touching different controls. The processor is used to generate an interaction instruction in response to the human-computer interaction operation, and send the interaction instruction to the server to obtain a reference parking space image. The memory is used to store the first parking space image.

[0028] In addition, the server 112 includes a processing engine 116, and the processing engine 116 is used to perform a storage or reading operation on the database 114. Specifically, the processing engine 116 reads the reference parking space image from the database 114.

[0029] Assumptions Figure 1 The terminal device 102 in the embodiment runs a client for managing the parking space status. The specific process of this embodiment is as follows: In step S102, a first parking space image can be collected in the terminal device, and the first parking space image is processed and decomposed in the HSV space to obtain a chromaticity image, a saturation image and a brightness image. Then, step S104 is executed: a reference parking space image is obtained in the server 112 through the network 110. Then, steps S106-S108 are executed: the saturation image and the brightness image are processed according to the reference parking space image, and resynthesized to obtain a new parking space image; the new parking space image is processed to obtain a grayscale image, and parking space recognition is performed.

[0030] Optionally, in this embodiment, the terminal device 102 may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client may be a vehicle client, a visual monitoring client, or other client that supports providing parking space identification tasks. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network, and a wide area network, and the wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and this embodiment does not impose any limitation on this.

[0031] Optionally, in this embodiment, the parking space recognition method can be applied to, but not limited to, a parking space management system, and multiple parking spaces in a parking lot can be monitored, and the parking space occupancy status of multiple parking spaces in the parking lot can be collected in real time, and the first parking space image can be processed according to the reference parking space images of the same parking space at different times to obtain an image with enhanced saturation and brightness. The enhanced image is gray-scaled, and then the presence of a vehicle in the parking space is identified to obtain a vehicle recognition result, so as to manage multiple parking spaces in the entire parking lot as a whole, and the overall indicators such as the occupancy rate of the parking space can be seen, and the number of available parking spaces can be displayed on the display.

[0032] Optionally, in this embodiment, the parking space recognition method can be applied to, but not limited to, intelligent driving vehicles. When the intelligent vehicle performs operations such as intelligent parking, it can automatically recognize image data around the vehicle through multiple sensors to obtain a two-dimensional parking space image such as a bird's-eye view. The acquired parking space image is processed according to the reference parking space image to obtain an image with enhanced saturation and brightness, and the enhanced image is used to recognize the parking space. To determine whether to automatically park the parking space, the accuracy of intelligent parking is improved.

[0033] The above usage scenarios are only examples, and any scenario related to parking space recognition can utilize the solution of the present application. This embodiment does not impose any limitation on this.

[0034] In an embodiment of the present application, the first parking space image is inverted to obtain a second parking space image, and the second parking space image is decomposed to obtain a first chromaticity image, a first saturation image and a first brightness image, wherein the first parking space image is used to indicate the parking space to be identified; the first saturation image is image processed using a reference saturation image to obtain a second saturation image, and the first brightness image is corrected to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on the saturation channel; the second saturation image, the second brightness image and the first chromaticity image are synthesized and inverted to obtain a third parking space image, and the third parking space image and the first parking space image are superimposed to obtain a fourth parking space image; the fourth parking space image is processed to obtain a first grayscale image, and when the pixel points in the first grayscale image meet the preset conditions, it is determined that there is a vehicle in the parking space to be identified. The parking space image can be decomposed, and the saturation channel and brightness channel obtained by the decomposition can be processed to enhance the contrast and brightness of the parking space image, thereby improving the quality of the low-light image. The parking space image in complex scenes can be processed, thus solving the technical problem that the parking space recognition method provided by the related technology has low accuracy in complex scenes.

[0035] As an optional implementation, Figure 2 As shown, the above parking space recognition method includes the following steps:

[0036] S202, inverting the first parking space image to obtain a second parking space image, and decomposing the second parking space image to obtain a first chromaticity image, a first saturation image, and a first brightness image, wherein the first parking space image is used to indicate a parking space to be identified;

[0037] It should be noted that the first parking space image refers to the original parking space image, that is, the image data directly obtained from the parking space image acquisition device without any processing. It contains the initial information of the parking space and its surrounding environment and is the starting point of the parking space recognition process.

[0038] In an optional embodiment, in image processing, the negation operation refers to reducing the value of each pixel in the image from the maximum value to the minimum value. For example, in a grayscale image, the pixel value is usually between 0 and 255, and the negation operation will change the value of each pixel to 255 minus its original value. For RGB images, the value of each color channel (red, green, and blue) will be processed in the same way. If the first parking space image is A(x, y), then the first parking space image is negated, and A'=255-A is set to obtain the second parking space image A'.

[0039] It should be noted that, compared with the first parking space image, the pixel values ​​of the second parking space image are completely opposite, in order to enhance the image contrast and make the parking space features more prominent.

[0040] It should be noted that the HSV color model in the HSV color space is a color model that represents color in three dimensions: hue, saturation, and value. This representation method is closer to the human eye's perception of color, making the processing of color and brightness more intuitive and effective. The first chromaticity image is a chromaticity (Hue) channel image obtained by decomposing the second parking space image in the HSV color space, which reflects the basic hue of the color in the image. The first saturation image is a saturation (Saturation) channel image obtained by decomposing the second parking space image in the HSV color space, which reflects the intensity or purity of the image color. The first brightness image is a brightness (Value) channel image obtained by decomposing the second parking space image in the HSV color space, which reflects the brightness information of the image.

[0041] In an optional embodiment, the original parking space image (first parking space image) is subjected to an inversion operation to generate a second parking space image, the purpose of which is to enhance the image contrast and make the parking space features more prominent in the image. Secondly, the second parking space image is further processed, converted into the HSV color space, and decomposed into three independent images: a chromaticity image (first chromaticity image), a saturation image (first saturation image), and a brightness image (first brightness image). This decomposition allows the color and brightness information in the image to be optimized independently, thereby providing a better basis for subsequent image processing and parking space recognition.

[0042] In an optional embodiment, suppose there is a first parking space image taken at night. Due to insufficient light, the contrast between the parking space and the surrounding environment is low, and it becomes difficult to directly identify the parking space. In order to optimize the image, the following operations are performed: Negation operation: Use the image inversion device ImageInversion (such as using the cv2.bitwise_not() function in the OpenCV library) to invert the pixel values ​​of the first parking space image to generate a second parking space image. In this way, the originally darker parking space area now becomes brighter, and the brighter surrounding environment becomes darker, thereby enhancing the contrast between the parking space and the environment. Conversion and decomposition: The second parking space image is converted from the RGB color space to the HSV color space, and the cv2.cvtColor() function can be used. Then use the cv2.split() function to decompose the HSV image into three independent channels: H (hue), S (saturation), and V (brightness). This will generate a first chromaticity image H(x, y), a first saturation image S(x, y), and a first brightness image V(x, y), respectively.

[0043] S204, performing image processing on the first saturation image using the reference saturation image to obtain a second saturation image, and correcting the first brightness image to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on the saturation channel;

[0044] It should be noted that the reference saturation image is a saturation image in a standard or ideal state, which is used to guide and optimize the processing of the first saturation image. It is derived from a reference parking space image and is decomposed on the saturation channel to provide a benchmark or target for saturation processing. The reference parking space image can be a parking space image of the same parking space at different times, such as in an environment with normal lighting. The second saturation image is the result of optimizing the first saturation image after image processing guided by the reference saturation image, that is, the second saturation image. Second brightness image: This is an optimized brightness image obtained after correcting the first brightness image. This correction can better adapt to various lighting conditions and improve the overall brightness and contrast of the image.

[0045] In an optional embodiment, the first saturation image is processed using the reference saturation image as a guide, with the goal of making the color intensity of the first saturation image reach or approach the level of the reference image, thereby improving the clarity of the color features of the parking space in the image. Secondly, the first brightness image is corrected to optimize the brightness distribution, making the overall brightness of the image more uniform, and maintaining good visibility and contrast even in scenes with poor lighting conditions, thereby generating a second brightness image.

[0046] In an optional embodiment, it is assumed that there is a first parking space image (i.e., the original image of the second parking space image) taken at dusk. At this time, the lighting conditions are unstable, the saturation and brightness in the image are uneven, and the parking space features are not clear enough. In order to optimize the image, the following operations are performed: first, a reference parking space image taken under good lighting conditions is prepared, converted to the HSV color space and decomposed to obtain a reference saturation image. Then, the first saturation image (i.e., the saturation image decomposed from the second parking space image) is used as input and processed by a joint bilateral filtering mechanism. The filtering mechanism will use the reference saturation image as a guide to adjust the pixel values ​​in the first saturation image so that its color intensity is closer to the level of the reference image. The processed first saturation image becomes the second saturation image, which is visually clearer and the color features of the parking space are more prominent. Continue to use the first brightness image in the second parking space image as input, and through adaptive Gamma correction, the brightness of the first brightness image is optimized to generate a second brightness image, which is visually brighter and has better contrast, which helps to identify parking spaces under complex lighting conditions.

[0047] S206, synthesizing the second saturation image, the second brightness image, and the first chromaticity image, and then inverting them to obtain a third parking space image, and superimposing the third parking space image and the first parking space image to obtain a fourth parking space image;

[0048] It should be noted that the third parking space image is obtained by synthesizing the second saturation image, the second brightness image and the first chromaticity image in the HSV color space and then performing a negation operation again. The image has been enhanced in contrast and color to adapt to more complex recognition scenarios. The fourth parking space image is obtained by superimposing the third parking space image and the first parking space image (i.e., the original parking space image). The superposition operation usually involves weighted mixing to retain or enhance key features in the image, thereby generating an image that is more suitable for subsequent parking space recognition.

[0049] In an optional embodiment, the optimized second saturation image and the second brightness image are synthesized with the first chromaticity image (i.e., the chromaticity image decomposed from the second parking space image) to generate an image enhanced in both color and brightness, i.e., the third parking space image. In order to further improve the image contrast, the third parking space image is negated again to make the parking space features in the image more prominent. Secondly, the negated third parking space image is superimposed with the original first parking space image, and the key features in the image are retained and enhanced through weighted fusion to generate the final fourth parking space image. After a series of enhancement and optimization processes, this image is more suitable for parking space recognition, even in complex or low-light scenes.

[0050] In an optional embodiment, it is assumed that a first parking space image taken in an underground parking lot is processed. Due to uneven lighting conditions, the contrast and brightness of the image need to be improved. After processing in steps S202 and S204, a second saturation image, a second brightness image, and a first chromaticity image are obtained. Next, the following operations are performed: the optimized second saturation image, the second brightness image and the first chromaticity image are synthesized, and the three image channels are synthesized into an image in an HSV color space using the cv2.merge() function in the OpenCV library. Then, the above-mentioned image inverter is used again to perform an inversion operation on the synthesized image to generate a third parking space image. The inversion operation further enhances the contrast of the image and makes the parking space feature more prominent in the image. The third parking space image is superimposed with the original first parking space image (i.e., the unprocessed parking space image) and an image weighted processing mechanism (ImageAddWeightMechanism) is used. The specific operation is to use the cv2.addWeighted() function in the OpenCV library to perform weighted fusion of the two images. Here, the weights α, β and offset γ can be adjusted according to actual needs to achieve the best image fusion effect. After the overlay processing, the fourth parking space image obtained retains the original image information while integrating the optimized image features, making it visually clearer, and the contrast and brightness of the parking space are improved.

[0051] In an optional implementation, the third parking space image and the first parking space image are superimposed to obtain a fourth parking space image. The third parking space image can be read by the imread function in the OpenCV library and recorded as I1(x, y). The first parking space image can be read by the imread function in the OpenCV library and recorded as I2(x, y). Then, the addWeighted function in the OpenCV library is used to perform weighted fusion on I1(x, y) and I2(x, y): out = addWeighted(I2(x, y)*α+I2(x, y)*β+γ). α and β represent the weights of the two original images in the mixing process. The values ​​of the two are not limited to 1. The data type is double. After the two original images are mixed, if there is a requirement for the brightness of the image, the overall brightness of the image can be adjusted by adjusting the value of γ. If the value is positive, the brightness is increased, and if the value is negative, the brightness is reduced. The data type is double.

[0052] S208, processing the fourth parking space image to obtain a first grayscale image, and determining that there is a vehicle in the parking space to be identified when pixels in the first grayscale image meet a preset condition.

[0053] It should be noted that the first grayscale image is a grayscale image converted from the fourth parking space image. Converting a color image into a black-and-white image can simplify the image processing process and make it easier for the vehicle detection algorithm to identify the vehicle in the parking space.

[0054] In an optional embodiment, the fourth parking space image is converted into a first grayscale image through grayscale conversion. The grayscale image can focus more on brightness information and remove color interference. This step helps to simplify subsequent image analysis and feature recognition. Then, by analyzing the pixels in the first grayscale image, if the brightness and distribution pattern of these pixels meet the preset vehicle existence conditions (for example, continuous high-brightness areas, specific shapes or sizes, etc.), it can be determined that there is a vehicle in the parking space to be identified. This grayscale image-based vehicle detection method is generally more efficient and more suitable for parking space recognition tasks under various lighting conditions.

[0055] In an optional embodiment, it is assumed that a fourth parking space image of an underground parking lot optimized by steps S202 to S206 is processed, and the contrast and color of the parking spaces in the image are enhanced, and now vehicle detection is required. First, the cv2.cvtColor() function in the OpenCV library is used to convert the fourth parking space image from the RGB color space to a grayscale image to generate a first grayscale image. The grayscale image only contains brightness information, which removes the interference of color, making the vehicle detection process simpler and more efficient. Next, the pixels in the first grayscale image are analyzed to check whether there are continuous high-brightness areas, and the brightness and distribution patterns of these areas may match the parked vehicles. In the specific operation, a threshold can be set, such as using the cv2.threshold() or cv2.adaptiveThreshold() function in the OpenCV library to convert the first grayscale image into a binary image, in which the pixel values ​​of the high-brightness areas are set to 255, and the pixel values ​​of other areas are set to 0, so as to highlight the potential vehicle areas. Then, by analyzing the shapes and sizes of these high-brightness areas, if they meet the preset vehicle characteristics (such as aspect ratio, area range, etc.), it can be determined that there is a vehicle in the parking space to be identified.

[0056] For example, the preset vehicle detection conditions may include: the area of ​​the continuous high brightness region is greater than a certain threshold and has a certain aspect ratio, because a parked vehicle usually occupies most of the area of ​​a parking space and has a specific shape. If a high brightness region that meets these conditions is detected in the first grayscale image, it can be considered that a vehicle is parked in the parking space.

[0057] For example, the countNonZero method in the OpenCV library is used to count the pixel data whose grayscale is not 0 in the first grayscale image. If the number of non-zero grayscale values ​​is greater than 1800, there is a car in the parking space; otherwise, there is no car in the parking space and it is an empty parking space.

[0058] In an embodiment of the present application, the first parking space image is inverted to obtain a second parking space image, and the second parking space image is decomposed to obtain a first chromaticity image, a first saturation image and a first brightness image, wherein the first parking space image is used to indicate the parking space to be identified; the first saturation image is image processed using a reference saturation image to obtain a second saturation image, and the first brightness image is corrected to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on the saturation channel; the second saturation image, the second brightness image and the first chromaticity image are synthesized and inverted to obtain a third parking space image, and the third parking space image and the first parking space image are superimposed to obtain a fourth parking space image; the fourth parking space image is processed to obtain a first grayscale image, and when the pixel points in the first grayscale image meet the preset conditions, it is determined that there is a vehicle in the parking space to be identified. The parking space image can be decomposed, and the saturation channel and brightness channel obtained by the decomposition can be processed to enhance the contrast and brightness of the parking space image, thereby improving the quality of the low-light image. The parking space image in complex scenes can be processed, thus solving the technical problem that the parking space recognition method provided by the related technology has low accuracy in complex scenes.

[0059] In an optional embodiment, the above-mentioned image processing of the first saturation image using the reference saturation image to obtain the second saturation image includes: filtering the first saturation image using the reference saturation image to obtain a third saturation image; and intensity enhancing the third saturation image to obtain the second saturation image.

[0060] It should be noted that the third saturation image is an intermediate image obtained by filtering the first saturation image using the reference saturation image. It removes noise and smoothes image edges while retaining or enhancing the saturation information in the parking space image. The second saturation image is the final image obtained after the third saturation image is enhanced in intensity. Compared with the first saturation image, the color intensity of the second saturation image is improved, and the color features of the parking space are more prominent.

[0061] In an optional embodiment, the first saturation image is filtered using the reference saturation image as a guide to remove noise in the image, smooth the image edges, and maintain or enhance the color contrast in the image, thereby obtaining a third saturation image. Filtering is an important part of image enhancement and can significantly improve image quality. Then, the third saturation image is subjected to intensity enhancement in order to further enhance the color intensity in the image and make the color features of the parking space more obvious, thereby obtaining a second saturation image, which provides better image conditions for subsequent image analysis and parking space recognition.

[0062] Filtering and intensity enhancement are two important aspects of image enhancement, and they are often used in combination to optimize image quality. Filtering helps remove noise and irregular edges in the image, providing a clearer basis for subsequent processing. Intensity enhancement further enhances the color intensity and contrast in the image, making key features more prominent. This processing flow is particularly important in complex scenes, such as dusk, nighttime, or environments with unstable lighting conditions. It can significantly improve image quality and the accuracy of parking space recognition. The specific filtering process and intensity enhancement process will be explained later and will not be repeated here.

[0063] Through the above implementation of the present application, the third saturation image generated by the above filtering process and the second saturation image generated by the subsequent intensity enhancement, the color features in the parking space image are optimized, the noise is effectively suppressed, the contrast and color intensity are improved, and high-quality image data is provided for parking space recognition in complex scenes. This processing method not only improves the visual effect of the image, but also enhances the performance of the image recognition algorithm, especially in environments with poor lighting conditions, and can significantly improve the accuracy and reliability of parking space detection.

[0064] In an optional embodiment, the above-mentioned filtering processing of the first saturation image using the reference saturation image to obtain the third saturation image includes: performing the following operations for the ith pixel in the first saturation image: determining the spatial Gaussian kernel according to the distance between the ith pixel and each pixel in the first saturation image; determining the range Gaussian kernel according to the grayscale value of the ith pixel and the grayscale value of each pixel in the first saturation image; determining the joint Gaussian kernel according to the grayscale value of the ith pixel in the reference saturation image and the grayscale value in the reference saturation image; calculating the normalization factor of the ith pixel according to the spatial Gaussian kernel, the range Gaussian kernel and the joint Gaussian kernel, and determining the filtered value of the ith pixel according to the normalization factor, wherein i is an integer greater than 0; after performing the above operations on all pixels in the first saturation image, a third saturation image is obtained.

[0065] It should be noted that the spatial Gaussian kernel is a matrix used in image filtering to represent the degree of correlation between a pixel and its neighboring pixels in spatial position. It assigns weights according to the distance between pixels. The closer the distance, the higher the weight of the pixel, which helps to preserve the local details of the image.

[0066] Range Gaussian kernel: In filtering, a matrix used to represent the similarity between a pixel value and its neighboring pixel values ​​in grayscale or color intensity. It assigns weights based on the difference in pixel grayscale values, with pixels with high similarity having higher weights, which helps suppress noise and maintain image contrast.

[0067] Joint Gaussian Kernel: It combines the characteristics of the spatial Gaussian kernel and the range Gaussian kernel, and considers the similarity of the spatial position and grayscale value of the pixels in the image. It also combines the information of the reference saturation image to guide the filtering process, ensuring that the filtered image not only removes noise but also retains the key features of the parking space image.

[0068] Normalization factor: In image filtering, it is used to ensure that the output value of the filtering operation is within a reasonable range to avoid oversaturation or undersaturation. The normalization factor is usually the sum of the weights of the neighboring pixels, ensuring that the pixel value after filtering is a weighted average based on the neighboring pixels.

[0069] In an optional implementation, for each pixel (taking the i-th pixel as an example), a spatial Gaussian kernel can be determined based on its position, a range Gaussian kernel can be determined based on its grayscale value, and then a joint Gaussian kernel can be determined in combination with a reference saturation image. These Gaussian kernels provide a distribution of pixel weights for the filtering process. Next, the normalization factor of each pixel is calculated based on these three Gaussian kernels to ensure that the filtering operation does not cause the pixel value to exceed a reasonable range. Finally, the normalization factor and the Gaussian kernel are used to determine the filtered value of each pixel, complete the filtering process of the first saturation image, and generate a third saturation image. This process processes all pixels of the image to ensure the optimization of the overall image quality.

[0070] In an optional embodiment, it is assumed that a first saturation image of a parking space image taken at night is processed. Due to insufficient lighting, the contrast and saturation of the image are not high, and the parking space cannot be clearly identified. A parking space image taken under good lighting conditions can be selected as a reference saturation image, which has clear contrast and saturation and is used as a guide for filtering. For each pixel in the first saturation image (set as the i-th pixel), firstly, a spatial Gaussian kernel is determined according to the distance between the pixel and other pixels in the image to retain the local details of the image; then, a range Gaussian kernel is determined according to the gray value of the i-th pixel and the gray values ​​of other pixels in the image to maintain the contrast of the image; finally, a joint Gaussian kernel is determined according to the gray value of the i-th pixel in the reference saturation image and the gray value of the entire reference image to guide the filtering process, ensuring that the filtered image not only removes noise but also retains the key features of the parking space image.

[0071] According to the three Gaussian kernels determined above, the normalization factor of the i-th pixel is calculated. The normalization factor is a key parameter used to ensure that the value of each pixel after filtering does not exceed a reasonable range. After the normalization factor is calculated, it is used with the joint Gaussian kernel to determine the value of the i-th pixel after filtering. This process ensures that the filtered image effectively removes noise while retaining saturation information, maintaining image clarity and contrast.

[0072] After completing the above operations on all pixels in the first saturation image, a third saturation image can be obtained. Compared with the first saturation image, the noise of the third saturation image is effectively suppressed, the saturation and contrast are optimized, and the parking space features are more obvious, providing better image conditions for subsequent parking space recognition and vehicle detection.

[0073] In an alternative embodiment, the spatial Gaussian kernel where p and q can be the indices of the pixels, σ s is the standard deviation of the spatial Gaussian kernel. s yes Among them, I p and I q Represent the grayscale values ​​of pixels p and q respectively, σ r is the standard deviation of the range Gaussian kernel. Joint Gaussian kernel Among them, p and q are the grayscale values ​​of the reference saturation image, σ j is the standard deviation of the range Gaussian kernel. The weight of the pixels in the neighborhood can be calculated by the following formula: P =∑ q∈S G s (p,q)G r (I p ,I q )G j(J p ,J q ), for the filtered value, it can be calculated according to get.

[0074] By using a reference saturation image to guide the filtering process, it is ensured that the filtered image is not only visually clearer, but also has optimized contrast and color intensity, which is essential for parking space recognition under complex lighting conditions. The calculation of the normalization factor is key to ensuring the stability of the filtering operation, which avoids extreme changes in pixel values ​​and provides a smoother and more natural image processing result.

[0075] Through the above-mentioned implementation of the present application, the information of the reference saturation image is effectively utilized, the first saturation image is subjected to detailed noise removal and feature enhancement, and the generated third saturation image has significant improvements in visual effects and image quality. This processing method is particularly suitable for scenes with poor lighting conditions, such as at night or in indoor parking lots, and can significantly improve the accuracy and reliability of parking space identification. Through the above-mentioned embodiments, it can be seen that even at night or under low light conditions, through filtering processing, the contrast and saturation of the parking space image can be significantly improved, making the parking space features clearer, which is helpful for subsequent parking space identification and management.

[0076] In an optional embodiment, the above-mentioned intensity enhancement of the third saturation image to obtain the second saturation image includes: determining the maximum intensity value and the minimum intensity value in the third saturation image; performing the following operation on the j-th pixel in the third saturation image, where j is an integer greater than 0: multiplying the ratio of the difference between the intensity value of the j-th pixel and the minimum intensity value to the difference between the maximum intensity value and the minimum intensity value by a preset intensity value to obtain the enhanced intensity value of the j-th pixel; and after enhancing each pixel in the third saturation image, obtaining the second saturation image.

[0077] It should be noted that the maximum intensity value is the highest point of the pixel intensity value in the third saturation image, that is, the intensity value of the brightest or most saturated pixel in the image. In image processing, the maximum intensity value is generally used to determine the upper limit of image enhancement. The minimum intensity value is the lowest point of the pixel intensity value in the third saturation image, that is, the intensity value of the darkest or least saturated pixel in the image. In image processing, the minimum intensity value is generally used to determine the lower limit of image enhancement. The preset intensity value is used to adjust the parameters of the pixel enhancement degree in the intensity enhancement operation. The preset intensity value can be a fixed value, or it can be dynamically adjusted according to different scenarios and needs to control the amplitude of image enhancement to ensure that the image will not be oversaturated or distorted after enhancement.

[0078] In an optional embodiment, the maximum intensity value and the minimum intensity value in the third saturation image can be determined, which is the basis for intensity enhancement and is used to determine the extended range of the intensity value. Next, for each pixel in the image (taking the jth pixel as an example), the enhancement coefficient of the pixel can be calculated based on the difference between its intensity value and the minimum intensity value, and the ratio between the maximum and minimum intensity values. The enhancement coefficient reflects the relative intensity of the pixel in the original image and is used to adjust its degree of enhancement. Then, this enhancement coefficient can be multiplied by the preset intensity value to obtain the enhanced intensity value of the jth pixel. This process ensures that each pixel in the image is appropriately enhanced in intensity, avoiding oversaturation or distortion during the enhancement process. Finally, after performing the above-mentioned enhancement operation on all pixels in the third saturation image, a second saturation image is generated, which is visually clearer and has a higher contrast, and the color features of the parking space are more prominent, providing favorable conditions for subsequent image analysis and parking space recognition.

[0079] In an optional embodiment, assuming that a third saturation image of an underground parking lot is processed, the saturation distribution in the image is uneven, and the parking space features are not prominent enough. The maximum intensity value and the minimum intensity value in the third saturation image can be determined. Assuming that the maximum intensity value is I max , the minimum intensity value is I min For each pixel in the third saturation image (set as the jth pixel), the enhancement coefficient can be calculated according to the difference between its intensity value and the minimum intensity value, and the ratio between the difference between the maximum and minimum intensity values. Then, the enhancement coefficient can be multiplied by the preset intensity value to obtain the enhanced intensity value of the jth pixel.

[0080] The formula is as follows:

[0081]

[0082] Among them, MAX can be 255 and MIN can be 0.

[0083] After completing the enhancement operation on all pixels in the third saturation image, a second saturation image can be obtained, which is visually clearer, has improved color saturation, and has more prominent parking space features. Assuming that the color saturation of the parking space in the original image is between 100 and 150, it may be adjusted to between 150 and 225 after enhancement, which not only improves the saturation, but also increases the contrast of the image, making the parking space easier to identify.

[0084] The intensity enhancement step is an important step in image processing. It improves the overall contrast and clarity of the image by adjusting the intensity value of the pixels in the image, which helps to identify the key features in the image. In the present invention, by calculating the enhancement coefficient of the pixel point and combining it with the preset intensity value for enhancement, the accuracy of parking space recognition can be significantly improved while maintaining the naturalness and realism of the image.

[0085] Through the above-mentioned implementation mode of the present application, by performing intensity enhancement on each pixel point in the third saturation image, a second saturation image can be obtained, which is visually clearer and has improved color saturation, which is helpful for identifying parking spaces in complex scenes. This multiplication enhancement method based on pixel intensity value and preset intensity value can ensure the uniformity and appropriateness of image enhancement, avoid oversaturation or distortion during the enhancement process, and provide a high-quality image foundation for subsequent parking space identification and management. Through the above-mentioned embodiments, it can be seen that even in underground parking lots with unsatisfactory lighting conditions, the saturation and contrast of parking space images can be significantly improved through intensity enhancement processing, making the parking space features clearer, which is helpful for subsequent parking space identification and vehicle detection.

[0086] In an optional embodiment, the above-mentioned correction of the first brightness image to obtain the second brightness image includes: obtaining a correction coefficient based on the average brightness of the first brightness image; for the kth pixel in the first brightness image, performing the following operation, where k is an integer greater than 0: obtaining an adjustment coefficient by using the correction coefficient as an exponent of the ratio of the brightness of the kth pixel to a preset brightness, and obtaining the corrected brightness of the kth pixel by multiplying the adjustment coefficient by the preset brightness; and obtaining the second brightness image after enhancing each pixel in the first brightness image.

[0087] It should be noted that the average brightness is the average brightness value of all pixels in the first brightness image, which reflects the overall illumination intensity of the image and is a key parameter in the adaptive gamma correction algorithm. The correction coefficient is a value calculated based on the average brightness of the image in the adaptive gamma correction algorithm, which is used to adjust the gamma value of the image, thereby controlling the degree of brightness correction of the image and ensuring that the image can be correctly enhanced under different lighting conditions. The preset brightness is a pre-set brightness value used to guide the brightness correction of the image. By comparing with the brightness value of the pixel, the preset brightness helps determine the adjustment coefficient, and then adjusts the brightness of the image so that the image can maintain a good brightness effect under any lighting condition. The adjustment coefficient is calculated based on the ratio of the brightness value of the pixel and the preset brightness in the adaptive gamma correction algorithm, and is used to adjust the brightness of each pixel in the image to ensure that the image will not be too bright or too dark after enhancement.

[0088] In an optional embodiment, the average brightness of the first brightness image can be calculated, and the correction coefficient can be determined based on this value, which lays the foundation for the subsequent brightness correction. Next, for each pixel in the image (taking the kth pixel as an example), the adjustment coefficient can be calculated based on the ratio between the brightness value of the pixel and the preset brightness value, and with the correction coefficient as an index. The adjustment coefficient reflects the specific adjustment degree of the brightness value of the pixel after enhancement. It is multiplied by the preset brightness value to obtain the corrected brightness value of the kth pixel. This process ensures that each pixel in the image is personalized according to its brightness value and the overall lighting conditions. Correction, avoid the overall image is too bright or too dark, and ensure the visual effect and recognition performance of the image under different lighting conditions. Finally, after the above brightness correction is performed on all pixels in the first brightness image, a second brightness image is generated, which is visually clearer, the brightness distribution is more uniform, and the brightness characteristics of the parking space are more prominent, which provides favorable conditions for subsequent image analysis and parking space recognition.

[0089] In an optional implementation, assume that a first brightness image V(x, y) taken in an indoor parking lot is processed. Due to the instability of indoor lighting conditions, the brightness distribution of the image is uneven, and the brightness characteristics of the parking space are not prominent enough. Input V(x, y), use the imread function in the OpenCV library to read the image V(x, y) and record it as I(x, y). Use the mean function to process I(x, y) to obtain the average brightness V of the image mean The correction factor is:

[0090]

[0091] Then the corrected second brightness image is calculated as:

[0092]

[0093] Through the above-mentioned implementation mode of the present application, adaptive gamma correction is performed on each pixel in the first brightness image, and a second brightness image with more uniform brightness distribution and more prominent parking space features can be obtained. This adaptive correction method based on the average brightness of the image and the preset brightness not only improves the overall brightness and contrast of the image, but also avoids the problem of over-brightness or over-darkness that may occur in the image enhancement process, and provides a clearer and easier to analyze image condition for subsequent parking space recognition. Through the examples, it can be seen that the adaptive gamma correction algorithm can significantly improve the brightness distribution of the image in complex scenes such as indoor parking lots, making the parking space features more obvious, and helping to improve the accuracy and robustness of parking space recognition. In application, this algorithm can ensure that the parking space image can maintain good brightness and contrast whether it is daytime or nighttime, whether indoors or outdoors, and provide reliable data support for the intelligent parking system.

[0094] In an optional embodiment, the above-mentioned processing of the fourth parking space image to obtain the first grayscale image includes: converting the fourth parking space image into a fifth parking space image in RGB space, and decomposing the fifth parking space image to obtain a red channel image, a green channel image and a blue channel image; calculating the first reflection component corresponding to the red channel image, the second reflection component corresponding to the green channel image and the third reflection component corresponding to the blue channel image; synthesizing and transforming the first reflection component, the second reflection component and the third reflection component to obtain a sixth parking space image; processing the sixth parking space image to obtain the first grayscale image.

[0095] It should be noted that the first reflection component, the second reflection component and the third reflection component are reflection components respectively calculated from the red, green and blue channel images of the fifth parking space image by the Retinex algorithm, and they reflect the inherent color characteristics of each pixel in the image after removing the influence of illumination. The sixth parking space image is an image obtained by synthesizing the first reflection component, the second reflection component and the third reflection component and performing corresponding transformations. It integrates the reflection information in the three color channels and provides an enhanced image version for subsequent processing. The first grayscale image is an image obtained by grayscale conversion processing of the sixth parking space image. The grayscale image only retains the brightness information and removes the color information, and is suitable for subsequent image analysis and feature recognition, especially when processing complex scenes with large illumination changes.

[0096] In an optional embodiment, the fourth parking space image is converted to the RGB space to form the fifth parking space image, which is then decomposed into three color channel images, namely, red, green and blue channel images. Next, the Retinex algorithm is used to calculate the first reflection component, the second reflection component and the third reflection component of the three channel images respectively, thereby removing the influence of illumination and making the inherent color characteristics of the image more obvious. Next, the three reflection components are synthesized and subjected to necessary transformation processing to generate the sixth parking space image, which is visually clearer and has higher color contrast, which is helpful for subsequent image analysis. Finally, the sixth parking space image is converted into the first grayscale image, removing the color information and retaining only the brightness information, providing a simpler and more direct image condition for parking space recognition.

[0097] In an optional implementation, the fourth parking space image I" (x, y) is converted into the fifth parking space image B (x, y) in the RGB space, which may be converted using the following formula:

[0098]

[0099] in p=v×(1-s), q=v×(1-f×s), t=v×(1-(1-f)×s), h=img_hsv[:,:,0], s=img_hsv[:,:,1], v=img_hsv[:,:,2], is the maximum integer not greater than x, f is the offset value of the color range, and t, p, and q are intermediate values.

[0100] In complex scenes, such as at night or in indoor parking lots with uneven lighting, the Retinex algorithm can effectively reduce the halo phenomenon, improve the quality of the image, and make the inherent color characteristics of the image more obvious, thereby improving the accuracy of parking space recognition. Grayscale conversion further simplifies image processing, removes color interference, and makes image features more prominent, which is conducive to the recognition of parking spaces and vehicles.

[0101] Through the above-mentioned implementation mode of the present application, the fourth parking space image is subjected to color space conversion, decomposition, reflection component calculation, synthesis transformation and grayscale conversion, and a first grayscale image can be obtained, which is visually clearer, has a higher contrast, and has more prominent parking space features. This processing flow not only improves the quality of the image, but also removes the impact of lighting changes on the image, and provides high-quality image data for parking space recognition in complex scenes. Through the above-mentioned embodiments, it can be seen that even under poor lighting conditions, after the Retinex algorithm and grayscale conversion processing, the contrast and clarity of the parking space image can be significantly improved, making parking space recognition more accurate and reliable. In the intelligent parking system, this image processing method can ensure accurate parking space recognition under any lighting conditions, and improve the stability of the system and user experience.

[0102] In an optional embodiment, the above-mentioned calculation of the first reflection component corresponding to the red channel image, the second reflection component corresponding to the green channel image, and the third reflection component corresponding to the blue channel image includes: taking any one channel of the red channel image, the green channel image, and the blue channel image as the target channel image, and performing the following operations: convolving the target channel image with a center-surround function to obtain an illumination component; and obtaining a reflection component based on the target channel image and the illumination component.

[0103] It should be noted that the center-surround function is a function used to estimate the illumination (irradiation) component in the field of image processing. It simulates the way the human visual system perceives illumination and uses convolution operations to estimate the illumination intensity of each pixel in the image, providing a basis for the subsequent calculation of the reflection component. The illumination component can represent the part of the image brightness change caused by the illumination distribution. It is obtained by processing the target channel image with the center-surround function, reflecting the influence of local illumination conditions in the image, and plays an important role in eliminating shadows, uneven illumination, and improving image contrast and clarity. The reflection component can represent the contribution of the inherent properties of the object surface to the image brightness. It is obtained through the operation between the target channel image and the illumination component, reflecting the true color and texture information of the object in the image. By calculating the reflection component, the negative impact of illumination conditions on the image can be eliminated, so that the image can maintain a consistent visual effect under different illumination conditions.

[0104] In an optional embodiment, any one of the red, green or blue channel images can be used as the target channel image, and then the center surround function is used to perform a convolution operation on the target channel image to obtain an illumination component representing the influence of local illumination. Next, according to the relationship between the target channel image and the illumination component, the reflection component of the channel image can be obtained by calculation (for example: the ratio of the target channel image to the illumination component, and then logarithmic transformation). This process is performed on the red, green and blue channel images respectively, and finally the first reflection component, the second reflection component and the third reflection component corresponding to the three channels are obtained. The calculation of the reflection component enables the image to better maintain the true color and texture of the object under different lighting conditions, and improves the recognition and visual effect of the image in complex scenes.

[0105] In an optional embodiment, three color channel images R(x, y), G(x, y), B(x, y) are input. Each image can be convolved using the center-surround function F. λ is a normalization constant that ensures that the integral within the convolution kernel is 1; c is the convolution kernel size, and the commonly used convolution kernel radii are 15, 80, and 120.

[0106] The reflection component R and the illumination component L have the following relationship: lnI(x,y)=lnL(x,y)+lnR(x,y), that is, r(x,y)=lnR(x,y)=lnI(x,y)-lnL(x,y), and the corresponding reflection component can be obtained.

[0107] The illumination component reflects the effect of lighting conditions on image brightness, while the reflection component reflects the contribution of the inherent properties of the object surface to brightness. By calculating the reflection component, the effect of lighting changes on image quality can be eliminated, and the recognition and robustness of the image under complex lighting conditions can be improved.

[0108] Through the above implementation of the present application, the reflection component of the RGB channel image can be calculated, and the influence of lighting conditions (such as side light, backlight, etc.) on the image quality can be eliminated, making the image visually clearer and the parking space features more obvious, providing high-quality image data for subsequent parking space recognition. Through the above embodiments, it can be seen that the parking space image under the influence of strong side light can significantly improve the image quality after the illumination component is calculated and the reflection component is extracted, eliminate the influence of uneven lighting, make the parking space more prominent in the image, and provide reliable data support for the intelligent parking system. Through this processing, no matter how the lighting conditions change, the parking space image can maintain good recognition and visual effects, improving the adaptability of the intelligent parking system to complex scenes.

[0109] In an optional embodiment, the above-mentioned processing of the sixth parking space image to obtain the first grayscale image includes: rotating the sixth parking space image to obtain an adjusted sixth parking space image; converting the adjusted sixth parking space image into a second grayscale image; deleting white dots in the second grayscale image to obtain the first grayscale image.

[0110] In an optional embodiment, after obtaining the reflection components r of the three channels R (x,y),r G (x,y),r B After (x, y), weighted synthesis can be performed to obtain r(x, y). Exponential transformation is performed on the parking space image r(x, y) to obtain the sixth parking space image R(x, y)=e in RGB space r(x,y) .

[0111] It should be noted that the sixth parking space image is rotated and adjusted. This step is usually used to correct the angle deviation in the image, making the parking space image more regular and convenient for subsequent processing and recognition. Next, the adjusted sixth parking space image is converted into a second grayscale image, the color information is removed, the brightness information is retained, and the image features are more concentrated. Finally, by deleting the white spots in the second grayscale image, the first grayscale image can be obtained, the noise in the image is reduced, the boundary of the parking space is clearer, and more accurate image data is provided for parking space recognition.

[0112] In an optional implementation, assume that there is an image of the sixth parking space taken at the entrance of a parking lot. The parking space is not positioned correctly in the image due to angle and distance factors, and there are some scattered white spots in the image caused by light reflection or dust. First, the rotation function in the OpenCV library can be used to rotate and adjust the image of the sixth parking space. For example, by calculating the center point and rotation angle of the parking space rectangle, the getRotationMatrix2D and warpAffine functions can be used to adjust the image to make the parking space rectangle more upright, which is convenient for subsequent processing and recognition. Define the coordinates of the upper left corner of the rectangular box (x, y), the width and height of the box are w and h respectively, the rotation angle is a, and the coordinates of the rotation reference point are (x0, y0). Calculate the coordinates of the upper right corner (x+w, y), the lower right corner (x+w, y+h), and the lower left corner (x, y+h) before rotation. According to the rotation rectangle formula x ′ =(x-x0)cos a-(y-y0)sina+x0,y ′ =(x-x0)sin a+(y-y0)cos a+y0, calculate the adjusted coordinates (x', y'). Use array P to store the adjusted coordinates of the four corners P = [p1, p2, p3, p4]. Use the line method in the OpenCV library to draw the rotated rectangular frame and obtain the adjusted parking space image R'(x, y).

[0113] Use the cvtColor method in the OpenCV library to convert R'(x, y) into a parking space grayscale image and record it as G'(x, y). Use the adaptiveThreshold method in the OpenCV library to convert G'(x, y) into a parking space binary image and record it as B'(x, y). Use the medianBlur method in the OpenCV library to delete the scattered white dots in B'(x, y), and the processed image is recorded as R" (x, y).

[0114] In image processing, rotation and grayscale conversion are used to correct image posture and simplify image features, making the image features more concentrated and easier to identify. White point removal is used to reduce noise points in the image and improve image clarity and recognition accuracy. Through these steps, the boundaries and features of parking spaces in the image can be made more prominent, which is conducive to the subsequent parking space recognition and parking space detection algorithm execution.

[0115] Through the above implementation of the present application, by rotating, grayscale converting, and deleting white spots on the sixth parking space image, a first grayscale image can be obtained, which is visually clearer, has more obvious parking space features, and more accurate boundaries. This processing flow not only improves the quality of the image, but also removes the negative impact of illumination changes and image noise on the image, providing high-quality image data for parking space recognition in complex scenes. Through the above embodiments, it can be seen that even in the case of an incorrect parking space angle or the presence of white spot noise, the clarity and recognition performance of the parking space image can be significantly improved after rotation adjustment, grayscale conversion, and white spot deletion, ensuring that the intelligent parking system can achieve accurate parking space recognition in any scenario, improving the stability of the system and user experience.

[0116] Figure 3 is a schematic diagram of an optional parking space recognition method according to an embodiment of the present application; Figure 3 As shown in the figure, in the smart parking system, the Internet Smart Parking Space Recognition Center (hereinafter referred to as the "Recognition Center") can select the most suitable parking space recognition node from a heterogeneous network to process parking space image data from different parking lots. These nodes may be distributed in different geographical areas and have different hardware configurations, software versions, and security performance. The Recognition Center has designed a set of on-demand customized mechanisms to meet the specific scenario requirements of data security processing, while taking into account the trustworthiness and service quality of the nodes.

[0117] First, the identification center classifies data security requirements according to the location, scale and security requirements of the parking lot. For example, a large parking lot in the city center may require a higher data security level, and the corresponding nodes should have stronger security performance, such as firewalls, encryption technology, access control, etc. The identification center divides security requirements into three levels: low, medium and high, corresponding to different security indicator requirements.

[0118] The identification center maintains a node database, which records the heterogeneous security indicators and historical service error counts of each parking space identification node. Heterogeneous security indicators include firewall strength, encryption algorithm efficiency, access control mechanism strictness, etc., while the service error count is the number of times the node failed to correctly identify the parking space in the past period of time. For example, the security indicators of node N1 are firewall strength 80%, encryption algorithm efficiency 90%, access control mechanism strictness 85%, and historical service error count 5 times; the security indicators of node N2 are firewall strength 75%, encryption algorithm efficiency 80%, access control mechanism strictness 80%, and historical service error count 20 times.

[0119] The identification center calculates the credibility of each node, which combines heterogeneous security indicators and historical service error times. In the calculation formula, the weight of the security indicator is higher than the number of service errors, ensuring that the selected node meets the security requirements first. For example, the calculation formula for the credibility of the node can be: credibility = 0.8 × average value of security indicators - 0.2 × number of service errors. According to the above formula, the credibility of node N1 is 0.8 × (80% + 90% + 85%) / 3-0.2 × 5 = 73%, and the credibility of node N2 is 0.8 × (75% + 80% + 80%) / 3-0.2 × 20 = 54%.

[0120] According to the location and security level of each parking lot, the recognition center selects nodes that meet the security level requirements from the node database, sorts them according to the credibility of the nodes, and selects the nodes with the highest credibility as the target nodes. For example, for a large parking lot located in the city center, the recognition center selects all nodes that meet the high-level security requirements. Among these nodes, N1 has the highest credibility, so N1 is selected as the target node for processing the parking space image data of the parking lot.

[0121] Once the target node N1 is selected, the recognition center sends the parking space image data to N1. N1 uses its high-security hardware and software to process the image data, execute the above-mentioned image enhancement and parking space recognition algorithms, and ensure the security of the data during transmission and processing. The processed parking space recognition results will be encrypted and fed back to the recognition center for updating the parking space status and guiding vehicles.

[0122] In this embodiment, the on-demand customization mechanism of the identification center ensures that the selection of parking space identification nodes not only meets the specific scenario requirements of data security processing, but also takes into account the historical service quality of the nodes, avoiding the selection of nodes that meet the security indicators but have a high number of service errors, thereby improving the accuracy of parking space identification and the overall performance of the system. Through this mechanism, the smart parking system can achieve efficient and stable services while ensuring data security, providing users with a good user experience.

[0123] This customized node selection mechanism combined with image enhancement and parking space recognition technology significantly improves the data security processing capabilities and service quality of the smart parking system in complex scenarios. Through the implementation examples, it can be seen that even in a diverse network environment, the recognition center can select the most suitable parking space recognition node by comprehensively considering the security requirement level, node security indicators and service error times, ensuring the secure transmission and efficient processing of image data, and providing stable and reliable technical support for the smart parking system. In practical applications, this mechanism can cope with the challenges of various parking environments, provide accurate parking space recognition services, and at the same time protect the security and privacy of user data.

[0124] In an optional embodiment, in the intelligent parking system, it is assumed that the average credibility of the existing parking space identification node set (hereinafter referred to as the "node set") is 65%, but the credibility threshold required by the system is 70%, which means that the current node set cannot fully meet the system's requirements for data security processing, and it is necessary to re-search the parking space identification nodes to optimize the node set.

[0125] In the parking space identification network, several edge parking space identification routers are deployed, which are located near the entrances and exits of the parking lot, as well as key areas inside the parking lot. These edge routers are responsible for collecting the latest information of nearby parking space identification nodes, such as hardware configuration, software version, security indicators, and historical service error times. For example, edge router E1 collects the security indicators of nodes N1 as 75%, N2 as 85%, and N3 as 70%, and sends this information to the regional parking space identification router R1.

[0126] After receiving the parking space identification node information uploaded by the edge router, the regional parking space identification router (hereinafter referred to as the "regional router") first calculates the heterogeneous security indicators of each node, including firewall strength, encryption algorithm efficiency, access control mechanism strictness, etc. Then, the parking space identification node combination is screened according to the calculation results. For example, the heterogeneous security indicators of N1, N2 and N3 are compared, and it is found that N2 has the highest security index of 85%. The regional router R1 compares the information of N2 with the heterogeneous security indicators of other nodes, eliminates nodes with high service error times or low security indicators, and generates a heterogeneous security parking space identification node set, which contains the nodes with the best security performance in the network.

[0127] After calculation and screening, the regional router R1 generates a heterogeneous safe parking space identification node set, which includes nodes with high security performance such as N2. Subsequently, R1 submits this set to the smart parking space identification dispatch center (hereinafter referred to as the "dispatching center"), which is responsible for comprehensively evaluating the node sets submitted by all regional routers and selecting the node set that best meets the system security requirements for subsequent parking space image data processing and parking space identification services.

[0128] After receiving the heterogeneous safe parking space identification node sets submitted by the routers in each area, the dispatch center calculated the average credibility of each set and found that the average credibility of the set submitted by R1 was 80%. The dispatch center selected the node set with the highest average credibility and used it as the new parking space identification node set to process the parking space image data of the entire system. At the same time, for areas with lower average credibility, the dispatch center will send a notification to require the edge routers in these areas to re-search nearby parking space identification nodes with higher security performance to further optimize the node set of the entire system and improve service performance.

[0129] Once the new set of heterogeneous safe parking space identification nodes is determined, the dispatch center sends the parking space image data to the nodes in the set for processing. These nodes use their high security performance and low service error rate to perform image enhancement and parking space identification algorithms while ensuring the security of data transmission and processing. The processed parking space identification results will be encrypted and fed back to the dispatch center for updating the parking space status and guiding vehicles.

[0130] In this embodiment, the deployment and collaboration of the edge parking space identification router and the regional parking space identification router enable the intelligent parking system to dynamically optimize the parking space identification node set and improve the system's adaptability and flexibility to data security processing. Even in a complex and changing parking environment, the system can select the most appropriate node set through continuous node search and evaluation, ensure the secure transmission and efficient processing of image data, and provide users with stable and reliable parking space identification services.

[0131] Through the above embodiments, it can be seen that when the credibility of the existing parking space identification node set does not meet the requirements, the intelligent parking system can re-search and screen nearby parking space identification nodes with higher security performance through the collaboration of edge parking space identification routers and regional parking space identification routers, generate a new set of heterogeneous security parking space identification nodes, and submit it to the smart parking space identification dispatching center for comprehensive evaluation and selection. This mechanism not only improves the system's adaptability and flexibility in data security processing, but also ensures accurate parking space identification and efficient services in any scenario, providing strong technical support for intelligent parking management. In actual applications, this mechanism can cope with the challenges of various parking environments, including complex scenarios such as nighttime, indoors, and outdoors, and provide users with stable, reliable and safe parking space identification services.

[0132] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0133] According to another aspect of the embodiments of the present application, a parking space recognition device for implementing the above parking space recognition method is also provided. Figure 4 As shown, the device comprises:

[0134] a channel decomposition unit 402, configured to invert the first parking space image to obtain a second parking space image, and decompose the second parking space image to obtain a first chromaticity image, a first saturation image, and a first brightness image, wherein the first parking space image is used to indicate a parking space to be identified;

[0135] A channel processing unit 404 is used to perform image processing on the first saturation image using the reference saturation image to obtain a second saturation image, and to correct the first brightness image to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on the saturation channel;

[0136] An image superposition unit 406 is used to synthesize the second saturation image, the second brightness image and the first chromaticity image and then invert them to obtain a third parking space image, and superimpose the third parking space image and the first parking space image to obtain a fourth parking space image;

[0137] The parking space recognition unit 408 is used to process the fourth parking space image to obtain a first grayscale image, and determine that there is a vehicle in the parking space to be recognized when the pixel points in the first grayscale image meet the preset conditions.

[0138] Optionally, the channel processing unit 404 further includes: a filtering module, used to filter the first saturation image using a reference saturation image to obtain a third saturation image; and an enhancement module, used to perform intensity enhancement on the third saturation image to obtain a second saturation image.

[0139] Optionally, the above-mentioned filtering module is also used to: perform the following operations for the i-th pixel in the first saturation image: determine the spatial Gaussian kernel according to the distance between the i-th pixel and each pixel in the first saturation image; determine the range Gaussian kernel according to the grayscale value of the i-th pixel and the grayscale value of each pixel in the first saturation image; determine the joint Gaussian kernel according to the grayscale value of the i-th pixel in the reference saturation image and the grayscale value in the reference saturation image; calculate the normalization factor of the i-th pixel according to the spatial Gaussian kernel, the range Gaussian kernel and the joint Gaussian kernel, and determine the filtered value of the i-th pixel according to the normalization factor, where i is an integer greater than 0; after performing the above operations on all pixels in the first saturation image, a third saturation image is obtained.

[0140] Optionally, the above-mentioned enhancement module is also used to: determine the maximum intensity value and the minimum intensity value in the third saturation image; perform the following operation for the j-th pixel in the third saturation image, where j is an integer greater than 0: use the ratio of the difference between the intensity value of the j-th pixel and the minimum intensity value to the difference between the maximum intensity value and the minimum intensity value, and multiply it by a preset intensity value to obtain the enhanced intensity value of the j-th pixel; after enhancing each pixel in the third saturation image, a second saturation image is obtained.

[0141] Optionally, the above-mentioned channel processing unit 404 also includes: a brightness correction module, which is used to calculate a correction coefficient based on the average brightness of the first brightness image; for the kth pixel in the first brightness image, perform the following operations, where k is an integer greater than 0: use the correction coefficient as the exponent of the ratio of the brightness of the kth pixel to the preset brightness to obtain an adjustment coefficient, and multiply the adjustment coefficient by the preset brightness to obtain the corrected brightness of the kth pixel; after enhancing each pixel in the first brightness image, a second brightness image is obtained.

[0142] Optionally, the parking space recognition unit 408 further includes: a channel decomposition module, used to convert the fourth parking space image into a fifth parking space image in RGB space, and decompose the fifth parking space image to obtain a red channel image, a green channel image and a blue channel image; a reflection component calculation module, used to calculate the first reflection component corresponding to the red channel image, the second reflection component corresponding to the green channel image and the third reflection component corresponding to the blue channel image; an image synthesis and transformation module, used to synthesize and transform the first reflection component, the second reflection component and the third reflection component to obtain a sixth parking space image; and a grayscale image generation module, used to process the sixth parking space image to obtain a first grayscale image.

[0143] Optionally, the above-mentioned reflection component calculation module is also used to: take any one channel of the red channel image, the green channel image and the blue channel image as the target channel image, and perform the following operations: convolve the target channel image using the center surround function to obtain the illumination component; and obtain the reflection component based on the target channel image and the illumination component.

[0144] Optionally, the grayscale image generating module is further used to: rotate the sixth parking space image to obtain an adjusted sixth parking space image; convert the adjusted sixth parking space image into a second grayscale image; and delete white dots in the second grayscale image to obtain a first grayscale image.

[0145] Optionally, in this embodiment, the embodiments to be implemented by the above-mentioned various unit modules can refer to the above-mentioned various method embodiments, which will not be repeated here.

[0146] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned parking space recognition method is also provided. The electronic device may be Figure 5 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Figure 5 As shown, the electronic device includes a memory 502 and a processor 504. The memory 502 stores a computer program, and the processor 504 is configured to execute the steps in any of the above method embodiments through the computer program.

[0147] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0148] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0149] S1, inverting the first parking space image to obtain a second parking space image, and decomposing the second parking space image to obtain a first chromaticity image, a first saturation image, and a first brightness image, wherein the first parking space image is used to indicate a parking space to be identified;

[0150] S2, performing image processing on the first saturation image using the reference saturation image to obtain a second saturation image, and correcting the first brightness image to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on the saturation channel;

[0151] S3, synthesizing the second saturation image, the second brightness image, and the first chromaticity image, and then inverting them to obtain a third parking space image, and superimposing the third parking space image and the first parking space image to obtain a fourth parking space image;

[0152] S4, processing the fourth parking space image to obtain a first grayscale image, and determining that there is a vehicle in the parking space to be identified when a pixel point in the first grayscale image meets a preset condition.

[0153] Alternatively, a person skilled in the art may understand that: Figure 5 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Figure 5 The electronic device and the electronic equipment described above are not limited in structure. Figure 5 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 5 Different configurations shown.

[0154] Among them, the memory 502 can be used to store software programs and modules, such as the program instructions / modules corresponding to the parking space identification method and device in the embodiment of the present application. The processor 504 executes various functional applications and data processing by running the software programs and modules stored in the memory 502, that is, to implement the above-mentioned parking space identification method. The memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 502 may further include a memory remotely located relative to the processor 504, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 502 can be specifically, but not limited to, used to store parking space images. As an example, such as Figure 5 As shown, the memory 502 may include, but is not limited to, the channel decomposition unit 402, the channel processing unit 404, the image superposition unit 406, and the parking space recognition unit 406 in the parking space recognition device. In addition, it may also include, but is not limited to, other module units in the parking space recognition device, which will not be repeated in this example.

[0155] Optionally, the transmission device 506 is used to receive or send data via a network. Specific examples of the network may include wired networks and wireless networks. In one example, the transmission device 506 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 506 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0156] In addition, the electronic device further includes: a display 508 for displaying parking space status data; and a connection bus 510 for connecting various module components in the electronic device.

[0157] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.

[0158] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0159] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned parking space recognition method.

[0160] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0161] S1, inverting the first parking space image to obtain a second parking space image, and decomposing the second parking space image to obtain a first chromaticity image, a first saturation image, and a first brightness image, wherein the first parking space image is used to indicate a parking space to be identified;

[0162] S2, performing image processing on the first saturation image using the reference saturation image to obtain a second saturation image, and correcting the first brightness image to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on the saturation channel;

[0163] S3, synthesizing the second saturation image, the second brightness image, and the first chromaticity image, and then inverting them to obtain a third parking space image, and superimposing the third parking space image and the first parking space image to obtain a fourth parking space image;

[0164] S4, processing the fourth parking space image to obtain a first grayscale image, and determining that there is a vehicle in the parking space to be identified when a pixel point in the first grayscale image meets a preset condition.

[0165] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0166] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the above methods in each embodiment of the present application.

[0167] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0168] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0169] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0170] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0171] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0172] The above are only preferred implementations of the present application. It should be pointed out that ordinary technicians in this technical field can make several improvements and modifications without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A parking space recognition method, characterized in that: The method comprises: Inverting the first parking space image to obtain a second parking space image, and decomposing the second parking space image to obtain a first chromaticity image, a first saturation image, and a first brightness image, wherein the first parking space image is used to indicate a parking space to be identified; Using a reference saturation image to perform image processing on the first saturation image to obtain a second saturation image, and correcting the first brightness image to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on a saturation channel; The second saturation image, the second brightness image, and the first chromaticity image are synthesized and then inverted to obtain a third parking space image, and the third parking space image and the first parking space image are superimposed to obtain a fourth parking space image; The fourth parking space image is processed to obtain a first grayscale image, and when pixels in the first grayscale image meet a preset condition, it is determined that a vehicle exists in the parking space to be identified.

2. The method according to claim 1, characterized in that The step of performing image processing on the first saturation image using the reference saturation image to obtain a second saturation image includes: Using the reference saturation image to filter the first saturation image, to obtain a third saturation image; Intensity enhancement is performed on the third saturation image to obtain the second saturation image.

3. The method according to claim 2, characterized in that The filtering process of the first saturation image by using the reference saturation image to obtain a third saturation image includes: For the i-th pixel in the first saturation image, perform the following operations: determining a spatial Gaussian kernel according to a distance between the i-th pixel and each pixel in the first saturation image; Determine a range Gaussian kernel according to the gray value of the i-th pixel and the gray value of each pixel in the first saturation image; Determine a joint Gaussian kernel according to the grayscale value of the i-th pixel in the reference saturation image and the grayscale value in the reference saturation image; Calculating a normalization factor of the i-th pixel according to the spatial Gaussian kernel, the range Gaussian kernel, and the joint Gaussian kernel, and determining a filtered value of the i-th pixel according to the normalization factor, wherein i is an integer greater than 0; After performing the above operation on all pixels in the first saturation image, the third saturation image is obtained.

4. The method according to claim 2, characterized in that: The step of performing intensity enhancement on the third saturation image to obtain the second saturation image includes: determining a maximum intensity value and a minimum intensity value in the third saturation image; The following operation is performed for the j-th pixel in the third saturation image, where j is an integer greater than 0: The enhanced intensity value of the j-th pixel is obtained by multiplying the ratio of the difference between the intensity value of the j-th pixel and the minimum intensity value to the difference between the maximum intensity value and the minimum intensity value by a preset intensity value; After enhancing each pixel in the third saturation image, the second saturation image is obtained.

5. The method according to claim 2, characterized in that: The correcting the first brightness image to obtain a second brightness image includes: Calculate a correction coefficient according to the average brightness of the first brightness image; For the kth pixel in the first brightness image, perform the following operation, where k is an integer greater than 0: The correction coefficient is used as an exponent of the ratio of the brightness of the k-th pixel to the preset brightness to obtain an adjustment coefficient, and the adjusted brightness of the k-th pixel is obtained by multiplying the adjustment coefficient by the preset brightness; After each pixel in the first brightness image is enhanced, the second brightness image is obtained.

6. The method according to any one of claims 1 to 5, characterized in that The processing of the fourth parking space image to obtain a first grayscale image includes: Convert the fourth parking space image into a fifth parking space image in RGB space, and decompose the fifth parking space image to obtain a red channel image, a green channel image, and a blue channel image; Calculate a first reflection component corresponding to the red channel image, a second reflection component corresponding to the green channel image, and a third reflection component corresponding to the blue channel image; synthesizing and transforming the first reflection component, the second reflection component and the third reflection component to obtain a sixth parking space image; The sixth parking space image is processed to obtain the first grayscale image.

7. The method according to claim 6, characterized in that The calculating the first reflection component corresponding to the red channel image, the second reflection component corresponding to the green channel image, and the third reflection component corresponding to the blue channel image includes: Take any one channel of the red channel image, the green channel image and the blue channel image as the target channel image and perform the following operations: Convolving the target channel image using a center-surround function to obtain an illumination component; A reflection component is obtained according to the target channel image and the illumination component.

8. The method according to claim 6, characterized in that The processing of the sixth parking space image to obtain the first grayscale image includes: Rotating the sixth parking space image to obtain an adjusted sixth parking space image; Converting the adjusted sixth parking space image into a second grayscale image; The white dots in the second grayscale image are deleted to obtain the first grayscale image.

9. A parking space recognition device, characterized in that: The device comprises: a channel decomposition unit, configured to invert the first parking space image to obtain a second parking space image, and decompose the second parking space image to obtain a first chromaticity image, a first saturation image, and a first brightness image, wherein the first parking space image is used to indicate a parking space to be identified; a channel processing unit, configured to perform image processing on the first saturation image using a reference saturation image to obtain a second saturation image, and to correct the first brightness image to obtain a second brightness image, wherein the reference saturation image is a component of the reference parking space image on a saturation channel; an image superposition unit, configured to synthesize the second saturation image, the second brightness image, and the first chromaticity image, and then invert the synthesized images to obtain a third parking space image, and to superimpose the third parking space image and the first parking space image to obtain a fourth parking space image; The parking space recognition unit is used to process the fourth parking space image to obtain a first grayscale image, and determine that there is a vehicle in the parking space to be recognized when the pixels in the first grayscale image meet the preset conditions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 8 when executed.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.