Intelligent intercom method and system based on face recognition

By segmenting the grayscale image blocks of faces, calculating the detail and shadow, adjusting the crop limit value, and using CLAHE and bilinear interpolation, the problem of poor image quality in the face recognition system is solved, and the intelligent intercom is improved Accuracy and image clarity.

CN118799946BActive Publication Date: 2025-01-07SHENZHEN CHAOWANG TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411262238.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-01-07
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

In the existing intelligent intercom system based on facial recognition, the quality of the face images collected by the camera is poor, resulting in inaccurate facial recognition results, making it difficult to achieve accurate intelligent intercom.

Method used

By obtaining the grayscale image of the face, segmenting it into multiple sub-image blocks, calculating the detail and shadow of each sub-image block, adjusting the crop limit value, and using the CLAHE algorithm and bilinear interpolation method to process the images to reduce the impact of noise and improve recognition accuracy.

Benefits of technology

It effectively improves the accuracy of face recognition, avoids excessive or insufficient contrast enhancement, enhances image detail clarity, achieves more natural image reorganization, and improves the accuracy of intelligent intercom.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799946B_ABST
    Figure CN118799946B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to an intelligent intercom method and system based on face recognition. The method includes the following steps: obtaining a grayscale image of a face, dividing the grayscale image of the face into a plurality of sub-image blocks based on a preset window size, wherein the sub-image blocks contain a plurality of pixels; determining the detail of the sub-image blocks according to the image entropy of the sub-image blocks; obtaining the grayscale mean of all pixels in the sub-image blocks, and determining the shadow of the sub-image blocks according to the grayscale mean; calculating the cropping limit value weight of the sub-image blocks; presetting an initial cropping limit value, and taking the product of the cropping limit value weight of the sub-image blocks and the initial cropping limit value as the cropping limit value of the sub-image blocks; and using the cropping limit value in the CLAHE algorithm to process the sub-image blocks to realize intelligent intercom based on face recognition, so that the accuracy of intelligent intercom based on face recognition can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to an intelligent intercom method and system based on face recognition. Background Art

[0002] The intelligent intercom system based on face recognition is a security monitoring device that combines image processing and communication technology. It can identify visitors in real time, automatically compare identities and enable intercom functions. It is widely used in communities and enterprises to improve security and communication efficiency. In the intelligent intercom system based on face recognition, the quality of the image is crucial to the accuracy of image recognition.

[0003] The existing patent application document with publication number CN110533001A discloses a big data face recognition method based on face recognition, which collects face images through a camera; pre-processes the face images to obtain clear face images; stores face feature blocks, clear face images and their corresponding identity information in a platform; a face recognition terminal extracts face feature blocks of the face image to be recognized, and compares the face feature blocks of the face image to be recognized with the face feature blocks in the face feature block library respectively. When the comparison is successful, a clear face image matching the face image to be recognized and its corresponding identity information are obtained.

[0004] The above existing solutions rely on cameras to collect facial images. If the camera collection environment is poor or the camera quality is average, the collected facial images will have poor quality, and the facial recognition terminal cannot accurately obtain facial recognition results based on the poor quality facial images.

[0005] Based on this, how to accurately obtain face recognition results to achieve intelligent intercom based on face recognition is a technical problem that needs to be solved urgently by technical personnel in this field. Summary of the invention

[0006] In order to solve the above-mentioned technical problem of how to accurately obtain face recognition and thus realize intelligent intercom based on face recognition, the present invention provides an intelligent intercom method and system based on face recognition.

[0007] In the first aspect, the present invention provides an intelligent intercom method based on face recognition, which adopts the following technical solution:

[0008] The intelligent intercom method based on face recognition includes the following steps:

[0009] Obtain a grayscale image of a face, and divide the grayscale image of the face into multiple sub-image blocks based on a preset window size, wherein the sub-image block contains multiple pixels; obtain the image entropy of the sub-image block, and determine the detail of the sub-image block, wherein the detail is positively correlated with the image entropy of the sub-image block; obtain the grayscale mean of all pixels in the sub-image block, and determine the shadow of the sub-image block, wherein the shadow is negatively correlated with the grayscale mean and negatively correlated with the difference between the maximum grayscale value and the minimum grayscale value in the sub-image block; calculate the cropping limit value weight of the sub-image block: ; In the formula, represents the cropping limit value weight of the i-th sub-image block, represents the shadow degree of the i-th sub-image block, represents the detail degree of the ith sub-image block; presets an initial cropping limit value, and uses the product of the cropping limit value weight of the sub-image block and the initial cropping limit value as the cropping limit value of the sub-image block; and uses the cropping limit value in the CLAHE algorithm to process the sub-image block to realize intelligent intercom based on face recognition.

