CN105117758A - Colored two-dimensional code based mobile platform security communication method - Google Patents

Colored two-dimensional code based mobile platform security communication method Download PDF

Info

Publication number
CN105117758A
CN105117758A CN201510549552.2A CN201510549552A CN105117758A CN 105117758 A CN105117758 A CN 105117758A CN 201510549552 A CN201510549552 A CN 201510549552A CN 105117758 A CN105117758 A CN 105117758A
Authority
CN
China
Prior art keywords
page
color
code
pixel
coding
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.)
Pending
Application number
CN201510549552.2A
Other languages
Chinese (zh)
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.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
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 Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN201510549552.2A priority Critical patent/CN105117758A/en
Publication of CN105117758A publication Critical patent/CN105117758A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a colored two-dimensional code based mobile platform security communication method. Comparing with a near distance communication scheme of a radio frequency technology, the colored two-dimensional code based mobile platform security communication method has the advantages that a connecting direction and a distance of a screen and a camera can be easily controlled, thereby protecting privacy and communication security; the colored two-dimensional code based mobile platform security communication method can naturally resist to frequency interference, thereby having extremely high flexibility and a wide application scene; and utilizes RainBar to implement a Diffie-Hellman key agreement protocol based on a high capacity colored two-dimensional stream and finally can implement secure and reliable communication between smart phones at different levels.

Description

