Vehicle driving image enhancement processing method and auxiliary driving system under black light environment
By combining global and local histogram equalization processing in a black light environment and using a hash table to manage image area relationships, the problem of reduced image quality of autonomous vehicles in complex light environments is solved, and efficient images in night driving environments are achieved. Enhanced, improved driving safety and handling efficiency.
Patent Information
- Application Number
- CN202410839538.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-26
AI Technical Summary
In complex and changing light environments, the image quality of autonomous vehicles is affected. Existing technologies such as histogram equalization methods may cause texture information to be lost when processing grayscale areas with a small number of pixels, especially in night driving environments. There are safety hazards.
The vehicle driving image enhancement processing method under black light environment is adopted. Through the combination of global histogram equalization and local histogram equalization, a hash table is used to manage the image area relationship, identify the loss area and perform local processing to avoid the loss of texture information and improve the image contrast. and clarity.
It improves the image enhancement effect in black light environments, accurately identifies loss areas, retains texture information, improves driving safety, reduces the amount of calculation, and improves image processing efficiency.
Smart Images

Figure CN118379203B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a vehicle driving image enhancement processing method and an auxiliary driving system in a black light environment. Background Art
[0002] With the continuous advancement of autonomous driving technology, it has brought revolutionary changes to modern transportation. However, this technology still faces many challenges in practical application, especially in complex and changing light environments. Autonomous driving vehicles usually rely on image data captured by cameras to perceive the environment and make decisions, but the uneven brightness of the ambient light, such as overexposure or too dark, will seriously affect the image quality, thereby reducing the accuracy of the autonomous driving system's judgment of the environment ahead.
[0003] When processing these images, the traditional histogram equalization method can enhance the overall contrast of the image to a certain extent, but it processes the entire image uniformly and ignores the specific characteristics of different areas in the image. Histogram equalization is a simple and effective image enhancement technology. It changes the grayscale of each pixel in the image by changing the histogram of the image. It is mainly used to enhance the contrast of images with a small dynamic range. The original image may be concentrated in a narrow range due to its grayscale distribution, resulting in unclear images. For example, the grayscale of an overexposed image is concentrated in a high brightness range, while underexposure will cause the grayscale of the image to be concentrated in a low brightness range. Using histogram equalization, the histogram of the original image can be transformed into a uniformly distributed form, which increases the dynamic range of the grayscale value difference between pixels, thereby achieving the effect of enhancing the overall contrast of the image.
[0004] This method works better when dealing with grayscale areas with a large number of pixels, and can increase the contrast of these areas, making the image clearer. However, in grayscale areas with a small number of pixels in the image, this method may cause important texture information to be lost because these areas may be merged or ignored during the histogram equalization process.
[0005] This problem becomes particularly prominent in nighttime driving environments. Existing night vision assisted driving systems, such as lighting, infrared imaging, cameras, and various sensor systems, can improve the safety of nighttime driving to a certain extent, but they all have obvious defects. For example, the use of lights or laser fill light can easily alert the other party, which is not conducive to covert reconnaissance or nighttime monitoring; and passive infrared imaging technology performs poorly in distance perception, which may lead to misjudgment. Although other sensor systems can provide certain environmental information, they are often not intuitive enough and difficult for law enforcement officers to interpret quickly and accurately.
[0006] Considering the special needs of nighttime driving and the limitations of existing technologies, it is particularly important to develop a camera-assisted driving system that can work properly under weak natural light (such as starlight, moonlight, and atmospheric glow). Such a system not only needs to capture clear, real-time video images in extremely poor lighting conditions, but also needs to have adaptive local image enhancement functions to cope with changes in lighting conditions in different areas. Summary of the invention
[0007] The present application provides a method for enhancing the image of a vehicle traveling in a black light environment, which can effectively and timely improve the image enhancement effect in a black light environment, thereby improving driving safety.
[0008] The present application provides a method for enhancing a vehicle driving image in a black light environment, comprising:
[0009] S101, obtaining a first grayscale image of an original input image acquired by an image acquisition device, and performing global histogram equalization processing on the first grayscale image to obtain a second grayscale image;
[0010] S102, performing connected domain identification on the first grayscale image and the second grayscale image respectively, recording all first connected regions of the first grayscale image as first regions, and recording all second connected regions of the second grayscale image as second regions;
[0011] S103, based on each first connected region in the first region, traverse each pixel point in turn, locate the target pixel point of the second grayscale image and its second connected region according to the pixel point coordinates, and form a second region set with all the second connected regions corresponding to the first connected region;
[0012] S104, sequentially filling the first connected region and its corresponding second region set into the target key-value pair unit in the preset hash table, and determining the target key-value pair unit to be filled into the hash table by the first connected region and its corresponding second region set according to the Euclidean distance value and texture complexity between the first connected region and the target region already existing in the hash table in the first grayscale image each time filling, until all the first connected regions are filled, thereby obtaining a hash table containing N key-value pair units;
[0013] S105, based on each key-value pair unit, determining a loss area according to a change degree value of the second connected area in the second area set compared with the first connected area;
[0014] S106, in the second grayscale image, performing local histogram equalization processing on the loss area to obtain a target output image.
[0015] Preferably, the preset hash table is composed of a number of empty key-value pair units, the key is used to fill the first connected area to obtain the first image, and the value is used to fill the second area set corresponding to the first connected area to obtain the second image.
[0016] Preferably, the target area already existing in the hash table is determined as:
[0017] A1. According to a preset mask, determine a grid area of the first connected area to be filled in the first grayscale image, and obtain all first connected areas contained in the grid area;
[0018] wherein, the center point of the mask is overlapped with the center pixel point of the first connected area, and a grid area is marked in the first grayscale image;
[0019] A2. Based on all first connected regions contained in the grid region, a first connected region that already exists in the hash table is selected as a target region.
[0020] Preferably, in S104, each filling is performed based on the Euclidean distance value and texture complexity between the first connected region and the target region already existing in the hash table in the first grayscale image, to determine the target key-value pair unit to be filled into the hash table by the first connected region and its second region set, specifically including:
[0021] S201, calculating the Euclidean distance between the first connected region and the target region according to the coordinates of the central pixels in the first grayscale image;
[0022] S202, obtaining a first texture complexity of the first connected region and a target texture complexity of the target region;
[0023] S203, obtaining a merging trend factor between the first connected region and the target region according to the Euclidean distance value between the two and the difference value of the texture complexity respectively corresponding thereto;
[0024] S204, if the merging trend factor is greater than a preset merging threshold, the key-value pair unit where the target area is located is determined as a target key-value pair unit, the first connected area to be filled and the second area set to be filled are filled into the target key-value pair unit, and the first image and the second image are updated according to the key and value in the target key-value pair unit;
[0025] S205, otherwise, determining the empty key-value pair unit in the hash table as the target key-value pair unit;
[0026] S206: until all first connected regions in the first region are filled, update the hash table to obtain N key-value pair units, where N is less than or equal to the number of first connected regions in the first region.
[0027] Preferably, the change degree value in S105 is determined according to the area value and texture complexity of the first connected region and the second connected region in the key-value pair unit, and is specifically calculated according to the following formula:
[0028] ;
[0029] Among them, C is the value of the degree of change, is the maximum area of the second connected region in the value of the corresponding key-value pair unit, is the maximum area of the first connected region in the key of the corresponding key-value pair unit, T1' is the average value of the first texture complexity of all first connected regions in the corresponding key-value pair unit, and T2 is the average value of the second texture complexity of all second connected regions in the corresponding key-value pair unit;
[0030] The S105 specifically includes:
[0031] If the change degree value is greater than 1 or less than or equal to -1, the second image corresponding to the value in the corresponding key-value pair unit is determined as a loss area, and the loss area includes at least one second connected area.
[0032] Preferably, in S204, after the merging trend factor is greater than a preset merging threshold and before determining the target key-value pair unit, the step further includes:
[0033] S401, determining whether there is an intersection between the first connected region to be filled and the second region set corresponding to the target region, if yes, executing step S402, otherwise, executing step S205;
[0034] S402, determining the second connected area included in the intersection as the intersection area, if the area value of the second connected area in the intersection area is the maximum value in the second area set, determining the key-value pair unit where the target area is located as the target key-value pair unit; otherwise, executing step S205.
[0035] Preferably, before the step S106, the method further includes:
[0036] S501, when the loss region includes the intersection region, respectively calculating the discrete degree values of all second connected regions included in the non-intersection region in the loss region relative to the intersection region;
[0037] S502, if there is a discrete degree value greater than the discrete threshold, the loss area is divided into blocks, all the second connected areas with discrete degree values greater than the discrete threshold are combined into a first area block, and the remaining second connected areas and the intersection area are combined into a second area block; otherwise, step S106 is executed;
[0038] S503, dividing the first area block and the second area into new loss areas, and executing step S106, respectively calculating the grayscale projection range and performing local histogram equalization processing on the two.
[0039] Preferably, the discrete degree value of the second connected area of the non-intersecting area and the intersection area is calculated according to the following formula:
[0040] F=d / H, where d is the Euclidean distance between the second connected area and the intersection area, and H is the maximum span of the loss area;
[0041] The maximum span value of the loss area is obtained in the following manner: a minimum boundary rectangle of the loss area is obtained, and a distance value between pixel points at two end points on a diagonal line of the minimum boundary rectangle is used as the maximum span value of the loss area.
[0042] Preferably, the S502 further includes:
[0043] S601, connecting central pixel points of all second connected regions in the first region block in sequence to obtain a target image, where the target image is an irregular closed shape;
[0044] S602, calculating the overlapping area of the overlapping region between the target image and the second region block, if the overlapping area is greater than a preset ratio of the maximum area of the second connected region in the intersection region, executing step S603 to dynamically update the second connected region in the first region block and the second region block; otherwise, directly jump to step S503;
[0045] S603, determining the associated connected area of the second area block according to the overlapping area;
[0046] S604, merging the associated connected region into the second region block, and updating the second connected regions in the first region block and the second region block;
[0047] The associated connected area is determined as:
[0048] Obtaining the outermost boundary line of the target image, where the outermost boundary line is composed of a number of line segments, and the two endpoints of each line segment are the central pixel points of the two second connected regions;
[0049] Determine a line segment that intersects with the connected area in the second area block as a target line segment;
[0050] All second connected areas on the target line segment are determined as associated connected areas of the second area block.
[0051] The present application also provides a method for enhancing a vehicle driving image in a black light environment, comprising:
[0052] The acquisition unit is used to obtain a first grayscale image of the original input image, and perform global histogram equalization processing on it to obtain a second grayscale image;
[0053] The determination unit is used to identify connected domains of the first grayscale image and the second grayscale image respectively, record all first connected regions of the first grayscale image as first regions, and record all second connected regions of the second grayscale image as second regions; based on each first connected region in the first region, traverse each pixel point in turn, locate the target pixel point of the second grayscale image and its second connected region according to its pixel coordinates, and form a second region set with all second connected regions corresponding to the first connected region; fill the first connected region and its corresponding second region set into the target key-value pair unit in the preset hash table in turn, and each time fill, determine the target key-value pair unit to be filled in the hash table with the first connected region and its second region set according to the Euclidean distance value and texture complexity of the first connected region and the target region already existing in the hash table in the first grayscale image, until all the first connected regions are filled; based on each key-value pair unit, determine the loss region according to the change degree value of the second connected region in the second region set compared with the first connected region;
[0054] The processing unit is used to perform local histogram equalization processing on the loss area in the second grayscale image to obtain a target output image, and transmit the target output image to the vehicle-mounted display terminal for real-time display.
[0055] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0056] Based on each key-value pair unit in the updated hash table, the change degree value of the second connected area in the second area set compared with the first connected area is calculated, so that the loss area that needs to be processed by local histogram equalization can be accurately identified, and the most matching and suitable grayscale projection range is determined according to the grayscale value distribution range and texture information of the identified loss area relative to the first grayscale image, thereby avoiding the problem of texture information loss caused by global equalization and improving the effect of image enhancement processing;
[0057] Through the application of hash tables, the relationship data between the first grayscale image and the second grayscale image can be effectively managed, and it is helpful to efficiently process the loss area. By introducing the merged trend factor, when determining the loss area, the number of hash table key-value pair units is optimized, which reduces unnecessary calculations and improves image processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flowchart of a method for enhancing a vehicle driving image in a black light environment according to an embodiment of the present invention;
[0059] Figure 2 Schematic diagram of the structure of a driving assistance system in a black light environment according to an embodiment of the present invention. DETAILED DESCRIPTION
[0060] To facilitate the understanding of the present invention, the present application will be described more comprehensively below with reference to the relevant drawings; the drawings show preferred embodiments of the present invention, but the present invention can be implemented in many different forms and is not limited to the embodiments described herein; on the contrary, the purpose of providing these embodiments is to enable a more thorough and comprehensive understanding of the disclosed content of the present invention.
[0061] It should be noted that the terms “vertical”, “horizontal”, “up”, “down”, “left”, “right” and similar expressions used in this document are only for illustrative purposes and do not represent the only implementation method.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which the present invention belongs; the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the term "and / or" used herein includes any and all combinations of one or more related listed items.
[0063] Embodiment 1: Figure 1 It is a flow chart of a method for enhancing a vehicle driving image in a black light environment according to an embodiment of the present invention.
[0064] like Figure 1 As shown, the vehicle driving image enhancement processing method in a black light environment includes the following steps:
[0065] S101, obtaining a first grayscale image corresponding to an original input image, and performing global histogram equalization processing on the first grayscale image to obtain a second grayscale image.
[0066] Specifically, the specific content of the histogram equalization processing is: the grayscale values with a large number of pixels in the grayscale image, that is, the grayscale values that play a major role in the image picture are widened, and the grayscale values with a small number of pixels, that is, the grayscale values that do not play a major role in the picture are merged, so as to increase the contrast, make the image clear, and achieve the purpose of enhancement. After the histogram equalization processing is performed on the entire grayscale image, the grayscale difference in the area corresponding to the grayscale level that originally accounted for a large proportion increases, and the contrast is enhanced; and after the grayscale level that originally accounted for a small proportion is merged, the grayscale difference in the corresponding area becomes smaller, which may cause the texture information in the area to be lost, so the use of global histogram equalization may not be suitable for all areas of the grayscale image. Therefore, the embodiment of the present invention needs to identify and determine the area where the texture information is lost based on the change of the first grayscale image and the second grayscale image, that is, the subsequent loss area, and perform local histogram equalization processing on the loss area, so as to further improve the image contrast while retaining the texture information in a targeted manner, and better adapt to the scene of vehicle driving in a black light environment, thereby improving the safety of night driving.
[0067] S102, performing connected domain identification on the first grayscale image and the second grayscale image respectively, recording all connected regions of the first grayscale image as first regions, and recording all connected regions of the second grayscale image as second regions, wherein the first region includes a plurality of first connected regions, and the second region includes a plurality of second connected regions.
[0068] The connected domain of the image is identified using a preset algorithm, such as a Seed-Filling algorithm, which will not be described in detail in the present invention.
[0069] S103, based on each first connected area in the first area, traverse each pixel point in turn, locate the target pixel point of the second grayscale image and its second connected area according to its pixel coordinates, and form all the second connected areas corresponding to the first connected area into a second area set.
[0070] S104, sequentially filling the first connected region and its corresponding second region set into the target key-value pair unit in the preset hash table, and each filling is determined based on the Euclidean distance value and texture complexity in the first grayscale image between the first connected region and the target region already existing in the hash table, to fill the first connected region and its second region set into the target key-value pair unit in the hash table, until all the first connected regions in the first region are filled, and a hash table containing N key-value pair units is obtained.
[0071] Among them, the preset hash table is composed of several empty key-value pair units, the key is used to fill the first connected area to obtain the first image (the first image formed by the first connected area in the key), and the value is used to fill the second area set corresponding to the first connected area to obtain the second image (the second image formed by all second connected areas of the second area set in the value).
[0072] In some embodiments, the target area is determined as:
[0073] A1. According to a preset mask, determine a grid area of a first connected region to be filled in the first grayscale image, and obtain all first connected regions contained in the grid area.
[0074] The mask is set to be circular, and the size of the mask can be set according to actual conditions, and is used to represent the vicinity of the first connected area.
[0075] Specifically, the center point of the mask is overlapped with the center pixel point of the first connected area, and a grid area is marked in the first grayscale image.
[0076] A2. Based on all first connected regions contained in the grid region, a first connected region that already exists in the hash table is selected as a target region.
[0077] Therefore, by demarcating the grid area with a preset mask, it is only necessary to calculate the subsequent merging trend factor between the first connected areas in the grid area, without traversing all the first connected areas of the entire first grayscale image, which can effectively reduce the amount of image processing calculations and further improve image processing efficiency.
[0078] In some embodiments, each filling is performed based on the Euclidean distance value and texture complexity between the first connected region and the target region already existing in the hash table in the first grayscale image, and determines the target key-value pair unit to be filled into the hash table by the first connected region and its second region set, specifically including:
[0079] S201, calculating a Euclidean distance between the first connected region and the target region according to the coordinates of the central pixels of the first connected region and the target region in the first grayscale image.
[0080] S202, obtaining the normalized gray level co-occurrence matrix of the first connected region in the first region, and calculating the entropy of the first connected region according to the probability of occurrence of each pixel pair as the first texture complexity of the first connected region; obtaining the normalized gray level co-occurrence matrix of the target region in the first region, and calculating the entropy of the target region according to the probability of occurrence of each pixel pair as the target texture complexity of the target region.
[0081] S203, obtaining a merging trend factor between the first connected region and the target region according to the Euclidean distance value between the two and the difference value of the texture complexity respectively corresponding thereto.
[0082] Specifically, the combined trend factor is calculated according to the following formula:
[0083] , where M is the merging trend factor of the first connected region and the target region, and d is the Euclidean distance between the two. is the preset distance threshold, T1 is the first texture complexity, T is the target texture complexity, is the preset maximum texture complexity difference value, , and r are the preset weight factor values, which can be adjusted according to actual conditions to optimize the calculation formula of the combined trend factor.
[0084] S204, if the merging trend factor is greater than the preset merging threshold, the key-value pair unit where the target area is located is determined as the target key-value pair unit, the first connected area to be filled and its second area set are filled into the target key-value pair unit, and the first image and the second image are updated.
[0085] The first connected region unit to be filled is merged with the first connected region in the key where the target region is located, and the merged region is used to update the first image and the second image. It can be understood that the first image in each key-value pair unit includes at least one first connected region, and the second image includes at least one second connected region.
[0086] S205: Otherwise, determine the empty key-value pair unit in the hash table as the target key-value pair unit.
[0087] S206: until all first connected regions in the first region are filled, update the hash table to obtain N key-value pair units, where N is less than or equal to the number of first connected regions in the first region.
[0088] S105 , based on each key-value pair unit, determine a loss area according to a change degree value of the second connected area in the second area set compared with the first connected area.
[0089] In some embodiments, the change degree value is determined according to the area value and texture complexity of the first connected region and the second connected region in the key-value pair unit, and is specifically calculated according to the following formula:
[0090] ;
[0091] Among them, C is the value of the degree of change, is the maximum area of the second connected region in the value of the corresponding key-value pair unit, is the maximum area of the first connected region in the key of the corresponding key-value pair unit, T1' is the average value of the first texture complexity of all first connected regions in the corresponding key-value pair unit, and T2 is the average value of the second texture complexity of all second connected regions in the corresponding key-value pair unit.
[0092] It should be noted that T1' is the average value of the first texture complexity of all first connected areas in the first image corresponding to the key in the corresponding key-value pair unit. If there is only one first connected area, the first texture complexity T1 of the first connected area can be directly used as T1'. The specific method for calculating the texture complexity can refer to step S202, and the present invention will not elaborate on it.
[0093] In some embodiments, if the change degree value is greater than 1 or less than or equal to -1, the second image corresponding to the value in the corresponding key-value pair unit is determined as a loss area, and the loss area includes at least one second connected area.
[0094] Specifically, when the texture of the first connected area itself is relatively clear, after global histogram equalization processing, the corresponding second connected area in the second grayscale image will not change; when the first connected area is darker, it is divided into one area in the first grayscale image to obtain the first connected area, but after global histogram equalization processing, the texture information increases and the contrast is enhanced, so the corresponding second connected areas are multiple; when the proportion of multiple first connected areas in the first grayscale image is relatively small, these corresponding gray levels may be merged during the global equalization process, resulting in the loss of texture information in each first connected area, so that multiple first connected areas form a large area after equalization, that is, many-to-one.
[0095] S106, in the second grayscale image, perform local histogram equalization processing on the loss area to obtain a target output image, and transmit the target output image to the vehicle-mounted display terminal for real-time display.
[0096] In some embodiments, in the second grayscale image, performing local histogram equalization processing on the loss area further includes:
[0097] Based on each loss region, according to its corresponding first texture complexity and grayscale value distribution range, a grayscale projection range for performing local histogram equalization processing on the loss region is obtained.
[0098] Specifically, the grayscale projection range is calculated according to the following formula:
[0099] ,in, is the maximum gray value in the loss area, is the minimum gray value in the loss area, is the maximum grayscale value in the first grayscale image, is the minimum grayscale value in the first grayscale image, The ratio is used to characterize the distribution range of the grayscale value of the loss area relative to the first grayscale image. This ratio helps determine the grayscale value range that needs to be considered in the local histogram equalization processing of the loss area. If the ratio is large, it means that the grayscale value variation range of the loss area is wide, and a wider grayscale projection range may be required to retain the details. On the contrary, if the ratio is small, a too wide projection range may not be required;
[0100] is the average value of the first texture complexity of all first connected regions in the first image corresponding to the loss region;
[0101] right By performing inverse tangent function processing, it can be mapped to a limited range (usually -π / 2 to π / 2), so that a value between 0 and 1 is obtained through related operations. This is to normalize the texture complexity and make it a weight factor that can be used for subsequent evaluation of the grayscale projection range calculation. Specifically, since the loss area is an area where texture may be lost, the higher the texture complexity, the more detail information it contains, and the more grayscale levels are merged when the histogram equalization is performed on the entire first grayscale image. Therefore, a larger grayscale range is required to improve the image contrast; when the texture complexity is low, it means less detail information. At this time, although the grayscale levels in the area are merged, the merged grayscale levels are also less, so an excessively large grayscale range is not required to improve the contrast.
[0102] The normalized texture complexity is combined with the ratio of the grayscale value distribution range of the loss area and multiplied by 255, so as to be mapped to the grayscale value range of 0 to 255. Thus, a suitable grayscale projection range is calculated according to the grayscale value distribution range and texture complexity of the loss area, ensuring that both texture details are retained and contrast is enhanced during local histogram equalization.
[0103] It should be noted that the specific method of performing local histogram equalization processing on the loss area according to the determined grayscale projection range can refer to the relevant existing technology, and the present invention does not make any redundant description or limitation on this.
[0104] In some embodiments, the original input image in step S101 is acquired according to an image acquisition device installed on the vehicle, the image acquisition device includes a lens, a photoelectric film, a microchannel plate, a fluorescent screen, and a sensor, and they are connected in sequence. The acquisition method specifically includes the following steps:
[0105] S301, forming an initial optical image by capturing weak natural light such as starlight, moonlight and atmospheric glow through a lens of an image acquisition device installed in the vehicle.
[0106] S302, converting the initial optical image (optical signal) received by the photoelectric film into an electrical signal through the photoelectric effect.
[0107] S303, the received electrical signal is processed through the microchannel plate to ensure the strength and transmission efficiency of the electrical signal.
[0108] S304, the amplified electrical signal hits the fluorescent screen, stimulating a strong visible light image.
[0109] S305, capturing the visible light image on the fluorescent screen through a sensor, and converting it into a digital image as an original input image.
[0110] S306, the image acquisition device transmits the original input image to the digital signal processor and executes step S101.
[0111] The digital signal sensor is used to execute a vehicle driving image enhancement processing method in a black light environment according to an embodiment of the present invention.
[0112] Thus, the weak natural light at night is captured by the lens, and after the steps of photoelectric conversion, signal amplification, fluorescence excitation and digital conversion, a digitized original input image is finally obtained. The image is then transmitted to the digital signal processor for image enhancement processing, and steps S101 to S106 are executed to improve the contrast and clarity of the image, and retain the texture information. The processed target output image is transmitted to the vehicle display terminal for the driver to monitor the road conditions in real time. The original input image obtained by the optoelectronic enhancement technology can capture more weak natural light information at night, provide the driver with a clearer road view, and thus improve the safety of night driving.
[0113] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0114] In the driving scene under dark light, the real-time image grayscale image collected by the camera is first subjected to global histogram equalization. The loss area, that is, the area where texture information is lost, is determined according to the change between the grayscale images before and after equalization. Local histogram equalization is then performed to avoid the loss of texture information caused by global histogram equalization, thereby further retaining the image texture while ensuring image contrast enhancement.
[0115] However, when determining the loss area, the first grayscale image may have a large number of first connected areas due to the complexity of the environment. If the changes in the first connected areas are compared one by one with all the connected areas in the second grayscale image, it may cause computational burden and low efficiency.
[0116] Therefore, the first connected region and its second region set are filled according to the filling rule based on the key-value pair unit of the preset hash table, and the subsequent loss region is calculated for the region information in the key-value pair unit finally obtained; since the filling rule is based on the Euclidean distance value and the texture complexity difference value between the first connected region and the first connected region already existing in the hash table to limit the merging trend factor of the two, the target position for filling the first connected region is determined, which may be a new key-value pair unit or an existing key-value pair unit, that is, the merging processing of the first connected region minimizes the number of key-value pair units in the hash table;
[0117] Based on each key-value pair unit in the hash table, the change degree value of the second connected area in the second area set compared with the first connected area is calculated, so that the loss area that needs to be processed by local histogram equalization can be accurately identified, and the most matching and suitable grayscale projection range is determined according to the grayscale value distribution range and texture information of the identified loss area relative to the first grayscale image, thereby avoiding the problem of texture information loss caused by global equalization and improving the effect of image enhancement processing;
[0118] Moreover, through the application of hash tables, the relationship data between the first grayscale image and the second grayscale image can be effectively managed, and it is helpful to efficiently process the loss area. By introducing the merged trend factor, when determining the loss area, due to the optimization of the number of hash table key-value pair units, unnecessary calculations are reduced and the image processing efficiency is improved.
[0119] Embodiment 2: In embodiment 1, although the merged trend factor takes into account the difference in Euclidean distance and texture complexity between the first connected area and the target area, it does not rule out certain situations. For example, two first connected areas with similar texture complexity and Euclidean distance may form two completely different second connected areas with completely different changes after global histogram equalization. Although merging the two can reduce the amount of calculation and improve processing efficiency, there may be a risk of misjudgment or omission of the loss area.
[0120] Therefore, the embodiments of the present application are optimized to a certain extent based on the above embodiments.
[0121] In some embodiments, in step S204, after the merging trend factor is greater than the preset merging threshold and before determining the target key-value pair unit, the following steps are further included:
[0122] S401, determining whether there is an intersection between the first connected region to be filled and the second region set corresponding to the target region respectively, if yes, executing step S402, otherwise, executing step S205.
[0123] S402, determining the second connected area included in the intersection as the intersection area, if the area value of the second connected area in the intersection area is the maximum value in the second area set, determining the key-value pair unit where the target area is located as the target key-value pair unit; otherwise, executing step S205.
[0124] Therefore, by checking the intersection between the second region sets and paying special attention to whether there is a second connected region with the largest area in the intersection area, it is possible to more accurately determine which first connected regions should be merged together, thereby avoiding unreasonable merging, which is especially important when processing complex textures or objects because they may change significantly after global histogram equalization.
[0125] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0126] By checking the intersection between the second region sets, it is ensured that when merging the first connected region and the target region, not only the Euclidean distance and texture complexity are considered, but also whether the second connected region formed by the two after global histogram equalization overlaps, which improves the accuracy and rationality of merging and filling, thereby improving the accuracy and reliability of determining the loss region;
[0127] When there is a second connected area with the largest area in the intersection area, these first connected areas are more likely to be merged into the target key-value pair unit containing the second connected area with the largest area. This is because if the second areas corresponding to two first connected areas intersect and the area of the intersection area is the largest in the set of second areas, it means that the possibility of grayscale merging after equalization of the two is greater. Combined with the merging trend factor, it can effectively avoid erroneously merging adjacent textures or objects with different changes before and after equalization.
[0128] Embodiment 3: In the aforementioned embodiment, although the contrast and clarity of the image are improved by combining global histogram equalization and local histogram equalization, when processing complex images containing multiple connected regions, there may be a problem of inaccurate processing of the loss area, especially when some connected areas in the loss area are too scattered with the intersection area (representative area of grayscale merging), unified processing of the loss area may lead to increased errors and even adverse effects on the non-loss area.
[0129] Therefore, the embodiments of the present application are optimized to a certain extent based on the above embodiments.
[0130] In some embodiments, before step S106, the method further includes:
[0131] S501, when the loss region includes the intersection region, respectively calculating the discrete degree values of all other second connected regions (non-intersection regions) included in the loss region relative to the intersection region.
[0132] The discrete degree value is used to measure the dispersion degree of the two regions in the loss region. The discrete degree value of the second connected region of the non-intersecting region and the intersection region is calculated according to the following formula:
[0133] F=d / H, where d is the Euclidean distance between the second connected area and the intersection area, and H is the maximum span value of the loss area.
[0134] The maximum span value of the loss area is obtained as follows:
[0135] The minimum bounding rectangle of the loss area is obtained by using image processing technology. The minimum bounding rectangle can contain the minimum rectangle of all pixels in the loss area. The minimum bounding rectangle can be determined based on the minimum x coordinate, maximum x coordinate, minimum y coordinate and maximum y coordinate of all pixels in the loss area. It should be noted that the coordinates of the pixels in the image are generally expressed as (x, y). The coordinate system is established based on the endpoint of the lower left corner of the image as the coordinate origin, the horizontal direction as the x-axis, and the vertical direction as the y-axis.
[0136] Specifically, the distance value between the pixel points at the two end points on the diagonal line of the minimum boundary rectangle is taken as the maximum span value of the loss area.
[0137] S502, if there is a discrete degree value greater than the discrete threshold, the loss area is divided into blocks, all second connected areas with discrete degree values greater than the discrete threshold are formed into a first area block, and the remaining second connected areas and the intersection area are formed into a second area block; otherwise, execute step S106.
[0138] S503, dividing the first area block and the second area into new loss areas, and executing step S106, respectively calculating the grayscale projection range and performing local histogram equalization processing on the two.
[0139] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0140] By introducing a discrete degree value for each loss area, it is determined whether the loss area needs to be processed in blocks, and each block is subjected to local histogram equalization processing, which can more accurately determine the grayscale projection range for each block, thereby reducing the error caused by uniform processing due to the loss area being too dispersed, improving the accuracy and effect of the local histogram equalization processing of the loss area, and enhancing the local enhancement effect of the image;
[0141] The second connected areas that are too dispersed relative to the intersection area are formed into a regional block for separate processing, avoiding the impact on other non-loss areas during the local histogram equalization process and maintaining the integrity and clarity of the image; especially when processing complex images containing multiple connected areas, by considering the loss area in blocks, the loss area can be locally processed more effectively, thereby improving the adaptability and robustness of image enhancement processing.
[0142] Embodiment 4: In embodiment 3, although the intersection area is locally processed through block processing to further improve the accuracy of image enhancement, when a connected area in the first area block is too far away from other connected areas, the span of the first area block in the entire image may be too large. In this case, when the area blocks are subjected to local histogram equalization processing respectively, it is likely to cause cross-overlapping effects with the local processing of the second area block, resulting in uneven equalization effect, thereby affecting the effect of the local histogram equalization processing.
[0143] Therefore, the embodiments of the present application are optimized to a certain extent based on the above embodiments.
[0144] In some embodiments, step S502 further includes:
[0145] S601, connecting central pixels of all second connected regions in the first region block in sequence to obtain a target image, where the target image is an irregular closed shape.
[0146] S602, calculating the overlapping area of the overlapping region between the target image and the second region block. If the overlapping area is greater than a preset ratio of the maximum area of the second connected region in the intersection region, executing step S603 to dynamically update the second connected region in the first region block and the second region block; otherwise, directly jump to step S503.
[0147] Among them, the preset ratio is set to 50%, which is used to measure the influence of the overlapping area on the uniformity of the equalization effect of the first area block and the second area block when the local histogram equalization processing is performed on the first area block and the second area block respectively, so as to avoid distortion of some areas of the image due to excessive equalization processing.
[0148] S603: Determine the associated connected area of the second area block according to the overlapping area.
[0149] Specifically include:
[0150] Obtaining the outermost boundary line of the target image, where the outermost boundary line is composed of a number of line segments, and the two endpoints of each line segment are the central pixel points of the two second connected regions;
[0151] Determine a line segment that intersects with the connected area in the second area block as a target line segment;
[0152] All second connected areas on the target line segment are determined as associated connected areas of the second area block.
[0153] S604: merge the associated connected region into the second region block, and update the second connected regions in the first region block and the second region block.
[0154] Therefore, transferring the associated connected region to the second region block can minimize the cross-influence generated when the two region blocks are subjected to local histogram equalization processing respectively.
[0155] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages:
[0156] By detecting the overlapping area and then dynamically adjusting the second area block and the second area block, the cross-influence of the two area blocks in the local histogram equalization process is reduced, so that the equalization effect of each area block is more uniform;
[0157] Since the equalization effect is more uniform, it can improve the local contrast and clarity of the image loss area, further improving the visual experience of night driving.
[0158] Furthermore, the present invention also proposes a driving assistance system in a black light environment.
[0159] Figure 2 Schematic diagram of the structure of a driving assistance system in a black light environment according to an embodiment of the present invention.
[0160] like Figure 2 As shown, a driving assistance system in a black light environment includes: an acquisition unit, a determination unit, and a processing unit;
[0161] The acquisition unit is used to obtain a first grayscale image of the original input image, and perform global histogram equalization processing on it to obtain a second grayscale image;
[0162] The determination unit is used to identify connected domains of the first grayscale image and the second grayscale image respectively, record all first connected regions of the first grayscale image as first regions, and record all second connected regions of the second grayscale image as second regions; based on each first connected region in the first region, traverse each pixel point in turn, locate the target pixel point of the second grayscale image and its second connected region according to its pixel coordinates, and form a second region set with all second connected regions corresponding to the first connected region; fill the first connected region and its corresponding second region set into the target key-value pair unit in the preset hash table in turn, and each time fill, determine the target key-value pair unit to be filled in the hash table with the first connected region and its second region set according to the Euclidean distance value and texture complexity of the first connected region and the target region already existing in the hash table in the first grayscale image, until all the first connected regions are filled; based on each key-value pair unit, determine the loss region according to the change degree value of the second connected region in the second region set compared with the first connected region;
[0163] The processing unit is used to perform local histogram equalization processing on the loss area in the second grayscale image to obtain a target output image, and transmit the target output image to the vehicle-mounted display terminal for real-time display.
[0164] It should be noted that the specific implementation of the auxiliary driving system in a black light environment of the embodiment of the present invention can refer to the aforementioned vehicle driving image enhancement processing method in a black light environment.
[0165] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A vehicle driving image enhancement processing method in a black light environment, It is characterized in that include: S101, obtaining a first grayscale image of an original input image acquired by an image acquisition device, and performing global histogram equalization processing on the first grayscale image to obtain a second grayscale image; S102, performing connected domain identification on the first grayscale image and the second grayscale image respectively, recording all first connected regions of the first grayscale image as first regions, and recording all second connected regions of the second grayscale image as second regions; S103, based on each first connected region in the first region, traverse each pixel point in turn, locate the target pixel point of the second grayscale image and its second connected region according to the pixel point coordinates, and form a second region set with all the second connected regions corresponding to the first connected region; S104, sequentially filling the first connected region and its corresponding second region set into the target key-value pair unit in the preset hash table, and determining the target key-value pair unit to be filled into the hash table by the first connected region and its second region set according to the Euclidean distance value and texture complexity between the first connected region and the target region already existing in the hash table in the first grayscale image each time filling, until all the first connected regions are filled, thereby obtaining a hash table containing N key-value pair units; The preset hash table is composed of a number of empty key-value pair units, the key is used to fill the first connected area to obtain the first image, and the value is used to fill the second area set corresponding to the first connected area to obtain the second image; The S104 specifically includes: S201, calculating the Euclidean distance between the first connected region and the target region according to the coordinates of the central pixels in the first grayscale image; S202, obtaining a first texture complexity of the first connected region and a target texture complexity of the target region; S203, obtaining a merging trend factor between the first connected region and the target region according to the Euclidean distance value between the two and the difference value of the texture complexity respectively corresponding thereto; the merging trend factor is calculated according to the following formula: , where M is the merging trend factor of the first connected region and the target region, and d is the Euclidean distance between the two. is the preset distance threshold, T1 is the first texture complexity, T is the target texture complexity, is the preset maximum texture complexity difference value, , , r are respectively the preset weight factor values; S204, if the merging trend factor is greater than a preset merging threshold, the key-value pair unit where the target area is located is determined as a target key-value pair unit, the first connected area to be filled and the second area set to be filled are filled into the target key-value pair unit, and the first image and the second image are updated according to the key and value in the target key-value pair unit; S205, otherwise, determining the empty key-value pair unit in the hash table as the target key-value pair unit; S206, until all first connected regions in the first region are filled, update the hash table to obtain N key-value pair units, where N is less than or equal to the number of first connected regions in the first region; In the S204, after the merging trend factor is greater than the preset merging threshold and before determining the target key-value pair unit, the process further includes: S401, determining whether there is an intersection between the first connected region to be filled and the second region set corresponding to the target region, if yes, executing step S402, otherwise, executing step S205; S402, determining the second connected region included in the intersection as the intersection region, and if the area value of the second connected region in the intersection region is the maximum value in the second region set, determining the key-value pair unit where the target region is located as the target key-value pair unit; otherwise, executing step S205; S105, based on each key-value pair unit, determining a loss area according to a change degree value of the second connected area in the second area set compared with the first connected area; S106, performing local histogram equalization processing on the loss area in the second grayscale image to obtain a target output image; Before the step S106, the method further includes: S501, when the loss region includes the intersection region, respectively calculating the discrete degree values of all second connected regions included in the non-intersection region in the loss region relative to the intersection region; S502, if there is a discrete degree value greater than the discrete threshold, the loss area is divided into blocks, all the second connected areas with discrete degree values greater than the discrete threshold are combined into a first area block, and the remaining second connected areas and the intersection area are combined into a second area block; otherwise, step S106 is executed; S503, dividing the first region block and the second region block into new loss regions, and executing step S106, respectively calculating the grayscale projection range and performing local histogram equalization processing on the two regions; The grayscale projection range of the loss area is calculated according to the corresponding first texture complexity and grayscale value distribution range: ,in, is the maximum gray value in the loss area, is the minimum gray value in the loss area, is the maximum grayscale value in the first grayscale image, is the minimum grayscale value in the first grayscale image, It is the average value of the first texture complexity of all first connected regions in the first image corresponding to the loss region.
2. The vehicle driving image enhancement processing method in a black light environment as claimed in claim 1, It is characterized in that The target area already existing in the hash table is determined as: A1. According to a preset mask, determine a grid area of the first connected area to be filled in the first grayscale image, and obtain all first connected areas contained in the grid area; wherein, the center point of the mask is overlapped with the center pixel point of the first connected area, and a grid area is marked in the first grayscale image; A2. Based on all first connected regions contained in the grid region, a first connected region that already exists in the hash table is selected as a target region.
3. The vehicle driving image enhancement processing method in a black light environment as claimed in claim 1, It is characterized in that The change degree value in S105 is determined according to the area value and texture complexity of the first connected region and the second connected region in the key-value pair unit, and is specifically calculated according to the following formula: ; Among them, C is the value of the degree of change, is the maximum area of the second connected region in the value of the corresponding key-value pair unit, is the maximum area of the first connected region in the key of the corresponding key-value pair unit, T1' is the average value of the first texture complexity of all first connected regions in the corresponding key-value pair unit, and T2 is the average value of the second texture complexity of all second connected regions in the corresponding key-value pair unit; The S105 specifically includes: If the change degree value is greater than 1 or less than or equal to -1, the second image corresponding to the value in the corresponding key-value pair unit is determined as a loss area, and the loss area includes at least one second connected area.
4. The vehicle driving image enhancement processing method in a black light environment as claimed in claim 1, It is characterized in that The discrete degree value of the second connected area of the non-intersecting area and the intersection area is calculated according to the following formula: F=d / H, where d is the Euclidean distance between the second connected area and the intersection area, and H is the maximum span of the loss area; The maximum span value of the loss area is obtained in the following manner: a minimum boundary rectangle of the loss area is obtained, and a distance value between pixel points at two end points on a diagonal line of the minimum boundary rectangle is used as the maximum span value of the loss area.
5. The vehicle driving image enhancement processing method in a black light environment as claimed in claim 1, It is characterized in that The S502 further includes: S601, connecting central pixel points of all second connected regions in the first region block in sequence to obtain a target image, where the target image is an irregular closed shape; S602, calculating the overlapping area of the overlapping region between the target image and the second region block, if the overlapping area is greater than a preset ratio of the maximum area of the second connected region in the intersection region, executing step S603 to dynamically update the second connected region in the first region block and the second region block; otherwise, directly jump to step S503; S603, determining the associated connected area of the second area block according to the overlapping area; S604, merging the associated connected region into the second region block, and updating the second connected regions in the first region block and the second region block; The associated connected area is determined as: Obtaining the outermost boundary line of the target image, where the outermost boundary line is composed of a number of line segments, and the two endpoints of each line segment are the central pixel points of the two second connected regions; Determine a line segment that intersects with the connected area in the second area block as a target line segment; All second connected areas on the target line segment are determined as associated connected areas of the second area block.
6. A driver assistance system in a black light environment, It is characterized in that include: Acquisition unit, determination unit, processing unit; The acquisition unit is used to obtain a first grayscale image of the original input image, and perform global histogram equalization processing on it to obtain a second grayscale image; The determining unit is used to perform connected domain identification on the first grayscale image and the second grayscale image respectively, record all first connected regions of the first grayscale image as first regions, and record all second connected regions of the second grayscale image as second regions; Based on each first connected area in the first area, traverse each pixel point in turn, locate the target pixel point of the second grayscale image and its second connected area according to its pixel point coordinates, and form a second area set with all the second connected areas corresponding to the first connected area; sequentially fill the first connected area and its corresponding second area set into the target key-value pair unit in the preset hash table, and each filling is determined according to the Euclidean distance value and texture complexity of the first connected area and the target area already existing in the hash table in the first grayscale image, until all the first connected areas are filled; based on each key-value pair unit, determine the loss area according to the change degree value of the second connected area in the second area set compared with the first connected area; The preset hash table is composed of a number of empty key-value pair units, the key is used to fill the first connected area to obtain the first image, and the value is used to fill the second area set corresponding to the first connected area to obtain the second image; each filling is determined according to the Euclidean distance value and texture complexity of the first connected area and the target area already existing in the hash table in the first grayscale image, and the target key-value pair unit to be filled in the hash table by the first connected area and its second area set, specifically including: S201, according to the coordinates of the central pixel points of the first connected area and the target area in the first grayscale image, the Euclidean distance value between the two is calculated; S202, the first texture complexity of the first connected area and the target texture complexity of the target area are obtained; S203, according to the Euclidean distance value between the two and the difference value of the corresponding texture complexity, the merging trend factor between the first connected area and the target area is obtained; the merging trend factor is calculated according to the following formula: , where M is the merging trend factor of the first connected region and the target region, and d is the Euclidean distance between the two. is the preset distance threshold, T1 is the first texture complexity, T is the target texture complexity, is the preset maximum texture complexity difference value, , , r are respectively the preset weight factor values; S204, if the merging trend factor is greater than the preset merging threshold, the key-value pair unit where the target area is located is determined as the target key-value pair unit, the first connected area to be filled and the set of the second areas thereof are filled into the target key-value pair unit, and the first image and the second image are updated according to the key and value in the target key-value pair unit; S205, otherwise, the empty key-value pair unit in the hash table is determined as the target key-value pair unit; S206, until all the first connected areas in the first area are filled, the hash table is updated to obtain N key-value pair units, where N is less than or equal to the number of the first connected areas in the first area; In the S204, after the merging trend factor is greater than the preset merging threshold and before the target key-value pair unit is determined, the following further includes: S401, determining whether there is an intersection between the first connected area to be filled and the second area set corresponding to the target area respectively, if so, executing step S402, otherwise, executing step S205; S402, determining the second connected area included in the intersection as the intersection area, if the area value of the second connected area in the intersection area is the maximum value in the second area set, determining the key-value pair unit where the target area is located as the target key-value pair unit; otherwise, executing step S205; The processing unit is used to perform local histogram equalization processing on the loss area in the second grayscale image to obtain a target output image, and transmit the target output image to the vehicle-mounted display terminal for real-time display; Before the loss area is subjected to the local histogram equalization processing, the method further includes: S501, when the loss area includes the intersection area, respectively calculating the discrete degree values of all second connected areas contained in the non-intersection area of the loss area relative to the intersection area; S502, if there is a discrete degree value greater than the discrete threshold, then the loss area is divided into blocks, all the second connected areas whose discrete degree values are greater than the discrete threshold are formed into a first area block, and the remaining second connected areas and the intersection area are formed into a second area block; otherwise, the loss area is subjected to the local histogram equalization processing; S503, the first area block and the second area block are divided into new loss areas, the loss area is subjected to the local histogram equalization processing, and the grayscale projection range of the two is calculated and the local histogram equalization processing is performed respectively; The grayscale projection range of the loss area is calculated according to the corresponding first texture complexity and grayscale value distribution range: ,in, is the maximum gray value in the loss area, is the minimum gray value in the loss area, is the maximum grayscale value in the first grayscale image, is the minimum grayscale value in the first grayscale image, It is the average value of the first texture complexity of all first connected regions in the first image corresponding to the loss region.
