WO2017167159A1 - 图像定位方法及装置 - Google Patents

图像定位方法及装置 Download PDF

Info

Publication number
WO2017167159A1
WO2017167159A1 PCT/CN2017/078324 CN2017078324W WO2017167159A1 WO 2017167159 A1 WO2017167159 A1 WO 2017167159A1 CN 2017078324 W CN2017078324 W CN 2017078324W WO 2017167159 A1 WO2017167159 A1 WO 2017167159A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
tracking
matching
feature
preset
Prior art date
Application number
PCT/CN2017/078324
Other languages
English (en)
French (fr)
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 WO2017167159A1 publication Critical patent/WO2017167159A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Definitions

  • the present invention relates to the field of computers, and in particular to an image positioning method and apparatus.
  • Augmented reality technology that is, according to computer vision technology, superimposes the virtual objects generated by the computer system into the real scene, so that the virtual objects are perfectly integrated with the real scene, and can interact with the virtual objects through human-computer interaction technology.
  • mobile terminal devices such as smart phones
  • mobile augmented reality technology has received attention and research from many experts and scholars at home and abroad in recent years.
  • the mobile augmented reality hopes to transplant the traditional augmented reality application to the mobile terminal device, thereby expanding the application range of the augmented reality technology.
  • mobile terminal devices such as smart phones have become more popular, so mobile augmented reality technology has become one of the development trends of augmented reality technology.
  • the quality of registration and positioning technology directly determines the success of augmented reality systems, and the high-speed, accurate and robust registration and positioning technology based on natural features is the core and key of the whole system.
  • the advantages and disadvantages of the feature detection algorithm, feature tracking algorithm and feature matching algorithm will directly affect the processing speed and stability of the whole system.
  • the computing power of smart phones is about 10 times slower than that of ordinary PC desktops, so the registration and positioning technology applied to mainstream computer platforms cannot be fully applied to mobile terminals. Therefore, solving the registration and positioning based on mobile terminals under the condition of limited hardware resources of mobile phones is the key to realize the augmented reality system based on mobile terminals, and also has important research significance.
  • the embodiment of the invention provides an image positioning method and device, so as to solve at least the problem that the mobile terminal resources in the related art are limited and the registration and positioning processing technology cannot be effectively performed.
  • an image positioning method including:
  • the preset condition includes: a difference between the area of the first image and the area of the second image is within a preset range, wherein the first image area is an area of the area surrounded by the matching feature points, The second image area is the area of the area enclosed by the tracking feature points.
  • the method further includes: correcting the tracking feature point according to the matching feature point if a difference between the first image area and the second image area is not within a preset range.
  • performing feature matching on the reference point of the real-time video stream and the reference image to output the feature points comprises: obtaining the matching feature points when the following conditions are simultaneously met:
  • the connected image of the matching feature point is a preset image, wherein the preset image is a wired image of the reference point;
  • performing feature tracking output on the reference point of the reference image to output the feature point comprises: obtaining the tracking feature point when the following conditions are simultaneously met:
  • Determining a wired image of the tracking feature point is a preset image, wherein the preset image is a wired image of the reference point.
  • an image positioning apparatus including:
  • An extraction module configured to extract a specified image in the real-time video stream as a reference image
  • a matching tracking module configured to perform feature matching between the real-time video stream and a pre-selected reference point in the reference image to obtain a matching feature point; and perform feature tracking on the reference point to obtain a tracking feature point;
  • an output module configured to output an image frame of the real-time video stream when a predetermined condition is met between the matching feature point and the tracking feature point.
  • the preset condition includes: a difference between the area of the first image and the area of the second image is within a preset range, wherein the first image area is an area of the area surrounded by the matching feature points, The second image area is the tracking The area enclosed by the sign.
  • the device further includes: correcting the tracking feature point according to the matching feature point if a difference between the first image area and the second image area is not within a preset range.
  • performing feature matching on the reference point of the real-time video stream and the reference image to output the feature points comprises: obtaining the matching feature points when the following conditions are simultaneously met:
  • the connected image of the matching feature point is a preset image, wherein the preset image is a wired image of the reference point;
  • performing feature tracking output on the reference point of the reference image to output the feature point comprises: obtaining the tracking feature point when the following conditions are simultaneously met:
  • Determining a wired image of the tracking feature point is a preset image, wherein the preset image is a wired image of the reference point.
  • a computer storage medium is further provided, and the computer storage medium may store an execution instruction for performing the implementation of the image positioning method in the above embodiment.
  • the specified image in the real-time video stream is extracted as a reference image, and the real-time video stream is matched with a pre-selected reference point in the reference image to obtain a matching feature point; and the reference point is characterized.
  • FIG. 1 is a flow chart of an image localization method according to an embodiment of the present invention.
  • FIG. 2 is a block diagram showing the structure of an image positioning apparatus according to an embodiment of the present invention.
  • FIG. 3 is a block diagram showing the structure of an image matching tracking system module in accordance with a preferred embodiment of the present invention.
  • FIG. 4 is a flow chart of an image tracking method in accordance with a preferred embodiment of the present invention.
  • FIG. 1 is a flowchart of an image localization method according to an embodiment of the present invention. As shown in FIG. 1, the flow includes the following steps:
  • Step S102 extracting a specified image in the real-time video stream as a reference image
  • Step S104 performing feature matching on the real-time video stream and the pre-selected reference points in the reference image to obtain matching feature points; and performing feature tracking on the reference point to obtain tracking feature points;
  • Step S106 When the preset condition is met between the matching feature point and the tracking feature point, the image frame of the real-time video stream is output.
  • the reference point in this embodiment may be that a quadrilateral is selected in the image, and four vertices of the quadrilateral are used as reference points, and the preset condition that matches the matching feature point and the tracking feature point is a relationship between the points, which may be a point circumference.
  • the area ratio between the formed images is greater than the threshold, and the difference in the length of the line between the points is greater than the threshold. It should be noted that after the matching feature point and the tracking special feature point meet the preset condition, the tracking processing result is preferably output, and the matching processing result may also be output, or the tracking processing result and the matching processing result may be corrected and output. Unify the results.
  • the above technical solution solves the problem that the mobile terminal has limited resources and cannot effectively perform the registration and positioning processing technology, and realizes image positioning in time and accurately.
  • the preset condition includes:
  • the difference between the area of the first image and the area of the second image is within a preset range, wherein the area of the first image is the area of the area enclosed by the matching feature point, and the area of the second image is the area enclosed by the tracking feature point
  • the area may also be that the ratio of the first image area to the second image area is greater than a threshold.
  • the tracking feature point is corrected according to the matching feature point.
  • the difference between the area of the first image and the area of the second image is not within the preset range, indicating that the processing results of the same video stream are different in the two methods.
  • the matching processing result is more accurate, and therefore, the deviation occurs.
  • the matching processing result is used to correct the tracking processing result, in order to obtain a better technical solution.
  • the real-time video stream and the reference point of the reference image are feature-matched and output matching feature point packets. Include: Get the matching feature points when both of the following conditions are met:
  • the connected image of the matching feature point is a preset image, wherein the preset image is a wired image of the reference point;
  • the ratio of the number of matching feature points to the reference point number is not less than a preset value.
  • the above technical solution is applied to independently verify the matching feature point, and the correctness of the matching feature point is determined when the above four conditions are simultaneously satisfied.
  • performing feature tracking output tracking feature points on the reference point of the reference image includes:
  • the tracking feature points are obtained when the following conditions are met:
  • connection image of the tracking feature point is determined to be a preset image, wherein the preset image is a wired image of the reference point.
  • the above technical solution is applied to independently verify the tracking feature point, and the correctness of the tracking feature point is determined when the above four conditions are simultaneously satisfied.
  • module may implement a combination of software and/or hardware of a predetermined function.
  • apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 2 is a structural block diagram of an image positioning apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes:
  • the extracting module 22 is configured to extract a specified image in the real-time video stream as a reference image
  • the matching tracking module 24 is connected to the extraction module 22, and is configured to perform feature matching between the real-time video stream and a pre-selected reference point in the reference image to obtain a matching feature point; and perform feature tracking on the reference point to obtain a tracking feature. point;
  • the output module 26 is connected to the matching tracking module 24, and is configured to output an image frame of the real-time video stream when the matching feature point and the tracking feature point meet a preset condition.
  • the preset condition includes:
  • the difference between the area of the first image and the area of the second image is within a preset range, wherein the area of the first image is the area of the area enclosed by the matching feature point, and the area of the second image is the area enclosed by the tracking feature point area.
  • the device further includes:
  • performing feature matching on the reference point of the real-time video stream and the reference image to output matching feature points includes:
  • the matching feature points are obtained when the following conditions are met:
  • the connected image of the matching feature point is a preset image, wherein the preset image is a wired image of the reference point;
  • the ratio of the number of matching feature points to the reference point number is not less than a preset value.
  • performing feature tracking output tracking feature points on the reference point of the reference image includes:
  • the tracking feature points are obtained when the following conditions are met:
  • connection image of the tracking feature point is determined to be a preset image, wherein the preset image is a wired image of the reference point.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the above modules are respectively located. Different processors.
  • the purpose of the preferred embodiment of the present invention is to provide a mobile augmented reality registration and positioning method based on module interaction, which can realize real-time, stable and robust on current mainstream mobile platforms, in view of the defects of the related art and the limited characteristics of the mobile terminal platform. Registration positioning to expand the range of augmented reality applications and improve user experience.
  • the method of the preferred embodiment of the present invention comprises the following steps 1, 2, 3, 4, 5:
  • Step 1 Call the smartphone camera to collect the live video stream of the scene, obtain the reference template image, and preprocess the video stream.
  • Step 2 Turn on the tracking module thread (corresponding to some functions of the matching tracking module 24 of the above embodiment) and the matching module thread (corresponding to some functions of the matching tracking module 24 of the above embodiment), respectively, and obtain the video stream obtained in step 1. Pass in two modules separately.
  • Step 3 The matching module is configured to perform feature matching on the reference template image and the real-time video stream, and the tracking module is configured to perform feature tracking on the reference template image feature point (corresponding to the reference point of the foregoing embodiment).
  • Step 4 The advantage of image tracking in the related art is that its real-time performance is good, but its stability and robustness are poor. And figure Image tracking is just the opposite, image matching is stable and robust, but its real-time performance is poor relative to tracking algorithms.
  • the fusion module (corresponding to some of the functions of the output module 26 of the above embodiment) combines the advantages of image matching and image tracking for interactive verification of the matching module and the tracking module. At the same time, for the tracking failure, the tracking module is used to start and correct the tracking module.
  • Step 5 Output the tracking module video stream (corresponding to part of the function of the output module 26 of the above embodiment), and superimpose the 3D model in the video stream using the camera pose calculated by the pose estimation module.
  • FIG. 3 is a block diagram of a module structure tracking system according to a preferred embodiment of the present invention. As shown in FIG. 3, the block diagram includes: an image acquisition module, an image tracking module, an image matching module, a fusion module, a position estimation module, and a virtual reality. Fusion and enhanced display modules.
  • FIG. 4 is a flow chart of an image tracking method in accordance with a preferred embodiment of the present invention. As shown in FIG. 4, the method includes the following steps:
  • Step 1 video stream acquisition and reference template image selection:
  • Step 2 The matching module processes the video stream:
  • Feature detection algorithm is used to perform feature detection on each level of the gold tower image.
  • a feature detection algorithm based on Features of Accelerated Segment Test (FAST) is adopted.
  • Feature points are selected by using a fast binary descriptor.
  • an Oriented Brief (ORB) feature description is used.
  • FLANN Fast Library for Approximate Near St Neighbors
  • RAP Dooms Consensus RAP Dooms Consensus
  • a minimum threshold is set for the number of matching feature points. When the number of matching feature points is less than the set threshold, the matching is considered to be a failure, and the matching module output is stopped.
  • the minimum threshold set by the matching module is 5-15.
  • the preferred embodiment of the present invention uses the judgment of the homography matrix.
  • the main function of the judgment of the homography matrix is to further filter the homography matrix calculated by matching feature points to determine whether it is the homography matrix in the correct case.
  • the main algorithm steps for judging the pros and cons are as follows: a, b, c, d:
  • step a the sub-matrix of the upper left corner 2X2 of the homography matrix H is selected for the first time and the determinant of the sub-matrix is calculated to be greater than zero.
  • This 2X2 matrix is called the R matrix and contains the rotated portion of the estimated transform.
  • the correct rotation matrix determinant value should be 1, in some cases R may contain scale parts, so the determinant value of R may have other values, but the correct rotation and scale values are greater than zero.
  • Step b the second judgment is to obtain the element of the R matrix (0, 0) position and the element of the (1, 0) position in the homography matrix H, calculate the square sum of the two elements and perform the square root, and the square root result
  • the normal range should be between (0.1-4), where 0.1 and 4 are empirically set thresholds.
  • Step c for the third time, obtaining the element of the R matrix (0, 1) position and the element of the (1, 1) position in the homography matrix H, calculating the square sum of the two elements and performing the square rooting, and the square root result
  • the normal range should be between (0.1-4), where 0.1 and 4 are empirically set thresholds.
  • step d the elements of the homography matrix H(2, 0) and (2, 1) are obtained for the fourth time, and the sum of squares is calculated and squared.
  • the position of the above two elements represents a projection transformation, and the normal value of the square root result should be greater than 0.002, where 0.002 is an empirically set threshold.
  • the preferred embodiment of the present invention selects reference points of four vertex positions on the template image, and the coordinates of the four reference points on the screen are (w/4, h/4), (3w/4, h/4), (3w/4, 3h/4), (w/4, 3h/4). According to the homography matrix calculated by the matching module processing result, four points after the perspective transformation of the reference point are calculated, and the quadrilateral formed by the four points should be a convex quadrilateral.
  • the specific method is: setting an image mask and using the mask as an output parameter of the homography calculation. After the homography matrix H is calculated, the number of feature points C1 in the mask is counted. At the same time, the number of feature points on the reference template (reference template) is recorded as C2, and C1/C2 is calculated.
  • the threshold value q set in the preferred embodiment of the present invention ranges from 0.2 to 0.4, that is, when C1/C2 ⁇ q, the matching is considered to be a failure, and the matching output of the image frame is stopped, otherwise the matching is considered successful.
  • Step 3 The tracking module processes the video stream:
  • the pyramid LK optical flow tracking algorithm is used to track the feature points detected by each layer of images.
  • a minimum threshold is set for the number of tracking feature points. When the number of tracking feature points is less than the set threshold, the tracking failure is considered to stop the tracking module output.
  • the minimum threshold set by the tracking module is 10-20.
  • the preferred embodiment of the present invention uses the judgment of the homography matrix.
  • the main function of the judgment of the homography matrix is to further filter the homography matrix calculated by tracking feature points to determine whether it is the homography matrix in the correct case.
  • the main algorithm steps for judging the pros and cons are as follows: a, b, c, d:
  • step a the sub-matrix of the upper left corner 2X2 of the homography matrix H is selected for the first time and the determinant of the sub-matrix is calculated to be greater than zero.
  • This 2X2 matrix is called the R matrix and contains the rotated portion of the estimated transform.
  • the correct rotation matrix determinant value should be 1, in some cases R may contain scale parts, so the determinant value of R may have other values, but the correct rotation and scale values are greater than zero.
  • Step b the second judgment is to obtain the element of the R matrix (0, 0) position and the element of the (1, 0) position in the homography matrix H, calculate the square sum of the two elements and perform the square root, and the square root result
  • the normal range should be between (0.1-4), where 0.1 and 4 are empirically set thresholds.
  • Step c for the third time, obtaining the element of the R matrix (0, 1) position and the element of the (1, 1) position in the homography matrix H, calculating the square sum of the two elements and performing the square rooting, and the square root result
  • the normal range should be between (0.1-4), where 0.1 and 4 are empirically set thresholds.
  • step d the elements of the homography matrix H(2, 0) and (2, 1) are obtained for the fourth time, and the sum of squares is calculated and squared.
  • the position of the above two elements represents a projection transformation, and the normal value of the square root result should be greater than 0.002, where 0.002 is an empirically set threshold.
  • the preferred embodiment of the present invention selects reference points of four vertex positions on the template image, and the coordinates of the four reference points on the screen are (w/4, h/4), (3w/4, h/4), (3w/4, 3h/4), (w/4, 3h/4). According to the homography matrix calculated by the tracking module processing result, the four points after the reference point perspective transformation are calculated, and the quadrilateral formed by the four points should be a convex quadrilateral.
  • Step 4 The fusion module performs cross-check on the tracking module and the matching module:
  • the tracking module obtains the initial homography of the matching module.
  • the matrix and the reference template feature points are detected to start optical flow tracking.
  • the feature tracking starts from the same frame of the matching module at this time.
  • Step 5 Estimate camera pose, 3D model import, realize virtual and real fusion and enhanced display:
  • the 3D model is rendered in the Java code side of the computer program language using OpenGL for Embedded Systems (OpenGL ES) 2.0, and responded according to the implemented touch screen.
  • OpenGL ES OpenGL for Embedded Systems
  • the image tracking method of the preferred embodiment of the present invention comprehensively considers the characteristics of image matching and image tracking, and proposes a mobile augmented reality registration and positioning method based on module interaction, which mainly uses image matching and image tracking to run in parallel and continuously check and verify.
  • This method is used to realize the mobile terminal-based registration and augmented reality system. Its advantages are mainly reflected in the following two aspects:
  • the preferred embodiment of the present invention improves the real-time performance and stability of the registration positioning by using the matching module and the tracking module running in parallel and running the interaction in real time, compared with the simple use of the image matching method or the feature tracking method.
  • Mobile augmented reality registration positioning requirements
  • the preferred embodiment of the present invention can implement real-time, stable, robust registration tracking in a normal, scale-up, zoom, rotation, partial occlusion, etc. environment on a mobile terminal platform, and effectively track when a reference template image is lost. restore.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the storage medium is further arranged to store program code for performing the method steps of the above-described embodiments:
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • the processor performs the method steps of the foregoing embodiments according to the stored program code in the storage medium.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the foregoing technical solution provided by the embodiment of the present invention may be applied to an image localization process, and extract a specified image in a real-time video stream as a reference image, and perform feature matching on the real-time video stream and a pre-selected reference point in the reference image. Obtaining a matching feature point; and performing feature tracking on the reference point to obtain a tracking feature point, and outputting an image frame of the real-time video stream when the matching feature point and the tracking feature point meet a preset condition, thereby solving the mobile terminal
  • the resources are limited, and the problem of registration and location processing technology cannot be effectively implemented, and image positioning is realized in time and accurately.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

