A real-time data acquisition method and system

By screening and analyzing boundary groups in traffic monitoring images, calculating stretching parameters and performing local linear stretching, the problem that global stretching cannot handle local lighting differences is solved, and image quality and recognition accuracy are improved.

CN119722446BActive Publication Date: 2025-06-24WUXI RUIGESI INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510205859.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-06-24
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

Global stretching cannot effectively handle lighting differences in local areas, resulting in loss of details in the intermediate image, affecting the image quality of traffic monitoring images and the accuracy of recognition processing.

Method used

By filtering out strong boundary groups and weak boundary groups in the intermediate image, the gradient direction continuity and stretching parameters of each boundary are calculated, the mapping intervals of pixel points in the stretched areas of different weak boundaries are set, and linear stretching is performed to obtain the traffic monitoring image after uniform light.

Benefits of technology

Effectively handle local lighting differences, retain detailed information of intermediate images, and improve the image quality of traffic monitoring images and the accuracy of recognition processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722446B_ABST
    Figure CN119722446B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of image data acquisition, and specifically relates to a real-time data acquisition method and system. The method includes: performing equalization processing on traffic surveillance images through an equalization algorithm. For the obtained intermediate images, according to the distance between strong boundaries and weak boundaries, obtain the associated strong boundaries of each weak boundary, calculate the contrast limitation of each weak boundary, and calculate the stretching parameters of each weak boundary according to the contrast limitation of each weak boundary, the gradient direction continuity, the gradient direction continuity of the associated strong boundaries of each weak boundary, and the distance between the associated strong boundaries of each weak boundary and each weak boundary. According to the stretching parameters of each weak boundary, set the mapping interval of the pixel points within the stretching area of each weak boundary, and perform linear stretching on all pixel points in the intermediate image according to the mapping interval to obtain the traffic surveillance image after equalization. The present invention improves the image quality of the traffic surveillance image after equalization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data acquisition. More specifically, the present invention relates to a real-time data acquisition method and system. Background Art

[0002] The electronic police monitoring system is an important part of the intelligent transportation system. Traffic monitoring images are collected in real time through the monitoring probes of the electronic police monitoring system to monitor the traffic conditions of vehicles on the road. During the acquisition process of traffic monitoring images, due to factors such as lighting conditions, shooting angles, and weather conditions, the brightness distribution in traffic monitoring images is uneven, seriously affecting the quality of traffic monitoring images and increasing the difficulty of identifying and processing traffic monitoring images. The MASK equalization algorithm is a commonly used equalization method.

[0003] In related technologies, for example, the Chinese patent application document with the publication number CN117575967A discloses a method for enhancing underwater crack images of water conveyance tunnels based on MASK. This patent application document analyzes the characteristics of the underwater environment of water conveyance tunnels, uses the land concrete crack as the image to be transformed, the real underwater environment image of the water conveyance tunnel as the style image, trains with the CycleGAN model to generate a large number of underwater style crack images of water conveyance tunnels, and selects images with better quality from them. Then, common denoising methods are compared, and finally, wavelet transform is used for image denoising processing. Finally, it is improved based on the MASK equalization algorithm and experimental comparison is carried out. The results show that the improved algorithm has a better defogging effect and better image quality than the original algorithm, solving the problem of uneven illumination in water conveyance tunnel images.

[0004] Since the subtraction operation in the MASK equalization algorithm will reduce the gray range of the subtracted image and lower the overall contrast, resulting in the loss of local detail information and affecting the clarity and information content of the intermediate image. Therefore, it is necessary to stretch the contrast to enhance the local details of the intermediate image and improve the clarity and information content of the intermediate image. Linear stretching is a commonly used stretching method. Linear stretching is a global adjustment method that linearly maps the gray values of the intermediate image to a new range. However, the uneven illumination in the intermediate image is usually local, and global stretching cannot effectively handle the illumination differences in local areas, resulting in the loss of details in the intermediate image and affecting the image quality of the equalized traffic monitoring image obtained after stretching processing, and further affecting the accuracy of identifying and processing traffic monitoring images. Summary of the Invention

[0005] To solve the above technical problem that global stretching cannot effectively handle the illumination difference in local areas, resulting in the loss of details in the intermediate image, affecting the image quality of the traffic monitoring image after uniform illumination obtained by stretching processing, and further affecting the accuracy of recognition and processing of traffic monitoring images, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a real-time data acquisition method, including: collecting traffic monitoring images in real time through a monitoring probe for monitoring the vehicle passing conditions on the road; performing uniform illumination processing on the traffic monitoring images through a uniform illumination algorithm. For the obtained intermediate image: screening out strong pixel points and weak pixel points according to the magnitude relationship between the gradient intensity of pixel points and the upper threshold and the lower threshold; forming a strong boundary group with all the strong pixel points; screening out the weak pixel points that form the weak boundary group according to whether there are strong pixel points within the 8-neighborhood of the weak pixel points; respectively converting all pixel points in the strong boundary group and the weak boundary group into a plurality of strong boundaries and a plurality of weak boundaries; calculating the gradient direction continuity of each strong boundary and each weak boundary; obtaining the associated strong boundary of each weak boundary according to the distance between the strong boundary and the weak boundary; calculating the average value of the gradient intensities of all weak pixel points in the weak boundary and the average value of the gradient intensities of all strong pixel points in the associated strong boundary of the weak boundary , taking the normalization result of as the contrast limitation of the weak boundary ; calculating the stretching parameter of the weak boundary ; , are respectively the gradient direction continuities of the weak boundary and the associated strong boundary of the weak boundary, is the distance between the associated strong boundary of the weak boundary and the weak boundary; setting the mapping interval of the pixel points within the stretching area of each weak boundary according to the stretching parameter of each weak boundary; the mapping interval of other pixel points in the intermediate image is ; performing linear stretching on all pixel points in the intermediate image according to the mapping interval to obtain the traffic monitoring image after uniform illumination.

