Video identification and analysis method based on physical characteristics

Through the video recognition and analysis method based on shape features, the problems of inaccurate segmentation and unstable feature extraction under lighting changes, noise and complex backgrounds in video recognition technology are solved, and efficient similarity calculation and feature comparison between video frames are achieved.

CN120808238AActive Publication Date: 2025-10-17BEIJING SIHAI TONGDA TECH CO LTD

Patent Information

Application Number
CN202511073903.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-10-17
Estimated Expiration
2045-08-01

AI Technical Summary

Technical Problem

Existing video recognition and analysis technologies suffer from inaccurate segmentation, broken contours, unstable feature extraction, and low computational efficiency when dealing with illumination changes, noise, complex backgrounds, and multi-target scenes, making it difficult to meet the needs of real-time and large-scale video stream processing.

Method used

A method based on shape features is adopted to generate standardized spectral amplitude feature vectors through unified pixel coordinate system, mirror extension boundary, median filtering, four-neighborhood connected domain analysis, neighborhood search and polar angle sorting, Euclidean distance resampling, three-point difference algorithm and discrete Fourier transform to realize inter-frame shape similarity calculation.

Benefits of technology

It improves the compatibility of video frames and the stability of feature extraction, enhances the accuracy of target segmentation in complex backgrounds and dynamic scenes, ensures the robustness and comparability of features, and realizes efficient retrieval and comparison between video frames.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808238A_ABST
    Figure CN120808238A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of video recognition and analysis, and discloses a video recognition and analysis method based on physical characteristics. Video frame pixels are mapped to a two-dimensional coordinate system with the upper left corner as an original point, and mirror image expansion and median filtering are carried out on a gray level image; constructing a binary image based on a gray threshold value, and analyzing and extracting a target region by using a four-neighborhood connected domain; using neighborhood search and polar angle sorting to close the tracking contour, and generating equidistant re-sampling points based on Euclidean distance and an interpolation method; the curvature of the re-sampling points is estimated through a three-point difference algorithm, and zero denominator is avoided through numerical protection; performing discrete Fourier transform on the curvature sequence to extract a frequency spectrum, and normalizing an amplitude to form a standardized feature vector; and finally, inter-frame similarity is calculated based on the feature vector, and the most similar frame is automatically retrieved. By processing unified data standards in stages, edge noise is suppressed, sampling uniformity is ensured, and feature stability and cross-frame comparability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of video recognition and analysis, in particular to a video recognition and analysis method based on shape features. BACKGROUND

[0002] With the rapid development of video monitoring, intelligent transportation, virtual reality and other fields, there are higher and higher requirements for automatic recognition and analysis of target shapes in videos. The existing technology mainly uses means such as gray scale or color segmentation, edge detection, contour extraction, and frequency domain analysis to describe and classify moving objects or human body contours.

[0003] Firstly, the gray scale segmentation method based on global or local threshold (such as fixed threshold segmentation, Otsu algorithm, etc.) is extremely sensitive to light changes and background complexity. When the background light or target reflection causes the gray scale distribution to drift, the segmentation result is prone to foreground loss, background false detection, etc., and manual adjustment of the threshold parameter is required to ensure the accuracy of the segmentation, which is difficult to meet the needs of real-time and large-scale video stream processing. Secondly, the commonly used edge detection operators (such as Canny, Sobel) have obvious performance degradation in high noise environment. Although various filters (median filtering, Gaussian filtering) can be used for preprocessing, noise suppression and edge preservation are often difficult to balance. In actual scenes, the gray scale or texture contrast between the foreground and background is insufficient, which will also lead to edge breakage or false alarm, thereby affecting the complete extraction of the contour. Thirdly, the connected component analysis and contour tracking algorithm (such as eight-connected / four-connected component labeling, chain code encoding) is not robust enough for small spot noise or contour breakage. For complex shapes or multi-target scenes, the connected component region often contains interfering objects, making it difficult to accurately select the region of interest; chain tracking is prone to tracking failure at discontinuous boundaries or concave places, and needs to use post-processing steps such as polar angle sorting or centroid sorting, increasing the algorithm complexity. In the parameterization and resampling of the contour, the existing scheme usually directly uses the original contour points or simplified polygon fitting, without ensuring the equidistant distribution of the sampling points along the contour. This leads to uneven curvature estimation, amplification of curvature discontinuity or noise peaks, and affects the stability and comparability of the features. At the same time, most curvature estimation methods (such as second-order derivative or curvature kink difference) may have zero denominator or numerical explosion when the adjacent three points are approximately collinear, and need special processing for extreme geometric configurations, otherwise it is easy to cause false decisions. In the aspect of frequency domain feature extraction, methods such as discrete Fourier contour descriptor (Fourier Descriptor) require fixed length input or pre-set shape alignment method, and rely on empirical coefficients in amplitude normalization and scale normalization. The feature dimensions between different target sizes or different resolution video frames are difficult to compare directly, and methods such as truncation, zero padding or dynamic time warping are often used, which significantly affects the calculation efficiency and real-time performance.

[0004] To this end, the present application aims to propose a method of video recognition and analysis based on shape features, which gradually converts the original video frames into representative normalized spectral feature vectors, effectively extracts the essential features of the target shape through a series of rigorous image processing and feature parameterization steps, and finally uses the features as criteria for inter-frame retrieval and comparison. SUMMARY