[0010] The present invention takes into account that a fixed cropping limit value may cause excessive or insufficient contrast enhancement of the sub-image block. Therefore, the cropping limit value of the sub-image block is obtained by the detail and shadow degree of each sub-image block in the grayscale image of the face, so that the sub-image block can be accurately adjusted. In addition, the present invention also takes into account that the noise in the sub-image block has a great influence on the recognition result. Therefore, the grayscale similarity between the sub-image block and the adjacent sub-image blocks is combined, which effectively reduces the influence of the noise in the sub-image block on the recognition result, thereby effectively improving the accuracy of intelligent intercom based on face recognition.

[0011] According to the intelligent intercom method based on face recognition provided by the present invention, the facial grayscale image is obtained, and the facial grayscale image is divided into multiple sub-image blocks based on the size of a preset window, including: collecting the facial image of the user through a camera, and gray-scaling the facial image to obtain the facial grayscale image of the user.

[0012] According to the intelligent intercom method based on face recognition provided by the present invention, the determining of the detail degree of the sub-image block further includes: taking each sub-image block in an 8-neighborhood centered on the sub-image block in the face grayscale image as an adjacent sub-image block of the sub-image block, and calculating the grayscale similarity between the sub-image block and the adjacent sub-image block:

[0013] ;

[0014] In the formula, Represents the relationship between the i-th sub-image block and the The grayscale similarity of adjacent sub-image blocks is Represents the number of pixels in the sub-image block, Indicates The first of the adjacent sub-image blocks The gray value of a pixel, Represents the grayscale value of the jth pixel in the ith sub-image block; takes the product of the grayscale similarity between the sub-image block and the adjacent sub-image block and the image entropy of the adjacent sub-image block as the detail index of the sub-image block, determines the detail of the sub-image block, and the detail is positively correlated with the detail index.

[0015] According to the intelligent intercom method based on face recognition provided by the present invention, the detail degree of the sub-image block satisfies the relationship:

[0016] ;

[0017] In the formula, represents the detail level of the i-th sub-image block, represents the number of adjacent sub-image blocks of the ith sub-image block, Represents the relationship between the i-th sub-image block and the The grayscale similarity of adjacent sub-image blocks is represents the first The image entropy of adjacent sub-image blocks is represents the image entropy of the i-th sub-image block, represents the linear normalization function, Represents the detail index of the i-th sub-image block.

[0018] The present invention takes into account that noise in a sub-image block may affect the details in the sub-image block. Therefore, the image entropy of the sub-image block is corrected by the grayscale similarity between the sub-image block and adjacent sub-image blocks, which can effectively improve the accuracy of the details of the obtained sub-image block.

[0019] According to the intelligent intercom method based on face recognition provided by the present invention, the shadow degree of the sub-image block satisfies the relationship:

[0020] ;

[0021] In the formula, represents the shadow degree of the i-th sub-image block, represents the maximum gray value in the i-th sub-image block, represents the minimum gray value in the i-th sub-image block, Represents the number of pixels in the sub-image block, represents the gray value of the jth pixel in the i-th sub-image block, represents the linear normalization function.

[0022] The present invention provides an accurate method for calculating the shadow degree of a sub-image block. By acquiring the grayscale variation range and grayscale mean in the sub-image block, the shadow degree of the sub-image block can be accurately obtained, thereby avoiding the influence of black and white spots on the recognition result.

[0023] According to the intelligent intercom method based on face recognition provided by the present invention, the sub-image blocks are processed using the cropping limit value in the CLAHE algorithm to realize intelligent intercom based on face recognition, including: enhancing the contrast of the sub-image blocks based on the cropping limit value of each sub-image block, and using a bilinear interpolation method to reorganize each sub-image block after contrast enhancement according to the position before segmentation to obtain a processed face grayscale image; matching the processed face grayscale image with a face database, and if the match is successful, enabling the intercom permission of the user corresponding to the processed face grayscale image, and establishing a communication connection.

