A scenic spot electronic ticket code scanning and recognizing method and system
By dividing the electronic ticket image into multiple sub-regions for independent quality analysis and supplementary lighting optimization, the problem of electronic ticket image recognition failure was solved, improving the recognition success rate and the scenic area entry experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MANZHOULI PORT TOURISM CO LTD
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, the image quality of electronic tickets is poor due to issues such as screen glare, insufficient brightness, or complex ambient lighting, resulting in low success rates for QR code scanning. Furthermore, traditional QR code scanners cannot dynamically adjust their supplementary lighting strategies based on real-time environmental characteristics, leading to poor adaptability.
The electronic ticket image is divided into multiple sub-regions to be identified, and independent quality analysis is performed to generate a targeted environmental lighting strategy. The lighting is optimized by using a multi-source lighting array, and the images are stitched together to restore the complete image for recognition.
It effectively solved the problem of recognition failure caused by image quality issues, improving the scenic area entry experience and the recognition success rate.
Smart Images

Figure CN122157218A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic ticket recognition technology, and in particular to a method and system for scanning and recognizing electronic tickets for scenic spots. Background Technology
[0002] With the development of smart tourism, electronic tickets (such as QR codes and barcodes) have become the main form of attraction tickets. Tourists usually display the electronic ticket QR code on their mobile devices, which is then scanned by the gate scanner for passage.
[0003] In existing technologies, due to inherent glare on mobile phone screens, insufficient brightness, or complex ambient lighting conditions (such as direct sunlight, backlighting, and low light), electronic ticket images often suffer from blurriness, overexposure, underexposure, and low contrast. Traditional barcode scanners typically use fixed intensity and angle lighting, failing to dynamically adjust the lighting strategy based on real-time environmental characteristics and image quality. This results in lower scanning success rates, frequent recognition failures, and delays, impacting visitor efficiency and increasing operational pressure on scenic area management. Furthermore, traditional barcode recognition methods often process the entire image at once. When local image areas have quality defects, the overall recognition result is prone to errors, making precise optimization for quality issues in different areas difficult and resulting in poor adaptability. Therefore, combining real-time image quality analysis with dynamic ambient lighting to improve the robustness of electronic ticket barcode recognition in scenic areas has become a pressing technical challenge in the construction of smart scenic areas. Summary of the Invention
[0004] To address the aforementioned technical issues, this application provides a method and system for scanning and recognizing electronic tickets for scenic spots. The method divides the electronic ticket image into multiple sub-regions to be recognized, performs independent quality analysis on each sub-region, determines the quality defect feature sequence based on the analysis results, sets up a supplementary lighting array on the scanning device, and generates a targeted environmental supplementary lighting strategy based on the quality defect feature sequence, real-time environmental characteristics, and a preset supplementary lighting model. Based on the structural characteristics of the multi-source supplementary lighting array, the supplementary lighting requirements of all sub-regions are integrated and optimized to generate an optimal environmental compensation strategy, avoiding supplementary lighting resource conflicts and ensuring maximum supplementary lighting effect. After supplementary lighting is completed, the sub-images are stitched together to restore the complete electronic ticket image, which is then recognized using a preset decoding model. This effectively solves the recognition failure problem caused by image quality issues and improves the scenic spot entry experience.
[0005] In some embodiments of this application, a method for scanning and recognizing electronic tickets for scenic spots is provided, including:
[0006] Capture the electronic ticket image of each tourist, map it to several sub-regions to be identified, and obtain the sub-image to be identified in each region; Real-time quality analysis is performed on the sub-image to be identified to obtain the quality coefficient and determine whether adjustment is needed. If so, the quality defect feature sequence is determined, and the corresponding environmental supplementary lighting strategy for the sub-image is generated by combining the preset supplementary lighting model and real-time environmental features. Based on the structural characteristics of the multi-source adaptive illumination array and the environmental illumination strategy of all sub-images, the optimal environmental compensation strategy is generated, and the illumination command is issued. Several sub-images to be identified after supplemental lighting are stitched together to obtain the overall electronic image of each tourist. The recognition result of the overall electronic image of the tourist is generated based on the preset decoding model.
[0007] In some embodiments of this application, an electronic ticket image of each tourist is captured and mapped to several preset sub-regions to be identified, resulting in a sub-image to be identified in each region, including: The image of the electronic ticket displayed by the tourist is acquired in real time by the image acquisition device. The image is then preprocessed, including grayscale conversion, noise reduction and edge detection, to obtain the image region outline. The length and width of the overall recognition region are determined based on the bounding rectangle of the image region contour. Then, the region is evenly divided according to the preset number of rows and columns of sub-regions. If the area of the edge sub-region after division is less than the preset area threshold, it is merged with the adjacent region. Generate several sub-regions to be identified; The generated sub-regions to be identified are marked with coordinates. The preprocessed electronic ticket image is mapped and cut according to the coordinate range of each sub-region to obtain the sub-image to be identified corresponding to each sub-region. The relative position information of each sub-image in the whole electronic image is recorded.
[0008] In some embodiments of this application, real-time quality analysis is performed on the sub-image to be identified to obtain a quality coefficient and determine whether adjustment is needed, including: Several image quality evaluation indicators are pre-defined; Image features are extracted from each sub-image to be identified to obtain several real-time image features; Calculate the correlation coefficient between real-time image features and each image quality evaluation index, and use real-time image features with correlation coefficients greater than a preset correlation coefficient threshold as the features to be evaluated for the corresponding image quality evaluation index. Generate real-time evaluation values for each feature to be evaluated in the image quality evaluation index; The quality sub-coefficient of the corresponding index is generated based on the real-time evaluation value of each feature to be evaluated for the same image quality evaluation index. The quality coefficients are obtained by summing the weights of the quality sub-coefficients of all image quality evaluation indicators and the corresponding weight coefficients. If the quality coefficient is less than the preset quality coefficient threshold, it is determined that adjustment is needed.
[0009] In some embodiments of this application, generating a quality sub-coefficient of the corresponding index based on the real-time evaluation value of each feature to be evaluated for the same image quality evaluation index includes: Pre-set the evaluation value threshold for each feature to be evaluated; The difference between the real-time evaluation value and the corresponding evaluation value threshold is obtained. The evaluation features are then classified according to the real-time evaluation difference to obtain the normal feature set and abnormal feature set for each indicator. The real-time evaluation difference for each feature is quantified into the corresponding real-time type coefficient. The comprehensive anomaly coefficient is calculated based on the number of features in the anomaly feature set, the real-time type coefficients of all features, and the weight coefficients of the corresponding features. The comprehensive normal coefficient is calculated based on the number of features in the normal feature set, the real-time type coefficients of all features, and the weight coefficients of the corresponding features. The quality sub-coefficients of the corresponding indicators are generated based on the comprehensive anomaly coefficient and the comprehensive normal coefficient.
[0010] In some embodiments of this application, determining a sequence of quality defect features includes: The quality sub-coefficients of the image quality evaluation indicators of the same sub-image to be identified are selected if they are less than the preset quality sub-coefficient threshold, and the difference in quality sub-coefficients of the corresponding indicators is calculated. The number of defect features for each indicator is determined by matching the difference in mass coefficients with the preset range of mass coefficient differences, and by mapping the preset number of defect features to the range of mass coefficient differences and the current number of features to be evaluated for the corresponding indicator. The abnormal feature set of each selected indicator is sorted, and the top N features after sorting are selected as the defect features of the corresponding indicator according to the number of defect features. The weight coefficients of the defect features are generated based on the real-time type coefficients of the defect features and the weight coefficients of the corresponding indicators. The quality defect feature sequence of the corresponding sub-image is obtained by sorting all the defect features of the same sub-image according to the weight coefficient.
[0011] In some embodiments of this application, an environmental lighting strategy for generating corresponding sub-images by combining a preset lighting model and real-time environmental features includes: Obtain the historical lighting log of the scenic area's electronic ticket, and extract the historical lighting strategies, historical changes in historical image features, and corresponding historical environmental features from the historical lighting log. A training sample set for a preset lighting model is constructed based on historical lighting strategies, historical changes in historical image features, and historical environmental features. The preset lighting model is then trained using the gradient descent algorithm. Collect real-time environmental features of the current scanning environment, including real-time light intensity, light direction, relative distance and angle between the device and the electronic ticket; The quality defect feature sequence and real-time environmental features of each sub-image to be identified are input into the trained preset supplementary lighting model to generate an environmental supplementary lighting strategy. The ambient lighting strategy includes lighting type, lighting intensity, lighting angle, and lighting duration.
[0012] In some embodiments of this application, an optimal environmental compensation strategy is generated based on the structural characteristics of the multi-source adaptive illumination array and the environmental illumination strategy for all sub-images, including: Obtain the structural characteristics of a multi-source adaptive supplementary lighting array, including the number of light sources, the type of light sources, the installation position coordinates of each light source, the adjustable angle range, and the supplementary lighting intensity range of a single light source; Based on the environmental illumination strategy of all sub-images to be identified and the structural characteristics of the multi-source adaptive illumination array, the demand distribution of illumination type, illumination intensity and illumination angle for each sub-image is statistically analyzed, and the conflict factors of illumination resources are marked. The conflict factors include conflicts in the supplementary lighting angle requirements, supplementary lighting intensity requirements, and light source type requirements for the same light source. The ambient lighting strategy for all sub-images is optimized and adjusted based on the conflict factor to generate the optimal ambient compensation strategy.
[0013] In some embodiments of this application, the ambient lighting strategy for all sub-images is optimized and adjusted based on the conflict factor, including: Based on the conflict factor, all environmental lighting strategies are divided into conflict-free strategy set, low-conflict strategy set, and high-conflict strategy set; Integrate all environmental illumination strategies in the conflict-free strategy set, and generate the first illumination parameter based on the integration result; The conflict factors in the low-conflict strategy set are fine-tuned using a weighted average method, and the second supplementary lighting parameters are generated based on the fine-tuning results. Prioritize the sub-images corresponding to the environmental illumination strategies in the high-conflict strategy set, select strategies based on the ranking results, and generate the third illumination parameters based on the selection results. The first, second, and third supplementary lighting parameters are integrated to form the optimal ambient lighting strategy.
[0014] In some embodiments of this application, several sub-images to be identified after supplemental lighting are stitched together to obtain an overall electronic image of each tourist. The identification result of the overall electronic image of the tourist is generated based on a preset decoding model, including: The sub-images to be identified after supplemental lighting are preprocessed, feature points of each preprocessed sub-image are extracted, and feature point matching is performed. The matching feature points are determined by calculating the Euclidean distance between feature points. The spatial transformation relationship between sub-images is established based on the coordinates of the matched feature points. Based on this spatial transformation relationship, and combined with the weighted average fusion algorithm, the overlapping areas are processed to achieve a smooth transition and form an overall electronic image. The stitched overall electronic image is input into a preset decoding model to obtain the recognition result of the overall electronic image.
[0015] In some embodiments of this application, a scenic area electronic ticket scanning and recognition system is also included, employing the aforementioned scenic area electronic ticket scanning and recognition method, comprising: The capture module is used to capture the electronic ticket image of each tourist, map it to several sub-regions to be identified, and obtain the sub-image to be identified in each region; The analysis module is used to perform real-time quality analysis on the sub-image to be identified, obtain the quality coefficient and determine whether adjustment is needed. If so, it determines the quality defect feature sequence and generates the corresponding sub-image's environmental supplementary lighting strategy by combining the preset supplementary lighting model and real-time environmental features. The supplementary lighting module is used to generate the optimal environmental compensation strategy based on the structural characteristics of the multi-source adaptive supplementary lighting array and the environmental supplementary lighting strategy of all sub-images, and to issue supplementary lighting commands. The recognition module is used to stitch together several sub-images to be recognized after supplemental lighting to obtain the overall electronic image of each tourist, and to generate the recognition result of the overall electronic image of the tourist based on a preset decoding model.
[0016] The method and system for scanning and recognizing electronic tickets for scenic spots according to embodiments of this application have the following advantages compared with the prior art: By dividing the electronic ticket image into multiple sub-regions to be identified, and conducting independent quality analysis on each sub-region, the quality defect feature sequence is determined based on the analysis results. A supplementary lighting array is then set up on the scanning device. Based on the quality defect feature sequence, real-time environmental characteristics, and a preset supplementary lighting model, a targeted environmental supplementary lighting strategy is generated. Taking into account the structural characteristics of the multi-source supplementary lighting array, the supplementary lighting requirements of all sub-regions are integrated and optimized to generate the optimal environmental compensation strategy, avoiding supplementary lighting resource conflicts and ensuring maximum supplementary lighting effect. After supplementary lighting is completed, the sub-images are stitched together to restore the complete electronic ticket image, which is then recognized using a preset decoding model. This effectively solves the recognition failure problem caused by image quality issues and improves the scenic area entry experience. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating a method for scanning and recognizing electronic tickets for scenic spots, as described in this application. Figure 2 This is a schematic diagram of a scenic area electronic ticket scanning and recognition system according to an embodiment of this application. Detailed Implementation
[0018] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.
[0019] In the description of this application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0020] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0021] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0022] like Figure 1 As shown in the figure, an embodiment of this application provides a method for scanning and recognizing electronic tickets for scenic spots, including: S101: Capture the electronic ticket image of each tourist, map it to several sub-regions to be identified, and obtain the sub-image to be identified in each region; S102: Perform real-time quality analysis on the sub-image to be identified, obtain the quality coefficient and determine whether adjustment is needed. If so, determine the quality defect feature sequence and generate the corresponding sub-image's environmental supplementary lighting strategy by combining the preset supplementary lighting model and real-time environmental features. S103: Generate the optimal environmental compensation strategy based on the structural characteristics of the multi-source adaptive illumination array and the environmental illumination strategy of all sub-images, and issue illumination commands. S104: After supplementing the light, several sub-images to be identified are stitched together to obtain the overall electronic image of each tourist, and the recognition result of the overall electronic image of the tourist is generated based on the preset decoding model.
[0023] In some embodiments of this application, an electronic ticket image of each tourist is captured and mapped to several preset sub-regions to be identified, resulting in a sub-image to be identified in each region, including: The image of the electronic ticket displayed by the tourist is acquired in real time by the image acquisition device. The image is then preprocessed, including grayscale conversion, noise reduction and edge detection, to obtain the image region outline. The length and width of the overall recognition region are determined based on the bounding rectangle of the image region contour. Then, the region is evenly divided according to the preset number of rows and columns of sub-regions. If the area of the edge sub-region after division is less than the preset area threshold, it is merged with the adjacent region. Generate several sub-regions to be identified; The generated sub-regions to be identified are marked with coordinates. The preprocessed electronic ticket image is mapped and cut according to the coordinate range of each sub-region to obtain the sub-image to be identified corresponding to each sub-region. The relative position information of each sub-image in the whole electronic image is recorded.
[0024] In this embodiment, the preset number of rows and columns of sub-regions can be flexibly configured according to the actual application scenario. For example, when the tourist flow is large during the peak period of the scenic spot, the number of rows and columns of sub-regions can be set to 3 rows and 3 columns to improve the efficiency of image segmentation and quickly capture multiple sub-images for parallel processing. In scenarios with less tourist flow and higher requirements for recognition accuracy, the division method can be adjusted to 4 rows and 4 columns or 5 rows and 5 columns to refine the granularity of image analysis by increasing the number of sub-regions.
[0025] In this embodiment, the preset area threshold is 5% of the overall recognition area. The edge sub-region is merged with its adjacent larger sub-region. The boundaries of the merged sub-region need to be recalculated and marked to ensure that the area of each sub-region to be recognized is relatively balanced, so as to avoid deviations in subsequent quality analysis and supplementary lighting strategy generation due to the small area of the factor region.
[0026] In this embodiment, the coordinate markers adopt a two-dimensional coordinate system with the upper left corner of the overall electronic image as the origin, accurately recording the coordinates of the upper left and lower right corners of each sub-image to be identified, so that the spatial structure of the overall electronic image can be accurately restored during subsequent stitching and combination.
[0027] In some embodiments of this application, real-time quality analysis is performed on the sub-image to be identified to obtain a quality coefficient and determine whether adjustment is needed, including: Several image quality evaluation indicators are pre-defined; Image features are extracted from each sub-image to be identified to obtain several real-time image features; Calculate the correlation coefficient between real-time image features and each image quality evaluation index, and use real-time image features with correlation coefficients greater than a preset correlation coefficient threshold as the features to be evaluated for the corresponding image quality evaluation index. Generate real-time evaluation values for each feature to be evaluated in the image quality evaluation index; The quality sub-coefficient of the corresponding index is generated based on the real-time evaluation value of each feature to be evaluated for the same image quality evaluation index. The quality coefficients are obtained by summing the weights of the quality sub-coefficients of all image quality evaluation indicators and the corresponding weight coefficients. If the quality coefficient is less than the preset quality coefficient threshold, it is determined that adjustment is needed.
[0028] In this embodiment, the image quality evaluation indicators include reflectivity, brightness, and sharpness. The reflectivity indicator is used to measure the degree of interference to recognition caused by light spots or bright areas in the sub-image to be identified due to light reflection. The brightness indicator is used to evaluate whether the overall brightness of the image is within the range suitable for QR code recognition. The sharpness indicator is used to characterize the blurriness and detail richness of the electronic ticket pattern in the image.
[0029] In this embodiment, the real-time image features include the pixel distribution and texture features of the highlight area, the overall average gray value of the image, the local brightness histogram distribution of the QR code area, the edge energy value of the image, and the average gradient magnitude, etc.
[0030] In this embodiment, the real-time correlation coefficient is calculated using the Pearson correlation coefficient formula and is used to quantify the linear correlation between real-time image features and image quality evaluation indicators. A preset correlation coefficient threshold is set to 0.6. When the calculated correlation coefficient is greater than this threshold, it indicates that the real-time image feature has a significant impact on the corresponding image quality evaluation indicator, and it is designated as the feature to be evaluated for that indicator.
[0031] In this embodiment, the real-time evaluation value refers to the normalized score obtained by comparing the actual measured value of the feature to be evaluated with the standard value of the preset standard feature. Specifically, for the image overall average gray value in the brightness index, the preset standard gray value range is [120, 180]. If the real-time average gray value is 150, the real-time evaluation value is 1.0; if the real-time value is 100 (below the lower limit of the standard), the evaluation value is calculated as 0.3 by the linear mapping formula. The specific calculation formula is: real-time evaluation value = (real-time feature value - lower limit of the standard) / (upper limit of the standard - lower limit of the standard). When the real-time feature value exceeds the standard range, the evaluation value is set to 0 (below the lower limit) or 1 (above the upper limit).
[0032] In this embodiment, the weight coefficient of each feature is set according to the correlation coefficient with the corresponding indicator. The higher the correlation coefficient, the greater the influence of the feature on the indicator, and the higher the weight coefficient. Specifically, the correlation coefficient is converted into a weight coefficient through normalization, so that the sum of the weight coefficients of all features to be evaluated under the same indicator is 1.
[0033] In this embodiment, the quality coefficient is calculated using a weighted summation method, that is, the quality sub-coefficient of each image quality evaluation index is multiplied by the weight coefficient of that index and then summed. The weight coefficients of the reflectivity index, brightness index, and sharpness index are set to 0.3, 0.4, and 0.3, respectively, thereby highlighting the core influence of brightness on electronic ticket recognition.
[0034] In this embodiment, the preset quality coefficient threshold is 0.75. This threshold is determined based on statistical analysis of sample data from a large number of actual QR code scanning scenarios in scenic areas. By modeling the recognition success rate under different lighting conditions, different mobile phone screen brightness, and different QR code display clarity, when the quality coefficient reaches 0.75, the overall quality of the QR code image can meet the recognition requirements of the preset decoding model, that is, the recognition success rate can reach more than 98%. Therefore, 0.75 is set as the critical value for determining whether environmental lighting adjustment is needed.
[0035] In this embodiment, corresponding features to be evaluated are selected by pre-setting several image quality evaluation indicators, and the real-time evaluation value and the quality sub-coefficient of each indicator are calculated to obtain the quality coefficient of each sub-image to be identified, thereby accurately determining whether supplementary lighting adjustment is needed, and providing reliable data basis for subsequent generation of supplementary lighting strategy.
[0036] In some embodiments of this application, generating a quality sub-coefficient of the corresponding index based on the real-time evaluation value of each feature to be evaluated for the same image quality evaluation index includes: Pre-set the evaluation value threshold for each feature to be evaluated; The difference between the real-time evaluation value and the corresponding evaluation value threshold is obtained. The evaluation features are then classified according to the real-time evaluation difference to obtain the normal feature set and abnormal feature set for each indicator. The real-time evaluation difference for each feature is quantified into the corresponding real-time type coefficient. The comprehensive anomaly coefficient is calculated based on the number of features in the anomaly feature set, the real-time type coefficients of all features, and the weight coefficients of the corresponding features. The comprehensive normal coefficient is calculated based on the number of features in the normal feature set, the real-time type coefficients of all features, and the weight coefficients of the corresponding features. The quality sub-coefficients of the corresponding indicators are generated based on the comprehensive anomaly coefficient and the comprehensive normal coefficient.
[0037] In this embodiment, the evaluation value threshold is obtained by correcting the preset evaluation value threshold based on the feature compensation coefficient under the corresponding indicator. In this application, the preset evaluation value threshold for each feature is 0.75. The feature compensation coefficient is set based on the correlation coefficient of the feature with respect to the indicator. The higher the correlation coefficient, the larger the feature compensation coefficient, and vice versa. The value range of the feature compensation coefficient is 0.8-1.2. The mapping relationship between the correlation coefficient and the feature compensation coefficient is determined by linear interpolation. In this application, when the correlation coefficient is 0.6, the feature compensation coefficient is 0.8; when the correlation coefficient is 0.8, the feature compensation coefficient is 1.0; and when the correlation coefficient is 1.0, the feature compensation coefficient is 1.2, thereby realizing the dynamic adjustment of the evaluation value threshold.
[0038] In this embodiment, the real-time evaluation difference = real-time evaluation value - evaluation value threshold. When the real-time evaluation difference is not less than 0, the corresponding feature is classified into the normal feature set; otherwise, it is classified into the abnormal feature set.
[0039] In this embodiment, the real-time type coefficient = real-time evaluation difference / evaluation value threshold. The real-time type coefficient of each feature in the normal feature set is not less than 0, and the real-time type coefficient of each feature in the abnormal feature set is less than 0.
[0040] In this embodiment, the specific formula for calculating the comprehensive anomaly coefficient or comprehensive normal coefficient is: Comprehensive anomaly / normal coefficient = (the sum of the real-time type coefficients of each feature in the anomaly / normal feature set × the weight coefficients of the corresponding features).
[0041] In this embodiment, the formula for calculating the quality sub-coefficient is: Comprehensive Normal Coefficient × (Number of features in the normal feature set / Total number of features to be evaluated) + Comprehensive Abnormal Coefficient × (Number of features in the abnormal feature set / Total number of features to be evaluated). This formula comprehensively considers the impact of normal and abnormal features on the indicator, with the proportions of the normal and abnormal feature sets used as weights, ensuring that the quality sub-coefficient fully reflects the overall performance of all features to be evaluated under this indicator.
[0042] In this embodiment, by dynamically weighting the proportion of features in the abnormal feature set and the normal feature set, the comprehensive impact of different feature states on image quality evaluation indicators can be quantified more accurately, providing a reliable basis for subsequently determining the feature sequence of quality defects.
[0043] In some embodiments of this application, determining a sequence of quality defect features includes: The quality sub-coefficients of the image quality evaluation indicators of the same sub-image to be identified are selected if they are less than the preset quality sub-coefficient threshold, and the difference in quality sub-coefficients of the corresponding indicators is calculated. The number of defect features for each indicator is determined by matching the difference in mass coefficients with the preset range of mass coefficient differences, and by mapping the preset number of defect features to the range of mass coefficient differences and the current number of features to be evaluated for the corresponding indicator. The abnormal feature set of each selected indicator is sorted, and the top N features after sorting are selected as the defect features of the corresponding indicator according to the number of defect features. The weight coefficients of the defect features are generated based on the real-time type coefficients of the defect features and the weight coefficients of the corresponding indicators. The quality defect feature sequence of the corresponding sub-image is obtained by sorting all the defect features of the same sub-image according to the weight coefficient.
[0044] In this embodiment, the real-time type coefficients of each abnormal feature are sorted from smallest to largest (the smaller the real-time type coefficient, the more serious the feature defect). The top N features after sorting are selected as the defect features of the indicator, where N is the number of defect features of the indicator.
[0045] In this embodiment, the preset quality sub-coefficient threshold is 0.65. When the quality sub-coefficient of a certain image quality evaluation index is less than this threshold, it is determined that the index has quality defects and further screening of specific defect features is required.
[0046] In this embodiment, the quality sub-coefficient difference = preset quality sub-coefficient threshold - actual quality sub-coefficient, used to quantify the degree of defect of the indicator. The preset quality sub-coefficient difference range includes [0, 0.1), [0.1, 0.2), [0.2, 0.3), and ≥0.3, which correspond to preset defect feature numbers of 1, 2, 3, and 4, respectively. The mapping relationship between the preset difference range and the preset number is derived from the statistical analysis of historical data from a large number of scenic spot QR code scanning scenarios.
[0047] In this embodiment, the defect feature weight coefficient = the absolute value of the real-time type coefficient of the defect feature × the weight coefficient of the corresponding indicator × the weight coefficient of the feature itself, where the weight coefficient of the feature itself is the normalized weight coefficient of the feature in the corresponding indicator to be evaluated. The weight coefficient calculated by this formula can comprehensively reflect the severity of the defect feature, the importance of the indicator to which it belongs, and the degree of influence of the feature itself on the indicator.
[0048] In this embodiment, by determining the defect features of each indicator and ranking the importance of all defect features of the same sub-image to be identified, the most critical feature items affecting image quality can be clearly identified, laying the foundation for subsequent targeted generation of environmental lighting strategies.
[0049] In some embodiments of this application, an environmental lighting strategy for generating corresponding sub-images by combining a preset lighting model and real-time environmental features includes: Obtain the historical lighting log of the scenic area's electronic ticket, and extract the historical lighting strategies, historical changes in historical image features, and corresponding historical environmental features from the historical lighting log. A training sample set for a preset lighting model is constructed based on historical lighting strategies, historical changes in historical image features, and historical environmental features. The preset lighting model is then trained using the gradient descent algorithm. Collect real-time environmental features of the current scanning environment, including real-time light intensity, light direction, relative distance and angle between the device and the electronic ticket; The quality defect feature sequence and real-time environmental features of each sub-image to be identified are input into the trained preset supplementary lighting model to generate an environmental supplementary lighting strategy. The ambient lighting strategy includes lighting type, lighting intensity, lighting angle, and lighting duration.
[0050] In this embodiment, the historical supplementary lighting log covers the QR code supplementary lighting data of the scenic area in different seasons and at different times (such as noon on a sunny day, evening on a cloudy day, and under night lights) over the past year. Each log records the image quality defect characteristics before supplementary lighting, environmental parameters, supplementary lighting strategy parameters, and the changes in historical image features before and after supplementary lighting.
[0051] In this embodiment, the preset supplementary lighting model adopts a multilayer perceptron structure. The input layer contains the weight coefficient vector of the quality defect feature sequence and the real-time environment feature vector. The hidden layer performs nonlinear mapping on the features through an activation function. The output layer outputs specific parameter values for the supplementary lighting type (visible light source or infrared light source), supplementary lighting intensity (0-100% adjustable), supplementary lighting angle (-45° to 45° horizontal adjustment), and supplementary lighting duration (0.5-3 seconds).
[0052] In this embodiment, real-time environmental features are collected in real time through the light sensor, distance sensor, and angle sensor integrated into the scenic area gate.
[0053] In this embodiment, the model prioritizes ambient lighting for the defect features with the highest weight coefficients, generates lighting parameters for each defect feature in sequence, and then uses a multi-objective optimization algorithm to coordinately adjust each parameter to ensure that the lighting strategy can improve multiple defect features simultaneously.
[0054] In this embodiment, a preset supplementary lighting model trained based on historical data is constructed, and a deep fusion analysis is performed on the current image quality defect feature sequence and real-time environmental features to generate a targeted environmental supplementary lighting strategy. The generation process of this supplementary lighting strategy fully considers the repair priority of different defect features and the influence of environmental factors on the supplementary lighting effect, ensuring that the supplementary lighting operation can accurately improve image quality and increase the success rate of electronic ticket recognition.
[0055] In some embodiments of this application, an optimal environmental compensation strategy is generated based on the structural characteristics of the multi-source adaptive illumination array and the environmental illumination strategy for all sub-images, including: Obtain the structural characteristics of a multi-source adaptive supplementary lighting array, including the number of light sources, the type of light sources, the installation position coordinates of each light source, the adjustable angle range, and the supplementary lighting intensity range of a single light source; Based on the environmental illumination strategy of all sub-images to be identified and the structural characteristics of the multi-source adaptive illumination array, the demand distribution of illumination type, illumination intensity and illumination angle for each sub-image is statistically analyzed, and the conflict factors of illumination resources are marked. The conflict factors include conflicts in the supplementary lighting angle requirements, supplementary lighting intensity requirements, and light source type requirements for the same light source. The ambient lighting strategy for all sub-images is optimized and adjusted based on the conflict factor to generate the optimal ambient compensation strategy.
[0056] In this embodiment, the multi-source adaptive supplementary lighting array includes 8 independently controllable supplementary lighting units, of which 4 are white LED visible light sources (wavelength range 400-700nm) and 4 are infrared LED light sources (wavelength 850nm), which are evenly distributed in a ring around the barcode scanning camera. The horizontal adjustment angle range of each light source is -60° to 60°, and the vertical adjustment angle range is -30° to 30°. The supplementary lighting intensity of a single light source supports stepless adjustment from 0-100%, with a minimum adjustment accuracy of 1%.
[0057] In this embodiment, frequency statistics are performed on the supplementary lighting type requirements, intensity requirement ranges, and angle requirement ranges of all sub-images to be identified to obtain the requirement distribution.
[0058] In this embodiment, by cross-analyzing the environmental illumination strategies of all sub-images, conflicts in illumination resources are identified, and adjustments are made to generate the optimal environmental compensation strategy. This strategy can maximize the illumination requirements of all sub-images to be identified under the hardware constraints of the multi-source array, avoid waste or conflict of illumination resources, ensure the overall optimal illumination effect, and lay the foundation for subsequent processing of the overall electronic image and accurate identification.
[0059] In some embodiments of this application, the ambient lighting strategy for all sub-images is optimized and adjusted based on the conflict factor, including: Based on the conflict factor, all environmental lighting strategies are divided into conflict-free strategy set, low-conflict strategy set, and high-conflict strategy set; Integrate all environmental illumination strategies in the conflict-free strategy set, and generate the first illumination parameter based on the integration result; The conflict factors in the low-conflict strategy set are fine-tuned using a weighted average method, and the second supplementary lighting parameters are generated based on the fine-tuning results. Prioritize the sub-images corresponding to the environmental illumination strategies in the high-conflict strategy set, select strategies based on the ranking results, and generate the third illumination parameters based on the selection results. The first, second, and third supplementary lighting parameters are integrated to form the optimal ambient lighting strategy.
[0060] In this embodiment, a conflict-free strategy set refers to an environment lighting strategy in which there is no conflict among the supplementary lighting resources. In a low-conflict strategy set, there is a single conflict factor among the environmental supplementary lighting strategies and the conflict value is within the threshold. In a high-conflict strategy set, there are multiple conflict factors among the environmental supplementary lighting strategies or the conflict value exceeds the threshold. The conflict value refers to the quantitative index of different conflict factors. The supplementary lighting angle conflict value is the absolute value of the angle difference between two conflicting strategies. The supplementary lighting intensity conflict value is the ratio of the intensity difference to the maximum intensity. The light source type conflict value is set to 0 (consistent) or 1 (inconsistent) depending on whether the types are consistent. The conflict value threshold is determined based on a large amount of experimental data and actual application scenarios. In this application, the supplementary lighting angle conflict value threshold is set to 15° and the supplementary lighting intensity conflict value threshold is set to 20%.
[0061] In this embodiment, the first supplementary lighting parameter includes the specific values of supplementary lighting type, supplementary lighting intensity, supplementary lighting angle, and supplementary lighting duration for each environmental supplementary lighting strategy in the conflict-free strategy set. The second supplementary lighting parameter includes the supplementary lighting intensity (taken as the weighted average of the intensity requirements of conflict strategies, with the weight being the sum of the weight coefficients of the quality defect feature sequences of the corresponding sub-images for each strategy) and the supplementary lighting angle (taken as the weighted average of the angle requirements of conflict strategies, with the same weight as above). The supplementary lighting type and supplementary lighting duration retain the parameters with the highest proportion among the conflict strategies. The third supplementary lighting parameter is based on the sub-image priority ranking result, prioritizing the retention of environmental supplementary lighting strategy parameters for sub-images with high priority. For sub-images with low priority, if their supplementary lighting requirements conflict with the retained strategies, their supplementary lighting parameters are adjusted to a range compatible with the retained strategies, or the supplementary lighting requirements of the sub-image are temporarily discarded when resources are scarce, and re-evaluated in subsequent cycles.
[0062] In this embodiment, the three types of supplementary lighting parameters are integrated, and the resulting optimal environmental supplementary lighting strategy can meet the differentiated supplementary lighting needs of different sub-images under the hardware limitations of the multi-source array. This ensures the supplementary lighting effect of key sub-images while also taking into account the overall utilization efficiency of supplementary lighting resources.
[0063] In some embodiments of this application, several sub-images to be identified after supplemental lighting are stitched together to obtain an overall electronic image of each tourist. The identification result of the overall electronic image of the tourist is generated based on a preset decoding model, including: The sub-images to be identified after supplemental lighting are preprocessed, feature points of each preprocessed sub-image are extracted, and feature point matching is performed. The matching feature points are determined by calculating the Euclidean distance between feature points. The spatial transformation relationship between sub-images is established based on the coordinates of the matched feature points. Based on this spatial transformation relationship, and combined with the weighted average fusion algorithm, the overlapping areas are processed to achieve a smooth transition and form an overall electronic image. The stitched overall electronic image is input into a preset decoding model to obtain the recognition result of the overall electronic image.
[0064] In this embodiment, the feature points of each sub-image include, but are not limited to, the relative position information of each sub-image in the overall electronic image, edge contour features, electronic ticket positioning patterns (such as position detection graphics, alignment graphics), and module arrangement rules.
[0065] In this embodiment, the preprocessing steps include grayscale conversion, noise reduction, and contrast enhancement to ensure the accuracy of feature point extraction.
[0066] In this embodiment, during the feature point matching process, the Euclidean distance threshold is set to 5 pixels. When the Euclidean distance between two feature points is less than this threshold, they are determined to be matching feature points. At the same time, the Random Sampling Consensus Algorithm (RANSAC) is used to remove false matching points, thereby improving the matching accuracy.
[0067] In this embodiment, the spatial transformation relationship adopts an affine transformation model, and the transformation matrix is solved by the least squares method to achieve the alignment of sub-images in a unified coordinate system.
[0068] In this embodiment, weighted average fusion refers to using the distance between the centers of the sub-images as the weighting basis. The closer the sub-image pixels are to the center of the overlapping area, the higher their weight, thus avoiding obvious seams at the stitching edges.
[0069] In this embodiment, the preset decoding model uses a large amount of scenic spot electronic ticket sample data during the training phase and adopts an end-to-end QR code recognition network based on deep learning. This network is based on ResNet50 architecture and adds a CTC (Connection Temporal Classification) loss function layer at the end of the network, which can directly output the text information of the QR code.
[0070] In this embodiment, through the above steps, even if some sub-images have quality defects due to initial environmental issues, they can be stitched together into a complete electronic ticket image through supplementary lighting optimization and precise stitching, thereby improving the integrity and clarity of the electronic ticket image and enhancing the accuracy of the preset decoding model in recognizing the electronic ticket text information, thus completing the scanning and verification process of the scenic spot's electronic ticket.
[0071] In some embodiments of this application, such as Figure 2 As shown, it also includes a scenic area electronic ticket scanning and recognition system, which adopts the above-mentioned scenic area electronic ticket scanning and recognition method, including: The capture module is used to capture the electronic ticket image of each tourist, map it to several sub-regions to be identified, and obtain the sub-image to be identified in each region; The analysis module is used to perform real-time quality analysis on the sub-image to be identified, obtain the quality coefficient and determine whether adjustment is needed. If so, it determines the quality defect feature sequence and generates the corresponding sub-image's environmental supplementary lighting strategy by combining the preset supplementary lighting model and real-time environmental features. The supplementary lighting module is used to generate the optimal environmental compensation strategy based on the structural characteristics of the multi-source adaptive supplementary lighting array and the environmental supplementary lighting strategy of all sub-images, and to issue supplementary lighting commands. The recognition module is used to stitch together several sub-images to be recognized after supplemental lighting to obtain the overall electronic image of each tourist, and to generate the recognition result of the overall electronic image of the tourist based on a preset decoding model.
[0072] In this embodiment, the supplementary lighting module includes a multi-source adaptive supplementary lighting array. The supplementary lighting module and the multi-source adaptive supplementary lighting array are connected through a high-speed bus. The module can complete the parameter configuration and drive control of each light source unit according to the optimal environmental compensation strategy, thereby achieving a fast supplementary lighting response.
[0073] In this embodiment, the capture module uses a high-resolution industrial camera (resolution not less than 2592×1944 pixels), equipped with an autofocus lens, and supports an image acquisition speed of 30 frames per second. It can quickly respond to tourists' scanning actions and ensure that clear images can still be captured while tourists are moving with their electronic tickets in hand.
[0074] In this embodiment, the analysis module has a built-in high-performance embedded processor, equipped with an image quality analysis algorithm and a preset supplementary lighting model inference engine. It can complete the quality analysis of a single sub-image and generate a supplementary lighting strategy within 50 milliseconds, meeting the real-time requirements.
[0075] In this embodiment, the recognition module integrates an image stitching algorithm and a preset decoding model. The preset decoding model undergoes quantization and compression processing, enabling it to run efficiently on an embedded platform and ensuring the smoothness of the tourist QR code verification process. Furthermore, the system includes a data storage module to record the original image data, supplementary lighting strategy parameters, recognition results, and environmental feature data for each QR code scan, providing data support for subsequent model optimization and system maintenance.
[0076] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and substitutions can be made without departing from the technical principles of this application, and these improvements and substitutions should also be considered within the scope of protection of this application.
Claims
1. A method for scanning and recognizing electronic tickets for scenic spots, characterized in that, include: Capture the electronic ticket image of each tourist, map it to several sub-regions to be identified, and obtain the sub-image to be identified in each region; Real-time quality analysis is performed on the sub-image to be identified to obtain the quality coefficient and determine whether adjustment is needed. If so, the quality defect feature sequence is determined, and the corresponding environmental supplementary lighting strategy for the sub-image is generated by combining the preset supplementary lighting model and real-time environmental features. Based on the structural characteristics of the multi-source adaptive illumination array and the environmental illumination strategy of all sub-images, the optimal environmental compensation strategy is generated, and the illumination command is issued. Several sub-images to be identified after supplemental lighting are stitched together to obtain the overall electronic image of each tourist. The recognition result of the overall electronic image of the tourist is generated based on the preset decoding model.
2. The method for scanning and recognizing electronic tickets for scenic spots as described in claim 1, characterized in that, Capture the electronic ticket image of each tourist, map it to several preset sub-regions to be identified, and obtain the sub-image to be identified in each region, including: The image of the electronic ticket displayed by the tourist is acquired in real time by the image acquisition device. The image is then preprocessed, including grayscale conversion, noise reduction and edge detection, to obtain the image region outline. The length and width of the overall recognition region are determined based on the bounding rectangle of the image region contour. Then, the region is evenly divided according to the preset number of rows and columns of sub-regions. If the area of the edge sub-region after division is less than the preset area threshold, it is merged with the adjacent region. Generate several sub-regions to be identified; The generated sub-regions to be identified are marked with coordinates. The preprocessed electronic ticket image is mapped and cut according to the coordinate range of each sub-region to obtain the sub-image to be identified corresponding to each sub-region. The relative position information of each sub-image in the whole electronic image is recorded.
3. The method for scanning and recognizing electronic tickets for scenic spots as described in claim 2, characterized in that, Real-time quality analysis is performed on the sub-image to be recognized to obtain quality coefficients and determine whether adjustments are needed, including: Several image quality evaluation indicators are pre-defined; Image features are extracted from each sub-image to be identified to obtain several real-time image features; Calculate the correlation coefficient between real-time image features and each image quality evaluation index, and use real-time image features with correlation coefficients greater than a preset correlation coefficient threshold as the features to be evaluated for the corresponding image quality evaluation index. Generate real-time evaluation values for each feature to be evaluated in the image quality evaluation index; The quality sub-coefficient of the corresponding index is generated based on the real-time evaluation value of each feature to be evaluated for the same image quality evaluation index. The quality coefficients are obtained by summing the weights of the quality sub-coefficients of all image quality evaluation indicators and the corresponding weight coefficients. If the quality coefficient is less than the preset quality coefficient threshold, it is determined that adjustment is needed.
4. The method for scanning and recognizing electronic tickets for scenic spots as described in claim 3, characterized in that, Based on the real-time evaluation value of each feature to be evaluated for the same image quality evaluation index, a quality sub-coefficient for the corresponding index is generated, including: Pre-set the evaluation value threshold for each feature to be evaluated; The difference between the real-time evaluation value and the corresponding evaluation value threshold is obtained. The evaluation features are then classified according to the real-time evaluation difference to obtain the normal feature set and abnormal feature set for each indicator. The real-time evaluation difference for each feature is quantified into the corresponding real-time type coefficient. The comprehensive anomaly coefficient is calculated based on the number of features in the anomaly feature set, the real-time type coefficients of all features, and the weight coefficients of the corresponding features. The comprehensive normal coefficient is calculated based on the number of features in the normal feature set, the real-time type coefficients of all features, and the weight coefficients of the corresponding features. The quality sub-coefficients of the corresponding indicators are generated based on the comprehensive anomaly coefficient and the comprehensive normal coefficient.
5. The method for scanning and recognizing electronic tickets for scenic spots as described in claim 4, characterized in that, If so, determine the sequence of quality defect characteristics, including: The quality sub-coefficients of the image quality evaluation indicators of the same sub-image to be identified are selected if they are less than the preset quality sub-coefficient threshold, and the difference in quality sub-coefficients of the corresponding indicators is calculated. The number of defect features for each indicator is determined by matching the difference in mass coefficients with the preset range of mass coefficient differences, and by mapping the preset number of defect features to the range of mass coefficient differences and the current number of features to be evaluated for the corresponding indicator. The abnormal feature set of each selected indicator is sorted, and the top N features after sorting are selected as the defect features of the corresponding indicator according to the number of defect features. The weight coefficients of the defect features are generated based on the real-time type coefficients of the defect features and the weight coefficients of the corresponding indicators. The quality defect feature sequence of the corresponding sub-image is obtained by sorting all the defect features of the same sub-image according to the weight coefficient.
6. The method for scanning and recognizing electronic tickets for scenic spots as described in claim 1, characterized in that, An environmental lighting strategy that combines a preset lighting model with real-time environmental features to generate corresponding sub-images includes: Obtain the historical lighting log of the scenic area's electronic ticket, and extract the historical lighting strategies, historical changes in historical image features, and corresponding historical environmental features from the historical lighting log. A training sample set for a preset lighting model is constructed based on historical lighting strategies, historical changes in historical image features, and historical environmental features. The preset lighting model is then trained using the gradient descent algorithm. Collect real-time environmental features of the current scanning environment, including real-time light intensity, light direction, relative distance and angle between the device and the electronic ticket; The quality defect feature sequence and real-time environmental features of each sub-image to be identified are input into the trained preset supplementary lighting model to generate an environmental supplementary lighting strategy. The ambient lighting strategy includes lighting type, lighting intensity, lighting angle, and lighting duration.
7. The method for scanning and recognizing electronic tickets for scenic spots as described in claim 1, characterized in that, Based on the structural characteristics of the multi-source adaptive illumination array and the environmental illumination strategy for all sub-images, an optimal environmental compensation strategy is generated, including: Obtain the structural characteristics of a multi-source adaptive supplementary lighting array, including the number of light sources, the type of light sources, the installation position coordinates of each light source, the adjustable angle range, and the supplementary lighting intensity range of a single light source; Based on the environmental illumination strategy of all sub-images to be identified and the structural characteristics of the multi-source adaptive illumination array, the demand distribution of illumination type, illumination intensity and illumination angle for each sub-image is statistically analyzed, and the conflict factors of illumination resources are marked. The conflict factors include conflicts in the supplementary lighting angle requirements, supplementary lighting intensity requirements, and light source type requirements for the same light source. The ambient lighting strategy for all sub-images is optimized and adjusted based on the conflict factor to generate the optimal ambient compensation strategy.
8. The method for scanning and recognizing electronic tickets for scenic spots as described in claim 7, characterized in that, The ambient lighting strategy for all sub-images is optimized and adjusted based on the conflict factor, including: Based on the conflict factor, all environmental lighting strategies are divided into conflict-free strategy set, low-conflict strategy set, and high-conflict strategy set; Integrate all environmental illumination strategies in the conflict-free strategy set, and generate the first illumination parameter based on the integration result; The conflict factors in the low-conflict strategy set are fine-tuned using a weighted average method, and the second supplementary lighting parameters are generated based on the fine-tuning results. Prioritize the sub-images corresponding to the environmental illumination strategies in the high-conflict strategy set, select strategies based on the ranking results, and generate the third illumination parameters based on the selection results. The first, second, and third supplementary lighting parameters are integrated to form the optimal ambient lighting strategy.
9. The method for scanning and recognizing electronic tickets for scenic spots as described in claim 8, characterized in that, Several sub-images to be identified after supplemental lighting are stitched together to obtain the overall electronic image of each tourist. Based on a preset decoding model, the recognition result of the overall electronic image of the tourist is generated, including: The sub-images to be identified after supplemental lighting are preprocessed, feature points of each preprocessed sub-image are extracted, and feature point matching is performed. The matching feature points are determined by calculating the Euclidean distance between feature points. The spatial transformation relationship between sub-images is established based on the coordinates of the matched feature points. Based on this spatial transformation relationship, and combined with the weighted average fusion algorithm, the overlapping areas are processed to achieve a smooth transition and form an overall electronic image. The stitched overall electronic image is input into a preset decoding model to obtain the recognition result of the overall electronic image.
10. A scenic area electronic ticket scanning and recognition system, employing the scenic area electronic ticket scanning and recognition method according to any one of claims 1-9, characterized in that, include: The capture module is used to capture the electronic ticket image of each tourist, map it to several sub-regions to be identified, and obtain the sub-image to be identified in each region; The analysis module is used to perform real-time quality analysis on the sub-image to be identified, obtain the quality coefficient and determine whether adjustment is needed. If so, it determines the quality defect feature sequence and generates the corresponding sub-image's environmental supplementary lighting strategy by combining the preset supplementary lighting model and real-time environmental features. The supplementary lighting module is used to generate the optimal environmental compensation strategy based on the structural characteristics of the multi-source adaptive supplementary lighting array and the environmental supplementary lighting strategy of all sub-images, and to issue supplementary lighting commands. The recognition module is used to stitch together several sub-images to be recognized after supplemental lighting to obtain the overall electronic image of each tourist, and to generate the recognition result of the overall electronic image of the tourist based on a preset decoding model.