WO2020077516A1 - Led array signal detection method, and device - Google Patents

Led array signal detection method, and device Download PDF

Info

Publication number
WO2020077516A1
WO2020077516A1 PCT/CN2018/110348 CN2018110348W WO2020077516A1 WO 2020077516 A1 WO2020077516 A1 WO 2020077516A1 CN 2018110348 W CN2018110348 W CN 2018110348W WO 2020077516 A1 WO2020077516 A1 WO 2020077516A1
Authority
WO
WIPO (PCT)
Prior art keywords
led
led array
positioning
leds
light source
Prior art date
Application number
PCT/CN2018/110348
Other languages
French (fr)
Chinese (zh)
Inventor
刘鹏
陈欣
Original Assignee
华北电力大学扬中智能电气研究中心
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华北电力大学扬中智能电气研究中心 filed Critical 华北电力大学扬中智能电气研究中心
Priority to PCT/CN2018/110348 priority Critical patent/WO2020077516A1/en
Priority to JP2021546407A priority patent/JP7182722B2/en
Publication of WO2020077516A1 publication Critical patent/WO2020077516A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes

Abstract

An LED array signal detection method and a device. An LED array comprises N * N LEDs, where N is greater than or equal to 3, and positioning LEDs are defined as LEDs at four corner positions in the LED array. On-off states of the four positioning LEDs are pre-configured such that three of the positioning LEDs are on, and the remaining positioning LED is off. The method comprises: acquiring an image containing the LED array (200); detecting each light source from the image by means of a connected-component labeling algorithm (210); determining a position of each detected light source, and determining the positioning LEDs of the LED array in the image according to the position of each light source and the pre-configured on-off states of the four positioning LEDs (220); and determining positions of the positioning LEDs, performing detection on each light source according to the positions of the positioning LEDs and a grayscale value and the position of each light source, determining an on-off state of each LED in the LED array, and acquiring an LED array signal of the LED array (230). The invention is configured to achieve accurate identification of the positioning LEDs by means of the design of the positioning LEDs and the distance of each light source, and in turn to detect the LED array signal, thereby providing computational simplicity and improved efficiency.

Description