[0024] The present invention takes into account that the CLAHE algorithm processes the image in blocks, and each sub-image block is independently subjected to histogram equalization and cropping, which may cause the image between adjacent sub-blocks to be visually discontinuous, i.e., the block effect. Therefore, the bilinear interpolation method is used to smooth the transition between sub-image blocks, so that the enhanced face grayscale image is more natural.

[0025] According to the intelligent intercom method based on face recognition provided by the present invention, the establishment of a communication connection further includes: storing the processed face grayscale image, the matching result of the processed face grayscale image and the face database, and the corresponding communication time, duration and location information in an information database.

[0026] The present invention takes into account that the personalized characteristics of users may change over time, and thus can better provide personalized intelligent intercom services for users by updating the information database in real time.

[0027] In a second aspect, the present invention provides an intelligent intercom system based on face recognition, which adopts the following technical solutions:

[0028] The intelligent intercom system based on face recognition includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the intelligent intercom method based on face recognition is implemented.

[0029] By adopting the above technical solution, the above-mentioned intelligent intercom method based on face recognition is generated into a computer program and stored in a memory to be loaded and executed by a processor, so that a terminal device is made according to the memory and the processor for easy use.

[0030] The present invention has the following technical effects:

[0031] Based on the above technical solution, the present invention obtains the detail and shadow degree of each sub-image block in the grayscale image of the face to obtain the cropping limit value of the sub-image block, so as to achieve precise adjustment of the sub-image block and effectively avoid the occurrence of excessive or insufficient enhancement; in addition, the present invention also combines the grayscale similarity between the sub-image block and the adjacent sub-image block, effectively reducing the influence of noise in the sub-image block on the recognition result, thereby effectively improving the accuracy of intelligent intercom based on face recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.

[0033] Figure 1 A flowchart of an intelligent intercom method based on face recognition provided by an embodiment of the present invention;

[0034] Figure 2 An example diagram of an initial grayscale image of a human face provided by an embodiment of the present invention;

[0035] Figure 3 This is an example diagram of a processed grayscale image of a face provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0037] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.

[0038] It should be noted that when the camera collects facial images, the quality of the collected facial images may be poor due to factors such as changes in lighting conditions, which is not conducive to subsequent facial data matching. Contrast Limited Adaptive Histogram Equalization (CLAHE) is a technology used for image enhancement that can improve the contrast and detail clarity of the image. However, the traditional CLAHE algorithm uses a fixed-size cropping limit value to limit the contrast of each image after block division, thereby limiting the mapping slope of the pixel value to prevent over-enhancement in high-contrast areas. However, since the image details in different facial images are not exactly the same, if the cropping limit value is too small, the contrast enhancement of some areas of the image may be insufficient, and if the cropping limit value is too large, the details in the image may be lost, ultimately resulting in low accuracy of face recognition.

[0039] Based on this, the embodiment of the present invention discloses an intelligent intercom method based on face recognition, see Figure 1 As shown, Figure 1 The present invention provides a flowchart of a method for intelligent intercom based on face recognition. The method analyzes the detailed features in the face image and determines the appropriate cropping limit value based on the detailed features in the face image, so as to accurately adjust the face image and realize intelligent intercom based on the accurate face recognition result. The method specifically includes the following steps S1 to S5:

[0040] S1: Obtain a grayscale face image, and divide the grayscale face image into multiple sub-image blocks based on a preset window size.

[0041] It should be noted that since the grayscale values ​​of various areas in the grayscale image of the face are not exactly the same, there are significant brightness differences in different areas, such as the shadow areas around the eyes, nose and mouth. In order to more accurately obtain the image details of each area, the grayscale image of the face can be divided into multiple sub-image blocks, and each sub-image block is subjected to histogram equalization processing separately, so that the contrast of each sub-image block can be adjusted independently to reduce the impact of uneven lighting or shadows on image quality.

[0042] By way of example, in an embodiment of the present invention, when a grayscale image of a face is obtained and divided into multiple sub-image blocks based on a preset window size, a camera can be used to capture an image or video stream containing a face, and a face detection algorithm can be used to automatically detect the position and size of the face image in the image or video, and the face image is grayed to obtain a grayscale image of the user's face; each sub-image block in an 8-neighborhood centered on the sub-image block in the grayscale image of the face is used as an adjacent sub-image block of the sub-image block.

[0043] Among them, the face detection algorithm can be an adaptive enhanced face detection algorithm based on Haar features, a face recognition algorithm based on convolutional neural network, etc.; the face detection algorithm can be specifically set according to actual needs, and the embodiment of the present invention does not impose too many restrictions on this.