[0007] In view of the fact that the uneven illumination in the intermediate image is usually local, the present invention sets different mapping intervals for the pixel points in the stretching areas of each weak boundary and other pixel points in the intermediate image, and linearly stretches all the pixel points in the intermediate image according to the mapping intervals to obtain a traffic monitoring image with uniform illumination, which solves the problem that global stretching cannot effectively handle the illumination differences in local areas, resulting in the loss of details in the intermediate image, improves the image quality of the traffic monitoring image with uniform illumination obtained after stretching processing, and further improves the accuracy of recognition and processing of traffic monitoring images; wherein, according to the contrast limitation, gradient direction continuity of each weak boundary, gradient direction continuity of the associated strong boundary of each weak boundary, and the distance between the associated strong boundary of each weak boundary and each weak boundary, the stretching parameters of each weak boundary are calculated, and according to the stretching parameters of each weak boundary, the mapping intervals of the pixel points in the stretching areas of each weak boundary are set. By judging whether the weak boundary is an important detail in the intermediate image according to the characteristics of different weak boundaries, by adjusting the mapping intervals of different weak boundaries according to the characteristics of different weak boundaries, and by analyzing and enhancing the weak boundaries representing the important details in the intermediate image, the details in the intermediate image can be made more prominent.

[0008] Preferably, the uniform illumination processing of the traffic monitoring image by the uniform illumination algorithm includes: filtering the traffic monitoring image through a Gaussian low-pass filter to obtain a background image simulating the brightness distribution; subtracting the traffic monitoring image from the background image to obtain an intermediate image.

[0009] Preferably, the screening of strong pixel points and weak pixel points according to the magnitude relationship between the gradient intensity of the pixel points and the upper threshold and the lower threshold includes: marking the pixel points with a gradient intensity greater than or equal to the upper threshold as strong pixel points, and marking the pixel points with a gradient intensity less than the upper threshold and greater than the lower threshold as weak pixel points.

[0010] Preferably, the screening of the weak pixel points that make up the weak boundary group according to whether there are strong pixel points in the 8-neighborhood of the weak pixel points includes: for the weak pixel point , if there are strong pixel points in the 8-neighborhood of the weak pixel point , divide the weak pixel point into the first group; if there are no strong pixel points in the 8-neighborhood of the weak pixel point , divide the weak pixel point into the second group; for the weak pixel points in the second group, if there are weak pixel points belonging to the first group in the 8-neighborhood of the weak pixel point , remove the weak pixel point from the second group and add it to the first group; mark the first group as the weak boundary group.

[0011] Preferably, the converting all pixel points in the strong boundary group and the weak boundary group into a plurality of strong boundaries and a plurality of weak boundaries respectively includes: converting all strong pixel points in the strong boundary group into a plurality of first chain codes; for any one of the first chain codes, forming a strong boundary by all the strong pixel points that make up the first chain code; converting all weak pixel points in the weak boundary group into a plurality of second chain codes; for any one of the second chain codes, forming a weak boundary by all the weak pixel points that make up the second chain code.

[0012] In the present invention, the pixel points in the weak boundary group are converted into a plurality of weak boundaries through chain codes, which can better capture and represent the texture information in the intermediate image.

[0013] Preferably, the calculating the gradient direction continuity of each strong boundary and each weak boundary includes: calculating the difference between the gradient directions of two adjacent strong pixel points in the strong boundary, and forming a gradient direction difference sequence of the strong boundary by all the differences in gradient directions; calculating the difference between the gradient directions of two adjacent weak pixel points in the weak boundary, and forming a gradient direction difference sequence of the weak boundary by all the differences in gradient directions; the difference between the gradient directions of two adjacent strong pixel points is equal to the absolute value of the difference between the gradient directions of two adjacent strong pixel points, and the difference between the gradient directions of two adjacent weak pixel points is equal to the absolute value of the difference between the gradient directions of two adjacent weak pixel points; the difference between the maximum value and the minimum value of the gradient direction difference sequence of the strong boundary and the ratio of is used as the gradient direction continuity of the strong boundary; the difference between the maximum value and the minimum value of the gradient direction difference sequence of the weak boundary and the ratio of is used as the gradient direction continuity of the weak boundary.

[0014] In the present invention, the gradient direction continuity of the weak boundary is used to judge whether the gradient directions on the weak boundary are consistent, and further judge whether the weak pixel points on the weak boundary belong to the same edge structure. The weak boundary with high gradient direction continuity is more likely to be a part of the real edge. By retaining these continuous weak boundaries, the intermediate detailed structure can be better reflected.