一种LED阵列信号检测方法及装置LED array signal detection method and device 技术领域Technical field
本发明涉及光通信技术领域,尤其涉及一种LED阵列信号检测方法及装置。The invention relates to the technical field of optical communication, in particular to an LED array signal detection method and device.
背景技术Background technique
图像传感器通信(Image sensor communication,ISC)是以发光二极管(Light emitting diodes,LED)作为信号发射端、图像传感器作为接收端,主要应用于智能交通和室内定位等场合。另外,为了提高通信性能,通常采用多输入多输出(multi-input multi-output,MIMO)技术应用于ISC系统中。但是,在MIMO-ISC技术的应用过程中,由于外界干扰和背景光的存在等,导致不能准确检测出LED的变化,从而降低了系统通信性能。Image sensor communication (ISC) uses light emitting diodes (LEDs) as signal transmitters and image sensors as receivers. It is mainly used in intelligent transportation and indoor positioning. In addition, in order to improve communication performance, multi-input and multi-output (MIMO) technology is generally used in ISC systems. However, in the application process of MIMO-ISC technology, due to external interference and the presence of background light, etc., it is impossible to accurately detect the change of the LED, thereby reducing the system communication performance.
现有技术中,LED阵列信号检测方法,主要采用边缘算法、区块生长法和帧差法,对图像中LED进行识别,从而检测出LED阵列信号,但是,这几种方法具有以下缺点:1)边缘算法实现困难,效率较低;2)区块生成算法分割效率较低,代价较大;3)帧差法虽然计算量小,复杂度低,但是对于背景噪声比较敏感,识别效果较差。In the prior art, the LED array signal detection method mainly uses the edge algorithm, block growth method and frame difference method to identify the LED in the image to detect the LED array signal, but these methods have the following disadvantages: 1 ) The edge algorithm is difficult to implement and has low efficiency; 2) The block generation algorithm has low segmentation efficiency and high cost; 3) Although the frame difference method has small calculation and low complexity, it is sensitive to background noise and has poor recognition effect .
发明内容Summary of the invention
本发明实施例提供一种LED阵列信号检测方法及装置,以解决现有技术中LED阵列信号检测效率和准确性较低的问题。Embodiments of the present invention provide an LED array signal detection method and device to solve the problem of low efficiency and accuracy of LED array signal detection in the prior art.
本发明实施例提供的具体技术方案如下:The specific technical solutions provided by the embodiments of the present invention are as follows:
一种发光二极管LED阵列信号检测方法,LED阵列包括N*N个LED,其中N大于等于3,并定义所述LED阵列中位于四个角位置的LED为定位LED,预先设置四个定位LED的开关状态为其中三个定位LED为亮,其余一个定位LED为灭,所述方法包括:A light-emitting diode LED array signal detection method, the LED array includes N * N LEDs, where N is greater than or equal to 3, and the LEDs at four corner positions in the LED array are defined as positioning LEDs, and four positioning LEDs are preset The switch state is that three of the positioning LEDs are on and the remaining one is off. The method includes:
获取包含所述LED阵列的图像;Obtaining an image containing the LED array;
采用连通区域标记算法,从所述图像中检测出各光源;A connected area labeling algorithm is used to detect each light source from the image;
确定检测出的各光源的位置,并根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED;Determine the positions of the detected light sources, and determine the positioning LEDs of the LED array from the image according to the positions of the light sources and the switch states of the four preset positioning LEDs;
确定定位LED的位置,并根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号。Determine the position of the positioning LED, and detect each light source according to the position of the positioning LED, and the gray value and position of each light source, determine the switching state of each LED in the LED array, and obtain the LED array LED array signal.
可选的,根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确 定所述LED阵列的定位LED,具体包括:Optionally, the positioning LEDs of the LED array are determined from the image according to the position of each light source and the switch states of the four preset positioning LEDs, which specifically include:
根据各光源的位置,分别依次计算任意两个光源之间的距离;According to the position of each light source, calculate the distance between any two light sources in turn;
根据计算出的任意两个光源之间的距离,确定出能够构成直角边最大的等腰直角三角形的三个光源;According to the calculated distance between any two light sources, determine the three light sources that can form an isosceles right triangle with the largest right-angle side;
若确定出的等腰直角三角形的直角边取值为所述LED阵列预设的LED间距的N-1倍,则确定所述直角边最大的等腰直角三角形的三个顶点的光源,为所述LED阵列的三个开关状态为亮的定位LED;If the determined right-angle side of the isosceles right-angled triangle is N-1 times the preset LED spacing of the LED array, the light sources of the three vertices of the isosceles right-angled triangle with the largest right-angled side are determined as The three switch states of the LED array are bright positioning LEDs;
根据确定出的三个开关状态为亮的定位LED,确定出其余一个定位LED的位置。According to the determined positioning LEDs whose three switch states are bright, the positions of the remaining positioning LEDs are determined.
可选的,进一步包括:若确定出至少两个直角边取值为所述预设的LED间距的N-1倍的等腰直角三角形,则分别统计至少两个等腰直角三角形对应组成的LED阵列区域中光源的数量,并将数量最多对应的等腰直角三角形的三个顶点的光源确定为所述LED阵列的三个开关状态为亮的定位LED。Optionally, the method further includes: if it is determined that at least two right-angled sides have an isosceles right-angled triangle whose value is N-1 times the predetermined LED interval, then at least two LEDs corresponding to the isosceles right-angled triangles are counted The number of light sources in the array area, and the light sources at the three vertices of the isosceles right-angled triangle corresponding to the maximum number are determined to be the three positioning LEDs in the LED array whose switching state is bright.
可选的,进一步包括:筛选出不大于所述LED阵列预设的对角线取值的距离,并根据筛选出的距离,确定执行确定出能够构成直角边最大的等腰直角三角形的三个光源的步骤。Optionally, the method further includes: filtering out a distance not greater than the preset diagonal value of the LED array, and determining and executing three three isosceles right-angled triangles that can form the largest right-angled side according to the selected distance Light source steps.
可选的,根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号,具体包括:Optionally, according to the position of the positioning LED, and the gray value and position of each light source, each light source is detected to determine the switching state of each LED in the LED array to obtain the LED array signal of the LED array , Including:
分别对所述各光源进行检测,确定所述各光源对应的LED的开关状态,并根据各LED的开关状态,获得所述LED阵列的LED阵列信号;Respectively detecting the light sources, determining the switching state of the LEDs corresponding to the light sources, and obtaining the LED array signal of the LED array according to the switching state of the LEDs;
其中,针对所述各光源中任意一个光源进行检测时,具体包括:Wherein, when detecting any one of the light sources, specifically include:
判断所述任意一个光源的灰度值是否在预设的LED最小灰度值和最大灰度值区间范围内,以及根据确定出的任意一个定位LED的位置、预设的位置误差值和预设的LED间距,确定所述LED阵列中各LED的位置区间,判断所述任意一个光源的位置是否在对应的位置区间中;Determine whether the gray value of any one light source is within the range of the preset minimum gray value and maximum gray value of the LED, and according to the determined position of any one positioning LED, the preset position error value and the preset LED spacing, determine the position interval of each LED in the LED array, and determine whether the position of any one light source is in the corresponding position interval;
若判断均为是,则确定所述任意一个光源对应的LED的开关状态为亮,解码为1,否则,确定所述任意一个光源对应的LED的开关状态为灭,解码为0。If the judgment is YES, it is determined that the switch state of the LED corresponding to any one light source is on and decoded as 1, otherwise, the switch state of the LED corresponding to any one of the light sources is determined to be off and decoded as 0.
一种LED阵列信号检测装置,LED阵列包括N*N个LED,其中N大于等于3,并定义所述LED阵列中位于四个角位置的LED为定位LED,预先设置四个定位LED的开关状态为其中三个定位LED为亮,其余一个定位LED为灭,所述装置包括:An LED array signal detection device, the LED array includes N * N LEDs, where N is greater than or equal to 3, and the LEDs at four corner positions in the LED array are defined as positioning LEDs, and the switching states of the four positioning LEDs are preset For three of the positioning LEDs to be on and the remaining one to be off, the device includes:
获取模块,用于获取包含所述LED阵列的图像;An acquisition module for acquiring an image containing the LED array;
检测模块,用于采用连通区域标记算法,从所述图像中检测出各光源;The detection module is used to detect each light source from the image by using a connected area labeling algorithm;
第一确定模块,用于确定检测出的各光源的位置,并根据各光源的位置和预先设置的 四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED;A first determining module, configured to determine the positions of the detected light sources, and determine the positioning LEDs of the LED array from the image according to the positions of the light sources and the switch states of the four preset positioning LEDs;
第二确定模块,用于确定定位LED的位置,并根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号。The second determination module is used to determine the position of the positioning LED, and respectively detect the light sources according to the position of the positioning LED, and the gray value and position of each light source, and determine the switching state of each LED in the LED array To obtain the LED array signal of the LED array.
可选的,根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED时,所述第一确定模块具体用于:Optionally, when determining the positioning LEDs of the LED array from the image according to the position of each light source and the switch states of the four preset positioning LEDs, the first determining module is specifically configured to:
根据各光源的位置,分别依次计算任意两个光源之间的距离;According to the position of each light source, calculate the distance between any two light sources in turn;
根据计算出的任意两个光源之间的距离,确定出能够构成直角边最大的等腰直角三角形的三个光源;According to the calculated distance between any two light sources, determine the three light sources that can form an isosceles right triangle with the largest right-angle side;
若确定出的等腰直角三角形的直角边取值为所述LED阵列预设的LED间距的N-1倍,则确定所述直角边最大的等腰直角三角形的三个顶点的光源,为所述LED阵列的三个开关状态为亮的定位LED;If the determined right-angle side of the isosceles right-angled triangle is N-1 times the preset LED spacing of the LED array, the light sources of the three vertices of the isosceles right-angled triangle with the largest right-angled side are determined as The three switch states of the LED array are bright positioning LEDs;
根据确定出的三个开关状态为亮的定位LED,确定出其余一个定位LED的位置。According to the determined positioning LEDs whose three switch states are bright, the positions of the remaining positioning LEDs are determined.
可选的,所述第一确定模块进一步用于:若确定出至少两个直角边取值为所述预设的LED间距的N-1倍的等腰直角三角形,则分别统计至少两个等腰直角三角形对应组成的LED阵列区域中光源的数量,并将数量最多对应的等腰直角三角形的三个顶点的光源确定为所述LED阵列的三个开关状态为亮的定位LED。Optionally, the first determining module is further configured to: if at least two right-angled sides are determined as isosceles right-angled triangles with a value of N-1 times the predetermined LED interval, at least two equal points are counted respectively The waist right-angled triangle corresponds to the number of light sources in the LED array area formed, and the light sources at the three vertices of the isosceles right-angled triangle corresponding to the maximum number are determined to be the positioning LEDs whose three switch states are bright.
可选的,所述第一确定模块进一步用于:筛选出不大于所述LED阵列预设的对角线取值的距离,并根据筛选出的距离,确定执行确定出能够构成直角边最大的等腰直角三角形的三个光源的步骤。Optionally, the first determining module is further configured to: filter out a distance not greater than the preset diagonal value of the LED array, and determine and execute to determine the largest square angle can be formed according to the selected distance Steps of three light sources of isosceles right triangle.
可选的,根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号时,所述第二确定模块具体用于:Optionally, according to the position of the positioning LED, and the gray value and position of each light source, each light source is detected to determine the switching state of each LED in the LED array to obtain the LED array signal of the LED array At this time, the second determining module is specifically used to:
分别对所述各光源进行检测,确定所述各光源对应的LED的开关状态,并根据各LED的开关状态,获得所述LED阵列的LED阵列信号;Respectively detecting the light sources, determining the switching state of the LEDs corresponding to the light sources, and obtaining the LED array signal of the LED array according to the switching state of the LEDs;
其中,针对所述各光源中任意一个光源进行检测时,具体包括:Wherein, when detecting any one of the light sources, specifically include:
判断所述任意一个光源的灰度值是否在预设的LED最小灰度值和最大灰度值区间范围内,以及根据确定出的任意一个定位LED的位置、预设的位置误差值和预设的LED间距,确定所述LED阵列中各LED的位置区间,判断所述任意一个光源的位置是否在对应的位置区间中;Determine whether the gray value of any one light source is within the range of the preset minimum gray value and maximum gray value of the LED, and according to the determined position of any one positioning LED, the preset position error value and the preset LED spacing, determine the position interval of each LED in the LED array, and determine whether the position of any one light source is in the corresponding position interval;
若判断均为是,则确定所述任意一个光源对应的LED的开关状态为亮,解码为1,否则,确定所述任意一个光源对应的LED的开关状态为灭,解码为0。If the judgment is YES, it is determined that the switch state of the LED corresponding to any one light source is on and decoded as 1, otherwise, the switch state of the LED corresponding to any one of the light sources is determined to be off and decoded as 0.
一种计算机装置,包括:A computer device, including:
至少一个存储器,用于存储计算机程序;At least one memory for storing computer programs;
至少一个处理器,用于执行存储器中存储的计算机程序时实现上述任一种LED阵列信号的检测方法的步骤。At least one processor for implementing the steps of any one of the above LED array signal detection methods when executing a computer program stored in a memory.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种LED阵列信号的检测方法的步骤。A computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements any of the steps of the LED array signal detection method described above.
本发明实施例中,LED阵列包括N*N个LED,其中N大于等于3,并定义所述LED阵列中位于四个角位置的LED为定位LED,预先设置四个定位LED的开关状态为其中三个定位LED为亮,其余一个定位LED为灭;在进行LED阵列信号检测时,具体为:获取包含所述LED阵列的图像;采用连通区域标记算法,从所述图像中检测出各光源;确定检测出的各光源的位置,并根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED;确定定位LED的位置,并根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号,这样,将LED阵列的四个角的LED定义为定位LED,并设置三亮一灭,从而可以根据光源距离和定位LED开关状态,从图像中准确识别出定位LED,准确性高,计算简单,运算速度较快,进而可以根据定位LED,检测出LED阵列信号,提高了检测效率和准确性。In the embodiment of the present invention, the LED array includes N * N LEDs, where N is greater than or equal to 3, and the LEDs at the four corner positions in the LED array are defined as positioning LEDs, and the switching states of the four positioning LEDs are preset as Three positioning LEDs are on, and the other positioning LEDs are off; when performing LED array signal detection, specifically: acquiring an image containing the LED array; using a connected area marking algorithm to detect each light source from the image; Determine the position of each detected light source, and determine the positioning LED of the LED array from the image according to the position of each light source and the switch state of the four preset positioning LEDs; determine the position of the positioning LED, and according to the positioning The position of the LED, and the gray value and position of each light source, respectively detect the light source, determine the switching state of each LED in the LED array, obtain the LED array signal of the LED array, so that the LED array The four corners of the LED are defined as positioning LEDs, and set three on and one off, so that the positioning LED can be accurately identified from the image according to the distance of the light source and the position of the positioning LED switch, and the accuracy is high. Simple calculation, calculation speed, and thus can be positioned according to the LED, the LED arrays detected signal, the detection efficiency and accuracy.
并且,设置LED阵列的定位LED三亮一灭,不仅可以便于确定识别出定位LED的位置,进而确定出LED阵列的范围,还可以根据定位LED的开关状态,确定LED阵列的正方向,校正LED阵列的位置,便于逐行解码获得LED阵列信号,提高准确性。In addition, the positioning LED of the LED array is turned on and off three times, which not only facilitates the determination of the location of the identified LED and thus the range of the LED array, but also determines the positive direction of the LED array and corrects the LED array according to the switching state of the positioning LED. The position of it is convenient to decode the line by line to obtain the LED array signal and improve the accuracy.
附图说明BRIEF DESCRIPTION
被结合在说明书中并构成说明书的一部分的附图示出了本发明的实施例,并且连同其说明一起用于解释本发明的原理。The drawings incorporated in and forming a part of the specification illustrate embodiments of the invention, and together with the description thereof, serve to explain the principles of the invention.
图1为本发明实施例中基于MIMO的ISC系统原理结构示意图;FIG. 1 is a schematic structural diagram of an ISC system based on MIMO in an embodiment of the present invention;
图2为本发明实施例中LED阵列信号检测方法的流程图;2 is a flowchart of a method for detecting LED array signals in an embodiment of the present invention;
图3为本发明实施例中连通区域标记算法的检测结果示意图;3 is a schematic diagram of the detection result of the connected region marking algorithm in the embodiment of the present invention;
图4为本发明实施例中第一种情况的定位LED的识别结果示意图;FIG. 4 is a schematic diagram of the identification result of the positioning LED in the first case in the embodiment of the present invention;
图5为本发明实施例中第二种情况的定位LED的识别结果示意图;FIG. 5 is a schematic diagram of the identification result of the positioning LED in the second case in the embodiment of the present invention;
图6为本发明实施例中第三种情况的定位LED的识别结果示意图;6 is a schematic diagram of a recognition result of a positioning LED in a third case in an embodiment of the present invention;
图7为本发明实施例中基于定位LED进行LED阵列信号解码的原理示意图;7 is a schematic diagram of the principle of decoding LED array signals based on positioning LEDs in an embodiment of the present invention;
图8为本发明实施例中LED阵列信号检测装置结构示意图;8 is a schematic structural diagram of an LED array signal detection device according to an embodiment of the present invention;
图9为本发明实施例中计算机装置结构示意图。9 is a schematic structural diagram of a computer device in an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,并不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be described clearly and completely in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the protection scope of the present invention.
实际中,发光二极管(Light emitting diodes,LED)光源不仅可以用于照明,还可以用于通信,通过LED光源的明暗变化来传递信号,可见光通信(Visible light communication,VLC)就是一种使用LED的明暗变化进行无线通信的技术。为了提高可靠性和效率,可以采用图像传感器作为接收端,即可称为图像传感器通信(Image sensor communication,ISC),ISC以LED作为信号发射端、图像传感器作为接收端,可以应用于智能交通和室内定位等场景,ISC通信中关键在于对LED的准确识别。并且,为提高通信性能,通常将多输入多输出(multi-input multi-output,MIMO)技术应用于ISC系统中,但是MIMO-ISC系统中,由于外界干扰和背景光噪声的存在等,使得图像传感器不能准确辨别出LED的变化,从而降低了通信性能,现有技术中,提供几种LED阵列信号检测方法,主要采用边缘算法、区块生长法和帧差法,从图像中识别并还原出LED阵列信号,但是,这几种方法对LED阵列检测效率和准确性较低。In practice, the light emitting diode (LED) light source can be used not only for lighting, but also for communication. The signal is transmitted through the change of the light and dark of the LED light source. Visible light communication (VLC) is a type of LED. The technology of wireless communication that changes light and shade. In order to improve reliability and efficiency, the image sensor can be used as the receiving end, that is, image sensor communication (ISC). ISC uses LED as the signal transmitting end and the image sensor as the receiving end, which can be applied to intelligent transportation and For indoor positioning and other scenarios, the key to ISC communication is accurate identification of LEDs. In addition, in order to improve communication performance, multi-input and multi-output (MIMO) technology is usually applied to ISC systems. However, in MIMO-ISC systems, due to the presence of external interference and background light noise, etc., the image The sensor cannot accurately recognize the change of the LED, thereby reducing the communication performance. In the prior art, several LED array signal detection methods are provided, mainly using edge algorithm, block growth method and frame difference method to identify and restore from the image LED array signals, however, these methods have low detection efficiency and accuracy for LED arrays.
因此,本发明实施例中,以LED阵列作为信号发射端,主要是为了从复杂背景噪声中识别和提取LED阵列光源,提高识别准确性和效率,预先设计LED阵列中位于四个角位置的定位LED的工作状态为三亮一灭,利用图像传感器拍摄包含LED阵列的图像后,采用连通区域标记法检测图像中各光源,并根据各光源的位置,通过寻找最大等腰直角三角形来确定出定位LED,从而确定LED阵列中各LED的工作状态,进行解码,识别LED阵列包含的信息,获得传输的光信号。Therefore, in the embodiment of the present invention, the LED array is used as the signal emitting end, mainly to identify and extract the LED array light source from the complex background noise, improve the recognition accuracy and efficiency, and design the positioning of the LED array at four corner positions in advance The working state of the LED is three on and one off. After taking the image containing the LED array with the image sensor, the connected area marking method is used to detect each light source in the image, and according to the position of each light source, the positioning LED is determined by finding the largest isosceles right triangle In order to determine the working status of each LED in the LED array, decode it, identify the information contained in the LED array, and obtain the transmitted optical signal.
参阅图1所示,为本发明实施例中基于MIMO的ISC系统原理结构示意图,至少包括接收端和发送端两部分。Referring to FIG. 1, it is a schematic structural diagram of an ISC system based on MIMO in an embodiment of the present invention, which includes at least a receiving end and a sending end.
第一部分:发送端。发送端至少包括信号输入、调制、LED阵列驱动器、LED阵列发射端部分。Part 1: The sending end. The sending end includes at least signal input, modulation, LED array driver, and LED array emitting end part.
发送端的基本原理为:输入二进制序列信号,将二进制序列信号经过串并转换后形成并行的多路数字信号,然后,分别对每一路数字信号进行调制,例如可以采用二进制开关键控(On-Off Keying,OOK)调制,本发明实施例中并不进行限制,最后,基于调制后的信号,通过LED阵列驱动器驱动LED阵列工作,即变换LED阵列中各LED的开关状态,通过透镜发射信号。The basic principle of the sending end is: input a binary sequence signal, convert the binary sequence signal into a parallel multi-channel digital signal after serial-to-parallel conversion, and then modulate each digital signal separately, for example, binary on-off key control (On-Off Keying, OOK) modulation, which is not limited in the embodiment of the present invention. Finally, based on the modulated signal, the LED array driver is driven by the LED array driver to work, that is, the switching state of each LED in the LED array is changed, and the signal is transmitted through the lens.
进一步地,在信号通信过程中,对于输入的信源信号,还可以先进行编码,再进行传 输,提高可靠性。Furthermore, in the process of signal communication, the input source signal can also be encoded first and then transmitted to improve reliability.
也就是说,本发明实施例中,可以将调制后的信号,加载到LED阵列中发射出去,例如,可以通过LED阵列中LED的亮表示“1”,灭表示“0”。That is to say, in the embodiment of the present invention, the modulated signal can be loaded into the LED array and emitted, for example, the LED in the LED array can be lit to indicate “1” and off to indicate “0”.
其中,本发明实施例中,LED阵列包括N*N个LED,其中N大于等于3,为了便于接收端能够准确识别LED阵列信号,定义LED阵列中位于四个角位置的LED为定位LED,并预先设置四个定位LED的开关状态为其中三个定位LED为亮,其余一个定位LED为灭,并且还可以设置为亮的定位LED与为灭的定位LED在LED阵列中的位置。Among them, in the embodiment of the present invention, the LED array includes N * N LEDs, where N is greater than or equal to 3, in order to facilitate the receiver to accurately identify the LED array signal, the LEDs at four corners of the LED array are defined as positioning LEDs, and The switch state of the four positioning LEDs is preset as three of the positioning LEDs are on, and the remaining one of the positioning LEDs is off, and the position of the on-positioning LED and the off-positioning LED in the LED array can also be set.
这样,本发明实施例中通过设置的定位LED的工作状态以及在LED阵列中的位置,不仅可以便于接收端准确检测LED阵列信号,还可以便于接收端定位LED阵列位置,并可以用来检测发射端的区域、判断图片是否畸变、估计LED阵列校正参数,例如旋转角度等。In this way, the working status of the positioning LED and the position in the LED array in the embodiment of the present invention can not only facilitate the accurate detection of the LED array signal at the receiving end, but also facilitate the positioning of the LED array at the receiving end, and can be used to detect the emission The area at the end, determine whether the picture is distorted, and estimate the LED array correction parameters, such as the rotation angle.
第二部分:接收端。接收端至少包括透镜、图像传感器、数字图像处理和解码部分。Part 2: The receiving end. The receiving end includes at least a lens, an image sensor, a digital image processing and decoding part.
接收端的基本原理为:通过图像传感器实时拍摄获得包含LED阵列的图像,然后,读取拍摄的图像,对图像进行数字图像处理,检测并识别图像中各光源,确定出定位LED,最后,根据定位LED的确定,进行解码,确定LED阵列中各LED的开关状态,还原出传输的二进制序列信号,即LED阵列信号。The basic principle of the receiving end is: real-time shooting through the image sensor to obtain the image containing the LED array, then, read the captured image, perform digital image processing on the image, detect and identify each light source in the image, determine the positioning LED, and finally, according to the positioning Determine the LED, decode it, determine the switching state of each LED in the LED array, and restore the transmitted binary sequence signal, that is, the LED array signal.
其中,本发明实施例中主要实现了对图像的数字图像处理,并进行解码获得LED阵列信号,具体地将在下文中LED阵列信号检测方法中进行具体介绍。Among them, the digital image processing of the image is mainly implemented in the embodiment of the present invention, and decoding is performed to obtain the LED array signal, which will be specifically described in the LED array signal detection method below.
值得说明的是,本发明实施例中的系统原理结构图是为了更加清楚地说明本发明实施例中的技术方案,并不构成对本发明实施例提供的技术方案的限制,对于其它的系统结构和业务应用,本发明实施例提供的技术方案对于类似的问题,同样适用。It is worth noting that the system principle structure diagram in the embodiments of the present invention is to more clearly explain the technical solutions in the embodiments of the present invention, and does not constitute a limitation on the technical solutions provided in the embodiments of the present invention. For other system structures and For business applications, the technical solutions provided by the embodiments of the present invention are also applicable to similar problems.
本发明各个实施例中,以LED阵列信号检测方法用于图1所示的系统原理结构图为例进行示意性说明。In various embodiments of the present invention, the LED array signal detection method is used as a schematic structural diagram of the system shown in FIG. 1 as an example for schematic description.
参阅图2所示,为本发明实施例中LED阵列信号检测方法流程图,该方法包括:Referring to FIG. 2, it is a flowchart of a method for detecting an LED array signal according to an embodiment of the present invention. The method includes:
步骤200:获取包含LED阵列的图像。Step 200: Acquire an image containing an LED array.
例如,LED阵列通过各LED开关状态的变化来发送信号,可以通过相机实时拍摄LED阵列,获得包含LED阵列的图像。For example, the LED array sends a signal through the change of the switch status of each LED, and the LED array can be photographed in real time by a camera to obtain an image containing the LED array.
步骤210:采用连通区域标记算法,从图像中检测出各光源。Step 210: A connected area labeling algorithm is used to detect each light source from the image.
进一步地,对图像进行二值化处理,获得二值化图像,从而可以采用连通区域标记算法,从二值化图像中检测光源。Further, the image is binarized to obtain a binarized image, so that a connected region labeling algorithm can be used to detect the light source from the binarized image.
其中,连通区域标记算法的基本原理为:采用二次遍历完成标记,第一轮遍历时,逐行扫描图像,把连通区域标为一个团,除第一行外的所有行的团,如果与前一行的团有重叠部分,则给该团赋予相连团的最小标号,且这些同一标号的团的标记都是等价的,第二 轮遍历时,遍历开始团的标记,寻找等价序列,重新标记。Among them, the basic principle of the connected area labeling algorithm is: use the second traversal to complete the labeling. During the first round of traversal, the image is scanned line by line, and the connected area is marked as a cluster. The clusters of all lines except the first line, if If there is an overlap between the groups in the previous row, the group is given the smallest label of the connected group, and the labels of these groups with the same label are equivalent. During the second round of traversal, the labels of the starting group are traversed to find the equivalent sequence. Relabel.
参阅图3所示,为本发明实施例中连通区域标记算法的检测结果示意图,可知可以标记出各光源的区域,各区域的圆心即可以认为是光源的位置,从而可以获得所有光源位置,包括LED光源和干扰源的位置,之后再进行判断,确定各位置的光源是LED还是干扰源。Referring to FIG. 3, which is a schematic diagram of the detection result of the connected area marking algorithm in the embodiment of the present invention, it can be seen that the areas of each light source can be marked, and the center of each area can be regarded as the position of the light source, so that all light source positions can be obtained, including The positions of the LED light source and the interference source are determined afterwards to determine whether the light source at each position is an LED or an interference source.
这样,采用连通区域标记算法来检测光源,效率更高,并且耗时少,对于不同帧的图像,耗时都相同。In this way, the connected area labeling algorithm is used to detect the light source, which is more efficient and takes less time. For images of different frames, the time is the same.
步骤220:确定检测出的各光源的位置,并根据各光源的位置和预先设置的四个定位LED的开关状态,从图像中确定LED阵列的定位LED。Step 220: Determine the positions of the detected light sources, and determine the positioning LEDs of the LED array from the image according to the positions of the light sources and the switch states of the four positioning LEDs set in advance.
执行步骤220时,具体包括:When step 220 is executed, it specifically includes:
首先,根据各光源的位置,分别依次计算任意两个光源之间的距离。First, according to the position of each light source, the distance between any two light sources is calculated in sequence.
例如,有3个光源,分别为光源1、光源2和光源3,则依次分别计算光源1与光源2、光源1与光源3以及光源2与光源3之间的距离,并记录计算出的各距离和对应的光源的位置。For example, if there are 3 light sources, namely light source 1, light source 2 and light source 3, then calculate the distance between light source 1 and light source 2, light source 1 and light source 3 and light source 2 and light source 3 in sequence, and record the calculated The distance and the position of the corresponding light source.
然后,根据计算出的任意两个光源之间的距离,确定出能够构成直角边最大的等腰直角三角形的三个光源。Then, based on the calculated distance between any two light sources, three light sources that can form an isosceles right triangle with the largest right-angle side are determined.
具体地,根据记录的各距离,以及各距离对应的光源,依次确定能够构成等腰直角三角形的三个光源,并确定出其中直角边最大的等腰直角三角形对应的三个光源。Specifically, according to each distance recorded and the light source corresponding to each distance, three light sources capable of forming an isosceles right-angled triangle are sequentially determined, and three light sources corresponding to the isosceles right-angled triangle with the largest right-angle side are determined.
进一步地,为方便计算和确定,本发明实施例中还可以先按光源的距离从小到大的顺序进行排序,从而根据排序后的距离,可以更快确定出直角边最大的等腰直角三角形。Further, in order to facilitate calculation and determination, in this embodiment of the present invention, the distances of the light sources can be sorted first from small to large, so that the isosceles right-angled triangle with the largest right-angled side can be determined faster according to the sorted distance.
然后,若确定出的等腰直角三角形的直角边取值为LED阵列预设的LED间距的N-1倍,则确定该直角边最大的等腰直角三角形的三个顶点的光源,为LED阵列的三个开关状态为亮的定位LED。Then, if the determined right-angle side of the isosceles right-angled triangle is N-1 times the preset LED spacing of the LED array, the light source of the three vertices of the isosceles right-angled triangle with the largest right-angled edge is determined as the LED array The three switch states are the bright positioning LED.
需要说明的是,理想状态下,确定出的最大等腰直角三角形的直角边的取值应该为N*N的LED阵列的LED间距的N-1倍,因此该最大等腰直角三角形也可以称为理想等腰直角三角形,为便于描述,以下将直角边取值为N*N的LED阵列的LED间距的N-1倍的等腰直角三角形,简称为理想等腰直角三角形,但是,在实际中可能会有一些位置误差,确定出的最大等腰直角三角形的直角边可能不是LED间距的N-1倍,因此,为提高判断的准确性,本发明实施例中还提供了一种可能的实施方式,设置误差阈值,若确定出的等腰直角三角形的直角边的取值在LED间距的N-1倍的误差阈值范围内,则确定该等腰直角三角形的三个顶点的光源为LED阵列的三个开关状态为亮的定位LED。It should be noted that in an ideal state, the value of the right-angle side of the largest isosceles right-angled triangle should be N-1 times the LED pitch of the N * N LED array, so the largest isosceles right-angled triangle can also be called It is an ideal isosceles right-angled triangle. For ease of description, the following is a right-angled isosceles right-angled triangle with N-1 times the LED pitch of the N * N LED array, referred to as an ideal isosceles right-angled triangle, but in actual There may be some position errors, and the determined right-angle side of the largest isosceles right-angled triangle may not be N-1 times the LED spacing. Therefore, in order to improve the accuracy of judgment, a possible In an embodiment, an error threshold is set, and if the value of the right-angle side of the determined isosceles right-angled triangle is within the error threshold range of N-1 times the LED pitch, the light sources of the three vertices of the isosceles right-angled triangle are determined to be LEDs The three switch states of the array are bright positioning LEDs.
本发明实施例中,由于预先设置LED阵列的其中三个定位LED始终处于亮状态,因此,拍摄到的图像中的光源会包含这三个定位LED,根据定位LED位于边角,并且这三个定位LED可以构成最大的等腰直角三角形的特点,因此,本发明实施例中,可以通过寻 找最大等腰直角三角形的方法,来确定出三个处于亮状态的定位LED。In the embodiment of the present invention, since three of the positioning LEDs in the LED array are always on, the light source in the captured image will contain these three positioning LEDs, and the three positioning LEDs are located at the corners according to the positioning LEDs. The positioning LEDs can form the characteristic of the largest isosceles right-angled triangle. Therefore, in the embodiment of the present invention, three positioning LEDs in a bright state can be determined by searching for the largest isosceles right-angled triangle.
进一步地,在确定等腰直角三角形时,可以分为以下几种情况:Further, when determining an isosceles right triangle, it can be divided into the following situations:
第一种情况:只有一个理想等腰直角三角形。The first case: there is only one ideal isosceles right triangle.
参阅图4所示,为本发明实施例中第一种情况的定位LED的识别结果示意图,可知在确定等腰直角三角形中,可能会有多个等腰直角三角形,但直角边最大并且取值为LED间距的N-1倍的等腰直角三角形只有一个,即只有一个理想等腰直角三角形,例如,如图4所示,确定出3个等腰直角三角形,但其中只有一个理想等腰直角三角形。Referring to FIG. 4, it is a schematic diagram of the identification result of the positioning LED in the first case in the embodiment of the present invention. It can be seen that there may be multiple isosceles right-angle triangles in determining the isosceles right-angle triangle, but the right-angle side is the largest and takes values There is only one isosceles right-angled triangle that is N-1 times the LED pitch, that is, there is only one ideal isosceles right-angled triangle. For example, as shown in FIG. 4, three isosceles right-angled triangles are determined, but only one isosceles right-angled triangle triangle.
也就是说,在理想情况下,对于包含LED阵列的图像,是只有一个理想等腰直角三角形的,因此,在这种理想情况下,即使有噪声,但可能影响不太,可以只确定出一个理想等腰直角三角形。That is to say, in an ideal situation, there is only one ideal isosceles right-angled triangle for the image containing the LED array. Therefore, in this ideal situation, even if there is noise, it may not be affected very much. Only one can be determined Ideal isosceles right triangle.
从而可以确定该理想等腰直角三角形的三个顶点的光源为LED阵列的三个开关状态为亮的定位LED。Therefore, it can be determined that the light sources of the three vertices of the ideal isosceles right-angled triangle are the positioning LEDs whose three switch states of the LED array are bright.
第二种情况:至少有两个理想等腰直角三角形。The second case: at least two ideal isosceles right triangles.
参阅图5所示,为本发明实施例中第二种情况的定位LED的识别结果示意图,本发明实施例中,由于噪声的存在,可能会确定出多个理想等腰直角三角形,这种情况下,可能光源之间的最大距离会大于LED阵列的对角线取值,因此,需要识别出实际属于LED阵列的定位LED组成的理想等腰直角三角形,本发明实施例中提供了一种可能的实施方式,基于实际中ISC系统的工作情况,可以根据概率论的方法来确定实际属于LED阵列的理想等腰直角三角形,主要是通过比较各理想等腰直角三角形对应的定位LED组成的LED阵列区域中光源出现的概率,概率大的则为实际属于LED阵列的理想等腰直角三角形,例如,如图5所示,检测出两个理想等腰直角三角形,这两个理想等腰直角三角形对应的LED阵列中光源数量是不同的,而实际LED阵列中各LED排列有序且密集,工作时,实际属于LED阵列的理想等腰直角三角形应包括更多的光源,因此,将图5中对应LED阵列中光源数量更多的理想等腰直角三角形确定为实际属于LED阵列的理想等腰直角三角形。Referring to FIG. 5, it is a schematic diagram of the identification result of the positioning LED in the second case in the embodiment of the present invention. In the embodiment of the present invention, due to the presence of noise, multiple ideal isosceles right triangles may be determined. Next, the maximum distance between the light sources may be greater than the diagonal value of the LED array. Therefore, it is necessary to identify the ideal isosceles right triangle composed of the positioning LEDs that actually belong to the LED array. This embodiment of the present invention provides a possibility The implementation of the ISC system is based on the actual working conditions of the ISC system, and the ideal isosceles right triangle that actually belongs to the LED array can be determined according to the method of probability theory, mainly by comparing the LED array composed of the positioning LEDs corresponding to each ideal isosceles right triangle The probability of the light source appearing in the area, the probability is the ideal isosceles right triangle that actually belongs to the LED array. For example, as shown in Figure 5, two ideal isosceles right triangles are detected, and these two ideal isosceles right triangles correspond The number of light sources in the LED array is different, and the LEDs in the actual LED array are arranged in an orderly and dense manner. Over the isosceles right triangle to be LED array comprises more light sources, therefore, the LED array more number of light sources over the isosceles right triangle is determined as corresponding to the ideal isosceles right triangle actually belong to the LED array in FIG. 5.
具体为:若确定出至少两个直角边取值为预设的LED间距的N-1倍的等腰直角三角形,则分别统计至少两个等腰直角三角形对应组成的LED阵列区域中光源的数量,并将数量最多对应的等腰直角三角形的三个顶点的光源确定为LED阵列的三个开关状态为亮的定位LED。Specifically: if at least two right-angled isosceles right-angled triangles with a value of N-1 times the preset LED spacing are determined, the number of light sources in the LED array area corresponding to at least two isosceles right-angled triangles are respectively counted And determine the light sources of the three vertices of the isosceles right-angled triangle corresponding to the maximum number as the three LEDs of the LED array with the bright positioning LEDs.
第三种情况:可能存在直角边比理想等腰直角三角形更大的等腰直角三角形。The third case: there may be isosceles right-angled triangles with larger right-angled sides than ideal isosceles right-angled triangles.
参阅图6所示,为本发明实施例中第三种情况的定位LED的识别结果示意图,由于噪声的存在,可能也会出现直角边比理想等腰直角三角形更大的等腰直角三角形,即直角边取值大于LED间距的N-1倍,可能是噪声或干扰源造成的,通常不是LED阵列的理想等腰直角三角形,例如,如图6所示,确定出2个等腰直角三角形,其中,偏左上的等腰直 角三角形的斜边大于LED阵列的对角线的长度,而实际中确定该等腰直角三角形的确不属于LED阵列。Referring to FIG. 6, which is a schematic diagram of the recognition result of the positioning LED in the third case in the embodiment of the present invention, due to the presence of noise, an isosceles right-angled triangle with larger right-angle sides than an ideal isosceles right-angled triangle may also appear The value of the right-angle side is greater than N-1 times the LED spacing, which may be caused by noise or interference sources, and is usually not an ideal isosceles right-angled triangle for the LED array. For example, as shown in FIG. 6, two isosceles right-angled triangles are determined. Among them, the oblique side of the isosceles right-angled triangle on the upper left is larger than the length of the diagonal of the LED array, and in practice it is determined that the isosceles right-angled triangle does not belong to the LED array.
为避免这种情况出现,并提高后续确定理想等腰直角三角形的效率,本发明实施例中提供了一种可能的实施方式,在计算出各光源之间的距离后,进行距离从小到大排序时,只考虑不大于理想等腰直角三角形的斜边的距离取值,即距离取值不大于LED阵列的对角线的长度。In order to avoid this situation and improve the efficiency of subsequent determination of ideal isosceles right-angled triangles, an embodiment of the present invention provides a possible implementation manner, after calculating the distance between the light sources, sort the distance from small to large At this time, only consider the value of the distance not greater than the hypotenuse of the ideal isosceles right triangle, that is, the value of the distance is not greater than the length of the diagonal of the LED array.
具体地,进一步包括:筛选出不大于LED阵列预设的对角线取值的距离,并根据筛选出的距离,确定执行确定出能够构成直角边最大的等腰直角三角形的三个光源的步骤。Specifically, the method further includes: filtering out a distance not greater than a predetermined diagonal value of the LED array, and according to the filtered distance, determining and executing the step of determining three light sources capable of forming an isosceles right triangle with the largest right-angle side .
这样,根据寻找理想等腰直角三角形的方式,来确定定位LED,更加简单,运算速度快,效率高。In this way, according to the way of finding an ideal isosceles right triangle, it is easier to determine the positioning LED, the calculation speed is fast, and the efficiency is high.
最后,根据确定出的三个开关状态为亮的定位LED,确定出其余一个定位LED的位置。Finally, according to the determined positioning LEDs whose three switch states are bright, the positions of the remaining positioning LEDs are determined.
具体为,根据LED阵列均匀分布的特性,以及确定出的三个定位LED的位置,确定出其余一个定位LED的位置。Specifically, according to the characteristics of the uniform distribution of the LED array and the positions of the three determined positioning LEDs, the positions of the remaining one positioning LED are determined.
即由于四个定位LED可以构成四方形,因此,根据距离推算,可以确定最后其余一个定位LED的位置,并且该位置的定位LED处于灭的状态,图像中没有光源。That is, since the four positioning LEDs can form a square, the position of the last remaining positioning LED can be determined according to the distance calculation, and the positioning LED at the position is in an off state, and there is no light source in the image.
这样,本发明实施例中,可以根据各光源之间的距离,寻找最大等腰直角三角形,从而确定出LED阵列中的定位LED,例如,确定出的处于亮状态的定位LED,分别位于LED阵列的(1,1)、(1,n)和(n,1),处于灭状态的定位LED位于LED阵列的(n,n)。In this way, in the embodiment of the present invention, the largest isosceles right triangle can be found according to the distance between the light sources, so as to determine the positioning LEDs in the LED array, for example, the determined positioning LEDs in the bright state are respectively located in the LED array (1,1), (1, n) and (n, 1), the positioning LED in the off state is located in (n, n) of the LED array.
步骤230:确定定位LED的位置,并根据定位LED的位置,以及各光源的灰度值和位置,分别对各光源进行检测,确定LED阵列中各LED的开关状态,获得LED阵列的LED阵列信号。Step 230: Determine the position of the positioning LED, and detect each light source according to the position of the positioning LED, and the gray value and position of each light source, determine the switching state of each LED in the LED array, and obtain the LED array signal of the LED array .
执行步骤230时,具体包括:When step 230 is executed, it specifically includes:
首先,确定定位LED的位置。First, determine the location of the LED.
确定出LED阵列的四个定位LED后,就可以获知定位LED在图像中的位置。After the four positioning LEDs of the LED array are determined, the position of the positioning LEDs in the image can be known.
然后,根据定位LED的位置,以及各光源的灰度值和位置,分别对各光源进行检测,确定LED阵列中各LED的开关状态,获得LED阵列信号。Then, according to the position of the positioning LED, and the gray value and position of each light source, each light source is detected to determine the switching state of each LED in the LED array to obtain the LED array signal.
具体地,逐行遍历,分别依次对各光源进行检测,其中,以针对任意一个光源进行检测为例进行说明。Specifically, traversing line by line, each of the light sources is sequentially detected, wherein the detection of any one light source is taken as an example for description.
1)可以分为两个判断条件:1) It can be divided into two judgment conditions:
第一个判断条件:灰度值判断。The first judgment condition: gray value judgment.
具体为:判断任意一个光源的灰度值是否在预设的LED最小灰度值和最大灰度值区间范围内。Specifically, it is determined whether the gray value of any one light source is within the range of the preset minimum gray value and maximum gray value of the LED.
例如,hij为第一判断条件的判断结果,若确定灰度值在LED最小灰度值和最大灰度值区间范围内,则判断结果为1,否则判断结果为0,即:For example, hij is the judgment result of the first judgment condition. If the gray value is determined to be within the range of the minimum gray value and the maximum gray value of the LED, the judgment result is 1, otherwise the judgment result is 0, that is:
其中,thmax、thmin分别为LED的最大灰度值、最小灰度值,Sij是灰度图像中光源(i,j)的灰度值。Among them, thmax and thmin are respectively the maximum gray value and the minimum gray value of the LED, and Sij is the gray value of the light source (i, j) in the gray image.
第二个判断条件:根据确定出的任意一个定位LED的位置、预设的位置误差值和预设的LED间距,确定LED阵列中各LED的位置区间,判断任意一个光源的位置是否在对应的位置区间中。The second judgment condition: according to the determined position of any one positioning LED, the preset position error value and the preset LED spacing, determine the position interval of each LED in the LED array, and determine whether the position of any one light source is in the corresponding In the location interval.
例如,以取任意一个定位LED为位于(1,1)位置的定位LED,为例,pij为第二判断条件的判断结果,若确定计算出位置在对应的位置区间中,则判断结果为1,否则判断结果为0,即:For example, taking any positioning LED as the positioning LED at the (1,1) position, for example, pij is the judgment result of the second judgment condition, and if it is determined that the calculated position is in the corresponding position interval, the judgment result is 1 , Otherwise the judgment result is 0, namely:
其中,x_1、y_1是定位LED(1,1)的位置坐标,d是LED阵列间距,δ是位置误差值。Among them, x_1, y_1 are the position coordinates of the positioning LED (1,1), d is the LED array spacing, and δ is the position error value.
参阅图7所示,为本发明实施例中基于定位LED进行LED阵列信号解码的原理示意图,如图7所示,四个定位LED分别位于LED阵列的四个角,位置分别为(1,1)、(1,n)、(n,1)和(n,n),并且位于(1,1)、(1,n)、(n,1)位置的定位LED为亮状态,位于(n,n)位置的定位LED为灭状态,因此,根据灭状态的定位LED位置,以及灭状态的定位LED与其余亮状态的定位LED的位置相对关系,就可以很容易确定出位于(1,n)位置的定位LED,正常情况下,LED光源的位置应该在四个定位LED组成的区域中,并且LED阵列中各LED按照间距依次固定排列,从而就可以根据位于(1,n)位置的定位LED的坐标,以LED(1,n)为开始点,先从(1,n)到(1,1)解码,然后依次逐行解码,依次判断各光源的位置是否符合实际中其在LED阵列的位置关系,来判断其是否为LED光源。Referring to FIG. 7, it is a schematic diagram of the principle of decoding LED array signals based on positioning LEDs in an embodiment of the present invention. As shown in FIG. 7, the four positioning LEDs are located at four corners of the LED array at positions (1, 1 ), (1, n), (n, 1) and (n, n), and the positioning LEDs at the (1,1), (1, n), (n, 1) positions are on and located at (n , N) The positioning LED in the off state is off. Therefore, according to the position of the off-positioning LED and the relative relationship between the off-positioning LED and the rest of the on-positioning LEDs, you can easily determine the location of (1, n ) Positioning LEDs, under normal circumstances, the position of the LED light source should be in the area composed of four positioning LEDs, and the LEDs in the LED array are fixedly arranged in sequence according to the spacing, so that they can be positioned according to the (1, n) position The coordinates of the LED, with LED (1, n) as the starting point, are decoded from (1, n) to (1,1) first, and then decoded line by line to determine whether the position of each light source is in line with the actual LED array. To determine whether it is an LED light source.
2)若判断均为是,则确定该任意一个光源对应的LED开关状态为亮,解码为1,否则,确定该任意一个光源对应的LED开关状态为灭,解码为0。2) If the judgments are both yes, determine that the LED switch corresponding to any one light source is on and decode to 1, otherwise, determine that the LED switch corresponding to any one light source is off and decode to 0.
即对LED阵列进行检测解码时,有两个判断条件,只有同时满足hij和pij都为1时,该位置对应的LED才能解码为1,否则解码为0。That is, when the LED array is detected and decoded, there are two judgment conditions. Only when both hij and pij are 1 at the same time, the LED corresponding to the position can be decoded to 1, otherwise it is decoded to 0.
本发明实施例中,根据预设阈值,对图像进行二值化处理后,获取各光源的灰度值,并分别判断各光源的类型,即判断是否为LED还是干扰源,若是LED光源,则该光源位置对应的LED为亮状态,解码为1,若是干扰源,例如可能是周围光源干扰或重叠造成的光源,则该光源位置对应的LED为灭状态,解码为0。In the embodiment of the present invention, after the image is binarized according to a preset threshold, the gray value of each light source is obtained, and the type of each light source is judged separately, that is, whether it is an LED or an interference source. If it is an LED light source, then The LED corresponding to the light source position is in a bright state and decoded as 1. If it is an interference source, for example, a light source caused by interference or overlap of surrounding light sources, the LED corresponding to the light source position is in an off state and decoded as 0.
这样,就可以依次解码出LED阵列中各LED对应码值,根据顺序就可以检测出LED 阵列信号,即输入的二进制序列信号。In this way, the corresponding code value of each LED in the LED array can be decoded in sequence, and the LED array signal, that is, the input binary sequence signal can be detected according to the order.
进一步地,若LED阵列按照正常角度摆放,则通常从左上角第一位开始,按照从左到右、从上到下的顺序依次携带信号的比特,但可能LED阵列会发生旋转,可能捕获的包含LED图片有一定角度的旋转,因此需要能够正确找到信号序列的起始位置,本发明实施例中,定义LED阵列的定位LED,并设计四个定位LED三亮一灭,由于处于亮状态的定位LED和处于灭状态的定位LED在LED阵列的位置也是预先设置好的,因此,本发明实施例中,还可以将处于灭状态的定位LED作为参考定位LED,根据定位LED之间的相互位置关系,从而可以检测LED阵列是否发生旋转,确定旋转角度,校正LED阵列的位置,将其旋转到正确的角度,并可以确定出信号序列的起始位置,从而在解码过程中能够按照预定的LED阵列中信号比特顺序进行解码,获得正确的LED阵列信号。Further, if the LED array is placed at a normal angle, it usually starts from the first bit in the upper left corner and carries the signal bits in order from left to right and from top to bottom, but the LED array may rotate and may be captured The picture containing the LED has a certain angle of rotation, so it is necessary to be able to correctly find the starting position of the signal sequence. In the embodiment of the present invention, the positioning LED of the LED array is defined, and the four positioning LEDs are designed to turn on and off three times. The position of the positioning LED and the positioning LED in the off state in the LED array are also preset. Therefore, in the embodiment of the present invention, the positioning LED in the off state can also be used as a reference positioning LED, according to the mutual position between the positioning LEDs Relationship, which can detect whether the LED array rotates, determine the rotation angle, correct the position of the LED array, rotate it to the correct angle, and can determine the starting position of the signal sequence, so that it can follow the predetermined LED during the decoding process The signal bits in the array are decoded sequentially to obtain the correct LED array signal.
本发明实施例中,定义LED阵列中位于四个角位置的LED为定位LED,并预先设置四个定位LED的开关状态为其中三个定位LED为亮,其余一个定位LED为灭,获取包含LED阵列的图像,采用连通区域标记算法,从图像中检测出各光源,并根据各光源的位置和相互之间的距离,确定出定位LED,从而根据定位LED的位置,以及各光源的灰度值和位置,分别对各光源进行检测,确定LED阵列中各LED的开关状态,获得LED阵列信号,这样,可以根据LED阵列中定位LED的设计,准确从图像中识别出定位LED,从而检测出LED阵列信号,运算速度快,不仅可以从背景光中快速检测LED阵列信号,还可以应用于室内定位。In the embodiment of the present invention, the LEDs at the four corner positions in the LED array are defined as positioning LEDs, and the switching state of the four positioning LEDs is preset as three of the positioning LEDs are on, and the remaining one of the positioning LEDs is off. The image of the array uses the connected area labeling algorithm to detect each light source from the image, and determines the positioning LED according to the position of each light source and the distance between each other, so that according to the position of the positioning LED and the gray value of each light source And position, detect each light source separately, determine the switching status of each LED in the LED array, and obtain the LED array signal, so that the positioning LED can be accurately identified from the image according to the design of the positioning LED in the LED array, thereby detecting the LED Array signals, with fast calculation speed, can not only quickly detect LED array signals from the background light, but also be used in indoor positioning.
并且,本发明实施例中,还可以确定LED阵列的方向,适用于LED阵列发生旋转的情况,可以对LED阵列进行位置校正,准确检测LED阵列信号。In addition, in the embodiment of the present invention, the direction of the LED array can also be determined, which is suitable for the rotation of the LED array, and the position of the LED array can be corrected to accurately detect the LED array signal.
基于上述实施例,参阅图8所示,为本发明实施例中,LED阵列信号检测装置结构示意图,其中,LED阵列包括N*N个LED,其中N大于等于3,并定义所述LED阵列中位于四个角位置的LED为定位LED,预先设置四个定位LED的开关状态为其中三个定位LED为亮,其余一个定位LED为灭,该装置具体包括:Based on the above embodiment, referring to FIG. 8, which is a schematic structural diagram of an LED array signal detection device according to an embodiment of the present invention, wherein the LED array includes N * N LEDs, where N is greater than or equal to 3, and defines the LED array The LEDs located at the four corners are positioning LEDs. The switching status of the four positioning LEDs is preset, three of which are on, and the other one is off. The device specifically includes:
获取模块80,用于获取包含所述LED阵列的图像;The obtaining module 80 is used to obtain an image containing the LED array;
检测模块81,用于采用连通区域标记算法,从所述图像中检测出各光源;The detection module 81 is used to detect each light source from the image by using a connected area labeling algorithm;
第一确定模块82,用于确定检测出的各光源的位置,并根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED;The first determining module 82 is used to determine the positions of the detected light sources, and determine the positioning LEDs of the LED array from the image according to the positions of the light sources and the switch states of the four preset positioning LEDs;
第二确定模块83,用于确定定位LED的位置,并根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号。The second determining module 83 is used to determine the position of the positioning LED, and respectively detect the light sources according to the position of the positioning LED, and the gray value and position of each light source, and determine the switch of each LED in the LED array State, the LED array signal of the LED array is obtained.
可选的,根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED时,所述第一确定模块82具体用于:Optionally, when determining the positioning LEDs of the LED array from the image according to the position of each light source and the switch states of the four preset positioning LEDs, the first determining module 82 is specifically configured to:
根据各光源的位置,分别依次计算任意两个光源之间的距离;According to the position of each light source, calculate the distance between any two light sources in turn;
根据计算出的任意两个光源之间的距离,确定出能够构成直角边最大的等腰直角三角形的三个光源;According to the calculated distance between any two light sources, determine the three light sources that can form an isosceles right triangle with the largest right-angle side;
若确定出的等腰直角三角形的直角边取值为所述LED阵列预设的LED间距的N-1倍,则确定所述直角边最大的等腰直角三角形的三个顶点的光源,为所述LED阵列的三个开关状态为亮的定位LED;If the determined right-angle side of the isosceles right-angled triangle is N-1 times the preset LED spacing of the LED array, the light sources of the three vertices of the isosceles right-angled triangle with the largest right-angled side are determined as The three switch states of the LED array are bright positioning LEDs;
根据确定出的三个开关状态为亮的定位LED,确定出其余一个定位LED的位置。According to the determined positioning LEDs whose three switch states are bright, the positions of the remaining positioning LEDs are determined.
可选的,所述第一确定模块82进一步用于:若确定出至少两个直角边取值为所述预设的LED间距的N-1倍的等腰直角三角形,则分别统计至少两个等腰直角三角形对应组成的LED阵列区域中光源的数量,并将数量最多对应的等腰直角三角形的三个顶点的光源确定为所述LED阵列的三个开关状态为亮的定位LED。Optionally, the first determining module 82 is further configured to: if it is determined that at least two right-angled sides have an isosceles right-angled triangle with a value of N-1 times the predetermined LED interval, then at least two are counted respectively The isosceles right-angled triangle corresponds to the number of light sources in the LED array region formed, and the light sources at the three vertices of the isosceles right-angled triangle corresponding to the maximum number are determined to be the positioning LEDs whose three switch states of the LED array are bright.
可选的,所述第一确定模块82进一步用于:筛选出不大于所述LED阵列预设的对角线取值的距离,并根据筛选出的距离,确定执行确定出能够构成直角边最大的等腰直角三角形的三个光源的步骤。Optionally, the first determining module 82 is further configured to: filter out a distance not greater than a predetermined diagonal value of the LED array, and determine and execute to determine that the largest right-angle side can be formed according to the filtered distance Steps of three light sources of an isosceles right triangle.
可选的,根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号时,所述第二确定模块83具体用于:Optionally, according to the position of the positioning LED, and the gray value and position of each light source, each light source is detected to determine the switching state of each LED in the LED array to obtain the LED array signal of the LED array At this time, the second determining module 83 is specifically used to:
分别对所述各光源进行检测,确定所述各光源对应的LED的开关状态,并根据各LED的开关状态,获得所述LED阵列的LED阵列信号;Respectively detecting the light sources, determining the switching state of the LEDs corresponding to the light sources, and obtaining the LED array signal of the LED array according to the switching state of the LEDs;
其中,针对所述各光源中任意一个光源进行检测时,具体包括:Wherein, when detecting any one of the light sources, specifically include:
判断所述任意一个光源的灰度值是否在预设的LED最小灰度值和最大灰度值区间范围内,以及根据确定出的任意一个定位LED的位置、预设的位置误差值和预设的LED间距,确定所述LED阵列中各LED的位置区间,判断所述任意一个光源的位置是否在对应的位置区间中;Determine whether the gray value of any one light source is within the range of the preset minimum gray value and maximum gray value of the LED, and according to the determined position of any one positioning LED, the preset position error value and the preset LED spacing, determine the position interval of each LED in the LED array, and determine whether the position of any one light source is in the corresponding position interval;
若判断均为是,则确定所述任意一个光源对应的LED的开关状态为亮,解码为1,否则,确定所述任意一个光源对应的LED的开关状态为灭,解码为0。If the judgment is YES, it is determined that the switch state of the LED corresponding to any one light source is on and decoded as 1, otherwise, the switch state of the LED corresponding to any one of the light sources is determined to be off and decoded as 0.
参阅图9所示,本发明实施例中,一种计算机装置结构示意图。Referring to FIG. 9, in an embodiment of the present invention, a schematic structural diagram of a computer device.
本发明实施例提供了一种计算机装置,该服务器可以包括处理器910(Center Processing Unit,CPU)、存储器920、输入设备930和输出设备940等,输入设备930可以包括键盘、鼠标、触摸屏等,输出设备940可以包括显示设备,如液晶显示器(Liquid Crystal Display,LCD)、阴极射线管(Cathode Ray Tube,CRT)等。An embodiment of the present invention provides a computer apparatus. The server may include a processor 910 (Center Processing Unit, CPU), a memory 920, an input device 930, an output device 940, etc. The input device 930 may include a keyboard, a mouse, a touch screen, etc. The output device 940 may include a display device, such as a liquid crystal display (Liquid Crystal Display, LCD), a cathode ray tube (Cathode Ray Tube, CRT), and the like.
存储器920可以包括只读存储器(ROM)和随机存取存储器(RAM),并向处理器910提供存储器920中存储的程序指令和数据。在本发明实施例中,存储器920可以用于存储 上述LED阵列信号检测方法的程序。The memory 920 may include a read-only memory (ROM) and a random access memory (RAM), and provide the processor 910 with program instructions and data stored in the memory 920. In the embodiment of the present invention, the memory 920 may be used to store the program of the LED array signal detection method described above.
处理器910通过调用存储器920存储的程序指令,处理器910用于按照获得的程序指令执行本发明实施例中任一种LED阵列信号检测方法。The processor 910 calls the program instructions stored in the memory 920, and the processor 910 is used to execute any LED array signal detection method in the embodiment of the present invention according to the obtained program instructions.
基于上述实施例,本发明实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任意方法实施例中的LED阵列信号检测方法。Based on the above embodiments, in an embodiment of the present invention, there is provided a computer readable storage medium on which a computer program is stored, and the computer program is executed by a processor to implement the LED array signal detection method in any of the above method embodiments .
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram and a combination of the flow and / or block in the flowchart and / or block diagram may be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processing machine, or other programmable data processing device to produce a machine that enables the generation of instructions executed by the processor of the computer or other programmable data processing device A device for realizing the functions specified in one block or multiple blocks of one flow or multiple blocks of a flowchart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instructions The device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and / or block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device The instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and / or block diagrams.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. In this way, if these modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and equivalent technologies thereof, the present invention is also intended to include these modifications and variations.

