A community access terminal device-based image information collection method
By fitting and adjusting the resolution of facial images in community access control terminal devices, the balance problem between clarity and transmission time in the image recognition system is solved, recognition accuracy and efficiency are improved, and user waiting time and resource waste are reduced.
Patent Information
- Application Number
- CN202510249693.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-03-04
AI Technical Summary
In image recognition systems, how to find the optimal balance between image clarity, transmission time, and recognition accuracy to improve the overall efficiency of the system, especially in wireless transmission or real-time processing scenarios, to avoid the long transmission time and excessive computing resource requirements caused by high-resolution images.
By pre-collecting and recognizing facial images of different resolutions, using the least squares method to fit the relationship between recognition time and transmission time, constructing an objective function, and determining the optimal recognition resolution based on the objective function, downsampling or adjusting the focal length when necessary to optimize the image resolution, ensuring recognition accuracy and efficiency.
While ensuring recognition accuracy, it reduces user waiting time, improves access efficiency and user satisfaction, and avoids excessive transmission time and waste of computing resources caused by high-resolution images.
Smart Images

Figure CN120071489B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image acquisition, and in particular to an image information acquisition method based on a community access control terminal device. Background Art
[0002] With the continuous development of computer vision technology, image recognition systems are widely used in various fields, such as community access control and security. For these systems, image clarity directly affects the balance between recognition accuracy and system performance. However, in practical applications, there is a certain trade-off between image clarity and processing efficiency.
[0003] In traditional image processing and recognition systems, it's generally believed that clearer images lead to higher recognition accuracy. However, increased image clarity often comes with greater data transmission and computing resource requirements. Especially in wireless transmission or real-time processing scenarios, high-resolution images can result in longer transmission times, impacting system response speed and efficiency. During image recognition, system processing power and algorithm optimization also significantly impact recognition time. Improving image clarity doesn't necessarily significantly shorten recognition time and may even reduce efficiency due to processing bottlenecks.
[0004] Therefore, in some cases, moderate image clarity may achieve a better balance between recognition accuracy and computing resources, thereby improving overall system efficiency. By controlling image clarity and processing methods, it is possible to reduce data transmission time and computing resource consumption while maintaining sufficient recognition accuracy. Therefore, finding the optimal balance between image clarity, transmission time, and recognition accuracy has become a key issue in image recognition system design. Summary of the Invention
[0005] The purpose of this invention is to provide an image information acquisition method based on a community access control terminal device to solve the following technical problems:
[0006] Therefore, in some cases, moderate image clarity may achieve a better balance between recognition accuracy and computing resources, thereby improving overall system efficiency. By controlling image clarity and processing methods, it is possible to reduce data transmission time and computing resource consumption while maintaining sufficient recognition accuracy. Therefore, finding the optimal balance between image clarity, transmission time, and recognition accuracy has become a key issue in image recognition system design.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] A method for collecting image information based on a community access control terminal device, characterized by comprising the following steps:
[0009] S1: Pre-collect the same facial image at different resolutions and label each pre-collected image as F1, F2, ..., Fn. Perform face recognition on each pre-collected image in turn and record the recognition time. Use resolution as the horizontal axis and recognition time as the vertical axis to generate corresponding data points in the coordinate system. Fit the data points using the least squares method, using the fitting formula T(F).
[0010] Obtain the transmission time of any pre-captured image from the camera acquisition device to the cloud platform, with resolution as the horizontal axis and transmission time as the vertical axis, generate corresponding data points in the coordinate system, and fit the data points using the least squares method. The fitting formula is H(F);
[0011] S2, constructing the objective function Total(F)=T(F)+H(F) to determine the optimal recognition resolution BestF, acquiring the face image to be recognized in real time and preprocessing it, and obtaining the resolution ReaF of the preprocessed face image to be recognized;
[0012] S3, if ReaF is greater than BestF, the pre-processed face image to be identified is sampled, and the sampled face image to be identified is sent to the cloud platform for face recognition; if ReaF is less than BestF, the focal length of the camera acquisition device is adjusted and the face image to be identified is re-acquired, and the re-acquired face image is sent to the cloud platform for face recognition.
[0013] As a further solution of the present invention: in S2, the specific calculation process of the optimal recognition resolution is:
[0014] According to the objective function Total(F)=T(F)+H(F), a corresponding target curve is generated, and the minimum value of the target curve is obtained. The resolution corresponding to the minimum value is obtained and calibrated as the best recognition resolution BestF.
[0015] As a further solution of the present invention: if there are two or more minimum values in the target curve, the resolution corresponding to any minimum value is obtained and the maximum resolution MaxF is selected as the best recognition resolution BestF.
[0016] As a further solution of the present invention: in S2, the specific process of pretreatment is:
[0017] The face image to be identified is input into a preset OpenCV recognition model, and the face area in the face image to be identified is extracted. The minimum bounding rectangle of the face area is obtained with the horizontal length as the length and the vertical length as the width. The face image to be identified is cropped according to the minimum bounding rectangle to obtain a cropped face image.
[0018] As a further solution of the present invention: in S3, the specific process of resampling is:
[0019] Calculation according to the formula Calculate the adjustment coefficient K, establish a rectangular coordinate system with the center pixel of the preprocessed face image to be identified as the origin, generate the coordinates (x, y) of all pixels in the face image to be identified, and for any pixel point (xi, yi), calculate the corresponding position (xi', yi') of the pixel point in the sampled image according to the calculation formula xi'=xi*K; yi=yi*K, and obtain the four pixel points (x1, y1), (x1, y2), (x2, y1) and (x2, y2) closest to the pixel point (xi', yi'), where x1 is the largest integer less than or equal to x', x2 is the smallest integer greater than x', y1 is the largest integer less than or equal to y', and y2 is the smallest integer greater than y'; calculate the horizontal distance weight and vertical distance weight between (x', y') and these four pixels respectively, and calculate the pixel value f(x, y) of the pixel (xi, yi) after sampling according to the horizontal distance weight and vertical distance weight;
[0020] The specific calculation process is:
[0021] w1=x2-x', w2=x'-x1;
[0022] h1=y2-y', h2=y'-y1;
[0023] f(x',y')=w1×h1×f(x1,y1)+w1×h2×f(x1,y2)+w2×h1×f(x2,y1)
[0024] +w2×h2×f(x2,y2);
[0025] Among them, w1 and w2 are horizontal distance weights, h1 and h2 are vertical distance weights, and f(x,y) represents the pixel value of the pixel point (x,y).
[0026] As a further solution of the present invention: in S3, the specific process of focal length correction is:
[0027] According to the calculation formula The adjustment coefficient A is calculated, the focal length of the camera acquisition device when shooting is marked as f, the value of A*f is calculated and rounded up to obtain the corrected focal length f'.
[0028] As a further solution of the present invention: S3 further includes:
[0029] When the adjustment coefficient K is less than or equal to the preset threshold, no sampling is performed and the pre-processed face image to be recognized is directly sent to the cloud platform for face recognition.
[0030] As a further solution of the present invention: in said S1, the focal length and lens setting of the camera acquisition device remain unchanged during the pre-acquisition process, and the shooting angle of the facial image remains unchanged during the acquisition process.
[0031] Beneficial effects of the present invention:
[0032] The present invention first obtains facial images of different resolutions and records the recognition time, and then uses the least squares method to fit the relationship T(F) between the recognition time and the resolution. At the same time, the transmission time is also measured, and the least squares method is also used to fit the relationship H(F) between the transmission time and the resolution. The objective function is constructed according to the relationship between the recognition time and the transmission time and the resolution. It can be understood that the higher the image resolution, the larger the amount of image data, and the longer the transmission time in actual application scenarios. At the same time, in the process of face recognition, high-definition images contain more details and pixel information. Although it can improve recognition accuracy, it also means that more time is required for calculation and processing. When processing high-definition images, the algorithm requires more computing resources to extract and analyze features in the image, resulting in increased recognition time. Too low a resolution will cause image blur, requiring more time to compensate for accuracy through other technical means. Therefore, the optimal recognition resolution BestF can be determined based on the objective function. Considering that the shooting distance at which the camera capture device captures a facial image each time in actual scenarios changes dynamically, the resolution of the facial image also changes continuously. Therefore, in the present invention, the real-time captured image resolution ReaF is compared with BestF. If ReaF is greater than BestF, downsampling is performed. When the actual resolution is too high, recognition time and transmission time will increase. Therefore, downsampling greatly reduces the waiting time for users to wait for the access control to open while ensuring recognition accuracy, improves passage efficiency, and increases user satisfaction. If it is less than BestF, the focal length is adjusted and the image is re-captured. It is understandable that if the resolution is too low, the recognition accuracy may decrease. Secondly, other technical means are required to compensate for the accuracy, which greatly increases the recognition time. Therefore, it is necessary to adjust the focal length to obtain a higher-resolution image. While ensuring recognition accuracy, the waiting time for the access control to open is reduced. The present invention improves access efficiency and enhances user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The present invention will be further described below with reference to the accompanying drawings.
[0034] Figure 1 It is a flow chart of an image information collection method based on a community access control terminal device of the present invention. DETAILED DESCRIPTION
[0035] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0036] See also Figure 1 As shown, the present invention is a method for collecting image information based on a community access control terminal device, comprising the following steps:
[0037] S1: Pre-collect the same facial image at different resolutions and label each pre-collected image as F1, F2, ..., Fn. Perform face recognition on each image in turn and record the recognition time, labeling it as t1, t2, ..., tn. Use resolution as the horizontal axis and recognition time as the vertical axis to generate corresponding data points in the coordinate system. Fit the data points using the least squares method, using the fitting formula T(F).
[0038] Obtain the transmission time of any pre-captured image from the camera acquisition device to the cloud platform, with resolution as the horizontal axis and transmission time as the vertical axis, generate corresponding data points in the coordinate system, and fit the data points using the least squares method. The fitting formula is H(F);
[0039] S2, constructing an objective function Total(F)=T(F)+H(F), determining an optimal recognition resolution BestF based on the objective function, acquiring a face image to be recognized in real time using a camera acquisition device, preprocessing the face image to be recognized, and obtaining a resolution ReaF of the preprocessed face image to be recognized;
[0040] S3, if ReaF is greater than BestF, the preprocessed face image to be recognized is sampled, and the sampled face image to be recognized is sent to the cloud platform for face recognition; if ReaF is less than BestF, the focal length of the current camera acquisition device is corrected and the face image to be recognized is re-acquired, the face image to be recognized is preprocessed, and the preprocessed face image to be recognized is sent to the cloud platform for face recognition.
[0041] The present invention first obtains facial images of different resolutions and records the recognition time, and then uses the least squares method to fit the relationship T(F) between the recognition time and the resolution. At the same time, the transmission time is also measured, and the least squares method is also used to fit the relationship H(F) between the transmission time and the resolution. The objective function is constructed according to the relationship between the recognition time and the transmission time and the resolution. It can be understood that the higher the image resolution, the larger the amount of image data, and the longer the transmission time in actual application scenarios. At the same time, in the process of face recognition, high-definition images contain more details and pixel information. Although it can improve recognition accuracy, it also means that more time is required for calculation and processing. When processing high-definition images, the algorithm requires more computing resources to extract and analyze features in the image, resulting in increased recognition time. Too low a resolution will cause image blur, requiring more time to compensate for accuracy through other technical means. Therefore, the optimal recognition resolution BestF can be determined based on the objective function. Considering that the shooting distance at which the camera capture device captures a facial image each time in actual scenarios changes dynamically, the resolution of the facial image also changes continuously. Therefore, in the present invention, the real-time captured image resolution ReaF is compared with BestF. If ReaF is greater than BestF, downsampling is performed. When the actual resolution is too high, recognition time and transmission time will increase. Therefore, downsampling greatly reduces the waiting time for users to wait for the access control to open while ensuring recognition accuracy, improves passage efficiency, and increases user satisfaction. If it is less than BestF, the focal length is adjusted and the image is re-captured. It is understandable that if the resolution is too low, the recognition accuracy may decrease. Secondly, other technical means are required to compensate for the accuracy, which greatly increases the recognition time. Therefore, it is necessary to adjust the focal length to obtain a higher-resolution image. While ensuring recognition accuracy, the waiting time for the access control to open is reduced. The present invention improves access efficiency and enhances user satisfaction.
[0042] In another preferred embodiment of the present invention, in S2, the specific calculation process of the optimal recognition resolution is:
[0043] According to the objective function Total(F)=T(F)+H(F), a corresponding target curve is generated, and the minimum value of the target curve is obtained. The resolution corresponding to the minimum value is obtained and calibrated as the best recognition resolution BestF.
[0044] The objective function Total(F) = T(F) + H(F) combines face recognition time T(F) and image transmission time H(F). By generating a target curve, we can intuitively see the combined changes in these two time factors at different resolutions. The resolution corresponding to the minimum value of the target curve is calculated as the optimal recognition resolution BestF. It can be understood that at this resolution, face recognition time and transmission time reach a relatively optimal balance. For example, at low resolution, the transmission time is very short, but face recognition time may be longer because the lack of image details may cause the recognition algorithm to require more time to process operations such as feature extraction. At high resolution, although face recognition may be more accurate and faster, the transmission time will increase significantly. By determining BestF, we can ensure a certain level of recognition accuracy while avoiding the impact of excessive transmission time on overall efficiency.
[0045] In another preferred embodiment of the present invention, it is characterized in that, if there are two or more minimum values in the target curve, the resolution corresponding to any minimum value is obtained and the maximum resolution MaxF is selected therefrom as the best recognition resolution BestF.
[0046] It's understandable that selecting the maximum resolution, MaxF, ensures recognition accuracy while fully utilizing existing computing resources, avoiding the sacrifice of recognition quality by excessively pursuing low resolution to reduce transmission time. While modern technology has significantly improved the processing power of computing devices, it's still necessary to rationally allocate resources while ensuring efficient system operation. Selecting the maximum resolution, MaxF, isn't about blindly pursuing high resolution. Rather, it's about determining the optimal resolution that meets recognition accuracy requirements while remaining within the limits of available computing resources, after comprehensive evaluation and analysis. While excessively pursuing low resolution reduces computational effort to a certain extent, it comes at the expense of recognition quality, potentially leading to inaccurate face recognition and compromising system security and reliability. Conversely, blindly pursuing excessively high resolution not only significantly increases computing costs but also wastes resources.
[0047] In another preferred embodiment of the present invention, in S2, the specific process of pre-processing is:
[0048] The face image to be identified is input into a preset OpenCV recognition model, and the face area in the face image to be identified is extracted. The minimum bounding rectangle of the face area is obtained with the horizontal length as the length and the vertical length as the width. The face image to be identified is cropped according to the minimum bounding rectangle to obtain a cropped face image.
[0049] In another preferred embodiment of the present invention, in S3, the specific process of resampling is:
[0050] Calculation according to the formula Calculate the adjustment coefficient K, establish a rectangular coordinate system with the center pixel of the preprocessed face image to be identified as the origin, generate the coordinates (x, y) of all pixels in the face image to be identified, and for any pixel point (xi, yi), calculate the corresponding position (xi', yi') of the pixel point in the sampled image according to the calculation formula xi'=xi*K; yi=yi*K, and obtain the four pixel points (x1, y1), (x1, y2), (x2, y1) and (x2, y2) closest to the pixel point (xi', yi'), where x1 is the largest integer less than or equal to x', x2 is the smallest integer greater than x', y1 is the largest integer less than or equal to y', and y2 is the smallest integer greater than y'; calculate the horizontal distance weight and vertical distance weight between (x', y') and these four pixels respectively, and calculate the pixel value f(x, y) of the pixel (xi, yi) after sampling according to the horizontal distance weight and vertical distance weight;
[0051] The specific calculation process is:
[0052] w1=x2-x', w2=x'-x1;
[0053] h1=y2-y', h2=y'-y1;
[0054] f(x',y')=w1×h1×f(x1,y1)+w1×h2×f(x1,y2)+w2×h1×f(x2,y1)
[0055] +w2×h2×f(x2,y2);
[0056] Among them, w1 and w2 are horizontal distance weights, h1 and h2 are vertical distance weights, and f(x,y) represents the pixel value of the pixel point (x,y).
[0057] In another preferred embodiment of the present invention, the specific process of focal length correction in S3 is:
[0058] According to the calculation formula The adjustment coefficient A is calculated, the focal length of the camera acquisition device when shooting is marked as f, the value of A*f is calculated and rounded up to obtain the corrected focal length f'.
[0059] In another preferred embodiment of the present invention, said S3 further includes:
[0060] When the adjustment coefficient K is less than or equal to the preset threshold, no sampling is performed and the pre-processed face image to be recognized is directly sent to the cloud platform for face recognition.
[0061] In another preferred embodiment of the present invention, said S1 further includes keeping the focal length and lens setting of the camera acquisition device unchanged during the pre-acquisition process, and keeping the shooting angle of the facial image unchanged during the acquisition process.
[0062] The above is a detailed description of an embodiment of the present invention. However, the content described is only a preferred embodiment of the present invention and should not be considered to limit the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A method for collecting image information based on community access control terminal equipment, characterized in that: The following steps are involved: S1, pre-collect the same face image with different resolutions and mark each pre-collected image as F1, F2, ..., Fn; perform face recognition on each pre-collected image in turn and record the recognition time for each time; With resolution as the horizontal coordinate and recognition time as the vertical coordinate, the corresponding data points are generated in the coordinate system, and the data points are fitted by the least squares method. The fitting formula is T(F); Obtain the transmission time of any pre-captured image from the camera acquisition device to the cloud platform. Use resolution as the horizontal axis and transmission time as the vertical axis to generate corresponding data points in the coordinate system. Fit the data points using the least squares method. The fitting formula is H(F). S2, constructing the objective function Total(F)=T(F)+H(F) to determine the optimal recognition resolution BestF, acquiring the face image to be recognized in real time and preprocessing it, and obtaining the resolution ReaF of the preprocessed face image to be recognized; S3, if ReaF is greater than BestF, the pre-processed face image to be identified is sampled, and the sampled face image to be identified is sent to the cloud platform for face recognition; if ReaF is less than BestF, the focal length of the camera acquisition device is adjusted and the face image to be identified is re-acquired, and the re-acquired face image is sent to the cloud platform for face recognition.
2. The image information acquisition method based on community access control terminal equipment according to claim 1 is characterized in that: In S2, the specific calculation process of the optimal recognition resolution is: According to the objective function Total(F)=T(F)+H(F), a corresponding target curve is generated, and the minimum value of the target curve is obtained. The resolution corresponding to the minimum value is obtained and calibrated as the optimal recognition resolution BestF.
3. The image information acquisition method based on community access control terminal equipment according to claim 2 is characterized in that: The method further includes obtaining a resolution corresponding to any minimum value and selecting a maximum resolution MaxF as the best recognition resolution BestF if there are two or more minimum values in the target curve.
4. The image information acquisition method based on community access control terminal equipment according to claim 1 is characterized in that: In S2, the specific process of pre-processing is: The face image to be identified is input into a preset OpenCV recognition model, and the face area in the face image to be identified is extracted. The minimum bounding rectangle of the face area is obtained with the horizontal length as the length and the vertical length as the width. The face image to be identified is cropped according to the minimum bounding rectangle to obtain a cropped face image.
5. The image information acquisition method based on community access control terminal equipment according to claim 1 is characterized in that: In S3, the specific sampling process is as follows: Calculation according to the formula The adjustment coefficient K is calculated, and a rectangular coordinate system is established with the center pixel of the pre-processed face image as the origin to generate the coordinates (x, y) of all pixels in the face image to be identified. For any pixel (xi, yi), the calculation formula is used. Calculate the corresponding position (xi', yi') of the pixel point in the sampled image, obtain the four pixel points (x1, y1), (x1, y2), (x2, y1), and (x2, y2) closest to the pixel point (xi', yi'), where x1 is the largest integer less than xi', x2 is the smallest integer greater than xi', y1 is the largest integer less than yi', and y2 is the smallest integer greater than yi'; calculate the horizontal distance weights and vertical distance weights between (xi', yi') and these four pixels respectively, and calculate the pixel value f(x, y) of the pixel (xi, yi) after sampling based on the horizontal distance weights and vertical distance weights; The specific calculation process is: w1=x2-xi', w2=xi'-x1; h1=y2-yi', h2=yi'-y1; f(xi',yi')=w1×h1×f(x1,y1)+w1×h2×f(x1,y2)+w2×h1×f(x2,y1)+w2×h2×f(x2,y2); Among them, w1 and w2 are horizontal distance weights, h1 and h2 are vertical distance weights, and f(x,y) represents the pixel value of the pixel point (x,y).
6. The image information collection method based on community access control terminal equipment according to claim 1 is characterized in that: In S3, the specific process of focal length correction is as follows: According to the calculation formula Calculate the adjustment coefficient A, mark the focal length of the camera capture device when shooting as f, and calculate The value of is rounded up to get the corrected focal length f'.
7. The image information collection method based on community access control terminal equipment according to claim 5 is characterized in that: Said S3 also includes: When the adjustment coefficient K is less than or equal to the preset threshold, no sampling is performed and the pre-processed face image to be recognized is directly sent to the cloud platform for face recognition.
8. The image information collection method based on community access control terminal equipment according to claim 1 is characterized in that: Said S1 also includes that the focal length and lens setting of the camera acquisition device remain unchanged during the pre-acquisition process, and the shooting angle of the face image remains unchanged during the acquisition process.
Citation Information
Patent Citations
Intelligent identification system for access control
CN118155269A
Communication terminal
JP2007312089A