一种图像定位方法及装置,其中,该方法包括:提取实时视频流中的指定图像作为参考图像(S102),将该实时视频流和该参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对该参考点进行特征跟踪,得到跟踪特征点(S104),在该匹配特征点与该跟踪特征点之间符合预设条件时,输出该实时视频流的图像帧(S106)。上述方法及装置解决了移动终端资源有限,不能有效进行注册定位处理技术的问题,及时准确地实现了图像定位。

Description

图像定位方法及装置 技术领域
本发明涉及计算机领域,具体而言,涉及一种图像定位方法及装置。
背景技术
相关技术中,随着新一代宽带无线移动通信网的飞速发展和智能移动终端性能的迅速提高,视频通讯、在线检索与浏览、互动游戏、即时通信等丰富的数据业务研发和应用已成为移动通信领域重要的研究热点和发展趋势之一。在国家中长期科学和技术发展规划纲要(2006-2020年)中,将开发支持多媒体、安全、泛在的多种新业务与应用的智能终端作为重点领域和优先发展主题。在2010国家科技重大专项“新一代宽带无线移动通信网”中,也将研发具有高附加值的新型移动终端视频通信作为核心内容之一。
增强现实技术,即根据计算机视觉技术,将计算机系统生成的虚拟物体叠加到真实场景中,使虚拟物体与真实场景完美融合,并且可以通过人机交互技术与虚拟物体进行互动。随着智能手机等移动终端设备的发展和普及,移动增强现实技术近年来受到了国内外许多专家和学者的关注和研究。随着目前移动终端运算能力的提高和硬件性能的提升,移动增强现实希望将传统增强现实应用移植到移动终端设备上,从而扩展增强现实技术的应用范围。目前,智能手机等移动终端设备已经比较普及,所以移动增强现实技术也成为增强现实技术的发展趋势之一。
注册定位技术的好坏直接决定增强现实系统的成功与否,而基于自然特征的高速、精确、鲁棒的注册定位技术是整个系统核心和关键。作为整个注册定位处理的前提和基础,特征检测算法、特征跟踪算法、特征匹配算法的优劣将直接影响整个系统的处理速度和稳定性。目前智能手机的计算能力比普通PC台式机慢10倍左右,因此应用于主流计算机平台的注册定位技术并不能完全适用于移动终端。因此,在手机硬件资源有限的条件下解决基于移动终端的注册定位,是实现基于移动终端的增强现实系统的关键,也具有重要的研究意义。
针对相关技术中,移动终端资源有限,不能有效进行注册定位处理技术的问题,目前还没有有效的解决方案。
发明内容
本发明实施例提供了一种图像定位方法及装置,以至少解决相关技术中移动终端资源有限,不能有效进行注册定位处理技术的问题。
根据本发明的一个实施例,提供了一种图像定位方法,包括:
提取实时视频流中的指定图像作为参考图像;
将所述实时视频流和所述参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对所述参考点进行特征跟踪,得到跟踪特征点;
在所述匹配特征点与所述跟踪特征点之间符合预设条件时,输出所述实时视频流的图像帧。
进一步地,所述预设条件包括:第一图像面积与第二图像面积的差值在预设范围内,其中,所述第一图像面积为所述匹配特征点围成的区域面积,所述第二图像面积为所述跟踪特征点围成的区域面积。
进一步地,所述方法还包括:在所述第一图像面积与所述第二图像面积的差值不在预设范围内的情况下,依据所述匹配特征点校正所述跟踪特征点。
进一步地,将所述实时视频流和所述参考图像的参考点进行特征匹配输出匹配特征点包括:在同时满足以下条件时,得到所述匹配特征点:
确定所述特征匹配过程中的匹配特征点的数目不低于预设值数目;
确定由所述匹配特征点计算出的单应性矩阵是预设的单应性矩阵;
确定所述匹配特征点的连线图像是预设图像,其中,所述预设图像为所述参考点的连线图像;
确定所述匹配特征点数与所述参考点数的比率不小于预设值。
进一步地,对所述参考图像的参考点进行特征跟踪输出跟踪特征点包括:在同时满足以下条件时,得到所述跟踪特征点:
确定所述特征跟踪过程中的跟踪特征点数目不低于预设值数目;
确定由所述跟踪特征点计算出的单应性矩阵是预设的单应性矩阵;
确定所述跟踪特征点的连线图像是预设图像,其中,所述预设图像为所述参考点的连线图像。
根据本发明的另一实施例,提供了一种图像定位装置,包括:
提取模块,设置为提取实时视频流中的指定图像作为参考图像;
匹配跟踪模块,设置为将所述实时视频流和所述参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对所述参考点进行特征跟踪,得到跟踪特征点;
输出模块,设置为在所述匹配特征点与所述跟踪特征点之间符合预设条件时,输出所述实时视频流的图像帧。
进一步地,所述预设条件包括:第一图像面积与第二图像面积的差值在预设范围内,其中,所述第一图像面积为所述匹配特征点围成的区域面积,所述第二图像面积为所述跟踪特 征点围成的区域面积。
进一步地,所述装置还包括:在所述第一图像面积与所述第二图像面积的差值不在预设范围内的情况下,依据所述匹配特征点校正所述跟踪特征点。
进一步地,将所述实时视频流和所述参考图像的参考点进行特征匹配输出匹配特征点包括:在同时满足以下条件时,得到所述匹配特征点:
确定所述特征匹配过程中的匹配特征点的数目不低于预设值数目;
确定由所述匹配特征点计算出的单应性矩阵是预设的单应性矩阵;
确定所述匹配特征点的连线图像是预设图像,其中,所述预设图像为所述参考点的连线图像;
确定所述匹配特征点数与所述参考点数的比率不小于预设值。
进一步地,对所述参考图像的参考点进行特征跟踪输出跟踪特征点包括:在同时满足以下条件时,得到所述跟踪特征点:
确定所述特征跟踪过程中的跟踪特征点数目不低于预设值数目;
确定由所述跟踪特征点计算出的单应性矩阵是预设的单应性矩阵;
确定所述跟踪特征点的连线图像是预设图像,其中,所述预设图像为所述参考点的连线图像。
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的图像定位方法的实现。
通过本发明实施例,提取实时视频流中的指定图像作为参考图像,将该实时视频流和该参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对该参考点进行特征跟踪,得到跟踪特征点,在该匹配特征点与该跟踪特征点之间符合预设条件时,输出该实时视频流的图像帧,解决了移动终端资源有限,不能有效进行注册定位处理技术的问题,及时准确地实现了图像定位。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的一种图像定位方法的流程图;
图2是根据本发明实施例的图像定位装置的结构框图;
图3是根据本发明优选实施例的图像匹配跟踪系统模块结构框图;
图4是根据本发明优选实施例的图像跟踪方法的流程图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
在本实施例中提供了一种图像定位方法,图1是根据本发明实施例的一种图像定位方法的流程图,如图1所示,该流程包括如下步骤:
步骤S102,提取实时视频流中的指定图像作为参考图像;
步骤S104,将该实时视频流和该参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对该参考点进行特征跟踪,得到跟踪特征点;
步骤S106,在该匹配特征点与该跟踪特征点之间符合预设条件时,输出该实时视频流的图像帧。
通过上述步骤,提取实时视频流中的指定图像作为参考图像;将该实时视频流和该参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对该参考点进行特征跟踪,得到跟踪特征点;在该匹配特征点与该跟踪特征点之间符合预设条件时,输出该实时视频流的图像帧。本实施例中的参考点可以是图像中选取一个四边形,以四边形的四个顶点为参考点,匹配特征点和跟踪特征点之间符合的预设条件是点之间的关系,可以是点围成的图像之间的面积比大于阈值,点之间连线长度差值大于阈值。需要说明的是,在匹配特征点与跟踪特特征点符合预设条件之后,优选地输出跟踪处理结果,也可以输出匹配处理结果,或者,将跟踪处理结果与匹配处理结果进行校验校正后输出统一结果。采用上述技术方案,解决了移动终端资源有限,不能有效进行注册定位处理技术的问题,及时准确地实现了图像定位。
在本实施例中,该预设条件包括:
第一图像面积与第二图像面积的差值在预设范围内,其中,该第一图像面积为该匹配特征点围成的区域面积,该第二图像面积为该跟踪特征点围成的区域面积,也可以是第一图像面积与第二图像面积比大于阈值。
在本实施例中,在该第一图像面积与该第二图像面积的差值不在预设范围内的情况下,依据该匹配特征点校正该跟踪特征点。第一图像面积与第二图像面积的差值不在预设范围内,说明两种方法对同一视频流的处理结果不一样,在相关技术中,匹配的处理结果的更加准确,因此,在出现偏差时,采用匹配处理结果对跟踪处理结果进行校正,以期得到更好的技术方案。
在本实施例中,将该实时视频流和该参考图像的参考点进行特征匹配输出匹配特征点包 括:在同时满足以下条件时,得到该匹配特征点:
确定该特征匹配过程中的匹配特征点的数目不低于预设值数目;
确定由该匹配特征点计算出的单应性矩阵是预设的单应性矩阵;
确定该匹配特征点的连线图像是预设图像,其中,该预设图像为该参考点的连线图像;
确定该匹配特征点数与该参考点数的比率不小于预设值。
在验证匹配特征点与跟踪特征点符合预设条件之前,应用上述技术方案对匹配特征点进行独立验证,在同时满足上述四个条件时确定匹配特征点的正确性。
在本实施例中,对该参考图像的参考点进行特征跟踪输出跟踪特征点包括:
在同时满足以下条件时,得到该跟踪特征点:
确定该特征跟踪过程中的跟踪特征点数目不低于预设值数目;
确定由该跟踪特征点计算出的单应性矩阵是预设的单应性矩阵;
确定该跟踪特征点的连线图像是预设图像,其中,该预设图像为该参考点的连线图像。
在验证匹配特征点与跟踪特征点符合预设条件之前,应用上述技术方案对跟踪特征点进行独立验证,在同时满足上述四个条件时确定跟踪特征点的正确性。
在本实施例中还提供了一种图像定位装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图2是根据本发明实施例的图像定位装置的结构框图,如图2所示,该装置包括:
提取模块22,设置为提取实时视频流中的指定图像作为参考图像;
匹配跟踪模块24,与提取模块22连接,设置为将该实时视频流和该参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对该参考点进行特征跟踪,得到跟踪特征点;
输出模块26,与匹配跟踪模块24连接,设置为在该匹配特征点与该跟踪特征点之间符合预设条件时,输出该实时视频流的图像帧。
在本实施例中,该预设条件包括:
第一图像面积与第二图像面积的差值在预设范围内,其中,该第一图像面积为该匹配特征点围成的区域面积,该第二图像面积为该跟踪特征点围成的区域面积。
在本实施例中,该装置还包括:
在该第一图像面积与该第二图像面积的差值不在预设范围内的情况下,依据该匹配特征 点校正该跟踪特征点。
在本实施例中,将该实时视频流和该参考图像的参考点进行特征匹配输出匹配特征点包括:
在同时满足以下条件时,得到该匹配特征点:
确定该特征匹配过程中的匹配特征点的数目不低于预设值数目;
确定由该匹配特征点计算出的单应性矩阵是预设的单应性矩阵;
确定该匹配特征点的连线图像是预设图像,其中,该预设图像为该参考点的连线图像;
确定该匹配特征点数与该参考点数的比率不小于预设值。
在本实施例中,对该参考图像的参考点进行特征跟踪输出跟踪特征点包括:
在同时满足以下条件时,得到该跟踪特征点:
确定该特征跟踪过程中的跟踪特征点数目不低于预设值数目;
确定由该跟踪特征点计算出的单应性矩阵是预设的单应性矩阵;
确定该跟踪特征点的连线图像是预设图像,其中,该预设图像为该参考点的连线图像。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述各个模块均位于同一处理器中;或者,上述各个模块分别位于不同的处理器中。
下面结合本发明优选实施例进行详细说明。
本发明优选实施例的目的在于针对相关技术的缺陷,以及移动终端平台受限特点,提出一种基于模块交互的移动增强现实注册定位方法,可以在目前主流移动平台上实现实时、稳定、鲁棒的注册定位,以扩大增强现实应用范围,提高用户体验效果。
为实现上述目的,本发明优选实施例的方法包括如下步骤1,2,3,4,5所示:
步骤1,调用智能手机摄像头,采集场景实时视频流,取得参考模板图像,并对视频流进行预处理。
步骤2,分别开启跟踪模块线程(相当于上述实施例的匹配跟踪模块24的部分功能)和匹配模块线程(相当于上述实施例的匹配跟踪模块24的部分功能),将步骤1得到的视频流分别传入两个模块。
步骤3,匹配模块设置为对参考模板图像与实时视频流进行特征匹配,跟踪模块设置为对参考模板图像特征点(相当于上述实施例的参考点)进行特征跟踪。
步骤4,相关技术中图像跟踪的优点在于其实时性能好,但其稳定性、鲁棒性较差。与图 像跟踪正好相反,图像匹配的稳定性和鲁棒性能好,但其实时性能相对于跟踪算法较差。融合模块(相当于上述实施例的输出模块26的部分功能)结合了图像匹配和图像跟踪的优点,用于对匹配模块和跟踪模块进行交互校验。同时对于跟踪失败时,利用匹配模块对跟踪模块进行起始和校正。
步骤5,输出跟踪模块视频流(相当于上述实施例的输出模块26的部分功能),并使用位姿估计模块计算出的摄像机位姿将3D模型叠加在视频流中。
图3是根据本发明优选实施例的图像匹配跟踪系统模块结构框图,如图3所示,该结构框图包括:图像采集模块,图像跟踪模块,图像匹配模块,融合模块,位资估计模块,虚实融合与增强显示模块。
图4是根据本发明优选实施例的图像跟踪方法的流程图,如图4所示,该方法包括以下步骤:
步骤1,视频流采集与参考模板图像选取:
(1.1)调用安卓Android开发包的开源计算机视觉库(Open Source Computer Vision Library,简称为OpenCV)图形处理库打开摄像头,采集视频流。
(1.2)选择视频流的任意场景作为系统的参考模板图像。
步骤2,匹配模块对视频流进行处理:
(2.1)对视频流图像和参考模板进行尺度变换,用线性插值的方法以g为缩放因子将匹配图像缩放为3层金子塔,缩放因子g=0.5。
(2.2)选用特征检测算法对每一级金子塔图像进行特征检测,本发明优选实施例中采用了加速段试验的特点(Features from Accelerated Segment Test,简称为FAST)特征检测算法。
(2.3)选用一种快速的二进制描述子对特征点进行特征描述,本发明优选实施例中采用了定向简介(Oriented Brief,简称为ORB)特征描述。
(2.4)采用近似最近邻的快速库(Fast Library for Approximate Nearst Neighbors,简称为FLANN)算法进行快速特征匹配,同时利用随机抽样一致性(RANdom Sample Consensus,简称为RANSAC)算法滤除误匹配点。
(2.5)利用匹配点对计算摄像机单应性矩阵H(摄像机外参矩阵),利用H计算参考模板四个顶点(参考点)的透视变换输出,同时满足下面四个条件时,判定匹配模块的输出是正确的。四个条件如下(1)、(2)、(3)、(4)所示:
(1)对匹配特征点数目设定最小阈值。当匹配特征点数目小于设定阈值时,认为匹配失败,停止匹配模块输出。本发明优选实施例中匹配模块设定的最小阈值为5-15。
(2)本发明优选实施例使用了单应性矩阵优劣判断。单应性矩阵优劣判断的主要功能是对以匹配特征点计算出的单应性矩阵进行进一步筛选,判断是否是正确情况下的单应性矩阵。 优劣判断的主要算法步骤如下步骤a,b,c,d所示:
步骤a,第一次判断选取单应性矩阵H左上角2X2的子矩阵并计算子矩阵的行列式是否大于0。这个2X2矩阵称作R矩阵,包含了估计出的变换的旋转部分。正确的旋转矩阵行列式值应该为1,在一些情况下R可能包含尺度部分,因此R的行列式值可能有其他值,但是正确的旋转和尺度值都是大于0的。
步骤b,第二次判断获取单应性矩阵H中R矩阵(0,0)位置的元素以及(1,0)位置的元素,计算上述两个元素的平方和并进行开方,开方结果的正常范围应该在(0.1-4)之间,其中0.1和4是根据经验设置的阈值。
步骤c,第三次判断获取单应性矩阵H中R矩阵(0,1)位置的元素以及(1,1)位置的元素,计算上述两个元素的平方和并进行开方,开方结果的正常范围应该在(0.1-4)之间,其中0.1和4是根据经验设置的阈值。
步骤d,第四次判断获取单应性矩阵H(2,0)以及(2,1)位置的元素,计算它们的平方和并进行开方。上述两个元素的位置表示投影变换,开方结果的正常值应该大于0.002,其中0.002是根据经验设定的阈值。
(3)对匹配模块对应于参考点透视变换后的得到的匹配特征点进行判断。如果围成的图形是凸四边形,认为输出正确,否则停止当前图像帧的结果输出。本发明优选实施例选用了模板图像上四个顶点位置的参考点,这四个参考点分别在屏幕上的坐标是(w/4,h/4),(3w/4,h/4),(3w/4,3h/4),(w/4,3h/4)。根据匹配模块处理结果计算出的单应性矩阵,计算参考点透视变换后的四个点,这四个点构成的四边形应该是凸四边形。
(4)计算匹配得到的特征点数与参考模板特征点的比率,若小于一定阈值,认为匹配失败。具体方法为:设定一个图像掩膜,并将该掩膜作为单应性计算的一个输出参数。在计算得到单应性矩阵H后,统计掩膜内特征点个数C1。同时,将参考模板(参考模板)上的特征点个数记为C2,计算C1/C2。本发明优选实施例设定的阈值q取值范围为0.2-0.4,即C1/C2<q时,认为匹配失败,停止此图像帧的匹配输出,否则认为匹配成功。
应当指出,上文提到的四种求精方式是并行的。即只有这些方式同时成立时,匹配模块输出结果才认为是正确可信的。
步骤3,跟踪模块对视频流进行处理:
(3.1)在c代码端对参考模板图像进行尺度变换,用双线性插值的方法以g为缩放因子将匹配图像缩放为3层金子塔,缩放因子g=0.5。
(3.2)选用FAST-9特征检测算法对每一级金子塔图像进行特征检测。
(3.3)选用金字塔LK光流跟踪算法对每层图像检测到的特征点进行跟踪。
(3.4)使用匹配模块传入的初始单应矩阵以及视频流图像帧每一帧与前一帧之间的特征匹配计算跟踪模块单应性矩阵,并采用RANSAC算法和下面的3个条件对跟踪结果进行确认, 在同时满足下面的3个条件时,确定跟踪处理结果正确,3个条件如下(1)、(2)、(3)所示:
(1)对跟踪特征点数目设定最小阈值。当跟踪特征点数目小于设定阈值时,认为跟踪失败,停止跟踪模块输出。本发明优选实施例中跟踪模块设定的最小阈值为10-20。
(2)本发明优选实施例使用了单应性矩阵优劣判断。单应性矩阵优劣判断的主要功能是对以跟踪特征点计算出的单应性矩阵进行进一步筛选,判断是否是正确情况下的单应性矩阵。优劣判断的主要算法步骤如下步骤a,b,c,d所示:
步骤a,第一次判断选取单应性矩阵H左上角2X2的子矩阵并计算子矩阵的行列式是否大于0。这个2X2矩阵称作R矩阵,包含了估计出的变换的旋转部分。正确的旋转矩阵行列式值应该为1,在一些情况下R可能包含尺度部分,因此R的行列式值可能有其他值,但是正确的旋转和尺度值都是大于0的。
步骤b,第二次判断获取单应性矩阵H中R矩阵(0,0)位置的元素以及(1,0)位置的元素,计算上述两个元素的平方和并进行开方,开方结果的正常范围应该在(0.1-4)之间,其中0.1和4是根据经验设置的阈值。
步骤c,第三次判断获取单应性矩阵H中R矩阵(0,1)位置的元素以及(1,1)位置的元素,计算上述两个元素的平方和并进行开方,开方结果的正常范围应该在(0.1-4)之间,其中0.1和4是根据经验设置的阈值。
步骤d,第四次判断获取单应性矩阵H(2,0)以及(2,1)位置的元素,计算它们的平方和并进行开方。上述两个元素的位置表示投影变换,开方结果的正常值应该大于0.002,其中0.002是根据经验设定的阈值。
(3)对跟踪模块对应于参考点透视变换后的得到的跟踪特征点进行判断。如果围成的图形是凸四边形,认为输出正确,否则停止当前图像帧的结果输出。本发明优选实施例选用了模板图像上四个顶点位置的参考点,这四个参考点分别在屏幕上的坐标是(w/4,h/4),(3w/4,h/4),(3w/4,3h/4),(w/4,3h/4)。根据跟踪模块处理结果计算出的单应性矩阵,计算参考点透视变换后的四个点,这四个点构成的四边形应该是凸四边形。
应当指出,上文提到的三种求精方式是并行的。即只有这些方式同时成立时,跟踪模块输出结果才认为是正确可信的。
步骤4,融合模块对跟踪模块和匹配模块进行交互校验:
(4.1)在本发明优选实施例的图像匹配跟踪系统初次运行时融合的步骤,匹配模块利用参考模板图像和实时视频流进行图像特征匹配并有正确输出时,跟踪模块取得匹配模块初始单应性矩阵并检测参考模板特征点开始光流跟踪。为了匹配模块和跟踪模块图像帧的一致性,特征跟踪从此时匹配模块的同一帧开始。
(4.2)在本发明优选实施例的图像匹配跟踪系统运行中的融合的步骤。匹配模块每当处理完一帧图像并且有正确的输出,就计算参考模板的参考点透视变换后输出的四个点围成的四 边形面积,记为S1。同时计算此时跟踪模块输出的四个点围成的四边形面积,记为S2。计算两个模块的面积重叠比S2/S1。当S2/S1大于设定的阈值ε时,认为跟踪模块运行状况是正常的,即特征点跟踪是正常的,此时不需要任何操作。当S2/S1小于设定的阈值ε时,认为此时跟踪丢失或者失败,跟踪模块需要被校正。需要注意的是,由于匹配和跟踪处理速度不同,正常运行情况下的四边形重叠面积可能达不到很高的数值,因此阈值不能选取的太高,本发明优选实施例中设定为0.6-0.8。
步骤5,估计摄像机姿态,3D模型导入,实现虚实融合与增强显示:
(5.1)在java代码端打开摄像头,对触摸屏响应,触摸屏幕完成屏幕区域内参考模板选取,操作按钮进行实现,并声明与本地c代码端的接口;
(5.2)在c代码端使用c/c++代码实现上述步骤2到步骤4,完成相机姿态的实时更新,并将姿态信息与其它中间数据信息通过接口返回给java代码端;
(5.3)根据位姿估计模块提供的摄像机姿态,在计算机程序语言java代码端使用开放图形库子集(OpenGL for Embedded Systems,简称为OpenGL ES)2.0对3D模型进行渲染,并根据实现的触摸屏响应功能,手指在屏幕上滑动时,实现3D(Three Dimensional)模型的各个方向移动、旋转、尺寸改变,通过按钮控制模型的更换。
本发明优选实施例的图像跟踪方法,步骤综合考虑图像匹配和图像跟踪的特点,提出了一种基于模块交互的移动增强现实注册定位方法,主要采用图像匹配与图像跟踪并行运行并不断交互校验的方式,结合了图像匹配与图像跟踪的优点。利用该方法实现了基于移动终端的注册定位及增强现实系统,其优点主要表现在以下两个方面:
(1)本发明优选实施例通过采用匹配模块与跟踪模块并行运行并实时运行交互的方式,与单纯使用图像匹配方法或者特征跟踪方法相比,提高了注册定位的实时性和稳定性,满足了移动增强现实注册定位的要求。
(2)本发明优选实施例可以在移动终端平台上在正常、尺度放大缩小、旋转,部分遮挡等环境下实现实时、稳定、鲁棒的注册跟踪,并且在参考模板图像丢失时有效地进行跟踪恢复。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:
S1,提取实时视频流中的指定图像作为参考图像;
S2,将该实时视频流和该参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对该参考点进行特征跟踪,得到跟踪特征点;
S3,在该匹配特征点与该跟踪特征点之间符合预设条件时,输出该实时视频流的图像帧。
可选地,存储介质还被设置为存储用于执行上述实施例的方法步骤的程序代码:
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行上述实施例的方法步骤。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
本发明实施例提供的上述技术方案,可以应用于图像定位过程中,提取实时视频流中的指定图像作为参考图像,将该实时视频流和该参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对该参考点进行特征跟踪,得到跟踪特征点,在该匹配特征点与该跟踪特征点之间符合预设条件时,输出该实时视频流的图像帧,解决了移动终端资源有限,不能有效进行注册定位处理技术的问题,及时准确地实现了图像定位。

