Method and system for retrieving face image

By generating image matrix and setting simplified boxes with different weights for simplification processing, the problems of lag in traditional campus access control systems during peak hours and slow high-resolution image processing speed are solved, and fast and convenient image retrieval and passage are achieved.

CN120386882APending Publication Date: 2025-07-29BEIJING ZHONGSHITONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510468368.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

Traditional campus access control systems are prone to lag and congestion during peak hours, which affects traffic fluency. High-resolution image processing requires a lot of computing resources and time, resulting in slow retrieval speed.

Method used

By calculating the three primary color intensity of the image, setting simplified boxes with different weights for simplification processing, generating simplified sets and comparing them with the standard set, calculating the ratio of qualified elements to judge the face matching.

Benefits of technology

It speeds up the speed of face retrieval, reduces the demand for computing resources, improves the system operation efficiency, and ensures a fast and convenient passport experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386882A_ABST
    Figure CN120386882A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image retrieval, and particularly discloses a method and system for retrieving a face image, and the method comprises the following steps: S1, collecting a to-be-recognized image, obtaining the three-primary color intensity of a pixel, calculating a color value, and generating an image matrix; s2, setting a simplification frame; s3, calculating a comprehensive value; s4, generating a simplified set, generating an error set, screening qualified elements, calculating the proportion of the qualified elements, and making a judgment; according to the method, the collected image data is simplified, calculated, dimensionality reduced and the like, so that the data processing speed is increased on the premise that important information is not lost, the system can make response and judgment in time, and the actual application requirement is met. Reasonable allocation of computing resources is realized, so that the efficiency of whole image processing is improved. And the speed of face retrieval is accelerated, so that students can pass through the access control system more quickly and conveniently when entering and exiting the campus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image retrieval, and particularly to a method and a system for retrieving face images. Background Art

[0002] In today's educational environment, the campus access control system undoubtedly plays a crucial role in enhancing campus security and management efficiency. The campus access control system guards the lives and property safety of teachers and students on campus and ensures the stable operation of campus order. However, just like everything has two sides, in the actual use process, the traditional campus access control system has gradually revealed some defects that cannot be ignored.

[0003] The operation modes of traditional access control systems mainly include operations such as swiping cards, entering passwords, or performing biometric identifications. In daily campus life, especially during peak class hours, these operation modes often lead to a series of problems. When a large number of students gather at the entrance to enter passwords or perform biometric identifications, the system may experience short-term lags or response delays, which may cause local congestion and seriously affect the smoothness of passage.

[0004] For large-scale campuses, the personnel flow situation between different regions is relatively complex. A campus usually includes multiple functional areas such as teaching areas, living areas, and administrative areas, and each area has its specific personnel flow requirements and management regulations, which further increases the complexity of personnel flow management.

[0005] Therefore, schools urgently need an innovative method to optimize the existing access control management mode. This method should be able to accelerate the speed of face retrieval, enabling students to pass through the access control system more quickly and conveniently when entering and leaving the campus. It can not only effectively control the entry and exit of students but also greatly reduce the energy and computing power consumed for face recognition information retrieval. Summary of the Invention

[0006] The purpose of the present invention is to provide a method and a system for retrieving face images to solve the above technical problems.

[0007] The purpose of the present invention can be achieved by the following technical solutions:

[0008] A method for retrieving face images includes the following steps:

[0009] S1: Perform image data acquisition, use the collected face images as the images to be recognized, obtain the intensities of the three primary colors of the pixels in the images to be recognized, where the intensities of the three primary colors include the red channel intensity R, the green channel intensity G, and the blue channel intensity B, calculate the color value S of the pixel as S = 256 * 256 * R + 256 * G + B, and generate an image matrix Where Si,j represents the color value of the pixel in the i-th row and j-th column of the image to be identified, X represents the horizontal resolution of the image to be identified, and Y represents the vertical resolution of the image to be identified;

[0010] S2: Set up simplified box Wherein, λ1, λ2, λ3 represent the preset first, second and third weight values respectively, and 0<λ1<λ2<λ3;

[0011] S3: Move the simplified frame K from left to right and from top to bottom in the image matrix T. The moving distances are respectively the row height and column width of the simplified frame K. Calculate the comprehensive value ZH of the overlapped portion of the simplified frame K and the image matrix T using the formula:

[0012]

[0013] Where Sx,y represents the color value of the xth row and yth column in the image matrix T, 0≤x≤X-2, 0≤y≤Y-2;