[0005] The present application provides a method of video recognition and analysis based on shape features, which solves the problems mentioned in the background art.

[0006] The present application provides the following technical solution: a method of video recognition and analysis based on shape features, comprising: Mapping each pixel in the video frame to a two-dimensional pixel coordinate system with the top-left corner of the image as the origin, and performing mirror expansion boundary and median filtering processing on the input grayscale image; Constructing a binary image according to the pixel grayscale threshold, and extracting all connected domain regions using four-neighbor connected domain analysis, and selecting the target region as the region of interest; Detecting the target boundary pixels using a neighborhood search algorithm, and achieving closed tracking of the contour points through polar angle sorting to form a continuous boundary point set; Calculating the contour cumulative length by Euclidean distance, determining the equidistant resampling points, and generating equidistantly distributed contour sampling points based on the interpolation algorithm; Using a three-point difference algorithm to estimate the curvature of the resampled contour points, and performing numerical protection processing on the zero denominator situation that may occur during calculation; Applying discrete Fourier transform to the estimated curvature sequence to obtain the spectral information of the contour curvature; Extracting the amplitude information from the spectral results and performing normalization processing to form a standardized spectral amplitude feature vector; Based on the normalized spectral amplitude feature, calculating the shape similarity between different video frames, and realizing retrieval and comparison according to the preset similarity criterion, and outputting the video frame with the most similar shape feature to the reference frame.

[0007] Optionally, the mapping of each pixel in the video frame to a two-dimensional pixel coordinate system with the top-left corner of the image as the origin, and the mirror expansion boundary and median filtering processing on the input grayscale image, specifically includes: Constructing a two-dimensional pixel coordinate system with the origin located at the top-left corner of the image, the x-axis along the image width connected to the origin in the direction away from the origin, the y-axis along the image height connected to the origin in the direction away from the origin, with units of pixels; wherein, is the image width; is the image height; Get the Frame input grayscale image in pixels The gray value at ;in, is the video frame index; Set the mirror extension boundary: Out of range The coordinates of are filled with the nearest boundary pixel value; For the Grayscale value of the frame after the frame is expanded by the mirror boundary; For each point Calculate the Frames in Pixels Department The result after median filtering ;in, To get the median of the set; Calculate the Frame Pixels The grayscale value after median filtering and rounding is: .

[0008] Optionally, constructing a binary image based on a pixel grayscale threshold, and extracting all connected domain areas using four-neighborhood connected domain analysis, from which a target area is selected as a region of interest, specifically includes: Calculate the The maximum grayscale value of all pixels in the frame ; Calculate the The minimum grayscale value of all pixels in the frame ; Set the The global binary segmentation threshold of the frame is ; Construct a binary image: ;in, For the Frame Pixels The binary value of ; Four-neighborhood pair Perform connected domain labeling to obtain a connected domain set ;in, For the Frame No. connected domains; For the The number of pixels in a connected component; For the The number of connected regions in the frame binary graph; The four neighborhoods include 、 ; like , then terminate and output no prospect; Otherwise, take , ;in, is the maximum connected domain index; For the The target area of ​​the frame is the connected area with the largest number of pixels; like , it terminates and outputs that the number of points in the region is insufficient.

[0009] Optionally, the method of detecting target boundary pixels using a neighborhood search algorithm and achieving closed tracking of contour points by polar angle sorting to form a continuous boundary point set specifically includes: Set the boundary point set: ;in, For the Boundary pixel coordinates, Number the contour points; For the Frame contour point set; To detect the current pixel The offset vector used when the four neighbors are background. is the horizontal offset, is the vertical offset; Calculate the Number of frame contour points ; like , then terminate and output insufficient contour points; From any point Departure, in order of offset: Select the next boundary point in turn until you return to , record sequence ;in, For the Frame outline The coordinates of the points; like , then execute steps S301 to S302: S301. Calculate the center of mass: , , ;in, For the The centroid coordinates of the frame contour points; S302, polar angle sorting: ;in, For the The polar angle of each contour point relative to the centroid; is the four-quadrant inverse tangent function, output ; according to From childhood to adulthood Re-sort to get a closed sequence.

[0010] Optionally, calculating the cumulative length of the contour by using the Euclidean distance, determining equidistant resampling points, and generating equidistantly distributed contour sampling points based on an interpolation algorithm specifically includes: Get loop index , calculate the Frame No. The Euclidean distance between a contour point and the next contour point : ; Calculate the The cumulative arc length corresponding to the contour points , ; Calculate the Total perimeter of frame outline ; Assume that the number of sampling points is the same as the number of original points: , ;in, For the The number of points after the frame contour is equally spaced and resampled; For the equidistant resampling target arc length position; , is the resampling point number; For each , find the index make ,calculate ;in, For the Sampling points in and The normalized ratio between Interpolated sampling points: , ;in, For the The coordinates of the equally spaced resampling points; get .

[0011] Optionally, the curvature estimation of the resampled contour points is performed using a three-point difference algorithm, and numerical protection processing is performed on the zero denominator situation that may occur during the calculation process, specifically including: Set the numerical protection threshold ; Perform periodic boundary extension: , ; Define the difference quantity: , ; , ; ;in, For the Point left and right difference; For the Point up and down difference; and is the second-order difference of three points; is the sum of squares of difference modulos; like ,but ;otherwise ;in, For the Frame No. The curvature of the sampling points.

