A big data processing method for urban and rural planning
By analyzing the probability of moving objects and shadow outlines in nighttime images, and combining optical flow and neural networks, the problem of blurred pedestrian features in nighttime images was solved, achieving accurate pedestrian flow statistics and reducing equipment costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING QIMU TECHNOLOGY CO LTD
- Filing Date
- 2026-03-12
- Publication Date
- 2026-06-09
AI Technical Summary
The degraded image quality at night leads to blurred pedestrian features, and traditional methods misidentify shadows as pedestrians, resulting in inaccurate pedestrian flow statistics. In addition, high-performance camera equipment is expensive and complex to maintain.
By analyzing the grayscale differences of each pixel in consecutive frames of nighttime images, the contour points of moving objects are identified. The amount of pixel movement is calculated using optical flow, the probability of shadow contours is evaluated, and a neural network is used for pedestrian detection and counting. The probability of shadow contours being pedestrian contours is corrected, and image enhancement is performed.
It improves the clarity of pedestrian outline recognition in nighttime images, accurately counts pedestrian flow, and reduces equipment costs and maintenance complexity.
Smart Images

Figure CN122176635A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image enhancement technology, and more specifically to a big data processing method for urban and rural planning. Background Technology
[0002] Cameras and sensors are deployed in urban and rural public spaces such as streets, squares, parks, and transportation hubs to collect pedestrian activity data. By extracting pedestrian numbers, flow rates, trajectories, and behavioral characteristics from video footage, high-risk accident areas and congested road sections can be effectively identified, providing a basis for new construction or renovation and enabling more human-centered spatial design. Nighttime is a critical period for emergencies, and traditional urban and rural planning has neglected the safety and functionality of public spaces at night. However, in situations with low visibility at night, image quality deteriorates significantly, leading to blurred pedestrian features. Shadows caused by moving light sources in the nighttime environment can easily be misidentified as pedestrians, resulting in significant errors in pedestrian flow statistics.
[0003] Currently, commonly used technologies include high-performance infrared and thermal imaging cameras. However, high-performance camera equipment requires the deployment of infrastructure such as power supply, which is costly and complex to maintain. While commonly used algorithms include illumination compensation techniques, the enhancement effect is unsatisfactory in nighttime images due to the influence of light sources on pedestrian areas, leading to inaccurate pedestrian flow statistics in the enhanced images. Summary of the Invention
[0004] To address the aforementioned problems, this invention provides a big data processing method for urban and rural planning.
[0005] The present invention provides a big data processing method for urban and rural planning, which adopts the following technical solution: One embodiment of the present invention provides a big data processing method for urban and rural planning, the method comprising the following steps: Acquire each frame of nighttime image; Obtain the degree of change of each pixel in each frame of the night image; based on the degree of change of each pixel in each frame of the night image, obtain the contour points of possible moving objects in each frame of the night image; perform a closing operation on the contour points of possible moving objects in each frame of the night image to obtain the contours of each frame of the night image. Obtain the probability that each contour in each frame of the night image is a pedestrian contour; obtain the movement amount of each pixel on each contour in each frame of the night image; based on the probability that each contour in each frame of the night image is a pedestrian contour and the movement amount of each pixel on each contour in each frame of the night image, obtain the probability that each contour in each frame of the night image is a shadow contour; based on the probability that each contour in each frame of the night image is a shadow contour, obtain each shadow contour in each frame of the night image and the probability of each shadow contour in each frame of the night image. Based on the probability of each shadow contour in each frame of night image, obtain the corrected probability that the contour closest to each shadow contour in each frame of night image is the pedestrian contour. Based on the correction probability of the contour closest to each shadow contour in each night image frame as the pedestrian contour, the correction enhancement scale of each contour point in each night image frame is obtained; based on the correction enhancement scale of each contour point in each night image frame, the enhanced image of each night image frame is obtained, and a neural network is used to perform pedestrian detection and counting on the enhanced image to obtain the pedestrian flow statistics.
[0006] Preferably, the specific steps for obtaining the degree of change of each pixel in each frame of the night image are as follows: In the formula, Representing the The first frame of the night image The degree of change in each pixel; Indicates the first The first frame of the night image The grayscale value of each pixel; Representing the The first frame of the night image The grayscale value of each pixel; Representing the The first frame of the night image The amount of grayscale value change per pixel; Representing the Frame Night Image and the First The maximum value among the changes in grayscale values of all corresponding pixels between frames of nighttime images; It is the absolute value symbol; To prevent extremely small positive numbers with a denominator of zero.
[0007] Preferably, the specific steps for obtaining the contour points of possible moving objects in each frame of the night image based on the degree of change of each pixel in each frame of the night image are as follows: Preset change threshold, when the first If the degree of change of any pixel in a nighttime image exceeds a change threshold, that pixel is considered a contour point that may be a moving object.
[0008] Preferably, the specific steps for obtaining the probability that each contour of each frame of the night image is a pedestrian contour are as follows: In the formula, Representing the The first frame of the night image The probability that a silhouette is a pedestrian silhouette; Representing the The first frame of the night image The variance of grayscale values of all pixels on a contour; This represents the reference area of the pedestrian outline, pre-defined based on the resolution of the nighttime image. Representing the The first frame of the night image The area of a contour; || is the absolute value symbol, and exp() is an exponential function with the natural constant as the base.
[0009] Preferably, the specific steps for obtaining the movement amount of each pixel on each contour in each frame of the night image are as follows: Preset number of reference frames , get the The front of the night image Frame of nighttime image, as the first The reference frame image for the nighttime image, for the first frame The first frame of the night image On the first contour The pixel is obtained using optical flow. The position of the reference frame image in the night image, at the number From the reference frame image of the nighttime image, obtain the first... The average distance between the positions of the nth pixel in all adjacent reference frames is used to represent the nth pixel. The first frame of the night image On the first contour The amount of movement per pixel.
[0010] Preferably, the specific steps for obtaining the probability that each contour in each night frame is a shadow contour based on the probability that each contour in each night frame is a pedestrian contour and the amount of movement of each pixel on each contour in each night frame include the following: In the formula, Representing the The first frame of the night image The probability that a contour is a shadow contour; Representing the The first frame of the night image On the first contour The amount of movement per pixel; Representing the The first frame of the night image The number of pixels on each contour; Representing the The first frame of the night image The probability that a silhouette is a pedestrian silhouette; Representing the The first frame of the night image The maximum amount of movement of all pixels on a contour; This is the normalization function; To prevent extremely small positive numbers with a denominator of zero.
[0011] Preferably, the specific steps for obtaining each shadow contour in each night frame and the probability of each shadow contour in each night frame based on the probability that each contour in each night frame is a shadow contour are as follows: A preset shadow probability threshold is set. For any contour, if the probability that the contour is a shadow contour is greater than the shadow probability threshold, the contour is a shadow contour. The probability that the contour is a shadow contour is recorded as the probability of the shadow contour.
[0012] Preferably, the specific steps for obtaining the corrected probability that the contour closest to each shadow contour in each night frame is the pedestrian contour, based on the probability of each shadow contour in each night frame image, are as follows: In the formula, min() represents the minimum value function. Indicates the first The first frame of the night image The probability of a shadow outline; Indicates the first In the nighttime image of the first frame The probability that the nearest contour to a shadow contour is a pedestrian contour; Indicates the first In the nighttime image of the first frame The nearest contour to the shadow contour is the correction probability of the pedestrian contour; This is the normalization function.
[0013] Preferably, the specific steps for obtaining the correction enhancement scale of each contour point in each night frame image based on the correction probability of the contour closest to each shadow contour in each night frame image are as follows: The pixel on the contour closest to the shadow contour in each frame of the night image is recorded as the contour point of each frame of the night image. In the formula, Representing the The first frame of the night image The scale is enhanced by correcting and strengthening the contour points; Representing the The first frame of the night image The grayscale value of each contour point; Indicates the first The maximum grayscale value among all contour points in a frame of nighttime image; Representing the The first frame of the night image The contour to which each contour point belongs is the corrected probability of the pedestrian contour. It represents an exponential function with the natural constant as its base.
[0014] Preferably, the specific steps for obtaining the enhanced image of each nighttime image frame based on the corrected enhancement scale of each contour point in each nighttime image frame are as follows: Using an illumination compensation algorithm, each contour point in each nighttime image is enhanced according to the correction and enhancement scale of each contour point in each nighttime image, resulting in an enhanced image of each nighttime image.
[0015] The beneficial effects of the technical solution of this invention are as follows: This invention obtains the degree of change of each pixel in each frame of nighttime images based on the difference in grayscale values of each pixel in consecutive frames of nighttime images. Pixels with large differences in grayscale values may be contour points of moving objects. Subsequently, each contour is obtained based on the contour points of moving objects, and each contour is analyzed to obtain the probability that each contour is a pedestrian contour. Based on the probability that each contour in each frame of nighttime images is a pedestrian contour and the amount of movement of each pixel on each contour in each frame of nighttime images, the probability that each contour in each frame of nighttime images is a shadow contour is obtained. The probability of each shadow contour in each night image and each shadow contour in each frame of the night image is obtained. Then, the probability that the contour closest to each shadow contour in each frame of the night image is a pedestrian contour is corrected to obtain the corrected probability that the contour closest to each shadow contour is a pedestrian contour. Then, based on the corrected probability that the contour closest to each shadow contour in each frame of the night image is a pedestrian contour, the enhancement scale of the contour points on each contour is corrected, so that the enhancement scale of the pedestrian contour points is increased, and the enhanced pedestrian contours can be more clearly identified. Therefore, the pedestrian flow at this time can be more accurately calculated based on the pedestrian contours. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the steps of a big data processing method for urban and rural planning according to the present invention. Detailed Implementation
[0018] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a big data processing method for urban and rural planning proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0020] The following description, in conjunction with the accompanying drawings, details a specific scheme for a big data processing method for urban and rural planning provided by the present invention.
[0021] Please see Figure 1 The diagram illustrates a flowchart of a big data processing method for urban and rural planning according to an embodiment of the present invention. The method includes the following steps: S001. Acquire each frame of nighttime image.
[0022] It should be noted that the process involves acquiring nighttime video footage from surveillance cameras, obtaining each frame of the nighttime image from the video, and then converting each frame of the nighttime image to grayscale to obtain multiple frames of nighttime images.
[0023] S002. Based on the grayscale differences of pixels between consecutive night images, obtain the degree of change of each pixel in each night image, and then obtain the contour points of all possible moving objects in each night image and each contour of each night image.
[0024] It should be noted that when illumination compensation enhances nighttime images, it is first necessary to obtain the enhancement scale of each pixel in the nighttime image, that is, the ratio of the gray value of each pixel to the highest gray value in the image. Based on the product of the enhancement scale and the gray value of each pixel, the enhanced gray value of each pixel is obtained, thus completing the enhancement of the nighttime image. However, for nighttime images, the gray value of pedestrian areas may be low, and the highest gray value in the nighttime image may be large due to the influence of light sources. Therefore, for pixels in pedestrian areas of nighttime images, the obtained enhancement scale is low, and the enhancement effect is not ideal.
[0025] Furthermore, since people are moving objects in the acquired nighttime video, and the movement of objects will cause changes in the grayscale values of pixels at the same position in consecutive frames of nighttime images, pixels with larger grayscale value changes are more likely to be the contour points of moving objects in the image. Therefore, in this embodiment of the invention, the degree of change of each pixel in each frame of nighttime image is obtained based on the difference in grayscale values of each pixel in consecutive frames of nighttime images, and pixels with larger grayscale value differences may be the contour points of moving objects. Subsequently, each contour is obtained based on the contour points of moving objects, and then each contour is analyzed.
[0026] First, it is necessary to obtain the degree of change of each pixel in each frame of the night image based on the difference in grayscale value of each pixel in consecutive frames of night images.
[0027] In this embodiment of the invention, the first... The degree of change of each pixel in the nighttime image: In the formula, Representing the The first frame of the night image The degree of change in each pixel; Indicates the first The first frame of the night image The grayscale value of each pixel; Representing the The first frame of the night image The grayscale value of each pixel; Representing the The first frame of the night image The amount of grayscale value change per pixel; Indicates the first The first frame of the image The degree of change in each pixel; To prevent extremely small positive numbers with a denominator of zero, the value is set to 0.0001 in this embodiment.
[0028] Representing the Frame Night Image and the First The maximum value among the changes in grayscale values of all corresponding pixels between frames of nighttime images; when A larger value indicates a greater change in the grayscale value of that pixel in consecutive nighttime images. The first frame of the night image Each pixel may be a contour point of a moving object.
[0029] Thus, the first [number] was obtained. The degree of change of each pixel in a frame of nighttime image, with a preset change threshold. When the first When the degree of change of a pixel in a nighttime image exceeds a change threshold, the pixel is considered to be a contour point of a moving object. This completes the process for obtaining the [number of frames]. In the nighttime image frame, there may be outline points of moving objects. The change threshold α is used to filter moving pixels, and its value range is usually [0.3, 0.7]. It can be obtained by statistically analyzing the grayscale changes of static backgrounds and moving targets in historical video data. In this embodiment of the invention, the preset change threshold... After experimental verification At the same time, it can effectively filter out most noise interference and preserve the contour of the moving target. In other embodiments, implementers can set a preset change threshold according to the specific implementation situation. The value of .
[0030] It should be further explained that, since the contour points of all moving objects in each frame of the night image are obtained, there may be breaks between the contour points of the moving objects. Therefore, in this embodiment of the invention, a closing operation is performed on the contour points of all moving objects in each frame of the night image to connect the discontinuous contour points of the moving objects and obtain each complete contour.
[0031] Thus, based on the grayscale differences of pixels between consecutive night images, the degree of change of each pixel in each night image is obtained, thereby obtaining the contour points of all possible moving objects in each night image and each contour of each night image.
[0032] S003. Obtain the probability that each contour of each frame of the night image is a pedestrian contour.
[0033] It should be noted that the contours of each frame of the night image may be pedestrian contours, pedestrian shadow contours, or contours of other moving objects. Since the goal is to count the number of pedestrians, it is necessary to obtain the probability that each contour of each frame of the night image is a pedestrian contour. Based on the probability that each contour is a pedestrian contour, the enhancement scale of the contour points on each contour is corrected, so that the enhancement scale of the human contour points is increased. After enhancement, the human contours can be identified, making the count of people more accurate.
[0034] Furthermore, since pedestrians are roughly the same size in nighttime images, meaning their outlines are close to a specific area, a reference area for pedestrian outlines is pre-set based on the resolution of the nighttime image. The closer the area of any outline in the nighttime image is to the pre-set reference area, the greater the probability that the outline belongs to a pedestrian outline. Also, since the grayscale values of pixels on a pedestrian outline are similar, while for shadow outlines, the grayscale values may gradually change as they extend from the pedestrian's feet to their head, a smaller variance in the grayscale values of pixels on any outline in the nighttime image indicates that the outline is very likely to be a pedestrian outline. Therefore, in this embodiment of the invention, the probability that each outline in each frame of the nighttime image is a pedestrian outline is obtained based on the area of each outline in each frame of the nighttime image and the variance in the grayscale values of pixels on each outline.
[0035] In this embodiment of the invention, the first... The first frame of the night image The probability that a given silhouette is a pedestrian silhouette: In the formula, Representing the The first frame of the night image The probability that a silhouette is a pedestrian silhouette; Representing the The first frame of the night image The variance of grayscale values of all pixels on a contour; This represents the reference area of the pedestrian outline, pre-defined based on the resolution of the nighttime image. Representing the The first frame of the night image The area of each contour; || is the absolute value symbol, and exp() is an exponential function with the natural constant as the base. The difference is mapped to the interval (0,1] using the exponential function. The closer the area is to the reference area and the smaller the gray variance, the closer the probability is to 1.
[0036] When the The first frame of the night image The smaller the difference between the area of the first contour and the pre-defined reference area of the pedestrian contour, and the smaller the variance of the grayscale values of the pixels on the contour, the better the first contour is considered to be. The first frame of the night image The higher the probability that a given outline is a pedestrian outline, the greater the reference area of the preset pedestrian outline in this embodiment of the invention. An adaptive setting is made based on the resolution of the nighttime image, specifically 0.5% of the total number of pixels in the nighttime image, to accommodate the differences in pedestrian image size in videos with different resolutions. In other embodiments of the invention, the implementer may also set the setting based on the depth information calibrated by the camera; this invention does not impose any limitations on this.
[0037] Thus, the probability that each contour of each frame of the nighttime image is a pedestrian contour was obtained.
[0038] S004. Obtain the probability that each contour of each frame of the night image is a shadow contour, and obtain all shadow contours of each frame of the image.
[0039] It should be noted that shadows always accompany people and that shadows change around the pedestrian's feet as the position of the person and the light source changes. By analyzing the positional information of each contour in multiple frames of images, when the positional information of each pixel on each contour in a night image changes in adjacent night images, it indicates that the contour is more likely to be a shadow contour. If it is a pedestrian contour, then the positional information of each point on its contour is almost unchanged. Therefore, by combining the positional information changes of each pixel on each contour in the night image and the probability that each contour is a pedestrian contour, the probability that each contour in the night image is a shadow contour can be obtained.
[0040] In this embodiment of the invention, the first... The first frame of the night image On the first contour Movement per pixel: Number of preset reference frames , get the The front of the night image Frame of nighttime image, as the first The reference frame image for the nighttime image, for the first frame The first frame of the night image On the first contour The pixel is obtained using optical flow. The position of the reference frame image in the night image, at the number From the reference frame image of the nighttime image, obtain the first... The average distance between the positions of the nth pixel in all adjacent reference frames is used to represent the nth pixel. The first frame of the night image On the first contour The amount of movement per pixel.
[0041] In this embodiment of the invention, the Farneback dense optical flow method is used to calculate the movement of pixels. Specific parameter settings include: a pyramid scaling factor of 0.5, 3 layers, a window size of 15, 3 iterations, a polynomial neighborhood size of 5, a standard deviation of 1.2, a flag of 0, and a preset number of reference frames. In other embodiments, implementers may set the specific implementation method as required. The value of .
[0042] Get the The probability that each contour in a frame of a nighttime image is a shadow contour: In the formula, Representing the The first frame of the night image The probability that a contour is a shadow contour; This represents a linear normalization function that linearly maps input values to the interval [0,1]. Representing the The first frame of the night image On the first contour The amount of movement per pixel; Representing the The first frame of the night image The number of pixels on each contour; Representing the The first frame of the night image The probability that a silhouette is a pedestrian silhouette; Representing the The first frame of the night image The maximum amount of movement of all pixels on a contour; This is a preset minimum positive constant, which is set to 0.001 in this application, to prevent a division-by-zero error when the maximum movement is 0 due to the contour being completely stationary.
[0043] Since shadow silhouettes usually appear alongside pedestrians and their textures and shapes are highly variable, while pedestrian silhouettes are relatively stable, the probability of a silhouette being identified as a pedestrian silhouette is... When the pixel density is low and the average pixel movement between consecutive frames is large, the contour is more likely to be a dynamic shadow contour. Therefore, by... Evaluate the probability of the shadow outline.
[0044] Thus, the first [number] was obtained. The probability that each contour in a nighttime image is a shadow contour.
[0045] In this embodiment of the invention, a preset shadow probability threshold is used. When the first When the probability that any contour in the nighttime image is a shadow contour is greater than the shadow probability threshold, the 1st... The contour in the nighttime image is a shadow contour. The probability that this contour is a shadow contour is denoted as the probability of this shadow contour. This yields the probability of the first frame. In this embodiment of the invention, the shadow contours and probabilities of each shadow contour in a frame of nighttime image are determined by a preset shadow probability threshold. In other embodiments, implementers may set the following according to the specific implementation situation. The value of .
[0046] Thus, based on the probability that each contour of each nighttime image is a shadow contour, all shadow contours of each image frame are obtained.
[0047] S005. Based on the probability of each shadow contour in each frame of the night image, obtain the corrected probability that the contour closest to each shadow contour in each frame of the night image is the pedestrian contour.
[0048] It should be noted that step S004 above obtains the shadow contours in each frame of the night image. It is known that for each shadow, there is a corresponding object. Therefore, for each shadow contour in each frame of the night image, the probability that the contour closest to the shadow contour is a pedestrian contour is greater. Therefore, based on the probability of each shadow contour, the probability that the contour closest to it is a pedestrian contour is corrected. When the probability of the shadow contour is greater, the probability that the contour closest to that shadow contour is a pedestrian contour is greater.
[0049] Specifically, the method for obtaining the contour closest to the shadow contour is as follows: calculate the Euclidean distance between each shadow contour and all other non-shadow contours, specifically defined as the distance between the centroids of the two contours. The centroid of the contour is obtained by calculating the mean value of the coordinates of all pixels of the contour. Then, for each shadow contour, select the non-shadow contour with the smallest distance to its centroid.
[0050] In this embodiment of the invention, the first... The probability that the contour closest to each shadow contour in a nighttime image frame is the corrected pedestrian contour is: In the formula, min() represents the minimum value function. Indicates the first The first frame of the night image The probability of a shadow outline; Indicates the first In the nighttime image of the first frame The probability that the nearest contour to a shadow contour is a pedestrian contour; Indicates the first In the nighttime image of the first frame The nearest contour to the shadow contour is the correction probability of the pedestrian contour; This is the normalization function.
[0051] Thus, based on the probability of each shadow contour in each frame of the night image, the corrected probability that the contour closest to each shadow contour in each frame of the night image is the pedestrian contour is obtained.
[0052] S006. Based on the correction probability that the contour closest to each shadow contour in each frame of the night image is the pedestrian contour, obtain the correction enhancement scale for each contour point.
[0053] It should be noted that when the probability of the nearest contour to each shadow contour in each night image being a pedestrian contour is higher, it means that the nearest contour to each shadow contour is more likely to be a pedestrian contour. Therefore, the enhancement scale of the contour points on the nearest contour to each shadow contour is larger. Thus, the enhancement scale of the contour points on the nearest contour to each shadow contour is obtained by combining the correction probability of the nearest contour to each shadow contour in each night image being a pedestrian contour.
[0054] In this embodiment of the invention, the pixel point on the contour closest to the shadow contour in each frame of night image is recorded as the contour point of each frame of night image; Get the Scale of enhancement for each contour point in the nighttime image: In the formula, Representing the The first frame of the night image The scale is enhanced by correcting and strengthening the contour points; Representing the The first frame of the night image The grayscale value of each contour point; Indicates the first The maximum grayscale value among all contour points in a frame of nighttime image; Representing the The first frame of the night image The enhancement factor for each contour point, the value of which varies with the gray value. The decrease in volume increases the volume, thus enhancing the darker areas more significantly; Representing the The first frame of the night image The contour to which the i-th contour point belongs is the corrected probability of the pedestrian contour. The first frame of the night image The higher the probability that the contour to which the first contour point belongs is a pedestrian contour, the better the correction for the first contour point. The first frame of the night image The greater the degree of correction to the initial enhancement scale of the first contour point, the greater the effect of the second contour point. The first frame of the night image The larger the enhancement scale after the correction of each contour point, the greater the enhancement scale.
[0055] Modified Enhancement Scale In the initial enhancement coefficient Based on this, the probability of its corresponding contour being a pedestrian contour is corrected. Nonlinear enhancement is performed. The reason for using an exponential function is that: when... When the probability is close to 1 (high probability of a pedestrian), it produces a significant enhancement effect, effectively improving the visibility of pedestrians in dark areas; when... When the value is close to 0, the enhancement effect is weak, avoiding over-enhancement of non-pedestrian areas. The divisor '2' is used to adjust the slope of the enhancement curve and is an experimentally optimized smoothing factor.
[0056] Thus, the enhancement scale of each contour point was obtained based on the correction probability that the contour closest to each shadow contour in each frame of the night image is the pedestrian contour.
[0057] S007. Enhance the nighttime image according to the enhancement scale of each contour point, and identify pedestrian flow based on the enhanced image.
[0058] In this embodiment of the invention, an illumination compensation algorithm is used to enhance each contour point in each night image according to the corrected enhancement scale of each contour point in each night image, thereby obtaining an enhanced image of each night image. The number of pedestrians in the enhanced image is counted using neural network technology. The use of neural network technology to count the number of pedestrians in the enhanced image is a well-known technique, and will not be described in detail in this invention.
[0059] This completes the enhancement of the nighttime images, and the number of pedestrians is then counted based on the enhanced images.
[0060] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A big data processing method for urban and rural planning, characterized in that, The method includes the following steps: Acquire each frame of nighttime image; Obtain the degree of change of each pixel in each frame of the night image; based on the degree of change of each pixel in each frame of the night image, obtain the contour points of possible moving objects in each frame of the night image; perform a closing operation on the contour points of possible moving objects in each frame of the night image to obtain the contours of each frame of the night image. Obtain the probability that each contour in each frame of the night image is a pedestrian contour; obtain the movement amount of each pixel on each contour in each frame of the night image; based on the probability that each contour in each frame of the night image is a pedestrian contour and the movement amount of each pixel on each contour in each frame of the night image, obtain the probability that each contour in each frame of the night image is a shadow contour; based on the probability that each contour in each frame of the night image is a shadow contour, obtain each shadow contour in each frame of the night image and the probability of each shadow contour in each frame of the night image. Based on the probability of each shadow contour in each frame of night image, obtain the corrected probability that the contour closest to each shadow contour in each frame of night image is the pedestrian contour. Based on the correction probability of the contour closest to each shadow contour in each night image frame as the pedestrian contour, the correction enhancement scale of each contour point in each night image frame is obtained; based on the correction enhancement scale of each contour point in each night image frame, the enhanced image of each night image frame is obtained, and a neural network is used to perform pedestrian detection and counting on the enhanced image to obtain the pedestrian flow statistics.
2. The big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining the degree of change of each pixel in each frame of the night image are as follows: In the formula, Representing the The first frame of the night image The degree of change in each pixel; Indicates the first The first frame of the night image The grayscale value of each pixel; Representing the The first frame of the night image The grayscale value of each pixel; Representing the The first frame of the night image The amount of grayscale value change per pixel; Representing the Frame Night Image and the First The maximum value among the changes in grayscale values of all corresponding pixels between frames of nighttime images; It is the absolute value symbol; To prevent extremely small positive numbers with a denominator of zero.
3. The big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining the contour points of potentially moving objects in each frame of the night image based on the degree of change of each pixel are as follows: Preset change threshold, when the first If the degree of change of any pixel in a nighttime image exceeds a change threshold, that pixel is considered a contour point that may be a moving object.
4. The big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining the probability that each contour of each frame of the night image is a pedestrian contour are as follows: In the formula, Representing the The first frame of the night image The probability that a silhouette is a pedestrian silhouette; Representing the The first frame of the night image The variance of grayscale values of all pixels on a contour; This represents the reference area of the pedestrian outline, pre-defined based on the resolution of the nighttime image. Representing the The first frame of the night image The area of a contour; || is the absolute value symbol, and exp() is an exponential function with the natural constant as the base.
5. The big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining the movement of each pixel on each contour in each frame of the night image are as follows: Preset number of reference frames , get the The front of the night image Frame of nighttime image, as the first The reference frame image for the nighttime image, for the first frame The first frame of the night image On the first contour The pixel is obtained using optical flow. The position of the reference frame image in the night image, at the number From the reference frame image of the nighttime image, obtain the first... The average distance between the positions of the nth pixel in all adjacent reference frames is used to represent the nth pixel. The first frame of the night image On the first contour The amount of movement per pixel.
6. The big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining the probability that each contour in each night frame is a shadow contour based on the probability that each contour in each night frame is a pedestrian contour and the amount of movement of each pixel on each contour in each night frame are as follows: In the formula, Representing the The first frame of the night image The probability that a contour is a shadow contour; Representing the The first frame of the night image On the first contour The amount of movement per pixel; Representing the The first frame of the night image The number of pixels on each contour; Representing the The first frame of the night image The probability that a silhouette is a pedestrian silhouette; Representing the The first frame of the night image The maximum amount of movement of all pixels on a contour; This is the normalization function; To prevent extremely small positive numbers with a denominator of zero.
7. The big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining each shadow contour in each night image frame and the probability of each shadow contour in each night image frame based on the probability that each contour in each night image frame is a shadow contour are as follows: A preset shadow probability threshold is set. For any contour, if the probability that the contour is a shadow contour is greater than the shadow probability threshold, the contour is a shadow contour. The probability that the contour is a shadow contour is recorded as the probability of the shadow contour.
8. The big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining the corrected probability of the pedestrian contour being the contour closest to each shadow contour in each night frame image based on the probability of each shadow contour in each night frame are as follows: In the formula, min{} represents the minimum value function. Indicates the first The first frame of the night image The probability of a shadow outline; Indicates the first In the nighttime image of the first frame The probability that the nearest contour to a shadow contour is a pedestrian contour; Indicates the first In the nighttime image of the first frame The nearest contour to the shadow contour is the correction probability of the pedestrian contour; This is the normalization function.
9. A big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining the correction enhancement scale of each contour point in each night image frame based on the correction probability of the contour closest to each shadow contour in each night image frame are as follows: The pixel on the contour closest to the shadow contour in each frame of the night image is recorded as the contour point of each frame of the night image. In the formula, Representing the The first frame of the night image The scale is enhanced by correcting and strengthening the contour points; Representing the The first frame of the night image The grayscale value of each contour point; Indicates the first The maximum grayscale value among all contour points in a frame of nighttime image; Representing the The first frame of the night image The contour to which each contour point belongs is the corrected probability of the pedestrian contour. It represents an exponential function with the natural constant as its base.
10. A big data processing method for urban and rural planning according to claim 1, characterized in that, The specific steps for obtaining the enhanced image of each nighttime image frame based on the corrected enhancement scale of each contour point in each nighttime image frame are as follows: Using an illumination compensation algorithm, each contour point in each nighttime image is enhanced according to the correction and enhancement scale of each contour point in each nighttime image, resulting in an enhanced image of each nighttime image.