[0015] Preferably, the obtaining the associated strong boundary of each weak boundary according to the distance between the strong boundary and the weak boundary includes: for any one strong boundary and any one weak boundary, respectively calculating the Euclidean distance between the first strong pixel point of the strong boundary and the first weak pixel point of the weak boundary and the last weak pixel point, and respectively denoting them as and ; respectively calculating the Euclidean distance between the last strong pixel point of the strong boundary and the weak pixel point and the weak pixel point , and respectively denoting them as and ; Take the minimum value among , , , as the distance between the strong boundary and the weak boundary; for any weak boundary, take the strong boundary corresponding to the minimum value among the distances between all strong boundaries and this weak boundary as the associated strong boundary of this weak boundary.

[0016] According to the distance between the strong boundary and the weak boundary, the present invention screens out the associated strong boundary of the weak boundary from all strong boundaries. Through the associated strong boundary, it can be verified whether the weak boundary belongs to the real edge structure.

[0017] Preferably, setting the mapping interval of the pixel points in the stretching area of each weak boundary according to the stretching parameters of each weak boundary includes: the mapping interval of the pixel points in the stretching area of the weak boundary is , where and are the left and right boundaries of the mapping interval, and , , , are the minimum gray value and the maximum gray value in the stretching area of the weak boundary, is the stretching parameter of the weak boundary, is the maximum value function, and is the minimum value function.

[0018] By setting different mapping intervals for the pixel points in the stretching areas of different weak boundaries, the present invention improves the image quality of the traffic monitoring image after stretching processing, and further improves the accuracy of recognition and processing of the traffic monitoring image.

[0019] Preferably, the method for obtaining the stretching area of each weak boundary is: obtain the minimum circumscribed rectangle area of each weak boundary, and record the size of the minimum circumscribed rectangle area as ; expand the minimum circumscribed rectangle area of the weak boundary into a rectangle area with a size of , and the expanded rectangle area is centered on the center point of the original minimum circumscribed rectangle area; use the expanded rectangle area as the stretching area of the weak boundary.

[0020] In a second aspect, the present invention provides a real-time data acquisition system, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned real-time data acquisition method is implemented.

[0021] ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​By adopting the above technical solution, a computer program is generated from the above real-time data acquisition method and stored in a memory to be loaded and executed by a processor, so as to manufacture a terminal device according to the memory and the processor, which is convenient to use.

[0022] The beneficial effects of the present invention are as follows:

[0023] Aiming at the characteristic that the uneven illumination in the intermediate image is usually local, the present invention sets different mapping intervals for the pixel points in the stretching areas of each weak boundary and other pixel points in the intermediate image, and linearly stretches all the pixel points in the intermediate image according to the mapping intervals to obtain a traffic monitoring image with uniform illumination, solving the problem that global stretching cannot effectively process the illumination difference in local areas, resulting in the loss of details in the intermediate image, improving the image quality of the traffic monitoring image with uniform illumination obtained after stretching processing, and further improving the accuracy of recognition and processing of the traffic monitoring image; among them, according to the contrast limitation of each weak boundary, the gradient direction continuity, the gradient direction continuity of the associated strong boundary of each weak boundary, and the distance between the associated strong boundary of each weak boundary and each weak boundary, the stretching parameters of each weak boundary are calculated, and according to the stretching parameters of each weak boundary, the mapping intervals of the pixel points in the stretching areas of each weak boundary are set. Whether the weak boundary is an important detail in the intermediate image is judged by the characteristics of different weak boundaries, the mapping intervals of different weak boundaries are adjusted according to the characteristics of different weak boundaries, and by analyzing and enhancing the weak boundaries representing the important details in the intermediate image, the details in the intermediate image can be made more prominent. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the drawings, several embodiments of the present invention are shown in an exemplary rather than restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0025] Figure 1 is a flowchart schematically showing a real-time data acquisition method in the present invention;

[0026] Figure 2 is a schematic diagram schematically showing an electronic police monitoring system;

[0027] Figure 3 is a schematic diagram schematically showing a traffic monitoring image with uneven brightness distribution collected;

[0028] Figure 4 is schematically showing that through the MASK uniform illumination algorithm for Figure 3 the traffic monitoring image shown is subjected to uniform illumination processing, and a schematic diagram of the obtained intermediate image;

[0029] Figure 5 is a flowchart schematically showing step S2;

[0030] Figure 6 is a schematic diagram showing the traffic monitoring image after uniform illumination processing of the intermediate image shown by Figure 4 the 2% linear stretching method;

[0031] Figure 7 is a schematic diagram showing the traffic monitoring image after uniform illumination processing of the intermediate image shown by Figure 4 the method of the present invention; Detailed implementation manners

[0032] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0033] Next, the detailed implementation manners of the present invention will be described in detail with reference to the accompanying drawings.

[0034] An embodiment of the present invention discloses a real-time data acquisition method. Referring to Figure 1 , it includes steps S1 - S2:

[0035] S1. Real-time traffic monitoring images are collected through monitoring probes to monitor the vehicle passing conditions on the road.