[0012] Optionally, applying a discrete Fourier transform to the estimated curvature sequence to obtain frequency spectrum information of the contour curvature specifically includes: Set imaginary units ; Calculate the Number of frame spectrum components ; Calculate the Frame No. complex components of the curvature spectrum : ;in, is the spectral component number.

[0013] Optionally, extracting amplitude information from the spectrum result and performing normalization processing to form a standardized spectrum amplitude feature vector specifically includes: Calculate the Frame No. The amplitude of the spectral components ; Build the Frame amplitude vector ; Calculate the The sum of squares of the amplitudes of all spectral components of the frame ; like , terminate and output spectrum energy is too low; Otherwise, normalization is obtained as: , ; wherein, is the normalized amplitude of the spectrum of the first frame; is the normalized amplitude of the spectrum of the first frame; is the normalized amplitude of the spectrum of the first frame; is the normalized amplitude of the spectrum of the first frame; is the normalized amplitude of the spectrum of the first frame.

[0014] Optionally, the shape similarity between different video frames is calculated based on the normalized spectral amplitude feature, and retrieval and comparison are realized according to a preset similarity criterion, and the video frame most similar to the reference frame shape feature is output, and specifically comprising: The minimum spectral dimension shared by the reference frame and the candidate frame is set as: ; wherein, is the index of the candidate frame; If , the spectral dimension is insufficient, and the process is terminated and output; The curvature spectral Euclidean distance measure of the reference frame and the candidate frame is calculated as: ; wherein, is the normalized amplitude of the spectrum of the first frame; is the normalized amplitude of the spectrum of the first frame; The most similar frame is retrieved as: ; wherein, is the frame number most similar to the shape curvature spectrum of the reference frame .

[0015] The present application has the following advantages: 1. The standardized two-dimensional pixel coordinate system mapping is adopted, all subsequent processing is unified to the space system with the upper left corner of the image as the origin, seamless access and positioning consistency of multi-source video data are realized. At the same time, the mirror boundary expansion technology is introduced, effectively solving the common problems of out-of-bound and distortion in boundary pixel processing, ensuring that the pixels in the edge region participate in the calculation. The application of median filter can suppress salt and pepper noise and accidental pixel interference, and improve the overall signal-to-noise ratio of the original image, laying a high-quality foundation for subsequent image segmentation and feature extraction. Compared with the traditional method of directly processing the original frame, the present method emphasizes the standardization and robustness of space and pixel level, providing a fundamental guarantee for the repeatability and engineering adaptability of each stage of the algorithm. The problems of missegmentation, contour breakage, and unstable feature extraction often occur in traditional algorithms when processing boundaries, low-quality or noise-polluted video frames.

[0016] ​2、Adopt adaptive global threshold to carry out binaryzation processing, and automatically generate segmentation threshold according to the actual gray distribution of the current frame image, which avoids a large number of manual parameter adjustment. Combined with four-neighborhood connected domain marking technology, not only the target region can be extracted completely, but also the scattered noise spots can be efficiently removed. The maximum connected domain automatic screening mechanism ensures that the extracted region has practical recognition significance. Compared with most existing binary segmentation methods which rely on manual setting or are only suitable for specific scenes, the present application improves the target segmentation accuracy and adaptive ability under complex background and dynamic scene. It reduces the failure of foreground extraction caused by improper threshold setting, solves the pain point that the target region is difficult to accurately lock in complex background, and automatically avoids the interference caused by small spot noise.

[0017] 3、By introducing neighborhood search and polar angle sorting strategy, the target boundary pixels can be accurately locked, and the closed and ordered arrangement of the contour points is ensured. Especially the combination of centroid calculation and polar angle sorting not only enhances the geometric consistency of contour extraction, but also effectively solves the problems of broken chain and unordered point set in chain tracking. Compared with the traditional method which only relies on simple contour tracking or single threshold, the present method improves the tracking closure rate and the spatial distribution continuity of boundary points under complex contour, improves the accuracy of subsequent parameterization and feature extraction, improves the coherence and integrity of target boundary extraction, and eliminates the feature expression distortion caused by chain break or sequence disorder, which adapts to the precise extraction demand of high deformation and complex contour shape.

[0018] 4、On the basis of the contour point set, the arc length accumulation and equidistant resampling mechanism is introduced, which effectively converts the original contour points with uneven spatial distribution into uniformly distributed feature points. This method can reduce the curvature estimation deviation caused by uneven sampling, making the shape description more consistent and comparable. Interpolation sampling ensures the smoothness and continuity of the contour curve, which is helpful for subsequent spectral analysis. Compared with the method of using only original boundary points or simple interval sampling, this scheme shows stronger robustness and universality in describing complex or high curvature change contours. It solves the feature expression distortion caused by uneven contour point sampling density, and improves the basis of shape alignment and feature consistency under multiple frames and multiple targets.