[0014] S4: Generate a simplified set U = {ZH1, ZH2, . . . , ZHn}, where ZHn represents the comprehensive value of the parts where the simplified box K overlaps with the image matrix T for the nth time, and n represents the total number of parts where the simplified box K overlaps with the image matrix T;

[0015] Obtain a simplified set U_s = {ZH_s1, ZH_s2, ..., ZH_sn} corresponding to the student ID photo in the school database, where ZH_sn represents the comprehensive value of the portion where the simplified box overlaps with the standard matrix for the nth time. The standard matrix is the image matrix corresponding to the student ID photo;

[0016] Calculate the error set UW = {W1, W2, ···Wh, ···, Wn}, where Wh = ZHh - ZH_Sh, and 1≤h≤n. If Wh is within the judgment interval [-δ, δ], it is recorded as a qualified element, where δ is a preset judgment coefficient and δ>0;

[0017] Calculate the ratio B of qualified elements in the error set UW = F / Fall*100%. If the ratio B is greater than 80%, the face retrieval is successful. If there is no student ID photo in the database that makes the ratio B greater than 80%, it is indicated that the student is an off-campus person, where F represents the number of qualified elements in the error set UW, and Fall represents the total number of elements in the error set UW.

[0018] As a further solution of the present invention: in the step S1, a background image is collected, and a simplified set of the background image is calculated, and elements equal to those in the background image are eliminated.

[0019] As a further solution of the present invention: in the step S1, obtain the illumination intensity L of the current external environment. If the illumination intensity L is not equal to the preset illumination intensity Lsta, calculate the illumination intensity difference ΔL = L - Lsta. If the illumination intensity difference ΔL < 0, increase the grayscale value of the image to be recognized by HD = η * ΔL, where Lsta is the preset standard light intensity and η is the preset grayscale change value.

[0020] As a further solution of the present invention: another setting method of the simplified frame K includes:

[0021] If the horizontal resolution X of the image to be recognized is not equal to the vertical resolution Y and the resolution is greater than or equal to 2K, and if X > Y, set a simplified frame with a size of 3 * 6.

[0022] As a further solution of the present invention: the simplified frame with a size of 3 * 6

[0023]

[0024] As a further solution of the present invention: in the step S4, if the image matrix cannot completely coincide with the simplified frame, the non - coincident part is recorded as the missing part, and the missing part is removed.

[0025] As a further solution of the present invention: in the step S1, obtain the number of bytes E used by the pixel to display the three primary colors. If the number of bytes E ≠ 1, calculate the color value S of the pixel at this time as S = 2 16E R + 2 8E G + B.

[0026] A system for retrieving face images includes:

[0027] A pre - processing module: performs image data acquisition, takes the collected face image as the image to be recognized, obtains the intensities of the three primary colors of the pixels in the image to be recognized. The intensities of the three primary colors include the red - channel intensity R, the green - channel intensity G, and the blue - channel intensity B, calculates the color value S of the pixel as S = 256 * 256 * R + 256 * G + B, and generates an image matrix where Si,j represents the color value of the pixel in the i - th row and j - th column of the image to be recognized, X represents the horizontal resolution of the image to be recognized, and Y represents the vertical resolution of the image to be recognized;

[0028] A simplification module: sets a simplified frame where λ1, λ2, λ3 respectively represent the preset first, second, and third weight values, and 0 < λ1 < λ2 < λ3;

[0029] Calculation module: Let the simplified box K move successively from left to right and from top to bottom in the image matrix T, and the moving distances are respectively the row height and column width of the simplified box K. Calculate the comprehensive value ZH of the overlapping part between the simplified box K and the image matrix T through the formula. The specific formula is as follows:

[0030]

[0031] Among them, Sx,y represents the color value of the x-th row and y-th column in the image matrix T, where 0 ≤ x ≤ X - 2 and 0 ≤ y ≤ Y - 2;

[0032] Judgment module: Generate the simplified set U = {ZH1, ZH2, ···, ZHn}, where ZHn represents the comprehensive value of the overlapping part of the simplified box K with the image matrix T for the n-th time, and n represents the total number of overlapping parts of the simplified box K with the image matrix T;

[0033] Obtain the simplified set U_s = {ZH_s1, ZH_s2, ···, ZH_sn} corresponding to the student ID photo in the school database. Among them, ZH_sn represents the comprehensive value of the overlapping part of the simplified box with the standard matrix for the n-th time, and the standard matrix is the image matrix corresponding to the student ID photo;

