Method and device for controlling hysteresis of LED infrared lamp switched on and switched off by face recognition camera

文档序号:73669 发布日期:2021-10-01 浏览:18次 中文

阅读说明:本技术 一种人脸识别摄像头开关led红外灯滞环控制方法及装置 (Method and device for controlling hysteresis of LED infrared lamp switched on and switched off by face recognition camera ) 是由 李奕华 汤备 高东梅 于 2020-03-30 设计创作,主要内容包括:本发明涉及一种人脸识别摄像头开关LED红外灯滞环控制方,包括设定LED灯关闭的阈值为off bm,设定LED灯关闭的阈值为on bm;采集K个bm,ECU控制器调用滞环滤波算法计算出K个bm的平均值E bm;比较判断off bm、on bm及E bm之间的大小,循环执行上述步骤,直至程序结束,退出。加入对红外LED灯在对应场景的滞环控制,解决可见光和红外光根据环境光照进行切换的此类两栖摄像头,在环境光照由亮变暗或者由暗变亮时易发生红外LED灯频繁开启关闭造成画面亮度震荡的情况,使红外LED灯随环境变化时,能平稳正确的开关红外LED灯,达到实际项目应用需求。选用的摄像头传感器使用Bayer Pattern,同步实现多功能应用,做到单器件多功能取代多器件多功能,节省整体方案成本。(The invention relates to a hysteresis control method for switching an LED infrared lamp by a face recognition camera, which comprises the steps of setting the threshold value of the LED lamp to be off bm, and setting the threshold value of the LED lamp to be on bm; collecting K bm, and calculating an average value Ebm of the K bm by using a hysteresis filtering algorithm through an ECU (electronic control unit) controller; and comparing and judging the sizes of off bm, on bm and E bm, circularly executing the steps until the program is ended, and exiting. The hysteresis control of the infrared LED lamp in a corresponding scene is added, the problem that the situation that the picture brightness is vibrated due to frequent opening and closing of the infrared LED lamp easily occurs when the ambient illumination is changed from bright to dark or from dark to bright due to the fact that the visible light and the infrared light are switched according to the ambient illumination is solved, the infrared LED lamp can be stably and correctly turned on and off when the ambient illumination is changed, and the application requirement of an actual project is met. The selected camera sensor uses Bayer Pattern, so that multifunctional application is synchronously realized, single-device multifunction is realized to replace multi-device multifunction, and the cost of the whole scheme is saved.)

1. A method for controlling hysteresis of an LED infrared lamp of a face recognition camera switch comprises the following steps:

s10, setting the threshold value of the LED lamp to be off bm and the threshold value of the LED lamp to be on bm;

s20, the ECU controller calls a hysteresis filter algorithm to acquire K matrix brightness values bm in a specific time period before the current time, and calculates an average value E bm of the K bm;

s30, comparing and judging the sizes among off bm, on bm and E bm, and executing the operation of turning on, turning off or keeping the state of the LED lamp;

and S40, returning to S20, and executing S20 and S30 in a circulating mode until the program is finished, and exiting.

2. The method for controlling hysteresis of an LED infrared lamp of a face recognition camera switch as claimed in claim 1, wherein before collecting the K bm, the state of the LED lamp is off.

3. The hysteresis control method of a face recognition camera switch LED infrared lamp according to claim 1, wherein the hysteresis filtering algorithm comprises the steps of:

s21, establishing a buffer area;

s22, storing K bm collected in a specific time period before the current time into a cache region;

and S23, calculating and outputting an average value Ebm of the K bm in the buffer area.

4. The method for controlling hysteresis of an LED infrared lamp of a face recognition camera switch according to claim 3, wherein in S22, one bm is collected every T ms in the specific time period, K bm are collected continuously, and T is any one value from 50 to 100.

5. The method for controlling hysteresis of an LED infrared lamp of a face recognition camera switch as claimed in claim 3, wherein the K bm is collected at the time of starting a program for the first time.

6. The method for controlling hysteresis of an LED infrared lamp of a face recognition camera according to any one of claims 1 to 5, wherein K is any one of values from 5 to 10, off is any one of values from 750 to 850, and on is any one of values from 250 to 350.

7. The method for controlling hysteresis of an LED infrared lamp of a face recognition camera switch as claimed in claim 1, wherein said S30 comprises the following substeps:

