Anti-glare adjusting method, electronic device and storage medium
By acquiring and analyzing images of the current scene captured by the camera, the system determines the impact of glare and adjusts the lens position, thus solving the problem of glare affecting access control equipment in open-air environments. This achieves intelligent anti-glare processing and improves the performance and adaptability of the recognition system.
Patent Information
- Application Number
- CN202111505037.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2041-12-10
AI Technical Summary
In open-air environments, access control equipment suffers from glare caused by unplanned light sources or reflections from specific surfaces, resulting in a decline in the effectiveness of facial data capture and acquisition, and making adaptive adjustments difficult.
By acquiring images of the current scene captured by the camera, the degree of glare impact is determined, and the extension and retraction positions of the camera lens are adjusted according to the glare source's illumination angle range to reduce the glare impact.
It significantly improves the camera's intelligence level, enhances the usability and accuracy of the recognition system, adapts to various glare scenarios, and expands the applicability of anti-glare solutions.
Smart Images

Figure CN116264025B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of video monitoring, and in particular to a glare prevention adjustment method, an electronic device, and a storage medium. BACKGROUND
[0002] With the progress of security technology and the popularization of safety awareness, the popularity of access control comparison devices is increasing, which can reduce manual comparison by manpower, and efficiently and uninterruptedly collect data and compare and process. Access control devices are widely used in various scenarios, such as communities, parks, company interiors, schools, and other areas. Among them, the characteristics of the community, park entrance, school, and other areas are that the space is not closed and the environment is open. In the open environment, unstable environmental factors and human factors are likely to affect the data collection and snapshot effect of the access control device.
[0003] In view of the problems caused by environmental factors, when installing the access control device, the staff will consider and handle the adverse effects, such as the problem of sunlight irradiation, and the problem of mirror surface blur caused by rain, which can be handled by regular human handling. However, the human-caused impact is irregular and unpredictable. Glare caused by unexpected light sources or reflections from specific surfaces will change the visibility of the work surface, which is one of the main factors affecting face data snapshot collection. In the intelligent trend of access control devices, it is necessary to have model training capability to adaptively handle external adverse factors.
[0004] How to solve the glare problem in the related video shooting and recognition scheme has become an important part of improving the intelligent level of the video recognition scheme. SUMMARY
[0005] The present application provides a glare adjustment method, an electronic device, and a storage medium. According to the glare influence degree determination of the current scene image, in the case of determining that glare prevention processing is needed, the camera lens zoom position is adjusted adaptively according to the current scene image to reduce the influence of glare, which significantly improves the intelligent level of the camera and improves the overall availability of the related recognition system.
[0006] In one aspect, the present application provides a glare prevention adjustment method, comprising:
[0007] obtaining a current scene image shot by a camera, and determining a glare influence degree of a current scene according to the current scene image;
[0008] in the case that the glare influence degree is greater than a set first influence threshold, determining an irradiation angle range of a glare source in a camera shooting range relative to the camera according to the current scene image;
[0009] According to the illumination angle range, the lens telescopic position of the camera is adjusted to reduce the degree of glare influence.
[0010] In another aspect, the embodiments of the present disclosure also provide an electronic device, comprising:
[0011] one or more processors;
[0012] a storage device configured to store one or more programs,
[0013] When the one or more programs are executed by the one or more processors, the one or more processors implement the glare adjustment method as described in any of the embodiments of the present disclosure.
[0014] In another aspect, the embodiments of the present disclosure also provide a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the glare adjustment method as described in any of the embodiments of the present disclosure.
[0015] Other aspects can become apparent from the following detailed description when read in conjunction with the drawings and the detailed description. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained from the drawings shown without creative labor.
[0017] Figure 1 is a schematic diagram of camera shooting and illumination range in the embodiments of the present disclosure;
[0018] Figure 2 is a flowchart of the glare adjustment method provided by the embodiments of the present disclosure;
[0019] Figure 3 is a schematic diagram of image division manner in the embodiments of the present disclosure;
[0020] Figure 4 is a schematic diagram of image division and glare area in the embodiments of the present disclosure;
[0021] Figure 5 is a schematic diagram of the overlap degree between the glare area and the feature recognition area in the embodiments of the present disclosure;
[0022] Figure 6 is a schematic diagram of the illumination angle range in the embodiments of the present disclosure;
[0023] Figure 7 is a flowchart of another glare adjustment method provided by the embodiments of the present disclosure.
[0024] The objectives, functional characteristics and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative effort fall within the protection scope of the present application.
[0026] It should be noted that all the directionality indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present application are only used to explain the relative position relationship, movement condition, etc. between components in a certain posture (as shown in the drawings), and if the certain posture changes, the directionality indications also change accordingly.
[0027] In addition, the descriptions such as “first”, “second” and the like in the present application are only for the purpose of description, and cannot be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the features defined with “first”, “second” can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of “plurality” is at least two, for example, two, three, etc., unless otherwise specifically limited.
[0028] In the present application, unless otherwise specifically defined and limited, the terms “connection”, “fixation” and the like should be understood in a broad sense, for example, “fixation” can be fixed connection, or detachable connection, or integral; can be mechanical connection, or electrical connection; can be direct connection, or indirect connection through an intermediate medium; can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise specifically defined. For a person of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0029] In addition, the technical solutions of each embodiment of the present application can be combined with each other, but it must be based on the fact that a person of ordinary skill in the art can realize it, and when the combination of technical solutions appears contradictory or unachievable, it should be considered that the combination of technical solutions does not exist, and is not within the protection scope of the present application.
[0030] In the field of video surveillance and recognition, taking access control systems as an example, after equipment commissioning and delivery, changes in the installation and usage environment may lead to unplanned light sources or reflected light from specific surfaces. The presence of these lights causes glare in systems that have been delivered and are in normal use, resulting in a decrease in the accuracy of target object (face) detection and recognition. The generation of this glare is uncertain and dynamic, making it difficult to predict in advance and adjust the cameras in the access control system in a timely manner to reduce or overcome the glare effect.
[0031] Before describing the relevant embodiments in this disclosure, we will take an access control system as an example to introduce relevant application scenarios, such as... Figure 1 As shown, the camera in the access control system is installed at a height of S3. The standard capture position is defined as being aligned with the camera at a distance of S1, also known as the standard capture distance. This means that for a person of average height, a capture at a distance of S1 will yield the best recognition results. The maximum capture position is being aligned with the camera at a distance of S2, also known as the maximum capture distance. This means that for a person of average height, a capture at a distance of S2 will satisfy the recognition clarity requirements. If the person is at a greater distance, the clarity of the captured facial image will not meet the system's recognition requirements. When a person is captured at the standard capture position, the distance between their imaging plane and the camera is S1. When a person is captured at the furthest position, the distance between their imaging plane and the camera is S2.
[0032] like Figure 1 As shown, at distance S1, the circular area represents the imaging range / area of the face. At distance S2, the central black circular area represents the imaging range / area of the same face, and the outer circular area represents the range / area of light received by the camera, i.e., the overall imaging range / area of the shot. It can be seen that when performing face recognition and face capture, the illumination range affected by glare at S2 is the area between the outer large circle and the central small circle. The illumination angles shown in the vertical cross-section are used to represent this: angle b is the shooting angle for the camera to capture a face of a set size, angle a+b+c is the maximum shooting angle of the camera, and angles a and c are the maximum angles that may be affected by glare when capturing a face from the front.
[0033] This disclosure provides an anti-glare adjustment method. Figure 2 As shown, it includes:
[0034] Step 210: Acquire the current scene image captured by the camera, and determine the degree of glare impact of the current scene based on the current scene image;
[0035] Step 220: If the degree of glare influence is greater than the set first influence threshold, determine the range of glare sources within the camera's shooting range relative to the camera's illumination angle based on the current scene image.
[0036] At step 230, according to the range of the illumination angle, the lens telescopic position of the camera is adjusted to reduce the degree of glare influence.
[0037] In some example embodiments, the degree of glare influence of the current scene is determined according to the current scene image at step 210, including:
[0038] According to the current scene image and the standard scene image, a glare area in the current scene image is determined;
[0039] According to the glare area in the current scene image and the standard target object image, a coincidence degree of the glare area in the current image and a feature recognition area of the target object in the standard target object image is determined, and the coincidence degree is taken as the degree of glare influence of the current scene;
[0040] The standard scene image is a scene image captured by the camera under normal illumination; and the standard target object image is a target object image of a target object at a set shooting distance and a set height captured by the camera under normal illumination of the standard scene.
[0041] It should be noted that the judgment basis of normal illumination is determined according to the performance of the camera and / or system recognition requirements, and specific aspects are not discussed in the embodiments of the present disclosure. Taking an access control system as an example, the target object is a face, the standard scene image is a scene image captured under normal illumination after the camera is installed and debugged, and the standard target object image is also a face image captured under normal illumination after the camera is installed and debugged, by selecting a user with an average height L of the access control system and aiming at the face at a standard distance from the camera.
[0042] In some example embodiments, the glare area in the current scene image is determined according to the current scene image and the standard scene image, including:
[0043] The image average brightness of the standard scene image is determined;
[0044] The current scene image is divided into a plurality of sub-areas according to a set division rule, and the area average brightness of each sub-area is determined respectively;
[0045] The sub-area with the area average brightness greater than L times of the image average brightness in the plurality of sub-areas is determined to constitute the glare area in the current scene image, and L is a positive number greater than 1.
[0046] In some example embodiments, the average gray value of the image is calculated as the image average brightness Pavg according to the gray value of each pixel point according to the standard deviation formula, and the average gray value of the area is calculated as the area average brightness.
[0047] In some exemplary embodiments, taking an access control system as an example, L=5, such as... Figure 3 As shown, the current scene image is divided into n sub-regions (n = 4 * l, l > 1). The average brightness (grayscale) of each sub-region is calculated and denoted as P1, P2, P3, ..., Pn. The average brightness (grayscale) of the sub-regions is compared with the average brightness (grayscale) of the quasi-scene image. If Pi > 5 * Pavg, then region i is determined to have glare. The m sub-regions among the n sub-regions whose average brightness is greater than 5 times the average brightness Pavg of the quasi-scene image constitute the glare region in the current scene image, also known as the glare sub-region set. Figure 4 As shown, the current scene image is divided into 4*4 sub-regions. Regions P5, P6, and P7 have an average grayscale (brightness) greater than 5*Pavg. Therefore, the glare region / glare sub-region set P = {P5, P6, P7} is determined, with the center positions of each sub-region being {(x5, y5), (x6, y6), (x7, y7)}. Alternatively, L = 10, or other multiples, depending on the relevant camera parameters or application scenario.
[0048] In some exemplary embodiments, the sub-regions whose average brightness is much greater than the average brightness of the image are determined to constitute glare regions in the current scene image.
[0049] In some exemplary embodiments, determining the overlap between the glare region in the current scene image and the feature recognition region of the target object in the standard target object image, based on the glare region in the current scene image and the standard target object image, includes:
[0050] The standard target image is divided into multiple sub-regions according to the same set division rules;
[0051] The sub-regions containing the feature recognition parts of the target object are identified in multiple sub-regions of the standard target object image, and these sub-regions constitute the feature recognition region of the target object;
[0052] Determine the overlapping sub-regions of the glare region and the feature recognition region of the target object in the current scene image;
[0053] The degree of overlap is determined based on the overlapping sub-regions and the feature recognition sub-regions of all the target objects.
[0054] In some exemplary embodiments, taking a face as an example, the feature recognition areas of a face include the eyes, nose, and mouth, which are key areas for face recognition / comparison; other areas (such as cheeks, eyebrows, and forehead) are non-feature recognition areas. When applied to other target objects, the feature recognition areas can be set accordingly.
[0055] For example, such as Figure 5As shown, the standard target (face) image is also divided into 4*4 sub-regions in the manner of 4*l. The feature recognition parts of the target (face) include: A, B, C and D, and the sub-regions of the standard target image containing the feature recognition parts are: 5, 6, 7, 10, 14, 15, which constitute the feature recognition region Q of the target, also known as the feature recognition sub-region set of the target, denoted as Q={P5, P6, P7, P10, P14, P15}, and the corresponding center positions of each sub-region are {(x5, y5), (x6, y6), (x7, y7), (x10, y10), (x14, y14), (x15, y15)}. The overlapping sub-regions of P and Q are determined to be {P5, P6, P7}, and the degree of overlap is further determined to be 3 / 6=0.5. That is, step 210 determines that the glare influence degree of the current scene is 0.5.
[0056] It can be understood that the glare influence degree (i.e. the degree of overlap) of the current scene determined here indicates the proportion of the influence of glare on the recognition of the feature parts of the target (face) under the current scene. If the glare influence degree is greater than the first influence threshold, the target (face) image captured under the current scene is greatly affected by glare and cannot be normally compared; if it is less than or equal to the first influence threshold, the target (face) image captured under the current scene is less affected by glare and can be normally compared. Therefore, further, in the case where the glare influence degree is greater than the first influence threshold, camera adjustment is needed to reduce the glare in the camera's photographable range to reduce the glare influence degree of the adjusted photographing scene, so that the target image captured by the adjusted camera can be normally compared. As can be seen, according to the scheme provided by the embodiment of the present disclosure, during the operation of the monitoring / access control system, the camera determines the glare influence degree according to the current scene image captured, and when it is determined that the glare influence degree is high, it is adaptively adjusted, which can reduce the adverse effects of glare on the recognition or comparison effect of the system.
[0057] In some example embodiments, step 220 of determining, according to the current scene image, the range of illumination angles of the glare source in the camera's photographable range relative to the camera comprises:
[0058] According to the glare region in the current scene image, the target region in the standard target image, the installation height of the camera, the photographing distance of the standard target image, and the height of the target in the standard target image, determining the relative position of the glare mapping region of the glare region on the imaging plane relative to the target mapping region of the target region on the imaging plane when the glare region and the target region are mapped onto the same imaging plane;
[0059] According to the relative position, the installation height of the camera, the distance between the imaging plane and the camera, and the height of the target object in the standard target object image, a range of illumination angles of the glare source relative to the camera is determined.
[0060] It should be noted that the installation height of the camera remains unchanged when the current scene image is captured and the standard target object image is captured. For example, as shown in Figure 1 According to the installation height S3 of the camera, the shooting distance S1 of the standard target object (face) image, and the height L of the target object, the glare area in the current scene image and the target object area in the standard target object image can be mapped to the same imaging plane according to the camera imaging principle. The same imaging plane can be the imaging plane at the position S1 or the imaging plane at the farthest shooting distance S2, or the imaging plane at other positions.
[0061] In some example embodiments, taking the access control system as an example, as shown in Figure 6 The glare area in the current scene image and the target object area in the standard target object image are mapped to the same imaging plane at the position S2. The glare area in the current scene image is mapped to the circular area above the "person" in Figure 6 , which is recorded as the glare mapping area, and the target object area in the standard target object image is mapped to the elliptical area shown by the "person" in Figure 6 , which is recorded as the target object mapping area. According to the mapping result on the imaging plane, the relative position of the two mapping areas can be determined.
[0062] Further, the target object mapping area is mapped to the imaging plane according to the target object in the standard target object image and the camera imaging principle. When the standard target object image is captured, the height of the target object and the shooting distance are known. That is, the position of the target object mapping area on the imaging plane has a corresponding relationship with the distance of the actual target object from the camera and the height of the actual target object. Therefore, according to the relative position of the glare mapping area and the target object mapping area on the imaging plane, the relative position relationship of the glare source relative to the actual target object (when the standard target object image is captured) can be inferred. Then, according to the installation height of the camera, the range of illumination angles of the glare source relative to the camera can be determined.
[0063] In some example embodiments, the range of illumination angles of the glare source relative to the camera is described by the angle range on the vertical section, as shown in Figure 6 The range of illumination angles is determined by the edge of the glare mapping area on the imaging plane and the camera position. It should be noted that Figure 6The illumination angle range indicated by the angle a includes both the angle size and the angle direction. According to this example, a person skilled in the art can also describe the illumination angle range of the glare source relative to the camera in other ways, which are not limited to the aspects exemplified in the embodiments of the present disclosure.
[0064] In some exemplary embodiments, in the case of a large glare illumination range, the glare mapping area may cover the target mapping area.
[0065] In some exemplary embodiments, in the case of multiple glare light sources, multiple glare mapping sub-areas are formed, and the glare mapping area is an area including the multiple mapping sub-areas; accordingly, the illumination angle range of the glare source relative to the camera corresponds to the maximum angle range of the glare mapping area including the multiple mapping sub-areas. The multiple glare mapping sub-areas can be discrete, and the glare mapping sub-area and the glare mapping area are not limited to specific area shapes. Figure 6 The area shapes shown are exemplary representations.
[0066] As can be seen, in the case of a large glare influence degree requiring adjustment of the camera, adjusting / controlling the extension / retreat position of the lens in the camera can reduce the amount of light entering the camera, thereby reducing the influence of glare on the captured image to meet the requirements of subsequent image comparison / identification. It can be understood that the illumination angle range of the glare source relative to the camera represents the position of the glare source within the camera shooting range, and adjusting the retreat position of the camera lens can reduce or increase the amount of light entering the camera to achieve the goal of controlling the brightness of the captured image.
[0067] In some exemplary embodiments, step 230 includes: according to the illumination angle range, searching for corresponding relationship data between the illumination angle range and the extension / retreat position of the camera lens to determine a matched lens extension / retreat position.
[0068] According to the matched lens extension / retreat position, adjusting the extension / retreat position of the lens of the camera.
[0069] When the lens of the camera is in the matched extension / retreat position, the glare influence degree of the camera shooting scene is less than or equal to a set first influence degree threshold.
[0070] As can be seen, according to the saved corresponding relationship data, the illumination angle range of the glare source relative to the camera within the camera shooting range determined in step 220 can be used to find a proper lens extension / retreat position, and controlling the camera lens to reach the matched lens extension / retreat position completes the camera adjustment this time.
[0071] In some exemplary embodiments, step 230 further includes:
[0072] According to the illumination angle range, the corresponding relationship data of the illumination angle range and the camera lens zoom position is searched, and if no matching lens zoom position is obtained, the lens zoom position of the camera is adjusted in sequence according to a set retraction step size until the glare influence degree of the photographed scene after adjustment is less than or equal to the set first influence degree threshold, and the adjustment is stopped.
[0073] It can be seen that when the corresponding relationship data of the illumination angle range and the camera lens zoom position stored in the camera or the system cannot match the lens zoom position suitable for the current illumination angle range, the camera lens zoom position needs to be adjusted in sequence according to a set retraction step size within the camera lens zoom range, the scene image is photographed again after each adjustment, and the glare influence degree is determined until the glare influence degree of the photographed scene after adjustment is less than the set first influence degree threshold, and the adjustment is stopped.
[0074] It can be understood that the sequential adjustment means that the lens is retracted in sequence from the current position of the lens according to the retraction step size. The step size of each retraction can be equal or unequal, or the step size of each retraction can be dynamically calculated according to a set algorithm. In some example embodiments, the step size of each retraction can be determined by using a dichotomy method between the current lens zoom position and the shortest zoom position.
[0075] In some example embodiments, step 230 further includes:
[0076] The illumination angle range and the lens zoom position of the camera when the adjustment is stopped are recorded and added to the corresponding relationship data of the illumination angle range and the camera lens zoom position.
[0077] It can be seen that after the camera lens retraction attempt / verification determines that the glare influence is reduced and meets the system comparison / recognition requirements, the adjustment result of this time is recorded and added to the corresponding relationship data of the illumination angle range and the camera lens zoom position. The adjustment result includes the illumination angle range determined in step 220 and the lens zoom position of the camera when the adjustment is stopped in step 230.
[0078] It can be understood that the camera does not accumulate the corresponding relationship data of the irradiation angle range and the camera lens zoom position when it is initially installed and put into use. However, with the adaptive adjustment attempts in the camera daily use, more and more adjustment result data can be generated and accumulated to form the corresponding relationship data of the irradiation angle range and the camera lens zoom position. These historical data can be directly matched and used in the subsequent adjustment scheme execution process, without the need for adjustment attempts in sequence, which can significantly improve the adjustment efficiency. The adaptive adjustment scheme provided in the embodiments of the present disclosure can self-learn without human intervention, be applicable to various glare scenes, expand the application range of the anti-glare scheme, and significantly improve the intelligent degree of the scheme.
[0079] In some example embodiments, as shown in Figure 7 The method further includes:
[0080] In step 240, in the case that the glare influence degree is less than the set second influence degree threshold, the zoom position of the camera lens is restored to the initial position under normal lighting conditions.
[0081] In some example embodiments, the glare influence degree less than the set second influence degree threshold includes: determining a non-glare area according to the current scene image, and then the glare influence degree is 0, which is less than the set second influence degree threshold. At this time, the zoom position of the camera lens is restored to the initial position under normal lighting conditions.
[0082] In some example embodiments, the glare influence degree less than the set second influence degree threshold includes: determining a small coincidence degree according to the current scene image, that is, the glare influence degree is less than the set second influence degree threshold. At this time, the zoom position of the camera lens is restored to the initial position under normal lighting conditions.
[0083] It can be seen that according to step 240, in the case that the glare influence disappears or is small, the camera lens can be restored to the initial position for normal shooting, and the camera can operate according to the related settings under normal lighting conditions.
[0084] The second influence degree threshold is less than the first influence degree threshold.
[0085] In some example embodiments, step 210 includes:
[0086] When the set anti-glare detection condition is met, a current scene image captured by the camera is acquired, and the glare influence degree of the current scene is determined according to the current scene image.
[0087] In some example embodiments, the anti-glare detection condition is met at least in the following case:
[0088] The preset detection time or detection interval arrives.
[0089] The detection data of the light sensor in the camera reaches a set threshold.
[0090] For example, taking an access control system as an example, if it is set to detect once every 1 hour, then a round of steps 210-240 is performed every 1 hour. For example, the glare in a certain access control system is caused by the sunlight reflection of surrounding buildings. At different times, the sunlight reflection of buildings in different positions may cause glare to the camera of the access control system. Therefore, after detection every 1 hour, the corresponding different illumination angle ranges at different times can be determined, and then targeted lens extension position adjustment can be performed. After the sunlight reflection disappears, the lens can be restored to the initial position for shooting under normal lighting conditions according to step 240.
[0091] It can be seen that the anti-glare adjustment scheme provided by the embodiment of the present disclosure can automatically detect the current shooting scene, adaptively select the optimal shooting scheme, and automatically adjust with the change of the lighting environment of the camera, greatly improving the intelligent degree of the camera.
[0092] It should be noted that the anti-glare adjustment method provided by the embodiment of the present disclosure is taken as an example of application in an access control system, but is not limited to only being applicable to the access control system. According to the description of the embodiment of the present disclosure, the system needs to be applied to other similar scenes, such as product detection / comparison in a production system, vehicle access control system in a parking lot, and the like.
[0093] The embodiment of the present disclosure also provides an electronic device, comprising:
[0094] one or more processors;
[0095] a storage device configured to store one or more programs,
[0096] When the one or more programs are executed by the one or more processors, the one or more processors implement the anti-glare adjustment method as described in any embodiment of the present disclosure.
[0097] In some example embodiments, the electronic device is a camera.
[0098] The embodiment of the present disclosure also provides a computer readable storage medium having a computer program stored thereon, the program being implemented by a processor to implement the anti-glare adjustment method as described in any embodiment of the present disclosure.
[0099] Those of ordinary skill in the art will realize and understand that all or some of the steps in the methods disclosed above and the functional modules / units in the systems and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation. Some or all of the components can be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. Furthermore, it is well known to those of ordinary skill in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
[0100] The above description is merely preferred embodiments of the present application, and is not intended to limit the patent scope of the present application. Any equivalent structural variations made under the concept of the present application, or direct / indirect application in other related technical fields, are included in the patent protection scope of the present application.
Claims
1. A method of adjusting an anti-glare, characterized in that, The method comprises: acquiring a current scene image captured by a camera, and determining a glare influence degree of a current scene according to the current scene image; in a case where the glare influence degree is greater than a set first influence degree threshold, determining, according to the current scene image, an irradiation angle range of a glare source within a camera shooting range relative to the camera; adjusting a lens telescopic position of the camera according to the irradiation angle range to reduce the glare influence degree; wherein the determination of the glare influence degree of the current scene according to the current scene image comprises: determining a glare area in the current scene image according to the current scene image and a standard scene image; determining an overlap degree of the glare area in the current image and a feature recognition area of a target object in the standard target object image according to the glare area in the current scene image and the standard target object image, and taking the overlap degree as the glare influence degree of the current scene; wherein the standard scene image is a scene image captured by the camera under normal lighting conditions; and the standard target object image is a target object image of a target object at a set shooting distance and a set height in a standard scene under normal lighting conditions.
2. The method of claim 1, wherein the determination of the glare area in the current scene image according to the current scene image and the standard scene image comprises: determining an image average brightness of the standard scene image; dividing the current scene image into a plurality of sub-areas according to a set division rule, and respectively determining a region average brightness of each sub-area; determining a sub-area in the plurality of sub-areas whose region average brightness is greater than L times of the image average brightness, to constitute the glare area in the current scene image, L being a positive number greater than 1.
3. The method of claim 2, wherein the determination of the overlap degree of the glare area in the current image and the feature recognition area of the target object in the standard target object image according to the glare area in the current scene image and the standard target object image comprises: dividing the standard target object image into a plurality of sub-areas according to the same set division rule; determining a sub-area in the plurality of sub-areas of the standard target object image containing a feature recognition part of the target object, to constitute the feature recognition area of the target object; determining an overlapping sub-area of the glare area in the current scene image and the feature recognition area of the target object; determining the overlap degree according to the overlapping sub-area and all the feature recognition sub-areas of the target object.
4. The method of claim 1, wherein the determination of the irradiation angle range of the glare source within the camera shooting range relative to the camera according to the current scene image comprises: determine, according to the glare area in the current scene image, the target object area in the standard target object image, the installation height of the camera, the shooting distance of the standard target object image, and the height of the target object in the standard target object image, a relative position of a glare mapping area of the glare area on an imaging plane relative to a target object mapping area of the target object area on the imaging plane when the glare area and the target object area are mapped onto the same imaging plane; determine, according to the relative position, the installation height of the camera, the distance between the imaging plane and the camera, and the height of the target object in the standard target object image, a range of illumination angles of the glare source relative to the camera.
5. The method of any one of claims 1-4, wherein the adjusting the lens extension position of the camera according to the range of illumination angles to reduce the degree of glare influence comprises: finding, according to the range of illumination angles, corresponding relationship data of the range of illumination angles and the lens extension position of the camera, to determine a matched lens extension position; adjusting the lens extension position of the camera according to the matched lens extension position; and wherein when the lens of the camera is in the matched lens extension position, the degree of glare influence on the shooting scene of the camera is less than or equal to a set first influence threshold.
6. The method of claim 5, wherein the adjusting the lens extension position of the camera according to the range of illumination angles to reduce the degree of glare influence further comprises: when the matched lens extension position cannot be obtained according to the corresponding relationship data of the range of illumination angles and the lens extension position of the camera, adjusting the lens extension position of the camera according to a set retraction step length in sequence until the degree of glare influence on the shooting scene after the adjustment is less than or equal to the set first influence threshold, and then stopping the continuous adjustment.
7. The method of claim 6, wherein the method further comprises: recording the range of illumination angles and the lens extension position of the camera when the adjustment is stopped, and adding the range of illumination angles and the lens extension position of the camera into the corresponding relationship data of the range of illumination angles and the lens extension position of the camera. comprising: one or more processors; a storage device for storing one or more programs, 8. An electronic device, comprising: when the one or more programs are executed by the one or more processors, the one or more processors implement the glare prevention adjustment method of any one of claims 1-7. The program is executed by the processor to implement the glare prevention adjustment method of any one of claims 1-7. 9. A computer readable storage medium having stored thereon a computer program, characterized in that,
Citation Information
Patent Citations
Sunlight glare suppression method and device based on time, positioning, lens angle, incident light intensity and color temperature
CN113726983A
Mobile unit and car
CN208665065U
Building monitoring device with automatic alarm function
CN211905934U