[0034] Calculate the error set UW = {W1, W2, ··· Wh, ···, Wn}, where Wh = ZHh - ZH_Sh, and 1 ≤ h ≤ n. If Wh is within the judgment interval [-δ, δ], it is recorded as a qualified element, where δ is a preset judgment coefficient and δ > 0;

[0035] Calculate the ratio B = F / Fall * 100% of the qualified elements in the error set UW. If the ratio B is greater than 80%, the face retrieval is successful; if there is no student ID photo in the database that makes the ratio B greater than 80%, it is prompted as an off-campus person, where F represents the number of qualified elements in the error set UW, and Fall represents the total number of elements in the error set UW.

[0036] Advantages of the present invention: In the present invention, after obtaining the original data of the image, the next key step is to calculate the color value of the pixel according to the color intensity of the three primary colors. Here, the three primary colors, namely Red, Green, and Blue, are the basis for forming all colors. Usually, one byte is used to represent the color intensity of a primary color. A byte consists of 8 bits. Since the computer system uses binary counting, each bit has two states, 0 and 1. According to the binary operation rules, 8 bits can represent at most 2 8 = 256 different color intensities.

[0037] As can be seen from the color value calculation formula, different colors will correspond to a unique combination of numbers. This unique combination of numbers is like the "ID number" of each color, accurately identifying the position of the color in the color space. Based on this principle, we can arrange the color values corresponding to each pixel point in the entire image in a certain order to form a matrix, that is, generate an image matrix. This image matrix can represent the overall characteristics of the image. By analyzing the image matrix, we can obtain many key information of the image.

[0038] In the process of image processing, after obtaining the image matrix, a crucial step is to simplify the obtained image matrix.

[0039] First of all, there are a huge number of pixels in an image. These pixels constitute the basic units of the image, and each contains certain color information and position information. However, if all pixels are directly processed comprehensively and meticulously, a series of serious problems will arise. From the perspective of computing power resources, processing such a large amount of data requires extremely powerful computing capabilities. This means that high-performance computing devices need to be equipped, such as processors with a large number of cores, large-capacity memory, and high-speed data transmission channels, etc. This will not only increase the procurement cost of hardware devices but also consume a large amount of electrical energy to maintain the operation of the devices. For example, when processing large images with high resolution, if complex operations are performed on each pixel, even using the most advanced computing devices, it may take a long time to complete a processing process.

[0040] Secondly, comprehensively processing all pixels will greatly reduce the retrieval speed. In many practical applications, such as querying an image database and searching based on image content, it is crucial to quickly and accurately retrieve the target image. If all pixels are processed, then a large amount of data needs to be compared and analyzed during the retrieval process, which will lead to too long retrieval time and cannot meet the user's real-time requirements. For example, in a database containing millions of images, if each image's all pixels need to be compared one by one during each retrieval, then even using an efficient retrieval algorithm, users may need to wait for a long time to get the result, which will undoubtedly seriously affect the user experience.

[0041] More importantly, not all pixels have practical significance and value. In an image, some pixels may be in the background area or some insignificant detail parts, and they do not make a substantial contribution to the main features and object recognition of the image. Therefore, it is very necessary to reasonably simplify these meaningless pixels. After removing the pixels that do not need to be processed, the scale of data processing will be significantly reduced, thus accelerating the processing speed and improving the operating efficiency of the entire system.

[0042] As can be seen from the set simplification box, it has unique weight distribution characteristics. Among them, the weight ratio of the central area is the highest, while the weight ratios of the four corners are the lowest. This carefully designed weight distribution method has many important significances and positive impacts.

[0043] From the perspective of image imaging quality, this processing method can further improve the imaging quality of the image. In practical applications, the central area is often the most concerned part because it usually contains the most important features and information content of the image. At the same time, appropriately weakening the surrounding areas can effectively avoid the interference of surrounding environmental factors on the main body.

[0044] This way of highlighting the center, weakening the surrounding areas and performing blurring processing also brings a significant improvement in processing speed. During the image processing process, a large amount of data needs to be analyzed and calculated. By reducing the weights of unimportant areas such as the four corners, it is equivalent to reducing the amount of data processing for these areas.