[0019] 5、Three-point difference algorithm is used for local curvature estimation, and a global numerical protection threshold is introduced to solve the problem of numerical zero division or instability. This method is not only more robust in numerical calculation, but also effectively eliminates the curvature mutation caused by discrete sampling. Compared with the traditional second-order derivative or local polynomial fitting curvature algorithm, the present application improves the adaptability to discrete points and boundary points while ensuring accuracy, which is suitable for various complex contours and dynamic change environments. It avoids distortion and collapse caused by zero division or extreme values in curvature calculation, so that the shape feature extraction still performs stably and reliably on high variability data sets.

[0020] 6. Convert the curvature sequence in the time domain into features in the frequency domain, and capture the global and local change information of the body structure through Fourier transform. Spectral analysis can more comprehensively reflect the periodicity and complexity of the contour, and effectively avoid the limitation that a single spatial feature is difficult to express details and overall form. Compared with the traditional representation method that relies on edge coordinates or geometric moments, the spectral features of the present invention are more stable, noise-resistant and rotationally invariant, and can adapt to arbitrary changes in the shape in space. It solves the inconsistency problem introduced by spatial sampling, improves the contrast and uniqueness of body features across frames and scenes, and is suitable for large-scale retrieval and fast matching.

[0021] 7. The spectral features are amplitude extracted and fully normalized, effectively eliminating the effects of scale or brightness differences between different video frames and different targets, and obtaining standardized feature vectors. This strategy ensures that the feature expressions between different video frames can be directly compared in the same metric space, improving the engineering practicality and deployment scalability of the algorithm. Compared with some traditional methods that only retain local amplitudes or do not perform normalization, this invention ensures the fairness and robustness of the retrieval and comparison process. It eliminates feature deviations caused by changes in external parameters, providing a solid foundation for subsequent automated retrieval and intelligent matching.

[0022] 8. An inter-frame similarity metric based on spectral amplitude features is designed. The shape differences are measured through normalized Euclidean distance, and efficient retrieval with reference frames is automatically achieved. The minimum distance strategy ensures a high degree of consistency between the output frame and the target frame in terms of shape features, simplifying the traditional manual comparison and discrimination process. Compared with existing retrieval systems that only rely on color, texture or single spatial feature comparison, the present invention has higher discrimination and adaptability, and can be widely used in complex scenarios such as security monitoring and behavior recognition. It solves practical problems such as recognition errors and low retrieval efficiency caused by insufficient traditional feature expression or a single comparison method, and realizes a higher level of automation and intelligent video content analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0025] Example, see Figure 1 , a method for video recognition and analysis based on body features, comprising: Each pixel in the video frame is mapped to a two-dimensional pixel coordinate system with the upper left corner of the image as the origin, and the input grayscale image is mirror-extended boundary and median filter processed; A binary image is constructed according to a pixel grayscale threshold, and all connected domain regions are extracted using a four-neighbor connected domain analysis, from which a target region is selected as a region of interest; The target boundary pixels are detected using a neighborhood search algorithm, and the closed tracking of the contour points is realized through polar angle sorting to form a continuous boundary point set; The contour cumulative length is calculated by the Euclidean distance, the equidistant resampling points are determined, and the equidistant distributed contour sampling points are generated based on the interpolation algorithm; The curvature of the resampled contour points is estimated using a three-point difference algorithm, and numerical protection processing is performed on the zero denominator situation that may occur during calculation; The estimated curvature sequence is applied to the discrete Fourier transform to obtain the spectral information of the contour curvature; The amplitude information is extracted from the spectral results and normalized to form a standardized spectral amplitude feature vector; Based on the normalized spectral amplitude feature, the shape similarity between different video frames is calculated, and the retrieval and comparison are realized according to the preset similarity criterion, and the video frame with the most similar shape feature to the reference frame is output.

[0026] Through the phased image processing steps, the problems of non-uniform standards of multi-source data, serious target edge noise interference, unstable feature extraction, and weak automatic retrieval capability in video target recognition are systematically solved. Specifically, first, through a unified pixel coordinate system and median filtering, the compatibility of video frames from different sources and the image quality are effectively improved. Binary segmentation and connected domain screening can automatically remove interference and noise regions to ensure the accuracy of the object of interest. The subsequent contour extraction and resampling eliminate the problem of uneven distribution of sampling points, improving the shape parameterization and feature stability. Through curvature estimation and spectral analysis, the essential features of the shape structure are further excavated and expressed, and the normalized feature vector ensures the comparability of cross-frame features. Finally, using frame similarity measurement and automatic retrieval, the technical difficulties of automatic identification and content retrieval of massive data in video are effectively solved. The overall scheme not only improves the recognition accuracy and system robustness, but also reduces the burden of manual intervention and parameter tuning, providing an efficient and reliable solution for automatic video analysis and monitoring in practical engineering applications.

[0027] The mapping of each pixel in the video frame to a two-dimensional pixel coordinate system with the upper left corner of the image as the origin, and the mirror-extended boundary and median filter processing of the input grayscale image, specifically includes: Constructing a two-dimensional pixel coordinate system with the origin Located in the upper left corner of the image, The axis square is along the wide side of the image connected to the origin and moves away from the origin. The axis square is along the high side of the image connected to the origin and moves away from the origin, in pixels; is the image width; Is the image height; unify all subsequent spatial variables Reference system to ensure positioning and measurement consistency; Get the Frame input grayscale image in pixels The gray value at ;in, Index the video frame; obtain the original image data to provide input for subsequent processing; Set the mirror extension boundary: Out of range The coordinates of are filled with the nearest boundary pixel value; For the Grayscale value of the frame after the frame is expanded by the mirror boundary; For each point Calculate the Frames in Pixels Department The result after median filtering ;in, To obtain the median of the set; suppress salt and pepper noise and ensure that the boundary pixels do not cross the boundary during filtering; Calculate the Frame Pixels The grayscale value after median filtering and rounding is: ; Convert grayscale values ​​to integers to ensure accuracy in subsequent comparisons and threshold operations.

