A statistical method for tourist density in scenic spots

By extracting contour images from scenic spot tourist images and calculating the inner and outer contour feature values, combined with a dual-channel classifier, the problem of low accuracy in scenic spot tourist density statistics is solved, and higher statistical accuracy and feature recognition are achieved.

CN120496152BActive Publication Date: 2025-09-30SICHUAN VOCATIONAL & TECHN COLLEGE OF COMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510969943.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-09-30
Estimated Expiration
2045-07-15

AI Technical Summary

Technical Problem

The existing statistical methods for tourist density in scenic spots have low accuracy in complex environments and are prone to misjudgment and omission due to factors such as tourist posture, clothing, occlusion and lighting conditions.

Method used

By extracting the contour images of tourist images in scenic spots, marking the suspected facial contours and calculating the relative position eigenvalues, area eigenvalues ​​and pixel ratios of the inner and outer contours, a dual-channel classifier is used for feature fusion and classification to improve statistical accuracy.

Benefits of technology

It significantly improves the accuracy of tourist density statistics in scenic spots, effectively avoids misjudgments and missed judgments, and enhances feature recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120496152B_ABST
    Figure CN120496152B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for statistically analyzing the density of tourists in scenic spots, belonging to the field of image processing technology. The method extracts a contour image from a tourist image of a scenic spot and identifies suspected facial contours; marks an outer contour and an inner contour on the image; calculates the relative position and relative area feature values ​​of the inner contour and constructs a corresponding feature vector; calculates the pixel ratio of the inner contour to the outer contour and the pixel ratio of the inner contour to construct a corresponding ratio vector; performs feature fusion on the position and area feature vector of the inner contour, and the pixel ratio of the inner contour to the pixel ratio vector of the inner contour; and utilizes a dual-channel classifier based on the fused features and the number of inner contours to classify suspected facial regions; finally, calculates the tourist density of the scenic spot based on the classification of each suspected facial region. The present invention solves the problem of low accuracy in statistically analyzing the density of tourist in scenic spots in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for counting tourist density in a scenic area. Background Art

[0002] Currently, existing methods for counting tourist density in scenic spots primarily rely on installing cameras to collect image data. These methods then utilize traditional image processing and analysis techniques, such as edge-detection-based contour extraction algorithms, to identify visitor outlines. These methods are then combined with simple counting methods to estimate visitor numbers and subsequently calculate visitor density. However, these traditional methods have limitations in practical applications. Due to the complex and ever-changing nature of scenic spots, factors such as visitor posture, clothing, occlusion, and lighting conditions can interfere with the accurate extraction of facial and body contours in images. This can lead to misjudgments and omissions in contour-based counting methods, resulting in inaccurate results for tourist density statistics. Summary of the Invention

