CN112751612A - Method and device for transmitting data to mobile terminal by using three-color LED - Google Patents

Method and device for transmitting data to mobile terminal by using three-color LED Download PDF

Info

Publication number
CN112751612A
CN112751612A CN202011609650.8A CN202011609650A CN112751612A CN 112751612 A CN112751612 A CN 112751612A CN 202011609650 A CN202011609650 A CN 202011609650A CN 112751612 A CN112751612 A CN 112751612A
Authority
CN
China
Prior art keywords
led
data
color
image
frame
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202011609650.8A
Other languages
Chinese (zh)
Other versions
CN112751612B (en
Inventor
曹林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Jianwei Jingdian Technology Co Ltd
Original Assignee
Chengdu Jianwei Jingdian Technology Co Ltd
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 Chengdu Jianwei Jingdian Technology Co Ltd filed Critical Chengdu Jianwei Jingdian Technology Co Ltd
Priority to CN202011609650.8A priority Critical patent/CN112751612B/en
Publication of CN112751612A publication Critical patent/CN112751612A/en
Application granted granted Critical
Publication of CN112751612B publication Critical patent/CN112751612B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/11Arrangements specific to free-space transmission, i.e. transmission through air or vacuum
    • H04B10/114Indoor or close-range type systems
    • H04B10/116Visible light communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/22Adaptations for optical transmission
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/20Controlling the colour of the light
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/30Driver circuits

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Control Of El Displays (AREA)
  • Optical Communication System (AREA)

Abstract

The invention discloses a method and a device for transmitting data to a mobile terminal by using a three-color LED. According to 8 light-emitting states of the three-color LED, the all-off state is used as a data transmission indicating state or background indication, and light-emitting colors formed by the rest 7 light-emitting states are expressed in a 7-system mode. The invention takes the three-color LED full-off state as the data transmission indicating state or background indication, and takes the full-off state as the synchronous signal, thereby avoiding the error code generated by the step-out of the collected data; within one period, valid data can be transmitted twice synchronously. The invention has the advantages of low power consumption of the sending end, higher transmission bit rate, large information capacity, small volume and low cost.

Description

Method and device for transmitting data to mobile terminal by using three-color LED
Technical Field
The invention relates to the technical field of wireless transmission, in particular to a method and a device for transmitting data to a mobile terminal by using a three-color LED.
Background
At present, methods for transmitting data from an object to a mobile phone are various, such as WIFI, bluetooth, NFC, two-dimensional codes, one-dimensional codes and the like. WIFI and Bluetooth are strong in interactivity and high in power consumption, and data transmission of ultra-low power consumption equipment is not facilitated. NFC has low power consumption, but not all mobile phones have an information reading function of NFC. The reading of the one-dimensional code and the two-dimensional code can even be realized without power, but only limited to printed objects, if the real-time variable information state is expressed, the dot matrix display units such as LCD and OLED can be used, and the power consumption is not as low.
Patent document CN103957056B discloses a visible light communication system compatible with a smart phone, which includes a partial information selection module, a partial information encoder, a complete information encoder, a visible light communication modulator, an LED array, a special receiving device, and a smart phone, wherein: the LED array is used for driving each LED in the array by utilizing the driving signal output by the visible light communication modulator so as to output a visible light signal; the special receiving equipment is used for collecting images containing complete LED arrays at a high speed, extracting high-speed code word sequences corresponding to all LEDs in the LED arrays from the images, and finally obtaining estimated values of all information after decoding; the smart phone is used for acquiring images containing a complete LED array at a low speed, extracting a code word sequence at the low speed corresponding to each LED in the LED array from the images, and finally obtaining an estimated value of partial information after decoding. The visible light communication system compatible with the smart phone can utilize the smart phone or special receiving equipment with a high-speed camera as receiving equipment, the application range of MIMO (multiple input multiple output) visible light communication is expanded, and meanwhile, when the special receiving equipment is used, diversity reception of partial transmitted information can be realized, so that the error probability of partial transmitted information transmission is reduced.
Patent document CN109784119A discloses an optical code generating device, a decoding device, an encoding and decoding method and a system, wherein:
the optical code generation device includes: a light emitting lamp group; the light homogenizing piece is arranged in the light emitting direction of the light emitting lamp group; the encoder is connected with the light-emitting lamp group and used for receiving the pulse signals, compiling the pulse signals according to a preset encoding rule and generating control signals so as to control the light-emitting lamp group to form an optical code image on the light-equalizing piece according to the control signals, so that when an image acquisition device with a roller shutter exposure function receives the optical code image, the pulse signals are obtained through optical code image analysis; wherein the optical code image comprises a time-domain sequential identification image and a data image.
A method of encoding for an optical code generating device comprising a light bank and a light homogenizer, the method comprising: receiving a pulse signal, and compiling the pulse signal according to a preset coding rule to generate a control signal of the light-emitting lamp group; controlling the light-emitting lamp group to form an optical code image on the light equalizing piece according to the control signal, so that when an image acquisition device with a roller shutter exposure function receives the optical code image, the pulse signal is obtained through the optical code image analysis; wherein the optical code image comprises a temporally contiguous identification image and a data image. Specifically, when the coding rule is any one of a six-system coding rule, a seven-system coding rule and a twenty-four-system coding rule, the light-emitting lamp group is controlled to emit three different colors of emitted light; when the coding rule is a seven-system coding rule, the identification image is a first preset number of continuous dark stripes; the data image includes at least a second preset number of consecutive dark stripes.
The decoding method is used for a terminal, the terminal comprises an image acquisition device with a rolling shutter exposure function, and the method comprises the following steps: collecting an optical code image formed on the light uniformizing piece through an image collecting device with a rolling shutter exposure function; scanning the optical code image to determine an identification image contained in the optical code image; determining a data image in the optical code image from the identification image; and analyzing the data image according to a pre-stored coding rule to obtain a pulse signal corresponding to the data image.
However, the above patent documents CN103957056B, CN109784119A or the existing technologies currently using LEDs to transmit data have at least the following disadvantages:
1. the above patent documents all use graphics for shooting and then extract data for encoding, but ignore the problem that the images may be affected by shooting angle, camera quality, ambient light and the like during the use process to cause partial data decoding failure.
CN109784119A mainly uses spatial information for encoding (light and dark stripe distance), and CN103957056B also uses a similar method (LED array), but there is no effective synchronization technique, and if a plurality of identical data information are transmitted consecutively, data errors and data frame confusion may occur.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method and an apparatus for transmitting data to a mobile terminal by using a three-color LED, which can solve the contradiction between power consumption, transmission rate, information capacity, volume and price, and has the characteristics of low power consumption at a transmitting end, high transmission bit rate, large information capacity, small volume and low cost.
The invention discloses a method for transmitting data to a mobile terminal by using a three-color LED, which adopts the three-color LED to cooperate with an LED controller to emit light, and uses a camera of the mobile terminal to finish data transmission from information to the camera of the mobile terminal, and comprises the following steps:
according to 8 luminous states of the three-color LED, the full-off state is used as a data transmission indicating state or background indication, and luminous colors formed by the rest 7 luminous states are expressed in a 7-system mode; when the total extinguishing time is 3T, the starting of the data or the ending of the last data is represented; when the total time of extinction is T, the data sub-nodes are represented and used for data synchronization confirmation;
utilizing a camera of the mobile terminal to photograph the three-color LED, analyzing frame by frame, and if the LED state photographed by the N-1 th frame is totally extinguished, and the LED of the N-1 th frame is on, storing the image of the N-1 th frame and the corresponding extinguished image of the N-1 th frame; if the LED of the M frame is on and the LED of the M +1 frame is off, storing the image of the M frame and the corresponding off image of the M +1 frame; namely, one state diagram of the LED is a totally-off image and corresponds to a nearest bright image; and then, image processing including matching and difference calculation is carried out according to the state diagram of the LED, and finally, a corresponding 7-system coding value is obtained.
Further, the LED controller comprises n common control ports and 3 status control ports; the n public control ports are connected to the public end of the LED display module, the LED display module is a circuit module which integrates or packages the red LED, the blue LED and the green LED together, and 1 red LED, 1 blue LED and 1 green LED are integrated or packaged into a group; the 3 state control ports respectively control the red LED, the blue LED and the green LED, and any one state control port is connected to the state control ports of all the LEDs with the same color.
Furthermore, only one public control port is effective at any time, and other public control ports are ineffective; the effective common control port can open a current path of a corresponding LED group, and the current is determined by the state control port through a certain LED; at some point, if all of the common control ports are inactive, then all of the LEDs will not be lit.
Further, the controller rapidly controls the common control port to switch, and the switching time is less than 1/n times of the frame interval time of the camera of the mobile terminal, so that the LEDs required to be lightened on each frame of image of the mobile terminal can form images.
Further, the method for LED data transmission verification comprises the following steps:
selecting 5 groups of three-color LEDs for data transmission, and transmitting 14 × 2 ═ 28bit data in one period, wherein 2bit is used for indicating the initial position of the data, and 26bit is used for BCH (26,16) verification of a shortened code, so that if 2bit codes in the transmitted 16bit data have errors, the data are corrected; consecutive m groups of data are put at the end with more transfers of one 16bit data for CRC16 check.
Further, in the image processing process, the matching calculation according to the state diagram of the LED comprises the following steps:
(1) respectively carrying out edge extraction on the image with the bright LED and the adjacent all-out image to respectively obtain images Pf and Pb;
(2) carrying out binarization processing on the Pf and Pb images to obtain images Pf2 and Pb 2;
(3) matching algorithm of Pf2 and Pb2 pictures is performed from the coordinate range of relative translation (-X, X) and (-Y, Y): at the ith matching, if the effective pixel P (X, Y) of Pf2 is (X + Xi, Y + Yi) in Pb2 (Xi belongs to (-X, X), Yi belongs to (-Y, Y)), the matching value Ri is added with 1; the Ri before searching is 0, after all images are searched, the total Ri value is obtained, and finally R MAX (R0, R1, … … Rn) is found, wherein n is 4XY, and the matching point coordinates (Xc, Yc) are obtained at the same time.
Further, in the image processing process, the method further comprises the following steps:
finding the position of the LED from Pf and Pb by the obtained matching coordinates (Xc, Yc) and applying a difference method; collecting the pixel colors of the LED position areas, and respectively calculating RGB values of red, green and blue after collection, wherein k is the pixel number of a certain LED area:
R=∑R(x,y)/k
G=∑G(x,y)/k
B=∑B(x,y)/k
the calculated RGB value is the average value of RGB components of the area where the LED is positioned so as to resist the influence of noise;
r, G and B are normalized, i.e. the format of RGB888 is divided by 255 to obtain normalized components of RGB [ R, G, B ], and the distance value of the RGB data of the LED to each luminous color is calculated, namely:
L=((R–Ri)2+(G–Gi)2+(B–Bi)2)0.5
the luminous color C (R) of any three-color LEDi,Gi,Bi) Calculating the distance L between the LED and the collected color of the three-color LEDiBy multiplying by the weight C of each emitted coloriFinding out the color distance K between all colors and the collected color of the three-color LEDi=LiCiThe smallest one of the colors is the emission color of the three-color LED, resulting in a corresponding 7-ary coded value.
The invention discloses a device for transmitting data to a mobile terminal by using a three-color LED, which at least comprises:
the LED display module is integrated or packaged with a red LED, a blue LED and a green LED, and 1 red LED, 1 blue LED and 1 green LED are integrated or packaged into a group;
the LED controller comprises n public control ports and 3 state control ports, wherein the n public control ports are connected to a public end of the LED display module, the 3 state control ports respectively control the red LEDs, the blue LEDs and the green LEDs, and any one state control port is connected to the state control ports of all the LEDs with the same color; the LED controller takes the full-off state as a data transmission indicating state or background indication according to 8 light-emitting states of the three-color LED, and expresses light-emitting colors formed by the rest 7 light-emitting states in a 7-system mode; when the total extinguishing time is 3T, the starting of the data or the ending of the last data is represented; and when the total time of extinction is T, the data subnodes are represented and used for data synchronization confirmation.
Furthermore, only one public control port is effective at any time, and other public control ports are ineffective; the effective common control port can open a current path of a corresponding LED group, and the current is determined by the state control port through a certain LED; at some point, if all of the common control ports are inactive, then all of the LEDs will not be lit.
Further, the controller rapidly controls the common control port to switch, and the switching time is less than 1/n times of the frame interval time of the camera of the mobile terminal, so that the LEDs required to be lightened on each frame of image of the mobile terminal can form images.
The invention has the beneficial effects that:
the invention takes the three-color LED full-off state as the data transmission indicating state or background indication, and takes the full-off state as the synchronous signal, thereby avoiding the error code generated by the step-out of the collected data; in one period, the valid data can be synchronously transmitted twice;
the method comprises the steps that a camera of a mobile terminal is used for shooting three-color LEDs, and the images are analyzed frame by frame, if the LED state shot by the N-1 th frame is full off, and the LED of the N-1 th frame is bright, the image of the N-1 th frame and the corresponding N-1 frame off image are stored; if the LED in the Mth frame is on and the LED in the M +1 th frame is off, the image of the Mth frame and the corresponding off image in the M +1 th frame are stored, namely, one state diagram of the LED is an all-off image and corresponds to the nearest on image. Because the time for the background and the LED to be bright is short, a photographer does not need to hold the shooting equipment stably between 1 frame and 2 frames, and the requirement on the photographer is not high; the 2N LED lightening images correspond to the N +1 background images, so that the ratio of the LED state diagram to the background diagram is greatly increased, and the improvement of the data communication rate is facilitated; in addition, the effective pixel points of the LED can be conveniently extracted by adopting a matching difference algorithm in the later period, the image calculation complexity is reduced, the generation rate of operation events is reduced, and the calculation of a processor of the mobile equipment is particularly convenient;
the invention adopts a data transmission check method, and greatly reduces the probability of error coding due to the existence of check codes; due to the existence of the error correcting code, even if a small amount of error identification codes exist, the normal transmission of data is not influenced;
the invention has the advantages of low power consumption of the sending end, higher transmission bit rate, large information capacity, small volume and low cost.
With respect to patent documents CN103957056B and CN 109784119A:
1. the above patent documents all use graphics to shoot and then extract data to encode, but the above patent documents ignore the problem that the image may be affected by shooting angle, camera quality, ambient light, etc. during the use process to cause partial data decoding failure. The invention not only adds data check information, but also adopts BCH (26,16) coding and adds data forward error correction information. The beneficial effects of the treatment are as follows: 1) due to the existence of the check code, the probability of error coding is greatly reduced; 2) due to the existence of the error correcting code, even if a small amount of error identification codes exist, the normal transmission of data is not influenced; 3) the method has no special requirement on the identification scanning direction of the LED scanning arranged in a line, the wrong scanning direction can generate wrong check codes, only the correct scanning direction check codes are correct, the receiving software only needs to judge once, and the calculation and the memory consumption can be basically ignored for the intelligent terminal equipment.
CN109784119A mainly uses spatial information for encoding (light and dark stripe distance), and CN103957056B also uses a similar method (LED array). The invention mainly adopts time sequence coding (relative light and shade in time) and also considers the coding expansion of a plurality of bits in space. The time sequence coding is favorable for determining the pressing point of the acquired data, and the sending end and the receiving end form data synchronization through light and shade change, so that the data frame information is provided with synchronous processing, and synchronous conversion at the later stage is not needed. In particular, there is no effective synchronization technique in the above patent documents, and if a plurality of identical data information are continuously transmitted, data errors and data frame confusion may occur.
3. Since the present invention employs time-sequential encoding, images are spatially matched in time sequence, and the above patent documents do not relate to this. The beneficial effects of the method are that: the shooting requirement on the photographer is greatly reduced, even if the photographer or the shot target shakes to a certain extent, matching can be achieved in a small area through a matching algorithm, and the problem that the photographer cannot be positioned again after shaking is avoided. The requirement on the camera of the low-performance intelligent terminal is greatly reduced, the frame rate of some low-performance cameras is low, the tailing is obvious in a darker environment, the position matching is carried out in space by adopting a time sequence, even if certain blurring exists, pole matching under the Gaussian distribution condition is not influenced, and therefore the requirement on the camera can be reduced.
4. The invention can directly acquire the position of the LED lamp and finish the coding identification by adopting an image edge difference matching mode without adopting the identification of the distance of light and shade alternate stripes. The method has the advantages that: the position of the LED lamp can be rapidly acquired, excessive image space positioning is not needed, the operation resources of the intelligent terminal are greatly saved, and the user can use experience and greatly improve the operation resources.
5. The LED light does not adopt a light homogenizing piece, and the RGB component space average mode is used in the matching algorithm to realize the identification of the three-color mixing function. The benefits of this are: and a light homogenizing device is removed, so that the cost is reduced, and the manufacturing difficulty is reduced. Because there is no light homogenizing device, the effective luminous flux of the LED is larger, and when smaller LED lamps are used, a better color mixing effect can be obtained.
6. The optical image extraction method of the present invention is different from the above patent documents. And according to the on and off of the LED light, the extraction of the LED coding features is realized in a mode of extracting picture pairs from multi-frame images. There is no need for a continuous identification image and data image. This has the benefits that: the operation amount of the intelligent terminal is reduced, and the cost overhead of manpower/identification devices/operation brought by identifying images is reduced.
Drawings
FIG. 1 is a schematic diagram of a control circuit according to an embodiment of the present invention;
FIG. 2 is a timing diagram of an LED according to an embodiment of the present invention.
Detailed Description
In order to more clearly understand the technical features, objects, and effects of the present invention, specific embodiments of the present invention will now be described. It should be understood that the detailed description and specific examples, while indicating the preferred embodiment of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a method and a device for transmitting data to a mobile terminal by using a three-color LED, wherein the device comprises an LED display module and an LED controller, as shown in figure 1, wherein:
the LED display module is integrated or packaged with a red LED, a blue LED and a green LED, and 1 red LED, 1 blue LED and 1 green LED are integrated or packaged into a group.
The LED controller comprises n public control ports and 3 state control ports, wherein the n public control ports are connected to a public end of the LED display module and can be specifically connected in a common cathode mode or a common anode mode, cathodes in a group of LEDs are all connected together and are connected in a common cathode mode by a mode of controlling anode current, or anodes are all connected together and are connected in a common anode mode by a mode of controlling cathode current. The 3 state control ports respectively control the red LED, the blue LED and the green LED, and any one state control port is connected to the state control ports of all the LEDs with the same color.
The control mode of the LED controller is as follows: only one common control port is active at any one time and the other common control ports are inactive. The active common control port can open a current path for the corresponding LED group, the current being determined by the status control port through a certain LED. The controller rapidly controls the public control port to switch, and the switching time is less than 1/n times of the frame interval time of the camera of the mobile terminal, so that the LEDs required to be lightened on each frame of image of the mobile terminal can form images. At some point, if all of the common control ports are inactive, then all of the LEDs will not be lit.
Optionally, the device further comprises a power supply, and the power supply is respectively connected with the LED controller and the LED display module.
The invention discloses a method for transmitting data to a mobile terminal by using a three-color LED, which adopts the three-color LED to cooperate with an LED controller to emit light, and uses a camera of the mobile terminal to complete data transmission from information to the camera of the mobile terminal, and comprises the following steps:
(1) principle of transmission coding
The transmission of the codes occurs in the changing process of the LED lamp from off to on or from on to off, namely on two continuously collected mobile terminal images, the LED in the previous frame image is in an off state, and the LED in the current frame image is in an on state, which indicates that A data transmission exists; the LED in the previous frame image is on, and the LED in the current frame image is off, indicating that there is one B data transmission. It has the advantages that: the full-off is used as a synchronous signal to avoid error codes generated by the step-out of the acquired data; within one period, valid data can be transmitted twice synchronously.
Three-color LED lamp totally has 8 states, and after the complete extinguishment is used as the data transmission indication state or background indication, 7 colors are left, and the combination mode of the 7 colors and the complete extinguishment is shown in the table 1.
TABLE 1 color coding
Serial number Red colour Green colour Blue color Mixing colors Description of the invention
0 0 0 0 Killing rice Data transmission control
1 0 0 1 Blue color Logic 0
2 0 1 0 Green colour Logic 1
3 0 1 1 Sky blue Logic 2
4 1 0 0 Red colour Logic 3
5 1 0 1 Purple color Logic 4
6 1 1 0 Yellow colour Logic 5
7 1 1 1 White colour Logic 6
Thus, the colors numbered 1-7 can be expressed in a 7-ary manner as 7-ary values 0-6. When the total extinguishing time is 3T, the starting of the data or the ending of the last data is represented; and when the total time of extinction is T, the data subnodes are represented and used for data synchronization confirmation. T can be adjusted according to specific application, and is generally 50-150 ms.
(2) Conversion of 7-ary data and 2-ary data
Each LED display group is a 7-system data bit, and if there are N bits, the number to be expressed is:
X=AN7N+AN-17N-1+……A171+A0
the relationship between a 7-ary number and its adjacent binary numbers is shown in table 2.
TABLE 27 relationship of binary numbers to their adjacent binary numbers
Number of 7 orders Express maximum range Equivalent binary digit number Closest binary range Efficiency of expression
1 7 2.807354922 4 0.75
2 49 5.614709844 32 0.53125
3 343 8.422064766 256 0.33984375
4 2401 11.22941969 2048 0.172363281
5 16807 14.03677461 16384 0.025817871
6 117649 16.84412953 65536 0.795181274
7 823543 19.65148445 524288 0.570783615
8 5764801 22.45883938 4194304 0.374435663
9 40353607 25.2661943 33554432 0.202631205
10 282475249 28.07354922 268435456 0.052302305
11 1977326743 30.88090414 1073741824 0.841529033
12 13841287201 33.68825906 8589934592 0.611337904
13 96889010407 36.49561399 68719476736 0.409920666
From table 2 it can be seen that selecting 5 groups of three color LEDs is a very economical way, and each off-on period can transmit 14 x 2-28 bit.
(3) LED data transmission checking method
In order to avoid transmission errors, it is required not only to find errors but also to correct the positions of the errors. And (3) selecting 5 groups of three-color LEDs in the step (2) for data transmission, and transmitting 28-bit data in one period, wherein 2 bits are used for indicating the initial position of the data, and 26 bits are used for BCH (26,16) verification of a shortened code, so that if 2-bit codes in the transmitted 16-bit data have errors, the 16-bit data can be corrected. Consecutive m groups of data are put at the end with more transfers of one 16bit data for CRC16 check. Therefore, due to the existence of the check code, the probability of error coding is greatly reduced; the existence of the error correcting code does not influence the normal transmission of data even if a small amount of error identification codes exist. There is no special requirement for the identification scanning direction of the LED scanning arranged in a line, and the wrong scanning direction will have wrong check code, and only the correct scanning direction check code is correct.
(4) Consumption of electric current
For any one LED, since a control manner of scanning display is adopted (only one LED is lighted at any time), the maximum current of one LED can represent the current of all the LEDs. In general, since the average operating current of the LEDs that can be sensed by the mobile terminal is about 0.2mA, the total display consumption current is 0.2 × 3mA to 0.6 mA.
(5) Identification principle of codes
1) Utilizing a camera of the mobile terminal to photograph the three-color LED, analyzing frame by frame, and if the LED state photographed by the N-1 th frame is totally extinguished, and the LED of the N-1 th frame is on, storing the image of the N-1 th frame and the corresponding extinguished image of the N-1 th frame; if the LED of the M frame is on and the LED of the M +1 frame is off, storing the image of the M frame and the corresponding off image of the M +1 frame; that is, the state diagram of the LED has one image that is completely off and corresponds to one image that is closest to being on.
Here, two LED lighting events are exemplified, the timing sequence of which is shown in fig. 2, where the labels BK1, BK2, BK3 are captured full blanking images, and a1, B1, a2, B2 are captured frame images of the LED being lit. The above coding rules can be paired as follows: p1(a1, BK1), P2(B1, BK2), P3(a2, BK2), P4(B2, BK 3).
The benefits of this approach are: because the time for the background and the LED to be bright is short, a photographer does not need to hold the shooting equipment stably between 1 frame and 2 frames, and the requirement on the photographer is not high; the 2N LED lightening images correspond to the N +1 background pictures, so that the ratio of the LED state diagram to the background pictures is greatly increased, and the improvement of the data communication rate is facilitated; the method is convenient for extracting the effective pixel points of the LED by adopting a matching difference algorithm in the later period, reduces the complexity of image calculation, reduces the generation rate of operation events, and is particularly convenient for the processor of the mobile equipment to calculate.
In the image processing process, matching and difference calculation are carried out according to the state diagram of the LED, and the specific processing steps are as follows: respectively carrying out edge extraction on the image with the bright LED and the adjacent all-out image to respectively obtain images Pf and Pb; carrying out binarization processing on the Pf and Pb images to obtain images Pf2 and Pb 2; matching algorithm of Pf2 and Pb2 pictures is performed from the coordinate range of relative translation (-X, X) and (-Y, Y): at the ith matching, if the effective pixel P (X, Y) of Pf2 is (X + Xi, Y + Yi) in Pb2 (Xi belongs to (-X, X), Yi belongs to (-Y, Y)), the matching value Ri is added with 1; the Ri before searching is 0, after all images are searched, the total Ri value is obtained, and finally R MAX (R0, R1, … … Rn) is found, wherein n is 4XY, and the matching point coordinates (Xc, Yc) are obtained at the same time.
2) And finding the position of the LED from Pf and Pb by using a difference method through the obtained matching coordinates (Xc, Yc). Collecting the pixel colors of the LED position areas, and respectively calculating RGB values of red, green and blue after collection, wherein k is the pixel number of a certain LED area:
R=∑R(x,y)/k
G=∑G(x,y)/k
B=∑B(x,y)/k
the calculated RGB values are the average of the RGB components of the area where the LED is located, which effectively resists the effects of noise.
R, G and B are normalized by dividing format of RGB888 by 255 to obtain normalized components of RGB [ R, G, B ], calculating distance values of RGB data of LED to each light emitting color according to the color data in Table 1, namely:
L=((R–Ri)2+(G–Gi)2+(B–Bi)2)0.5
for any one of the emission colors C (R) from Table 1i,Gi,Bi) Calculating the distance L between the LED and the collected color of the three-color LEDiBy multiplying by the weight C of each emitted coloriFinding out the color distance K between all colors and the collected color of the three-color LEDi=LiCiThe smallest one, namely the emission color of the three-color LED, is obtained by checking the colors of table 1 to obtain a 7-ary coded value.
The foregoing is illustrative of the preferred embodiments of this invention, and it is to be understood that the invention is not limited to the precise form disclosed herein and that various other combinations, modifications, and environments may be resorted to, falling within the scope of the concept as disclosed herein, either as described above or as apparent to those skilled in the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for transmitting data to a mobile terminal by using a three-color LED is characterized in that the three-color LED is adopted to cooperate with an LED controller to emit light, and a camera of the mobile terminal is used for completing data transmission from information to the camera of the mobile terminal, and the method comprises the following steps:
according to 8 luminous states of the three-color LED, the full-off state is used as a data transmission indicating state or background indication, and luminous colors formed by the rest 7 luminous states are expressed in a 7-system mode; when the total extinguishing time is 3T, the starting of the data or the ending of the last data is represented; when the total time of extinction is T, the data sub-nodes are represented and used for data synchronization confirmation;
utilizing a camera of the mobile terminal to photograph the three-color LED, analyzing frame by frame, and if the LED state photographed by the N-1 th frame is totally extinguished, and the LED of the N-1 th frame is on, storing the image of the N-1 th frame and the corresponding extinguished image of the N-1 th frame; if the LED of the M frame is on and the LED of the M +1 frame is off, storing the image of the M frame and the corresponding off image of the M +1 frame; namely, one state diagram of the LED is a totally-off image and corresponds to a nearest bright image; and then, image processing including matching and difference calculation is carried out according to the state diagram of the LED, and finally, a corresponding 7-system coding value is obtained.
2. The method of claim 1, wherein the LED controller comprises n common control ports and 3 status control ports; the n public control ports are connected to the public end of the LED display module, the LED display module is a circuit module which integrates or packages the red LED, the blue LED and the green LED together, and 1 red LED, 1 blue LED and 1 green LED are integrated or packaged into a group; the 3 state control ports respectively control the red LED, the blue LED and the green LED, and any one state control port is connected to the state control ports of all the LEDs with the same color.
3. The method of claim 2, wherein only one common control port is active and the other common control ports are inactive at any one time; the effective common control port can open a current path of a corresponding LED group, and the current is determined by the state control port through a certain LED; at some point, if all of the common control ports are inactive, then all of the LEDs will not be lit.
4. The method as claimed in claim 2, wherein the controller rapidly controls the common control port to switch for less than 1/n times of a frame interval time of the camera of the mobile terminal, so that the LED to be lit on each frame of image of the mobile terminal can be imaged.
5. The method for transmitting data to a mobile terminal by using a three-color LED according to any one of claims 1 to 4, further comprising a method for transmitting and verifying LED data:
selecting 5 groups of three-color LEDs for data transmission, and transmitting 14 × 2 ═ 28bit data in one period, wherein 2bit is used for indicating the initial position of the data, and 26bit is used for BCH (26,16) verification of a shortened code, so that if 2bit codes in the transmitted 16bit data have errors, the data are corrected; consecutive m groups of data are put at the end with more transfers of one 16bit data for CRC16 check.
6. The method for transmitting data to a mobile terminal by using a three-color LED according to any one of claims 1 to 4, wherein the matching calculation according to the state diagram of the LED in the image processing process comprises the following steps:
(1) respectively carrying out edge extraction on the image with the bright LED and the adjacent all-out image to respectively obtain images Pf and Pb;
(2) carrying out binarization processing on the Pf and Pb images to obtain images Pf2 and Pb 2;
(3) matching algorithm of Pf2 and Pb2 pictures is performed from the coordinate range of relative translation (-X, X) and (-Y, Y): at the ith matching, if the effective pixel P (X, Y) of Pf2 is (X + Xi, Y + Yi) in Pb2 (Xi belongs to (-X, X), Yi belongs to (-Y, Y)), the matching value Ri is added with 1; the Ri before searching is 0, after all images are searched, the total Ri value is obtained, and finally R MAX (R0, R1, … … Rn) is found, wherein n is 4XY, and the matching point coordinates (Xc, Yc) are obtained at the same time.
7. The method of claim 6, wherein the image processing further comprises the following steps:
finding the position of the LED from Pf and Pb by the obtained matching coordinates (Xc, Yc) and applying a difference method; collecting the pixel colors of the LED position areas, and respectively calculating RGB values of red, green and blue after collection, wherein k is the pixel number of a certain LED area:
R=∑R(x,y)/k
G=∑G(x,y)/k
B=∑B(x,y)/k
the calculated RGB value is the average value of RGB components of the area where the LED is positioned so as to resist the influence of noise;
r, G and B are normalized, i.e. the format of RGB888 is divided by 255 to obtain normalized components of RGB [ R, G, B ], and the distance value of the RGB data of the LED to each luminous color is calculated, namely:
L=((R–Ri)2+(G–Gi)2+(B–Bi)2)0.5
the luminous color C (R) of any three-color LEDi,Gi,Bi) Calculating the distance L between the LED and the collected color of the three-color LEDiBy multiplying by the weight C of each emitted coloriFinding out the color distance K between all colors and the collected color of the three-color LEDi=LiCiThe smallest one of the colors is the emission color of the three-color LED, resulting in a corresponding 7-ary coded value.
8. An apparatus for transmitting data to a mobile terminal using a three-color LED, comprising:
the LED display module is integrated or packaged with a red LED, a blue LED and a green LED, and 1 red LED, 1 blue LED and 1 green LED are integrated or packaged into a group;
the LED controller comprises n public control ports and 3 state control ports, wherein the n public control ports are connected to a public end of the LED display module, the 3 state control ports respectively control the red LEDs, the blue LEDs and the green LEDs, and any one state control port is connected to the state control ports of all the LEDs with the same color; the LED controller takes the full-off state as a data transmission indicating state or background indication according to 8 light-emitting states of the three-color LED, and expresses light-emitting colors formed by the rest 7 light-emitting states in a 7-system mode; when the total extinguishing time is 3T, the starting of the data or the ending of the last data is represented; and when the total time of extinction is T, the data subnodes are represented and used for data synchronization confirmation.
9. The apparatus of claim 8, wherein only one common control port is active and the other common control ports are inactive at any one time; the effective common control port can open a current path of a corresponding LED group, and the current is determined by the state control port through a certain LED; at some point, if all of the common control ports are inactive, then all of the LEDs will not be lit.
10. The apparatus as claimed in claim 8, wherein the controller rapidly controls the common control port to switch for less than 1/n times of a frame interval time of the camera of the mobile terminal, so that the LEDs to be lit on each frame of image of the mobile terminal can be imaged.
CN202011609650.8A 2020-12-30 2020-12-30 Method and device for transmitting data to mobile terminal by using three-color LED Active CN112751612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011609650.8A CN112751612B (en) 2020-12-30 2020-12-30 Method and device for transmitting data to mobile terminal by using three-color LED

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011609650.8A CN112751612B (en) 2020-12-30 2020-12-30 Method and device for transmitting data to mobile terminal by using three-color LED