[0028] By standardizing the pixel coordinate system, video frames from different sources and resolutions are unified into a common reference system, facilitating subsequent feature calculation and spatial positioning operations and eliminating compatibility barriers between different cameras and formats. Mirrored boundary extension automatically fills gaps caused by algorithm window overflow during image edge processing, effectively preventing computational anomalies when filtering boundary points, thereby ensuring that edge information is not lost. Median filtering specifically targets salt-and-pepper noise and isolated pixels, smoothing the image and suppressing interference without losing object detail, further improving the accuracy and reliability of subsequent object segmentation and contour extraction. Rounding grayscale values ​​ensures good computational compatibility and discreteness for all pixel feature data, providing highly accurate and unambiguous input data for subsequent binary segmentation and thresholding. Overall, this step lays a solid foundation for the entire video recognition process, enabling all downstream algorithms to operate on standard, clear, and low-noise data, enhancing the overall stability and scalability of the system.

[0029] The binary image is constructed according to the pixel grayscale threshold, and all connected domain areas are extracted by four-neighborhood connected domain analysis, from which the target area is selected as the region of interest, specifically including: Calculate the The maximum grayscale value of all pixels in the frame ; Calculate the The minimum grayscale value of all pixels in the frame ; Set the The global binary segmentation threshold of the frame is ; Automatically determine the global binarization threshold to avoid manual parameter adjustment; Construct a binary image: ;in, For the Frame Pixels The grayscale image is converted into a foreground / background binary image to highlight the target area; Four-neighborhood pair Perform connected domain labeling to obtain a connected domain set ;in, For the Frame No. connected domains; For the The number of pixels in a connected component; For the The number of connected domains in the frame binary image; grouping discrete foreground pixels to provide a basis for subsequent selection of the main area; The four neighborhoods include 、 ; If , terminate and output no foreground; Otherwise, take , ; where is the maximum connected domain index; is the target region of the frame, i.e. the connected domain with the most pixels; If , terminate and output insufficient region points; remove small noise spots, determine the effective target region, and give explicit branch processing for extreme cases.

[0030] By automatically setting the global binary segmentation threshold, the uncertainty of manual parameter selection in traditional segmentation and the poor adaptability to different scenes are effectively avoided, and wide adaptability to different video scenes is achieved. By using four-neighbor connected domain analysis technology, the foreground pixels are automatically grouped, which can quickly and efficiently distinguish the target region from the background noise, laying a solid foundation for subsequent target tracking and recognition. By using the maximum connected domain screening mechanism, the main target region is effectively focused, and most of the background noise and irrelevant small spots are filtered out, improving the efficiency and accuracy of subsequent processing. Explicit termination and processing branches are given for the cases of no foreground or insufficient region points, improving the system's abnormality detection and robustness. This step not only improves the automation level of target segmentation, but also reduces the misjudgment probability caused by the influence of background complexity and image noise, and is a prerequisite for the smooth progress of subsequent boundary detection and feature extraction, providing a guarantee for the final realization of high-accuracy video target recognition.

[0031] The target boundary pixels are detected using the neighborhood search algorithm, and the contour points are closed tracked by polar angle sorting to form a continuous boundary point set, specifically including: Setting the boundary point set: ; where is the boundary pixel coordinate, is the contour point number; is the contour point set of the frame; is the offset vector used when detecting whether the four-neighborhood of the current pixel is background, is the horizontal offset, is the vertical offset; locating the outer pixels of the target region, and constructing the contour point set; Calculating the number of contour points of the frame; If , terminate and output insufficient contour points; From any point Departure, in order of offset: Select the next boundary point in turn until you return to , record sequence ;in, For the Frame outline The coordinates of each point are obtained; a closed contour point chain is obtained in sequence to facilitate subsequent parameterization processing; like , then execute steps S301 to S302: S301. Calculate the center of mass: , , ;in, For the The centroid coordinates of the frame contour points; S302, polar angle sorting: ;in, For the The polar angle of each contour point relative to the centroid; is the four-quadrant inverse tangent function, output ; according to From childhood to adulthood Re-sort to get a closed sequence; Ensure the sequence of contour points is consistent and resolve chain tracking failures.

[0032] Through the organic combination of neighborhood search and polar angle sorting, not only the accurate detection of the outer edge pixels of the target area is achieved, but also the continuity of the order of all contour points and the complete closure of the contour chain are guaranteed. Centroid calculation, as a geometric benchmark, effectively improves the accuracy of polar angle sorting of contour points and ensures the spatial distribution logic and sequence consistency of boundary points. The introduction of polar angle sorting avoids the problems of order confusion and closure failure that are prone to occur in common chain tracking algorithms in the case of highly complex contours or contour breaks, and improves the stability and standardization of contour structure expression. The resulting sequential closed contour point chain provides high-quality basic data for subsequent parameterization, resampling and shape feature calculation, ensuring the integrity and continuity of feature extraction. Through the above steps, the system can better adapt to changes in different shape structures and edge complexity, and improve the adaptability and fault tolerance of automatic recognition and processing.