[0036] The intelligent transportation system is the development direction of the future transportation system. It is a comprehensive transportation management system that effectively integrates advanced information technology, data communication and transmission technology, electronic sensing technology, control technology, computer technology, etc. into the entire ground traffic management system and plays a role in a large range and in multiple aspects, being real-time, accurate, and effective.

[0037] The electronic police monitoring system is an important part of the intelligent transportation system, mainly responsible for monitoring the traffic conditions of vehicles at each traffic light on the road: First, the electronic police monitoring system involves multiple monitoring points, and two monitoring probes are distributed at each monitoring point. The monitoring probes are high-definition digital cameras. Second, one of the monitoring probes is used to automatically capture vehicle violation images, and the other monitoring probe is used to collect monitoring videos in real time. The monitoring videos are composed of multiple frames of monitoring images. The vehicle violation images and monitoring videos are the basis for the traffic management bureau to provide vehicle violation records and are important measures to standardize road safety. Finally, the electronic police monitoring system directly forms a ring network for all the monitoring points involved with RIS5110. Considering the transmission bandwidth and future network upgrades, all ring networks adopt gigabit ring network transmission. A full-gigabit switch is used in the central computer room for data aggregation. The vehicle violation images and monitoring videos are transmitted through the ring network and stored in the database of the traffic management bureau.

[0038] The schematic diagram of the electronic police monitoring system is as Figure 2 shown.

[0039] In summary, traffic monitoring images are collected in real time through the monitoring probes of the intelligent transportation system to monitor the traffic conditions of vehicles on the road. The traffic monitoring images include vehicle violation images and each frame of images in the monitoring videos.

[0040] S2. Perform equalization processing on the traffic monitoring images through the equalization algorithm. For the obtained intermediate images, according to the stretching parameters of each weak boundary, linearly stretch the stretching regions of each weak boundary to obtain the equalized traffic monitoring images.

[0041] It should be noted that during the acquisition process of traffic monitoring images, due to factors such as lighting conditions, shooting angles, and weather conditions, the brightness distribution in traffic monitoring images is uneven, which seriously affects the quality of traffic monitoring images and increases the difficulty of identifying and processing traffic monitoring images. To eliminate this problem, it is considered to perform equalization processing on traffic monitoring images to obtain traffic monitoring images with uniform brightness, thereby ensuring the accuracy of identifying and processing traffic monitoring images.

[0042] Specifically, the MASK equalization algorithm can achieve the purpose of uniform brightness by enhancing high-frequency information and suppressing low-frequency information; perform equalization processing on traffic monitoring images through the MASK equalization algorithm to obtain intermediate images, including: filtering the traffic monitoring images through a Gaussian low-pass filter to obtain a background image simulating the brightness distribution; subtracting the traffic monitoring images from the background image to obtain intermediate images.

[0043] Exemplarily, due to the influence of factors such as lighting conditions, shooting angles, and weather conditions, the schematic diagram of the traffic monitoring images with uneven brightness distribution collected is asFigure 3 as shown; perform equalization on the traffic monitoring image shown by the MASK equalization algorithm, and the schematic diagram of the obtained intermediate image is as Figure 3 shown. Figure 4 as shown.

[0044] Among them, since the process of subtraction operation will reduce the gray range of the obtained intermediate image, reduce the overall contrast, and further cause the loss of local detail information, affecting the clarity and information content of the intermediate image. Therefore, it is necessary to stretch the contrast to enhance the local details of the intermediate image and improve the clarity and information content of the intermediate image. Commonly used stretching methods include linear stretching. Linear stretching is a global adjustment method that linearly maps the gray values of the intermediate image to a new range. However, the uneven illumination in the intermediate image is usually local, and global stretching cannot effectively process the illumination differences in local areas, resulting in the loss of details in the intermediate image and affecting the image quality of the equalized traffic monitoring image obtained after stretching processing, and further affecting the accuracy of the recognition and processing of traffic monitoring images.

[0045] To solve the problem that global stretching cannot effectively process the illumination differences in local areas, which will also cause the loss of details in the intermediate image, affect the image quality of the equalized traffic monitoring image obtained after stretching processing, and further affect the accuracy of the recognition and processing of traffic monitoring images, in step S2 of the present invention, for the obtained intermediate image: according to the size relationship between the gradient intensity of the pixel point and the upper threshold and the lower threshold, strong pixel points and weak pixel points are screened out; all strong pixel points are formed into a strong boundary group; according to whether there are strong pixel points in the 8-neighborhood of the weak pixel points, the weak pixel points that form the weak boundary group are screened out; all pixel points in the strong boundary group and the weak boundary group are respectively converted into multiple strong boundaries and multiple weak boundaries; calculate the gradient direction continuity of each strong boundary and each weak boundary; according to the distance between the strong boundary and the weak boundary, obtain the associated strong boundary of each weak boundary; calculate the contrast limitation of each weak boundary; calculate the stretching parameter of the weak boundary; according to the stretching parameter of each weak boundary, set the mapping interval of the pixel points in the stretching area of each weak boundary; set the mapping interval of other pixel points in the intermediate image to ; perform linear stretching on all pixel points in the intermediate image according to the mapping interval to obtain the equalized traffic monitoring image; the flowchart of step S2 refers to Figure 5 as shown in, including steps S201 to S206, specifically:

[0046] S201. According to the size relationship between the gradient intensity of the pixel point and the upper threshold and the lower threshold, screen out strong pixel points and weak pixel points; form all strong pixel points into a strong boundary group; according to whether there are strong pixel points in the 8-neighborhood of the weak pixel points, screen out the weak pixel points that form the weak boundary group.

[0047] It should be noted that the details in the intermediate image mainly refer to the texture information in the intermediate image, and the pixel points on the texture information show a certain gradient intensity; therefore, global stretching cannot effectively handle the illumination differences in local areas, resulting in the loss of details in the intermediate image, mainly resulting in the weakening of the contrast of pixel points with relatively weak gradient intensity. Therefore, the present invention calculates the gradient intensity of each pixel point, and divides all pixel points into strong pixel points and weak pixel points according to the magnitude relationship between the gradient intensity of the pixel point and the upper threshold and the lower threshold. Subsequently, the analysis is mainly carried out on the weak pixel points with relatively weak gradient intensity.

[0048] Specifically, through the Canny operator, calculate the gradient intensity and gradient direction of each pixel point in the intermediate image; set the upper threshold and the lower threshold; compare the gradient intensity of the pixel point with the upper threshold and the lower threshold, and divide all pixel points into strong pixel points and weak pixel points according to the magnitude relationship between the gradient intensity of the pixel point and the upper threshold and the lower threshold, including: the pixel points with gradient intensity greater than or equal to the upper threshold are recorded as strong pixel points, and the pixel points with gradient intensity less than the upper threshold and greater than the lower threshold are recorded as weak pixel points.

[0049] Among them, the specific values of the upper threshold and the lower threshold can be set according to the actual application scenario and requirements, and the value range of the upper threshold is [50, 120], and the value range of the lower threshold is [20, 50). In the present invention, the upper threshold is set to 80 and the lower threshold is set to 30.

[0050] Furthermore, all weak pixel points are divided into a first group and a second group according to whether there are strong pixel points in the 8-neighborhood of the weak pixel points, including: for the weak pixel points , judge whether there are strong pixel points in the 8-neighborhood of the weak pixel point . If there are strong pixel points in the 8-neighborhood of the weak pixel point , it means that the weak pixel point is directly connected to the strong pixel point, then the weak pixel point is divided into the first group; if there are no strong pixel points in the 8-neighborhood of the weak pixel point , it means that the weak pixel point is not directly connected to the strong pixel point, then the weak pixel point is divided into the second group.

[0051] Furthermore, the weak pixel points in the second group are updated according to whether there are weak pixel points belonging to the first group in the 8-neighborhood of the weak pixel points in the second group, including: for the weak pixel points in the second group, judge whether there are weak pixel points belonging to the first group in the 8-neighborhood of the weak pixel point . If there are weak pixel points belonging to the first group in the 8-neighborhood of the weak pixel point There are weak pixel points belonging to the first group within the 8-neighborhood of, indicating weak pixel points are connected to strong pixel points at intervals, then the weak pixel points are removed from the second group and added to the first group.

[0052] Finally, all strong pixel points are formed into a strong boundary group, and the first group is denoted as the weak boundary group.

[0053] S202: Respectively convert all pixel points in the strong boundary group and the weak boundary group into multiple strong boundaries and multiple weak boundaries, and calculate the gradient direction continuity of each strong boundary and each weak boundary.

[0054] It should be noted that the details in the intermediate image mainly refer to the texture information in the intermediate image, and the pixel points on the texture information show a certain continuity. The chain code can effectively represent this continuity, making the texture information more complete and coherent. Therefore, in the present invention, through the chain code, all pixel points in the weak boundary group are converted into multiple weak boundaries, and the gradient direction continuity of each weak boundary is calculated. Subsequently, the weak boundaries composed of weak pixel points with relatively weak gradient intensity are mainly analyzed.

[0055] Specifically, all strong pixel points in the strong boundary group are converted into multiple first chain codes, and the number of all obtained first chain codes is greater than or equal to 1; for any one first chain code, all strong pixel points constituting the first chain code form a strong boundary; all weak pixel points in the weak boundary group are converted into multiple second chain codes, and the number of all obtained second chain codes is greater than or equal to 1; for any one second chain code, all weak pixel points constituting the second chain code form a weak boundary.

[0056] Among them, the Freeman chain code is a coding representation method of the boundary, which describes the boundary through the coordinates of the starting point and the direction of the intermediate point; the commonly used chain codes are divided into 4-connected chain codes and 8-connected chain codes according to the number of adjacent directions of the central pixel point. The 4-connected chain code has 4 adjacent points, which are respectively above, below, left and right of the central pixel point. The 8-connected chain code adds 4 diagonal directions. Since there are 8 adjacent points around any pixel, and the 8-connected chain code exactly conforms to the actual situation of the pixel point, it can accurately describe the position information of the central pixel point and its adjacent points.

[0057] Further, calculate the difference in the gradient directions of two adjacent strong pixels in the strong boundary, and form a gradient direction difference sequence of the strong boundary by all the differences in the gradient directions; calculate the difference in the gradient directions of two adjacent weak pixels in the weak boundary, and form a gradient direction difference sequence of the weak boundary by all the differences in the gradient directions; the difference in the gradient directions of two adjacent strong pixels is equal to the absolute value of the difference in the gradient directions of two adjacent strong pixels, and the difference in the gradient directions of two adjacent weak pixels is equal to the absolute value of the difference in the gradient directions of two adjacent weak pixels.