A kind of mobile platform safety communicating method based on color 2 D code
Technical field
The invention belongs to communication technical field, be specifically related to a kind of mobile platform safety communicating method based on color 2 D code.
Background technology
Current use more widely close range communication techniques has bluetooth (Bluetooth), WLAN (wireless local area network) 802.11 (Wi-Fi), ZigBee, RFID, near-field communication (NFC) etc.Relative to other close range communication techniques, NFC has higher safety guarantee, and it well can resist DoS attack, (MessageModificationAttack) and man-in-the-middle attack (Man-in-the-MiddleAttack) etc. are attacked in information amendment.But the enforcement of NFC needs extra hardware device, significantly limit its widespread use on mobile terminals.In addition, experimental study shows, with custom-designed portable NFC sniffer, it can eavesdrop the distance that NFC transmission range reaches 240 centimetres, namely than NFC communication distance at least one order of magnitude of expection, the serious challenge public generally believes that NFC is the viewpoint of immunity eavesdropping.
In recent years, visible light communication (VLC), acoustic communication is comprised novelshort haul connection more and more comes into one's own.Domestic famous payment platform Alipay and Baidu pay all to have released one after another and utilize the modes of payments of sound wave payment and recognition of face, these novelshort haul connection mode have the trend replacing traditional short-range communication mode such as NFC, RFID, bluetooth.
The present invention is devoted to research and explores a kind of safe and reliable short-range communication scheme utilizing visible ray, is referred to as RainBar (RobustApplicationdrivenvIsualcommuNicationusingcolorBARc odes).Be different from traditional close range communication techniques, due to the narrow light beam of high directivity, VLC can safe enough, exempt to disturb carry out radio communication connection, RainBar does not need extra network configuration process or radio frequency chip, has high dirigibility and application scenarios widely.These two-forties and wireless near field communication feature make VLC become an attractive solution at the application scenarios such as indoor wireless local area network and In-vehicle networking.
Although some Quick Response Codes are used widely, because its capacity is too little, be only rest on open link or add the small amount of data transmission such as good friend at present.But be that the visible light communication of representative has good natural safety with Quick Response Code, light is linearly propagated under normal circumstances, so be difficult under normal circumstances intercept light as intercepting wireless signal.Utilize this point, visible light communication can realize such as transfer files etc. and require large and that security requirement is high function to data volume.In addition, traditional Quick Response Code not good guarantee in opposing attack, and third party is easy to just to add fallacious message to attack user in original two dimensional code; So the present invention is in conjunction with 2 points, after trial raising capacity and with the color 2 D code stream of authentication, realize the function of closely data communication.
A kind of special shape of the VLC realized on intelligent mobile phone system exactly that RainBar explores.Specifically, data message is encrypted and be encoded into two-dimentional code stream and show on smart mobile phone/computer screen, and the opposing party's smart mobile phone is with camera shooting and decoded video streams.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, provide a kind of mobile platform safety communicating method based on color 2 D code;
Technical scheme of the present invention is: a kind of mobile platform safety communicating method based on color 2 D code, comprising:
Step 1: transmit leg is according to the size of self shaking degree adaptive generation coding lattice;
Step 2: transmit leg generates header information and RS coding;
Step 3: take over party's camera photographs the Quick Response Code page at every turn, first the brightness and blur level of often opening two-dimension code image is evaluated and tested, detection and positioning angle point tracker again, angle point tracker is utilized to navigate to two angle points above the Quick Response Code page, and then the information extracted in header information, according to the sender display frequency f extracted dwith take over party's filming frequency f cdetermine to adopt the page to select or the page synchronization algorithm acquisition Quick Response Code page;
Step 4: the Quick Response Code page utilizing step 3 to obtain, adopts progressive steady arm location algorithm, and the basis of the steady arm of a upper known location calculates the position of next steady arm, finds the left, center, right three row black steady arm of code area;
Step 5: the coding lattice using left column and middle row steady arm location left-half, the coding lattice of middle row and right row steady arm location right half part, thus accurately orient code area;
Step 6: average noise reduction is carried out to the color of each coding lattice, and carries out colour recognition based on HSV model;
Step 7: the error correction of RS code is carried out to the data that each Quick Response Code page extracts, then CRC check is carried out to the information after error correction, for the page exceeding error correction scope and lose in the transmission, utilize the sequence number of this page of light sensor LED-LightSensor channel feedback, then by feedback processing, this page is retransmitted.
Further, described transmit leg is according to the size of self shaking degree adaptive generation coding lattice; Concrete is: utilize the accelerometer accelerometers in mobile phone to obtain the mobile phone situation of rocking and adjust the size generating coding lattice; If accelerator measures the acceleration>1.2g of mobile phone, then the size blocksize of coding lattice is multiplied by 1.5, namely 15 × 15 pixel p ixel, until hard disk error rate BER is less than 0.01, otherwise continues to be multiplied by 1.5; If now accelerometer acceleration<1.2g, then by the size blocksize reduction 1 per second pixel p ixel of coding lattice, until hard disk error rate BER is close to 0.01, coding lattice is now of a size of most suitable size.
Further, in described step 2, what transmit leg generation header information was concrete is: first Quick Response Code header information comprises sequence number, transmit leg Quick Response Code display frequency, file type, stem School Affairs, and other Quick Response Code header informations comprise sequence number and stem School Affairs;
What transmit leg generation RS coding was concrete is: the integer field of given 256 bytes, block length n symbol, a message-length k symbol, RS (n, k) code can correct at most (n-k)/2 byte mistake, check out at most n-k byte mistake; In coding lattice, be eachly called that RS encodes by the byte of encoding.
Further, in described step 3:
The step that two-dimension code image blur level is often opened in evaluation and test is:
1. first each pixel p blur level DOB is defined as:
DOB p = &Sigma; Y &Element; { R , G , B } m i n ( | 255 - Y | , Y ) 3
Wherein, Y is the RGB component of pixel p;
2. then the two-dimension code image photographed is equally divided into upper left, upper right, lower-left, bottom right four part, the N number of pixel of every part stochastic sampling, then the DOB of whole two-dimension code image is defined as:
DOB i m g = &Sigma; p DOB p 4 N DOB i m g = &Sigma; p DOB p 4 N
Further, in described step 3:
The step of described detection and positioning angle point tracker is: angle point tracker is positioned at Quick Response Code page upper left, upper right two angle points, the angle point tracker of left upper is 8 black coding lattices round 1 green coding lattice, and the angle point tracker at upper right corner place is 8 black coding lattices round 1 red coding lattice; When carrying out Corner Detection, left upper is lined by line scan from left to right, upper right corner place turns left from the right side and lines by line scan, until scan the pixel P of a black, again respectively to its up and down four direction one by one pixel sound out whether occur color change, if just in time changed, now pixel is color to note four direction is b 1, b 2, b 3, b 4, its color is designated as color 1, color 2, color 3, color 4if met the following conditions, namely think that pixel P is positioned among the middle black coding lattice of angle point tracker, otherwise, continue scanning;
Described satisfy condition for:
Color 1, color 2, color 3, color 4it is identical color;
(b 3?b 1) and (b 2?b 4) being all greater than minimum coding lattice size, described minimum coding lattice size is set to 6 pixels;
(b 3?b 1) and (b 2?b 4) being all less than maximum coding lattice size, described maximum coding lattice size is set to 30 pixels.
Further, in described step 3:
The described sender display frequency f according to extraction dwith take over party's filming frequency f cdetermine that the step adopting page selection or page synchronization algorithm to obtain the Quick Response Code page is:
A. f is worked as d≤ 1/2f ctime, take over party, transmit leg often opens that the Quick Response Code page is minimum is photographed twice, therefore uses page selection algorithm, and the sequence number extracted by head is picked out same page and selects the minimum page of blur level for decoding;
B. 1/2f is worked as c<f d<f ctime, take over party, transmit leg often opens the Quick Response Code page can only be photographed 1 complete page, and in the process of shooting the 2nd time, transmit leg mobile phone screen has refreshed as the next frame Quick Response Code page, now adopts page synchronization algorithm; Wherein, give tacit consent to sender display frequency and be less than f dtake over party's filming frequency f c, otherwise partial page cannot read; Wherein, adopt page synchronization algorithm, from two-dimension code image header information, obtain this page synchronization frame marker character; With 00,01,10,11 cyclically mark the continuous print page, defining the difference that each page marks accords with and its previous page marks accords with is 1, and the difference of 1 page of being separated by is 2, and the difference of 2 pages of being separated by is 3, two colors arranged about identification page synchronization frame from top to bottom, represent color difference when recognizing color and changing with dt:
A.dt=0: illustrate that this two-dimension code image is a complete Quick Response Code page;
B.dt=1: illustrate that this Quick Response Code is put together by two adjacent Quick Response Code pages, the place that page synchronization frame color changes is seam crossing, just can be able to recover except the original Quick Response Code page by reconfiguring;
C.dt >=1: in the middle of illustrating, some page does not photograph completely.
Further, in described step 4:
The described position step of the steady arm central point of row in the middle of code area that finds is:
Step 4.1: the steady arm placing 3 row black in left, center, right, whole code area, often one, row steady arm interval coding lattice, position in order to steady arm is easy to detect and determines, code area coding uses white, red, green, blue four kinds of colors, then accurately orients the position of coding lattice;
Step 4.2: represent the transverse and longitudinal coordinate position in the Quick Response Code page with x, y, uses center adjustment algorithm by i-th code locator position (x i, y i) calculate the i-th+1 code locator (x i+1, y i+1) position; Described step 4.2 comprises the steps:
Step 4.2.1: with (x i+1, y i+1) centered by, BST finds out all black pixel points in the rectangle frame of the length of side;
Step 4.2.2: the mean value calculating black picture element position in rectangle frame, gives (x by its assignment i+1, y i+1);
Step 4.2.3: repeat step step 4.2.1 and step 4.2.2; Until (x i+1, y i+1) converge on a stable value;
Wherein, BST represents the vertical length of the coding lattice of the central black of upper left corner angle point tracker;
Step 4.3: the position of the steady arm central point of row in the middle of calculating; Described step 4.3 comprises the steps:
Step 4.3.1: using the length of side be 3 × BST rectangle as Search Area, scan from the pixel in the upper left corner, if not black pixel point, just continue scanning, otherwise just to search for four direction from current pixel;
Step 4.3.2: if black pixel point, then descend left and right four direction to sound out, until be not the point of black pixel point thereon; If had:
BSmin≤bu+bd≤BSmax and BSmin≤bi+br≤BSmax
The black picture element then searched is exactly the pixel of middle first code locator;
Wherein, bu, bi, bd and br represent upwards, left, downwards with the quantity of searching for the pixel of passing by the right, and the minimum value of BSmin, BSmax presentation code lattice size and maximal value;
After step 4.3.3: the first code locator finds, use center adjustment algorithm to find its central point, then find other steady arms of these row; Described center adjustment algorithm step is:
Step 4.3.3.1: with (xi+1; Yi+1), centered by, BST finds out all black pixel points in the rectangle frame of the length of side;
Step 4.3.3.2: the mean value calculating black picture element position in rectangle frame, gives (xi+1 by its assignment; Yi+1);
Step 4.3.3.3: repeat step 4.3.3.1 and 4.3.3.2 until (xi+1; Yi+1) a stable value is converged on.
Further, in described step 5:
Described use steady arm location coding lattice step is: suppose that left, middle row steady arm point-to-point transmission has n-1 lattice of encoding, then position (the x of i-th coding lattice i, y i) computing method are as follows:
x i = ( 1 - i n ) x l + i n x m a n d y i = ( 1 - i n ) y l + i n y m .
Wherein, (x i, y i) and (x m, y m) represent the left side of this row, the position of middle row steady arm; Equally, with the position of the coding lattice of this formulae discovery right half part, for the row not having steady arm, then calculate Far Left, centre, rightmost coding lattice position then as steady arm.
Further, in described step 6:
Described HSV Model Identification five kinds of color steps are:
Step 6.1: calculate luminance threshold Tv:
T v=μV b+(1-μ)V o
Wherein, Vb is the mean flow rate that brightness is less than the pixel of 0.1, and Vo is the mean flow rate of other pixels, and μ is a coefficient that can balance the threshold value between black and other four kinds of colors, usually get 0< μ <1, this method gets μ=0.4;
Step 6.2: saturation degree threshold value Tsat=0.41 is set;
Step 6.3: when brightness is less than Tv, pixel is black, no person, if saturation degree is less than Tsat, so this pixel is white, if a pixel is neither black neither be white, investigates its tone hue so further, if there are 60 ° of <hue<180 °, so this pixel is green, if 180 ° of <hue<300 °, so this pixel is blue, if below not, be redness.
Further, described retransmission mechanism is: by modulating flicker frequency and the luminance coding feedback information of LED.
The invention has the beneficial effects as follows:
The present invention compares with the short-range communication scheme based on radio-frequency technique, and the direction that screen-camera camera connects and distance can control easily, therefore, it is possible to protection privacy and communication safety;
The present invention can be natural opposing frequency interferences, therefore there is high dirigibility and application scenarios widely;
Utilize RainBar to achieve the secret key agreement protocol of Diffie – Hellman based on high power capacity color 2 D code stream, finally can realize the safe and reliable communication of different stage between smart mobile phone.
Accompanying drawing explanation
fig. 1for method flow of the present invention figure.
Embodiment
as Fig. 1, below in conjunction with embodiment and accompanying drawingthe present invention is described in further detail, but embodiments of the present invention are not limited thereto.
a kind of mobile platform safety communicating method based on color 2 D code, comprising:
Step 1: transmit leg is according to the size of self shaking degree adaptive generation coding lattice;
Concrete is: utilize the accelerometer accelerometers in mobile phone to obtain the mobile phone situation of rocking and adjust the size generating coding lattice; If accelerator measures the acceleration>1.2g of mobile phone, then the size blocksize of coding lattice is multiplied by 1.5, namely 15 × 15 pixel p ixel, until hard disk error rate BER is less than 0.01, otherwise continues to be multiplied by 1.5; If now accelerometer acceleration<1.2g, then by the size blocksize reduction 1 per second pixel p ixel of coding lattice, until hard disk error rate BER is close to 0.01, coding lattice is now of a size of most suitable size;
Step 2: transmit leg generates header information and RS coding;
Header information stores the mark and authorization information of often opening the Quick Response Code page;
RS coding is a kind of forward error correction channel with very strong EDC error detection and correction ability; What described transmit leg generation header information was concrete is: first Quick Response Code header information comprises sequence number, transmit leg Quick Response Code display frequency, file type, stem School Affairs, and other Quick Response Code header informations comprise sequence number and stem School Affairs.
Sequence number uniquely tagged often opens Quick Response Code, and whether its most significant digit (MSB) indicates current two-dimension frame to be last frame in whole file transfer, and other 15bits can represent 215 different pages, the information of most multipotency coding about 100M.Transmit leg Quick Response Code display frequency is used for and take over party's filming frequency compares, to select the mode recovering the page.File type is labeled with the file type of transmission.Stem School Affairs is for often opening the integrality of the information data of Quick Response Code coding after checking decoding.
What transmit leg generation RS coding was concrete is: the integer field of given 256 bytes, block length n symbol, a message-length k symbol, RS (n, k) code can correct at most (n-k)/2 byte mistake, check out at most n-k byte mistake.In coding lattice, be eachly called that RS encodes by the byte of encoding.
Step 3: take over party's camera photographs the Quick Response Code page at every turn, first the brightness and blur level of often opening two-dimension code image is evaluated and tested, detection and positioning angle point tracker again, angle point tracker is utilized to navigate to two angle points above the Quick Response Code page, and then the information extracted in header information, according to the sender display frequency f extracted dwith take over party's filming frequency f cdetermine to adopt the page to select or the page synchronization algorithm acquisition Quick Response Code page;
The step that two-dimension code image blur level is often opened in described evaluation and test is:
3. first each pixel p blur level DOB is defined as:
DOB p = &Sigma; Y &Element; { R , G , B } m i n ( | 255 - Y | , Y ) 3
Wherein, Y is the RGB component of pixel p;
4. then the two-dimension code image photographed is equally divided into upper left, upper right, lower-left, bottom right four part, the N number of pixel of every part stochastic sampling, then the DOB of whole two-dimension code image is defined as:
DOB i m g = &Sigma; p DOB p 4 N DOB i m g = &Sigma; p DOB p 4 N
The step of described detection and positioning angle point tracker is: angle point tracker is positioned at Quick Response Code page upper left, upper right two angle points, the angle point tracker of left upper is 8 black coding lattices round 1 green coding lattice, and the angle point tracker at upper right corner place is 8 black coding lattices round 1 red coding lattice; When carrying out Corner Detection, left upper is lined by line scan from left to right, upper right corner place turns left from the right side and lines by line scan, until scan the pixel P of a black, again respectively to its up and down four direction one by one pixel sound out whether occur color change, if just in time changed, now pixel is color to note four direction is b 1, b 2, b 3, b 4, its color is designated as color 1, color 2, color 3, color 4if met the following conditions, namely think that pixel P is positioned among the middle black coding lattice of angle point tracker, otherwise, continue scanning;
Described satisfy condition for:
Color 1, color 2, color 3, color 4it is identical color;
(b 3?b 1) and (b 2?b 4) being all greater than minimum coding lattice size, described minimum coding lattice size is set to 6 pixels;
(b 3?b 1) and (b 2?b 4) being all less than maximum coding lattice size, described maximum coding lattice size is set to 30 pixels.
The described sender display frequency f according to extraction dwith take over party's filming frequency f cdetermine that the step adopting page selection or page synchronization algorithm to obtain the Quick Response Code page is:
A. as fd≤1/2fc, take over party, transmit leg often opens that the Quick Response Code page is minimum is photographed twice, therefore uses page selection algorithm, and the sequence number extracted by head is picked out same page and selects the minimum page of blur level for decoding;
B. as 1/2fc<fd<fc, take over party, transmit leg often opens the Quick Response Code page can only be photographed 1 complete page, in the process of shooting the 2nd time, transmit leg mobile phone screen has refreshed as the next frame Quick Response Code page, now adopts page synchronization algorithm; Wherein, acquiescence sender display frequency is less than fd take over party's filming frequency fc, otherwise partial page cannot read;
Wherein, adopt page synchronization algorithm, from two-dimension code image header information, obtain this page synchronization frame marker character; With 00,01,10,11 cyclically mark the continuous print page, defining the difference that each page marks accords with and its previous page marks accords with is 1, and the difference of 1 page of being separated by is 2, and the difference of 2 pages of being separated by is 3, such as 01-00=1, then its difference=1,00-11=1,11-00=3, two colors arranged about identification page synchronization frame from top to bottom, represent color difference when recognizing color and changing with dt:
A.dt=0: illustrate that this two-dimension code image is a complete Quick Response Code page;
B.dt=1: illustrate that this Quick Response Code is put together by two adjacent Quick Response Code pages, the place that page synchronization frame color changes is seam crossing, just can be able to recover except the original Quick Response Code page by reconfiguring;
C.dt >=1: in the middle of illustrating, some page does not photograph completely.
Step 4: the Quick Response Code page utilizing step 3 to obtain, adopts progressive steady arm location algorithm, and the basis of the steady arm of a upper known location calculates the position of next steady arm, finds the left, center, right three row black steady arm of code area;
The described position step of the steady arm central point of row in the middle of code area that finds is:
Step 4.1: the steady arm placing 3 row black in left, center, right, whole code area, often one, row steady arm interval coding lattice, position in order to steady arm is easy to detect and determines, code area coding uses white, red, green, blue four kinds of colors, then accurately orients the position of coding lattice; Thus prevent due to camera lens distort bring two-dimension code image distortion cause location mistake(even if the image of overall serious distortion distortion, each coding lattice remains the square of comparison rule).
Step 4.2: represent the transverse and longitudinal coordinate position in the Quick Response Code page with x, y, uses center adjustment algorithm by i-th code locator position (x i, y i) calculate the i-th+1 code locator (x i+1, y i+1) position; Described step 4.2 comprises the steps:
Step 4.2.1: with (x i+1, y i+1) centered by, BST finds out all black pixel points in the rectangle frame of the length of side;
Step 4.2.2: the mean value calculating black picture element position in rectangle frame, gives (x by its assignment i+1, y i+1);
Step 4.2.3: repeat step step 4.2.1 and step 4.2.2; Until (x i+1, y i+1) converge on a stable value;
Wherein, BST represents the vertical length of the coding lattice of the central black of upper left corner angle point tracker;
Step 4.3: the position of the steady arm central point of row in the middle of calculating; Described step 4.3 comprises the steps:
Step 4.3.1: using the length of side be 3 × BST rectangle as Search Area, scan from the pixel in the upper left corner, if not black pixel point, just continue scanning, otherwise just to search for four direction from current pixel;
Step 4.3.2: if black pixel point, then descend left and right four direction to sound out, until be not the point of black pixel point thereon; If had:
BSmin≤bu+bd≤BSmax and BSmin≤bi+br≤BSmax
The black picture element then searched is exactly the pixel of middle first code locator;
Wherein, bu, bi, bd and br represent upwards, left, downwards with the quantity of searching for the pixel of passing by the right, and the minimum value of BSmin, BSmax presentation code lattice size and maximal value;
After first code locator finds, use center adjustment algorithm to find its central point, then find other steady arms of these row.
Described center adjustment algorithm step is:
Step 4.1: with (xi+1; Yi+1), centered by, BST finds out all black pixel points in the rectangle frame of the length of side;
Step 4.2: the mean value calculating black picture element position in rectangle frame, gives (xi+1 by its assignment; Yi+1);
Step 4.3: repeat step1 and step2 until (xi+1; Yi+1) a stable value is converged on.
Step 5: the coding lattice using left column and middle row steady arm location left-half, the coding lattice of middle row and right row steady arm location right half part, thus accurately orient code area;
Described use steady arm location coding lattice step is: suppose that left, middle row steady arm point-to-point transmission has n-1 lattice of encoding, then position (the x of i-th coding lattice i, y i) computing method are as follows:
x i = ( 1 - i n ) x l + i n x m a n d y i = ( 1 - i n ) y l + i n y m .
Wherein, (x i, y i) and (x m, y m) represent the left side of this row, the position of middle row steady arm; Equally, with the position of the coding lattice of this formulae discovery right half part, for the row not having steady arm, then calculate Far Left, centre, rightmost coding lattice position then as steady arm.
Step 6: average noise reduction is carried out to the color of each coding lattice, and carries out colour recognition based on HSV model;
Described HSV Model Identification five kinds of color steps are:
Step 6.1: calculate luminance threshold Tv:
T v=μV b+(1-μ)V o
Wherein, Vb is the mean flow rate that brightness is less than the pixel (thinking black) of 0.1, Vo is the mean flow rate of other pixels, μ is a coefficient that can balance the threshold value between black and other four kinds of colors, usually get 0< μ <1, this method gets μ=0.4;
Step 6.2: because saturation degree changes seldom at different brightnesses, can be considered constant, therefore saturation degree threshold value Tsat=0.41 is set;
Step 6.3: when brightness is less than Tv, pixel is black, no person, if saturation degree is less than Tsat, so this pixel is white, if a pixel is neither black neither be white, investigates its tone hue so further, if there are 60 ° of <hue<180 °, so this pixel is green, if 180 ° of <hue<300 °, so this pixel is blue, if below not, be redness.
Step 7: the error correction of RS code is carried out to the data that each Quick Response Code page extracts, then CRC check is carried out to the information after error correction, for the page exceeding error correction scope and lose in the transmission, utilize the sequence number of this page of light sensor LED-LightSensor channel feedback, then by feedback processing, this page is retransmitted; Described retransmission mechanism is: the information that feedback often opens the Quick Response Code page is a sequence number, and quantity of information is little, therefore by flicker frequency and the luminance coding feedback information of modulation LED.
Should be understood that, the part that this instructions does not elaborate all belongs to prior art.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly belongs to those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be with claimprotection domain be as the criterion.

Claims (10)

1., based on a mobile platform safety communicating method for color 2 D code, it is characterized in that, comprising:
Step 1: transmit leg is according to the size of self shaking degree adaptive generation coding lattice;
Step 2: transmit leg generates header information and RS coding;
Step 3: take over party's camera photographs the Quick Response Code page at every turn, first the brightness and blur level of often opening two-dimension code image is evaluated and tested, detection and positioning angle point tracker again, angle point tracker is utilized to navigate to two angle points above the Quick Response Code page, and then the information extracted in header information, according to the sender display frequency f extracted dwith take over party's filming frequency f cdetermine to adopt the page to select or the page synchronization algorithm acquisition Quick Response Code page;
Step 4: the Quick Response Code page utilizing step 3 to obtain, adopts progressive steady arm location algorithm, and the basis of the steady arm of a upper known location calculates the position of next steady arm, finds the left, center, right three row black steady arm of code area;
Step 5: the coding lattice using left column and middle row steady arm location left-half, the coding lattice of middle row and right row steady arm location right half part, thus accurately orient code area;
Step 6: average noise reduction is carried out to the color of each coding lattice, and carries out colour recognition based on HSV model;
Step 7: the error correction of RS code is carried out to the data that each Quick Response Code page extracts, then CRC check is carried out to the information after error correction, for the page exceeding error correction scope and lose in the transmission, utilize the sequence number of this page of light sensor LED-LightSensor channel feedback, then by feedback processing, this page is retransmitted.
2. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, is characterized in that, the transmit leg described in described step 1 is according to the size of self shaking degree adaptive generation coding lattice; Concrete is: utilize the accelerometer accelerometers in mobile phone to obtain the mobile phone situation of rocking and adjust the size generating coding lattice; If accelerator measures the acceleration>1.2g of mobile phone, then the size blocksize of coding lattice is multiplied by 1.5, namely 15 × 15 pixel p ixel, until hard disk error rate BER is less than 0.01, otherwise continues to be multiplied by 1.5; If now accelerometer acceleration<1.2g, then by the size blocksize reduction 1 per second pixel p ixel of coding lattice, until hard disk error rate BER is close to 0.01, coding lattice is now of a size of most suitable size.
3. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, it is characterized in that, in described step 2, what transmit leg generation header information was concrete is: first Quick Response Code header information comprises sequence number, transmit leg Quick Response Code display frequency, file type, stem School Affairs, and other Quick Response Code header informations comprise sequence number and stem School Affairs;
What transmit leg generation RS coding was concrete is: the integer field of given 256 bytes, block length n symbol, a message-length k symbol, and RS (n, k) code can correct at most (n-k)/2 byte error, checks out at most n-k byte error; In coding lattice, be eachly called that RS encodes by the byte of encoding.
4. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, is characterized in that, in described step 3:
The step that two-dimension code image blur level is often opened in evaluation and test is:
1. first each pixel p blur level DOB is defined as:
DOB p = &Sigma; Y &Element; { R , G , B } m i n ( | 255 - Y | , Y ) 3
Wherein, Y is the RGB component of pixel p;
2. then the two-dimension code image photographed is equally divided into upper left, upper right, lower-left, bottom right four part, the N number of pixel of every part stochastic sampling, then the DOB of whole two-dimension code image is defined as:
DOB i m g = &Sigma; p DOB p 4 N DOB i m g = &Sigma; p DOB p 4 N .
5. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, is characterized in that, in described step 3:
The step of described detection and positioning angle point tracker is: angle point tracker is positioned at Quick Response Code page upper left, upper right two angle points, the angle point tracker of left upper is 8 black coding lattices round 1 green coding lattice, and the angle point tracker at upper right corner place is 8 black coding lattices round 1 red coding lattice; When carrying out Corner Detection, left upper is lined by line scan from left to right, upper right corner place turns left from the right side and lines by line scan, until scan the pixel P of a black, again respectively to its up and down four direction one by one pixel sound out whether occur color change, if just in time changed, now pixel is color to note four direction is b 1, b 2, b 3, b 4, its color is designated as color 1, color 2, color 3, color 4if met the following conditions, namely think that pixel P is positioned among the middle black coding lattice of angle point tracker, otherwise, continue scanning;
Described satisfy condition for:
Color 1, color 2, color 3, color 4it is identical color;
(b 3?b 1) and (b 2?b 4) being all greater than minimum coding lattice size, described minimum coding lattice size is set to 6 pixels;
(b 3?b 1) and (b 2?b 4) being all less than maximum coding lattice size, described maximum coding lattice size is set to 30 pixels.
6. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, is characterized in that, in described step 3:
The described sender display frequency f according to extraction dwith take over party's filming frequency f cdetermine that the step adopting page selection or page synchronization algorithm to obtain the Quick Response Code page is:
A. f is worked as d≤ 1/2f ctime, take over party, transmit leg often opens that the Quick Response Code page is minimum is photographed twice, therefore uses page selection algorithm, and the sequence number extracted by head is picked out same page and selects the minimum page of blur level for decoding;
B. 1/2f is worked as c<f d<f ctime, take over party, transmit leg often opens the Quick Response Code page can only be photographed 1 complete page, and in the process of shooting the 2nd time, transmit leg mobile phone screen has refreshed as the next frame Quick Response Code page, now adopts page synchronization algorithm; Wherein, give tacit consent to sender display frequency and be less than f dtake over party's filming frequency f c, otherwise partial page cannot read;
Wherein, adopt page synchronization algorithm, from two-dimension code image header information, obtain this page synchronization frame marker character; With 00,01,10,11 cyclically mark the continuous print page, defining the difference that each page marks accords with and its previous page marks accords with is 1, and the difference of 1 page of being separated by is 2, and the difference of 2 pages of being separated by is 3, two colors arranged about identification page synchronization frame from top to bottom, represent color difference when recognizing color and changing with dt:
A.dt=0: illustrate that this two-dimension code image is a complete Quick Response Code page;
B.dt=1: illustrate that this Quick Response Code is put together by two adjacent Quick Response Code pages, the place that page synchronization frame color changes is seam crossing, just can be able to recover except the original Quick Response Code page by reconfiguring;
C.dt >=1: in the middle of illustrating, some page does not photograph completely.
7. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, is characterized in that, in described step 4:
The described position step of the steady arm central point of row in the middle of code area that finds is:
Step 4.1: the steady arm placing 3 row black in left, center, right, whole code area, often one, row steady arm interval coding lattice, position in order to steady arm is easy to detect and determines, code area coding uses white, red, green, blue four kinds of colors, then accurately orients the position of coding lattice;
Step 4.2: represent the transverse and longitudinal coordinate position in the Quick Response Code page with x, y, uses center adjustment algorithm by i-th code locator position (x i, y i) calculate the i-th+1 code locator (x i+1, y i+1) position; Described step 4.2 comprises the steps:
Step 4.2.1: with (x i+1, y i+1) centered by, BST finds out all black pixel points in the rectangle frame of the length of side;
Step 4.2.2: the mean value calculating black picture element position in rectangle frame, gives (x by its assignment i+1, y i+1);
Step 4.2.3: repeat step step 4.2.1 and step 4.2.2; Until (x i+1, y i+1) converge on a stable value;
Wherein, BST represents the vertical length of the coding lattice of the central black of upper left corner angle point tracker;
Step 4.3: the position of the steady arm central point of row in the middle of calculating; Described step 4.3 comprises the steps:
Step 4.3.1: using the length of side be 3 × BST rectangle as Search Area, scan from the pixel in the upper left corner, if not black pixel point, just continue scanning, otherwise just to search for four direction from current pixel;
Step 4.3.2: if black pixel point, then descend left and right four direction to sound out, until be not the point of black pixel point thereon; If had:
BSmin≤bu+bd≤BSmax and BSmin≤bi+br≤BSmax
The black picture element then searched is exactly the pixel of middle first code locator;
Wherein, bu, bi, bd and br represent upwards, left, downwards with the quantity of searching for the pixel of passing by the right, and the minimum value of BSmin, BSmax presentation code lattice size and maximal value;
After first code locator finds, use center adjustment algorithm to find its central point, then find other steady arms of these row.
8. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, is characterized in that, in described step 5:
Described use steady arm location coding lattice step is: suppose that left, middle row steady arm point-to-point transmission has n-1 lattice of encoding, then position (the x of i-th coding lattice i, y i) computing method are as follows:
x i = ( 1 - i n ) x l + i n x m a n d y i = ( 1 - i n ) y l + i n y m .
Wherein, (x i, y i) and (x m, y m) represent the left side of this row, the position of middle row steady arm; Equally, with the position of the coding lattice of this formulae discovery right half part, for the row not having steady arm, then calculate Far Left, centre, rightmost coding lattice position then as steady arm.
9. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, is characterized in that, in described step 6:
Described HSV Model Identification five kinds of color steps are:
Step 6.1: calculate luminance threshold Tv:
T v=μV b+(1-μ)V o
Wherein, Vb is the mean flow rate that brightness is less than the pixel of 0.1, and Vo is the mean flow rate of other pixels, and μ is a coefficient that can balance the threshold value between black and other four kinds of colors, usually get 0< μ <1, this method gets μ=0.4;
Step 6.2: saturation degree threshold value Tsat=0.41 is set;
Step 6.3: when brightness is less than Tv, pixel is black, no person, if saturation degree is less than Tsat, so this pixel is white, if a pixel is neither black neither be white, investigates its tone hue so further, if there are 60 ° of <hue<180 °, so this pixel is green, if 180 ° of <hue<300 °, so this pixel is blue, if below not, be redness.
10. a kind of mobile platform safety communicating method based on color 2 D code according to claim 1, is characterized in that, in described step 7: described retransmission mechanism is: by modulating flicker frequency and the luminance coding feedback information of LED.
CN201510549552.2A 2015-08-31 2015-08-31 Colored two-dimensional code based mobile platform security communication method Pending CN105117758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510549552.2A CN105117758A (en) 2015-08-31 2015-08-31 Colored two-dimensional code based mobile platform security communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510549552.2A CN105117758A (en) 2015-08-31 2015-08-31 Colored two-dimensional code based mobile platform security communication method

Publications (1)

Publication Number Publication Date
CN105117758A true CN105117758A (en) 2015-12-02

Family

ID=54665741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510549552.2A Pending CN105117758A (en) 2015-08-31 2015-08-31 Colored two-dimensional code based mobile platform security communication method

Country Status (1)

Country Link
CN (1) CN105117758A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105680915A (en) * 2016-04-05 2016-06-15 南京新与力文化传播有限公司 Wireless near field communication method and system based on display screen and camera link
CN107657199A (en) * 2016-07-25 2018-02-02 李威勋 Mobile device, verification device and verification method thereof
CN107707924A (en) * 2017-09-27 2018-02-16 天津大学 A kind of camera based on frequency constraint and screen communication means
CN108416405A (en) * 2018-03-12 2018-08-17 北京知道创宇信息技术有限公司 2 D code verification method and system
CN109635578A (en) * 2018-12-07 2019-04-16 上海交通大学 A kind of safe two dimensional code communication means based on non-linear space frequency characteristic
CN112733567A (en) * 2021-01-15 2021-04-30 深圳市豪恩汽车电子装备股份有限公司 Motor vehicle two-dimension code identification method and device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065177A (en) * 2012-12-14 2013-04-24 苏州阔地网络科技有限公司 Coding method and system of two-dimension code
CN104239927A (en) * 2014-08-01 2014-12-24 周奇 Colored two-dimension code generating method and decoding method
CN104794518A (en) * 2015-05-06 2015-07-22 矽照光电(厦门)有限公司 Color two-dimension code generating method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065177A (en) * 2012-12-14 2013-04-24 苏州阔地网络科技有限公司 Coding method and system of two-dimension code
CN104239927A (en) * 2014-08-01 2014-12-24 周奇 Colored two-dimension code generating method and decoding method
CN104794518A (en) * 2015-05-06 2015-07-22 矽照光电(厦门)有限公司 Color two-dimension code generating method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
QIAN WANG等: "RainBar:Robust Application-driven Visual Communication using Color Barcodes", 《2015 IEEE 35TH INTERNATIONAL CONFERENCE ON DISTRIBUTED COMPUTING SYSTEMS 》 *
TIAN HAO等: "COBRA:Color Barcode Streaming for Smartphone Systems", 《MOBISYS "12 PROCEEDINGS OF THE 10TH INTERNATIONAL CONFERENCE ON MOBILE SYSTEMS, APPLICATIONS, AND SERVICES》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105680915A (en) * 2016-04-05 2016-06-15 南京新与力文化传播有限公司 Wireless near field communication method and system based on display screen and camera link
CN107657199A (en) * 2016-07-25 2018-02-02 李威勋 Mobile device, verification device and verification method thereof
CN107657199B (en) * 2016-07-25 2020-12-15 李威勋 Mobile device, verification device and verification method thereof
CN107707924A (en) * 2017-09-27 2018-02-16 天津大学 A kind of camera based on frequency constraint and screen communication means
CN108416405A (en) * 2018-03-12 2018-08-17 北京知道创宇信息技术有限公司 2 D code verification method and system
CN109635578A (en) * 2018-12-07 2019-04-16 上海交通大学 A kind of safe two dimensional code communication means based on non-linear space frequency characteristic
CN109635578B (en) * 2018-12-07 2020-11-10 上海交通大学 Safe two-dimensional code communication method based on nonlinear space frequency characteristics
CN112733567A (en) * 2021-01-15 2021-04-30 深圳市豪恩汽车电子装备股份有限公司 Motor vehicle two-dimension code identification method and device and computer readable storage medium
CN112733567B (en) * 2021-01-15 2023-12-12 深圳市豪恩汽车电子装备股份有限公司 Method and device for identifying two-dimension code of motor vehicle and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN105117758A (en) Colored two-dimensional code based mobile platform security communication method
US10970607B2 (en) Secure QR code using nonlinearity of spatial frequency in light
Wang et al. Rain bar: Robust application-driven visual communication using color barcodes
Boubezari et al. Smartphone camera based visible light communication
US20180191437A1 (en) A method for visible light communication using display colors and pattern types of display
CN110463206B (en) Image filtering method, device and computer readable medium
US9189827B2 (en) Video codes for encoding/decoding streaming data
US20160234191A1 (en) Method for transmitting authentication password and method for acquiring authentication password by mobile terminal
CN107835332A (en) It is superimposed the two-dimensional code generation method and device of man made noise&#39;s information
WO2018036279A1 (en) Method for performing near-field communication using rgb ambient light sensor of mobile terminal
Stafford et al. Tetris: Smartphone-to-smartphone screen-based visible light communication
US20190138063A1 (en) System and Process for Enabling Secure, Instant, and Anonymous Communication Between Physically Touching Devices
CN116846472A (en) Visible light communication method between television screen and smart phone
CN108305293A (en) The method and apparatus that a pair of of stereo-picture is created using at least one light-field camera
KR101794933B1 (en) Visible light communication method using display / light source matrix adaptive color and pattern types
KR102162102B1 (en) Video call mediating apparatus, method and computer readable recording medium thereof
CN107888288A (en) A kind of short distance visible light communication method and its hardware system based on mobile terminal
Sharma et al. All that glitters: Low-power spoof-resilient optical markers for augmented reality
Penubaku et al. An attempt to transfer information using light as a medium and camera as receiver
Yokar et al. A novel blur reduction technique for QR and ASCII coding in smartphone visible light communications
Zhan et al. Megalight: Learning-based color adaptation for barcode stream recognition over screen-camera links
CN115422986A (en) Processing method, processing apparatus, and storage medium
CN107682692A (en) The self-adapting detecting system and method for photoimaging communication
CN207835455U (en) A kind of hardware system of the short distance visible light communication method based on mobile terminal
Sasaki et al. Light source tracking system for A-QL based display-camera communication

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Wang Jian

Inventor after: Zhou Man

Inventor after: Lei Tao

Inventor after: Tan Ran

Inventor after: Li Jigun

Inventor after: Wang Zhibo

Inventor before: Wang Jian

Inventor before: Tan Ran

Inventor before: Zhou Man

Inventor before: Lei Tao

Inventor before: Li Jigun

Inventor before: Wang Zhibo

WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20151202