[0033] The method of calculating the cumulative length of the contour by using the Euclidean distance, determining the equally spaced resampling points, and generating the equally spaced contour sampling points based on the interpolation algorithm specifically includes: Get loop index , calculate the Frame No. The Euclidean distance between a contour point and the next contour point : ; Calculate the distance between adjacent points on the contour chain to provide a basis for parameterization; Calculate the The cumulative arc length corresponding to the contour points , ; Calculate the Total perimeter of frame outline ; Convert discrete points into continuous arc length parameters to quantify contour length; Assume that the number of sampling points is the same as the number of original points: , ;in, For the The number of points after the frame contour is equally spaced and resampled; For the equidistant resampling target arc length position; , is the number of the resampling point; determine the equidistant sampling positions to ensure that the subsequent curvature calculation points are evenly distributed; For each , find the index make ,calculate ;in, For the Sampling points in and The normalized ratio between Interpolated sampling points: , ;in, For the The coordinates of the equally spaced resampling points; Perform equidistant resampling on the original contour to smooth and evenly distribute the sampling points; get ; Output a new contour point set for curvature estimation and spectral analysis.

[0034] By converting the original discrete contour points into cumulative arc length parameters, the global shape features of the contour can be effectively quantified, making the parameterization and alignment of complex curves simple and reliable. The equidistant resampling ensures that the distance between each sampling point is uniform, eliminating the feature deviation caused by uneven sampling density of the original contour points, and improving the feature consistency when comparing multiple frames and multiple targets. The introduction of the interpolation algorithm makes the newly generated contour points not only uniformly distributed, but also smooth, effectively reducing the numerical fluctuations of the discrete point set in the subsequent curvature estimation. The new contour point set not only represents the geometric shape of the original contour, but also has good mathematical processability, providing a solid data foundation for subsequent curvature analysis and spectral transformation. Overall, this technical solution improves the accuracy and comparability of feature expression, avoids the distortion of parameter extraction caused by unreasonable contour point distribution, and provides a standard and stable feature input for subsequent shape recognition and comparison.

[0035] The three-point difference algorithm is used to estimate the curvature of the resampled contour points, and numerical protection processing is performed on the possible zero denominator situation in the calculation process, specifically including: Set the numerical protection threshold ; uniform global zero threshold to ensure numerical stability; Periodic boundary extension: , ; Close the contour to keep the difference calculation consistent at the start and end points; Define the difference: , ; , ; ; wherein, is the left difference of the point; is the upper difference of the point; and are three-point second-order differences; is the difference modulus square sum; If , then ; otherwise ; wherein, is the curvature of the th sampling point in the th frame; Estimate the local curvature using the self-created three-point difference formula, and use to prevent zero division and ensure robustness.

[0036] The local curvature estimation of the equidistant sampling point set by the three-point difference method can more accurately reflect the local structural changes of the shape and improve the delicacy of the feature description. The strategy of periodic boundary extension ensures that the curvature estimation of the entire contour is also consistent at the closed ends, eliminating the errors caused by boundary effects. In order to address the problems of division by zero or extremely small denominators that may occur during the calculation process, by setting a global numerical protection threshold, the calculation instability and numerical overflow are effectively avoided, so that the curvature estimation is always within the controllable range, ensuring the physical rationality of the data. Compared with traditional second-order derivatives or polynomial fitting methods, this solution not only has a low computational load, but also has stronger adaptability to discrete data, improving the robustness of the system and the stability of practical applications. Through this step, the curvature features finally obtained have both high-resolution shape expression capabilities and will not affect the overall system performance due to calculation problems, laying a solid foundation for subsequent spectrum analysis and feature normalization.

[0037] The step of applying discrete Fourier transform to the estimated curvature sequence to obtain frequency spectrum information of the contour curvature specifically includes: Set imaginary units ; Provides an imaginary basis for Fourier transform; Calculate the Number of frame spectrum components ;Determine the number of independent frequency components to avoid redundant symmetry; Calculate the Frame No. Complex components of the curvature spectrum : ;in, Number the spectral components; convert the time domain curvature sequence to the frequency domain to extract the shape detail features.

[0038] By converting the curvature sequence from the time domain to the frequency domain, it is possible to simultaneously obtain global and local change information of the body structure, thereby improving the richness and accuracy of feature extraction. Spectral analysis has natural advantages such as anti-rotation, anti-translation, and anti-noise, and can effectively express the complex periodicity and detailed features of the contour, providing strong technical support for subsequent body comparisons between video frames. Compared with traditional methods that only use spatial domain features or simple geometric parameters, frequency domain features not only have stronger expressive power, but can also better adapt to the diversity and dynamic changes of the target shape, effectively avoiding recognition confusion caused by a single feature. Through this processing step, the system can elevate the expression of body features to a global level, enhance the distinguishability of features and the universality of application, and is an indispensable key technology for high-precision video content retrieval and intelligent recognition.