[0058] Further, the difference between the maximum value and the minimum value of the gradient direction difference sequence of the strong boundary and The ratio of is used as the gradient direction continuity of the strong boundary; the difference between the maximum value and the minimum value of the gradient direction difference sequence of the weak boundary and The ratio of is used as the gradient direction continuity of the weak boundary; the value range of the gradient direction is , therefore, is used to normalize the difference between the maximum value and the minimum value of the gradient direction difference sequence, so that the value of the gradient direction continuity is within range.

[0059] It should be noted that the gradient direction continuity of the weak boundary refers to whether the gradient direction remains consistent on the weak boundary; if the gradient direction is continuous and consistent on the weak boundary, it means that the weak pixels on the weak boundary may belong to the same edge structure; the gradient direction continuity of the weak boundary is used to judge whether the gradient direction remains consistent on the weak boundary, and then judge whether the weak pixels on the weak boundary belong to the same edge structure. The weak boundary with high gradient direction continuity is more likely to be part of the real edge. By retaining these continuous weak boundaries, the intermediate detail structure can be better reflected.

[0060] S203. Obtain the associated strong boundary of each weak boundary according to the distance between the strong boundary and the weak boundary.

[0061] It should be noted that the associated strong boundary of the weak boundary refers to the strong boundary found within a certain distance range near the weak boundary; through the associated strong boundary, it can be verified whether the weak boundary belongs to the real edge structure.

[0062] Specifically, for any strong boundary and any weak boundary, calculate the distance between the strong boundary and the weak boundary, including: calculating the Euclidean distance between the first strong pixel of the strong boundary and the first weak pixel of the weak boundary and denoting it as ; calculating the Euclidean distance between the first strong pixel of the strong boundary and the last weak pixel of the weak boundary and denoting it as ; Calculate the Euclidean distance between the position coordinates of the last strong pixel of the strong boundary and the first weak pixel of the weak boundary and denote it as ; Calculate the Euclidean distance between the position coordinates of the last strong pixel of the strong boundary and the last weak pixel of the weak boundary and denote it as ; Take , , , The minimum value among them as the distance between the strong boundary and the weak boundary.

[0063] For any weak boundary, according to the distances between all strong boundaries and this weak boundary, obtain the associated strong boundary of this weak boundary, including: taking the strong boundary corresponding to the minimum value among the distances between all strong boundaries and this weak boundary as the associated strong boundary of this weak boundary.

[0064] S204. Calculate the contrast limitation of each weak boundary according to the ratio of the average gradient intensity of all weak pixels in each weak boundary and the average gradient intensity of all strong pixels in the associated strong boundary of each weak boundary.

[0065] Specifically, for any weak boundary, calculate the average gradient intensity of all weak pixels in the weak boundary and denote it as , calculate the average gradient intensity of all strong pixels in the associated strong boundary of this weak boundary and denote it as , and take the normalized result of as the contrast limitation of the weak boundary.

[0066] The normalized result is inversely proportional to ; In one embodiment, the normalized result of is ; In another embodiment, the normalized result of is where

[0067] represents the exponential function with the natural constant as the base, and

[0068] S205. Calculate the stretching parameter of each weak boundary according to the contrast limitation, gradient direction continuity of each weak boundary, gradient direction continuity of the associated strong boundary of each weak boundary, and the distance between the associated strong boundary of each weak boundary and each weak boundary.

[0069] Specifically, calculate the stretching parameter of each weak boundary according to the contrast limitation and gradient direction continuity of each weak boundary, gradient direction continuity of the associated strong boundary of each weak boundary, and the distance between the associated strong boundary of each weak boundary and each weak boundary. Then, the calculation formula for the stretching parameter of each weak boundary is:

[0070] ;

[0071] In the formula, is the stretching parameter of the weak boundary, is the contrast limitation of the weak boundary, is the gradient direction continuity of the weak boundary, is the gradient direction continuity of the associated strong boundary of the weak boundary, is the distance between the associated strong boundary of the weak boundary and the weak boundary, represents the exponential function with the natural constant as the base.

[0072] It should be noted that the greater the gradient direction continuity of the weak boundary, the more likely the weak pixel points on the weak boundary belong to the same edge structure; the smaller the distance between the associated strong boundary of the weak boundary and the weak boundary, the stronger boundary that can be found within a smaller range of the weak boundary, and the more likely the weak boundary belongs to the real edge structure. At the same time, the greater the gradient direction continuity of the associated strong boundary of the weak boundary, the more information the real edge structure corresponding to the strong boundary can express in the intermediate image, and the more important the strong boundary is. Correspondingly, the weak boundary connected to the strong boundary is more likely to belong to the real edge structure; for weak edges that are more likely to belong to the same real edge structure and have a greater contrast limitation, their stretching parameters are larger.