[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method for statistically analyzing the density of tourists in a scenic area, which solves the problem of low accuracy in statistically analyzing the density of tourists in a scenic area in the prior art.

[0004] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is: a method for statistically analyzing the density of tourists in a scenic area, comprising the following steps:

[0005] S1, extracting a contour image from the tourist image of the scenic spot, and finding the suspected face contour from the contour image;

[0006] S2. Mark the suspected face outline as the outer outline on the tourist image of the scenic spot, and mark the closed area surrounded by the contour lines within the outer outline as the inner outline;

[0007] S3. Calculate the relative position eigenvalue and relative area eigenvalue of each inner contour, and construct an inner contour position eigenvector and an inner contour area eigenvector;

[0008] S4, calculating the inner and outer contour pixel ratios and the inner contour pixel ratios, and constructing the inner and outer contour pixel ratio vectors and the inner contour pixel ratio vectors;

[0009] S5. Fusing the inner contour position feature vector and the inner contour area feature vector, and fusing the inner and outer contour pixel ratio vector and the inner contour pixel ratio vector, and using a dual-channel classifier to classify the suspected face region based on the fused features and the number of inner contours.

[0010] S6. Calculate the density of tourists in the scenic area according to the classification of each suspected face region in the tourist image of the scenic area.

[0011] Furthermore, S1 includes the following sub-steps:

[0012] S11, extracting a contour image from the scenic area tourist image;

[0013] S12, extracting the closed area surrounded by each contour line in the contour image;

[0014] S13. Calculate the closed area feature value based on the circumscribed rectangle of the closed area;

[0015] S14, calculating the similarity between the closed area feature value and the stored feature value, and when the similarity is greater than a similarity threshold, the closed area is a suspected face contour;

[0016] The formula for calculating the closed area eigenvalue in S13 is: , where ε is the closed area eigenvalue, L is the length of the circumscribed rectangle of the closed area, W is the width of the circumscribed rectangle of the closed area, C is the perimeter of the closed area, and S is the area of ​​the closed area.

[0017] Furthermore, S3 includes the following sub-steps:

[0018] S31, calculating the relative position feature value of each inner contour according to the geometric center position of each inner contour and the geometric center position of the outer contour;

[0019] S32, arranging the relative position feature values ​​of each inner contour to construct an inner contour position feature vector;

[0020] S33. Calculate the relative area characteristic value of each inner contour according to the area of ​​each inner contour;

[0021] S34. Arrange the relative area eigenvalues ​​of each inner contour to construct an inner contour area eigenvector.

[0022] Furthermore, the formula for calculating the relative position feature value of each inner contour in S31 is: , where θ position,i is the relative position characteristic value of the i-th inner contour within the outer contour, x in,i is the horizontal coordinate of the geometric center position of the i-th inner contour within the outer contour, y in,i is the ordinate of the geometric center position of the i-th inner contour within the outer contour, x out is the horizontal coordinate of the geometric center position of the outer contour, y out is the ordinate of the geometric center of the outer contour, i is a positive integer, The width of the circumscribed rectangle of the outer contour;

[0023] The formula for calculating the relative area characteristic value of each inner contour in S33 is: , where θ E,iis the relative area characteristic value of the i-th inner contour within the outer contour, E in,i is the area of ​​the i-th inner contour within the outer contour, N is the number of inner contours, i is a positive integer, and || is the absolute value.

[0024] Furthermore, S4 includes the following sub-steps:

[0025] S41, calculating the inner and outer contour pixel ratio of each inner contour according to the pixel values ​​of the outer contour and the inner contour;

[0026] S42, calculating the inner contour pixel ratio of each inner contour according to the pixel values ​​of each inner contour;

[0027] S43, arranging the inner and outer contour pixel ratios of each inner contour to construct an inner and outer contour pixel ratio vector;

[0028] S44. Arrange the inner contour pixel ratios of each inner contour to construct an inner contour pixel ratio vector.

[0029] Furthermore, the formula for calculating the inner and outer contour pixel ratio of each inner contour in S41 is: , where γ inout,i is the ratio of inner and outer contour pixels of the i-th inner contour within the outer contour, P out,avg is the pixel mean between the outer contour and the inner contour, P in,i,avg is the pixel mean of the pixel points in the i-th inner contour, where i is a positive integer;

[0030] The formula for calculating the inner contour pixel ratio of each inner contour in S42 is: , where γ in,i is the ratio of the inner contour pixels to the i-th inner contour pixels within the outer contour, max{P in,i,avg} is the maximum value selected from the pixel means of all inner contours within the outer contour.

[0031] Furthermore, S5 includes the following sub-steps:

[0032] S51, performing feature fusion on the inner contour position feature vector and the inner contour area feature vector to obtain a morphological feature fusion vector;

[0033] S52, performing feature fusion on the inner and outer contour pixel ratio vector and the inner contour pixel ratio vector to obtain a pixel feature fusion vector;

[0034] S53. Calculate a feature enhancement value based on the number of inner contours;

[0035] S54, multiplying the feature enhancement value by the morphological feature fusion vector and the pixel feature fusion vector respectively to obtain the morphological feature fusion enhancement vector and the pixel feature fusion enhancement vector;

[0036] S55. Input the morphological feature fusion enhancement vector and the pixel feature fusion enhancement vector into a dual-channel classifier to obtain a classification of the suspected face area.

[0037] Furthermore, the formula for calculating the feature enhancement value in S53 is: , where β is the feature enhancement value, N is the number of inner contours, and N ref is the inner contour reference quantity, and | | is the absolute value operation.

[0038] Furthermore, the dual-channel classifier in S55 includes: a first LSTM unit, a second LSTM unit, a first Tanh unit, a second Tanh unit, a first Sigmoid unit, a second Sigmoid unit, a first Concat layer, a second Concat layer, a first fully connected layer, a second fully connected layer and an output unit;

[0039] The input end of the first LSTM unit is used to input the morphological feature fusion enhancement vector, and its output end is connected to the input end of the first Tanh unit and the input end of the first Sigmoid unit respectively;

[0040] The input end of the second LSTM unit is used to input the pixel feature fusion enhancement vector, and its output end is connected to the input end of the second Tanh unit and the input end of the second Sigmoid unit respectively;

[0041] The input end of the first Concat layer is connected to the output end of the first Tanh unit and the output end of the second Tanh unit respectively, and its output end is connected to the input end of the first fully connected layer;

[0042] The input end of the second Concat layer is connected to the output end of the first Sigmoid unit and the output end of the second Sigmoid unit respectively, and its output end is connected to the input end of the second fully connected layer;

[0043] The input end of the output unit is connected to the output end of the first fully connected layer and the output end of the second fully connected layer respectively, and its output end serves as the output end of the dual-channel classifier.

[0044] Furthermore, the formula for calculating the tourist density of the scenic area in S6 is: , where ζ is the density of tourists in the scenic area, L is the number of suspected face regions classified as faces in the tourist images of the scenic area, and C is the area of ​​the shooting area.

[0045] The beneficial effects of the present invention are:

[0046] 1. The present invention extracts a contour image from a tourist image of a scenic spot, then finds a suspected facial contour from the contour image, marks the suspected facial contour as an outer contour on the tourist image of the scenic spot, and marks the closed area within the outer contour as an inner contour. In an outer contour, the relative position characteristic value and relative area characteristic value of each inner contour are calculated to reflect the position distribution and relative area of ​​each inner contour, and then the inner and outer contour pixel ratio and the inner contour pixel ratio are calculated to reflect the distribution of the inner and outer contour pixel values ​​and the distribution of the inner contour pixel values. Through multi-dimensional features, the present invention can more comprehensively capture the characteristic information of the facial area, effectively avoiding the problems of misjudgment and missed judgment caused by factors such as the complex environment of the scenic spot, such as the posture, clothing, occlusion and lighting conditions of the tourists, and significantly improving the accuracy of the tourist density statistics of the scenic spot.

[0047] 2. The present invention fuses the inner contour position feature vector and the inner contour area feature vector to reflect the morphological characteristics of the face area, and fuses the inner and outer contour pixel ratio vector and the inner contour pixel ratio vector to reflect the pixel characteristics of the face area. The feature is then enhanced by combining the number of inner contours to enhance the recognition of the feature. A dual-channel classifier is used for classification to obtain the classification of suspected face areas, which further reduces the occurrence of misjudgment and improves the accuracy of tourist density statistics in scenic spots. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a flow chart of a method for statistically analyzing tourist density in a scenic area;

[0049] Figure 2 Schematic diagram of the structure of the dual-channel classifier. DETAILED DESCRIPTION

[0050] The specific embodiments of the present invention are described below to facilitate understanding of the present invention by those skilled in the art. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations utilizing the concepts of the present invention are protected.

[0051] like Figure 1 As shown, a method for counting tourist density in a scenic area includes the following steps:

[0052] S1, extracting a contour image from the tourist image of the scenic spot, and finding the suspected face contour from the contour image;

[0053] S2. Mark the suspected face outline as the outer outline on the tourist image of the scenic spot, and mark the closed area surrounded by the contour lines within the outer outline as the inner outline;

[0054] S3. Calculate the relative position eigenvalue and relative area eigenvalue of each inner contour, and construct an inner contour position eigenvector and an inner contour area eigenvector;

[0055] S4, calculating the inner and outer contour pixel ratios and the inner contour pixel ratios, and constructing the inner and outer contour pixel ratio vectors and the inner contour pixel ratio vectors;

[0056] S5. Fusing the inner contour position feature vector and the inner contour area feature vector, and fusing the inner and outer contour pixel ratio vector and the inner contour pixel ratio vector, and using a dual-channel classifier to classify the suspected face region based on the fused features and the number of inner contours.

[0057] S6. Calculate the density of tourists in the scenic area according to the classification of each suspected face region in the tourist image of the scenic area.

[0058] In this embodiment, S1 includes the following sub-steps:

[0059] S11, extracting a contour image from the scenic area tourist image;

[0060] S12, extracting the closed area surrounded by each contour line in the contour image;

[0061] S13. Calculate the closed area feature value based on the circumscribed rectangle of the closed area;

[0062] S14. Calculate the similarity between the closed area feature value and the stored feature value. When the similarity is greater than a similarity threshold, the closed area is a suspected face contour.

[0063] In the present invention, the stored feature value is the closed area feature value calculated based on the standard face contour. The similarity threshold is the threshold set for the similarity.

[0064] The present invention first extracts the contour image of the scenic spot tourist image, then extracts the closed area surrounded by the contour line, then calculates its eigenvalue, and finally calculates the similarity with the stored eigenvalue, which can accurately screen out suspected human face contours from complex images.

[0065] The formula for calculating the closed area eigenvalue in S13 is: , where ε is the closed area eigenvalue, L is the length of the circumscribed rectangle of the closed area, W is the width of the circumscribed rectangle of the closed area, C is the perimeter of the closed area, and S is the area of ​​the closed area.

[0066] In this embodiment, the formula for calculating similarity is: , where q is the similarity, ε th To store the eigenvalues.

[0067] In this invention, length and width reflect the overall size of the region, while perimeter and area reflect the shape characteristics of the region. This multi-dimensional consideration enables the eigenvalue to more comprehensively describe the shape of the closed region.

[0068] In this embodiment, S11 includes the following sub-steps:

[0069] S111, grayscale processing is performed on the tourist image of the scenic spot to obtain a grayscale image;

[0070] S112, taking any pixel in the grayscale image as the center, calculating the distance between the grayscale value of the pixels in the neighborhood of the center and the grayscale value at the center;

[0071] S113, when all eight neighborhood distances are less than the distance threshold, discard the pixel at the center;

[0072] S314: Jump to S112 until all pixels in the grayscale image are traversed to obtain a contour image.

[0073] The distance threshold is a threshold set for the distance.

[0074] S2 is specifically as follows: after finding the suspected face contour from the contour image, there is a closed area surrounded by various contour lines within the suspected face contour. The contour image and the scenic area tourist image are different forms of the same image. Therefore, the suspected face contour is marked as the outer contour on the scenic area tourist image, and the closed area within the outer contour is marked as the inner contour.

[0075] In this embodiment, S3 includes the following sub-steps:

[0076] S31, calculating the relative position feature value of each inner contour according to the geometric center position of each inner contour and the geometric center position of the outer contour;

[0077] S32, arranging the relative position feature values ​​of each inner contour to construct an inner contour position feature vector;

[0078] S33. Calculate the relative area characteristic value of each inner contour according to the area of ​​each inner contour;

[0079] S34. Arrange the relative area eigenvalues ​​of each inner contour to construct an inner contour area eigenvector.

[0080] In this embodiment, the formula for calculating the relative position feature value of each inner contour in S31 is: , where θ position,i is the relative position characteristic value of the i-th inner contour within the outer contour, x in,i is the horizontal coordinate of the geometric center position of the i-th inner contour within the outer contour, y in,i is the ordinate of the geometric center position of the i-th inner contour within the outer contour, xout is the horizontal coordinate of the geometric center position of the outer contour, y out is the ordinate of the geometric center of the outer contour, i is a positive integer, The width of the circumscribed rectangle of the outer contour.

[0081] The human face has certain structural characteristics. Key facial features, such as the facial features, can be considered internal contours, which have a relatively fixed distribution within the face (the external contour). Calculating the relative positions of the geometric centers of the internal and external contours effectively captures these structural characteristics. For example, the positions of internal contours such as the eyes, nose, and mouth are relatively stable on the face. Calculating their relative positional feature values ​​can be used to describe the morphological layout of the face and assist in determining whether it is a real face region.

[0082] In different images, the size of the face may be different. If the absolute distance between the inner and outer contours is used directly, the value will vary greatly due to the change in image scale, which is not convenient for comparison and analysis. The relative position eigenvalues ​​obtained are scale invariant. No matter how big or small the face is in the image, the relative position of the inner contour can be measured with a unified standard.

[0083] The formula for calculating the relative area characteristic value of each inner contour in S33 is: , where θ E,i is the relative area characteristic value of the i-th inner contour within the outer contour, E in,i is the area of ​​the i-th inner contour within the outer contour, N is the number of inner contours, i is a positive integer, and || is the absolute value.

[0084] The area ratios of the inner contours of a face, such as the facial features, exhibit a certain stability and regularity. For example, the area ratios of the eyes, nose, and mouth in a normal face typically fall within a specific range. By calculating the relative area eigenvalue of each inner contour relative to the average area of ​​all inner contours, we can capture the relative relationship of these area ratios, effectively reflecting the characteristics of facial structure and assisting in determining whether the area is a true face. If the inner contour area ratio of a region deviates significantly from the normal range, the likelihood of it being a face is low.

[0085] In this embodiment, S4 includes the following sub-steps:

[0086] S41, calculating the inner and outer contour pixel ratio of each inner contour according to the pixel values ​​of the outer contour and the inner contour;

[0087] S42, calculating the inner contour pixel ratio of each inner contour according to the pixel values ​​of each inner contour;

[0088] S43, arranging the inner and outer contour pixel ratios of each inner contour to construct an inner and outer contour pixel ratio vector;

[0089] S44. Arrange the inner contour pixel ratios of each inner contour to construct an inner contour pixel ratio vector.

[0090] In this embodiment, the formula for calculating the inner and outer contour pixel ratio of each inner contour in S41 is: , where γ inout,i is the ratio of inner and outer contour pixels of the i-th inner contour within the outer contour, P out,avg is the pixel mean between the outer contour and the inner contour, P in,i,avg is the pixel mean of the pixel points in the i-th inner contour, where i is a positive integer.

[0091] There are certain differences and patterns in the pixel values ​​between the inner contours (such as the facial features) and the outer contours (the facial outline). For example, the pixel values ​​in the facial features often differ from those in other facial areas in terms of color and brightness. By calculating the pixel ratios of the inner and outer contours, as well as the inner contour pixel ratios, we can capture the characteristics of these pixel value differences.

[0092] The formula for calculating the inner contour pixel ratio of each inner contour in S42 is: , where γ in,i is the ratio of the inner contour pixels to the i-th inner contour pixels within the outer contour, max{P in,i,avg} is the maximum value selected from the pixel means of all inner contours within the outer contour.

[0093] Within a face, the pixel features of different inner contours (such as the eyes, nose, and mouth) vary. By calculating the ratio of the mean pixel value of each inner contour to the maximum mean pixel value of all inner contours within the outer contour, we can highlight the relative differences in pixel features between these inner contours.

[0094] In this embodiment, S5 includes the following sub-steps:

[0095] S51, performing feature fusion on the inner contour position feature vector and the inner contour area feature vector to obtain a morphological feature fusion vector;

[0096] S52, performing feature fusion on the inner and outer contour pixel ratio vector and the inner contour pixel ratio vector to obtain a pixel feature fusion vector;

[0097] S53. Calculate a feature enhancement value based on the number of inner contours;

[0098] S54, multiplying the feature enhancement value by the morphological feature fusion vector and the pixel feature fusion vector respectively to obtain the morphological feature fusion enhancement vector and the pixel feature fusion enhancement vector;

[0099] S55. Input the morphological feature fusion enhancement vector and the pixel feature fusion enhancement vector into a dual-channel classifier to obtain a classification of the suspected face area.

[0100] In this embodiment, the formula for feature fusion in S51 is: , where H1 is the morphological feature fusion vector, Conv is the convolution operation, and R position is the inner contour position feature vector, R E is the inner contour area eigenvector.

[0101] The formula for feature fusion in S52 is: , where H2 is the pixel feature fusion vector, R inout is the ratio vector of inner and outer contour pixels, R in is the inner contour pixel ratio vector.

[0102] In this embodiment, the convolution operation is The convolutional layer of size .

[0103] The inner contour position feature vector reflects the positional distribution of the inner contour within the suspected face region, while the inner contour area feature vector reflects its area properties. Fusion of the two provides a more comprehensive description of the suspected face region from a morphological perspective. Similarly, the inner and outer contour pixel ratio vectors and the inner contour pixel ratio vector reflect regional characteristics from a pixel perspective. Fusion of these two provides a more complete pixel feature description.

[0104] A feature enhancement value is calculated based on the number of inner contours and multiplied by the fused feature vector. This enhances the saliency of the feature based on the number of inner contours. A larger feature enhancement value indicates that the area is closer to a real face. This enhancement operation can highlight these key features, making it easier for the classifier to identify and distinguish suspected face areas.

[0105] In this embodiment, the formula for calculating the feature enhancement value in S53 is: , where β is the feature enhancement value, N is the number of inner contours, and N ref is the inner contour reference quantity, and | | is the absolute value operation.

[0106] In a normal face, the number of inner contours (such as the contours corresponding to the facial features) has a relatively stable range. For example, a normal face contains inner contours corresponding to the eyes, nose, mouth, etc., and the number is usually within a certain range. In the formula, the number of inner contours N and the reference number N are used to calculate the inner contours. ref Perform comparison operation, when N is close to N refWhen , it means that the number of inner contours N in the region conforms to the characteristic pattern of a normal face. At this time, the feature enhancement value β is large, which can enhance the feature significance of the region and highlight the possibility that it is a face region. On the contrary, when N and N ref When the difference is large, the feature enhancement value β is small, which reduces the weight of the feature in this area, indicating that it may not be a face area. In this way, the number of inner contours is used as a feature to assist in determining whether the area is a face, improving recognition accuracy.

[0107] like Figure 2 As shown, the dual-channel classifier in S55 includes: a first LSTM unit, a second LSTM unit, a first Tanh unit, a second Tanh unit, a first Sigmoid unit, a second Sigmoid unit, a first Concat layer, a second Concat layer, a first fully connected layer, a second fully connected layer and an output unit;

[0108] The input end of the first LSTM unit is used to input the morphological feature fusion enhancement vector, and its output end is connected to the input end of the first Tanh unit and the input end of the first Sigmoid unit respectively;

[0109] The input end of the second LSTM unit is used to input the pixel feature fusion enhancement vector, and its output end is connected to the input end of the second Tanh unit and the input end of the second Sigmoid unit respectively;

[0110] The input end of the first Concat layer is connected to the output end of the first Tanh unit and the output end of the second Tanh unit respectively, and its output end is connected to the input end of the first fully connected layer;

[0111] The input end of the second Concat layer is connected to the output end of the first Sigmoid unit and the output end of the second Sigmoid unit respectively, and its output end is connected to the input end of the second fully connected layer;

[0112] The input end of the output unit is connected to the output end of the first fully connected layer and the output end of the second fully connected layer respectively, and its output end serves as the output end of the dual-channel classifier.

[0113] The present invention sets a Tanh unit and a Sigmoid unit after each LSTM unit, and uses two activation functions to map each feature output by the LSTM unit. The Tanh function maps the feature value to the range of -1 to 1, highlighting the positive and negative and relative size of the feature, and can effectively capture the difference in the distribution of the feature. For example, in the facial images of scenic spots, the pixel differences between the facial features and other areas of the face under different lighting can be more clearly displayed after Tanh processing. The Sigmoid function maps the feature value to the range of 0 to 1, which can measure the importance of the feature. The different transformation characteristics of the two functions enrich the description of the LSTM output features from different angles, so that the model can learn more comprehensive feature information.

[0114] The present invention splices the outputs of two Tanh units through the first Concat layer and the outputs of two Sigmoid units through the second Concat layer, realizing the information integration of the two-dimensional features of morphology and pixels after Tanh and Sigmoid transformations, so that the subsequent fully connected layer can obtain a more comprehensive feature representation, which helps to learn the association between features of different dimensions, thereby more accurately judging the suspected face area.

[0115] In the present invention, the first fully connected layer is used to calculate the first classification value based on the features of the first Concat layer, the second fully connected layer is used to calculate the second classification value based on the features of the second Concat layer, the output unit is used to weight the first classification value and the second classification value to obtain a final classification value, and the classification type is divided according to the final classification value. For example, when the final classification value is greater than the classification threshold, the suspected face area is classified as a face.

[0116] In this embodiment, the formula for calculating the tourist density of the scenic area in S6 is: , where ζ is the density of tourists in the scenic area, L is the number of suspected face regions classified as faces in the tourist images of the scenic area, and C is the area of ​​the shooting area.

[0117] The present invention extracts a contour image from a tourist image of a scenic spot, then finds a suspected facial contour from the contour image, marks the suspected facial contour as an outer contour on the tourist image of the scenic spot, and marks the closed area within the outer contour as an inner contour. Within an outer contour, the relative position characteristic value and relative area characteristic value of each inner contour are calculated to reflect the position distribution and relative area of ​​each inner contour. The inner and outer contour pixel ratios and the inner contour pixel ratios are then calculated to reflect the distribution of the inner and outer contour pixel values ​​and the distribution of the inner contour pixel values. Through multi-dimensional features, the present invention can more comprehensively capture the characteristic information of the facial area, effectively avoiding the problems of misjudgment and missed judgment caused by factors such as the complex environment of the scenic spot, such as tourist posture, clothing, occlusion and lighting conditions, and significantly improving the accuracy of tourist density statistics in the scenic spot.

[0118] The present invention fuses the inner contour position feature vector and the inner contour area feature vector to reflect the morphological characteristics of the face area, and fuses the inner and outer contour pixel ratio vector and the inner contour pixel ratio vector to reflect the pixel characteristics of the face area. The feature is then enhanced by combining the number of inner contours to enhance the recognition of the features. A dual-channel classifier is used for classification to obtain the classification of suspected face areas, which further reduces the occurrence of misjudgment and improves the accuracy of tourist density statistics in scenic spots.

[0119] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A method for statistically analyzing tourist density in a scenic area, characterized in that: The following steps are involved: S1, extracting a contour image from the tourist image of the scenic spot, and finding the suspected face contour from the contour image; S2. Mark the suspected face outline as the outer outline on the tourist image of the scenic spot, and mark the closed area surrounded by the contour lines within the outer outline as the inner outline; S3. Calculate the relative position eigenvalue and relative area eigenvalue of each inner contour, and construct an inner contour position eigenvector and an inner contour area eigenvector; The formula for calculating the relative position feature value of each inner contour is: , where θ position,i is the relative position characteristic value of the i-th inner contour within the outer contour, x in,i is the horizontal coordinate of the geometric center position of the i-th inner contour within the outer contour, y in,i is the ordinate of the geometric center position of the i-th inner contour within the outer contour, x out is the horizontal coordinate of the geometric center position of the outer contour, y out is the ordinate of the geometric center of the outer contour, i is a positive integer, The width of the circumscribed rectangle of the outer contour; The formula for calculating the relative area characteristic value of each inner contour is: , where θ E,i is the relative area characteristic value of the i-th inner contour within the outer contour, E in,i is the area of ​​the i-th inner contour within the outer contour, N is the number of inner contours, i is a positive integer, and || is the absolute value; S4, calculating the inner and outer contour pixel ratios and the inner contour pixel ratios, and constructing the inner and outer contour pixel ratio vectors and the inner contour pixel ratio vectors; The formula for calculating the inner and outer contour pixel ratio of each inner contour is: , where γ inout,i is the ratio of inner and outer contour pixels of the i-th inner contour within the outer contour, P out,avg is the pixel mean between the outer contour and the inner contour, P in,i,avg is the pixel mean of the pixel points in the i-th inner contour, where i is a positive integer; The formula for calculating the inner contour pixel ratio of each inner contour is: , where γ in,i is the ratio of the inner contour pixels to the i-th inner contour pixels within the outer contour, max{P in,i,avg } is the maximum value selected from the pixel means of all inner contours within the outer contour; S5. Fuse the inner contour position feature vector and the inner contour area feature vector to obtain a morphological feature fusion vector; fuse the inner and outer contour pixel ratio vector and the inner contour pixel ratio vector to obtain a pixel feature fusion vector; calculate the feature enhancement value based on the number of inner contours: , where β is the feature enhancement value, N is the number of inner contours, and N ref is the number of inner contour references, and || is the absolute value operation. The feature enhancement value is multiplied by the morphological feature fusion vector and the pixel feature fusion vector respectively to obtain the morphological feature fusion enhancement vector and the pixel feature fusion enhancement vector. The morphological feature fusion enhancement vector and the pixel feature fusion enhancement vector are input into the dual-channel classifier to obtain the classification of the suspected face area. S6. Calculate the density of tourists in the scenic area according to the classification of each suspected face region in the tourist image of the scenic area.

2. The method for statistically analyzing tourist density in a scenic area according to claim 1, wherein: The S1 comprises the following sub-steps: S11, extracting a contour image from the scenic area tourist image; S12, extracting the closed area surrounded by each contour line in the contour image; S13. Calculate the closed area feature value based on the circumscribed rectangle of the closed area; S14, calculating the similarity between the closed area feature value and the stored feature value, and when the similarity is greater than a similarity threshold, the closed area is a suspected face contour; The formula for calculating the closed area characteristic value in S13 is: , where ε is the closed area eigenvalue, L is the length of the circumscribed rectangle of the closed area, W is the width of the circumscribed rectangle of the closed area, C is the perimeter of the closed area, and S is the area of ​​the closed area.

3. The method for statistically analyzing tourist density in a scenic area according to claim 1, wherein: The S3 includes the following sub-steps: S31, calculating the relative position feature value of each inner contour according to the geometric center position of each inner contour and the geometric center position of the outer contour; S32, arranging the relative position feature values ​​of each inner contour to construct an inner contour position feature vector; S33. Calculate the relative area characteristic value of each inner contour according to the area of ​​each inner contour; S34. Arrange the relative area eigenvalues ​​of each inner contour to construct an inner contour area eigenvector.

4. The method for statistically analyzing tourist density in a scenic area according to claim 1, wherein: The S4 comprises the following sub-steps: S41, calculating the inner and outer contour pixel ratio of each inner contour according to the pixel values ​​of the outer contour and the inner contour; S42, calculating the inner contour pixel ratio of each inner contour according to the pixel values ​​of each inner contour; S43, arranging the inner and outer contour pixel ratios of each inner contour to construct an inner and outer contour pixel ratio vector; S44. Arrange the inner contour pixel ratios of each inner contour to construct an inner contour pixel ratio vector.

5. The method for statistically analyzing tourist density in a scenic area according to claim 1, wherein: The dual-channel classifier in S55 includes: a first LSTM unit, a second LSTM unit, a first Tanh unit, a second Tanh unit, a first Sigmoid unit, a second Sigmoid unit, a first Concat layer, a second Concat layer, a first fully connected layer, a second fully connected layer and an output unit; The input end of the first LSTM unit is used to input the morphological feature fusion enhancement vector, and the output end thereof is connected to the input end of the first Tanh unit and the input end of the first Sigmoid unit respectively; The input end of the second LSTM unit is used to input the pixel feature fusion enhancement vector, and the output end thereof is connected to the input end of the second Tanh unit and the input end of the second Sigmoid unit respectively; The input end of the first Concat layer is connected to the output end of the first Tanh unit and the output end of the second Tanh unit respectively, and the output end thereof is connected to the input end of the first fully connected layer; The input end of the second Concat layer is connected to the output end of the first Sigmoid unit and the output end of the second Sigmoid unit respectively, and the output end thereof is connected to the input end of the second fully connected layer; The input end of the output unit is connected to the output end of the first fully connected layer and the output end of the second fully connected layer respectively, and the output end thereof serves as the output end of the dual-channel classifier.

6. The method for statistically analyzing tourist density in a scenic area according to claim 1, wherein: The formula for calculating the tourist density of the scenic area in S6 is: , where ζ is the density of tourists in the scenic area, L is the number of suspected face regions classified as faces in the tourist images of the scenic area, and C is the area of ​​the shooting area.