Visitor flow monitoring method based on rapid improvement of resolution
By performing a convolution operation using the degradation function and convolution matrix of the photoelectric imaging system, combined with visual weight enhancement, the problem of the inability to improve image resolution in real time in existing technologies is solved, achieving real-time image clarity and accurate monitoring of pedestrian flow.
Patent Information
- Application Number
- CN202410590173.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2025-11-14
AI Technical Summary
Existing technologies cannot improve image resolution in real time, resulting in blurred images and an inability to accurately identify people in the images, thus affecting the accuracy of crowd monitoring.
By acquiring video images, a convolution operation is performed using the degradation function of the photoelectric imaging system and the image degradation convolution matrix. Combined with visual weight enhancement, this achieves a rapid improvement in image resolution and enables pedestrian target detection and tracking.
It achieves real-time image enhancement, improves the accuracy of pedestrian recognition and crowd monitoring, and ensures the real-time nature and clarity of the resolution improvement.
Smart Images

Figure CN120953901A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method for monitoring pedestrian flow based on rapid resolution improvement. Background Technology
[0002] In densely populated areas, accidents and disasters often occur due to overcrowding. To prevent these accidents, it is necessary to obtain real-time dynamic information about the crowds and take appropriate measures accordingly. For example, shopping mall managers can obtain real-time data on foot traffic and control the number of people entering the mall based on this data.
[0003] With the development of video surveillance technology, video surveillance systems are being used more and more widely in all aspects of people's lives. The automatic detection, recognition and tracking of moving objects in specific video sequences using digital image processing technology has become a research hotspot in the fields of intelligent monitoring and intelligent vision.
[0004] However, due to limitations in the number of photoelectric imaging sensor arrays and the size of the detection units, the spatial sampling frequency of the photoelectric imaging units used for video capture cannot meet the sampling law, resulting in low spatial resolution, blurry images, and an inability to accurately identify people in the images. In existing resolution enhancement schemes for imaging processes, super-resolution image restoration is a common strategy. However, because it employs deconvolution, obtaining the optimal resolution enhancement solution through iterative approximation is a tedious, time-consuming, and storage-intensive iterative process. Therefore, real-time resolution enhancement cannot be achieved for common 1280×1024 video imaging. Summary of the Invention
[0005] Based on the above analysis, the embodiments of the present invention aim to provide a pedestrian flow monitoring method based on rapid resolution improvement, in order to solve the problem that the existing methods cannot improve image resolution in real time, resulting in low pedestrian recognition rate in images.
[0006] The objective of this invention is mainly achieved through the following technical solutions:
[0007] This invention provides a method for monitoring pedestrian flow based on rapidly improved resolution, characterized by the following steps:
[0008] Acquire video images of the area with the highest pedestrian traffic to be detected;
[0009] The resolution of each frame in the video image is rapidly increased to obtain a clear image of each frame;
[0010] Detect pedestrian targets in clear images of each frame and track them to obtain the motion trajectory of the pedestrian targets;
[0011] The pedestrian flow in the area to be detected is obtained based on the preset direction of entry into the pedestrian flow area and the movement trajectory of the pedestrian target.
[0012] Furthermore, the step of detecting pedestrian targets in the clear images of each frame and tracking them to obtain the motion trajectory of the pedestrian targets includes:
[0013] Detect pedestrian targets in the clear images of each frame and perform face detection;
[0014] The facial information of each detected pedestrian is aligned, and the key facial feature points of each pedestrian are automatically located.
[0015] Feature extraction is performed on the key facial feature points of each pedestrian target to obtain the facial features of each pedestrian target;
[0016] Based on the extracted facial features of each pedestrian, the motion trajectory of each pedestrian is obtained.
[0017] Furthermore, the process of obtaining the pedestrian flow in the area to be detected based on the preset direction of entry into the pedestrian flow area and the movement trajectory of the pedestrian target includes:
[0018] When the movement trajectory of the pedestrian target is consistent with the preset direction of entering the pedestrian flow area to be detected, it is determined that the pedestrian has entered the pedestrian flow area to be detected, and the number of people in the pedestrian flow area to be detected is incremented by 1;
[0019] When the movement trajectory of the pedestrian target is opposite to the preset direction of entering the pedestrian flow area to be detected, it is determined that the pedestrian is leaving the pedestrian flow area to be detected, and the number of people in the pedestrian flow area to be detected is reduced by 1.
[0020] Furthermore, the step of rapidly upscaling the resolution of each frame in the video image to obtain a clear image of each frame includes:
[0021] Each frame of the image is convolved with an image degradation convolution matrix to obtain a preliminary resolution-enhanced image corresponding to each frame; wherein, the image degradation convolution matrix is obtained from the image captured by the photoelectric imaging system and its imaging degradation function;
[0022] Based on the resolution corresponding to each frame of the image, the visual weight of each pixel in the image is initially increased, and detail enhancement is performed to obtain a clear image of each frame.
[0023] Furthermore, the image degradation convolution matrix is obtained from the image captured by the photoelectric imaging system and its image degradation function, including:
[0024] The degradation function of the image in the photoelectric imaging system is obtained;
[0025] The image degradation convolution matrix is obtained based on the degradation function and several images pre-captured by the photoelectric imaging system.
[0026] Furthermore, obtaining the degradation function of the photoelectric imaging system includes:
[0027] Set up horizontal black and white targets and vertical black and white targets, and use the photoelectric imaging system to obtain horizontal target images and vertical target images respectively;
[0028] Based on the horizontal target image and the vertical target image, the horizontal line edge response and the vertical line edge response are calculated respectively;
[0029] Based on the horizontal and vertical edge responses, the horizontal modulation transfer function and the vertical modulation transfer function are calculated respectively.
[0030] Based on the horizontal modulation transfer function and the vertical modulation transfer function, the degradation function of the photoelectric imaging system is calculated.
[0031] Furthermore, the step of calculating the degradation function of the photoelectric imaging system based on the horizontal modulation transfer function and the vertical modulation transfer function includes:
[0032] Multiply the horizontal modulation transfer function by the vertical modulation transfer function, and normalize the magnitude of the result to obtain the normalized modulation transfer function.
[0033] Perform an inverse Fourier transform on the normalized modulation transfer function, and use the magnitude of the result as the degradation function of the image in the photoelectric imaging system.
[0034] Furthermore, obtaining the image degradation convolution matrix based on the degradation function and several images pre-captured by the photoelectric imaging system includes:
[0035] Acquire images captured by several of the aforementioned photoelectric imaging systems;
[0036] Obtain the cyclic matrix corresponding to the degenerate function;
[0037] The single-image degenerate convolution matrix for each image is obtained using the following formula:
[0038]
[0039] Where h1 represents a single-image degenerate convolution matrix; H1 represents the cyclic matrix corresponding to the single-image degenerate convolution matrix h1; H0 represents the cyclic matrix corresponding to the degenerate function; and g represents the image captured by the photoelectric imaging system.
[0040] The average value of the single-image degradation convolution matrix of each image is taken to obtain the image degradation convolution matrix.
[0041] Furthermore, the visual weights of each pixel in the initially improved image are obtained using the following formula:
[0042]
[0043] Where V(x,y) represents the visual weight of pixel (x,y); The resolution initially improves the value of the pixel (x,y) of the image; GaussianA(r,σ1,σ2) represents the two-dimensional Gaussian difference function.
[0044] Furthermore, the final image is obtained by enhancing the details of the initially resolution-upgraded image using the following formula:
[0045]
[0046] Where ω0 represents the constant of the balance enhancement effect.
[0047] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0048] 1. This application addresses the problem of low pixel count and blurry video images by using real-time resolution enhancement to obtain clear images, and then tracking pedestrians in the images to improve the accuracy of pedestrian flow detection.
[0049] 2. When dealing with situations such as video imaging that require real-time improvement of image resolution, this application transforms the usual method of using deconvolution for iterative updates during the image resolution improvement process into a method that can effectively improve image resolution using only a single convolution process, thus ensuring the real-time performance of image resolution improvement.
[0050] 3. This invention is designed for practical imaging scenarios. After achieving an initial resolution improvement through a single convolution, it combines visual weight enhancement to further enhance details, thereby achieving a second resolution improvement to the optimal image clarity.
[0051] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description
[0052] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0053] Figure 1 This is a flowchart illustrating a method for monitoring pedestrian flow based on rapid resolution improvement in an embodiment of the present invention.
[0054] Figure 2 This is a flowchart illustrating the method for rapidly improving image resolution in an embodiment of the present invention. Detailed Implementation
[0055] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0056] A specific embodiment of the present invention discloses a method for monitoring pedestrian flow based on rapidly improved resolution, such as... Figure 1 As shown, it includes the following steps S1-S4:
[0057] Step S1: Obtain video images of the area with the pedestrian flow to be detected.
[0058] Specifically, video images of the pedestrian flow area to be detected are acquired by the photoelectric imaging system, and each frame of the video images is captured using OpenCV.
[0059] The photoelectric imaging system can be a digital camera that uses a CCD or CMOS sensor.
[0060] Step S2: Quickly upscale the resolution of each frame in the video image to obtain a clear image of each frame.
[0061] Furthermore, such as Figure 2 As shown, the resolution of each frame in the video image is rapidly increased, including:
[0062] Each frame of image is convolved with an image degradation convolution matrix to obtain a preliminary resolution-enhanced image corresponding to each frame; wherein, the image degradation convolution matrix is obtained from the image captured by the photoelectric imaging system and its imaging degradation function.
[0063] Based on the resolution corresponding to each frame of the image, the visual weight of each pixel in the image is initially increased, and detail enhancement is performed to obtain a clear image of each frame.
[0064] Specifically, during the imaging process of an optoelectronic imaging system, due to imperfections in the optical system (such as lens distortion, diffraction limitations, etc.) and other physical factors (such as sensor noise, etc.), the imaging system will cause the quality of the ideal image to degrade. This process is called image degradation, and the degradation function is used to describe this degradation process.
[0065] Therefore, in photoelectric imaging systems, the common imaging process can be represented as:
[0066]
[0067] Where g represents the observed image, i.e., the image captured by the current imaging system; f represents the original scene, i.e., the clear image; h0 represents the degradation function of the photoelectric imaging system; and n represents noise. This indicates a convolution operation.
[0068] Since the circulant matrix is the discrete representation of the degenerate function h0, it can be represented as a circular convolution operation. Therefore, the imaging process can also be represented as:
[0069] g = H0f + n
[0070] Here, H0 represents the cyclic matrix corresponding to the degenerate function h0.
[0071] Furthermore, the original sharp image obtained by using the least squares method can be represented as:
[0072]
[0073] Where f0 represents the original sharp image.
[0074] The above formula means that selecting a clear original image f0 can make Minimum; among which, Let be the square of the second norm of g-H0f.
[0075] Solving the above formula using partial differential equations yields the following expression:
[0076]
[0077] Therefore, it is evident that iterative deconvolution is typically used to solve for the original clear image f0, which is time-consuming and laborious.
[0078] Therefore, in this application, we seek an optimal image f1 that is infinitely close to the deconvolution result f0 of the observed image, i.e.:
[0079]
[0080] Suppose there exists a convolution matrix h1, whose circulant matrix is denoted as H1, then there is an optimal image. g represents the observed image.
[0081] It can be deduced that a convolution matrix h1 can be found such that... The deconvolution result f0 that is closest to g can be derived from the following formula:
[0082]
[0083] Therefore, once the convolution matrix h1 is obtained, the image resolution can be quickly improved through simple convolution operations without the need for complex deconvolution calculations.
[0084] It should be noted that for a certain type of optoelectronic imaging system, the optical system, image sensor, circuit system, etc. are all standardized and regulated. Therefore, after studying one set of imaging systems and obtaining relevant parameters, it can be extended to products of the same optoelectronic imaging system to share the same set of parameters. Thus, the image degradation convolution matrix h1 obtained in advance can be applied to images captured by the same type of optoelectronic imaging system.
[0085] Furthermore, the image degradation convolution matrix is obtained from the image captured by the photoelectric imaging system and its image degradation function, including:
[0086] The degradation function of the image in the photoelectric imaging system is obtained;
[0087] The image degradation convolution matrix is obtained based on the degradation function and several images pre-captured by the photoelectric imaging system.
[0088] Specifically, the purpose of image resolution enhancement is to reconstruct the original image, that is, the image that has not been affected by degradation during the imaging process. In order to effectively restore the image, it is necessary to accurately estimate the degradation function of the photoelectric imaging system.
[0089] Furthermore, obtaining the degradation function of the photoelectric imaging system includes:
[0090] In the laboratory, horizontal black and white targets and vertical black and white targets were set up, and the photoelectric imaging system was used to obtain images of the horizontal targets and the vertical targets, respectively.
[0091] Based on the horizontal and vertical target images, the degradation function of the photoelectric imaging system is calculated.
[0092] It should be noted that when obtaining the degradation function, the field of view of the photoelectric imaging system contains only one horizontal or vertical black and white target with obvious edges at each time. The edges are where the brightness changes most drastically in the image and carry important contour information of the image. By analyzing the edge response, we can understand the imaging system's ability to preserve details and estimate the system's edge response. Using a standard target can calibrate and standardize the imaging results of different imaging systems or under different conditions, which is convenient for comparison and analysis.
[0093] Optical imaging systems exhibit different responses in different directions. For example, the optical distortion of a lens may result in differences in imaging quality in the horizontal and vertical directions. Therefore, by using horizontal and vertical targets respectively, the degradation function in both directions can be estimated and compensated independently.
[0094] Furthermore, the step of calculating the degradation function of the photoelectric imaging system based on the horizontal target image and the vertical target image includes steps S211-S213:
[0095] Step S211: Based on the horizontal target image and the vertical target image, calculate the horizontal line edge response and the vertical line edge response respectively; including:
[0096] Using an FIR filter, the edge response of each row of the horizontal target image is calculated and the mean is obtained to obtain the horizontal line edge response.
[0097] Using an FIR filter, the edge response of each column of the vertical target image is calculated and the mean is obtained to obtain the edge response of the vertical line.
[0098] Specifically, the brightness value change of each row / column pixel in the image is detected, and the first derivative (i.e., the rate of change of brightness value) is calculated for each row / column to obtain the speed of change of image brightness in the horizontal / vertical direction. The calculated derivative image can highlight the position of the edge. Since the calculated edge response may contain noise, an FIR filter (Finite Impulse Response Filter) is used to smooth the edge response to reduce the influence of noise. Finally, since the image is composed of black and white alternating lines in the row / column direction, the mean of the calculated edge response can be obtained to obtain the horizontal line edge response and the vertical line edge response respectively.
[0099] Step S212: Based on the horizontal line edge response and the vertical line edge response, calculate the horizontal modulation transfer function and the vertical modulation transfer function respectively; including:
[0100] The horizontal line edge response is input into a hamming filter, and the output of the hamming filter is subjected to a discrete Fourier transform to obtain the horizontal modulation transfer function.
[0101] The vertical edge response is input into a hamming filter, and the output of the hamming filter is subjected to a discrete Fourier transform to obtain the vertical modulation transfer function.
[0102] Specifically, the Hamming filter is a window function filter that uses a Hamming window to weight data to reduce spectral leakage and smooth images, reduce noise, and preserve important edge information of the image. The Hamming window is a commonly used smoothing window that weights the signal in the frequency domain to minimize the width of the main lobe and the level of the side lobes, thereby improving the performance of the Fourier transform.
[0103] The horizontal and vertical edge responses are input into a Hamming filter to obtain weighted and smoothed horizontal and vertical edge responses. Then, discrete Fourier transforms are performed on the results to convert them from the spatial domain to the frequency domain, yielding the horizontal and vertical modulation transfer functions. These functions represent the intensity of the edge responses at different frequencies and describe the system's ability to modulate different spatial frequency components.
[0104] Step S213: Based on the horizontal modulation transfer function and the vertical modulation transfer function, calculate the degradation function of the photoelectric imaging system; including:
[0105] Multiply the horizontal modulation transfer function by the vertical modulation transfer function, and normalize the magnitude of the result to obtain the normalized modulation transfer function.
[0106] Perform an inverse Fourier transform on the normalized modulation transfer function, and use the magnitude of the result as the degradation function of the image in the photoelectric imaging system.
[0107] Specifically, by multiplying the horizontal modulation transfer function by the vertical modulation transfer function, we obtain the comprehensive modulation transfer function that contributes to the imaging of the photoelectric system in both directions. At the same time, since the visual effect in image processing mainly depends on its amplitude information, and the magnitude of the comprehensive modulation transfer function can more intuitively represent the corresponding intensity of the imaging system at a specific frequency, normalizing the magnitude of the comprehensive modulation transfer function can make image processing more convenient, faster and more accurate.
[0108] Performing an inverse Fourier transform on the normalized modulation transfer function to convert it from the frequency domain to the spatial domain, its modulus becomes the degradation function of the photoelectric imaging system.
[0109] Furthermore, the step of obtaining the image degradation convolution matrix based on the degradation function and several images pre-captured by the photoelectric imaging system includes steps S221-S224:
[0110] Step S221: Acquire images captured by several of the aforementioned photoelectric imaging systems.
[0111] Specifically, in order to obtain a stable image degradation convolution matrix that is applicable to different imaging scenarios, multiple single-image degradation convolution matrices are obtained by testing a large number of images captured by the same optoelectronic imaging system, and their average value is taken as the final image degradation convolution matrix.
[0112] Step S222: Obtain the cyclic matrix corresponding to the degenerate function.
[0113] Specifically, since the degenerate function is a one-dimensional discrete function containing n elements, i.e., h0 = [h 00 ,h 01 ,h 02 ,…,h 0,n-1 A circular matrix H0 is constructed using the elements of the degenerate function h0, where each row of the matrix is a cyclically shifted version of h0; for example, the cyclic matrix is represented as:
[0114]
[0115] Step S223: Obtain the single-image degenerate convolution matrix for each image using the following formula:
[0116]
[0117] Where h1 represents a single-image degenerate convolution matrix; H1 represents the cyclic matrix corresponding to the single-image degenerate convolution matrix h1; H0 represents the cyclic matrix corresponding to the degenerate function; and g represents the image captured by the photoelectric imaging system.
[0118] It should be noted that in the process of calculating H1g, h1 can be directly convolved with the observed image g without the need for deconvolution calculation.
[0119] Step S224: Take the average of the single-image degradation convolution matrices of each image to obtain the image degradation convolution matrix.
[0120] Furthermore, based on the pre-obtained image degradation convolution matrix of the photoelectric imaging system, during application, for any image captured by the photoelectric imaging system... The initial resolution enhancement result is obtained directly using the image degradation convolution matrix, namely:
[0121]
[0122] in, represents the image with initial resolution enhancement; h represents the image degradation convolution matrix.
[0123] Furthermore, for any pixel (x, y) in the initially resolution-enhanced image, its absolute value after processing with a Gaussian difference filter is used as the weight value of the corresponding pixel, that is:
[0124]
[0125] Where V(x,y) represents the visual weight of pixel (x,y); The resolution initially improves the value of the pixel (x,y) of the image; GaussianA(r,σ1,σ2) represents the two-dimensional Gaussian difference function.
[0126] Specifically, the two-dimensional Gaussian difference function GaussianA(r,σ1,σ2) is defined as:
[0127] GaussianA(r,σ1,σ2)=Gauss(r,σ1)-Gauss(r,σ2)
[0128] Where Gauss() represents a two-dimensional Gaussian function; r represents the size of the Gaussian function, which determines the range of pixels covered by the filter; σ1 and σ2 represent the standard deviation of the Gaussian function, and in this embodiment, σ1 > σ2.
[0129] It should be noted that the two-dimensional Gaussian difference function, as a filter that can highlight image details, can make the image look clearer.
[0130] Furthermore, based on the aforementioned resolution, the visual weights of each pixel in the image are initially increased, and the following formula is used for detail enhancement to obtain the final image.
[0131]
[0132] Where E(x,y) represents the value of the final image pixel (x,y); ω0 represents the balance enhancement effect constant, which is set to a value in the range [0,1]. In this embodiment, ω0 is set to 0.5.
[0133] It should be noted that by selecting an appropriate value for ω0, the details of the image can be enhanced moderately while preserving the original image information.
[0134] Step S3: Detect pedestrian targets in clear images of each frame and track them to obtain the motion trajectory of the pedestrian targets.
[0135] Furthermore, steps S31-S34 are included:
[0136] Step S31: Detect pedestrian targets in the clear images of each frame and perform face detection.
[0137] Specifically, face detection involves locating the position of all faces in an image; for example, the face positions in the clear image can be detected using the cvHaarDetectObjects() or detectMultiScale() functions in OpenCV.
[0138] Step S32: Align the facial information of each detected pedestrian target and automatically locate the key facial feature points of each pedestrian target.
[0139] Specifically, face alignment processing involves automatically locating key facial feature points, such as eyes, nose tip, corners of the mouth, eyebrows, and contour points of various facial components, based on the input face image, and extracting the corresponding component features. For example, the Facemark class in OpenCV is used to implement face landmark detection. Specifically, the createFacemarkLBF function in OpenCV is used to create a face landmark detector, the detectMultiScale function is used to detect faces in the image, and the landmark detector is applied to each face to obtain the location of the key points.
[0140] Step S33: Extract features from the key facial feature points of each pedestrian target to obtain the facial features of each pedestrian target.
[0141] Specifically, extracting the key facial feature points refers to extracting a representative feature vector from a face image. For example, the FaceRecognizer class in OpenCV is used to implement the extraction of key facial feature points. Specifically, the LBPHFaceRecognizer_create function in OpenCV is used to create a face feature extractor, the detectMultiScale function is used to detect faces in the image, and the feature extractor is applied to each face to obtain a feature vector.
[0142] Step S34: Based on the extracted facial features of each pedestrian target, obtain the motion trajectory of each pedestrian target.
[0143] Specifically, based on the extracted facial features of each pedestrian target, optical flow is used to track the faces in the video image and generate motion trajectories.
[0144] Optical flow is the apparent motion pattern of an image object between two consecutive frames caused by the movement of an object or camera. Optical flow is a two-dimensional vector field, where each vector is a displacement vector, showing the movement of a point from the current frame to the next.
[0145] In this embodiment, the feature points are tracked iteratively using the Lucas-Kanade optical flow method by utilizing the OpenCV function cv.calcOpticalFlowPyrLK().
[0146] Step S4: Based on the preset direction of entering the pedestrian flow area to be detected and the movement trajectory of the pedestrian target, obtain the pedestrian flow in the area to be detected.
[0147] Furthermore, when the movement trajectory of the pedestrian target is consistent with the preset direction of entering the pedestrian flow area to be detected, it is determined that the pedestrian has entered the pedestrian flow area to be detected, and the number of people in the pedestrian flow area to be detected is incremented by 1.
[0148] When the movement trajectory of the pedestrian target is opposite to the preset direction of entering the pedestrian flow area to be detected, it is determined that the pedestrian is leaving the pedestrian flow area to be detected, and the number of people in the pedestrian flow area to be detected is reduced by 1.
[0149] Specifically, when the number of people in the area to be detected exceeds the preset number, it is determined that the crowd is dense, and security personnel are notified to evacuate the crowd.
[0150] In summary, the pedestrian flow monitoring method based on rapidly improved resolution according to the embodiments of the present invention has the following beneficial effects:
[0151] 1. This application addresses the problem of low pixel count and blurry video images by using real-time resolution enhancement to obtain clear images, and then tracking pedestrians in the images to improve the accuracy of pedestrian detection.
[0152] 2. When dealing with situations such as video imaging that require real-time improvement of image resolution, this application transforms the usual method of using deconvolution for iterative updates during the image resolution improvement process into a method that can effectively improve image resolution using only a single convolution process, thus ensuring the real-time performance of image resolution improvement.
[0153] 3. This invention is designed for practical imaging scenarios. After achieving an initial resolution improvement through a single convolution, it combines visual weight enhancement to further enhance details, thereby achieving a second resolution improvement to the optimal image clarity.
[0154] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for monitoring pedestrian flow based on rapidly improved resolution, characterized in that, Includes the following steps: Acquire video images of the area with the highest pedestrian traffic to be detected; The resolution of each frame in the video image is rapidly increased to obtain a clear image of each frame; Detect pedestrian targets in clear images of each frame and track them to obtain the motion trajectory of the pedestrian targets; The pedestrian flow in the area to be detected is obtained based on the preset direction of entry into the pedestrian flow area and the movement trajectory of the pedestrian target.
2. The method according to claim 1, characterized in that, The process of detecting pedestrian targets in clear images of each frame and tracking them to obtain the motion trajectory of the pedestrian targets includes: Detect pedestrian targets in the clear images of each frame and perform face detection; The facial information of each detected pedestrian is aligned, and the key facial feature points of each pedestrian are automatically located. Feature extraction is performed on the key facial feature points of each pedestrian target to obtain the facial features of each pedestrian target; Based on the extracted facial features of each pedestrian, the motion trajectory of each pedestrian is obtained.
3. The method according to claim 2, characterized in that, The process of obtaining the pedestrian flow in the area to be detected based on a preset direction of entry into the pedestrian flow area and the movement trajectory of the pedestrian target includes: When the movement trajectory of the pedestrian target is consistent with the preset direction of entering the pedestrian flow area to be detected, it is determined that the pedestrian has entered the pedestrian flow area to be detected, and the number of people in the pedestrian flow area to be detected is incremented by 1; When the movement trajectory of the pedestrian target is opposite to the preset direction of entering the pedestrian flow area to be detected, it is determined that the pedestrian is leaving the pedestrian flow area to be detected, and the number of people in the pedestrian flow area to be detected is reduced by 1.
4. The method according to claim 1, characterized in that, The step of rapidly upscaling the resolution of each frame in the video image to obtain a clear image of each frame includes: Each frame of the image is convolved with an image degradation convolution matrix to obtain a preliminary resolution-enhanced image corresponding to each frame; wherein, the image degradation convolution matrix is obtained from the image captured by the photoelectric imaging system and its imaging degradation function; Based on the resolution corresponding to each frame of the image, the visual weight of each pixel in the image is initially increased, and detail enhancement is performed to obtain a clear image of each frame.
5. The method according to claim 4, characterized in that, The image degradation convolution matrix is obtained from the image captured by the photoelectric imaging system and its image degradation function, including: The degradation function of the image in the photoelectric imaging system is obtained; The image degradation convolution matrix is obtained based on the degradation function and several images pre-captured by the photoelectric imaging system.
6. The method according to claim 5, characterized in that, The degradation function obtained from the photoelectric imaging system includes: Set up horizontal black and white targets and vertical black and white targets, and use the photoelectric imaging system to obtain horizontal target images and vertical target images respectively; Based on the horizontal target image and the vertical target image, the horizontal line edge response and the vertical line edge response are calculated respectively; Based on the horizontal and vertical edge responses, the horizontal modulation transfer function and the vertical modulation transfer function are calculated respectively. Based on the horizontal modulation transfer function and the vertical modulation transfer function, the degradation function of the photoelectric imaging system is calculated.
7. The method according to claim 6, characterized in that, The degradation function of the photoelectric imaging system, calculated based on the horizontal modulation transfer function and the vertical modulation transfer function, includes: Multiply the horizontal modulation transfer function by the vertical modulation transfer function, and normalize the magnitude of the result to obtain the normalized modulation transfer function. Perform an inverse Fourier transform on the normalized modulation transfer function, and use the magnitude of the result as the degradation function of the image in the photoelectric imaging system.
8. The method according to any one of claims 5-7, characterized in that, The image degradation convolution matrix obtained based on the degradation function and several images pre-captured by the photoelectric imaging system includes: Acquire images captured by several of the aforementioned photoelectric imaging systems; Obtain the cyclic matrix corresponding to the degenerate function; The single-image degenerate convolution matrix for each image is obtained using the following formula: Where h1 represents a single-image degenerate convolution matrix; H1 represents the cyclic matrix corresponding to the single-image degenerate convolution matrix h1; H0 represents the cyclic matrix corresponding to the degenerate function; and g represents the image captured by the photoelectric imaging system. The average value of the single-image degradation convolution matrix of each image is taken to obtain the image degradation convolution matrix.
9. The method according to claim 4, characterized in that, The visual weights of each pixel in the initially improved image at the stated resolution are obtained using the following formula: Where V(x,y) represents the visual weight of pixel (x,y); The resolution initially improves the value of the pixel (x,y) of the image; GaussianA(r,σ1,σ2) represents the two-dimensional Gaussian difference function.
10. The method according to claim 9, characterized in that, The final image is obtained by performing detail enhancement on the initially upgraded resolution image using the following formula: Where ω0 represents the constant of the balance enhancement effect.