[0045] The core purpose of generating the simplification set is to realize the transformation of the image from two-dimensional to one-dimensional. In traditional image processing, a two-dimensional image contains a vast amount of data information, and each pixel point has its specific color and position attributes, which undoubtedly brings a huge computational burden to subsequent processing work. By cleverly constructing the simplification set and converting the image into a one-dimensional form, the amount of data can be greatly reduced. For example, a two-dimensional image composed of tens of thousands of pixel points may only be accurately represented by a few hundred comprehensive values after being transformed into a simplification set.

[0046] After obtaining the simplification set, it needs to be compared with the standard set. The standard set here has special significance. It is a set of comprehensive values corresponding to the student ID photos included in the system. These student ID photos have undergone strict screening and sorting, and have a high degree of standardization and accuracy. Each ID photo corresponds to a unique set of comprehensive values, and these values are like the "facial fingerprints" of each person, which can accurately identify the facial features of an individual.

[0047] Based on these difference values, the similarity of elements can be further determined. For those elements with small errors, that is, the difference between the corresponding elements in the two sets is within a preset reasonable range, they are marked as qualified elements. This process is not a simple binary judgment, but fully takes into account the complexity and uncertainty in practical applications. By counting the proportion of qualified elements among all elements, a quantitative index can be obtained to evaluate the similarity degree of two pictures. When the proportion of qualified elements is greater than a certain value, there is sufficient basis to determine that the similarity degree of the two pictures is high, and thus it is determined that the face retrieval is successful.

[0048] This approach has multiple advantages. On the one hand, it ensures the strictness in the verification process. By strictly comparing with the standard set, it is ensured that only when the image highly matches the standard ID photo can it be determined that the retrieval is successful, effectively preventing incorrect identity recognition and illegal access. On the other hand, this mechanism of marking qualified elements also increases a certain degree of fault tolerance.

[0049] In summary, the present invention simplifies, calculates, and reduces the dimension of the collected image data, etc., so that without losing important information, the data processing speed is accelerated, enabling the system to make timely responses and judgments, meeting the requirements of practical applications. It realizes the reasonable allocation of computing resources, thereby improving the efficiency of the entire image processing. It speeds up the face retrieval speed, enabling students to pass through the access control system more quickly and conveniently when entering and leaving the campus. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The present invention will be further described below with reference to the accompanying drawings.

[0051] Figure 1 It is a schematic flowchart of a method for retrieving face images according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts belong to the scope of protection of the present invention.

[0053] Please refer to Figure 1 As shown, the present invention is a method for retrieving face images, including the following steps:

[0054] S1: Perform image data acquisition, take the captured facial image as the image to be recognized, obtain the intensity of the three primary colors of the pixels in the image to be recognized. The intensity of the three primary colors includes the intensity of the red channel R, the intensity of the green channel G, and the intensity of the blue channel B. Calculate the color value S of the pixel as S = 256 * 256 * R + 256 * G + B, and generate an image matrix. Where Si,j represents the color value of the pixel in the i-th row and j-th column of the image to be recognized, X represents the horizontal resolution of the image to be recognized, and Y represents the vertical resolution of the image to be recognized.

[0055] S2: Set a simplified box Where λ1, λ2, and λ3 respectively represent the preset first, second, and third weight values, and 0 < λ1 < λ2 < λ3.

[0056] S3: Let the simplified box K move sequentially from left to right and from top to bottom in the image matrix T, and the moving distances are respectively the row height and column width of the simplified box K. Calculate the comprehensive value ZH of the overlapping part of the simplified box K and the image matrix T through the formula. The specific formula is:

[0057]

[0058] Where Sx,y represents the color value of the pixel in the x-th row and y-th column of the image matrix T, 0 ≤ x ≤ X - 2, 0 ≤ y ≤ Y - 2.

[0059] S4: Generate a simplified set U = {ZH1, ZH2, ···, ZHn}, where ZHn represents the comprehensive value of the overlapping part of the simplified box K and the image matrix T for the n-th time, and n represents the total number of overlapping parts of the simplified box K and the image matrix T.

[0060] Obtain the simplified set U_s = {ZH_s1, ZH_s2, ···, ZH_sn} corresponding to the student ID photos in the school database. Where ZH_sn represents the comprehensive value of the overlapping part of the simplified box and the standard matrix for the n-th time. The standard matrix is the image matrix corresponding to the student ID photo.