[0039] The step of extracting amplitude information from the spectrum result and performing normalization processing to form a standardized spectrum amplitude feature vector specifically includes: Calculate the frame amplitude of the spectrum component ; construct the frame amplitude vector ; extract the spectrum energy size, ignore the phase influence; calculate the frame amplitude square sum of all spectrum components ; if , terminate and output the spectrum energy is too low; otherwise, normalize to get: , ; wherein, is the normalized result of the spectrum amplitude of the frame ; is the normalized amplitude feature vector of the frame; eliminate the scale difference, output the comparable normalized spectrum feature.

[0040] By uniformly extracting and normalizing the spectrum amplitude, the scale and energy differences between video frames caused by external factors such as shooting distance, target size, and light intensity are effectively eliminated, ensuring that all feature vectors can be effectively compared in the same measurement space. The energy detection mechanism can automatically exclude low signal intensity or invalid feature frames, further improving the robustness and retrieval accuracy of the system. The normalized feature vector has good cross-frame comparability and data consistency, simplifying the subsequent similarity calculation and automatic comparison process. Compared with the method of extracting only partial spectrum features or not normalizing, the present scheme is more suitable for large-scale, multi-source, and complex scene high-precision video content retrieval, and effectively supports the landing application of intelligent video analysis and automatic recognition system.

[0041] Based on the normalized spectrum amplitude feature, the shape similarity between different video frames is calculated, and the retrieval and comparison are realized according to the preset similarity criterion, and the video frame with the most similar shape feature to the reference frame is output. Specifically, it includes: Set the minimum spectrum dimension shared by the reference frame and the candidate frame as: ; wherein, is the candidate frame index; align the spectrum dimensions of different frames to ensure that the distance calculation is feasible; if , terminate and output the spectrum dimension is insufficient; calculate the curvature spectrum Euclidean distance measure of the reference frame and the candidate frame : ; wherein, is the normalized amplitude of the candidate frame; and quantizing the difference between the two frame shape spectrum for similarity judgment; Most similar frame retrieval: ; wherein, is the frame number with the closest shape curvature spectrum to the reference frame; Automatic retrieval of the frame with the closest curvature spectrum to the reference frame.

[0042] By using the normalized spectral amplitude feature for similarity calculation between different video frames, the system can automatically quantify the difference between shape features, and realize truly automatic content comparison. The dimension alignment mechanism ensures the alignment and comparability of different frame feature vectors, avoiding calculation anomalies caused by feature misalignment or inconsistency. The minimum distance matching rule accurately retrieves the closest target frame for each reference frame, improving retrieval efficiency and accuracy, and is suitable for various practical scenarios such as security monitoring, video archiving, and behavior analysis. Overall, the claim realizes intelligent video content retrieval and automatic matching based on shape features, breaking through the technical bottleneck of traditional manual annotation or simple color and texture comparison, and providing a solid algorithm support and engineering foundation for intelligent video processing, unsupervised recognition and other frontier applications.

[0043] It should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device.

[0044] The above description is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the technical principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A method for video recognition and analysis based on body features, characterized in that: include: Map each pixel in the video frame to a two-dimensional pixel coordinate system with the upper left corner of the image as the origin, and perform mirroring, boundary extension, and median filtering on the input grayscale image; A binary image is constructed based on the pixel grayscale threshold, and four-neighborhood connected domain analysis is used to extract all connected domain areas, from which the target area is selected as the region of interest; The target boundary pixels are detected using the neighborhood search algorithm, and the closed tracking of the contour points is achieved through polar angle sorting to form a continuous boundary point set; The cumulative length of the contour is calculated by Euclidean distance, the equally spaced resampling points are determined, and the equally spaced contour sampling points are generated based on the interpolation algorithm; The three-point difference algorithm is used to estimate the curvature of the resampled contour points, and the zero denominator situation that may occur during the calculation process is numerically protected. Applying discrete Fourier transform to the estimated curvature sequence to obtain the spectrum information of the contour curvature; Extract amplitude information from the spectrum results and perform normalization processing to form a standardized spectrum amplitude feature vector; Based on the normalized spectral amplitude features, the shape similarity between different video frames is calculated, and retrieval and comparison are performed according to the preset similarity criterion, and the video frame with the most similar shape features to the reference frame is output.

2. The method for video recognition and analysis based on body features according to claim 1, characterized in that: The method of mapping each pixel in the video frame to a two-dimensional pixel coordinate system with the upper left corner of the image as the origin and performing mirroring, boundary extension and median filtering on the input grayscale image specifically includes: Constructing a two-dimensional pixel coordinate system ,origin Located in the upper left corner of the image, The axis square is along the wide side of the image connected to the origin and moves away from the origin. The axis square is along the high side of the image connected to the origin and moves away from the origin, in pixels; is the image width; is the image height; Get the Frame input grayscale image in pixels The gray value at ;in, is the video frame index; Set the mirror extension boundary: Out of range The coordinates of are filled with the nearest boundary pixel value; For the Grayscale value of the frame after the frame is expanded by the mirror boundary; For each point Calculate the Frames in Pixels Department The result after median filtering ;in, To get the median of the set; Calculate the Frame Pixels The grayscale value after median filtering and rounding is: .