Publications (2)

Publication Number Publication Date
CN112751612A true CN112751612A (en) 2021-05-04
CN112751612B CN112751612B (en) 2024-03-08

Family

ID=75649568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011609650.8A Active CN112751612B (en) 2020-12-30 2020-12-30 Method and device for transmitting data to mobile terminal by using three-color LED

Country Status (1)

Country Link
CN (1) CN112751612B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888288A (en) * 2017-11-07 2018-04-06 华南理工大学 A kind of short distance visible light communication method and its hardware system based on mobile terminal
CN109784120A (en) * 2018-12-11 2019-05-21 田丰 Optical code generating means, light sensation data interactive method and image collecting device
CN111614399A (en) * 2020-04-21 2020-09-01 中国科学院西安光学精密机械研究所 Visible light high-speed communication method between intelligent terminals

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888288A (en) * 2017-11-07 2018-04-06 华南理工大学 A kind of short distance visible light communication method and its hardware system based on mobile terminal
CN109784120A (en) * 2018-12-11 2019-05-21 田丰 Optical code generating means, light sensation data interactive method and image collecting device
CN111614399A (en) * 2020-04-21 2020-09-01 中国科学院西安光学精密机械研究所 Visible light high-speed communication method between intelligent terminals

Also Published As

Publication number Publication date
CN112751612B (en) 2024-03-08