[0061] Calculate the error set UW = {W1, W2, ··· Wh, ···, Wn}, where Wh = ZHh - ZH_Sh, and 1 ≤ h ≤ n. If Wh is within the judgment interval [-δ, δ], it is recorded as a qualified element. Where δ is the preset judgment coefficient, δ > 0.

[0062] Calculate the ratio B of the qualified elements in the error set UW as B = F / Fall * 100%. If the ratio B is greater than 80%, the face retrieval is successful. If there is no student ID photo in the database that makes the ratio B greater than 80%, it is prompted as an off-campus person. Where F represents the number of qualified elements in the error set UW, and Fall represents the total number of elements in the error set UW.

[0063] It should be noted that after obtaining the original data of the image, the next key step is to calculate the color value of the pixel according to the color intensity of the three primary colors. The three primary colors here, namely Red, Green, and Blue, are the basis for forming all colors. Usually, one byte is used to represent the color intensity of a primary color. A byte consists of 8 bits. Since the computer system uses binary counting, each bit has two states, 0 and 1. According to the binary operation rules, 8 bits can represent at most 2 8 = 256 different color intensities.

[0064] It can be seen from the color value calculation formula that different colors will correspond to a unique digital combination. This unique digital combination is like the "ID number" of each color, accurately identifying the position of the color in the color space. Based on this principle, we can arrange the color values corresponding to each pixel point in the entire image in a certain order to form a matrix, that is, generate an image matrix. This image matrix can show the overall characteristics of the image. By analyzing the image matrix, we can obtain many key information of the image.

[0065] In the process of image processing, after obtaining the image matrix, a crucial step is to simplify the obtained image matrix.

[0066] First of all, there are a huge number of pixels in an image. These pixels form the basic units of the image, and each contains certain color information and position information. However, if all pixels are directly processed comprehensively and meticulously, a series of serious problems will arise. From the perspective of computing power resources, processing such a large amount of data requires extremely powerful computing capabilities as support. This means that high-performance computing devices need to be equipped, such as processors with a large number of cores, large-capacity memory, and high-speed data transmission channels, etc. This will not only increase the procurement cost of hardware devices but also consume a large amount of electrical energy to maintain the operation of the devices. For example, when processing large high-resolution images, if complex operations are performed on each pixel, even using the most advanced computing devices, it may take a long time to complete a processing process.

[0067] Secondly, processing all pixels comprehensively will greatly reduce the retrieval speed. In many practical applications, such as querying an image database, image content-based search, etc., quickly and accurately retrieving the target image is crucial. If all pixels are processed, then a large amount of data needs to be compared and analyzed during the retrieval process, which will result in an overly long retrieval time and cannot meet the user's real-time requirements. For example, in a database containing millions of images, if all pixels of each image need to be compared one by one during each retrieval, then even with an efficient retrieval algorithm, users may need to wait a long time to get the results, which will undoubtedly seriously affect the user experience.

[0068] More importantly, not all pixels have practical significance and value. In an image, some pixels may be in the background area or some unimportant detail parts, and they do not make a substantial contribution to the main features and target recognition of the image. Therefore, it is very necessary to reasonably simplify these meaningless pixels. After removing the pixels that do not need to be processed, the scale of data processing will be significantly reduced, thereby accelerating the processing speed and improving the operating efficiency of the entire system.

[0069] As can be seen from the set simplification box, it has unique weight distribution characteristics. Among them, the weight ratio of the central area is the highest, while the weight ratio of the four corners is the lowest. This carefully designed weight distribution method has multiple important significances and positive impacts.

[0070] From the perspective of image imaging quality, this processing method can further improve the imaging quality of the image. In practical applications, the central area is often the most concerned part because it usually contains the most important features and information content of the image. At the same time, appropriately weakening the surrounding areas can effectively avoid the interference of surrounding environmental factors on the main body.

[0071] This way of highlighting the center, weakening the surrounding areas and performing blurring processing also brings a significant improvement in processing speed. During the image processing process, a large amount of data needs to be analyzed and calculated, and by reducing the weight of unimportant areas such as the four corners, it is equivalent to reducing the amount of data processing for these areas.

[0072] The core purpose of generating a simplified set is to achieve the transformation of an image from two-dimensional to one-dimensional. In traditional image processing, a two-dimensional image contains a vast amount of data information, and each pixel point has its specific color and position attributes, which undoubtedly brings a huge computational burden to subsequent processing tasks. By cleverly constructing a simplified set and converting the image into a one-dimensional form, the amount of data can be greatly reduced. For example, a two-dimensional image composed of thousands of pixel points may be accurately represented by only a few hundred comprehensive values after being transformed into a simplified set.