s31, if E bm is larger than off bm, the LED lamp is turned off, and the current state of the LED lamp is recorded as off;

s32, if E bm is less than on bm, the LED lamp is turned on, and the current state of the LED lamp is recorded as on;

s33, if the front state of the LED lamp is off and the off bm is more than E bm is more than on bm, the LED lamp is turned off, and the current state of the LED lamp is recorded as off;

and S34, if the front state of the LED lamp is turned on, turning on the LED lamp, and recording the current state of the LED lamp as on.

8. A hysteresis control device for switching an LED infrared lamp by a face recognition camera is characterized by comprising a camera module, an LED lamp and an ECU (electronic control unit) controller, wherein the LED lamp is respectively and electrically connected with the camera module and the ECU controller;

the camera module is used for collecting K matrix brightness values bm in a specific time period before the current time, the ECU controller is used for calling a hysteresis filtering algorithm and calculating an average value Ebm of the K bm, and the ECU controller is also used for executing the operation of starting, closing or keeping the state of the LED lamp.

9. The hysteresis control device for switching on/off an LED infrared lamp of a face recognition camera as claimed in claim 8, wherein the camera module has a dual-pass band lens, and the LED lamp is a 940nm LED lamp.

10. The hysteresis control device for switching on and off an LED infrared lamp of a face recognition camera as claimed in claim 8, further comprising a memory, wherein the memory is electrically connected with the ECU controller, and the memory is used for caching K bm collected in a specific time period before the current time.

Technical Field

The invention relates to the technical field of face recognition, in particular to a method and a device for controlling hysteresis of an LED infrared lamp of a face recognition camera switch.

Background

As is well known, face recognition is a biometric technology for identifying an identity based on facial feature information of a person, and is a series of related technologies for acquiring an image or a video stream containing a face by using a camera or a video camera, automatically detecting and tracking the face in the image, and further performing face recognition on the detected face. At present, face recognition technology is ubiquitous, such as in the automobile industry.

However, the conventional face recognition technology is mainly based on face recognition of visible light images, but in this way, when ambient light changes, the recognition effect is drastically reduced, and the needs of an actual system cannot be met, for example, the usability of face recognition and the accuracy, stability and speed of face recognition are reduced in a low-light environment.

Disclosure of Invention

In order to solve the above problems, it is necessary to design a hysteresis control method and device for switching an LED infrared lamp of a face recognition camera.

A method for controlling hysteresis of an LED infrared lamp of a face recognition camera switch comprises the following steps:

s10, setting the threshold value of the LED lamp to be off bm and the threshold value of the LED lamp to be on bm;

s20, the ECU controller calls a hysteresis filter algorithm to acquire K matrix brightness values bm in a specific time period before the current time, and calculates an average value E bm of the K bm;

s30, comparing and judging the sizes among off bm, on bm and E bm, and executing the operation of turning on, turning off or keeping the state of the LED lamp;

and S40, returning to S20, and executing S20 and S30 in a circulating mode until the program is finished, and exiting.

In one embodiment, the status of the LED lamp is off before the K bm is collected.

In one embodiment, the hysteresis filter algorithm includes the steps of:

s21, establishing a buffer area;

s22, storing K bm collected in a specific time period before the current time into a cache region;

and S23, calculating and outputting an average value Ebm of the K bm in the buffer area.

In one embodiment, in S22, a bm is collected every T ms in the specific time period, and K bm are collected continuously, where T is any one of values from 50 to 100.

In one embodiment, the K bm are collected at the first time the program is initiated.

In one embodiment, K is 5-10, off is 750-850, and on is 250-350.

In one embodiment, the S30 includes the following sub-steps:

s31, if E bm is larger than off bm, the LED lamp is turned off, and the current state of the LED lamp is recorded as off;

s32, if E bm is less than on bm, the LED lamp is turned on, and the current state of the LED lamp is recorded as on;

s33, if the front state of the LED lamp is off and the off bm is more than E bm is more than on bm, the LED lamp is turned off, and the current state of the LED lamp is recorded as off;

and S34, if the front state of the LED lamp is turned on, turning on the LED lamp, and recording the current state of the LED lamp as on.

A hysteresis control device for switching an LED infrared lamp by a face recognition camera comprises a camera module, an LED lamp and an ECU (electronic control unit) controller, wherein the LED lamp is respectively and electrically connected with the camera module and the ECU controller;

