Method for automatically processing staff photos to meet requirements specified by access control and passing equipment inspection
By automating the processing of employee photos, the problem of time-consuming and labor-intensive manual processing in large-scale employee photo processing is solved, and an efficient and accurate photo processing workflow is achieved, which is suitable for batch photo processing in large enterprises and parks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-03
- Publication Date
- 2026-03-17
AI Technical Summary
In the process of large-scale employee photo processing, existing technologies are unable to automatically process employee photos to meet the requirements of access control devices, resulting in time-consuming, labor-intensive, and error-prone manual processing.
Through a series of automated steps, including determining image format, filtering facial features, locating and cropping, and uploading to the device, combined with regularized detection of brightness features and fine-grained verification of geometric constraints, the system ensures that the photos meet the standards of access control devices.
It achieves highly efficient processing without human intervention, improves photo processing efficiency, reduces error rate, and ensures that photos meet access control device certification standards.
Smart Images

Figure CN121686536A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photo processing, and more specifically, to a method for automatically processing employee photos to meet access control requirements and pass them through equipment verification. Background Technology
[0002] When integrating facial recognition access control systems, it's typically necessary to distribute employee photos. However, when the number of employees is too large to collect individual photos using specialized equipment, employees must provide their own. However, device authentication has specific requirements, and the photos provided by employees are often inconsistent and difficult to standardize. Problems include exceeding file size limits, non-standard portraits, and photos being copied from other sources. This necessitates manual processing of each photo individually, which is time-consuming, labor-intensive, and prone to errors.
[0003] Existing image processing technologies are quite mature, making it easy to process image files, perform compression, and correct images. However, each third-party technology package focuses on highly specialized techniques, making it complex to achieve automatic cropping and pass device certification.
[0004] To address the aforementioned problems, a technical solution is provided. Summary of the Invention
[0005] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a method for automatically processing employee photos to meet the requirements of access control regulations and passing them through equipment verification, thereby solving the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A method for automatically processing employee photos to meet access control requirements and pass equipment verification includes the following steps:
[0008] Step S1: Obtain employee photo attachments and determine whether the attachment type is a common image format;
[0009] Step S2: Locate facial features, verify the face, and filter out photos that do not meet the requirements.
[0010] Step S3: Locate the face and determine the distance from the top edge of the top row of the head to the bottom edge of the top row of the head in the image.
[0011] Step S4: Determine whether the image size needs to be compressed to a specified range;
[0012] Step S5: Upload the processed image.
[0013] In a preferred embodiment, in step S2, the photograph is assumed to be a pixel matrix. ,in Represents pixel coordinates, and pixel values (0-255) represent brightness; the smaller the pixel value, the darker the image.
[0014] First, convert the image to a luminance channel, then calculate the average luminance and luminance standard deviation;
[0015] The average brightness is the arithmetic mean of the brightness values of all pixels, ranging from 0 to 255, where 0 represents pure black and 255 represents pure white.
[0016] The standard deviation of brightness is the square root of the sum of squares of the deviations of all pixel brightness values from the average brightness.
[0017] The formulas for calculating the dark area threshold and the bright area threshold are as follows:
[0018] Dark area threshold =max(0, average brightness - 0.5 * standard deviation);
[0019] Bright area threshold =min(255, average brightness + 0.5 * standard deviation).
[0020] In a preferred embodiment, during dark area detection, the average brightness of any sub-region R is calculated. :
[0021] ;
[0022] like If so, then mark the area as a dark area;
[0023] When performing bright area detection, for any sub-region R, if If so, then mark the area as a bright area;
[0024] Perform contour rule verification. Let the width of any sub-region R be W and the height be H. Calculate the aspect ratio. :
[0025] ;
[0026] like If so, then the contour rule is satisfied.
[0027] In a preferred embodiment, binocular symmetry verification is performed, and the horizontal distance between the two eyes is calculated. : ;
[0028] If the eyes are vertically deviated If , then the symmetry requirement is satisfied;
[0029] The tip of the nose should be below the eyes. ;
[0030] The lips should be below the tip of the nose. .
[0031] In a preferred embodiment, in step S3, the image is assumed to be a pixel matrix. ,in Represents pixel coordinates, a set List={f1,f2,f3,f4......fn} obtained through facial feature points, where each point fi=(xi,yi) has coordinates;
[0032] The facial bounding box is derived by using the coordinates of facial feature points. 4 points;
[0033] according to The four points marked on the image are: This gives you the location of the image.
[0034] The difference in the y-axis between the highest point of the image and the highest point above the head represents the excess portion above the head.
[0035] The difference in the x-axis between the leftmost point of the image and the leftmost point of the left ear represents the excess portion on the left.
[0036] The difference in the x-axis between the rightmost and leftmost points of the image represents the excess portion on the right side.
[0037] The difference in the y-axis value between the bottom of the image and the lowest point of the chin represents the excess portion at the bottom.
[0038] In a preferred embodiment, the facial tilt angle formula is calculated using binocular feature points, with the coordinates of the left eye set. Right eye coordinates ;
[0039] Then the tilt angle is:
[0040] ,like If the value is greater than 0, it needs to be corrected.
[0041] In a preferred embodiment, in step S4, the image is compressed proportionally to its width and height according to the input parameters min and max, and compressed to between min and max. Then, the image is converted to the corresponding file type format according to the input parameter p.
[0042] In a preferred embodiment, in step S5, the manufacturer's SDK or API address is used to upload a test account based on the input access control device address a, device account u, and device password p parameters, and to verify whether the final compliance is achieved.
[0043] The technical effects and advantages of this invention's method for automatically processing employee photos to meet access control requirements and pass equipment verification are as follows:
[0044] 1. The entire process requires no manual intervention and automatically completes image format verification, face filtering, positioning and cropping, compression adaptation and device upload verification. This solves the problem of time-consuming, labor-intensive and error-prone manual processing of photos one by one when there are a large number of employees, and greatly improves processing efficiency. It is especially suitable for batch photo processing scenarios such as large enterprises and parks.
[0045] 2. By employing a two-stage strategy of brightness feature regularization detection and geometric constraint fine verification, combined with dark / bright area thresholding algorithms, facial feature position relationship verification (eye symmetry, hierarchical relationship between nose tip and lips), and contour ratio screening, it can effectively exclude unqualified photos such as non-human faces, copied photos, and photos with non-standard facial features. The face recognition accuracy is high, ensuring that the processed photos meet the face authentication standards of access control equipment and reducing the upload rejection rate. Attached Figure Description
[0046] Figure 1 This is a flowchart illustrating the method of automatically processing employee photos to meet access control requirements and pass equipment verification according to the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0048] Example 1
[0049] Reference Figure 1 This invention provides a method for automatically processing employee photos to meet access control requirements and pass equipment verification, comprising the following steps:
[0050] Step S1: Obtain employee photo attachments and determine whether the attachment type is a common image format;
[0051] To determine whether the attachment meets the basic requirements, since the underlying structure of various image formats is actually the same, only the outer format is not uniform, we can directly and brute-force compile the file and interpret whether the file header is an image format, which is efficient and convenient.
[0052] Step S2: Locate facial features, verify the face, and filter out photos that do not meet the requirements.
[0053] Identify facial features (specifically, facial features) and facial contours to determine if a face exists in the photo, thereby filtering out photos that do not meet the criteria.
[0054] Step S3: Locate the face and determine the distance from the top edge of the top row of the head to the bottom edge of the top row of the head in the image.
[0055] Step S4: Determine whether the image size needs to be compressed to a specified range;
[0056] Step S5: Upload the processed image.
[0057] The initial stage is used to look for facial features and screen for the presence of a face:
[0058] First, summarize the common and obvious features of the human face, such as: the eye area is darker than the surrounding skin (regardless of skin tone, the eyes are a relatively dark patch); the bridge of the nose is brighter than the cheeks (the bridge of the nose is a relatively bright strip in the middle of the face); the lip area is darker than the surrounding skin (the color of the lips is usually darker than the cheeks); the overall shape of the human face is roughly narrower at the top and wider at the bottom or oval, and there will be no extreme shapes such as particularly sharp angles or a width that is much greater than the height.
[0059] These characteristics are transformed into quantifiable judgment criteria (such as the approximate area of the dark area and its location within a certain proportion of the image), forming a set of fixed rules;
[0060] In step S2, the photograph is assumed to be a pixel matrix. ,in Represents pixel coordinates, and pixel values (0-255) represent brightness; the smaller the pixel value, the darker the image.
[0061] First, convert the image to a luminance channel (the V channel of HSV, which describes the brightness of a color and is directly related to the brightness of light), and then calculate the average luminance and the standard deviation of luminance.
[0062] Average brightness is the arithmetic mean of the brightness values of all pixels, ranging from 0 to 255, where 0 represents pure black and 255 represents pure white, reflecting the overall brightness of the image.
[0063] The standard deviation of brightness is the square root of the sum of squares of the deviations of all pixel brightness values from the average brightness. It reflects the dispersion of brightness distribution. A standard deviation of brightness > 50 indicates strong contrast between light and dark areas in the image (such as backlighting or night scenes), while a standard deviation of brightness < 30 indicates weak contrast (such as photos taken on a cloudy day).
[0064] The formulas for calculating the dark area threshold and the bright area threshold are as follows:
[0065] Dark area threshold =max(0, average brightness - 0.5 * standard deviation);
[0066] Bright area threshold =min(255, average brightness + 0.5 * standard deviation).
[0067] When performing dark area detection, for any sub-region R corresponding to features such as eyes and lips, calculate its average brightness. :
[0068] ;
[0069] This represents the pixel value of the pixel at coordinates (x, y) in the image in the luminance channel (i.e., the V channel of the HSV color space mentioned earlier);
[0070] like If so, then mark the area as a dark area; If a preset dark area threshold is set, such as 60, then the area is marked as a dark area.
[0071] When performing bright area detection, corresponding to features such as the bridge of the nose, for any sub-region R, if If so, then mark the area as a bright area; If a preset bright area threshold is set, such as 80, then the area is marked as a bright area.
[0072] Perform contour rule validation, corresponding to the overall shape of the face. Let the width of any sub-region R be W and the height be H, and calculate the aspect ratio. :
[0073] ;
[0074] like If the proportions of the face are within the range of an ellipse / narrower at the top and wider at the bottom, then the outline rule is satisfied.
[0075] In the fine-grained verification phase, it is confirmed whether the candidate region is a real human face:
[0076] The facial detail-based judgment model verifies the position of facial features, detailed characteristics, and texture patterns of candidate regions one by one, eliminating patterns that resemble human faces (such as stains on the wall, cartoon smiley faces, etc.) to ensure recognition accuracy.
[0077] Perform binocular symmetry verification and calculate the horizontal distance between the two eyes. : ;
[0078] If the eyes are vertically deviated If the face is approximately horizontally symmetrical and conforms to the features of a real human face, then the symmetry requirement is met.
[0079] The tip of the nose should be below the eyes. ;
[0080] The lips should be below the tip of the nose. .
[0081] In step S3, the face is located and the distance from the top edge of the head row to the bottom edge of the head row is determined to determine whether cropping and straightening are needed.
[0082] The entire image is divided into multiple grids to be pixelated, which makes the measurement of distance and other parameters more accurate. After obtaining the result data, you only need to use conventional methods to crop out the excess parts of the image and rotate and straighten it.
[0083] Let the image be a pixel matrix ,in Representing pixel coordinates, List={f1,f2,f3,f4......fn} is a set obtained through facial feature points, where each point fi=(xi,yi) has coordinates; facial feature points are the set obtained by integrating all the feature points (facial features + contours) extracted above according to coordinates, and i in fi=(xi,yi) represents the index of the feature point.
[0084] The facial bounding box is derived by using the coordinates of facial feature points. 4 points;
[0085] Pixelation and distance measurement stage:
[0086] according to The four points marked on the image are: This gives you the location of the image.
[0087] The difference in the y-axis between the highest point of the image and the highest point above the head represents the excess portion above the head.
[0088] The difference in the x-axis between the leftmost point of the image and the leftmost point of the left ear represents the excess portion on the left.
[0089] The difference in the x-axis between the rightmost and leftmost points of the image represents the excess portion on the right side.
[0090] The difference in the y-axis value between the bottom of the image and the lowest point of the chin represents the excess portion at the bottom.
[0091] Image positioning stage
[0092] The formula for facial tilt angle is calculated using feature points from both eyes, with the coordinates of the left eye set. Right eye coordinates ;
[0093] Then the tilt angle is:
[0094] ,like If the value is greater than 0, it needs to be corrected.
[0095] In step S4, the image is compressed proportionally to its length and width according to the input parameters min and max, and compressed to a value between min and max. Then, the image is converted to the corresponding file type format according to the input parameter p.
[0096] In step S5, the manufacturer's SDK or API address is used to upload a test account based on the input access control device address a, device account u, and device password p parameters, and to verify whether the final compliance is achieved.
[0097] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.
[0098] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0099] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0100] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing embodiments, and will not be repeated here.
[0101] In the several embodiments provided in this application, it should be understood that the disclosed systems and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0102] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0103] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0104] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0105] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0106] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for automatically processing an employee photo to the requirements of access control regulations and checking it through a device, characterized in that, It comprises the following steps: Step S1, obtain the employee photo attachment, judge whether the type of the attachment is a commonly used picture format; Step S2, find the facial organ features, and then check the face to filter out photos that do not meet the requirements; Step S3, position the face and judge the distance from the top of the head to the top of the head on the picture edge; Step S4, determine whether the picture memory size needs to be compressed to the specified range; Step S5, upload the processed picture.
2. The method of automatically processing employee photos to meet the requirements of access control and passing device inspection according to claim 1, characterized in that: In step S2, let the photo be a pixel matrix wherein represents the pixel coordinate, the pixel value (0-255) represents the brightness, the smaller the pixel value, the darker it is. First, convert the image to a brightness channel, then calculate the average brightness and brightness standard deviation; The average brightness is the arithmetic mean of all pixel brightness values, ranging from 0 to 255, where 0 represents pure black and 255 represents pure white; The brightness standard deviation is the square root of the sum of the squares of the deviations of all pixel brightness values from the average brightness; Calculate the dark area threshold and the bright area threshold, the formula is: Dark region threshold = max(0, mean luminance - 0.5 * standard deviation); bright region threshold = min(255, mean brightness + 0.5 * standard deviation).
3. The method of automatically processing employee photos to meet the requirements of access control and passing device inspection according to claim 2, characterized in that: When performing dark region detection, for any sub-region R, the average luminance of R is calculated : ; If then mark the region as dark; When performing bright region detection, for any sub-region R, if then mark the region as a bright region; Carrying out the contour rule verification, assuming the width of any sub-region R is W and the height is H, calculating the width-height ratio : ; If then the contour rule is satisfied.
4. The method of automatically processing employee photos to meet the requirements of access control and passing device inspection according to claim 3, characterized in that: Perform binocular symmetry verification, calculate binocular horizontal distance : ; If the vertical deviation of both eyes then the symmetry requirement is met; The tip of the nose should be below the eyes ; The lips need to be below the tip of the nose .
5. The method of automatically processing employee photos to meet the requirements of access control and passing device inspection according to claim 4, characterized in that: In step S3, set the picture as a pixel matrix wherein represent the pixel coordinates, and a set List={f1, f2, f3, f4,... fn} obtained by facial feature points, each point fi=(xi, yi) has coordinates; The face feature point coordinates are back calculated to obtain a face boundary frame, which are 4 point positions; According to 4 point position marks 4 points of the picture, respectively , get the position of the picture; The y-axis difference between the highest point of the picture and the highest point of the head is the excess part of the head; The x-axis difference between the leftmost side of the picture and the leftmost side of the left ear is the excess part of the left side; The x-axis difference between the rightmost side of the picture and the leftmost side of the right ear is the excess part of the right side; The y-axis difference between the bottom of the picture and the lowest point of the chin is the excess part of the bottom.
6. The method of automatically processing employee photos to meet the requirements of access control and passing device inspection according to claim 5, characterized in that: The face tilt angle formula is calculated by the feature points of the two eyes, wherein the left eye coordinate and the right eye coordinate are set. Then the inclination angle is: , if the value of is greater than 0, then a swing is required.
7. The method of automatically processing employee photos to meet the requirements of access control and passing device inspection according to claim 6, characterized in that: In step S4, according to the input parameters min, max, the picture is compressed in proportion to the length and width, and the picture is converted to the corresponding file type format according to the input parameter p.
8. The method of automatically processing employee photos to meet the requirements of access control and passing device inspection according to claim 7, characterized in that: In step S5, use the manufacturer's SDK or API address, according to the input access control device address a, device account u, and device password p parameters to test the account upload, and check whether it is finally compliant.