Intelligent community access control optimization identification method based on machine vision
By dynamically adjusting the Gaussian scale parameters of the multi-scale Retinex algorithm in the community's intelligent access control system, and optimizing the image enhancement method based on the similarity of feature regions and the difference in illumination, the problem of recognition accuracy caused by changes in illumination conditions in the community access control environment is solved, and the recognition effect is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHAANXI YUNONG YUNZHI INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-04-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In existing technologies, the Gaussian scale parameters of the multi-scale Retinex algorithm are statically set, which cannot adapt to the complex and varied lighting conditions in the community access control environment, resulting in unstable image enhancement effects and affecting the accuracy of facial feature recognition.
By analyzing historical facial images of residents in the community, feature regions are divided and assigned region numbers. Based on the similarity of feature regions and differences in illumination, the Gaussian scale parameter is dynamically adjusted, and the Retinex algorithm is used for image enhancement to optimize facial feature recognition.
Adaptive optimization of the image enhancement process was achieved, improving the recognition accuracy and stability of the community's intelligent access control system under complex lighting conditions.
Smart Images

Figure CN121904879A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and in particular to an optimized recognition method for smart access control in residential communities based on machine vision. Background Technology
[0002] With the acceleration of urbanization and the development of smart community construction, the demand for security management at community entrances and exits is constantly increasing. In recent years, in order to effectively retain and trace the identities of people entering and exiting the community, intelligent access control technology based on machine vision has been gradually promoted and applied. Specifically, it involves collecting facial images of people through cameras and using face detection and feature extraction algorithms to achieve identity matching. It has the advantages of being contactless, having high passage efficiency, and providing a good user experience, and is gradually becoming an important part of smart community construction.
[0003] However, in real-world residential applications, lighting conditions are complex and variable. Residential entrances are often semi-open environments, significantly affected by natural light, and issues such as backlighting, metering, shadow occlusion, low light at night, and rain / snow reflections cause uneven brightness and decreased contrast in facial images captured by cameras, severely impacting the stability of facial feature extraction. Therefore, existing technologies typically enhance facial images before facial feature extraction to improve image quality. Existing image enhancement methods usually use the multi-scale Retinex algorithm, which decomposes the image into the object's true color (reflection component) and lighting effects (illumination component), removing uneven lighting and retaining only true texture and color, thus addressing problems such as backlighting, shadow occlusion, low light at night, local overexposure, and uneven lighting.
[0004] The Gaussian scale, as a crucial parameter in the multi-scale Retinex algorithm, controls the spatial range of illumination estimation and determines the intensity of detail enhancement and the overall illumination balance in the image. However, the Gaussian scale in the multi-scale Retinex algorithm is a static parameter, while the environment of a residential access control system is highly dynamic. A static Gaussian scale cannot simultaneously adapt to various scenarios such as strong backlighting, low light, and sidelighting, potentially leading to insufficient or excessive enhancement in certain scenarios.
[0005] Therefore, how to dynamically set the Gaussian scale in the multi-scale Retinex algorithm to achieve adaptive closed-loop optimization of image enhancement and facial feature recognition has become an urgent problem to be solved. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a machine vision-based intelligent access control system for residential communities to address the problem of how to dynamically set the Gaussian scale in the multi-scale Retinex algorithm to achieve adaptive closed-loop optimization of image enhancement and facial feature recognition.
[0007] This invention provides a machine vision-based optimized recognition method for smart access control in residential communities, which includes the following steps: When a resident's face image is captured at the current moment, historical face images of the resident within a preset short period before the current moment are obtained. Based on facial key points, the face region of each historical face image is divided into multiple feature regions and assigned a region number. Based on the similarity of the feature region corresponding to each region number in any two historical face images, and the illumination difference between the two historical face images, the key identification indicators of each feature region are obtained. For any multi-scale parameter within a preset Gaussian scale range, the Retinex algorithm of the any multi-scale parameter is used to enhance any historical face image to obtain an enhanced image. Based on the feature region matching degree difference and illumination difference between the any historical face image, the enhanced image and the registered image, as well as the key recognition indicators of each feature region in the any historical face image, the feature recognition effect of the any multi-scale parameter after enhancing the any historical face image is obtained. Based on the feature recognition effect of each historical face image enhanced by each multi-scale parameter within a preset Gaussian scale range, the optimal multi-scale parameter is selected within the preset Gaussian scale range, and the optimal multi-scale parameter is used to enhance the face image at the current moment for identification of residents in the community through the community smart access control system.
[0008] Preferably, the key identification indicators for each feature region are obtained based on the similarity of the feature regions corresponding to each region number in any two historical face images, and the illumination difference between the two historical face images, including: For any region number, feature matching is performed on two feature regions belonging to the region number in any historical face image and the target historical face image to obtain the corresponding matching degree. Based on the difference in brightness change between the historical face image and the target historical face image, the illumination difference degree between the historical face image and the target historical face image is obtained. The matching degree between any historical face image and two feature regions belonging to any region number in each target historical face image is obtained, as well as the illumination difference between any historical face image and each target historical face image. The illumination difference is used as a weight to perform a weighted average of all matching degrees to obtain the region similarity of any region number in any historical face image. Obtain the region similarity of any region number in each historical face image, and use the average of all region similarities as the key indicator for identifying the feature region corresponding to any region number. Here, the target historical face image refers to any historical face image other than the aforementioned historical face image.
[0009] Preferably, the step of obtaining the illumination difference between any historical face image and the target historical face image based on the brightness change difference between the two includes: Calculate the absolute value of the difference in the mean brightness between the face region in any historical face image and the face region in the target historical face image, and denot it as the average brightness difference. Calculate the ratio of the brightness variance between the face region in any historical face image and the face region in the target historical face image, and denot the absolute value of the difference between the ratio and a constant 1 as the brightness fluctuation difference. The product of the average brightness difference and the brightness fluctuation difference is taken as the illumination difference between the any historical face image and the target historical face image.
[0010] Preferably, the step of obtaining the feature recognition effect of enhancing the historical face image using the multi-scale parameter based on the feature region matching degree difference and illumination difference between the historical face image, the enhanced image, and the registered image, as well as the key recognition indicators of each feature region in the historical face image, includes: Based on the feature region matching degree between any historical face image and the enhanced image, and the illumination difference between any historical face image and the registered image, the illumination effect elimination effect of each feature region in any historical face image is obtained; Based on the difference in feature region matching degree between any historical face image, the enhanced image and the registered image, and the key identification indicators of each feature region in any historical face image, the identification contribution of each feature region in any historical face image is obtained. By combining the illumination effect elimination effect and recognition contribution of each feature region in any historical face image, the feature recognition effect of any multi-scale parameter after enhancing any historical face image is obtained.
[0011] Preferably, the method for obtaining the illumination effect elimination effect of each feature region in any historical face image includes: For any feature region in any historical face image, the illumination difference and matching degree between the feature region and the feature region with the same region number in the registration image are obtained respectively, and the matching degree is recorded as the unenhanced matching degree. The matching degree between the enhanced image and two feature regions with the same region number as the feature region in the registration image are obtained and recorded as the enhanced matching degree. Using the absolute value of the difference between the unenhanced matching degree and the enhanced matching degree as the denominator, and the illumination difference degree as the numerator, a corresponding ratio is obtained. The negative of the absolute value of the difference between the ratio and the constant 1 is used as the independent variable of an exponential function with the natural constant as the base, to obtain the illumination adaptability index of any multi-scale parameter for any feature region. The product between the illumination adaptability index and the enhanced matching degree is used as the illumination influence elimination effect of any feature region.
[0012] Preferably, the method for obtaining the recognition contribution of each feature region in any historical face image includes: Feature matching is performed on the face regions in the enhanced image and the face regions in the registration image to obtain the corresponding matching degree, which is denoted as the overall enhanced matching degree. The overall enhanced matching degree is used as the denominator, and the absolute value of the difference between the overall enhanced matching degree and the enhanced matching degree is used as the numerator to obtain the corresponding ratio. The negative of the ratio is substituted into an exponential function with the natural constant as the base to obtain the feature representativeness index of any feature region. The product of the feature representativeness index of any feature region and the key recognition index is used as the recognition contribution of any feature region.
[0013] Preferably, the step of combining the illumination effect elimination effect and recognition contribution of each feature region in any historical face image to obtain the feature recognition effect after enhancing any historical face image with any multi-scale parameter includes: Using the recognition contribution of each feature region in any historical face image as a weight, the illumination effect elimination effect of each feature region in any historical face image is weighted and averaged to obtain the feature recognition effect of any multi-scale parameter after enhancing any historical face image.
[0014] Preferably, the step of enhancing the feature recognition effect of each historical face image based on each multi-scale parameter within a preset Gaussian scale range, and selecting the optimal multi-scale parameters within the preset Gaussian scale range, includes: For any multi-scale parameter, the enhanced feature recognition effect of each historical face image is obtained based on the enhanced feature recognition effect of the multi-scale parameter, and the enhanced recognition stability index of the multi-scale parameter is obtained; the enhanced recognition stability index of each multi-scale parameter is obtained, and the multi-scale parameter corresponding to the largest enhanced recognition stability index is taken as the optimal multi-scale parameter.
[0015] Preferably, the step of enhancing the feature recognition effect of each historical face image according to the multi-scale parameter to obtain the enhanced recognition stability index of the multi-scale parameter includes: Based on the feature recognition effect of each historical face image after enhancement according to any multi-scale parameter, calculate the average feature recognition effect, obtain the absolute value of the difference between the feature recognition effect corresponding to each historical face image and the average feature recognition effect, and use the negative of the absolute value of the difference as the independent variable of the exponential function with the natural constant as the base to obtain the weight coefficient of the corresponding historical face image. Based on the weighting coefficients, the feature recognition performance corresponding to all historical face images is weighted, summed, and averaged to obtain the enhanced recognition stability index for any multi-scale parameter.
[0016] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: This invention compares multiple historical facial images of residents in a community to analyze the key recognition indicators of each feature region under different time periods and lighting conditions. This analysis characterizes the information expression stability of each feature region and effectively distinguishes landmark feature regions with high lighting robustness. Image enhancement is performed on each historical facial image using different multi-scale parameters. By combining the key recognition indicators of each feature region, the image enhancement recognition effect of each feature region under different multi-scale parameters is analyzed, enabling a quantitative evaluation of the enhancement effect from the recognition result level. This transforms image enhancement from traditional visual optimization to a target optimization process oriented towards recognition performance. Based on the image enhancement recognition effect under different multi-scale parameters, the optimal multi-scale parameters suitable for the current facial image are dynamically selected. Adaptive compensation can be achieved for actual lighting conditions, improving the image enhancement effect. This method transforms the image enhancement process from a fixed parameter mode to an adaptive mode based on access control recognition feedback, significantly improving the recognition accuracy and stability of the community's intelligent access control system under complex lighting conditions. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a machine vision-based intelligent access control system optimization and recognition method for residential communities, provided in Embodiment 1 of the present invention. Detailed Implementation
[0019] Embodiments of this disclosure are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting it.
[0020] It should be noted that the terms "first," "second," etc., used in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.
[0021] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0022] The specific scenario addressed by this invention is as follows: Residential community entrances and exits are often semi-open environments, significantly affected by natural light, including backlighting, sidelighting, shadows, low light at night, and reflections from rain and snow. This results in uneven brightness and decreased contrast in facial images captured by the community's smart access control system, severely impacting the stability of facial feature extraction. Furthermore, the Gaussian scale in the multi-scale Retinex algorithm cannot adaptively adjust based on current lighting characteristics, leading to unstable image enhancement effects in different scenarios and a tendency to over-enhancement or loss of detail. Therefore, it is necessary to dynamically adjust the Gaussian scale based on recognition feedback from the access control management database to improve the stability of enhanced features and optimize access control recognition accuracy.
[0023] See Figure 1 This is a flowchart of a machine vision-based intelligent access control system optimization and recognition method for residential communities, as provided in Embodiment 1 of the present invention. Figure 1 As shown, the method may include: Step S101: When a face image of a resident in the community is acquired at the current moment, historical face images of the resident in the community within a preset short period of time before the current moment are obtained. Based on facial key points, the face region of each historical face image is divided into multiple feature regions and a region number is set. Based on the similarity of the feature region corresponding to each region number in any two historical face images and the illumination difference between any two historical face images, the key identification indicators of each feature region are obtained.
[0024] When the smart access control system in a residential community identifies residents, it collects facial image data of residents through smart access control cameras installed at the community entrances and exits. The facial image data includes resident registration images, historical facial images, and real-time captured facial images to be identified, all stored in the access control management database. Historical facial images are used to build a facial feature database of residents. These images are collected from multiple angles and under various lighting conditions, and after deduplication, quality screening, and standardization, feature vectors are extracted and stored in the access control management database. The real-time captured facial images to be identified are dynamically captured by the camera when the access control system is triggered. Through resolution unification, brightness normalization, and face detection and alignment processing, the consistency of real-time captured facial images with historical facial images in terms of data format, image quality, and feature dimensions is ensured. The registration images serve as biometric templates for identity verification.
[0025] When using the multi-scale Retinex algorithm to recognize facial images detected by community access control, the semi-open environment and complex, variable lighting at the access control points mean that a fixed Gaussian scale parameter cannot adapt to all lighting conditions. While it may enhance the image under some lighting conditions, it may lead to loss of detail or excessive noise under others. Therefore, in this embodiment of the invention, key features are extracted from historical facial images of residents within the same community. The enhancement of these key features is analyzed to assess their impact on access control recognition accuracy, thereby adaptively obtaining a suitable Gaussian scale parameter.
[0026] Taking a resident of a community as an example, when the access control camera captures the resident's face image at the current moment, it acquires the resident's historical face images within a preset short period of time before the current moment. In order to ensure that the historical face images provide effective information while covering different time periods and different lighting environments as much as possible, the preset short period of time is set to one week, that is, to acquire all the resident's historical face images within one week before the current moment.
[0027] Because different residents have different facial features, in community access control recognition, not all areas of the face contribute equally to identity recognition. Different areas differ in stability, discriminability, resistance to light intensity, and resistance to occlusion. Therefore, in order to analyze the recognition effect after image enhancement using fixed Gaussian scale parameters, it is necessary to determine the dominant feature areas of different residents. In this embodiment of the invention, the facial region of each historical facial image is divided into multiple feature regions based on facial key points and region numbers are set.
[0028] The method for dividing the facial region of each historical face image into multiple feature regions and assigning region numbers based on facial landmarks is as follows: Taking the a-th historical face image as an example, firstly, the face detection box (i.e., the face region) and facial landmark coordinates in the a-th historical face image are obtained using Google's MTCNN deep learning method. Facial landmarks include the coordinates of key points such as the eyes, nose tip, corner of the mouth, and eyebrows. Then, based on the coordinates of each facial landmark, a geometric rule segmentation algorithm is used to divide the face region into multiple feature regions, such as: left eye region, right eye region, bridge of nose region, lip region, forehead region, and chin region. Finally, according to a preset region labeling table, a region number is assigned to each feature region, for example: 1-left eye, 2-right eye, 3-nose, 4-lips, 5-forehead, 6-chin. It should be noted that feature region segmentation of the face region based on facial landmarks is an existing technology and will not be elaborated on here.
[0029] Since obtaining the feature regions in each historical face image is to improve the stability of subsequent recognition features, the key recognition indicators for each feature region can be obtained based on the similarity of the feature region corresponding to each region number in any two historical face images, as well as the illumination difference between the two historical face images. The method is as follows: When two historical facial images are under similar lighting conditions, the feature regions corresponding to residents of the same community should exhibit high similarity. Therefore, it is necessary to pay attention to the changes in feature regions under different lighting conditions and analyze the lighting changes in the facial regions between the two historical facial images. When there is a significant difference in brightness between the facial regions of any two historical facial images, it indicates a large difference in lighting conditions between the two historical facial images. However, if only average brightness is used as the basis for judging the magnitude of the difference in lighting conditions, it may lead to misjudgment. For example, when an image has obvious brightness gradient changes (such as local bright or shadow areas), its overall average brightness may be close to that of another image with a more uniform brightness distribution, but the actual lighting conditions of the two are significantly different. Therefore, only when the brightness fluctuations of two historical facial images are within a similar range and their average brightness is similar can they be considered to have a small difference in lighting conditions. In this embodiment of the invention, for the a-th historical face image and the b-th historical face image, the illumination difference between the a-th historical face image and the b-th historical face image is obtained based on the difference in brightness change between them. The specific method for obtaining this difference is as follows: Calculate the absolute value of the difference in the mean brightness between the face region in the a-th historical face image and the face region in the b-th historical face image, and denot it as the average brightness difference. Calculate the ratio of the brightness variance between the face region in the a-th historical face image and the face region in the b-th historical face image, and denot the absolute value of the difference between the ratio and the constant 1 as the brightness fluctuation difference. The product of the average brightness difference and the brightness fluctuation difference is taken as the illumination difference between the a-th historical face image and the b-th historical face image.
[0030] In one embodiment, the formula for calculating the illumination difference between the a-th historical face image and the b-th historical face image is: in, This represents the difference in illumination between the a-th historical face image and the b-th historical face image. This represents the average brightness of all pixels within the face region of the a-th historical face image; This represents the average brightness of all pixels within the face region of the b-th historical face image; The variance of brightness of all pixels within the face region of the a-th historical face image represents the degree of brightness fluctuation. Let || represent the luminance variance of all pixels within the face region of the b-th historical face image, where || represents the absolute value sign and 1 represents a constant.
[0031] It should be noted that, This represents the average brightness difference within the face region between the a-th historical face image and the b-th historical face image. The greater the average brightness difference, the greater the difference in illumination between the two historical face images. This is used to characterize the similarity of brightness fluctuations within the face region between historical face image a and historical face image b. The larger the value, the less similar the two historical face images are, indicating a greater difference in brightness fluctuations and a greater difference in illumination between them.
[0032] Under the same lighting conditions, the facial features of residents in the same community are highly similar. However, when the lighting conditions differ significantly, the feature regions still maintain high structural consistency and feature stability in two facial images, indicating that the feature regions are more critical for access control recognition. Therefore, for region number i, the SIFT feature matching algorithm is used to perform feature matching on two feature regions belonging to region number i in the a-th historical facial image and the target historical facial image, and the corresponding matching score is obtained, which is denoted as the matching degree. Here, the target historical facial image refers to any historical facial image other than the aforementioned historical facial image. The SIFT feature matching algorithm is an existing technology and will not be described in detail here.
[0033] Following the above method for obtaining illumination difference, the illumination difference between the a-th historical face image and the target historical face image is obtained. Similarly, the matching degree between the a-th historical face image and the two feature regions belonging to region number i in each target historical face image, as well as the illumination difference between the a-th historical face image and each target historical face image, are used as weights to perform a weighted average of all matching degrees to obtain the region similarity of region number i in the a-th historical face image.
[0034] In one embodiment, the formula for calculating the region similarity of region i in the a-th historical face image is: in, Let represent the region similarity of region i in the a-th historical face image. This represents the difference in illumination between the a-th historical face image and the b-th historical face image. The matching degree between two feature regions belonging to region number i in the a-th historical face image and the b-th historical face image is represented by N, where N represents the number of historical face images and N-1 represents the number of historical face images other than the a-th historical face image, which is also the number of target historical face images.
[0035] It should be noted that the region similarity of region number i in the a-th historical face image indicates that even with greater differences in lighting conditions between the a-th historical face image and each target historical face image, the matching degree between the two feature regions belonging to region number i remains high, indicating that the feature region corresponding to region number i is the key feature region for identifying residents of the community.
[0036] Similarly, the region similarity of region i in each historical face image is obtained, and the average of all region similarities is used as the key indicator for identifying the feature region corresponding to region i. The formula for calculating the key indicator for identifying the feature region corresponding to region i is as follows: in, The key indicator for identifying the feature region corresponding to region number i is denoted by , and N represents the number of historical face images. This represents the region similarity of region number i in the a-th historical face image.
[0037] Following the method for obtaining the key identification indicators of the feature region corresponding to region number i, the key identification indicators of the feature region corresponding to each region number are obtained respectively, thereby obtaining the key identification indicators of each feature region in each historical face image. Step S102: For any multi-scale parameter within the preset Gaussian scale range, enhance any historical face image using the Retinex algorithm with any multi-scale parameter to obtain an enhanced image. Based on the feature region matching degree difference and illumination difference between any historical face image, the enhanced image and the registered image, as well as the key recognition indicators of each feature region in any historical face image, obtain the feature recognition effect of any multi-scale parameter enhancing any historical face image.
[0038] In intelligent access control systems for residential communities, different lighting conditions significantly affect the texture and brightness distribution of facial images, thus interfering with the recognition stability of feature regions. To improve recognition accuracy, relying solely on a fixed Gaussian scale parameter cannot accommodate various lighting scenarios. Therefore, in this embodiment of the invention, the enhancement effect of feature regions under different lighting conditions is analyzed. That is, by applying different Gaussian scale parameters to feature regions, the feature stability and matching accuracy under different lighting conditions are observed to obtain the optimal Gaussian scale parameter for image enhancement of the facial image at the current moment.
[0039] The Gaussian scaling parameter in the multi-scale Retinex algorithm typically includes small scales. (Local texture enhancement), mesoscale (Local illumination balance) and large scale (Global Illumination Smoothing) enhances key details (eyes, nose, mouth) at small scales to prevent textures from being suppressed by illumination, balances local shadows or local overexposure at medium scales to take into account both details and illumination, and compensates for overall brightness unevenness at large scales to improve backlighting or shadows. Therefore, in this embodiment of the invention, the Retinex algorithm at three scales is used for image enhancement, which can cover the typical range of illumination changes in the community access control environment.
[0040] For the Gaussian scale range in the multi-scale Retinex algorithm, the smaller scale should be preferred. The value range is [5, 20], which can enhance local key features (eyes, nose tip, corners of mouth, etc.). The lower limit ensures that details can be captured, and the upper limit avoids excessive smoothing or noise amplification in local areas; mesoscale The value range is [40, 80], which can balance local lighting changes and take into account both details and overall lighting compensation. The empirical range is suitable for most backlit scenes in the early morning and late evening or low-light indoor scenes; large-scale The value range is [150, 250], which can smooth the overall illumination distribution and reduce the difference in illumination gradient. The upper limit is determined by the size of the face ROI and the camera resolution to avoid excessive blurring of key features.
[0041] Based on a preset Gaussian scale range, multi-scale parameters with different value combinations can be obtained through brute-force traversal. Brute-force traversal is an existing technique and will not be elaborated here. Instead, taking a multi-scale parameter as an example, denoted as the x-th multi-scale parameter, the multi-scale Retinex algorithm is used to enhance the a-th historical face image with the x-th multi-scale parameter, obtaining the corresponding enhanced image. Then, the registration image of the community residents is obtained. Based on the differences in feature region matching degree and illumination differences between the a-th historical face image, the enhanced image, and the registration image, as well as the key recognition indicators of each feature region in the a-th historical face image, the feature recognition effect of enhancing the a-th historical face image with the x-th multi-scale parameter is obtained. The specific operation is as follows: (1) Based on the feature region matching degree between the a-th historical face image and the enhanced image, and the illumination difference between the a-th historical face image and the registered image, obtain the illumination effect elimination effect of each feature region in the a-th historical face image.
[0042] The higher the enhancement effect of the feature region in the a-th historical face image under complex lighting conditions (such as strong light, low light at night, or backlight), the stronger the adaptability of the corresponding multi-scale parameters to the lighting of the feature region in the a-th historical face image. Therefore, for the k-th feature region in the a-th historical face image, the registration image is divided into regions according to the feature region division method of historical face images, resulting in multiple feature regions with region numbers. According to the methods for obtaining lighting difference and matching degree, the lighting difference between the k-th feature region and the feature regions with the same region number in the registration image are obtained respectively. and matching degree And the matching degree is recorded as the unenhanced matching degree. The matching degree between the enhanced image and the registered image is obtained, which is the matching degree between two feature regions that belong to the same region number as the k-th feature region. This matching degree is denoted as the enhanced matching degree. .
[0043] Using the absolute value of the difference between the unenhanced matching degree and the enhanced matching degree as the denominator, and the illumination difference degree as the numerator, the corresponding ratio is obtained. The negative of the absolute value of the difference between this ratio and the constant 1 is used as the independent variable of an exponential function with the natural constant as the base, to obtain the illumination adaptability index of the x-th multi-scale parameter to the k-th feature region. The calculation formula for the illumination adaptability index of the x-th multi-scale parameter to the k-th feature region is as follows: in, This represents the illumination adaptability index of the x-th multi-scale parameter to the k-th feature region in the a-th historical face image. This represents an exponential function with the natural constant as its base. This represents the illumination difference between the k-th feature region in the a-th historical face image and the feature region with the same region number in the registered image. This represents the matching degree between the k-th feature region in the a-th historical face image and the feature region with the same region number in the registered image. This represents the matching degree between the k-th feature region in the enhanced image and the feature region with the same region number in the registered image. 1 represents a constant, and || represents the absolute value sign.
[0044] It should be noted that, The term is used to characterize the difference in illumination between the k-th feature region in the a-th historical face image and the corresponding feature region in the registered image. This indicates that the greater the difference in matching degree between the k-th feature region in the a-th historical face image and the corresponding feature region in the registered image before and after enhancement, the better the image enhancement effect of the x-th multi-scale parameter on the a-th historical face image. In this case, the x-th multi-scale parameter has a stronger adaptability to the illumination of the k-th feature region.
[0045] The purpose of using the multi-scale Rxtinex algorithm to enhance historical face images is to eliminate the influence of different lighting conditions. Gaussian scale, as an important parameter for estimating the lighting range, determines the effectiveness of lighting effect elimination. The stronger the lighting adaptability of the x-th multi-scale parameter to the feature region in the a-th historical face image, the higher the matching degree between that feature region after image enhancement with the x-th multi-scale parameter and the corresponding feature region in the registered image. This indicates that the x-th multi-scale parameter adapts well to the lighting conditions in the a-th historical face image, and the matching and recognition effect after image enhancement is also better. Therefore, the product of the lighting adaptability index of the k-th feature region and the enhanced matching degree is taken as the lighting effect elimination effect of the k-th feature region, which is the effect of using the x-th multi-scale parameter to eliminate the lighting effect of the k-th feature region in the a-th historical face image. The lighting effect elimination effect of the k-th feature region... The calculation formula is: .
[0046] (2) Based on the difference in feature region matching degree between the a-th historical face image, the enhanced image and the registered image, and the key identification indicators of each feature region in the a-th historical face image, obtain the identification contribution of each feature region in the a-th historical face image.
[0047] When evaluating the access control recognition effect of any facial image, in addition to the feature regions being crucial for identifying residents, it is also necessary to analyze the recognition importance of the feature regions within the corresponding facial image. In community access control recognition, during the matching and recognition process between the real-time facial image of a resident and the registered image, if the matching degree between a certain feature region in the real-time facial image and the corresponding feature region in the registered image is close to the matching degree of the facial region in the real-time facial image, it indicates that the feature region is more representative for accurately identifying residents. Therefore, feature matching is performed on the facial regions in the enhanced image and the facial regions in the registered image to obtain the corresponding matching degree, which is denoted as the overall enhanced matching degree. Using the overall enhanced matching degree as the denominator and the absolute value of the difference between the overall enhanced matching degree and the enhanced matching degree as the numerator, the corresponding ratio is obtained. Substituting the negative of the ratio into an exponential function with the natural constant as the base, the feature representativeness index of the k-th feature region is obtained.
[0048] In one embodiment, the formula for calculating the characteristic representativeness index of the k-th characteristic region is: in, This represents the feature representativeness index of the k-th feature region in the a-th historical face image. This represents an exponential function with the natural constant as its base. This represents the matching degree between the k-th feature region in the enhanced image and the feature region with the same region number in the registered image. This indicates the degree of matching between the face regions in the enhanced image and the face regions in the registered image, where | represents the absolute value symbol.
[0049] It should be noted that, Used to characterize the The degree of matching between the k-th feature region of a historical face image after image enhancement with the x-th multi-scale parameter and the corresponding feature region of the registered image is considered. The closer the matching degree is to the face region, the stronger the representativeness of the k-th feature region.
[0050] The stronger the feature representativeness and the higher the recognition criticality of a certain feature region within the a-th historical face image, the greater its contribution to identifying residents of the community. Therefore, the product of the feature representativeness index and the recognition criticality index of the k-th feature region is taken as the recognition contribution of the k-th feature region. The calculation formula is: , This represents the key indicator for identifying the k-th feature region in the a-th historical face image.
[0051] (3) Following the method described above for obtaining the illumination effect elimination effect and recognition contribution of the k-th feature region in the a-th historical face image, the illumination effect elimination effect and recognition contribution of each feature region in the a-th historical face image are obtained respectively. Combining the illumination effect elimination effect and recognition contribution of each feature region in the a-th historical face image, the feature recognition effect of the x-th multi-scale parameter after enhancing the a-th historical face image is obtained: the recognition contribution of each feature region in the a-th historical face image is used as a weight to perform a weighted average of the illumination effect elimination effect of each feature region in the a-th historical face image, and the feature recognition effect of the x-th multi-scale parameter after enhancing the a-th historical face image is obtained.
[0052] In one embodiment, the formula for calculating the feature recognition effect of the x-th multi-scale parameter on the a-th historical face image after enhancement is as follows: in, This represents the feature recognition effect after the x-th multi-scale parameter enhances the a-th historical face image, and M represents the number of feature regions in the a-th historical face image, which is also the number of feature regions of the residents in the community. This represents the recognition contribution of the k-th feature region in the a-th historical face image. This represents the effect of eliminating the illumination effect on the k-th feature region in the a-th historical face image.
[0053] It should be noted that the image enhancement effect of the x-th multi-scale parameter is evaluated by using the recognition contribution of each feature region in the a-th historical face image and the effect of eliminating the illumination effect after image enhancement using the x-th multi-scale parameter. When the recognition contribution of the feature region in the a-th historical face image is greater and the effect of eliminating the illumination effect of the feature region is better, the face image enhanced by the x-th multi-scale parameter is more effective in accurately identifying residents of the community, and thus the feature recognition effect of the x-th multi-scale parameter is higher.
[0054] Step S103: Based on each multi-scale parameter within the preset Gaussian scale range, enhance the feature recognition effect of each historical face image, select the optimal multi-scale parameter within the preset Gaussian scale range, and use the optimal multi-scale parameter to enhance the face image at the current moment for use in the community smart access control system to identify the identity of community residents.
[0055] To reduce misjudgments and avoid the influence of false features introduced by lighting conditions on matching results, the recognition model must ensure that key features are stable and highly discriminative under various lighting conditions. Therefore, this invention constructs a closed-loop optimization mechanism guided by recognition results. By obtaining the recognition stability of each multi-scale parameter within a preset Gaussian scale range, the optimal multi-scale parameter is selected to enhance the face image at the current moment. This enhancement operation not only improves image quality but also directly serves to improve recognition performance.
[0056] When the recognition results of image enhancement on the faces of residents in the community under different lighting conditions using the x-th multi-scale parameter remain stable and consistent, it indicates that the image enhancement effect of the x-th multi-scale parameter is good, and thus the recognition stability of all historical face images is also high. Therefore, following the method of enhancing the feature recognition effect of the a-th historical face image using the x-th multi-scale parameter, we obtain the feature recognition effect of enhancing each historical face image using the x-th multi-scale parameter. Then, based on the feature recognition effect of enhancing each historical face image using the x-th multi-scale parameter, we obtain the enhancement recognition stability index of the x-th multi-scale parameter, including: Based on the enhanced feature recognition effect of each historical face image according to the x-th multi-scale parameter, the average feature recognition effect is calculated. The absolute value of the difference between the feature recognition effect corresponding to each historical face image and the average feature recognition effect is used as the independent variable of the exponential function with the natural constant as the base, to obtain the weight coefficient of the corresponding historical face image. Based on the weight coefficient, the feature recognition effects corresponding to all historical face images are weighted and summed and the average value is calculated to obtain the enhanced recognition stability index of the x-th multi-scale parameter.
[0057] In one embodiment, the formula for calculating the enhanced recognition stability index of the xth multi-scale parameter is: in, The x-th multi-scale parameter represents the enhanced recognition stability index, and N represents the number of historical face images. This represents an exponential function with the natural constant as its base. This represents the feature recognition effect after enhancing the a-th historical face image with the x-th multi-scale parameter. Let |x| represent the mean of the feature recognition effect after the x-th multi-scale parameter is enhanced on all historical face images, and || represents the absolute value sign.
[0058] It should be noted that, The smaller the value, the smaller the difference between the image enhancement and recognition effect of the x-th multi-scale parameter on the a-th historical face image and the average image enhancement and recognition effect of all images. This indicates that the image enhancement of the x-th multi-scale parameter makes feature recognition more stable.
[0059] Similarly, the enhancement recognition stability index for each multi-scale parameter is obtained, and the multi-scale parameter corresponding to the largest enhancement recognition stability index is taken as the optimal multi-scale parameter. Then, the optimal multi-scale parameter is used to enhance the face image at the current moment for identification of residents in the community's smart access control system. It should be noted that identifying residents using the enhanced face image is existing technology and will not be elaborated upon here.
[0060] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A machine vision-based optimized recognition method for smart access control in residential communities, characterized in that, The method includes: When a resident's face image is captured at the current moment, historical face images of the resident within a preset short period before the current moment are obtained. Based on facial key points, the face region of each historical face image is divided into multiple feature regions and assigned a region number. Based on the similarity of the feature region corresponding to each region number in any two historical face images, and the illumination difference between the two historical face images, the key identification indicators of each feature region are obtained. For any multi-scale parameter within a preset Gaussian scale range, the Retinex algorithm of the any multi-scale parameter is used to enhance any historical face image to obtain an enhanced image. Based on the feature region matching degree difference and illumination difference between the any historical face image, the enhanced image and the registered image, as well as the key recognition indicators of each feature region in the any historical face image, the feature recognition effect of the any multi-scale parameter after enhancing the any historical face image is obtained. Based on the feature recognition effect of each historical face image enhanced by each multi-scale parameter within a preset Gaussian scale range, the optimal multi-scale parameter is selected within the preset Gaussian scale range, and the optimal multi-scale parameter is used to enhance the face image at the current moment for identification of residents in the community through the community smart access control system.
2. The optimized recognition method for intelligent access control in residential communities based on machine vision according to claim 1, characterized in that, The key identification indicators for each feature region are obtained based on the similarity of the feature region corresponding to each region number in any two historical face images, and the illumination difference between the two historical face images. These indicators include: For any region number, feature matching is performed on two feature regions belonging to the region number in any historical face image and the target historical face image to obtain the corresponding matching degree. Based on the difference in brightness change between the historical face image and the target historical face image, the illumination difference degree between the historical face image and the target historical face image is obtained. The matching degree between any historical face image and two feature regions belonging to any region number in each target historical face image is obtained, as well as the illumination difference between any historical face image and each target historical face image. The illumination difference is used as a weight to perform a weighted average of all matching degrees to obtain the region similarity of any region number in any historical face image. Obtain the region similarity of any region number in each historical face image, and use the average of all region similarities as the key indicator for identifying the feature region corresponding to any region number. Here, the target historical face image refers to any historical face image other than the aforementioned historical face image.
3. The optimized recognition method for intelligent access control in residential communities based on machine vision according to claim 2, characterized in that, The step of obtaining the illumination difference between any historical face image and the target historical face image based on the brightness variation difference between the two includes: Calculate the absolute value of the difference in the mean brightness between the face region in any historical face image and the face region in the target historical face image, and denot it as the average brightness difference. Calculate the ratio of the brightness variance between the face region in any historical face image and the face region in the target historical face image, and denot the absolute value of the difference between the ratio and a constant 1 as the brightness fluctuation difference. The product of the average brightness difference and the brightness fluctuation difference is taken as the illumination difference between the any historical face image and the target historical face image.
4. The optimized recognition method for intelligent access control in residential communities based on machine vision according to claim 1, characterized in that, The step of obtaining the feature recognition effect of enhancing any historical face image using any multi-scale parameter based on the feature region matching degree difference and illumination difference between any historical face image, the enhanced image, and the registered image, as well as the key recognition indicators of each feature region in any historical face image, includes: Based on the feature region matching degree between any historical face image and the enhanced image, and the illumination difference between any historical face image and the registered image, the illumination effect elimination effect of each feature region in any historical face image is obtained; Based on the difference in feature region matching degree between any historical face image, the enhanced image and the registered image, and the key identification indicators of each feature region in any historical face image, the identification contribution of each feature region in any historical face image is obtained. By combining the illumination effect elimination effect and recognition contribution of each feature region in any historical face image, the feature recognition effect of any multi-scale parameter after enhancing any historical face image is obtained.
5. The optimized recognition method for intelligent access control in residential communities based on machine vision according to claim 4, characterized in that, The method for obtaining the illumination effect reduction effect of each feature region in any historical face image includes: For any feature region in any historical face image, the illumination difference and matching degree between the feature region and the feature region with the same region number in the registration image are obtained respectively, and the matching degree is recorded as the unenhanced matching degree. The matching degree between the enhanced image and two feature regions with the same region number as the feature region in the registration image are obtained and recorded as the enhanced matching degree. Using the absolute value of the difference between the unenhanced matching degree and the enhanced matching degree as the denominator, and the illumination difference degree as the numerator, a corresponding ratio is obtained. The negative of the absolute value of the difference between the ratio and the constant 1 is used as the independent variable of an exponential function with the natural constant as the base, to obtain the illumination adaptability index of any multi-scale parameter for any feature region. The product between the illumination adaptability index and the enhanced matching degree is used as the illumination influence elimination effect of any feature region.
6. The optimized recognition method for intelligent access control in residential communities based on machine vision according to claim 5, characterized in that, The method for obtaining the recognition contribution of each feature region in any historical face image includes: Feature matching is performed on the face regions in the enhanced image and the face regions in the registration image to obtain the corresponding matching degree, which is denoted as the overall enhanced matching degree. The overall enhanced matching degree is used as the denominator, and the absolute value of the difference between the overall enhanced matching degree and the enhanced matching degree is used as the numerator to obtain the corresponding ratio. The negative of the ratio is substituted into an exponential function with the natural constant as the base to obtain the feature representativeness index of any feature region. The product of the feature representativeness index of any feature region and the key recognition index is used as the recognition contribution of any feature region.
7. The optimized recognition method for intelligent access control in residential communities based on machine vision according to claim 4, characterized in that, The process of combining the illumination effect elimination effect and recognition contribution of each feature region in any historical face image to obtain the feature recognition effect after enhancing any historical face image with any multi-scale parameter includes: Using the recognition contribution of each feature region in any historical face image as a weight, the illumination effect elimination effect of each feature region in any historical face image is weighted and averaged to obtain the feature recognition effect of any multi-scale parameter after enhancing any historical face image.
8. The optimized recognition method for intelligent access control in residential communities based on machine vision according to claim 1, characterized in that, The enhancement of each historical face image based on each multi-scale parameter within a preset Gaussian scale range, and the selection of the optimal multi-scale parameters within the preset Gaussian scale range, includes: For any multi-scale parameter, the enhanced feature recognition effect of each historical face image is obtained based on the enhanced feature recognition effect of the multi-scale parameter. The enhanced recognition stability index of the multi-scale parameter is obtained. The multi-scale parameter corresponding to the largest enhanced recognition stability index is taken as the optimal multi-scale parameter.
9. The optimized recognition method for intelligent access control in residential communities based on machine vision according to claim 8, characterized in that, The enhancement and recognition stability index of the multi-scale parameter is obtained by applying the enhancement to each historical face image according to the multi-scale parameter, and includes: Based on the feature recognition effect of each historical face image after enhancement according to any multi-scale parameter, calculate the average feature recognition effect, obtain the absolute value of the difference between the feature recognition effect corresponding to each historical face image and the average feature recognition effect, and use the negative of the absolute value of the difference as the independent variable of the exponential function with the natural constant as the base to obtain the weight coefficient of the corresponding historical face image. Based on the weighting coefficients, the feature recognition performance corresponding to all historical face images is weighted, summed, and averaged to obtain the enhanced recognition stability index for any multi-scale parameter.