Claims (10)

  1. 一种图像定位方法,包括:
    提取实时视频流中的指定图像作为参考图像;
    将所述实时视频流和所述参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对所述参考点进行特征跟踪,得到跟踪特征点;
    在所述匹配特征点与所述跟踪特征点之间符合预设条件时,输出所述实时视频流的图像帧。
  2. 根据权利要求1所述的方法,其中,所述预设条件包括:
    第一图像面积与第二图像面积的差值在预设范围内,其中,所述第一图像面积为所述匹配特征点围成的区域面积,所述第二图像面积为所述跟踪特征点围成的区域面积。
  3. 根据权利要求2所述的方法,其中,所述方法还包括:
    在所述第一图像面积与所述第二图像面积的差值不在预设范围内的情况下,依据所述匹配特征点校正所述跟踪特征点。
  4. 根据权利要求1所述的方法,其中,将所述实时视频流和所述参考图像的参考点进行特征匹配输出匹配特征点包括:
    在同时满足以下条件时,得到所述匹配特征点:
    确定所述特征匹配过程中的匹配特征点的数目不低于预设值数目;
    确定由所述匹配特征点计算出的单应性矩阵是预设的单应性矩阵;
    确定所述匹配特征点的连线图像是预设图像,其中,所述预设图像为所述参考点的连线图像;
    确定所述匹配特征点数与所述参考点数的比率不小于预设值。
  5. 根据权利要求1所述的方法,其中,对所述参考图像的参考点进行特征跟踪输出跟踪特征点包括:
    在同时满足以下条件时,得到所述跟踪特征点:
    确定所述特征跟踪过程中的跟踪特征点数目不低于预设值数目;
    确定由所述跟踪特征点计算出的单应性矩阵是预设的单应性矩阵;
    确定所述跟踪特征点的连线图像是预设图像,其中,所述预设图像为所述参考点的连线图像。
  6. 一种图像定位装置,包括:
    提取模块,设置为提取实时视频流中的指定图像作为参考图像;
    匹配跟踪模块,设置为将所述实时视频流和所述参考图像中预先选定的参考点进行特征匹配,得到匹配特征点;以及对所述参考点进行特征跟踪,得到跟踪特征点;
    输出模块,设置为在所述匹配特征点与所述跟踪特征点之间符合预设条件时,输出所述实时视频流的图像帧。
  7. 根据权利要求6所述的装置,其中,所述预设条件包括:
    第一图像面积与第二图像面积的差值在预设范围内,其中,所述第一图像面积为所述匹配特征点围成的区域面积,所述第二图像面积为所述跟踪特征点围成的区域面积。
  8. 根据权利要求7所述的装置,其中,所述装置还包括:
    在所述第一图像面积与所述第二图像面积的差值不在预设范围内的情况下,依据所述匹配特征点校正所述跟踪特征点。
  9. 根据权利要求6所述的装置,其中,将所述实时视频流和所述参考图像的参考点进行特征匹配输出匹配特征点包括:
    在同时满足以下条件时,得到所述匹配特征点:
    确定所述特征匹配过程中的匹配特征点的数目不低于预设值数目;
    确定由所述匹配特征点计算出的单应性矩阵是预设的单应性矩阵;
    确定所述匹配特征点的连线图像是预设图像,其中,所述预设图像为所述参考点的连线图像;
    确定所述匹配特征点数与所述参考点数的比率不小于预设值。
  10. 根据权利要求6所述的装置,其中,对所述参考图像的参考点进行特征跟踪输出跟踪特征点包括:
    在同时满足以下条件时,得到所述跟踪特征点:
    确定所述特征跟踪过程中的跟踪特征点数目不低于预设值数目;
    确定由所述跟踪特征点计算出的单应性矩阵是预设的单应性矩阵;
    确定所述跟踪特征点的连线图像是预设图像,其中,所述预设图像为所述参考点的连线图像。