[0044] Specifically, by graying the face image to obtain the user's face gray image, storage space can be effectively saved, and it is also helpful to analyze the internal area of ​​the image based on the gray value characteristics of the face gray image. During the segmentation process, for the area at the edge of the face gray image that cannot be segmented into the size of the preset window, the face gray image can be segmented by mirror filling, and finally the face gray image is divided into multiple sub-image blocks of equal size. Each sub-image block obtained by segmentation contains multiple pixels, and the size of the preset window can be S=16×16, and the size of the preset window can be set according to actual needs; the size of the preset window is the number of pixels contained in the sub-image block, and each pixel has a corresponding gray value. The higher the gray value, the brighter the pixel, and the lower the gray value, the darker the pixel.

[0045] The mirror filling is a prior art, and the embodiment of the present invention will not be described in detail here. The size of the adjacent sub-image blocks of the sub-image block is equal to the size of the sub-image block.

[0046] Based on the above steps, the face grayscale image can be accurately segmented into multiple sub-image blocks of equal size. By continuing to analyze the grayscale features and details in the sub-image blocks through the following steps, the contrast of each sub-image block can be accurately enhanced.

[0047] S2: Obtain image entropy of the sub-image block and determine the detail level of the sub-image block.

[0048] It should be noted that a sub-image block with richer details needs to be set with a smaller cropping limit value to avoid loss of image details. Image entropy can be used to characterize the richness of details in a sub-image block. The higher the image entropy, the richer the details in the sub-image block. Based on this, the embodiment of the present invention characterizes the details in the sub-image block by acquiring the image entropy of the sub-image block.

[0049] Specifically, the grayscale values ​​of all pixels in the ith sub-image block are obtained, the grayscale distribution histogram of the ith sub-image block is determined, and the number of pixels in the ith sub-image block is recorded as , the gray value in the i-th sub-image block The number of occurrences is recorded as , get the gray value in the i-th sub-image block Probability of occurrence , in this way, the probability of each gray value appearing in the i-th sub-image block can be obtained, and the image entropy of the sub-image block can be obtained through the probability of each gray value appearing in the sub-image block.

[0050] For example, in the embodiment of the present invention, the image entropy of the i-th sub-image block is determined, and specifically, the following relationship can be referred to:

[0051] ;

[0052] In the formula, represents the image entropy of the i-th sub-image block, Represents the gray value in the i-th sub-image block The probability of occurrence, Represents the base 2 logarithmic function.

[0053] The image entropy of the sub-image block obtained based on the above formula can be used to characterize the richness of details in the sub-image block. The higher the image entropy of the sub-image block, the higher the detail level in the sub-image block, and the detail level is positively correlated with the image entropy of the sub-image block.

[0054] It should be noted that the embodiment of the present invention takes into account that noise will affect the image entropy of the sub-image block, resulting in the image entropy being unable to accurately reflect the detailed features of the sub-image block, and therefore it is necessary to correct the image entropy change caused by noise. In the grayscale image of the face, each part of the human body contains at least one sub-image block, and the grayscale means of the sub-image blocks belonging to the same part of the human body are relatively close. Therefore, if the grayscale means of a sub-image block and its adjacent sub-image block are relatively close, then the sub-image block and its adjacent sub-image block are likely to belong to the same part.

[0055] If the grayscale mean values ​​of a sub-image block and its adjacent sub-image blocks are relatively close but the image entropy difference is large, it is highly likely that such large image entropy difference is caused by noise. Based on this, the embodiment of the present invention can obtain the grayscale similarity between the sub-image block and the adjacent sub-image blocks by analyzing the grayscale features of the sub-image block and the adjacent sub-image blocks, and correct the image entropy according to the grayscale similarity, so as to accurately obtain the detail of the sub-image block.

[0056] By way of example, in an embodiment of the present invention, when determining the detail level of a sub-image block, the grayscale similarity between the sub-image block and adjacent sub-image blocks can also be calculated; the product of the grayscale similarity between the sub-image block and adjacent sub-image blocks and the image entropy of the adjacent sub-image blocks is used as the detail level index of the sub-image block to determine the detail level of the sub-image block, and the detail level is positively correlated with the detail level index.

[0057] Specifically, determine the i-th sub-image block and the i-th sub-image block The grayscale similarity of adjacent sub-image blocks can be seen in the following relationship:

[0058] ;

[0059] In the formula, Represents the relationship between the i-th sub-image block and the The grayscale similarity of adjacent sub-image blocks is Represents the number of pixels in the sub-image block, Indicates The first of the adjacent sub-image blocks The gray value of a pixel, represents the gray value of the jth pixel in the i-th sub-image block, represents the linear normalization function, Represents the absolute value symbol.

[0060] In the above formula, Represents the relationship between the i-th sub-image block and the The absolute difference of the grayscale mean of adjacent sub-image blocks. The larger the absolute difference, the closer the ith sub-image block is to the ith sub-image block. The greater the grayscale difference between adjacent sub-image blocks, the lower the corresponding grayscale similarity.

[0061] Based on the above formula, the grayscale similarity between the ith sub-image block and each adjacent sub-image block can be obtained. The detail of the ith sub-image block can be obtained by correcting the image entropy of the ith sub-image block according to the grayscale similarity between the ith sub-image block and each adjacent sub-image block.

[0062] For example, in the embodiment of the present invention, the detail level of the i-th sub-image block is determined, and specifically, the following relationship can be referred to:

[0063] ;

[0064] In the formula, represents the detail level of the i-th sub-image block, represents the number of adjacent sub-image blocks of the ith sub-image block, Represents the relationship between the i-th sub-image block and the The grayscale similarity of adjacent sub-image blocks is represents the first The image entropy of adjacent sub-image blocks is represents the image entropy of the i-th sub-image block, represents the linear normalization function.

[0065] In the above formula, Represents the detail index of the i-th sub-image block. Represents the relationship between the i-th sub-image block and the The detail degree of the ith sub-image block after image entropy correction is calculated by the grayscale similarity of the adjacent sub-image blocks. The higher the grayscale similarity of adjacent sub-image blocks, the more correction can be performed based on the grayscale mean; if the i-th sub-image block is similar to the i-th The lower the grayscale similarity of adjacent sub-image blocks, the The lower the correction degree of the image entropy of the ith sub-image block by the ith adjacent sub-image blocks.

[0066] It should be further explained that the number of adjacent sub-image blocks of each sub-image block in the grayscale face image is not exactly the same. For example, the number of adjacent sub-image blocks in the 8-neighborhood of the sub-image block in the middle of the grayscale face image is 8, and the number of adjacent sub-image blocks in the 8-neighborhood of the sub-image block in the upper left corner of the grayscale face image is 3. For such cases, the embodiments of the present invention do not make special processing, and the above formula can be used to process and obtain the detail degree of the sub-image block.

[0067] After obtaining the detail degree of each sub-image block in the grayscale image of the face based on the above steps, the following steps may be performed to determine the shadow degree of the sub-image block.

[0068] S3: Obtain the grayscale mean of all pixels in the sub-image block to determine the shadow degree of the sub-image block.

[0069] It should be noted that the embodiment of the present invention takes into account that in addition to the detail level, the shadow part of the grayscale image of the face may also contain important information, and the sub-image block in the shadow needs to enhance the contrast more than the sub-image block under normal lighting, and needs to set a higher cropping limit value. Therefore, when determining the cropping limit value of the sub-image block, it is necessary to consider both the detail level of the sub-image block and the shadow level of the sub-image block.

[0070] The higher the grayscale value, the brighter the pixel, so the grayscale mean value of the shadow area is smaller; in addition, the shadow area often shows a smaller grayscale variation range because the light distribution in the shadow is relatively uniform, while the non-shadow area may have a larger grayscale variation range. Based on this, the shadow degree of the sub-image block can be analyzed by the grayscale mean value and grayscale variation range in the sub-image block.

[0071] By way of example, in an embodiment of the present invention, when determining the shadow degree of a sub-image block, the grayscale mean of all pixels in the sub-image block, as well as the maximum grayscale value and the minimum grayscale value in the sub-image block can be obtained, and the shadow degree of the sub-image block is obtained based on the grayscale mean, the maximum grayscale value and the minimum grayscale value of all pixels; wherein, the shadow degree of the sub-image block is negatively correlated with the grayscale mean, and negatively correlated with the difference between the maximum grayscale value and the minimum grayscale value in the sub-image block.

[0072] It can be understood that the maximum grayscale value and the minimum grayscale value in the sub-image block are the maximum and minimum values ​​of all grayscale values ​​in the sub-image block, the maximum value of all grayscale values ​​is taken as the maximum grayscale value, and the minimum value of all grayscale values ​​is taken as the minimum grayscale value.