[0073] S206. Set the mapping interval of the pixel points in the stretching area of each weak boundary according to the stretching parameter of the weak boundary; set the mapping interval of the other pixel points in the intermediate image to [0, 255]; perform linear stretching on all the pixel points in the intermediate image according to the mapping interval to obtain the traffic monitoring image with uniform illumination.

[0074] Specifically, obtain the minimum circumscribed rectangle area of each weak boundary, and record the size of the minimum circumscribed rectangle area as ; expand the minimum circumscribed rectangle area of the weak boundary to a size of a rectangular area, and the expanded rectangular area is centered on the center point of the original minimum circumscribed rectangle area; the expanded rectangular area is used as the stretching area of the weak boundary.

[0075] Furthermore, according to the stretching parameters of each weak boundary, set the mapping interval for linearly stretching the stretching area of each weak boundary , where is the left boundary of the mapping interval, and , is the right boundary of the mapping interval, and , , are respectively the minimum gray value and the maximum gray value in the stretching area of the weak boundary, is the stretching parameter of the weak boundary, is the function to take the maximum value, is the function to take the minimum value.

[0076] Therefore, for the pixel points in the stretching area of each weak boundary, the mapping interval for linear stretching is , and for the other pixel points in the intermediate image except the pixel points in the stretching area of each weak boundary, the mapping interval for linear stretching is ; according to the mapping interval for linearly stretching each pixel point and the 2% linear stretching method, linearly stretch all the pixel points in the intermediate image to obtain the traffic monitoring image with uniform illumination.

[0077] Among them, the 2% linear stretching method is based on the gray histogram distribution. Take the gray value corresponding to the cumulative value of 2% in the gray histogram, denoted as , and take the gray value corresponding to the cumulative value of 98% in the gray histogram, denoted as ; when the gray value of the pixel point is less than , its mapped gray value , when the gray value of the pixel point is greater than , its mapped gray value , when the gray value of the pixel point is greater than or equal to and less than or equal to , its mapped gray value , , are respectively the left boundary and the right boundary of the mapping interval for linearly stretching the pixel point, is to round down.

[0078] It should be noted that the position of the gray value of the pixel point in the interval The gray value after mapping with pixel points Within the mapping interval Position Is the same, that is , therefore, the gray value after mapping .

[0079] Exemplarily, after performing equalization processing on the intermediate image shown by the 2% linear stretching method Figure 4 , the schematic diagram of the equalized traffic monitoring image obtained is as shown in Figure 6 ; After performing equalization processing on the intermediate image shown by the method of the present invention Figure 4 , the schematic diagram of the equalized traffic monitoring image obtained is as shown in Figure 7 .

[0080] It should be noted that the present invention aims at the characteristic that the uneven illumination in the intermediate image is usually local. By setting different mapping intervals for the pixel points in the stretching regions of each weak boundary and other pixel points in the intermediate image, and linearly stretching all the pixel points in the intermediate image according to the mapping intervals, an equalized traffic monitoring image is obtained, which solves the problem that global stretching cannot effectively process the illumination difference in local regions, resulting in the loss of details in the intermediate image, improves the image quality of the equalized traffic monitoring image obtained after stretching processing, and further improves the accuracy of recognition and processing of traffic monitoring images; Among them, according to the contrast limitation of each weak boundary, the gradient direction continuity, the gradient direction continuity of the associated strong boundary of each weak boundary, and the distance between the associated strong boundary of each weak boundary and each weak boundary, the stretching parameters of each weak boundary are calculated. According to the stretching parameters of each weak boundary, the mapping intervals of the pixel points in the stretching regions of each weak boundary are set. By judging whether the weak boundary is an important detail in the intermediate image through the characteristics of different weak boundaries, by adjusting the mapping intervals of different weak boundaries according to the characteristics of different weak boundaries, and by analyzing and enhancing the weak boundaries representing the important details in the intermediate image, the details in the intermediate image can be made more prominent.

[0081] The embodiment of the present invention also discloses a real-time data acquisition system, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, a real-time data acquisition method according to the present invention is implemented.

[0082] The above system also includes other components well known to those skilled in the art such as a communication bus and a communication interface. Their settings and functions are known in the art, so they will not be described in detail here.

[0083] In the description of this specification, the meanings of "a plurality of" and "several" are at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0084] Although this specification has shown and described several embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many variations, modifications, and alternative approaches will occur to those skilled in the art without departing from the spirit and scope of the present invention. It should be understood that alternative implementations of the embodiments of the present invention described herein may be employed in practicing the present invention.

Claims

1. A real-time data collection method, characterized in that: include: Traffic monitoring images are collected in real time through monitoring probes to monitor the traffic conditions of vehicles on the road; The traffic monitoring image is subjected to uniform light processing by a uniform light algorithm to obtain an intermediate image, including: filtering the traffic monitoring image by a Gaussian low-pass filter to obtain a background image with simulated brightness distribution; Subtract the traffic monitoring image from the background image to obtain an intermediate image; For the intermediate image obtained: According to the relationship between the gradient strength of the pixel point and the upper and lower limits of the threshold, strong pixels and weak pixels are screened out; all strong pixels are grouped into a strong boundary group; according to whether there are strong pixels in the 8-neighborhood of the weak pixel point, weak pixels forming a weak boundary group are screened out; all pixels in the strong boundary group and the weak boundary group are converted into multiple strong boundaries and multiple weak boundaries respectively; Calculate the gradient direction continuity of each strong boundary and each weak boundary; obtain the associated strong boundary of each weak boundary according to the distance between the strong boundary and the weak boundary; calculate the average value of the gradient strength of all weak pixels in the weak boundary And the average value of the gradient strength of all strong pixels in the associated strong boundary of the weak boundary ,Will The normalized result of is the contrast limitation of weak boundaries ; Calculate the stretch parameters of weak boundaries ; , They are respectively the gradient direction continuity of weak boundaries and the associated strong boundaries of weak boundaries, is the distance between the associated strong and weak boundaries of the weak boundary; According to the stretching parameters of the weak boundaries, the mapping interval of the pixels in the stretching area of ​​each weak boundary is set; the mapping interval of other pixels in the intermediate image is set to ; Linearly stretch all pixels in the intermediate image according to the mapping interval to obtain the traffic monitoring image after uniform illumination.

2. A real-time data collection method according to claim 1, characterized in that: The method of screening out strong pixels and weak pixels according to the relationship between the gradient strength of the pixel and the upper and lower limits of the threshold value includes: Pixels whose gradient strength is greater than or equal to the upper threshold are recorded as strong pixels, and pixels whose gradient strength is less than the upper threshold and greater than the lower threshold are recorded as weak pixels.

3. A real-time data collection method according to claim 1, characterized in that: The step of screening out weak pixels constituting a weak boundary group according to whether there are strong pixels in the 8-neighborhood of the weak pixel includes: For weak pixels If the weak pixel There are strong pixels in the 8-neighborhood of Divided into the first group; if the weak pixel There is no strong pixel in the 8-neighborhood of Divided into the second group; For the weak pixels in the second group If the weak pixel There are weak pixels belonging to the first group in the 8-neighborhood of removed from the second group and added to the first; The first group is recorded as the weak boundary group.

4. A real-time data collection method according to claim 1, characterized in that: The step of converting all pixel points in the strong boundary group and the weak boundary group into a plurality of strong boundaries and a plurality of weak boundaries respectively comprises: All strong pixel points in the strong boundary group are converted into multiple first chain codes; for any first chain code, all strong pixel points constituting the first chain code are formed into a strong boundary; all weak pixel points in the weak boundary group are converted into multiple second chain codes; for any second chain code, all weak pixel points constituting the second chain code are formed into a weak boundary.

5. A real-time data collection method according to claim 1, characterized in that: The step of calculating the continuity of the gradient direction of each strong boundary and each weak boundary includes: The difference in gradient direction between two adjacent strong pixels in a strong boundary is calculated, and all the differences in gradient direction are combined into a gradient direction difference sequence of the strong boundary; the difference in gradient direction between two adjacent weak pixels in a weak boundary is calculated, and all the differences in gradient direction are combined into a gradient direction difference sequence of the weak boundary; The difference between the maximum and minimum values ​​of the gradient direction difference sequence of the strong boundary is The ratio of is taken as the gradient direction continuity of the strong boundary; the difference between the maximum and minimum values ​​of the gradient direction difference sequence of the weak boundary is compared with The ratio of is taken as the gradient direction continuity of the weak boundary.

6. A real-time data collection method according to claim 1, characterized in that: The step of obtaining the associated strong boundaries of each weak boundary according to the distance between the strong boundary and the weak boundary includes: For any strong boundary and any weak boundary, calculate the first strong pixel point of the strong boundary respectively. The first weak pixel with weak boundary And the last weak pixel The Euclidean distance of the position coordinates of and ; Calculate the last strong pixel point of the strong boundary respectively With weak pixels And weak pixels The Euclidean distance of the position coordinates of and ;Will , , , The minimum value in is taken as the distance between the strong boundary and the weak boundary; For any weak boundary, the strong boundary corresponding to the minimum value of the distances between all strong boundaries and the weak boundary is taken as the associated strong boundary of the weak boundary.

7. A real-time data collection method according to claim 1, characterized in that: The step of setting the mapping interval of the pixel points in the stretching area of ​​each weak boundary according to the stretching parameters of each weak boundary includes: The mapping interval of the pixels in the stretched area of ​​the weak boundary is ,in, , are the left and right boundaries of the mapping interval, and , , , are the minimum and maximum grayscale values ​​in the stretched area of ​​the weak boundary, is the stretching parameter of the weak boundary, To obtain the maximum value function, is the minimum value function.

8. A real-time data collection method according to claim 1, characterized in that: The method for obtaining the stretching area of ​​each weak boundary is: Get the minimum bounding rectangle area of ​​each weak boundary, and record the size of the minimum bounding rectangle area as ; Expand the minimum bounding rectangle of the weak border to a size of The expanded rectangular area is centered on the center point of the original minimum circumscribed rectangular area; the expanded rectangular area is used as the stretching area of ​​the weak boundary.

9. A real-time data acquisition system, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a real-time data acquisition method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Mask-based water conveyance tunnel underwater crack image enhancement method

    CN117575967A

  • Canny edge detection method based on bilateral filtering and adaptive threshold

    CN117853510A

  • Liver cancer pathology image enhancement method based on artificial intelligence

    CN118297812A