Claims (10)

  1. 一种发光二极管LED阵列信号检测方法,其特征在于,LED阵列包括N*N个LED,其中N大于等于3,并定义所述LED阵列中位于四个角位置的LED为定位LED,预先设置四个定位LED的开关状态为其中三个定位LED为亮,其余一个定位LED为灭,所述方法包括:A light-emitting diode LED array signal detection method, characterized in that the LED array includes N * N LEDs, where N is greater than or equal to 3, and the LEDs at four corner positions in the LED array are defined as positioning LEDs. The switching status of the positioning LEDs is that three of the positioning LEDs are on and the remaining one is off. The method includes:
    获取包含所述LED阵列的图像;Obtaining an image containing the LED array;
    采用连通区域标记算法,从所述图像中检测出各光源;A connected area labeling algorithm is used to detect each light source from the image;
    确定检测出的各光源的位置,并根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED;Determine the positions of the detected light sources, and determine the positioning LEDs of the LED array from the image according to the positions of the light sources and the switch states of the four preset positioning LEDs;
    确定定位LED的位置,并根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号。Determine the position of the positioning LED, and detect each light source according to the position of the positioning LED, and the gray value and position of each light source, determine the switching state of each LED in the LED array, and obtain the LED array LED array signal.
  2. 如权利要求1所述的方法,其特征在于,根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED,具体包括:The method of claim 1, wherein determining the positioning LED of the LED array from the image according to the position of each light source and the switch state of the four preset positioning LEDs specifically includes:
    根据各光源的位置,分别依次计算任意两个光源之间的距离;According to the position of each light source, calculate the distance between any two light sources in turn;
    根据计算出的任意两个光源之间的距离,确定出能够构成直角边最大的等腰直角三角形的三个光源;According to the calculated distance between any two light sources, determine the three light sources that can form an isosceles right triangle with the largest right-angle side;
    若确定出的等腰直角三角形的直角边取值为所述LED阵列预设的LED间距的N-1倍,则确定所述直角边最大的等腰直角三角形的三个顶点的光源,为所述LED阵列的三个开关状态为亮的定位LED;If the determined right-angle side of the isosceles right-angled triangle is N-1 times the preset LED spacing of the LED array, the light sources of the three vertices of the isosceles right-angled triangle with the largest right-angled side are determined as The three switch states of the LED array are bright positioning LEDs;
    根据确定出的三个开关状态为亮的定位LED,确定出其余一个定位LED的位置。According to the determined positioning LEDs whose three switch states are bright, the positions of the remaining positioning LEDs are determined.
  3. 如权利要求2所述的方法,其特征在于,进一步包括:The method of claim 2, further comprising:
    若确定出至少两个直角边取值为所述预设的LED间距的N-1倍的等腰直角三角形,则分别统计至少两个等腰直角三角形对应组成的LED阵列区域中光源的数量,并将数量最多对应的等腰直角三角形的三个顶点的光源确定为所述LED阵列的三个开关状态为亮的定位LED。If it is determined that at least two right-angled sides have an isosceles right-angled triangle with a value of N-1 times the predetermined LED interval, then the number of light sources in the LED array area corresponding to at least two isosceles right-angled triangles is counted, And the light sources at the three vertices of the isosceles right-angled triangle corresponding to the maximum number are determined as the three positioning LEDs of the LED array with the bright switching state.
  4. 如权利要求2所述的方法,其特征在于,进一步包括:The method of claim 2, further comprising:
    筛选出不大于所述LED阵列预设的对角线取值的距离,并根据筛选出的距离,确定执行确定出能够构成直角边最大的等腰直角三角形的三个光源的步骤。A distance no greater than a predetermined diagonal value of the LED array is selected, and according to the selected distance, the step of determining three light sources that can form an isosceles right triangle with the largest right-angle side is determined and executed.
  5. 如权利要求1-4任一项所述的方法,其特征在于,根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号,具体包括:The method according to any one of claims 1 to 4, characterized in that, according to the position of the positioning LED, and the gray value and position of each light source, each light source is detected to determine each of the LED arrays The switching state of the LED to obtain the LED array signal of the LED array specifically includes:
    分别对所述各光源进行检测,确定所述各光源对应的LED的开关状态,并根据各LED 的开关状态,获得所述LED阵列的LED阵列信号;Separately detecting the light sources, determining the switching state of the LEDs corresponding to the light sources, and obtaining the LED array signal of the LED array according to the switching state of the LEDs;
    其中,针对所述各光源中任意一个光源进行检测时,具体包括:Wherein, when detecting any one of the light sources, specifically include:
    判断所述任意一个光源的灰度值是否在预设的LED最小灰度值和最大灰度值区间范围内,以及根据确定出的任意一个定位LED的位置、预设的位置误差值和预设的LED间距,确定所述LED阵列中各LED的位置区间,判断所述任意一个光源的位置是否在对应的位置区间中;Determine whether the gray value of any one light source is within the range of the preset minimum gray value and maximum gray value of the LED, and according to the determined position of any one positioning LED, the preset position error value and the preset LED spacing, determine the position interval of each LED in the LED array, and determine whether the position of any one light source is in the corresponding position interval;
    若判断均为是,则确定所述任意一个光源对应的LED的开关状态为亮,解码为1,否则,确定所述任意一个光源对应的LED的开关状态为灭,解码为0。If the judgment is YES, it is determined that the switch state of the LED corresponding to any one light source is on and decoded as 1, otherwise, the switch state of the LED corresponding to any one of the light sources is determined to be off and decoded as 0.
  6. 一种发光二极管LED阵列信号检测装置,其特征在于,LED阵列包括N*N个LED,其中N大于等于3,并定义所述LED阵列中位于四个角位置的LED为定位LED,预先设置四个定位LED的开关状态为其中三个定位LED为亮,其余一个定位LED为灭,所述装置包括:A light-emitting diode LED array signal detection device, characterized in that the LED array includes N * N LEDs, where N is greater than or equal to 3, and the LEDs at four corner positions in the LED array are defined as positioning LEDs, and four are preset The switch status of the positioning LEDs is that three of the positioning LEDs are on and the remaining one is off. The device includes:
    获取模块,用于获取包含所述LED阵列的图像;An acquisition module for acquiring an image containing the LED array;
    检测模块,用于采用连通区域标记算法,从所述图像中检测出各光源;The detection module is used to detect each light source from the image by using a connected area labeling algorithm;
    第一确定模块,用于确定检测出的各光源的位置,并根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED;A first determining module, configured to determine the positions of the detected light sources, and determine the positioning LEDs of the LED array from the image according to the positions of the light sources and the switch states of the four preset positioning LEDs;
    第二确定模块,用于确定定位LED的位置,并根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号。The second determination module is used to determine the position of the positioning LED, and respectively detect the light sources according to the position of the positioning LED, and the gray value and position of each light source, and determine the switching state of each LED in the LED array To obtain the LED array signal of the LED array.
  7. 如权利要求6所述的装置,其特征在于,根据各光源的位置和预先设置的四个定位LED的开关状态,从所述图像中确定所述LED阵列的定位LED时,所述第一确定模块具体用于:The device according to claim 6, characterized in that, when the positioning LEDs of the LED array are determined from the image according to the position of each light source and the switch state of four preset positioning LEDs, the first determination The module is specifically used for:
    根据各光源的位置,分别依次计算任意两个光源之间的距离;According to the position of each light source, calculate the distance between any two light sources in turn;
    根据计算出的任意两个光源之间的距离,确定出能够构成直角边最大的等腰直角三角形的三个光源;According to the calculated distance between any two light sources, determine the three light sources that can form an isosceles right triangle with the largest right-angle side;
    若确定出的等腰直角三角形的直角边取值为所述LED阵列预设的LED间距的N-1倍,则确定所述直角边最大的等腰直角三角形的三个顶点的光源,为所述LED阵列的三个开关状态为亮的定位LED;If the determined right-angle side of the isosceles right-angled triangle is N-1 times the preset LED spacing of the LED array, the light sources of the three vertices of the isosceles right-angled triangle with the largest right-angled side are determined as The three switch states of the LED array are bright positioning LEDs;
    根据确定出的三个开关状态为亮的定位LED,确定出其余一个定位LED的位置。According to the determined positioning LEDs whose three switch states are bright, the positions of the remaining positioning LEDs are determined.
  8. 如权利要求7所述的装置,其特征在于,所述第一确定模块进一步用于:The apparatus of claim 7, wherein the first determining module is further used to:
    若确定出至少两个直角边取值为所述预设的LED间距的N-1倍的等腰直角三角形,则分别统计至少两个等腰直角三角形对应组成的LED阵列区域中光源的数量,并将数量最多对应的等腰直角三角形的三个顶点的光源确定为所述LED阵列的三个开关状态为亮的 定位LED。If it is determined that at least two right-angled sides have an isosceles right-angled triangle with a value of N-1 times the predetermined LED interval, then the number of light sources in the LED array area corresponding to at least two isosceles right-angled triangles is counted, And the light sources at the three vertices of the isosceles right-angled triangle corresponding to the maximum number are determined as the three positioning LEDs of the LED array with the bright switching state.
  9. 如权利要求7所述的装置,其特征在于,所述第一确定模块进一步用于:The apparatus of claim 7, wherein the first determining module is further used to:
    筛选出不大于所述LED阵列预设的对角线取值的距离,并根据筛选出的距离,确定执行确定出能够构成直角边最大的等腰直角三角形的三个光源的步骤。A distance no greater than a predetermined diagonal value of the LED array is selected, and according to the selected distance, the step of determining three light sources that can form an isosceles right triangle with the largest right-angle side is determined and executed.
  10. 如权利要求6-9任一项所述的装置,其特征在于,根据定位LED的位置,以及各光源的灰度值和位置,分别对所述各光源进行检测,确定所述LED阵列中各LED的开关状态,获得所述LED阵列的LED阵列信号时,所述第二确定模块具体用于:The device according to any one of claims 6-9, characterized in that each light source is separately detected according to the position of the positioning LED and the gray value and position of each light source to determine each of the LED arrays In the switch state of the LED, when the LED array signal of the LED array is obtained, the second determining module is specifically used to:
    分别对所述各光源进行检测,确定所述各光源对应的LED的开关状态,并根据各LED的开关状态,获得所述LED阵列的LED阵列信号;Respectively detecting the light sources, determining the switching state of the LEDs corresponding to the light sources, and obtaining the LED array signal of the LED array according to the switching state of the LEDs;
    其中,针对所述各光源中任意一个光源进行检测时,具体包括:Wherein, when detecting any one of the light sources, specifically include:
    判断所述任意一个光源的灰度值是否在预设的LED最小灰度值和最大灰度值区间范围内,以及根据确定出的任意一个定位LED的位置、预设的位置误差值和预设的LED间距,确定所述LED阵列中各LED的位置区间,判断所述任意一个光源的位置是否在对应的位置区间中;Determine whether the gray value of any one light source is within the range of the preset minimum gray value and maximum gray value of the LED, and according to the determined position of any one positioning LED, the preset position error value and the preset LED spacing, determine the position interval of each LED in the LED array, and determine whether the position of any one light source is in the corresponding position interval;
    若判断均为是,则确定所述任意一个光源对应的LED的开关状态为亮,解码为1,否则,确定所述任意一个光源对应的LED的开关状态为灭,解码为0。If the judgment is YES, it is determined that the switch state of the LED corresponding to any one light source is on and decoded as 1, otherwise, the switch state of the LED corresponding to any one of the light sources is determined to be off and decoded as 0.
PCT/CN2018/110348 2018-10-16 2018-10-16 Led array signal detection method, and device WO2020077516A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/110348 WO2020077516A1 (en) 2018-10-16 2018-10-16 Led array signal detection method, and device
JP2021546407A JP7182722B2 (en) 2018-10-16 2018-10-16 Method and apparatus for detecting LED array signals

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/110348 WO2020077516A1 (en) 2018-10-16 2018-10-16 Led array signal detection method, and device

Publications (1)

Publication Number Publication Date
WO2020077516A1 true WO2020077516A1 (en) 2020-04-23

Family

ID=70282879

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/110348 WO2020077516A1 (en) 2018-10-16 2018-10-16 Led array signal detection method, and device

Country Status (2)

Country Link
JP (1) JP7182722B2 (en)
WO (1) WO2020077516A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009088704A (en) * 2007-09-27 2009-04-23 Toyota Central R&D Labs Inc Optical transmitting device, optical receiving device, and optical communication system
CN103795467A (en) * 2013-11-05 2014-05-14 深圳光启创新技术有限公司 Method and apparatus for identifying visible light communication signal received by camera
CN108155941A (en) * 2017-11-29 2018-06-12 东南大学 A kind of visible ray I-MIMO system signals identification and merging method
CN108288289A (en) * 2018-03-07 2018-07-17 华南理工大学 A kind of LED visible detection methods and its system for visible light-seeking
CN108428228A (en) * 2018-03-05 2018-08-21 深圳市奥拓电子股份有限公司 LED light intelligent detecting method, detecting system and storage medium
CN108462534A (en) * 2018-03-07 2018-08-28 华南理工大学 A kind of signal for visible light communication inverts visual pursuit method and its system
CN108631832A (en) * 2018-05-14 2018-10-09 中山大学 In conjunction with the multiuser MIMO-OOFDM visible light communication methods of index modulation
CN109461182A (en) * 2018-09-05 2019-03-12 华北电力大学扬中智能电气研究中心 A kind of LED array rapid detection method and device based on imaging sensor communication

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102017466A (en) 2008-05-07 2011-04-13 惠普开发有限公司 Arrays, system and method for bi-directional data transmission
CN104253646B (en) 2013-06-26 2018-11-06 中兴通讯股份有限公司 A kind of visible light communication mimo system and its method for realizing data transmit-receive
JP2017091140A (en) 2015-11-09 2017-05-25 三星電子株式会社Samsung Electronics Co.,Ltd. Code transmission/reception system, code receiver, code transmitter, code reception method, code transmission method, and program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009088704A (en) * 2007-09-27 2009-04-23 Toyota Central R&D Labs Inc Optical transmitting device, optical receiving device, and optical communication system
CN103795467A (en) * 2013-11-05 2014-05-14 深圳光启创新技术有限公司 Method and apparatus for identifying visible light communication signal received by camera
CN108155941A (en) * 2017-11-29 2018-06-12 东南大学 A kind of visible ray I-MIMO system signals identification and merging method
CN108428228A (en) * 2018-03-05 2018-08-21 深圳市奥拓电子股份有限公司 LED light intelligent detecting method, detecting system and storage medium
CN108288289A (en) * 2018-03-07 2018-07-17 华南理工大学 A kind of LED visible detection methods and its system for visible light-seeking
CN108462534A (en) * 2018-03-07 2018-08-28 华南理工大学 A kind of signal for visible light communication inverts visual pursuit method and its system
CN108631832A (en) * 2018-05-14 2018-10-09 中山大学 In conjunction with the multiuser MIMO-OOFDM visible light communication methods of index modulation
CN109461182A (en) * 2018-09-05 2019-03-12 华北电力大学扬中智能电气研究中心 A kind of LED array rapid detection method and device based on imaging sensor communication

Also Published As

Publication number Publication date
JP7182722B2 (en) 2022-12-02
JP2022508842A (en) 2022-01-19

Similar Documents

Publication Publication Date Title
TWI532331B (en) Transmitting and receiving apparatus and method for light communication, and the light communication system and method thereof
US10223801B2 (en) Code domain power control for structured light
CN107255524B (en) Method for detecting frequency of LED light source based on mobile equipment camera
US20210392261A1 (en) Flicker mitigation via image signal processing
CN102096802B (en) Face detection method and device
CN108288289B (en) LED visual detection method and system for visible light positioning
CN113538491A (en) Edge identification method, system and storage medium based on self-adaptive threshold
US10049454B2 (en) Active triangulation calibration
US20180006724A1 (en) Multi-transmitter vlc positioning system for rolling-shutter receivers
CN109816738B (en) Stripe boundary extraction method based on coded structured light
CN113496133A (en) Two-dimensional code identification method and device, electronic equipment and storage medium
US20120140084A1 (en) System and method for marking discrepancies in image of object
CN109461182A (en) A kind of LED array rapid detection method and device based on imaging sensor communication
WO2020077516A1 (en) Led array signal detection method, and device
WO2022016838A1 (en) Positioning method and device based on visual tag
WO2022021687A1 (en) Method for positioning quick response code area, and electronic device and storage medium
WO2018095147A1 (en) Method and device for labeling location of light point
CN111062228A (en) LED array signal detection method and device
KR102568759B1 (en) Apparatus and method for 2d color code optical wireless communication considering signal circumstances
Fiala Artag fiducial marker system applied to vision based spacecraft docking
CN104268536A (en) Face detection method through images
Johnson et al. Robot localization using overhead camera and leds
KR102324903B1 (en) Method and apparatus for processing image based on optical communication and computer readable recording medium with program therefor
CN115296738B (en) Deep learning-based unmanned aerial vehicle visible light camera communication method and system
Zachár et al. Long distance vlc-based beaconing for indoor localization applications

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18937459

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021546407

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18937459

Country of ref document: EP

Kind code of ref document: A1