the camera module is used for collecting K matrix brightness values bm in a specific time period before the current time, the ECU controller is used for calling a hysteresis filtering algorithm and calculating an average value Ebm of the K bm, and the ECU controller is also used for executing the operation of starting, closing or keeping the state of the LED lamp.

In one embodiment, the camera module has a dual-pass band lens, and the LED lamp is a 940nm LED lamp.

In one embodiment, the hysteresis control device for switching on and off the LED infrared lamp of the face recognition camera further comprises a memory, wherein the memory is electrically connected to the ECU controller, and the memory is used for caching K bm collected in a specific time period before the current time. .

Compared with the prior art, the invention has the following beneficial technical effects:

firstly, hysteresis control of the infrared LED lamp in a corresponding scene is added, the problem that the picture brightness oscillation is caused by frequent opening and closing of the infrared LED lamp when the ambient illumination is changed from bright to dark or dark to bright due to the fact that the visible light and the infrared light are switched according to the ambient illumination is solved, the infrared LED lamp can be stably and correctly turned on and off when the infrared LED lamp is changed along with the ambient, and the application requirement of an actual project is met.

Secondly, under the condition that the infrared LED lamp oscillates in an actual application scene, due to the fact that the Bayer Pattern is used by the selected camera sensor, multiple functions such as face recognition, photographing and partial fatigue driving are achieved synchronously, the situation that multiple devices are replaced by single-device multiple functions is achieved, and the overall scheme cost is saved.

Drawings

Fig. 1 is a flowchart of steps of a hysteresis control method for switching an LED infrared lamp of a face recognition camera according to an embodiment of the present invention.

Fig. 2 is a block diagram of a hysteresis control method for switching an LED infrared lamp of a face recognition camera according to an embodiment of the present invention.

Fig. 3 is a block diagram of a hysteresis control device for switching an LED infrared lamp of a face recognition camera according to an embodiment of the present invention.

The drawings are for illustrative purposes only and are not to be construed as limiting the patent; for the purpose of better illustrating the embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted; the same or similar reference numerals correspond to the same or similar parts; the terms describing positional relationships in the drawings are for illustrative purposes only and are not to be construed as limiting the patent.

Detailed Description

The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the invention easier to understand for those skilled in the art and will therefore make the scope of the invention more clearly defined.

Please refer to fig. 1, which is a flowchart illustrating a method for controlling hysteresis of an LED infrared lamp of a face recognition camera according to an embodiment of the present invention. A method for controlling hysteresis of an LED infrared lamp of a face recognition camera switch comprises the following steps:

s10, setting the threshold value of the LED lamp to be off bm and the threshold value of the LED lamp to be on bm;

s20, the ECU controller calls a hysteresis filter algorithm to acquire K matrix brightness values bm in a specific time period before the current time, and calculates an average value E bm of the K bm;

s30, comparing and judging the sizes among off bm, on bm and E bm, and executing the operation of turning on, turning off or keeping the state of the LED lamp;

and S40, returning to S20, and executing S20 and S30 in a circulating mode until the program is finished, and exiting.

In one embodiment, the S30 includes the following sub-steps:

s31, if E bm is larger than off bm, the LED lamp is turned off, and the current state of the LED lamp is recorded as off;

s32, if E bm is less than on bm, the LED lamp is turned on, and the current state of the LED lamp is recorded as on;

s33, if the front state of the LED lamp is off and the off bm is more than E bm is more than on bm, the LED lamp is turned off, and the current state of the LED lamp is recorded as off;

and S34, if the front state of the LED lamp is turned on, turning on the LED lamp, and recording the current state of the LED lamp as on.

Please refer to fig. 2, when the camera collects K bm in a specific time period before the current time, the ECU controller calls a hysteresis filtering algorithm to calculate an average E bm of the K bm, and when the E bm is greater than an off bm, the current state of the LED lamp is recorded as off; e bm is less than on bm, and the current state of the LED lamp is recorded as being turned on; if the front state of the LED lamp is off, the LED lamp is turned off, and the current state of the LED lamp is recorded as off; and if the front state of the LED lamp is turned on, and the current state of the LED lamp is recorded to be turned on, and the operation is continuously and circularly performed, namely hysteresis control of the infrared LED lamp in a corresponding scene is realized, and configuration interface of hysteresis threshold values and dynamic real-time detection of measured values are realized. Through adding hysteresis control to the infrared LED lamp at the corresponding scene, the amphibious camera that visible light and infrared light switched according to ambient lighting has been solved, has reduced and has easily taken place the infrared LED lamp and frequently opened and close when ambient lighting is by bright dim or by dark bright and cause the emergence of picture luminance vibration condition, when making infrared LED lamp change along with the environment, can steadily correct switch infrared LED lamp, reaches actual project application demand.

In one embodiment, before the K bm is collected, the status of the LED lamp is off.

In one embodiment, the hysteresis filtering algorithm includes the following steps:

s21, establishing a buffer area;

s22, storing K bm collected in a specific time period before the current time into a cache region;

and S23, calculating and outputting an average value Ebm of the K bm in the buffer area. Specifically, the hysteresis filter algorithm includes the specific steps of: establishing a cache region; continuously collecting K bm in a specific time period before the current time and storing the bm in a cache region; calculating an average value Ebm of K bm; after the Kth bm is obtained, the Kth +1 bm is also obtained, and the cache region is updated; assigning a second bm to the location of the first bm, assigning a third bm to the location of the second bm, …, assigning the kth bm to the location of the kth-1 bm, and then assigning the obtained kth +1 bm to the location of the kth bm. (ii) a And circulating the above operations until exiting after the program is finished.

Under the condition that the infrared LED lamp oscillates in an actual application scene, because the selected camera sensor uses Bayer Pattern (Bayer array), multiple functions are synchronously realized, such as face recognition, photographing, partial fatigue driving and the like, the situation that single-device multiple functions replace multiple-device multiple functions is achieved, and the cost of the whole scheme is saved. It should be noted that the bayer array refers to a common method used when a ccd (charge coupled device) or CMOS device is used as a light sensor to acquire a digital image.

In one embodiment, the K bm are collected at the first time the program is started. For another example, in S22, one bm is collected every T ms in the specific time period, and K bms are continuously collected, where T is any value from 50 to 100, and if T is 50, one bm is collected every 50ms in the specific time period, and K bms are continuously collected, that is, the specific time period is 50 Kms. For another example, K is any value from 5 to 10, off is any value from 750 to 850, and on is any value from 250 to 350, and for another example, K is 5, off is 750, and on is 250, that is, 5 bm are collected in a specific time period before the current time, the threshold value for turning off the LED lamp is 750bm, and the threshold value for turning on the LED lamp is 250 bm.

Please refer to fig. 3, which is a block diagram of a hysteresis control module for switching an LED infrared lamp of a face recognition camera according to an embodiment of the present invention. A hysteresis control device 10 for switching on and off an LED infrared lamp by a face recognition camera comprises a camera module 100, an LED lamp 200 and an ECU controller 300, wherein the LED lamp is respectively and electrically connected with the camera module and the ECU controller; the camera module is used for collecting K matrix brightness values bm in a specific time period before the current time, the ECU controller is used for calling a hysteresis filtering algorithm and calculating an average value Ebm of the K bm, and the ECU controller is also used for executing the operation of starting, closing or keeping the state of the LED lamp.

In one embodiment, the camera module has a bi-pass band lens, and the LED lamp is a 940nm LED lamp. For another example, the hysteresis control device for switching on and off the LED infrared lamp by the face recognition camera further includes a memory, the memory is electrically connected to the ECU controller, and the memory is configured to cache K bm collected in a specific time period before the current time, and update the bm in time according to the bm number collected by the ECU controller.

Compared with the prior art, the invention has the following beneficial technical effects:

firstly, hysteresis control of the infrared LED lamp in a corresponding scene is added, the problem that the picture brightness oscillation is caused by frequent opening and closing of the infrared LED lamp when the ambient illumination is changed from bright to dark or dark to bright due to the fact that the visible light and the infrared light are switched according to the ambient illumination is solved, the infrared LED lamp can be stably and correctly turned on and off when the infrared LED lamp is changed along with the ambient, and the application requirement of an actual project is met.

Secondly, under the condition that the infrared LED lamp oscillates in an actual application scene, due to the fact that the Bayer Pattern is used by the selected camera sensor, multiple functions such as face recognition, photographing and partial fatigue driving are achieved synchronously, the situation that multiple devices are replaced by single-device multiple functions is achieved, and the overall scheme cost is saved.

It should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种具有起夜功能的吸顶灯及其起夜监测方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!