[0073] Specifically, in the embodiment of the present invention, the shadow degree of the sub-image block is determined by referring to the following relationship:

[0074] ;

[0075] In the formula, represents the shadow degree of the i-th sub-image block, represents the maximum gray value in the i-th sub-image block, represents the minimum gray value in the i-th sub-image block, Represents the number of pixels in the sub-image block, represents the gray value of the jth pixel in the i-th sub-image block, represents the linear normalization function.

[0076] In the above formula, Indicates the grayscale variation range of the sub-image block. The larger the value, the larger the grayscale variation range of the sub-image block; the smaller the value, the smaller the grayscale variation range of the sub-image block.

[0077] When the grayscale mean of the sub-image block is small, the overall color of the sub-image block is darker, and the shadow degree of the sub-image block is higher; when the grayscale mean is small and the grayscale variation range is also small, it means that the shadow is uniform, rather than a non-uniform area composed of black and white spots, and the corresponding sub-image block has a higher shadow degree.

[0078] After respectively obtaining the detail degree and the shadow degree of the sub-image block based on the above steps, the weight of the cropping limit value of the sub-image block may be determined based on the detail degree and the shadow degree of the sub-image block.

[0079] S4: Calculate the cropping limit value weight of the sub-image block, preset an initial cropping limit value, and use the product of the cropping limit value weight of the sub-image block and the initial cropping limit value as the cropping limit value of the sub-image block.

[0080] It should be noted that when using the cropping limit value to adjust the contrast of the sub-image block, if the detail of the sub-image block is high, in order to avoid loss of details, the cropping limit value needs to be reduced; if the shadow of the sub-image block is high, in order to effectively enhance the contrast of the shadow area, the cropping limit value needs to be increased; if the shadow of the sub-image block is high but the detail is low, the cropping limit value can be increased to retain a larger contrast upper limit, thereby fully enhancing the image contrast; if the shadow of the sub-image block is low but the detail is high, the cropping limit value can be reduced to retain a smaller contrast upper limit, thereby avoiding excessive enhancement and resulting in loss of image details.

[0081] For example, in the embodiment of the present invention, when determining the weight of the cropping limit value of the sub-image block, the following relationship may be referred to:

[0082] ;

[0083] In the formula, represents the cropping limit value weight of the i-th sub-image block, represents the shadow degree of the i-th sub-image block, Indicates the detail level of the i-th sub-image block.

[0084] For example, the initial clipping limit value can be preset as , which can be adjusted according to actual needs.

[0085] By adjusting the initial cropping limit value of the sub-image block based on the cropping limit value weight of the sub-image block, the cropping limit value of the sub-image block can be accurately obtained, thereby performing limited contrast adaptive histogram equalization of the sub-image block more specifically.

[0086] S5: Using the cropping limit value in the CLAHE algorithm to process the sub-image block to achieve intelligent intercom based on face recognition.

[0087] It should be noted that when the image is enhanced by the CLAHE algorithm, the boundaries of each sub-image block after enhancement will become obvious due to the change in grayscale distribution, so bilinear interpolation is required.

[0088] By way of example, in an embodiment of the present invention, when a sub-image block is processed using a cropping limit value in the CLAHE algorithm to implement intelligent intercom based on face recognition, the contrast of the sub-image block can be enhanced based on the cropping limit value of each sub-image block, and each sub-image block after contrast enhancement can be reorganized according to the position before segmentation using a bilinear interpolation method to obtain a processed face grayscale image; the processed face grayscale image is matched with a face database, and if the match is successful, the intercom permission of the user corresponding to the processed face grayscale image is enabled, and a communication connection is established.

[0089] It should be further explained that the CLAHE algorithm processes the grayscale face image in blocks, so that each sub-image block is independently histogram equalized and cropped, which may cause the image between adjacent sub-blocks to appear visually discontinuous, that is, the block effect. Such a situation can be handled by bilinear interpolation.

[0090] Specifically, the sub-image block is enhanced by the cropping limit value of the sub-image block to obtain an enhanced sub-image block, all enhanced sub-image blocks are obtained, and the enhanced sub-image blocks are reorganized into a processed face grayscale image according to the position before segmentation. When reorganizing the image, a bilinear interpolation method is used for pixel points near the boundary of the enhanced sub-image block to smooth the transition between the sub-image blocks, so that the enhanced face grayscale image is more natural. The specific steps of using the bilinear interpolation method to smooth the transition between sub-image blocks can be obtained through the existing technical solution and will not be repeated here.

[0091] See also Figure 2 and Figure 3 As shown, Figure 2 An example diagram of an initial grayscale image of a human face provided by an embodiment of the present invention; Figure 3 This is an example of a processed grayscale image of a human face provided by an embodiment of the present invention. Figure 2 and Figure 3 It can be seen that the overall quality of the grayscale face image processed based on the technical solution provided by the embodiment of the present invention is significantly improved, and the details in the image are also clearer.

[0092] For example, before matching the processed grayscale face image with the face database, the facial data of the relevant user can be entered into the face database in advance, and the personalized features corresponding to the user can be entered into the information database; when matching, a face recognition algorithm can be used for identification and matching.

[0093] Among them, personalized features may include the user's basic information, behavior patterns, social relationships, geographic location, consumption capacity, interests and hobbies, etc., which can be set according to actual needs.

[0094] For example, after a successful match, personalized features related to the user's current scenario can be extracted from the information database, and the presentation of the intercom content can be adjusted based on the user's personalized features; based on the user's social relationships and geographic location preferences, relevant contacts can be intelligently recommended or nearby available intercom services can be provided.

[0095] Specifically, when intelligent intercom is realized based on the face recognition result, the grayscale image of the face processed based on the above steps can be matched with the existing face data in the face database, and the user identity of the successful match is determined to be the householder / visitor. If the user identity is the householder, the householder interface is activated, the information database corresponding to the householder is obtained, and the door lock is controlled to open automatically; if the user identity is a visitor, the visitor interface can provide recommended related contacts based on the number of user visits and related contacts. When the user selects the related contact to be intercomed, a notification can be sent to the householder, and the householder can choose to accept or reject the visit according to the actual situation. If the householder chooses to accept the visit, a communication connection can be established with the user through a mobile phone or other terminal, thereby realizing intelligent intercom.

[0096] For example, if the grayscale face image processed based on the above steps fails to match the existing face data in the face database, the grayscale face image of the current user can be marked as a new visitor.

[0097] After the intelligent intercom is realized based on the above steps, the personalized features related to the user in the information database can also be updated based on the intercom content.

[0098] By way of example, in an embodiment of the present invention, a communication connection is established, and then the method further includes: storing the processed face grayscale image, the matching result of the processed face grayscale image and the face database, and the corresponding communication time, duration and location information in the information database.

[0099] In this way, personalized intelligent intercom services can be better provided to users.

[0100] It can be seen that in the embodiment of the present invention, when realizing intelligent intercom based on face recognition, a face grayscale image can be obtained, and the face grayscale image can be divided into multiple sub-image blocks based on the size of a preset window, and the sub-image block contains multiple pixels; the image entropy of the sub-image block is obtained, and the detail of the sub-image block is determined, and the detail is positively correlated with the image entropy of the sub-image block; the grayscale mean of all pixels in the sub-image block is obtained, and the shadow of the sub-image block is determined, and the shadow is negatively correlated with the grayscale mean, and negatively correlated with the difference between the maximum grayscale value and the minimum grayscale value in the sub-image block; the cropping limit value weight of the sub-image block is calculated; the initial cropping limit value is preset, and the product of the cropping limit value weight of the sub-image block and the initial cropping limit value is used as the cropping limit value of the sub-image block; the cropping limit value is used in the CLAHE algorithm to process the sub-image block to realize intelligent intercom based on face recognition.

[0101] In this way, the embodiment of the present invention obtains the detail and shadow degree of each sub-image block in the grayscale image of the face to obtain the cropping limit value of the sub-image block, so as to achieve precise adjustment of the sub-image block and effectively avoid the occurrence of excessive or insufficient enhancement; in addition, the embodiment of the present invention also combines the grayscale similarity between the sub-image block and the adjacent sub-image blocks, effectively reducing the influence of noise in the sub-image block on the recognition result, thereby effectively improving the accuracy of intelligent intercom based on face recognition.

[0102] An embodiment of the present invention further discloses an intelligent intercom system based on face recognition, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the intelligent intercom method based on face recognition according to the present invention is implemented.

[0103] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0104] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM, a dynamic random access memory DRAM, a static random access memory SRAM, an enhanced dynamic random access memory EDRAM, a high bandwidth memory HBM, a hybrid memory cube HMC, etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device.

