一种基于NB-IOT的教室光环境控制系统A classroom light environment control system based on NB-IOT
技术领域Technical field
本发明涉及互联网通信技术领域,具体是一种基于NB-IOT的教室光环境控制系统。The invention relates to the field of Internet communication technology, in particular to a classroom light environment control system based on NB-IOT.
背景技术Background technique
教室照明环境对学生的视觉健康和学习效率至关重要,不舒适的照明会导致人眼频繁过度调节、造成肌肉紧张、视觉疲劳,同时还会造成学习效率的下降,影响学生的精神状态。The classroom lighting environment is crucial to students' visual health and learning efficiency. Uncomfortable lighting will cause frequent over-regulation of the human eye, causing muscle tension and visual fatigue. At the same time, it will also cause a decline in learning efficiency and affect the student's mental state.
目前的教室几乎都是采用手动控制的荧光灯具照明,只能手动控制灯具为亮暗两种状态。无法在外界环境光改变时相应调整室内灯具亮度,减少不必要的电能损失;在教室各个区域的照明不均匀时,也无法自动改变各个区域的灯具亮度,以提供均匀的室内照明;在上课播放投影仪时,传统的情况是会关闭教室前半区域的灯,如此会造成学生观看投影仪时背景亮度和投影仪的亮度差别过大,加重视觉疲劳。因此一个着眼于学生视觉健康的智能化灯控系统是现在所急需的。而现有技术中,一般只是简单地利用光敏电阻测量光照度,继而对灯具亮度进行负反馈调节,或者通过上位机端手动控制的方式人为来调节灯具亮度。At present, almost all classrooms are controlled by manually controlled fluorescent lamps, which can only be controlled manually in light and dark states. Unable to adjust the brightness of indoor lamps accordingly to reduce unnecessary power loss when the external ambient light changes; when the lighting in various areas of the classroom is uneven, the brightness of lamps in each area cannot be automatically changed to provide uniform indoor lighting; play during the class In the case of a projector, the traditional situation is to turn off the lights in the first half of the classroom. This will cause the students to watch the projector with a large difference in background brightness and the brightness of the projector, which will increase visual fatigue. Therefore, an intelligent light control system focusing on students' visual health is urgently needed now. In the prior art, the photoresistor is generally simply used to measure the illuminance, and then the brightness of the lamp is adjusted by negative feedback, or the brightness of the lamp is artificially adjusted by manual control on the upper computer side.
现今多数的物联网智能灯控系统都是基于GPRS或者wifi、蓝牙、zigbee等局域网方式,GPRS虽然是基于蜂窝网,可以直接联入互联网,但是其成本高,流量资费贵,功耗大;局域网方式虽然成本相对便宜,但是其需要至少两跳的方式才能联入网,即还需要借助一个额外的汇聚网关来入网,在开发、安装维护以及硬件成本上劣势较大。Most of today's IoT intelligent light control systems are based on GPRS or wifi, Bluetooth, zigbee and other local area network methods. Although GPRS is based on a cellular network and can be directly connected to the Internet, its cost is high, the flow rate is expensive, and the power consumption is large; LAN Although the cost is relatively cheap, it requires at least two hops to connect to the network, that is, it needs an additional aggregation gateway to access the network, which is disadvantageous in development, installation and maintenance, and hardware costs.
发明内容Summary of the invention
发明目的:本发明的目的是为了解决现有技术的不足,提供一种基于NB-IOT的教室光环境控制系统,该系统具有更广覆盖海量连接的能力,更低功耗以及更低的模块成本,能够实时采集教室精确的光环境信息,通过对多个参数的判断检测,融合计算出最适合的LED亮度值,并将每个LED亮度值通过NB-IOT通信发送给云平台,继而发送给上位机监控端,上位机存储显示亮度信息,并将LED亮度控制信号发送给LED控制端以改变每个LED灯具的亮度。Object of the invention: The purpose of the invention is to solve the shortcomings of the prior art, and to provide a classroom light environment control system based on NB-IOT, which has the ability to cover a large number of connections, lower power consumption and lower modules Cost, the ability to collect accurate light environment information in the classroom in real time, calculate the most suitable LED brightness value through judgment and detection of multiple parameters, and send each LED brightness value to the cloud platform through NB-IOT communication, and then send To the monitoring end of the upper computer, the upper computer stores the display brightness information and sends the LED brightness control signal to the LED control end to change the brightness of each LED lamp.
技术方案:为了实现以上目的,本发明所述的一种基于NB-IOT的教室光环境控制系统,其特征在于:包括由光环境采集端和LED控制端组成的设备端,云平台以及上位机监控端;Technical solution: In order to achieve the above objectives, a NB-IOT-based classroom light environment control system according to the present invention is characterized by comprising: a device end composed of a light environment acquisition end and an LED control end, a cloud platform and a host computer Monitoring end
所述光环境采集端由控制芯片、NB-IOT模块、摄像头模块组成,光环境采集端采用多曝光融合方式获取教室精确的光环境信息,通过图像处理计算出室内各LED的最佳亮度值并发送给上位机监控端;The light environment collecting end is composed of a control chip, an NB-IOT module, and a camera module. The light environment collecting end uses multi-exposure fusion to obtain accurate light environment information in the classroom, and calculates the optimal brightness value of each indoor LED through image processing. Send to the monitoring terminal of the host computer;
所述LED控制端由控制芯片、NB-IOT模块、LED灯具和LED恒流驱动模块组成,用于接收控制信号继从而对LED灯具亮度进行控制;The LED control terminal is composed of a control chip, an NB-IOT module, an LED lamp and an LED constant current drive module, and is used to receive a control signal and then control the brightness of the LED lamp;
所述云平台作为上位机监控端与LED控制端、光环境采集端之间的通信中继,云平台与设备端之间通过基站连接通信;The cloud platform serves as a communication relay between the monitoring end of the host computer, the LED control end, and the light environment collection end, and the cloud platform and the device end are connected and communicated through the base station;
所述上位机监控端包含存储数据的服务器和电脑界面端两部分,服务器与云平台实时交互信息,电脑界面端实时访问服务器获取数据和下发数据,当电脑界面端下线时,服务器保持在线与下位端进行数据交互。The monitoring terminal of the host computer includes a server for storing data and a computer interface terminal. The server and the cloud platform exchange information in real time. The computer interface terminal accesses the server in real time to obtain data and distribute data. When the computer interface terminal goes offline, the server remains online Data exchange with the lower end.
作为本发明的进一步优选,所述设备端由一个光环境采集端和多个LED控制端组成,光环境采集端安装在教室正后方,用于拍摄记录教室的整体信息,每个LED控制端安装在教室天花板,独立控制一盏LED灯具的亮度,并且通过NB-IOT模块实现与上位机监控端的通信。As a further preferred aspect of the present invention, the device end is composed of a light environment collecting end and a plurality of LED control ends. The light environment collecting end is installed directly behind the classroom for shooting and recording the overall information of the classroom. Each LED control end is installed In the classroom ceiling, the brightness of an LED lamp is independently controlled, and the communication with the monitoring end of the host computer is realized through the NB-IOT module.
作为本发明的进一步优选,所述光环境采集端通过拍摄记录整个室内的场景图像得到广视角图像,然后经过STM32内部的图像去畸变算法转化供后续处理的无畸变平面图像。As a further preference of the present invention, the light environment collecting end obtains a wide-angle image by shooting and recording scene images of the entire room, and then transforms the distortion-free planar image for subsequent processing through an image de-distortion algorithm within STM32.
作为本发明的进一步优选,所述光环境采集端通过摄像头多曝光的方式记录室内高动态范围的亮度信息,拍摄多幅不同曝光度的图像继而通过融合算法和相机亮度响应曲线恢复出一幅反映真实场景亮度的高动态图像,多幅不同曝光度图像的获取采用改变曝光时间的方法获取。As a further preference of the present invention, the light environment collecting end records the indoor high dynamic range brightness information through multiple exposures of the camera, captures multiple images with different exposures and then restores a reflection through the fusion algorithm and the camera brightness response curve For highly dynamic images of real scene brightness, multiple images with different exposures are obtained by changing the exposure time.
作为本发明的进一步优选,根据得到的高动态图像确定桌面的亮度,再根据桌面的反射特性确定桌面的实时照度,当桌面照度高于限定值时不断调低对应灯具LED亮度,直到下次采集到的照度值在适合区间内或至LED亮度为0则停止调节,当桌面照度低于标准值则调高对应灯具LED亮度。As a further preference of the present invention, the brightness of the desktop is determined according to the obtained high dynamic image, and then the real-time illumination of the desktop is determined according to the reflection characteristics of the desktop. When the illumination of the desktop is higher than the limited value, the LED brightness of the corresponding lamp is continuously lowered until the next acquisition When the obtained illuminance value is within the suitable range or until the LED brightness is 0, the adjustment is stopped, and when the desktop illuminance is lower than the standard value, the LED brightness of the corresponding lamp is increased.
作为本发明的进一步优选,通过采集到的平面图像,根据黑板的色度特征确定黑板在图像中位于的像素区域,根据黑板是否含有突出高亮区域判断教室有无进入上课模式,若是上课模式则调低教室前部区域LED的亮度值。As a further preferred aspect of the present invention, the acquired plane image is used to determine the pixel area where the blackboard is located in the image according to the chromaticity characteristics of the blackboard, and whether the classroom enters the classroom mode is judged based on whether the blackboard contains prominent highlight areas. Decrease the brightness of the LED in the front area of the classroom.
作为本发明的进一步优选,所述的光环境采集端通过多曝光拍摄记录的场景亮度信息来计算室内每个LED所需的亮度,通过NB-IOT模块发送给云平台,云平台再将信号转发给上位机监控端。As a further preference of the present invention, the light environment collecting end calculates the brightness required by each LED in the room through the scene brightness information recorded by multi-exposure shooting, and sends it to the cloud platform through the NB-IOT module, and the cloud platform forwards the signal To the monitoring end of the host computer.
作为本发明的进一步优选,所述的上位机监控端用于接收光环境采集端发送的采集信号,将每个教室的每个LED灯亮度信息实时显示在显示器上并备份存储,同时将每个LED亮度控制信号下发给对应的LED控制端。As a further preferred aspect of the present invention, the upper computer monitoring terminal is used to receive the collected signal sent by the light environment collecting terminal, display the brightness information of each LED lamp of each classroom on the display in real time and back up the storage, and simultaneously store each The LED brightness control signal is sent to the corresponding LED control terminal.
作为本发明的进一步优选,所述的上位机设置系统为手动模式或者自动模式。As a further preferred aspect of the present invention, the host computer setting system is in a manual mode or an automatic mode.
作为本发明的进一步优选,LED控制端根据接收到的LED亮度值,通过PWM波的方式控制LED恒流驱动器,继而控制LED的亮度,为适应人眼的特性,在调整LED亮度时采用软调整的方式,即当要提高LED亮度时通过在一段时间内缓慢提高PWM波占空比的方式达到目标亮度值;当要降低LED亮度时通过在一段时间内缓慢减小PWM波占空比的方式达到目标亮度值。As a further preferred aspect of the present invention, the LED control terminal controls the LED constant current driver through the PWM wave according to the received LED brightness value, and then controls the LED brightness. In order to adapt to the characteristics of the human eye, soft adjustment is adopted when adjusting the LED brightness Way, that is, when the LED brightness is to be increased, the target brightness value is achieved by slowly increasing the PWM wave duty cycle for a period of time; when the LED brightness is to be reduced, by slowly reducing the PWM wave duty cycle for a period of time Reach the target brightness value.
有益效果:本发明提供的一种基于NB-IOT的教室光环境控制系统,与现有技术相比,具有以下优点:Beneficial effect: The NB-IOT-based classroom light environment control system provided by the present invention has the following advantages compared with the prior art:
1、相较于传统室内灯控系统,设备端结构更加简便,安装方便占用空间小,不需汇聚网关即可直接入网;1. Compared with the traditional indoor lighting control system, the structure of the device terminal is more convenient, the installation is convenient and the space is small, and the network can be directly accessed without the need for a convergence gateway;
2、通过采用的NB-IOT通信方式具有广覆盖、强连接、低功耗、低成本的优势;2. The adopted NB-IOT communication method has the advantages of wide coverage, strong connection, low power consumption and low cost;
3、该系统可以真正达到智能化,对室内整体光环境信息都进行记录,然后进行多参数融合分析计算,继而调节响应LED亮度,以使教室达到最适宜的光环境状态,同时在一定程度上节约了能源。3. The system can be truly intelligent, record the overall indoor light environment information, and then perform multi-parameter fusion analysis and calculation, and then adjust the response LED brightness to make the classroom achieve the most suitable light environment state, and to a certain extent. Save energy.
附图说明BRIEF DESCRIPTION
图1为本发明结构示意图;Figure 1 is a schematic diagram of the structure of the present invention;
图2为教室的空间结构和下位端设备的整体布局图;Figure 2 is the overall structure of the classroom space structure and lower-end equipment;
图3为摄像头亮度曲线,即曝光量与像素灰度值的对应关系曲线;Figure 3 is the camera brightness curve, that is, the corresponding relationship between the exposure and the pixel gray value;
图4为教室光环境调节流程图;Figure 4 is the flow chart of classroom light environment adjustment;
图5为黑板、黑板灯和投影仪的位置示意图;Figure 5 is a schematic diagram of the location of the blackboard, blackboard lamp and projector;
图6为上位机监控端的结构图;Figure 6 is a structural diagram of the monitoring terminal of the host computer;
图7为LED控制端的具体结构图以及供电方式图。FIG. 7 is a specific structural diagram and power supply diagram of the LED control terminal.
具体实施方式detailed description
下面结合附图,进一步阐明本发明。The present invention will be further clarified below with reference to the drawings.
本发明所述的一种基于NB-IOT的教室光环境控制系统,如图1所示,其中设备端包含有教室光环境采集端和LED控制端两种类型的设备,一个光环境采集端由高性能STM32芯片、NB-IOT模块和摄像头模块组成,而LED控制端则由相对低端的STM32芯片、NB-IOT模块和LED恒流驱动控制器组成。设备端通过 NB-IOT模块与运营商基站进行通信,基站再联通云平台,云平台便可以实时与设备端进行通信,设备端也就实现了联入互联网的功能。云平台作为中继端,接收设备端的数据信息后能够转换数据格式再发送给上位机监控端,也能接收上位机监控端的控制信号,转换格式后再通过基站发送给设备端,若设备端暂时不在线,云平台则可以暂时缓存数据,待设备开启NB-IOT通信后再将数据发给设备端。上位机监控端则是整个系统的最上层部分,具体包括电脑界面端和服务器两部分,服务器实时与云平台交互信息,电脑界面端登陆后可以访问服务器获取数据和下发数据,当电脑界面端下线后,服务器依然可以保持在线,与下位端进行数据交互并处理数据。A classroom light environment control system based on NB-IOT according to the present invention, as shown in FIG. 1, wherein the device end includes two types of devices: a classroom light environment collecting end and an LED control end, one light environment collecting end is composed of: The high-performance STM32 chip, NB-IOT module and camera module are composed, while the LED control terminal is composed of a relatively low-end STM32 chip, NB-IOT module and LED constant current drive controller. The device side communicates with the operator's base station through the NB-IOT module, and the base station connects to the cloud platform. The cloud platform can communicate with the device side in real time, and the device side realizes the function of connecting to the Internet. The cloud platform acts as a relay. After receiving the data information from the device, it can convert the data format and send it to the monitoring terminal of the upper computer. It can also receive the control signal from the monitoring terminal of the upper computer. After converting the format, it can be sent to the device through the base station. When not online, the cloud platform can temporarily cache the data, and then send the data to the device after the device starts NB-IOT communication. The monitoring terminal of the upper computer is the uppermost part of the entire system, including the computer interface and the server. The server interacts with the cloud platform in real time. After logging in, the computer interface can access the server to obtain data and send data. When the computer interface is After going offline, the server can still stay online, interact with the lower-end data and process the data.
如图2所示,为本发明所述系统在教室中的整体布置情况,教室中的桌面、黑板以及灯具的布局都已在图中画出,该布局符合现有多数中小学教室的情况。设备端安装在教室中的特定位置,通过NB-IOT通信实现与上位机的交互。设备端包含有一个教室光环境采集端和多个LED控制端,其中光环境采集端安装在教室后方天花板的位置,图二所示为一种典型的安装位置,在该位置的摄像头可以采集到桌面以及黑板的图像信息,而且在采集桌面图像时不容易被学生的身体遮挡。LED控制端则用来控制LED的灯具亮度,一盏灯具配备一个LED控制端设备,室内每盏灯具都能够实现单独的亮度控制。As shown in FIG. 2, for the overall arrangement of the system in the classroom of the present invention, the layout of the desks, blackboards, and lamps in the classroom has been drawn in the figure, and this layout is in line with the situation of most existing primary and secondary classrooms. The device is installed at a specific location in the classroom, and interacts with the host computer through NB-IOT communication. The device end includes a classroom light environment collection end and multiple LED control terminals, where the light environment collection end is installed at the ceiling position at the rear of the classroom. Figure 2 shows a typical installation position where the camera can collect The image information of the desktop and blackboard, and it is not easy to be blocked by the student's body when collecting desktop images. The LED control terminal is used to control the brightness of the LED lamps. A lamp is equipped with an LED control terminal device, and each lamp in the room can achieve individual brightness control.
由于教室通常空间比较大,用普通视角的镜头往往无法一次性记录整个空间的信息,故本发明中的光环境采集端通过安装有鱼眼镜头或超广角镜头的嵌入式摄像头获取教室的图像信息。鱼眼镜头是一种极端的广角镜头,其视角能够接近180度,一次拍摄就可以记录下教室的整体信息,但是其拍摄的图像存在严重的畸变,首先需要进行图像去畸变处理。Since classrooms usually have a relatively large space, it is often impossible to record the information of the entire space at once with a lens of ordinary viewing angle. Therefore, the light environment collecting end of the present invention obtains classroom image information through an embedded camera equipped with a fisheye lens or an ultra-wide-angle lens. The fisheye lens is an extreme wide-angle lens. The angle of view can be close to 180 degrees. The overall information of the classroom can be recorded in one shot. However, the captured image has serious distortion. First, the image needs to be distorted.
本发明所述教室光环境采集端的核心是通过多曝光拍摄的方式合成高动态范围的实际空间亮度图像。根据几何光学原理,摄像头传感器接收到的照度与实际场景亮度存在下列的对应关系:The core of the classroom light environment acquisition end of the present invention is to synthesize the actual spatial brightness image with high dynamic range through multi-exposure shooting. According to the principle of geometric optics, the illuminance received by the camera sensor has the following correspondence with the actual scene brightness:
式(1)中E为摄像头光传感器平面(CCD或CMOS)的照度,L为实际场景的亮度,τ为镜头透射率,F
m为摄像头相对数值孔径的倒数。同时,光传感器平面照度E又与曝光量存在以下关系:
In formula (1), E is the illuminance of the camera light sensor plane (CCD or CMOS), L is the brightness of the actual scene, τ is the lens transmittance, and F m is the reciprocal of the camera relative numerical aperture. At the same time, the light sensor plane illuminance E has the following relationship with the exposure:
H=E×T (2)H=E×T (2)
其中,T为曝光时间,H为曝光量。Where T is the exposure time and H is the exposure amount.
如图3所示为相机曝光量与灰度值的对应关系,称为相机亮度响应曲线,它是相机出厂后就固定下来的,可以通过实验标定的方法恢复出这条相机亮度曲线。根据该亮度曲线和拍摄时用的曝光时间,结合公式(1)(2)可以确定图像灰度值与实际场景亮度的映射关系。As shown in Figure 3, the corresponding relationship between camera exposure and gray value is called the camera brightness response curve. It is fixed after the camera leaves the factory. This camera brightness curve can be restored by experimental calibration. According to the brightness curve and the exposure time used for shooting, combining the formulas (1) and (2), the mapping relationship between the image gray value and the actual scene brightness can be determined.
但是,摄像头一次曝光拍摄获得的图像亮度动态范围往往是有限的,会出现局部高亮区域过曝光或者局部暗区域曝光不够的问题,本发明采用多曝光融合记录高动态亮度信息。采用高曝光拍摄记录场景中低亮度段的信息,低曝光拍摄记录实际场景中的高亮度段信息。一次多曝光过程所需的最少拍摄次数由式(3)确定:However, the dynamic range of the image brightness obtained by the camera with one exposure shot is often limited, and the problem of overexposure of the local highlight area or insufficient exposure of the local dark area may occur. The present invention uses multi-exposure fusion to record high dynamic brightness information. Use high-exposure shooting to record information in low-brightness segments of a scene, and low-exposure shooting to record information in high-brightness segments in actual scenes. The minimum number of shots required for a multi-exposure process is determined by equation (3):
n=N
场景/N
相机 (3)
n=N scene /N camera (3)
其中n为一次多曝光所需的拍摄次数,即高动态融合所需的图片张数,N
场景为教室场景的亮度动态范围,N
相机为相机摄像头的动态范围。在获得这样n幅多曝光图像后,采用权重融合的方法融合这n张图像为一幅高动态亮度范围图像。其实现过程如下列公式所示:
Where n is the number of shots required for one multi-exposure, that is, the number of pictures required for high dynamic fusion, scene N is the brightness dynamic range of the classroom scene, and camera N is the dynamic range of the camera. After obtaining such n multi-exposure images, weight fusion method is used to fuse the n images into a high dynamic brightness range image. The implementation process is shown in the following formula:
L
i=f(B
i),i为1到n的整数 (4)
L i = f(B i ), i is an integer from 1 to n (4)
其中L
i为通过单幅图像恢复的亮度值,B
i为像素点灰度值,f()是由(1)(2)式确定的亮度-灰度对应关系,L是对n幅图像融合加权后得到的最终亮度值。可以看到,像素灰度值越接近128的像素,在亮度还原过程中所占的权重越大,这一规定是由图2曲线形状决定的,越靠近128灰度值的像素点,其斜率越大,表明在该区域由像素灰度值映射为曝光量H,再映射为亮度L的过程中精度更高,故分配给靠近128像素值的像素更大权重。
Where L i is the brightness value recovered from a single image, B i is the pixel gray value, f() is the brightness-grayscale correspondence determined by equations (1) and (2), and L is the fusion of n images The final brightness value obtained after weighting. It can be seen that the closer the pixel gray value is to 128 pixels, the greater the weight in the brightness restoration process. This rule is determined by the shape of the curve in FIG. 2. The closer to the pixel point of 128 gray values, the slope The larger the value, the higher the accuracy in the process of mapping the gray value of the pixel to the exposure amount H and then to the brightness L in this area, so the pixels closer to the 128 pixel value are assigned more weight.
还原出一幅高动态亮度范围的图像后,可以准确得到教室任一位置的实际亮度信息。根据教室桌面的色度特征,确定拍摄图像中的桌面区域,可通过查阅资料或者实际测量确定桌面的色度特征,继而通过桌面区域的亮度可以得出桌面大致的照度情况。其具体计算流程如下,该计算中将桌面近似等效为完全漫反射体:After restoring an image with a high dynamic brightness range, the actual brightness information at any location in the classroom can be accurately obtained. According to the chromaticity characteristics of the classroom desktop, the desktop area in the captured image can be determined. The chromaticity characteristics of the desktop can be determined by referring to data or actual measurements, and then the approximate illuminance of the desktop can be obtained by the brightness of the desktop area. The specific calculation process is as follows. In this calculation, the desktop is approximately equivalent to a complete diffuse reflector:
E
in=πL/ρ (8)
E in =πL/ρ (8)
其中E
in为桌面照度,ρ为桌面反射率,L为测得的桌面亮度,式8即表述了桌面亮度和照度之间的关系。若计算得到的桌面照度值不在合理值区间内,则重新计算该区域对应灯具的亮度,发送调光指令调节灯具亮度,然后继续检测桌面照度是否符合要求,不符合就继续调节灯具亮度,该反馈调节的流程图如图4所示。
Where E in is the desktop illuminance, ρ is the desktop reflectivity, and L is the measured desktop brightness. Equation 8 expresses the relationship between the desktop brightness and illuminance. If the calculated desktop illuminance value is not within a reasonable range, then recalculate the brightness of the corresponding fixture in the area, send a dimming command to adjust the brightness of the fixture, and then continue to detect whether the desktop illuminance meets the requirements, and continue to adjust the brightness of the fixture if it does not meet the feedback The flow chart of adjustment is shown in Figure 4.
黑板在学生学习过程中的使用频率很大,黑板的照明条件直接关乎学生的视力,故需要更加精细化的调节。如图5所示为黑板、黑板灯和投影仪的位置示意图,顶部是两盏黑板灯,它们由各自的LED控制端设备控制,黑板位于前墙面上,投影白板一般位于黑板的中间一块矩形区域,平时该白板被黑板面遮挡,用的时候将黑板面推开即可露出白板作为投影平面使用。首先通过色度识别确定黑板在拍摄图像中的像素区域位置,可通过查阅资料或者实际测量确定黑板的色度特征,根据这一色度特征即可确定黑板在图像中的位置。根据黑板区域的亮度,结合公式(8)即可计算出黑板面照度,根据黑板面照度对黑板灯进行调节,这一调节过程与照面照度调节过程类似。当黑板区域检测到一块面积较大的高亮度区域时,则说明开启了投影仪,投影白板上有投影图像,此时应关闭黑板灯,并且相应调低教室前半区域灯具的亮度,进入多媒体上课模式。The blackboard is used frequently in the learning process of the students. The lighting conditions of the blackboard are directly related to the eyesight of the students, so more detailed adjustment is needed. Figure 5 shows the schematic diagram of the positions of the blackboard, blackboard lamp and projector. At the top are two blackboard lamps, which are controlled by their respective LED control devices. The blackboard is located on the front wall, and the projection whiteboard is generally located in the middle of the blackboard. In the area, the whiteboard is usually blocked by the blackboard surface. When it is used, the blackboard surface is pushed away to expose the whiteboard as a projection plane. Firstly, the location of the pixel area of the blackboard in the captured image is determined by chromaticity recognition. The chromaticity characteristics of the blackboard can be determined by referring to data or actual measurement, and the location of the blackboard in the image can be determined according to this chromaticity characteristic. According to the brightness of the blackboard area, combined with formula (8), the blackboard surface illuminance can be calculated, and the blackboard light is adjusted according to the blackboard surface illuminance. This adjustment process is similar to the illumination illuminance adjustment process. When a high-brightness area with a large area is detected in the blackboard area, it means that the projector is turned on and there is a projected image on the whiteboard. At this time, the blackboard light should be turned off, and the brightness of the lamps in the first half of the classroom should be reduced accordingly to enter the multimedia class mode.
如图6所示,光环境采集端在计算出相应灯具的调节亮度后,通过NB-IOT模块将这一信息发送给NB基站,基站再将信息发送到云平台上,云平台具有中继缓存和转化数据格式的功能,可以将设备端接收到的二进制数据转化为json格式数据,并发送到上位机监控端,json数据具体发送到用户的服务器上,当用户打开电脑端界面后,便可以实时与服务器进行数据交互。电脑端界面具有实时监控设备端状态,手动控制灯具等功能。As shown in Fig. 6, after calculating the adjusted brightness of the corresponding lamp, the light environment collection end sends this information to the NB base station through the NB-IOT module, and the base station sends the information to the cloud platform, which has a relay cache With the function of converting data format, the binary data received by the device can be converted into json format data and sent to the host computer monitoring end. The json data is specifically sent to the user's server. When the user opens the computer interface, it can be Real-time data interaction with the server. The computer interface has the functions of real-time monitoring of the status of the equipment and manual control of lamps and lanterns.
如图7所述为LED控制端的具体结构,电源模块将市电220V交流转化为5V直流和220V直流,5V直流用来给控制芯片以及NB-IOT模块供电,而LED恒流驱动控制器由220V供电,可产生恒流源来驱动LED灯具发光。该LED控制端通过NB-IOT模块接收灯具亮度控制信号,通过STM32处理后,产生对应脉宽的PWM 波给恒流驱动控制器。恒流驱动控制器基于接收到的PWM波,对灯具进行亮度控制。基于人眼感知闪烁的频率极限,灯具的调光频率至少应该为100HZ。同时考虑到在改变灯具亮度时,突然的亮度变化会引起人眼的不适,造成视疲劳和学习效率下降,在调整LED亮度时采用软调整的方式,即当要提高LED亮度时通过在一段时间内逐步提高PWM波占空比的方式达到目标亮度值;当要降低LED亮度时通过在一段时间内逐步减小PWM波占空比的方式达到目标亮度值。As shown in Figure 7, the specific structure of the LED control terminal, the power module converts 220V AC to 5V DC and 220V DC, 5V DC is used to power the control chip and NB-IOT module, and the LED constant current drive controller is 220V Power supply can generate a constant current source to drive LED lamps to emit light. The LED control terminal receives the lamp brightness control signal through the NB-IOT module, and after processing by STM32, generates a PWM wave with a corresponding pulse width to the constant current drive controller. The constant current drive controller controls the brightness of the lamp based on the received PWM wave. Based on the frequency limit of human eyes perceiving flicker, the dimming frequency of the lamp should be at least 100HZ. At the same time, considering that when the brightness of the lamp is changed, the sudden brightness change will cause discomfort to the human eye, causing visual fatigue and a decrease in learning efficiency. When adjusting the brightness of the LED, a soft adjustment method is adopted, that is, when the brightness of the LED is to be increased Internally gradually increase the duty cycle of the PWM wave to achieve the target brightness value; when the LED brightness is to be reduced, the target brightness value is achieved by gradually reducing the PWM wave duty cycle over a period of time.
上述实施例只为说明本发明的技术构思及特点,其目的是让熟悉该技术领域的技术人员能够了解本发明的内容并据以实施,并不能以此来限制本发明的保护范围。对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above embodiments are only for illustrating the technical concept and features of the present invention, and the purpose thereof is to enable those skilled in the technical field to understand the contents of the present invention and implement them accordingly, and cannot limit the scope of protection of the present invention. For those of ordinary skill in the art, without departing from the principles of the present invention, a number of improvements and retouches can be made, and these improvements and retouches should also be considered as the scope of protection of the present invention.