[0073] After obtaining the simplified set, it is necessary to compare it with the standard set. The standard set here has special significance. It is a set of comprehensive values corresponding to the student ID photos included in the system. These student ID photos have undergone strict screening and sorting, and have a high degree of standardization and accuracy. Each ID photo corresponds to a unique set of comprehensive values, which can accurately identify the facial features of an individual like everyone's "facial fingerprint".

[0074] Based on these difference values, the similarity of elements can be further judged. For those elements with small errors, that is, the difference between the corresponding elements in the two sets is within a preset reasonable range, they are marked as qualified elements. This process is not a simple binary judgment, but fully takes into account the complexity and uncertainty in practical applications. By counting the proportion of qualified elements among all elements, a quantitative index can be obtained to evaluate the similarity degree of two pictures. When the proportion of qualified elements is greater than a certain value, there is sufficient basis to determine that the similarity degree of the two pictures is high, and thus the face retrieval is considered successful.

[0075] This approach has many advantages. On the one hand, it ensures the strictness in the verification process. By strictly comparing with the standard set, it is ensured that only when the image highly matches the standard ID photo can the retrieval be considered successful, effectively preventing incorrect identity recognition and illegal access. On the other hand, this mechanism of marking qualified elements also increases a certain degree of fault tolerance.

[0076] In another preferred embodiment of the present invention, a background image is collected, and the simplified set of the background image is calculated, and the elements equal to those in the background image are removed.

[0077] It is worth noting that the background image is meaningless in the retrieval process and may even interfere with normal recognition. Therefore, removing the same elements in the background image reduces the interference caused by excessive invalid factors to the result accuracy.

[0078] In another preferred embodiment of the present invention, the illumination intensity L of the current external environment is obtained. If the illumination intensity L is not equal to the preset illumination intensity Lsta, the illumination intensity difference ΔL = L - Lsta is calculated. If the illumination intensity difference ΔL < 0, the gray value of the image to be recognized is increased by HD = η * ΔL, where Lsta is the preset standard light intensity and η is the preset gray value change.

[0079] It can be understood that the gray value is also an important factor in imaging, and the illumination intensity often affects the accuracy of the shooting system's acquisition of the intensities of the three primary colors. Therefore, it is necessary to appropriately adjust the gray value according to the illumination intensity of the external environment.

[0080] In another preferred embodiment of the present invention, another setting method of the simplified box K includes:

[0081] If the horizontal resolution X of the image to be recognized is not equal to the vertical resolution Y and the resolution is greater than or equal to 2K, and if X > Y, a simplified box with a size of 3 * 6 is set.

[0082] It should be noted that as the resolution increases, the number of pixels increases. When the number of pixels exceeds a certain value, in order to ensure the face retrieval speed, it is necessary to increase the size of the simplified box, in short, to increase the simplification intensity.

[0083] Here, only the case of X > Y is exemplified. For the case of X < Y, a simplified box with a size of 6 * 3 is set in the same way.

[0084] In a preferred case of this embodiment, the simplified box with a size of 3 * 6

[0085]

[0086] It is worth noting that as the size of the simplified box changes, its internal weights still satisfy the characteristics of "central prominence and peripheral weakening".

[0087] In another preferred embodiment of the present invention, if the image matrix cannot completely coincide with the simplified box, the non - coincident part is recorded as the missing part, and the missing part is removed.

[0088] It can be understood that for the missing part, if it is executed in the normal steps, due to the lack of the number of its elements, it will probably not meet the subsequent judgment conditions, thus making the value of the ratio B smaller and affecting the face retrieval result.

[0089] In another preferred embodiment of the present invention, the number of bytes E used by the pixel to display the three primary colors is obtained. If the number of bytes E ≠ 1, the color value S of the pixel at this time is calculated as S = 2 16E R + 2 8E G + B.

[0090] It is worth noting that when each of the three primary colors in a pixel uses more than one byte to represent the color intensity, in order to ensure the uniqueness of each degree of color, the color value needs to be recalculated.

[0091] A system for retrieving face images includes:

[0092] A preprocessing module: performs image data acquisition, takes the captured face image as the image to be recognized, obtains the intensities of the three primary colors of the pixels in the image to be recognized, where the intensities of the three primary colors include the red channel intensity R, the green channel intensity G, and the blue channel intensity B, calculates the color value S = 256 * 256 * R + 256 * G + B of the pixel, and generates an image matrix where Si,j represents the color value of the pixel in the i-th row and j-th column of the image to be recognized, X represents the horizontal resolution of the image to be recognized, and Y represents the vertical resolution of the image to be recognized;

[0093] A simplification module: sets a simplification box where λ1, λ2, and λ3 respectively represent preset first, second, and third weight values, and 0 < λ1 < λ2 < λ3;

[0094] A calculation module: makes the simplification box K move sequentially from left to right and from top to bottom in the image matrix T, and the moving distances are respectively the row height and column width of the simplification box K, and calculates the comprehensive value ZH of the overlapping part of the simplification box K and the image matrix T through the formula. The specific formula is:

[0095]

[0096] where Sx,y represents the color value of the pixel in the x-th row and y-th column of the image matrix T, 0 ≤ x ≤ X - 2, 0 ≤ y ≤ Y - 2;

[0097] A judgment module: generates a simplification set U = {ZH1, ZH2, ···, ZHn}, where ZHn represents the comprehensive value of the n-th overlapping part of the simplification box K and the image matrix T, and n represents the total number of overlapping parts of the simplification box K and the image matrix T;

[0098] Obtains the simplification set U_s = {ZH_s1, ZH_s2, ···, ZH_sn} corresponding to the student ID photos in the school database, where ZH_sn represents the comprehensive value of the n-th overlapping part of the simplification box and the standard matrix, and the standard matrix is the image matrix corresponding to the student ID photo;

[0099] Calculates an error set UW = {W1, W2, ··· Wh, ···, Wn}, where Wh = ZHh - ZH_Sh, and 1 ≤ h ≤ n. If Wh is within the judgment interval [-δ, δ], it is recorded as a qualified element, where δ is a preset judgment coefficient, and δ > 0;

[0100] Calculate the ratio B of the qualified elements in the calculation error set UW, where B = F / Fall * 100%. If the ratio B is greater than 80%, the face retrieval is successful. If there is no student ID photo in the database that makes the ratio B greater than 80%, it is prompted that the person is from outside the school. Here, F represents the number of qualified elements in the error set UW, and Fall represents the total number of elements in the error set UW.

[0101] The above has described an embodiment of the present invention in detail, but the content described is only a preferred embodiment of the present invention and cannot be considered as limiting the scope of implementation of the present invention. All equivalent changes and improvements made according to the scope of the application of the present invention should still fall within the scope covered by the patent of the present invention.

Claims

1. A method for retrieving face images, characterized in that, The following steps are involved: S1: Perform image data acquisition. Use the captured facial image as the image to be recognized. Obtain the intensities of the three primary colors of the pixels in the image to be recognized. The intensities of the three primary colors include the red channel intensity R, the green channel intensity G, and the blue channel intensity B. Calculate the color value S of the pixel as S = 256 * 256 * R + 256 * G + B, and generate an image matrix. Among them, Si,j represents the color value of the pixel in the i-th row and j-th column of the image to be recognized. X represents the horizontal resolution of the image to be recognized, and Y represents the vertical resolution of the image to be recognized. S2: Set the simplified box Wherein, λ1, λ2, and λ3 respectively represent preset first, second, and third weight values, and 0 < λ1 < λ2 < λ3; S3: Move the simplified frame K from left to right and from top to bottom in the image matrix T. The moving distances are respectively the row height and column width of the simplified frame K. Calculate the comprehensive value ZH of the overlapped portion of the simplified frame K and the image matrix T using the formula: Where Sx,y represents the color value of the xth row and yth column in the image matrix T, 0≤x≤X-2, 0≤y≤Y-2; S4: Generate a simplified set U = {ZH1, ZH2, . . . , ZHn}, where ZHn represents the comprehensive value of the parts where the simplified box K overlaps with the image matrix T for the nth time, and n represents the total number of parts where the simplified box K overlaps with the image matrix T; Obtain a simplified set U_s = {ZH_s1, ZH_s2, ..., ZH_sn} corresponding to the student ID photo in the school database, where ZH_sn represents the comprehensive value of the portion where the simplified box overlaps with the standard matrix for the nth time. The standard matrix is the image matrix corresponding to the student ID photo; Calculate the error set UW = {W1, W2, ···Wh, ···, Wn}, where Wh = ZHh - ZH_Sh, and 1≤h≤n. If Wh is within the judgment interval [-δ, δ], it is recorded as a qualified element, where δ is a preset judgment coefficient and δ>0; Calculate the ratio B of qualified elements in the error set UW = F / Fall*100%. If the ratio B is greater than 80%, the face retrieval is successful. If there is no student ID photo in the database that makes the ratio B greater than 80%, it is indicated that the student is an off-campus person, where F represents the number of qualified elements in the error set UW, and Fall represents the total number of elements in the error set UW.