3. The method for video recognition and analysis based on body features according to claim 2, characterized in that: The binary image is constructed according to the pixel grayscale threshold, and all connected domain areas are extracted by four-neighborhood connected domain analysis, from which the target area is selected as the region of interest, specifically including: Calculate the The maximum grayscale value of all pixels in the frame ; Calculate the The minimum grayscale value of all pixels in the frame ; Set the The global binary segmentation threshold of the frame is ; Construct a binary image: ;in, For the Frame Pixels The binary value of ; Four-neighborhood pair Perform connected domain labeling to obtain a connected domain set ;in, For the Frame No. connected domains; For the The number of pixels in a connected component; For the The number of connected regions in the frame binary graph; The four neighborhoods include 、 ; like , then terminate and output no prospect; Otherwise, take , ;in, is the maximum connected domain index; For the The target area of ​​the frame is the connected area with the largest number of pixels; like , it terminates and outputs that the number of points in the region is insufficient.

4. The method for video recognition and analysis based on body features according to claim 3, characterized in that: The method of detecting target boundary pixels by using a neighborhood search algorithm and achieving closed tracking of contour points by polar angle sorting to form a continuous boundary point set specifically includes: Set the boundary point set: ;in, For the Boundary pixel coordinates, Number the contour points; For the Frame contour point set; To detect the current pixel The offset vector used when the four neighbors are background. is the horizontal offset, is the vertical offset; Calculate the Number of frame contour points ; like , then terminate and output insufficient contour points; From any point Departure, in order of offset: Select the next boundary point in turn until you return to , record sequence ;in, For the Frame outline The coordinates of the points; like , then execute steps S301 to S302: S301. Calculate the center of mass: , , ;in, For the The centroid coordinates of the frame contour points; S302, polar angle sorting: ;in, For the The polar angle of each contour point relative to the centroid; is the four-quadrant inverse tangent function, output ; according to From childhood to adulthood Re-sort to get a closed sequence.

5. The method for video recognition and analysis based on body features according to claim 4, characterized in that: The method of calculating the cumulative length of the contour by using the Euclidean distance, determining the equally spaced resampling points, and generating the equally spaced contour sampling points based on the interpolation algorithm specifically includes: Get loop index , calculate the Frame No. The Euclidean distance between a contour point and the next contour point : ; Calculate the The cumulative arc length corresponding to the contour points , ; Calculate the Total perimeter of frame outline ; Assume that the number of sampling points is the same as the number of original points: , ;in, For the The number of points after the frame contour is equally spaced and resampled; For the equidistant resampling target arc length position; , is the resampling point number; For each , find the index make ,calculate ;in, For the Sampling points in and The normalized ratio between Interpolated sampling points: , ;in, For the The coordinates of the equally spaced resampling points; get .

6. The method for video recognition and analysis based on body features according to claim 5, characterized in that: The three-point difference algorithm is used to estimate the curvature of the resampled contour points, and a numerical protection process is performed for the zero denominator situation that may occur during the calculation process, specifically including: Set the numerical protection threshold ; Perform periodic boundary extension: , ; Define the difference quantity: , ; , ; ;in, For the Point left and right difference; For the Point up and down difference; and is the second-order difference of three points; is the sum of squares of difference modulos; like ,but ;otherwise ;in, For the Frame No. The curvature of the sampling points.

7. The method for video recognition and analysis based on body features according to claim 6, characterized in that: The step of applying discrete Fourier transform to the estimated curvature sequence to obtain frequency spectrum information of the contour curvature specifically includes: Set imaginary units ; Calculate the Number of frame spectrum components ; Calculate the Frame No. Complex components of the curvature spectrum : ;in, is the spectral component number.

8. The method for video recognition and analysis based on body features according to claim 7, characterized in that: The step of extracting amplitude information from the spectrum result and performing normalization processing to form a standardized spectrum amplitude feature vector specifically includes: Calculate the Frame No. The amplitude of the spectral components ; Build the Frame amplitude vector ; Calculate the The sum of squares of the amplitudes of all spectral components of the frame ; like , terminate and output spectrum energy is too low; Otherwise, normalization yields: , ;in, For the Frame No. Normalized results of spectrum amplitude; For the Frame normalized magnitude feature vector.

9. The method for video recognition and analysis based on body features according to claim 8, characterized in that: The method of calculating the shape similarity between different video frames based on the normalized spectral amplitude features, and performing retrieval and comparison according to a preset similarity criterion, and outputting the video frame with the most similar shape features to the reference frame, specifically includes: Set the minimum spectral dimension shared by the reference frame and the candidate frame to: ;in, is the candidate frame index; like , terminate and output the insufficient spectrum dimension; Compute reference frame and candidate frames Curvature spectrum Euclidean distance metric : ;in, The candidate frame Normalized amplitude; Most similar frame retrieval: ;in, For the reference frame The frame number where the body curvature spectrum is most similar.

Citation Information

Patent Citations

  • Unmanned aerial vehicle visual detection method for high-voltage line insulators

    CN107492094A

  • A tuna recognition method based on adaptive fish body bending model

    CN109145808A

  • Efficient pixel point filling method and system based on adaptive boundary detection technology

    CN119068007A

  • Gold wire bonding real-time image segmentation method

    CN119941764A

  • Robust, adaptive and efficient object detection, classification and tracking

    US20170068858A1

Cited By

  • Monitoring video motion segment extraction method based on multi-scale adaptive sampling line

    CN121665081A

  • Method for extracting moving segments from surveillance videos based on multi-scale adaptive sampling lines

    CN121665081B