PCT/CN2017/078324 2016-03-29 2017-03-27 图像定位方法及装置 WO2017167159A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610187893.4 2016-03-29
CN201610187893.4A CN107248169B (zh) 2016-03-29 2016-03-29 图像定位方法及装置

Publications (1)

Publication Number Publication Date
WO2017167159A1 true WO2017167159A1 (zh) 2017-10-05

Family

ID=59962613

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/078324 WO2017167159A1 (zh) 2016-03-29 2017-03-27 图像定位方法及装置

Country Status (2)

Country Link
CN (1) CN107248169B (zh)
WO (1) WO2017167159A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110060276A (zh) * 2019-04-18 2019-07-26 腾讯科技(深圳)有限公司 对象追踪方法、追踪处理方法、相应的装置、电子设备
CN110097061A (zh) * 2019-04-16 2019-08-06 聚好看科技股份有限公司 一种图像显示方法及装置
CN112102407A (zh) * 2020-09-09 2020-12-18 北京市商汤科技开发有限公司 显示设备的定位方法、装置、显示设备及计算机存储介质
CN112634469A (zh) * 2019-09-24 2021-04-09 北京沃东天骏信息技术有限公司 用于处理图像的方法和装置

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019084726A1 (zh) * 2017-10-30 2019-05-09 深圳市柔宇科技有限公司 基于标志物的摄像头图像处理方法、增强现实设备
CN108021921A (zh) * 2017-11-23 2018-05-11 塔普翊海(上海)智能科技有限公司 图像特征点提取系统及其应用
CN108010055B (zh) * 2017-11-23 2022-07-12 塔普翊海(上海)智能科技有限公司 三维物体的跟踪系统及其跟踪方法
CN111433809B (zh) * 2020-01-17 2021-08-27 上海亦我信息技术有限公司 行进路线及空间模型生成方法、装置、系统
CN112184674A (zh) * 2020-09-30 2021-01-05 苏州艾隆科技股份有限公司 药品检测方法、装置、电子终端及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101303732A (zh) * 2008-04-11 2008-11-12 西安交通大学 基于车载单目相机的运动目标感知与告警方法
CN102819845A (zh) * 2011-06-07 2012-12-12 中兴通讯股份有限公司 一种混合特征的跟踪方法和装置
CN103279952A (zh) * 2013-05-17 2013-09-04 华为技术有限公司 一种目标跟踪方法和装置
CN103929669A (zh) * 2014-04-30 2014-07-16 成都理想境界科技有限公司 可交互视频生成器、播放器及其生成方法、播放方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101893935B (zh) * 2010-07-14 2012-01-11 北京航空航天大学 基于真实球拍的协同式增强现实乒乓球系统构建方法
CN101976464B (zh) * 2010-11-03 2013-07-31 北京航空航天大学 基于单应性矩阵的多平面动态的增强现实注册的方法
CN103415860B (zh) * 2011-01-27 2019-07-12 苹果公司 确定第一和第二图像间的对应关系的方法以及确定摄像机姿态的方法
CN102521859B (zh) * 2011-10-19 2014-11-05 中兴通讯股份有限公司 基于人工标志的增强现实方法及装置
WO2013079098A1 (en) * 2011-11-29 2013-06-06 Layar B.V. Dynamically configuring an image processing function
CN103035003B (zh) * 2012-12-11 2015-09-09 华为技术有限公司 一种实现增强现实的方法及装置
CN103632626B (zh) * 2013-12-03 2016-06-29 四川省计算机研究院 一种基于移动互联网的智能导游实现方法、装置及移动客户端
CN103854283B (zh) * 2014-02-21 2017-04-05 北京理工大学 一种基于在线学习的移动增强现实跟踪注册方法
CN104077596A (zh) * 2014-06-18 2014-10-01 河海大学 一种无标志物跟踪注册方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101303732A (zh) * 2008-04-11 2008-11-12 西安交通大学 基于车载单目相机的运动目标感知与告警方法
CN102819845A (zh) * 2011-06-07 2012-12-12 中兴通讯股份有限公司 一种混合特征的跟踪方法和装置
CN103279952A (zh) * 2013-05-17 2013-09-04 华为技术有限公司 一种目标跟踪方法和装置
CN103929669A (zh) * 2014-04-30 2014-07-16 成都理想境界科技有限公司 可交互视频生成器、播放器及其生成方法、播放方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHEN, YASHA ET AL.: "Automatic Target Recognition and Tracking System Based on Template Image", CHINA MASTER'S THESES FULL-TEXT DATABASE, 15 January 2008 (2008-01-15), ISSN: 1674-0246 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110097061A (zh) * 2019-04-16 2019-08-06 聚好看科技股份有限公司 一种图像显示方法及装置
CN110060276A (zh) * 2019-04-18 2019-07-26 腾讯科技(深圳)有限公司 对象追踪方法、追踪处理方法、相应的装置、电子设备
CN110060276B (zh) * 2019-04-18 2023-05-16 腾讯科技(深圳)有限公司 对象追踪方法、追踪处理方法、相应的装置、电子设备
CN112634469A (zh) * 2019-09-24 2021-04-09 北京沃东天骏信息技术有限公司 用于处理图像的方法和装置
CN112102407A (zh) * 2020-09-09 2020-12-18 北京市商汤科技开发有限公司 显示设备的定位方法、装置、显示设备及计算机存储介质

Also Published As

Publication number Publication date
CN107248169B (zh) 2021-01-22
CN107248169A (zh) 2017-10-13

Similar Documents

Publication Publication Date Title
WO2017167159A1 (zh) 图像定位方法及装置
CN110136229B (zh) 一种用于实时虚拟换脸的方法与设备
CN107222468B (zh) 增强现实处理方法、终端、云端服务器和边缘服务器
WO2021008166A1 (zh) 用于虚拟试衣的方法和装置
WO2018014828A1 (zh) 识别二维码位置的方法及其系统
CN112052789A (zh) 人脸识别方法、装置、电子设备及存储介质
WO2022012085A1 (zh) 人脸图像处理方法、装置、存储介质及电子设备
US11257293B2 (en) Augmented reality method and device fusing image-based target state data and sound-based target state data
CN109887003A (zh) 一种用于进行三维跟踪初始化的方法与设备
WO2020056903A1 (zh) 用于生成信息的方法和装置
CN104898832A (zh) 一种基于智能终端的3d实时眼镜试戴方法
JP7182689B2 (ja) ビデオフレーム処理方法及び装置
CN109754464B (zh) 用于生成信息的方法和装置
CN104881114A (zh) 一种基于3d眼镜试戴的角度转动实时匹配方法
CN110598139A (zh) 基于5G云计算的Web浏览器增强现实实时定位的方法
CN109937434A (zh) 图像处理方法、装置、终端和存储介质
WO2020024485A1 (zh) 用于插入图像的方法和装置
CN112766215A (zh) 人脸融合方法、装置、电子设备及存储介质
CN113077524B (zh) 一种双目鱼眼相机自动标定方法、装置、设备及存储介质
WO2020155908A1 (zh) 用于生成信息的方法和装置
CN110097061B (zh) 一种图像显示方法及装置
CN107248138B (zh) 虚拟现实环境中的人类视觉显著性预测方法
CN116188742A (zh) 虚拟对象的控制方法、装置、设备及存储介质
CN113486941B (zh) 直播图像的训练样本生成方法、模型训练方法及电子设备
Lin et al. A Multi‐Person Selfie System via Augmented Reality

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 17773189

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17773189

Country of ref document: EP

Kind code of ref document: A1