2. A method for retrieving a face image according to claim 1, characterized in that, In step S1, a background image is collected, and a simplified set of the background image is calculated, and elements that are equal to those in the background image are eliminated.

3. A method for retrieving a face image according to claim 1, characterized in that, In the step S1, the light intensity L of the current external environment is obtained. If the light intensity L is not equal to the preset light intensity Lsta, the light intensity difference ΔL=L-Lsta is calculated, and the light intensity difference ΔL<0, and the grayscale value of the image to be identified is increased by HD=η*ΔL, where Lsta is the preset standard light intensity and η is the preset grayscale change value.

4. A method for retrieving a face image according to claim 1, characterized in that, In step S2, another method for setting the simplified frame K includes: If the horizontal resolution X of the image to be recognized is not equal to the vertical resolution Y and the resolution is greater than or equal to 2K, if X>Y, a simplified frame with a size of 3*6 is set.

5. A method for retrieving a face image according to claim 4, characterized in that, Simplified box with dimensions 3*6 6. A method for retrieving a face image according to claim 1, characterized in that, In the step S4, if the image matrix cannot completely overlap with the simplified frame, the portion that cannot overlap is recorded as a missing portion and is removed.

7. A method for retrieving a face image according to claim 1, characterized in that, In the step S1, obtain the number of bytes E of the pixel for displaying the three primary colors. If the number of bytes E ≠ 1, calculate the color value S of the pixel at this time as S = 2 16E R + 2 8E G + B.

8. A system for retrieving face images, characterized in that, include: Preprocessing module: Collect image data, use the captured face image as the image to be recognized, obtain the intensity of the three primary colors of the pixels in the image to be recognized, where the intensity of the three primary colors includes the intensity R of the red channel, the intensity G of the green channel, and the intensity B of the blue channel, calculate the color value S of the pixel as S = 256 * 256 * R + 256 * G + B, and generate an image matrix Among them, Si,j represents the color value of the pixel in the i-th row and j-th column of the image to be recognized, X represents the horizontal resolution of the image to be recognized, and Y represents the vertical resolution of the image to be recognized; Simplification Module: Set Simplification Box Wherein, λ1, λ2, and λ3 respectively represent preset first, second, and third weight values, and 0 < λ1 < λ2 < λ3; Calculation module: Let the simplified box K move from left to right and from top to bottom in the image matrix T. The moving distance is respectively the row height and column width of the simplified box K. The comprehensive value ZH of the overlapped part of the simplified box K and the image matrix T is calculated by the formula. The specific formula is: Where Sx,y represents the color value of the xth row and yth column in the image matrix T, 0≤x≤X-2, 0≤y≤Y-2; Judgment module: Generate a simplified set U = {ZH1, ZH2, ···, ZHn}, where ZHn represents the comprehensive value of the nth coincidence part of the simplified box K with the image matrix T, and n represents the total number of coincidence parts of the simplified box K with the image matrix T; Obtain the simplified set U_s = {ZH_s1, ZH_s2, ···, ZH_sn} corresponding to the student ID photo in the school database, where ZH_sn represents the comprehensive value of the nth coincidence part of the simplified box with the standard matrix, and the standard matrix is the image matrix corresponding to the student ID photo; Calculate the error set UW = {W1, W2, ··· Wh, ···, Wn}, where Wh = ZHh - ZH_Sh, and 1 ≤ h ≤ n. If Wh is within the judgment interval [-δ, δ], it is recorded as a qualified element, where δ is a preset judgment coefficient, and δ > 0; Calculate the ratio B = F / Fall * 100% of the qualified elements in the error set UW. If the ratio B is greater than 80%, the face retrieval is successful; if there is no student ID photo in the database that makes the ratio B greater than 80%, it is prompted as an off-campus person, where F represents the number of qualified elements in the error set UW, and Fall represents the total number of elements in the error set UW.