Similar Documents

Publication Publication Date Title
US10680711B2 (en) System and method for providing optically coded information
CN109661666B (en) Optical communication device and system, and corresponding information transmission and reception method
EP2940889B1 (en) Visible-light-communication-signal display method and display device
JP7550467B2 (en) Visible Light Communication System
EP2784949B1 (en) Transmission device, reception device, and method
CN107194301A (en) A kind of recognition methods of Quick Response Code and device
CN109784120B (en) Optical code generation device, light sensation data interaction method and image acquisition device
CN107255524B (en) Method for detecting frequency of LED light source based on mobile equipment camera
CN103905118A (en) Apparatus and method for data embedding in light communication and the light communication system and method thereof
US10848242B2 (en) System and method for providing optically coding of information combining color and luminosity
CN107222258A (en) A kind of data capture method, data transmission method for uplink, device and data transmission system
CN109936713B (en) Method and apparatus for decoding information conveyed by a light source
CN109936694B (en) Optical communication device comprising reference light source and corresponding information transmission and reception method
US20190036646A1 (en) Discrimination method and communication system
CN114285472A (en) UPSOOK modulation method with forward error correction based on mobile phone camera
CN111213368B (en) Rigid body identification method, device and system and terminal equipment
CN109784119B (en) Optical code generating device, decoding device, encoding method, decoding method, and system
CN112751612B (en) Method and device for transmitting data to mobile terminal by using three-color LED
CN111490823B (en) Visible light imaging communication decoding method based on convolutional neural network
CN112738325B (en) Intelligent LED identification method based on Android mobile phone
Zhang et al. The optical fringe code modulation and recognition algorithm based on visible light communication using convolutional neural network
Sun et al. CALC: calibration for ambient light correction in screen-to-camera visible light communication
CN110008781B (en) Two-dimensional multi-frame modulation and demodulation method
US9305200B2 (en) Information acquisition apparatus, information acquisition method, and non-transitory recording medium
US10951312B2 (en) Transmitting device, transmission control device, and transmission method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant