WO2015096462A1 - Method and system for focused display of 2-dimensional bar code - Google Patents

Method and system for focused display of 2-dimensional bar code Download PDF

Info

Publication number
WO2015096462A1
WO2015096462A1 PCT/CN2014/082081 CN2014082081W WO2015096462A1 WO 2015096462 A1 WO2015096462 A1 WO 2015096462A1 CN 2014082081 W CN2014082081 W CN 2014082081W WO 2015096462 A1 WO2015096462 A1 WO 2015096462A1
Authority
WO
WIPO (PCT)
Prior art keywords
dimensional code
display
camera
key information
resolution
Prior art date
Application number
PCT/CN2014/082081
Other languages
French (fr)
Chinese (zh)
Inventor
付仲平
袁永贵
汪雪林
Original Assignee
北京握奇智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京握奇智能科技有限公司 filed Critical 北京握奇智能科技有限公司
Publication of WO2015096462A1 publication Critical patent/WO2015096462A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices
    • G06K7/1095Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices the scanner comprising adaptations for scanning a record carrier that is displayed on a display-screen or the like
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10712Fixed beam scanning

Definitions

  • the invention belongs to the technical field of image processing, and in particular relates to a method and system for focusing display of two-dimensional codes.
  • a bunch of keys In modern business activities, achievable applications are very broad, such as: product anti-counterfeiting / traceability, advertising push, website link, data download, commodity trading, positioning / navigation, electronic voucher, vehicle management, information transfer, business card exchange, wi fi Eat together and so on.
  • the current QR code scanning uses the camera + high-resolution display to display the image captured by the camera in real time on the screen, and the imaging information allows the user to adjust the shooting and framing position.
  • This method has higher requirements on the back-end display screen, higher power consumption and cost, and is not suitable for use on a two-dimensional code scanning device of a low-resolution display, such as an OTP-type device.
  • the widely used OTP-type device is a blind shooting scheme without shooting finder.
  • the scanning result of the two-dimensional code is poor. The user experience is poor. Summary of the invention
  • an object of the present invention is to provide a two-dimensional code focusing display method and system for realizing display optimization of a two-dimensional code image on a low-resolution device such as OTP.
  • the technical solution adopted by the present invention is: A two-dimensional code focusing display method, comprising the following steps:
  • the key information includes coordinate information of a position detection pattern of the two-dimensional code
  • the photographing device refers to a device whose display screen resolution is lower than the resolution of the camera.
  • the key information in the imaging coordinates of the camera in the two-dimensional code image is Specific ways to map key information in the display coordinate system include:
  • the number of vertical pixels of the display screen is the number of vertical pixels of the display screen after the necessary information area is removed;
  • the information area refers to the area on the display for displaying the hardware information of the photographing device.
  • the two-dimensional code image is a QR code image.
  • the specific manner of reconstructing the contour of the two-dimensional code image according to the key information in the display screen coordinate system includes:
  • the coordinate points of the three position detection patterns of the two-dimensional code in the display coordinate system are respectively recorded as P 2 and P 3 , and P 3 is located at a diagonal position of the two-dimensional code;
  • a two-dimensional code focusing display system comprising:
  • a two-dimensional code image acquisition module configured to acquire a two-dimensional code image by a camera of the photographing device
  • a two-dimensional code key information extraction module configured to extract key information of the two-dimensional code in the two-dimensional code image
  • the information includes coordinate information of the position detection pattern of the two-dimensional code
  • the key information mapping module is configured to acquire camera resolution and display resolution of the photographing device, and map key information of the camera image in the two-dimensional code image according to a proportional relationship between the camera resolution and the display resolution.
  • the two-dimensional code image contour building module is configured to reconstruct the contour of the two-dimensional code image according to the key information in the display coordinate system, and send it to the display screen for display. Further, a two-dimensional code focus display system as described above, wherein the key information mapping module comprises:
  • the mapping ratio calculation unit is configured to calculate a key information mapping ratio, and the calculation manner is: calculating a ratio A of the number of horizontal pixels of the camera to the number of horizontal pixels of the display screen, and a ratio of the number of vertical pixels of the camera to the number of vertical pixels of the display screen B, the larger of the ratio A and the ratio B is used as a mapping ratio;
  • mapping unit configured to map key information in the imaging coordinates of the camera in the two-dimensional code image to key information in a display coordinate system according to the mapping ratio.
  • a two-dimensional code focus display system as described above, wherein the two-dimensional code image is a QR code image.
  • the two-dimensional code image contour building module comprises:
  • the two-dimensional code vertex calculation unit is configured to calculate the coordinates of the fourth vertex of the two-dimensional code image, and the calculation manner is as follows: the coordinate points of the three position detection patterns of the two-dimensional code in the display coordinate system are respectively recorded as P 2 and P 3 , ⁇ P 3 are located at the diagonal position of the two-dimensional code, and calculate the coordinates of the symmetry point ⁇ 4 of P 2 with respect to the line connecting ⁇ ⁇ 3 , P 2 , P 3 and P 4 Four vertices of the outline of the two-dimensional code;
  • a contour building unit is configured to construct a quadrilateral contour of the two-dimensional code from the four vertices to obtain a contour of the two-dimensional code image.
  • the beneficial effects of the present invention are as follows: The method and system according to the present invention, by not analyzing the feature information of the scanning target, abstracting the feature information of the scanning target, extracting the contour information and performing restoration to realize the framing position. Real-time feedback.
  • the method and system are out of the reliance on high-resolution display devices, and are particularly useful for QR code scanning devices that use low-resolution displays, such as on cost- and power-sensitive OTP devices.
  • FIG. 1 is a structural block diagram of a two-dimensional code focus display system according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a two-dimensional code focus display method according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a QR code position detection pattern in a specific embodiment
  • FIG. 5 is a schematic diagram of coordinates of three position detection patterns of a QR code in a specific embodiment
  • FIG. 6 is a schematic diagram of a QR code in a camera coordinate system in a specific embodiment
  • FIG. 7 is a schematic diagram showing the display of an image in a display coordinate system in a specific embodiment. detailed description
  • FIG. 1 is a structural block diagram of a two-dimensional code focus display system in a specific embodiment of the present invention, the system includes a two-dimensional code image acquisition module 1 1 , a two-dimensional code key information extraction module 1 2, a key information mapping module 1 3 and 2D code image contour building module 14, wherein:
  • the two-dimensional code image acquisition module 1 1 is configured to obtain a two-dimensional code image by using a camera of the photographing device;
  • the photographing device refers to a device whose display resolution is lower than the resolution of the camera;
  • the two-dimensional code key information extraction module 1 2 is configured to extract key information of the two-dimensional code in the two-dimensional code image; the key information includes coordinate information of a position detection pattern of the two-dimensional code;
  • the key information mapping module 1 3 is configured to acquire the resolution of the camera of the photographing device and the resolution of the display screen, and according to the proportional relationship between the resolution of the camera and the resolution of the display screen, the image of the two-dimensional code image is imaged under the imaging coordinates of the camera.
  • the key information is mapped to key information in the display coordinate system; the display resolution refers to the resolution of the display area for displaying the outline of the photographed object in the display screen; the module includes:
  • the mapping ratio calculation unit is configured to calculate a key information mapping ratio, and the calculation manner is: calculating a ratio A of the number of horizontal pixels of the camera to the number of horizontal pixels of the display screen, and a ratio of the number of vertical pixels of the camera to the number of vertical pixels of the display screen B, the larger of the ratio A and the ratio B is used as a mapping ratio;
  • mapping unit configured to map key information in the imaging coordinates of the camera in the two-dimensional code image to key information in a display coordinate system according to the mapping ratio.
  • the two-dimensional code image contour building module 14 is configured to reconstruct the contour of the two-dimensional code image according to the key information in the display coordinate system and send it to the display.
  • the original pattern is square
  • the image displayed on the display after shooting is not a standard square, and is a quadrangle such as a diamond or a rectangle, and the coordinate information of the position detection pattern under the calculated display resolution is obtained. , 3 ⁇ 4 can be constructed to get the outline of the quadrilateral.
  • the two-dimensional code image in this embodiment is a QR code image.
  • the two-dimensional code image contour building module 14 includes:
  • the two-dimensional code vertex calculation unit is configured to calculate the coordinates of the fourth vertex of the two-dimensional code image, and the calculation manner is as follows: the coordinate points of the three position detection patterns of the two-dimensional code in the display coordinate system are respectively recorded as P 2 and ⁇ 3 , ⁇ P 3 is located at the diagonal position of the two-dimensional code, and calculates the coordinates of the symmetry point ⁇ 4 of P 2 with respect to the line connecting ⁇ ⁇ 3 , and P 2 , P 3 and P 4 are two-dimensional codes.
  • a contour building unit is configured to construct a quadrilateral contour of the two-dimensional code from the four vertices to obtain a contour of the two-dimensional code image.
  • 2 shows a flow chart of a two-dimensional code focus display method based on the system shown in FIG. 1, the method comprising the following steps:
  • Step S 2 1 obtaining a two-dimensional code image through the camera
  • the two-dimensional code image is acquired by the camera of the photographing device, and the image is saved in the memory of the OTP device.
  • the photographing device in the specific embodiment refers to the resolution of the display screen being lower than the resolution of the camera.
  • a camera device such as an OTP device.
  • the camera When a two-dimensional code image is acquired by a photographing device having a display resolution lower than the resolution of the camera, the camera has a higher pixel of the camera, and the image obtained by the camera is a high-resolution image, but due to the lower resolution of the display screen, Sometimes it is not possible to completely restore the information captured by the camera to the display.
  • the present invention is a solution proposed for this problem.
  • the two-dimensional code scanning coded by the QR code model 2 method widely used in the present invention is taken as an example.
  • the two-dimensional code image is a QR code image.
  • Figure 3 shows a schematic diagram of the QR code.
  • the smallest element of the QR code black or white square
  • the QR code is composed of black and white modules, position detection patterns, time patterns, error correction levels and masks.
  • the format information of the code number, the data area, and the error correction code are combined.
  • the method of the present invention is mainly implemented by extracting information (shown by point P in Fig. 3) of the position detecting pattern portion in the QR code.
  • Step S22 extract key information of the two-dimensional code in the two-dimensional code image;
  • the key information of the two-dimensional code in the two-dimensional code image acquired in step S21 is extracted, and the key information includes coordinate information of the position detection pattern of the two-dimensional code, for example, the key information of the QR code image shown in FIG.
  • the coordinates of the pattern are detected for three positions.
  • the purpose of this step is to extract the key information of the two-dimensional code in the two-dimensional code image acquired by the camera, that is, extract the coordinate information of the position detection pattern under the imaging target coordinate system of the camera.
  • the coordinate information of the three position detection patterns of the two-dimensional code in the imaging coordinates of the camera is obtained by the image processing algorithm, and the position information is abstracted into a single pixel point to save the coordinates.
  • the position detecting pattern includes a plurality of pixel points as a set of coordinate information
  • the coordinate position information of the vertex of the position detecting pattern is used as the key information in the present embodiment.
  • the coordinate points of the three position detection patterns of the QR code in the imaging coordinates of the camera are respectively represented as Pi, P 2 , and P 3 , and the specific coordinates of the three points are expressed as ( ⁇ , ⁇ ), and ⁇ is taken.
  • the values correspond to 1, 1, and 3.
  • the position detection pattern of the QR code is arranged at three corners of the QR code, as shown in Fig. 4, the ratio of the black and white modules (black and white pixels) for any position of the position detection pattern ⁇ , ⁇ , and C The ratio is 1: 1: 3: 1 : 1, so the key information of the QR code can be extracted from any direction, and the work efficiency is greatly improved, and high-speed reading can be supported.
  • Step S23 mapping key information in the imaging coordinates of the camera in the two-dimensional code image to key information in the coordinate system of the display screen according to the proportional relationship between the resolution of the camera and the resolution of the display screen;
  • the resolution of the display screen in the embodiment refers to the resolution of the display area for displaying the outline of the photographed object in the display screen, that is, the resolution of the display screen in the embodiment is not the resolution of the actual display screen, and It is the resolution of the display area of the photographing device that can be used to display the photographed image.
  • the display screen of a photographing device is an LCD screen
  • the resolution of the LCD screen is 128 ⁇ 64
  • the LCD screen has 1 28 ⁇ .
  • the area of 16 needs to be used to display other related hardware information of the device, etc.
  • the area of the display screen that can be used to display the photographed image is 128 X 48 , which is the display screen resolution in this embodiment.
  • the specific manner of mapping the key information of the two-dimensional code image into the key information in the display coordinate system includes:
  • the number of vertical pixels of the display screen is the number of vertical pixels of the display screen after the necessary information area is removed;
  • the display necessary information area refers to the hardware for displaying the photographing device on the display screen. The area of information.
  • the coordinate information of the key information in the camera photographing imaging coordinates is recorded as (P n X, PnY ), and the coordinate information in the mapped display coordinate system is recorded as (PnXi, ⁇ )»
  • the QR code For a camera with a resolution of 30W pixels (640 x 480), to effectively identify the coded information of the QR code, the QR code must be completely and clearly within its field of view, as shown in Figure 6.
  • the number of pixels cannot satisfy the complete display of the image information saved by the camera. Therefore, the coordinates in the high coordinate system need to be mapped to the low coordinate system to meet the needs of the display device.
  • the display screen in this embodiment takes an LCD screen of 128 ⁇ 64 resolution as an example, and removes a region of 1 28 ⁇ 16 (such as the power display area in FIG. 7) that displays necessary information, and the remaining area pixels for mapping are 128*48.
  • the area that matches the 640x480 image scale is: 64x48. So according to the ratio of 1 0 : 1
  • the key information of the two-dimensional code image under the camera resolution is mapped to the key information in the display coordinate system, that is, the coordinates (PnX, PnY) of each position information in the image saved by the camera are mapped to the coordinates of the projection field of the display field of view. (PnX , ⁇ ), as shown in Figure 7.
  • Step S24 reconstructing the contour image of the two-dimensional code image according to the key information of the mapped two-dimensional code; reconstructing the contour of the two-dimensional code image according to the key information in the display coordinate system obtained in step S23, and transmitting the contour to the display
  • the on-screen display that is, the contour information of the position detection pattern under the resolution of the display screen can be constructed to obtain the outline of the quadrilateral.
  • the contour of the QR code image is reconstructed based on the key information in the display coordinate system and sent to the display on the display in the following way:
  • the coordinate points of the three position detection patterns in the display coordinate system are respectively recorded as P 2 and P 3 , and ⁇ 3 is located at the diagonal position of the two-dimensional code;
  • Pi, P 2 , P 3 and P 4 are the four vertices of the two-dimensional code
  • a quadrilateral contour of the two-dimensional code is constructed from the four vertices and pattern information of the two-dimensional code is generated to obtain a two-dimensional code image.
  • the original pattern of the QR code is square. Due to the shooting angle problem, the pattern of the image and the camera area may not be a standard square, but a diamond, a rectangle or the like. Therefore, this situation should be considered in the reconstruction of the contour.
  • the quadrilateral is used to draw the contour.
  • the principle of drawing the contour is as follows: Know the coordinate point information of P l, P2, P 3, and find the P2 point relative to Pl, P 3
  • the coordinates of the symmetry point P4 of the line, P l, P2, P 3, and P4 are the four vertices of the quadrilateral, and the contour of the quadrilateral is drawn to the display device for display.
  • the contour of the two-dimensional code image in the display coordinate system can be obtained, and when the photographing device scans the two-dimensional code image according to the contour, the two-dimensional code image can be visually displayed on the display screen.
  • the contour greatly improves the recognizability of the QR code displayed on the display.
  • the two-dimensional code image in the present invention includes but is not limited to the QR code image, and is applicable to other two-dimensional code images, and only needs to extract the coordinate information of the position detection pattern in the two-dimensional code image obtained by the camera, and then According to the proportional relationship between the resolution of the camera and the resolution of the display, the coordinate information under the camera coordinate system is mapped to the coordinate information under the field of view of the display screen, and The coordinate information constructs the contour of the two-dimensional code image in the display coordinate system, and uses the contour as a reference standard for capturing the two-dimensional code image, so that the image captured by the camera can be clearly displayed in the display screen.
  • the method and system of the present invention are equally applicable to focus display of an image having a specific feature (key information) by extracting coordinate information of a specific feature of an image under camera imaging coordinates and mapping it to a display coordinate system. With coordinate information, you can reconstruct the outline of the image in the display coordinate system.

Abstract

Disclosed in the present invention are a method and system for focused display of a 2-dimensional bar code. At first, a 2-dimensional bar code image is obtained via a camera of a photographing device, and then the key information of a 2-dimensional bar code in the 2-dimensional bar code image is extracted, the proportional relation between the resolution of the camera of the photographing device and the resolution of a display area, which is used for displaying the outline of a photographed object, in a display screen is obtained, the coordinates of the key information of the 2-dimensional bar code image in a camera imaging coordinate system is proportionally mapped to the coordinates in a display screen coordinate system according to the proportional relation, and finally, information concerning the outline of the 2-dimensional bar code image is rebuilt according to the mapped key information of the 2-dimensional bar code in the 2-dimensional bar code image, and sent to the display screen for display purposes. According to the method and system disclosed in the present invention, an abstract analysis of the characteristic information of a scanned target is performed, and information concerning the outline of the target is extracted and restored to achieve a real-time feedback of view-finding locations, as a result, the dependency on high-resolution display equipment is no longer present; in addition, the method and system are particularly applicable for 2-dimensional bar code scanning equipment on which a low-resolution display screen is employed.

Description

一种二维码聚焦显示方法及系统  Two-dimensional code focusing display method and system
技术领域 Technical field
本发明属于图像处理技术领域, 具体涉及一种二维码聚焦显示的方法及 系统。  The invention belongs to the technical field of image processing, and in particular relates to a method and system for focusing display of two-dimensional codes.
二维码 ( 2_d imens i ona l ba r code ), 又称二维条码, 它是用特定的几何 图形按一定规律在平面 (二维方向) 上分布的黑白相间的图形, 是所有信息 数据的一把钥匙。 在现代商业活动中, 可实现的应用十分广泛, 如: 产品防 伪 /溯源、 广告推送、 网站链接、 数据下载、 商品交易、 定位 /导航、 电子凭 证、 车辆管理、 信息传递、 名片交流、 wi f i共同享等等。 A two-dimensional code (2_d imens i ona l ba r code ), also known as a two-dimensional bar code, is a black and white graphic that is distributed in a plane (two-dimensional direction) by a certain geometric pattern, and is all information data. A bunch of keys. In modern business activities, achievable applications are very broad, such as: product anti-counterfeiting / traceability, advertising push, website link, data download, commodity trading, positioning / navigation, electronic voucher, vehicle management, information transfer, business card exchange, wi fi Enjoy together and so on.
目前的二维码扫描,如手机扫描时是釆用摄像头 +高分辨率显示屏显示的 方式, 将摄像头捕获的图像实时显示在屏幕上, 通过成像信息供用户调整拍 摄和取景位置。 此种方式对后端显示屏幕的要求较高, 功耗和成本较高, 不 利于在低分辨率显示屏的二维码扫描设备上使用, 如 OTP类设备。 而目前在 OTP 类设备上广泛釆用的是无拍摄取景提示的盲拍方案, 对于非经常性操作 设备的使用者而言由于无法直观获得扫描位置的反馈, 故二维码扫描结果较 差, 用户体验较差。 发明内容  The current QR code scanning, such as mobile phone scanning, uses the camera + high-resolution display to display the image captured by the camera in real time on the screen, and the imaging information allows the user to adjust the shooting and framing position. This method has higher requirements on the back-end display screen, higher power consumption and cost, and is not suitable for use on a two-dimensional code scanning device of a low-resolution display, such as an OTP-type device. At present, the widely used OTP-type device is a blind shooting scheme without shooting finder. For users of non-recurring operation equipment, since the feedback of the scanning position cannot be obtained intuitively, the scanning result of the two-dimensional code is poor. The user experience is poor. Summary of the invention
针对现有技术中存在的缺陷, 本发明的目的在于提供一种二维码聚焦显 示方法及系统, 实现对 OTP等低分辨率设备上二维码图像的显示优化。 为实现上述目的,本发明釆用的技术方案为: 一种二维码聚焦显示方法, 包括以下步骤:  In view of the deficiencies in the prior art, an object of the present invention is to provide a two-dimensional code focusing display method and system for realizing display optimization of a two-dimensional code image on a low-resolution device such as OTP. In order to achieve the above object, the technical solution adopted by the present invention is: A two-dimensional code focusing display method, comprising the following steps:
( 1 ) 通过拍照设备的摄像头获取二维码图像;  (1) acquiring a two-dimensional code image through a camera of the photographing device;
( 2 )提取所述的二维码图像中二维码的关键信息; 所述的关键信息包括 二维码的位置探测图案的坐标信息;  (2) extracting key information of the two-dimensional code in the two-dimensional code image; the key information includes coordinate information of a position detection pattern of the two-dimensional code;
( 3 )获取拍照设备的摄像头分辨率和显示屏分辨率,根据摄像头分辨率 与显示屏分辨率的比例关系, 将所述的二维码图像中摄像头成像坐标下的关 键信息映射为显示屏坐标系下的关键信息; 所述的显示屏分辨率是指显示屏 中用于显示拍照对象轮廓的显示区域的分辨率; (3) Obtain the camera resolution and display resolution of the camera device, according to the camera resolution The key information of the camera imaging coordinates in the two-dimensional code image is mapped to the key information in the display coordinate system according to the ratio of the display resolution; the display resolution is used in the display screen Displaying the resolution of the display area of the outline of the photographed object;
( 4 )根据显示屏坐标系下的关键信息重建二维码图像的轮廓,并发送到 显示屏上显示。 进一步, 如上所述的一种二维码聚焦显示方法, 步骤(1 ) 中, 所述的拍 照设备是指显示屏分辨率低于摄像头分辨率的设备。 进一步, 如上所述的一种二维码聚焦显示方法, 步骤( 3 ) 中, 根据摄像 头分辨率与显示屏分辨率的比例关系, 将所述的二维码图像中摄像头成像坐 标下的关键信息映射为显示屏坐标系下的关键信息的具体方式包括:  (4) Reconstruct the outline of the QR code image according to the key information in the display coordinate system and send it to the display. Further, in the above two-dimensional code focus display method, in the step (1), the photographing device refers to a device whose display screen resolution is lower than the resolution of the camera. Further, in the above two-dimensional code focusing display method, in step (3), according to the proportional relationship between the resolution of the camera and the resolution of the display screen, the key information in the imaging coordinates of the camera in the two-dimensional code image is Specific ways to map key information in the display coordinate system include:
1 )计算摄像头横向像素个数与显示屏横向像素个数的比例 A, 以及摄像 头纵向像素个数与显示屏纵向像素个数的比例 B, 将比例 A与比例 B中的较 大者作为映射比例;  1) Calculate the ratio A of the number of horizontal pixels of the camera to the number of horizontal pixels of the display screen, and the ratio B of the number of vertical pixels of the camera to the number of vertical pixels of the display screen, and use the larger of the ratios A and B as the mapping ratio. ;
2 )按照所述的映射比例将所述的二维码图像中摄像头成像坐标下的关键 信息映射为显示屏坐标系下的关键信息。 进一步, 如上所述的一种二维码聚焦显示方法, 步骤 1 ) 中, 所述的显 示屏纵向像素个数为去掉显示必要信息区域后的显示屏的纵向像素个数; 所 述的显示必要信息区域是指显示屏上用于显示拍照设备硬件信息的区域。 再进一步, 如上所述的一种二维码聚焦显示方法, 步骤(1 ) 中, 所述的 二维码图像为 QR码图像。 更进一步, 如上所述的一种二维码聚焦显示方法, 步骤(4 ) 中, 根据显 示屏坐标系下的关键信息重建二维码图像轮廓的具体方式包括:  2) mapping the key information in the imaging coordinates of the camera in the two-dimensional code image to the key information in the display coordinate system according to the mapping ratio. Further, in the above two-dimensional code focus display method, in step 1), the number of vertical pixels of the display screen is the number of vertical pixels of the display screen after the necessary information area is removed; The information area refers to the area on the display for displaying the hardware information of the photographing device. Further, in the above two-dimensional code focus display method, in the step (1), the two-dimensional code image is a QR code image. Further, in the above two-dimensional code focus display method, in step (4), the specific manner of reconstructing the contour of the two-dimensional code image according to the key information in the display screen coordinate system includes:
将显示屏坐标系下二维码的三个位置探测图案的坐标点分别记为 P2 和 P3, P3位于二维码的对角线位置上; The coordinate points of the three position detection patterns of the two-dimensional code in the display coordinate system are respectively recorded as P 2 and P 3 , and P 3 is located at a diagonal position of the two-dimensional code;
计算 P2相对于 P3连线的对称点 P4的坐标, Pi、 P2、 P3和 P4为二维码 轮廓的四个顶点; Calculate the coordinates of P 2 with respect to the symmetry point P 4 of the P 3 line, and Pi, P 2 , P 3 and P 4 are two-dimensional codes. The four vertices of the outline;
根据四个顶点构建二维码的四边形轮廓, 得到二维码图像的轮廓。 一种二维码聚焦显示系统, 包括:  The quadrilateral contour of the two-dimensional code is constructed from the four vertices to obtain the contour of the two-dimensional code image. A two-dimensional code focusing display system, comprising:
二维码图像获取模块, 用于通过拍照设备的摄像头获取二维码图像; 二维码关键信息提取模块, 用于提取所述的二维码图像中二维码的关键 信息; 所述的关键信息包括二维码的位置探测图案的坐标信息;  a two-dimensional code image acquisition module, configured to acquire a two-dimensional code image by a camera of the photographing device; a two-dimensional code key information extraction module, configured to extract key information of the two-dimensional code in the two-dimensional code image; The information includes coordinate information of the position detection pattern of the two-dimensional code;
关键信息映射模块,用于获取拍照设备的摄像头分辨率和显示屏分辨率, 根据摄像头分辨率与显示屏分辨率的比例关系, 将所述的二维码图像中摄像 头成像坐标下的关键信息映射为显示屏坐标系下的关键信息; 所述的显示屏 分辨率是指显示屏中用于显示拍照对象轮廓的显示区域的分辨率;  The key information mapping module is configured to acquire camera resolution and display resolution of the photographing device, and map key information of the camera image in the two-dimensional code image according to a proportional relationship between the camera resolution and the display resolution. The key information in the display coordinate system; the display resolution refers to the resolution of the display area in the display screen for displaying the outline of the photographed object;
二维码图像轮廓构建模块, 用于根据显示屏坐标系下的关键信息重建二 维码图像的轮廓, 并发送到显示屏上显示。 进一步, 如上所述的一种二维码聚焦显示系统, 所述的关键信息映射模 块包括:  The two-dimensional code image contour building module is configured to reconstruct the contour of the two-dimensional code image according to the key information in the display coordinate system, and send it to the display screen for display. Further, a two-dimensional code focus display system as described above, wherein the key information mapping module comprises:
映射比例计算单元, 用于计算关键信息映射比例, 计算的方式为: 计算 摄像头横向像素个数与显示屏横向像素个数的比例 A, 以及摄像头纵向像素 个数与显示屏纵向像素个数的比例 B, 将比例 A与比例 B中的较大者作为映 射比例;  The mapping ratio calculation unit is configured to calculate a key information mapping ratio, and the calculation manner is: calculating a ratio A of the number of horizontal pixels of the camera to the number of horizontal pixels of the display screen, and a ratio of the number of vertical pixels of the camera to the number of vertical pixels of the display screen B, the larger of the ratio A and the ratio B is used as a mapping ratio;
映射单元, 用于按照所述的映射比例将所述的二维码图像中摄像头成像 坐标下的关键信息映射为显示屏坐标系下的关键信息。 再进一步, 如上所述的一种二维码聚焦显示系统, 所述的二维码图像为 QR码图像。 更进一步, 如上所述的一种二维码聚焦显示系统, 所述的二维码图像轮 廓构建模块包括:  And a mapping unit, configured to map key information in the imaging coordinates of the camera in the two-dimensional code image to key information in a display coordinate system according to the mapping ratio. Still further, a two-dimensional code focus display system as described above, wherein the two-dimensional code image is a QR code image. Further, a two-dimensional code focus display system as described above, wherein the two-dimensional code image contour building module comprises:
二维码顶点计算单元, 用于计算二维码图像第四个顶点的坐标, 计算方 式为: 将显示屏坐标系下二维码的三个位置探测图案的坐标点分别记为 P2和 P3, Ρ^α P3位于二维码的对角线位置上, 计算 P2相对于 Ρ^α Ρ3连线的 对称点 Ρ4的坐标, P2、 P3和 P4为二维码轮廓的四个顶点; The two-dimensional code vertex calculation unit is configured to calculate the coordinates of the fourth vertex of the two-dimensional code image, and the calculation manner is as follows: the coordinate points of the three position detection patterns of the two-dimensional code in the display coordinate system are respectively recorded as P 2 and P 3 , Ρ^α P 3 are located at the diagonal position of the two-dimensional code, and calculate the coordinates of the symmetry point Ρ 4 of P 2 with respect to the line connecting Ρ^α Ρ 3 , P 2 , P 3 and P 4 Four vertices of the outline of the two-dimensional code;
轮廓构建单元, 用于根据四个顶点构建二维码的四边形轮廓, 得到二维 码图像的轮廓。 本发明的有益效果在于: 本发明所述的方法及系统, 在无法显示完整拍 摄信息的情况下, 通过对扫描目标的特征信息进行抽象分析, 抽取其轮廓信 息进行还原, 以实现对取景位置的实时反馈。 该方法及系统脱离了对高分辨 率显示设备的依赖, 尤其适用于釆用低分辨率显示屏的二维码扫码设备, 如 在成本、 功耗敏感的 OTP设备上使用。 附图说明  A contour building unit is configured to construct a quadrilateral contour of the two-dimensional code from the four vertices to obtain a contour of the two-dimensional code image. The beneficial effects of the present invention are as follows: The method and system according to the present invention, by not analyzing the feature information of the scanning target, abstracting the feature information of the scanning target, extracting the contour information and performing restoration to realize the framing position. Real-time feedback. The method and system are out of the reliance on high-resolution display devices, and are particularly useful for QR code scanning devices that use low-resolution displays, such as on cost- and power-sensitive OTP devices. DRAWINGS
图 1为本发明具体实施方式中一种二维码聚焦显示系统的结构框图; 图 2为本发明具体实施方式中一种二维码聚焦显示方法的流程图; 图 3为具体实施方式中 QR码的示意图;  1 is a structural block diagram of a two-dimensional code focus display system according to an embodiment of the present invention; FIG. 2 is a flowchart of a two-dimensional code focus display method according to an embodiment of the present invention; FIG. Schematic diagram of the code;
图 4为具体实施方式中 QR码位置探测图案的示意图;  4 is a schematic diagram of a QR code position detection pattern in a specific embodiment;
图 5为具体实施方式中 QR码的三个位置探测图案的坐标示意图; 图 6为具体实施方式中 QR码在摄像头坐标系下的示意图;  5 is a schematic diagram of coordinates of three position detection patterns of a QR code in a specific embodiment; FIG. 6 is a schematic diagram of a QR code in a camera coordinate system in a specific embodiment;
图 7为具体实施方式中图像在显示屏坐标系下的显示示意图。 具体实施方式  FIG. 7 is a schematic diagram showing the display of an image in a display coordinate system in a specific embodiment. detailed description
下面结合说明书附图与具体实施方式对本发明做进一步的详细说明。 图 1 示出了本发明具体实施方式中一种二维码聚焦显示系统的结构框 图, 该系统包括二维码图像获取模块 1 1、 二维码关键信息提取模块 1 2、 关键 信息映射模块 1 3和二维码图像轮廓构建模块 14, 其中:  The present invention will be further described in detail below in conjunction with the drawings and specific embodiments. 1 is a structural block diagram of a two-dimensional code focus display system in a specific embodiment of the present invention, the system includes a two-dimensional code image acquisition module 1 1 , a two-dimensional code key information extraction module 1 2, a key information mapping module 1 3 and 2D code image contour building module 14, wherein:
二维码图像获取模块 1 1用于通过拍照设备的摄像头获取二维码图像;所 述的拍照设备是指显示屏分辨率低于摄像头分辨率的设备;  The two-dimensional code image acquisition module 1 1 is configured to obtain a two-dimensional code image by using a camera of the photographing device; the photographing device refers to a device whose display resolution is lower than the resolution of the camera;
二维码关键信息提取模块 1 2 用于提取所述的二维码图像中二维码的关 键信息; 所述的关键信息包括二维码的位置探测图案的坐标信息; 关键信息映射模块 1 3 用于获取拍照设备的摄像头的分辨率和显示屏的 分辨率, 根据摄像头分辨率与显示屏分辨率的比例关系, 将所述的二维码图 像中摄像头成像坐标下的关键信息映射为显示屏坐标系下的关键信息; 所述 的显示屏分辨率是指显示屏中用于显示拍照对象轮廓的显示区域的分辨率; 该模块包括: The two-dimensional code key information extraction module 1 2 is configured to extract key information of the two-dimensional code in the two-dimensional code image; the key information includes coordinate information of a position detection pattern of the two-dimensional code; The key information mapping module 1 3 is configured to acquire the resolution of the camera of the photographing device and the resolution of the display screen, and according to the proportional relationship between the resolution of the camera and the resolution of the display screen, the image of the two-dimensional code image is imaged under the imaging coordinates of the camera. The key information is mapped to key information in the display coordinate system; the display resolution refers to the resolution of the display area for displaying the outline of the photographed object in the display screen; the module includes:
映射比例计算单元, 用于计算关键信息映射比例, 计算的方式为: 计算 摄像头横向像素个数与显示屏横向像素个数的比例 A, 以及摄像头纵向像素 个数与显示屏纵向像素个数的比例 B, 将比例 A与比例 B中的较大者作为映 射比例;  The mapping ratio calculation unit is configured to calculate a key information mapping ratio, and the calculation manner is: calculating a ratio A of the number of horizontal pixels of the camera to the number of horizontal pixels of the display screen, and a ratio of the number of vertical pixels of the camera to the number of vertical pixels of the display screen B, the larger of the ratio A and the ratio B is used as a mapping ratio;
映射单元, 用于按照所述的映射比例将所述的二维码图像中摄像头成像 坐标下的关键信息映射为显示屏坐标系下的关键信息。  And a mapping unit, configured to map key information in the imaging coordinates of the camera in the two-dimensional code image to key information in a display coordinate system according to the mapping ratio.
二维码图像轮廓构建模块 14 用于根据显示屏坐标系下的关键信息重建 二维码图像的轮廓, 并发送到显示屏上显示。 对于二维码图像, 其原始图案 为正方形, 而拍摄后在显示屏上显示的图像不是标准的正方形, 为菱形或者 矩形等四边形, 根据计算得到的显示屏分辨率下的位置探测图案的坐标信, ¾ 即可构建得到四边形的轮廓。 本具体实施方式中的二维码图像为 QR码图像, 对于 QR码图像, 二维码图像轮廓构建模块 14包括:  The two-dimensional code image contour building module 14 is configured to reconstruct the contour of the two-dimensional code image according to the key information in the display coordinate system and send it to the display. For the two-dimensional code image, the original pattern is square, and the image displayed on the display after shooting is not a standard square, and is a quadrangle such as a diamond or a rectangle, and the coordinate information of the position detection pattern under the calculated display resolution is obtained. , 3⁄4 can be constructed to get the outline of the quadrilateral. The two-dimensional code image in this embodiment is a QR code image. For the QR code image, the two-dimensional code image contour building module 14 includes:
二维码顶点计算单元, 用于计算二维码图像第四个顶点的坐标, 计算方 式为: 将显示屏坐标系下二维码的三个位置探测图案的坐标点分别记为 P2和 Ρ3, Ρ^α P3位于二维码的对角线位置上, 计算 P2相对于 Ρ^α Ρ3连线的 对称点 Ρ4的坐标, P2、 P3和 P4为二维码轮廓的四个顶点; The two-dimensional code vertex calculation unit is configured to calculate the coordinates of the fourth vertex of the two-dimensional code image, and the calculation manner is as follows: the coordinate points of the three position detection patterns of the two-dimensional code in the display coordinate system are respectively recorded as P 2 and Ρ 3 , Ρ^α P 3 is located at the diagonal position of the two-dimensional code, and calculates the coordinates of the symmetry point Ρ 4 of P 2 with respect to the line connecting Ρ^α Ρ 3 , and P 2 , P 3 and P 4 are two-dimensional codes. The four vertices of the outline;
轮廓构建单元, 用于根据四个顶点构建二维码的四边形轮廓, 得到二维 码图像的轮廓。 图 2示出了基于图 1中所示系统的一种二维码聚焦显示方法的流程图, 该方法包括以下步骤:  A contour building unit is configured to construct a quadrilateral contour of the two-dimensional code from the four vertices to obtain a contour of the two-dimensional code image. 2 shows a flow chart of a two-dimensional code focus display method based on the system shown in FIG. 1, the method comprising the following steps:
步骤 S 2 1 : 过摄像头获取二维码图像;  Step S 2 1 : obtaining a two-dimensional code image through the camera;
通过拍照设备的摄像头获取二维码图像, 并将该图像保存到 OTP设备内 存中。 本具体实施方式中的拍照设备是指显示屏分辨率低于摄像头分辨率的 拍照设备, 例如 OTP设备。 The two-dimensional code image is acquired by the camera of the photographing device, and the image is saved in the memory of the OTP device. The photographing device in the specific embodiment refers to the resolution of the display screen being lower than the resolution of the camera. A camera device, such as an OTP device.
使用显示屏分辨率低于摄像头分辨率的拍照设备获取二维码图像时, 设 备的摄像头的像素较高, 通过摄像头得到的为高分辨率的图像, 但是由于其 显示屏的分辨率较低, 有时会无法将摄像头拍摄的信息完整的还原显示显示 屏上。 本发明正是针对该问题而提出的一种解决方法。  When a two-dimensional code image is acquired by a photographing device having a display resolution lower than the resolution of the camera, the camera has a higher pixel of the camera, and the image obtained by the camera is a high-resolution image, but due to the lower resolution of the display screen, Sometimes it is not possible to completely restore the information captured by the camera to the display. The present invention is a solution proposed for this problem.
本具体实施方式中以目前国内广泛应用的 QR码型号 2方式进行编码的二 维码扫描为例进行说明, 即本具体实施方式中二维码图像为 QR码图像。  In the specific embodiment, the two-dimensional code scanning coded by the QR code model 2 method widely used in the present invention is taken as an example. In the specific embodiment, the two-dimensional code image is a QR code image.
图 3示出了 QR码的示意图, QR码的最小元素 (黑色或白色方块)被称 为 "模块", QR 码是由黑色和白色模块、 位置探测图案、 时间图案、 包含纠 错级别和掩码编号的格式信息、 数据区域以及糾错代码组合而成的。 本发明 所述的方法主要是针对 QR码中的位置探测图案部分的信息(图 3中 P点所示) 进行提取来实现。 步骤 S22: 提取二维码图像中二维码的关键信息;  Figure 3 shows a schematic diagram of the QR code. The smallest element of the QR code (black or white square) is called the "module". The QR code is composed of black and white modules, position detection patterns, time patterns, error correction levels and masks. The format information of the code number, the data area, and the error correction code are combined. The method of the present invention is mainly implemented by extracting information (shown by point P in Fig. 3) of the position detecting pattern portion in the QR code. Step S22: extract key information of the two-dimensional code in the two-dimensional code image;
提取步骤 S21中获取的二维码图像中二维码的关键信息, 所述的关键信 息包括二维码的位置探测图案的坐标信息,例如对于图 3中所示的 QR码图像, 其关键信息为三个位置探测图案的坐标。 该步骤的目的是提取通过摄像头获 取的二维码图像中二维码的关键信息, 即提取位置探测图案在摄像头成像坐 标系下的坐标信息。  The key information of the two-dimensional code in the two-dimensional code image acquired in step S21 is extracted, and the key information includes coordinate information of the position detection pattern of the two-dimensional code, for example, the key information of the QR code image shown in FIG. The coordinates of the pattern are detected for three positions. The purpose of this step is to extract the key information of the two-dimensional code in the two-dimensional code image acquired by the camera, that is, extract the coordinate information of the position detection pattern under the imaging target coordinate system of the camera.
对于 QR码,通过图像处理算法获取二维码的三个位置探测图案在摄像头 成像坐标下的坐标信息, 并将位置信息抽象为单个像素点保存坐标。 在实际 中, 由于位置探测图案包括多个像素点, 为一组坐标信息, 本实施方式中将 位置探测图案的顶点的坐标位置信息作为关键信息。  For the QR code, the coordinate information of the three position detection patterns of the two-dimensional code in the imaging coordinates of the camera is obtained by the image processing algorithm, and the position information is abstracted into a single pixel point to save the coordinates. In practice, since the position detecting pattern includes a plurality of pixel points as a set of coordinate information, the coordinate position information of the vertex of the position detecting pattern is used as the key information in the present embodiment.
如图 5中所示, QR码的三个位置探测图案在摄像头成像坐标下的坐标点 分别表示为 Pi、 P2、 P3, 三个点具体坐标表示为 (ΡηΧ, ΡηΥ ) , η的取值对应 为 1、 1、 3。 QR码的位置探测图案排列在 QR码的三个角落处, 如图 4所示, 对于位置探测图案的 Α、 Β和 C的任何位置, 其黑色和白色模块的比率(黑色 和白色像素点个数比例) 为 1 : 1 : 3: 1 : 1, 因此可以从任何方向上提取二维码 的关键信息, 工作效率大幅提升, 可支持高速读取。 步骤 S 23: 根据摄像头分辨率与显示屏分辨率的比例关系, 将二维码图 像中摄像头成像坐标下的关键信息映射为显示屏坐标系下的关键信息; As shown in FIG. 5, the coordinate points of the three position detection patterns of the QR code in the imaging coordinates of the camera are respectively represented as Pi, P 2 , and P 3 , and the specific coordinates of the three points are expressed as (ΡηΧ, ΡηΥ), and η is taken. The values correspond to 1, 1, and 3. The position detection pattern of the QR code is arranged at three corners of the QR code, as shown in Fig. 4, the ratio of the black and white modules (black and white pixels) for any position of the position detection pattern Α, Β, and C The ratio is 1: 1: 3: 1 : 1, so the key information of the QR code can be extracted from any direction, and the work efficiency is greatly improved, and high-speed reading can be supported. Step S23: mapping key information in the imaging coordinates of the camera in the two-dimensional code image to key information in the coordinate system of the display screen according to the proportional relationship between the resolution of the camera and the resolution of the display screen;
获取拍照设备的摄像头的分辨率和显示屏的分辨率, 根据摄像头分辨率 与显示屏分辨率的比例关系, 将所述的二维码图像中摄像头成像坐标下的关 键信息映射为显示屏坐标系下的关键信息。 本实施方式中所述的显示屏分辨 率是指显示屏中用于显示拍照对象轮廓的显示区域的分辨率, 即本实施方式 中的显示屏分辨率并不是实际的显示屏的分辨率, 而是拍照设备的显示屏中 能够用于显示拍照图像的显示区域的分辨率, 例如一拍照设备的显示屏为 LCD屏, 该 LCD屏的分辨率为 128 χ 64, 而 LCD屏中有 1 28 χ 16的区域需要用 来显示设备其它相关的硬件信息等, 那么该显示屏中能够用于显示拍照图像 的区域为 128 X 48 , 该 128 χ 48即为本实施方式中的显示屏分辨率。  Obtaining the resolution of the camera of the photographing device and the resolution of the display screen, and mapping the key information of the camera imaging coordinates in the two-dimensional code image to the display coordinate system according to the proportional relationship between the resolution of the camera and the resolution of the display screen Key information under. The resolution of the display screen in the embodiment refers to the resolution of the display area for displaying the outline of the photographed object in the display screen, that is, the resolution of the display screen in the embodiment is not the resolution of the actual display screen, and It is the resolution of the display area of the photographing device that can be used to display the photographed image. For example, the display screen of a photographing device is an LCD screen, the resolution of the LCD screen is 128 χ 64, and the LCD screen has 1 28 χ. The area of 16 needs to be used to display other related hardware information of the device, etc., and the area of the display screen that can be used to display the photographed image is 128 X 48 , which is the display screen resolution in this embodiment.
本实施方式中根据摄像头分辨率与显示屏分辨率的比例关系, 将二维码 图像的关键信息映射为显示屏坐标系下关键信息的具体方式包括:  In the embodiment, according to the proportional relationship between the resolution of the camera and the resolution of the display screen, the specific manner of mapping the key information of the two-dimensional code image into the key information in the display coordinate system includes:
1 )计算摄像头横向像素个数与显示屏横向像素个数的比例 Α, 以及摄像 头纵向像素个数与显示屏纵向像素个数的比例 Β, 将比例 Α与比例 B中的较 大者作为映射比例;  1) Calculate the ratio of the number of horizontal pixels of the camera to the number of horizontal pixels of the display screen, and the ratio of the number of vertical pixels of the camera to the number of vertical pixels of the display screen, and use the larger ratio of ratio Α and ratio B as the mapping ratio. ;
2 )按照所述的映射比例将二维码图像中摄像头成像坐标下的关键信息映 射为显示屏坐标系下的关键信息。  2) Mapping the key information in the imaging coordinates of the camera in the two-dimensional code image according to the mapping ratio as the key information in the display coordinate system.
其中, 步骤 1 ) 中, 所述的显示屏纵向像素个数为去掉显示必要信息区 域后的显示屏的纵向像素个数; 所述的显示必要信息区域是指显示屏上用于 显示拍照设备硬件信息的区域。  Wherein, in step 1), the number of vertical pixels of the display screen is the number of vertical pixels of the display screen after the necessary information area is removed; the display necessary information area refers to the hardware for displaying the photographing device on the display screen. The area of information.
本实施方式中将关键信息在摄像头拍照成像坐标下的坐标信息记为( PnX, PnY ), 将映射后显示屏坐标系下的坐标信息记为 (PnXi, ΡηΥι )» In this embodiment, the coordinate information of the key information in the camera photographing imaging coordinates is recorded as (P n X, PnY ), and the coordinate information in the mapped display coordinate system is recorded as (PnXi, ΡηΥι )»
对于拍照分辨率为 30W像素( 640 x 480 )的摄像头而言, 要有效识别 QR 码的编码信息, QR码必须完整并清晰的落在其视场内, 如图 6所示。 对于低 显示设备而言, 其像素点数不能满足对摄像头保存图像信息的完整显示, 因 此需要将高坐标系下的坐标映射到低坐标系下, 以满足显示设备的需要。  For a camera with a resolution of 30W pixels (640 x 480), to effectively identify the coded information of the QR code, the QR code must be completely and clearly within its field of view, as shown in Figure 6. For low display devices, the number of pixels cannot satisfy the complete display of the image information saved by the camera. Therefore, the coordinates in the high coordinate system need to be mapped to the low coordinate system to meet the needs of the display device.
本实施方式中的显示屏以 128x64分辨率的 LCD屏为例,去除显示必要信 息的 1 28x 16的区域(如图 7中的电量显示区域), 剩余可供映射的区域像素 为 128 *48, 匹配 640x480图像比例的区域为: 64x48。 因此按照 1 0 : 1的比 率将摄像头分辨率下的二维码图像的关键信息映射为显示屏坐标系下关键信 息, 即将各位置信息在摄像头保存图片下的坐标 (PnX, PnY ) 映射为显示屏 视场投影区的坐标 (PnX , ΡηΥι ), 如图 7所示。 步骤 S 24: 根据映射后的二维码的关键信息重建二维码图的轮廓像; 根据步骤 S2 3中得到的显示屏坐标系下的关键信息重建二维码图像的轮 廓, 并发送到显示屏上显示, 即根据显示屏分辨率下的位置探测图案的坐标 信息即可构建得到四边形的轮廓。 The display screen in this embodiment takes an LCD screen of 128×64 resolution as an example, and removes a region of 1 28×16 (such as the power display area in FIG. 7) that displays necessary information, and the remaining area pixels for mapping are 128*48. The area that matches the 640x480 image scale is: 64x48. So according to the ratio of 1 0 : 1 The key information of the two-dimensional code image under the camera resolution is mapped to the key information in the display coordinate system, that is, the coordinates (PnX, PnY) of each position information in the image saved by the camera are mapped to the coordinates of the projection field of the display field of view. (PnX , ΡηΥι ), as shown in Figure 7. Step S24: reconstructing the contour image of the two-dimensional code image according to the key information of the mapped two-dimensional code; reconstructing the contour of the two-dimensional code image according to the key information in the display coordinate system obtained in step S23, and transmitting the contour to the display The on-screen display, that is, the contour information of the position detection pattern under the resolution of the display screen can be constructed to obtain the outline of the quadrilateral.
对于 QR 码图像, 根据显示屏坐标系下的关键信息重建二维码图像的轮 廓, 并发送到显示屏上显示的具体方式为:  For the QR code image, the contour of the QR code image is reconstructed based on the key information in the display coordinate system and sent to the display on the display in the following way:
将显示屏坐标系下的三个位置探测图案的坐标点分别记为 P2和 P3, Ρ3位于二维码的对角线位置上; The coordinate points of the three position detection patterns in the display coordinate system are respectively recorded as P 2 and P 3 , and Ρ 3 is located at the diagonal position of the two-dimensional code;
计算 Ρ2相对于 Ρ3连线的对称点 Ρ4的坐标, Pi、 P2、 P3和 P4为二维码 的四个顶点, Calculate the coordinates of 对称2 with respect to the symmetry point 连4 of the Ρ 3 line, Pi, P 2 , P 3 and P 4 are the four vertices of the two-dimensional code,
根据四个顶点构建二维码的四边形轮廓并生成二维码的图案信息, 得到 二维码图像。  A quadrilateral contour of the two-dimensional code is constructed from the four vertices and pattern information of the two-dimensional code is generated to obtain a two-dimensional code image.
QR码的原始图案为正方形, 由于拍摄角度问题, 其成像与摄像头拍照区 域的图案可能不是标准正方形, 而是菱形、 矩形等四边形。 因此在轮廓重建 时要考虑此种情况, 在绘制轮廓时以四边形为准, 绘制轮廓的原理为: 已知 P l、 P2、 P 3的坐标点信息, 求 P2点相对于 Pl、 P 3连线的对称点 P4的坐标, P l、 P2、 P 3、 P4即为四边形的四个顶点, 依此绘制四边形的轮廓发至显示设 备显示即可。  The original pattern of the QR code is square. Due to the shooting angle problem, the pattern of the image and the camera area may not be a standard square, but a diamond, a rectangle or the like. Therefore, this situation should be considered in the reconstruction of the contour. The quadrilateral is used to draw the contour. The principle of drawing the contour is as follows: Know the coordinate point information of P l, P2, P 3, and find the P2 point relative to Pl, P 3 The coordinates of the symmetry point P4 of the line, P l, P2, P 3, and P4 are the four vertices of the quadrilateral, and the contour of the quadrilateral is drawn to the display device for display.
通过步骤 S21-S 24 , 即可得到显示屏坐标系下的二维码图像的轮廓, 拍 照设备根据该轮廓进行二维码图像的扫描时, 由于显示屏上可以直观的显示 二维码图像的轮廓, 大大提高了显示屏上显示的二维码的可识别性。 需要说明是,本发明中的二维码图像包括但并不限于 QR码图像,对于其 它二维码图像同样适用, 只需要提取通过摄像头得到的二维码图像中位置探 测图案的坐标信息, 再根据摄像头分辨率与显示屏分辨率的比例关系, 将摄 像头坐标系下的坐标信息映射为显示屏视场下的坐标信息, 即可根据映射后 的坐标信息构建出显示屏坐标系下的二维码图像轮廓, 并以该轮廓作为拍摄 二维码图像时的参考标准, 使通过摄像头拍摄的图像能够较清楚的显示在显 示屏中。 Through the steps S21-S 24, the contour of the two-dimensional code image in the display coordinate system can be obtained, and when the photographing device scans the two-dimensional code image according to the contour, the two-dimensional code image can be visually displayed on the display screen. The contour greatly improves the recognizability of the QR code displayed on the display. It should be noted that the two-dimensional code image in the present invention includes but is not limited to the QR code image, and is applicable to other two-dimensional code images, and only needs to extract the coordinate information of the position detection pattern in the two-dimensional code image obtained by the camera, and then According to the proportional relationship between the resolution of the camera and the resolution of the display, the coordinate information under the camera coordinate system is mapped to the coordinate information under the field of view of the display screen, and The coordinate information constructs the contour of the two-dimensional code image in the display coordinate system, and uses the contour as a reference standard for capturing the two-dimensional code image, so that the image captured by the camera can be clearly displayed in the display screen.
本发明的方法及系统, 也同样适用于具有特定特征(关键信息) 的图像 的聚焦显示, 通过提取摄像头成像坐标下的图像的特定特征的坐标信息, 并 将其映射为显示屏坐标系下的坐标信息, 即可重建显示屏坐标系下的图像轮 廓。  The method and system of the present invention are equally applicable to focus display of an image having a specific feature (key information) by extracting coordinate information of a specific feature of an image under camera imaging coordinates and mapping it to a display coordinate system. With coordinate information, you can reconstruct the outline of the image in the display coordinate system.
发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于本发明权利要 求及其同等技术的范围之内, 则本发明也意图包含这些改动和变型在内。 The spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and variations of the inventions

Claims

权 利 要 求 Rights request
1. 一种二维码聚焦显示方法, 包括以下步骤: A method for displaying a two-dimensional code focus, comprising the steps of:
( 1 ) 通过拍照设备的摄像头获取二维码图像;  (1) acquiring a two-dimensional code image through a camera of the photographing device;
( 2 )提取所述的二维码图像中二维码的关键信息; 所述的关键信息包括 二维码的位置探测图案的坐标信息;  (2) extracting key information of the two-dimensional code in the two-dimensional code image; the key information includes coordinate information of a position detection pattern of the two-dimensional code;
( 3 )获取拍照设备的摄像头分辨率和显示屏分辨率,根据摄像头分辨率 与显示屏分辨率的比例关系, 将所述的二维码图像中摄像头成像坐标下的关 键信息映射为显示屏坐标系下的关键信息; 所述的显示屏分辨率是指显示屏 中用于显示拍照对象轮廓的显示区域的分辨率;  (3) obtaining the camera resolution and the display resolution of the camera device, and mapping the key information of the camera imaging coordinates in the two-dimensional code image to the display screen coordinates according to the proportional relationship between the camera resolution and the display resolution. The key information of the system; the resolution of the display screen refers to the resolution of the display area for displaying the outline of the photographed object in the display screen;
( 4 )根据显示屏坐标系下的关键信息重建二维码图像的轮廓,并发送到 显示屏上显示。  (4) Reconstruct the outline of the QR code image according to the key information in the display coordinate system and send it to the display.
2.如权利要求 1所述的一种二维码聚焦显示方法,其特征在于,步骤( 1 ) 中, 所述的拍照设备是指显示屏分辨率低于摄像头分辨率的设备。 The method for displaying a two-dimensional code focus according to claim 1, wherein in the step (1), the photographing device refers to a device whose display screen resolution is lower than the resolution of the camera.
3. 如权利要求 1或 2所述的一种二维码聚焦显示方法, 其特征在于, 步 骤( 3 )中, 根据摄像头分辨率与显示屏分辨率的比例关系, 将所述的二维码 图像中摄像头成像坐标下的关键信息映射为显示屏坐标系下的关键信息的具 体方式包括: The method for displaying a two-dimensional code focus according to claim 1 or 2, wherein in step (3), the two-dimensional code is used according to a proportional relationship between a resolution of the camera and a resolution of the display screen. The specific ways in which the key information in the imaging coordinates of the camera is mapped to the key information in the display coordinate system include:
1 )计算摄像头横向像素个数与显示屏横向像素个数的比例 A, 以及摄像 头纵向像素个数与显示屏纵向像素个数的比例 B, 将比例 A与比例 B中的较 大者作为映射比例;  1) Calculate the ratio A of the number of horizontal pixels of the camera to the number of horizontal pixels of the display screen, and the ratio B of the number of vertical pixels of the camera to the number of vertical pixels of the display screen, and use the larger of the ratios A and B as the mapping ratio. ;
2 )按照所述的映射比例将所述的二维码图像中摄像头成像坐标下的关键 信息映射为显示屏坐标系下的关键信息。  2) mapping the key information in the imaging coordinates of the camera in the two-dimensional code image to the key information in the display coordinate system according to the mapping ratio.
4. 如权利要求 3所述的一种二维码聚焦显示方法,其特征在于, 步骤 1 ) 中, 所述的显示屏纵向像素个数为去掉显示必要信息区域后的显示屏的纵向 像素个数; 所述的显示必要信息区域是指显示屏上用于显示拍照设备硬件信 息的区域。 4. The method according to claim 3, wherein in step 1), the number of vertical pixels of the display screen is a vertical pixel of the display screen after the necessary information area is removed. The display necessary information area refers to an area on the display screen for displaying hardware information of the photographing device.
5.如权利要求 4所述的一种二维码聚焦显示方法,其特征在于,步骤( 1 ) 中, 所述的二维码图像为 QR码图像。 The method of displaying a two-dimensional code focus according to claim 4, wherein in the step (1), the two-dimensional code image is a QR code image.
6.如权利要求 5所述的一种二维码聚焦显示方法,其特征在于,步骤(4 ) 中, 根据显示屏坐标系下的关键信息重建二维码图像轮廓的具体方式包括: 将显示屏坐标系下二维码的三个位置探测图案的坐标点分别记为 P2 和 P3, P3位于二维码的对角线位置上; The method for displaying a two-dimensional code focus according to claim 5, wherein in the step (4), the specific manner of reconstructing the contour of the two-dimensional code image according to the key information in the display coordinate system comprises: displaying The coordinate points of the three position detection patterns of the two-dimensional code in the screen coordinate system are respectively recorded as P 2 and P 3 , and P 3 is located at the diagonal position of the two-dimensional code;
计算 P2相对于 P3连线的对称点 P4的坐标, Pi、 P2、 P3和 P4为二维码 轮廓的四个顶点; Calculating the coordinates of P 2 with respect to the symmetry point P 4 of the P 3 line, Pi, P 2 , P 3 and P 4 are the four vertices of the two-dimensional code profile;
根据四个顶点构建二维码的四边形轮廓, 得到二维码图像的轮廓。  The quadrilateral contour of the two-dimensional code is constructed from the four vertices to obtain the contour of the two-dimensional code image.
7. 一种二维码聚焦显示系统, 包括: 7. A two-dimensional code focusing display system, comprising:
二维码图像获取模块, 用于通过拍照设备的摄像头获取二维码图像; 二维码关键信息提取模块, 用于提取所述的二维码图像中二维码的关键 信息; 所述的关键信息包括二维码的位置探测图案的坐标信息;  a two-dimensional code image acquisition module, configured to acquire a two-dimensional code image by a camera of the photographing device; a two-dimensional code key information extraction module, configured to extract key information of the two-dimensional code in the two-dimensional code image; The information includes coordinate information of the position detection pattern of the two-dimensional code;
关键信息映射模块,用于获取拍照设备的摄像头分辨率和显示屏分辨率, 根据摄像头分辨率与显示屏分辨率的比例关系, 将所述的二维码图像中摄像 头成像坐标下的关键信息映射为显示屏坐标系下的关键信息; 所述的显示屏 分辨率是指显示屏中用于显示拍照对象轮廓的显示区域的分辨率;  The key information mapping module is configured to acquire camera resolution and display resolution of the photographing device, and map key information of the camera image in the two-dimensional code image according to a proportional relationship between the camera resolution and the display resolution. The key information in the display coordinate system; the display resolution refers to the resolution of the display area in the display screen for displaying the outline of the photographed object;
二维码图像轮廓构建模块, 用于根据显示屏坐标系下的关键信息重建二 维码图像的轮廓, 并发送到显示屏上显示。  The two-dimensional code image contour building module is configured to reconstruct the contour of the two-dimensional code image according to the key information in the display coordinate system, and send it to the display screen for display.
8. 如权利要求 7所述的一种二维码聚焦显示系统, 其特征在于, 所述的 关键信息映射模块包括: 8. The two-dimensional code focusing display system according to claim 7, wherein the key information mapping module comprises:
映射比例计算单元, 用于计算关键信息映射比例, 计算的方式为: 计算 摄像头横向像素个数与显示屏横向像素个数的比例 A, 以及摄像头纵向像素 个数与显示屏纵向像素个数的比例 B, 将比例 A与比例 B中的较大者作为映 射比例;  The mapping ratio calculation unit is configured to calculate a key information mapping ratio, and the calculation manner is: calculating a ratio A of the number of horizontal pixels of the camera to the number of horizontal pixels of the display screen, and a ratio of the number of vertical pixels of the camera to the number of vertical pixels of the display screen B, the larger of the ratio A and the ratio B is used as a mapping ratio;
映射单元, 用于按照所述的映射比例将所述的二维码图像中摄像头成像 坐标下的关键信息映射为显示屏坐标系下的关键信息。 a mapping unit, configured to image the camera in the two-dimensional code image according to the mapping ratio The key information in the coordinates is mapped to the key information in the display coordinate system.
9. 如权利要求 7或 8所述的一种二维码聚焦显示系统, 其特征在于, 所 述的二维码图像为 QR码图像。 9. A two-dimensional code focus display system according to claim 7 or 8, wherein the two-dimensional code image is a QR code image.
1 0. 如权利要求 9所述的一种二维码聚焦显示系统, 其特征在于, 所述 的二维码图像轮廓构建模块包括: A two-dimensional code focus display system according to claim 9, wherein the two-dimensional code image contour construction module comprises:
二维码顶点计算单元, 用于计算二维码图像第四个顶点的坐标, 计算方 式为: 将显示屏坐标系下二维码的三个位置探测图案的坐标点分别记为 P2和 Ρ3, Ρ^α P3位于二维码的对角线位置上, 计算 P2相对于 Ρ^α Ρ3连线的 对称点 Ρ4的坐标, P2、 P3和 P4为二维码轮廓的四个顶点; The two-dimensional code vertex calculation unit is configured to calculate the coordinates of the fourth vertex of the two-dimensional code image, and the calculation manner is as follows: the coordinate points of the three position detection patterns of the two-dimensional code in the display coordinate system are respectively recorded as P 2 and Ρ 3 , Ρ^α P 3 is located at the diagonal position of the two-dimensional code, and calculates the coordinates of the symmetry point Ρ 4 of P 2 with respect to the line connecting Ρ^α Ρ 3 , and P 2 , P 3 and P 4 are two-dimensional codes. The four vertices of the outline;
轮廓构建单元, 用于根据四个顶点构建二维码的四边形轮廓, 得到二维 码图像的轮廓。  A contour building unit is configured to construct a quadrilateral contour of the two-dimensional code from the four vertices to obtain a contour of the two-dimensional code image.
PCT/CN2014/082081 2013-12-24 2014-07-11 Method and system for focused display of 2-dimensional bar code WO2015096462A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310718991.2A CN103729610B (en) 2013-12-24 2013-12-24 Two-dimension code focusing displaying method and system
CN201310718991.2 2013-12-24

Publications (1)

Publication Number Publication Date
WO2015096462A1 true WO2015096462A1 (en) 2015-07-02

Family

ID=50453679

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/082081 WO2015096462A1 (en) 2013-12-24 2014-07-11 Method and system for focused display of 2-dimensional bar code

Country Status (2)

Country Link
CN (1) CN103729610B (en)
WO (1) WO2015096462A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766070A (en) * 2019-01-31 2019-05-17 网易(杭州)网络有限公司 Display control method and device in a kind of mobile terminal

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729610B (en) * 2013-12-24 2017-01-11 北京握奇智能科技有限公司 Two-dimension code focusing displaying method and system
CN104008361B (en) * 2014-06-16 2017-05-31 北京握奇智能科技有限公司 A kind of two-dimensional code scanning positioning indicating method and system
CN105373754A (en) * 2014-08-28 2016-03-02 沈维 Information interaction method and information interaction system
CN105138942B (en) * 2015-08-26 2018-12-18 小米科技有限责任公司 The display methods and device of two dimensional code
CN106339653A (en) * 2016-08-24 2017-01-18 乐视控股(北京)有限公司 QR code scanning processing method and QR code scanning processing device
CN106407868A (en) * 2016-08-26 2017-02-15 乐视控股(北京)有限公司 Two-dimensional scanning processing method and mobile terminal
CN106570437A (en) * 2016-10-19 2017-04-19 乐视控股(北京)有限公司 Two-dimensional code scanning processing method and mobile terminal thereof
CN106572300B (en) * 2016-10-31 2020-03-27 努比亚技术有限公司 Method for controlling shooting display, mobile terminal and intelligent device
CN108960000A (en) * 2018-07-17 2018-12-07 深圳市零点零科技有限公司 A kind of strip small two-dimension code recognition methods
CN110557649B (en) * 2019-09-12 2021-12-28 广州方硅信息技术有限公司 Live broadcast interaction method, live broadcast system, electronic equipment and storage medium
CN110738273B (en) * 2019-10-23 2023-07-21 成都极米科技股份有限公司 Image feature point matching method, device, equipment and storage medium
CN111767752B (en) * 2020-06-11 2022-09-23 网易宝有限公司 Two-dimensional code identification method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006024075A (en) * 2004-07-09 2006-01-26 Omron Corp Optical code reader
CN102710978A (en) * 2012-04-12 2012-10-03 深圳Tcl新技术有限公司 Method and device for television cursor movement
CN102810163A (en) * 2011-06-02 2012-12-05 航天信息股份有限公司 Picture channel and information transfer method thereof
CN103729610A (en) * 2013-12-24 2014-04-16 北京握奇智能科技有限公司 Two-dimension code focusing displaying method and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4420261A (en) * 1980-09-02 1983-12-13 Lowbar, Inc. Optical position location apparatus
US7016532B2 (en) * 2000-11-06 2006-03-21 Evryx Technologies Image capture and identification system and process
CN101217643B (en) * 2007-12-26 2010-12-29 广东威创视讯科技股份有限公司 A method and corresponding device for dynamic capture and collection, display of images with different sizes and resolution
CN102043940B (en) * 2009-10-14 2014-06-18 北大方正集团有限公司 Method and device for reading two-dimensional code symbol data
CN102243704B (en) * 2011-07-21 2014-04-02 我查查信息技术(上海)有限公司 Positioning system for two-dimension bar code and two-dimension bar code identification method and equipment
CN103092432B (en) * 2011-11-08 2016-08-03 深圳市中科睿成智能科技有限公司 The trigger control method of man-machine interactive operation instruction and system and laser beam emitting device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006024075A (en) * 2004-07-09 2006-01-26 Omron Corp Optical code reader
CN102810163A (en) * 2011-06-02 2012-12-05 航天信息股份有限公司 Picture channel and information transfer method thereof
CN102710978A (en) * 2012-04-12 2012-10-03 深圳Tcl新技术有限公司 Method and device for television cursor movement
CN103729610A (en) * 2013-12-24 2014-04-16 北京握奇智能科技有限公司 Two-dimension code focusing displaying method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766070A (en) * 2019-01-31 2019-05-17 网易(杭州)网络有限公司 Display control method and device in a kind of mobile terminal
CN109766070B (en) * 2019-01-31 2022-12-02 网易(杭州)网络有限公司 Display control method and device in mobile terminal

Also Published As

Publication number Publication date
CN103729610B (en) 2017-01-11
CN103729610A (en) 2014-04-16

Similar Documents

Publication Publication Date Title
WO2015096462A1 (en) Method and system for focused display of 2-dimensional bar code
JP5505007B2 (en) Image processing apparatus, image processing method, and computer program for image processing
CN110009561A (en) A kind of monitor video target is mapped to the method and system of three-dimensional geographical model of place
JP2014131257A (en) Image correction system, image correction method, and program
US8897598B1 (en) Mosaicing documents for translation using video streams
JP2004023373A5 (en)
WO2020134818A1 (en) Image processing method and related product
WO2009150882A1 (en) Image registration processing device, region expansion processing device, and image quality improving device
JP2007201948A (en) Imaging apparatus, image processing method and program
CN108958469B (en) Method for adding hyperlinks in virtual world based on augmented reality
WO2018113339A1 (en) Projection image construction method and device
KR101259550B1 (en) Method And Apparatus Contrasting Image Through Perspective Distortion Correction
KR20160117143A (en) Method, device and system for generating an indoor two dimensional plan view image
CN108205822B (en) Picture pasting method and device
TWI615808B (en) Image processing method for immediately producing panoramic images
CN111047678B (en) Three-dimensional face acquisition device and method
CN110715618A (en) Dynamic three-dimensional scanning method and device
CN106537453A (en) Rapid image registration
JP2017183948A (en) Digital watermark embedding apparatus, digital watermark detection device, method, and program
JPWO2020261546A1 (en) Information processing equipment, information processing systems, information processing methods, and programs
WO2019229855A1 (en) Object detection device, object detection system, object detection method, and recording medium having program recorded thereon
JP2019220032A (en) Program, apparatus and method that generate display image which is transformed from original image on the basis of target image
CN115731591A (en) Method, device and equipment for detecting makeup progress and storage medium
Li et al. Fisheye image rectification using spherical and digital distortion models
KR101028171B1 (en) Determination of aspect ratio from perspective projection images

Legal Events

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

Ref document number: 14875171

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14875171

Country of ref document: EP

Kind code of ref document: A1