[0105] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

[0106] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An intelligent intercom method based on face recognition, characterized in that: include: Acquire a grayscale image of a face, and divide the grayscale image of the face into a plurality of sub-image blocks based on a preset window size, wherein the sub-image blocks include a plurality of pixel points; The image entropy of the sub-image block is obtained, and the detail degree of the sub-image block is determined to satisfy the relationship: ; In the formula, represents the detail level of the i-th sub-image block, represents the number of adjacent sub-image blocks of the ith sub-image block, Represents the relationship between the i-th sub-image block and the The grayscale similarity of adjacent sub-image blocks is represents the first The image entropy of adjacent sub-image blocks is represents the image entropy of the i-th sub-image block, represents the linear normalization function, represents a detail index of the i-th sub-image block; the detail is positively correlated with the image entropy of the sub-image block; Obtaining a grayscale mean value of all pixels in the sub-image block, and determining a shadow degree of the sub-image block, wherein the shadow degree is negatively correlated with the grayscale mean value and negatively correlated with a difference between a maximum grayscale value and a minimum grayscale value in the sub-image block; Calculate the cropping limit value weight of the sub-image block: ; In the formula, represents the cropping limit value weight of the i-th sub-image block, Indicates the shadow degree of the i-th sub-image block; Presetting an initial cropping limit value, and taking the product of the cropping limit value weight of the sub-image block and the initial cropping limit value as the cropping limit value of the sub-image block; The sub-image block is processed using the cropping limit value in the CLAHE algorithm to implement intelligent intercom based on face recognition.

2. The intelligent intercom method based on face recognition according to claim 1 is characterized in that: The step of obtaining a grayscale face image and dividing the grayscale face image into a plurality of sub-image blocks based on a preset window size includes: The user's face image is captured by a camera, and the face image is grayscaled to obtain the user's face grayscale image.

3. The intelligent intercom method based on face recognition according to claim 2 is characterized in that: The determining the detail level of the sub-image block further includes: Each sub-image block in an 8-neighborhood centered on the sub-image block in the face grayscale image is used as an adjacent sub-image block of the sub-image block, and the grayscale similarity between the sub-image block and the adjacent sub-image block is calculated: ; In the formula, Represents the relationship between the i-th sub-image block and the The grayscale similarity of adjacent sub-image blocks is Represents the number of pixels in the sub-image block, Indicates The first of the adjacent sub-image blocks The gray value of a pixel, Represents the grayscale value of the jth pixel in the ith sub-image block; takes the product of the grayscale similarity between the sub-image block and the adjacent sub-image block and the image entropy of the adjacent sub-image block as the detail index of the sub-image block, determines the detail of the sub-image block, and the detail is positively correlated with the detail index.

4. The intelligent intercom method based on face recognition according to claim 1 is characterized in that: The shadow degree of the sub-image block satisfies the relationship: ; In the formula, represents the shadow degree of the i-th sub-image block, represents the maximum gray value in the i-th sub-image block, represents the minimum gray value in the i-th sub-image block, Represents the number of pixels in the sub-image block, represents the gray value of the jth pixel in the i-th sub-image block, represents the linear normalization function.

5. The intelligent intercom method based on face recognition according to claim 1 is characterized in that: The method of using the cropping limit value in the CLAHE algorithm to process the sub-image block to implement intelligent intercom based on face recognition includes: enhancing the contrast of the sub-image blocks based on the cropping limit value of each sub-image block, and reorganizing the sub-image blocks after the contrast enhancement according to the positions before segmentation by using a bilinear interpolation method to obtain a processed face grayscale image; The processed grayscale face image is matched with the face database. If the match is successful, the intercom permission of the user corresponding to the processed grayscale face image is enabled to establish a communication connection.

6. The intelligent intercom method based on face recognition according to claim 5 is characterized in that: The establishing of the communication connection further comprises: The processed face grayscale image, the matching result between the processed face grayscale image and the face database, and the corresponding communication time, duration and location information are stored in an information database.

7. Intelligent intercom system based on face recognition, characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the intelligent intercom method based on face recognition according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Big data face recognition method based on face recognition

    CN110533001A

  • Infrared image denoising enhancement method, device and system based on local adaptive CLAHE, and computer readable storage medium

    CN112365424A

  • Image processing method and device, chip and storage medium

    CN116363148A