CN113112545B - Handheld mobile printing device positioning method based on computer vision - Google Patents
Handheld mobile printing device positioning method based on computer vision Download PDFInfo
- Publication number
- CN113112545B CN113112545B CN202110403051.9A CN202110403051A CN113112545B CN 113112545 B CN113112545 B CN 113112545B CN 202110403051 A CN202110403051 A CN 202110403051A CN 113112545 B CN113112545 B CN 113112545B
- Authority
- CN
- China
- Prior art keywords
- coordinate system
- camera
- printing device
- printing
- pose
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 239000011159 matrix material Substances 0.000 claims abstract description 68
- 230000009466 transformation Effects 0.000 claims abstract description 44
- 230000003287 optical effect Effects 0.000 claims description 41
- 238000004364 calculation method Methods 0.000 claims description 7
- 230000000903 blocking effect Effects 0.000 claims 1
- 239000003550 marker Substances 0.000 description 16
- 238000005516 engineering process Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 230000035515 penetration Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/002—Measuring arrangements characterised by the use of optical techniques for measuring two or more coordinates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30204—Marker
- G06T2207/30208—Marker matrix
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
本发明公开了一种基于计算机视觉的手持移动打印装置定位方法,其实现过程是:(1)构建定位场景;(2)建立世界坐标系;(3)确定打印平面;(4)建立打印坐标系;(5)计算坐标系变换矩阵;(6)计算位姿变换矩阵;(7)实时计算打印装置位姿。本发明使用单个相机和简单算法实现定位,用较低的成本实现对手持移动打印装置的实时定位。
The invention discloses a positioning method for a handheld mobile printing device based on computer vision. The realization process is: (1) constructing a positioning scene; (2) establishing a world coordinate system; (3) determining a printing plane; (4) establishing a printing coordinate system; (5) calculate the coordinate system transformation matrix; (6) calculate the pose transformation matrix; (7) calculate the pose of the printing device in real time. The invention uses a single camera and a simple algorithm to realize positioning, and realizes real-time positioning of a hand-held mobile printing device at a lower cost.
Description
技术领域technical field
本发明属于空间定位领域,更进一步涉及空间定位领域中的一种基于计算机视觉的手持移动打印装置定位方法。本发明用于手持移动打印装置,打印装置上的相机持续获取图像,通过对图像的处理可以实现对打印装置自身的实时定位。The invention belongs to the field of space positioning, and further relates to a computer vision-based positioning method for a handheld mobile printing device in the field of space positioning. The invention is used in a hand-held mobile printing device. The camera on the printing device continuously acquires images, and the real-time positioning of the printing device itself can be realized by processing the images.
背景技术Background technique
不同于传统打印机,手持移动打印机体积小巧,便携性好,可打印长条形图案,由于没有定位功能,若要打印幅面较大的图案,则只能依靠经验手工拼接打印,往往拼接打印效果不好。若手持移动打印机可获得高频高精度定位信息,那么就可以根据打印头位置打印所需图像,则可不受幅面限制地,不受框架限制地在进行高精度手持移动打印。Different from traditional printers, hand-held mobile printers are small in size, good in portability, and can print long strip patterns. Since there is no positioning function, if you want to print larger-format patterns, you can only rely on experience to manually splice and print. Often the splicing printing effect is not good. good. If the handheld mobile printer can obtain high-frequency and high-precision positioning information, then it can print the desired image according to the position of the print head, and can perform high-precision handheld mobile printing without being limited by the format or frame.
现有的定位技术主要分为无线定位和光学定位。无线定位技术有蓝牙定位、wifi定位、超带宽定位等。光学定位技术有红外定位和计算机视觉定位。其中无线定位的穿透性较高但定位精度较低,光学定位的精度较高但穿透性较低。计算机视觉定位可以实现摄像头视场内大范围的高精度定位,适合于对手持移动打印装置进行定位。Existing positioning technologies are mainly divided into wireless positioning and optical positioning. Wireless positioning technologies include Bluetooth positioning, wifi positioning, ultra-wideband positioning, etc. Optical positioning technology includes infrared positioning and computer vision positioning. Among them, wireless positioning has higher penetration but lower positioning accuracy, and optical positioning has higher accuracy but lower penetration. Computer vision positioning can realize high-precision positioning in a large range within the field of view of the camera, and is suitable for positioning handheld mobile printing devices.
目前的针对手持移动打印装置的计算机视觉定位方法是通过外置的双目或多目相机对标记物进行三维重建实现的。在手持移动打印装置上放置标记点,多个相机从不同的视角拍摄标记点,检测图像上的标记点后,利用三角测量原理获取标记点的深度信息,通过这些深度信息重建出标记点的三维模型,从而实现对手持移动打印装置的三维定位,获得其位姿信息。这种多目重建的定位方法处理每帧图像所需的计算量较大,因此固定时间内处理的图像帧较少,往往定位频率低,与此同时,至少需要两个相机才能进行定位,实现定位的成本较高。The current computer vision positioning method for handheld mobile printing devices is realized by three-dimensional reconstruction of markers through external binocular or multi-eye cameras. Marking points are placed on the handheld mobile printing device, and multiple cameras take pictures of the marking points from different angles of view. After detecting the marking points on the image, the depth information of the marking points is obtained by using the principle of triangulation, and the three-dimensional shape of the marking points is reconstructed through these depth information. model, so as to realize the three-dimensional positioning of the handheld mobile printing device and obtain its pose information. This multi-eye reconstruction positioning method requires a large amount of calculation to process each frame of image, so the number of image frames processed in a fixed time is less, and the positioning frequency is often low. At the same time, at least two cameras are required to perform positioning. The cost of positioning is high.
发明内容Contents of the invention
本发明的目的在于针对上述已有技术的不足,提出了一种基于计算机视觉的手持移动打印装置定位方法,解决现有定位技术中存在的计算量大导致的定位频率低,所需相机数目多导致的高成本的问题。The purpose of the present invention is to address the shortcomings of the above-mentioned prior art, and propose a computer vision-based positioning method for a handheld mobile printing device, which solves the problems of low positioning frequency and large number of cameras required in the existing positioning technology due to the large amount of calculation lead to high cost problems.
实现本发明目的的思路是,利用手持移动打印装置上的单目相机获取的图像信息,根据像素点和世界坐标系中的点之间摄影几何关系计算相机在世界坐标系下的位姿,通过一系列坐标系变换可得到手持移动打印装置的打印头在打印坐标系下的位姿,每获得一帧图像都进行以上步骤,计算打印装置位姿,实现手持移动打印装置的实时定位。The idea of realizing the purpose of the present invention is to use the image information acquired by the monocular camera on the handheld mobile printing device to calculate the pose of the camera in the world coordinate system according to the photographic geometric relationship between the pixel point and the point in the world coordinate system. A series of coordinate system transformations can obtain the pose of the print head of the handheld mobile printing device in the printing coordinate system. The above steps are performed for each frame of image obtained to calculate the pose of the printing device and realize real-time positioning of the handheld mobile printing device.
实现本发明目的的具体步骤如下:The concrete steps that realize the object of the present invention are as follows:
(1)构建定位场景:(1) Build a positioning scene:
将标记图案放置在手持移动打印装置上的相机前,使标记图案在相机的视场角范围内;Place the mark pattern in front of the camera on the handheld mobile printing device, so that the mark pattern is within the field of view of the camera;
(2)建立世界坐标系:(2) Establish the world coordinate system:
将标记图案上任意一点作为原点,将标记图案所在平面的法向量作为Z轴,建立一个右手三维直角坐标系作为世界坐标系;Take any point on the marked pattern as the origin, take the normal vector of the plane where the marked pattern is located as the Z axis, and establish a right-handed three-dimensional Cartesian coordinate system as the world coordinate system;
(3)确定打印平面:(3) Determine the printing plane:
(3a)若打印区域是矩形,则用该打印装置的相机在该矩形打印区域的三个边角点处分别拍摄标记图案;(3a) If the printing area is a rectangle, use the camera of the printing device to take pictures of the marking patterns at three corner points of the rectangular printing area;
(3b)若打印区域是非矩形,则用该打印装置的相机在该非矩形打印区域内任意不共线的三点处分别拍摄标记图案;(3b) If the printing area is non-rectangular, use the camera of the printing device to take pictures of the marking pattern at any three points that are not collinear within the non-rectangular printing area;
(4)建立打印坐标系:(4) Establish printing coordinate system:
(4a)若打印区域是矩形,则将步骤(3a)中所选取的三个边角点中与其他两点都相邻的边角点作为原点O1,其它两点分别记为A1和B1,A1和B1的位置满足B1在有向线段前进方向的左侧,将和分别作为X轴和Y轴,将打印平面的法向量作为Z轴,建立一个右手三维直角坐标系作为打印坐标系;(4a) If the printing area is a rectangle, take the corner point adjacent to the other two points among the three corner points selected in step (3a) as the origin O 1 , and record the other two points as A 1 and The positions of B 1 , A 1 and B 1 satisfy that B 1 is on the directed line segment to the left in the direction of travel, place the and As the X-axis and Y-axis respectively, the normal vector of the printing plane is used as the Z-axis, and a right-handed three-dimensional Cartesian coordinate system is established as the printing coordinate system;
(4b)若打印区域是非矩形,则将步骤(3b)中所选取的不共线的三点中的任意一点作为原点O2,其它两点分别记为A2和B2,A2和B2的位置满足B2在有向线段前进方向的左侧,将打印平面的法向量作为Z轴,将作为X轴,将X轴与Z轴叉乘的结果作为Y轴,建立一个右手三维直角坐标系作为打印坐标系;(4b) If the printing area is non-rectangular, take any one of the three non-collinear points selected in step (3b) as the origin O 2 , and record the other two points as A 2 and B 2 , A 2 and B respectively The position of 2 satisfies that B 2 is on the directed line segment On the left side of the forward direction, the normal vector of the printing plane is used as the Z axis, and the As the X-axis, use the cross product of the X-axis and the Z-axis as the Y-axis, and establish a right-handed three-dimensional rectangular coordinate system as the printing coordinate system;
(5)计算坐标系变换矩阵;(5) Calculate the coordinate system transformation matrix;
(5a)计算每次拍摄时打印装置的相机光心在世界坐标系中的位置;(5a) Calculate the position of the camera optical center of the printing device in the world coordinate system when shooting each time;
(5b)计算相机光心在世界坐标系中的位置每两点之间的欧式距离,根据欧氏距离和相机光心到打印平面的高度H计算每次拍摄时打印装置的相机光心在打印坐标系中的位置,若打印区域是矩形,记相机在O1、A1、B1处拍摄时相机光心在世界坐标系中3×1维度的非齐次坐标分别为W11、W12、W13,则相机光心相对应地在打印坐标系中的非齐次坐标分别为若打印区域是非矩形,记相机在O2、A2、B2处拍摄时相机光心在世界坐标系中3×1维度的非齐次坐标分别为W21、W22、W23,则相机光心相对应地在打印坐标系中的非齐次坐标分别为 其中,||·||表示求欧式距离操作,θ表示与之间的夹角;(5b) Calculate the Euclidean distance between every two points of the position of the camera optical center in the world coordinate system, and calculate the camera optical center of the printing device when printing according to the Euclidean distance and the height H of the camera optical center to the printing plane The position in the coordinate system, if the printing area is a rectangle, remember that when the camera is shooting at O 1 , A 1 , and B 1 , the non-homogeneous coordinates of the camera’s optical center in the world coordinate system in the 3×1 dimension are W 11 , W 12 respectively , W 13 , then the corresponding inhomogeneous coordinates of the camera optical center in the printing coordinate system are If the printing area is non-rectangular, remember that when the camera shoots at O 2 , A 2 , and B 2 , the non-homogeneous coordinates of the camera’s optical center in the world coordinate system in the 3×1 dimension are W 21 , W 22 , and W 23 , then the camera The corresponding inhomogeneous coordinates of the optical center in the printing coordinate system are Among them, ||·|| represents the Euclidean distance operation, and θ represents and the angle between
(5c)根据每次拍摄时相机光心在两个坐标系下的位置计算世界坐标系到打印坐标系的坐标系变换矩阵;(5c) Calculate the coordinate system transformation matrix from the world coordinate system to the printing coordinate system according to the positions of the optical center of the camera in the two coordinate systems during each shooting;
(6)计算位姿变换矩阵:(6) Calculate the pose transformation matrix:
(6a)将打印装置喷头的端点作为原点,将喷头出墨方向作为X轴,将喷头排列方向作为Y轴,建立一个三维直角坐标系作为打印装置坐标系;(6a) Taking the end point of the nozzle of the printing device as the origin, the direction of ink output from the nozzle as the X-axis, and the direction of the arrangement of the nozzles as the Y-axis, a three-dimensional rectangular coordinate system is established as the coordinate system of the printing device;
(6b)根据相机坐标系与打印装置坐标系之间的欧拉角和偏移量,构造打印装置上相机的位姿到打印装置位姿的位姿变换矩阵;(6b) According to the Euler angle and the offset between the camera coordinate system and the printing device coordinate system, construct a pose transformation matrix from the pose of the camera on the printing device to the pose of the printing device;
(7)实时计算打印装置位姿:(7) Calculate the pose of the printing device in real time:
(7a)采用与步骤(5a)相同的方法,计算打印装置上的相机在世界坐标系中的位姿;(7a) Using the same method as step (5a), calculate the pose of the camera on the printing device in the world coordinate system;
(7b)根据步骤(5c)中得到的坐标系变换矩阵,计算打印装置上的相机在打印坐标系中的位姿;(7b) Calculate the pose of the camera on the printing device in the print coordinate system according to the coordinate system transformation matrix obtained in step (5c);
(7c)采用与步骤(7b)相同的方法,根据步骤(6b)中得到的位姿变换矩阵计算打印装置在打印坐标系中的位置和姿态。(7c) Using the same method as step (7b), calculate the position and attitude of the printing device in the printing coordinate system according to the pose transformation matrix obtained in step (6b).
本发明与现有的相比,具有以下优点:Compared with existing ones, the present invention has the following advantages:
第一,由于本发明仅需单个相机就可实现对手持移动打印装置进行定位,克服了现有技术所需相机数目多的问题,使得本发明具有所需相机数目少,相机成本低的优点。First, because the present invention only needs a single camera to realize the positioning of the handheld mobile printing device, it overcomes the problem of a large number of cameras required in the prior art, so that the present invention has the advantages of a small number of required cameras and low camera cost.
第二,由于本发明根据相机位姿进行定位,而不需要进行复杂的重建算法,克服了现有技术计算量大导致的定位频率低的问题,由于处理每帧图像所需的计算量与现有技术相比更小,因此相同芯片在固定时间内可处理更多的图像帧,从而获得更高频率的定位信息,使得本发明具有定位频率高的优点。Second, because the present invention performs positioning according to the camera pose without complex reconstruction algorithms, it overcomes the problem of low positioning frequency caused by the large amount of calculation in the prior art. Compared with the existing technology, it is smaller, so the same chip can process more image frames in a fixed time, so as to obtain higher frequency positioning information, so that the present invention has the advantage of high positioning frequency.
附图说明Description of drawings
图1为本发明的流程图;Fig. 1 is a flowchart of the present invention;
图2为本发明的实施例的示意图。Fig. 2 is a schematic diagram of an embodiment of the present invention.
具体实施方式Detailed ways
下面参照附图和实施例,对本发明的做进一步的描述。The present invention will be further described below with reference to the accompanying drawings and embodiments.
参照附图1,对本发明的具体实现步骤做进一步的描述。With reference to accompanying drawing 1, the specific implementation steps of the present invention are further described.
步骤1,构建定位场景。Step 1, build a positioning scene.
将标记图案放置在手持移动打印装置上的相机前,使标记图案在相机的视场角范围内。标记图案是指棋盘格、二维码、同心圆环、灰度图案中的任意一种。相机指的是内参数矩阵已知且所拍摄图像都经过去畸变处理的相机,所述内参数矩阵如下,The marking pattern is placed in front of the camera on the handheld mobile printing device, so that the marking pattern is within the field of view of the camera. The marking pattern refers to any one of checkerboard, two-dimensional code, concentric rings, and grayscale patterns. The camera refers to a camera whose internal parameter matrix is known and the captured images have been de-distorted. The internal parameter matrix is as follows,
其中,K表示相机的内参数矩阵,f表示相机的镜头焦距值,m和n分别表示在像素坐标系中相机主点在x轴和y轴的偏移量。Among them, K represents the internal parameter matrix of the camera, f represents the lens focal length value of the camera, m and n represent the offsets of the principal point of the camera on the x-axis and y-axis in the pixel coordinate system, respectively.
步骤2,建立世界坐标系。
将标记图案上任意一点作为原点,将标记图案所在平面的法向量作为Z轴,建立一个三维直角坐标系作为世界坐标系。Take any point on the marked pattern as the origin, take the normal vector of the plane where the marked pattern is located as the Z axis, and establish a three-dimensional Cartesian coordinate system as the world coordinate system.
步骤3,确定打印平面。Step 3, determine the printing plane.
3.1)若打印区域是矩形,则用该打印装置的相机在该矩形打印区域的三个边角点处分别拍摄标记图案。3.1) If the printing area is rectangular, use the camera of the printing device to take pictures of the marking patterns at the three corner points of the rectangular printing area.
3.2)若打印区域是非矩形,则用该打印装置的相机在该非矩形打印区域内任意不共线的三点处分别拍摄标记图案。3.2) If the printing area is non-rectangular, use the camera of the printing device to take pictures of the marking patterns at any three points that are not collinear in the non-rectangular printing area.
步骤4,建立打印坐标系。
若打印区域是矩形,则将步骤3.1)中所选取的三个边角点中与其他两点都相邻的边角点作为原点O1,其它两点分别记为A1和B1,A1和B1的位置满足B1在有向线段前进方向的左侧,将和分别作为X轴和Y轴,将打印平面的法向量作为Z轴,建立一个右手三维直角坐标系作为打印坐标系;If the printing area is a rectangle, take the corner point adjacent to the other two points among the three corner points selected in step 3.1) as the origin O 1 , and record the other two points as A 1 and B 1 , A The positions of 1 and B 1 satisfy that B 1 is on the directed line segment to the left in the direction of travel, place the and As the X-axis and Y-axis respectively, the normal vector of the printing plane is used as the Z-axis, and a right-handed three-dimensional Cartesian coordinate system is established as the printing coordinate system;
若打印区域是非矩形,则将步骤3.2)中所选取的不共线的三点中的任意一点作为原点O2,其它两点分别记为A2和B2,A2和B2的位置满足B2在有向线段前进方向的左侧,将打印平面法向量作为Z轴,将作为X轴,将X轴与Z轴叉乘的结果作为Y轴,建立一个右手三维直角坐标系作为打印坐标系;If the printing area is non-rectangular, take any one of the three non-collinear points selected in step 3.2) as the origin O 2 , and record the other two points as A 2 and B 2 respectively, and the positions of A 2 and B 2 satisfy B 2 is on the directed line segment On the left side of the forward direction, the normal vector of the printing plane is used as the Z axis, and the As the X-axis, use the cross product of the X-axis and the Z-axis as the Y-axis, and establish a right-handed three-dimensional rectangular coordinate system as the printing coordinate system;
步骤5,计算坐标系变换矩阵。
5.1)利用xij=KRi[I|-Ci]Xij公式,计算每次拍摄时打印装置的相机光心在世界坐标系中的位置。其中,xij表示第i次拍摄时第j个标记点的3×1维度的齐次像素坐标,i=1、2、3,0≤j≤n,n≥4,K表示3×3维度的相机内参数矩阵,Ri表示第i次拍摄时相机在世界坐标系中的3×3维度的旋转矩阵,I表示3×3维度的单位矩阵,|表示矩阵分块操作,Ci表示第i次拍摄时的相机光心的3×1维度的非齐次世界坐标,Xij表示第i次拍摄时第j个标记点的4×1维度的齐次世界坐标,由世界坐标系的建立方法,Xij的Z分量为0,xij与Xij一一对应,利用每次拍摄中获得的不少于4对标记点和旋转矩阵Ri的正交性质可求解相机光心位置Ci和相机姿态Ri。5.1) Using the formula x ij =KR i [I|-C i ]X ij to calculate the position of the optical center of the camera of the printing device in the world coordinate system at each shot. Among them, x ij represents the homogeneous pixel coordinates of the 3×1 dimension of the j-th marker point during the i-th shooting, i=1, 2, 3, 0≤j≤n, n≥4, and K represents the 3×3 dimension The internal parameter matrix of the camera, R i represents the 3×3-dimensional rotation matrix of the camera in the world coordinate system at the i-th shooting, I represents the 3×3-dimensional identity matrix, | represents the matrix block operation, and C i represents the The non-homogeneous world coordinates of the 3×1 dimension of the optical center of the camera at the i-th shooting, X ij represents the homogeneous world coordinates of the 4×1 dimension of the j-th marker point at the i-th shooting, established by the world coordinate system method, the Z component of X ij is 0, and x ij corresponds to X ij one by one, and the optical center position C i of the camera can be solved by using the orthogonal property of not less than 4 pairs of marker points obtained in each shooting and the rotation matrix R i and camera pose R i .
5.2)计算相机光心在世界坐标系中的位置每两点之间的欧式距离,根据欧氏距离和相机光心到打印平面的高度H计算每次拍摄时打印装置的相机光心在打印坐标系中的位置,若打印区域是矩形,记相机在O1、A1、B1处拍摄时相机光心在世界坐标系中3×1维度的非齐次坐标分别为W11、W12、W13,则相机光心相对应地在打印坐标系中的非齐次坐标分别为若打印区域是非矩形,记相机在O2、A2、B2处拍摄时相机光心在世界坐标系中3×1维度的非齐次坐标分别为W21、W22、W23,则相机光心相对应地在打印坐标系中的非齐次坐标分别为 其中,||·||表示求欧式距离操作,θ表示与之间的夹角;5.2) Calculate the Euclidean distance between every two points of the position of the camera optical center in the world coordinate system, and calculate the printing coordinates of the camera optical center of the printing device at each shooting according to the Euclidean distance and the height H of the camera optical center to the printing plane position in the world coordinate system, if the printing area is a rectangle, remember that when the camera shoots at O 1 , A 1 , and B 1 , the inhomogeneous coordinates of the optical center of the camera in the world coordinate system in the 3×1 dimension are W 11 , W 12 , W 13 , then the corresponding inhomogeneous coordinates of the camera optical center in the printing coordinate system are If the printing area is non-rectangular, remember that when the camera shoots at O 2 , A 2 , and B 2 , the non-homogeneous coordinates of the camera’s optical center in the world coordinate system in the 3×1 dimension are W 21 , W 22 , and W 23 , then the camera The corresponding inhomogeneous coordinates of the optical center in the printing coordinate system are Among them, ||·|| represents the Euclidean distance operation, and θ represents and the angle between
5.3)利用Xp=TwpXw公式和每次拍摄时相机光心在两个坐标系下的位置计算世界坐标系到打印坐标系的坐标系变换矩阵。其中,Xp表示相机光心在打印坐标系中的4×1维度的齐次坐标向量,Twp表示世界坐标系到打印坐标系的4×4维度的欧式变换矩阵,使用至少三个点对可求解欧式变换矩阵Twp,Xw表示相机光心在世界坐标系中的4×1维度的齐次坐标向量。5.3) Calculate the coordinate system transformation matrix from the world coordinate system to the print coordinate system by using the X p =T wp X w formula and the position of the camera optical center in the two coordinate systems at each shooting. Among them, X p represents the 4×1 dimension homogeneous coordinate vector of the camera optical center in the print coordinate system, T wp represents the 4×4 dimension Euclidean transformation matrix from the world coordinate system to the print coordinate system, using at least three point pairs The Euclidean transformation matrix T wp can be solved, and X w represents the 4×1-dimensional homogeneous coordinate vector of the camera optical center in the world coordinate system.
步骤6,计算位姿变换矩阵。
将打印装置喷头的端点作为原点,将喷头出墨方向作为X轴,将喷头排列方向作为Y轴,建立一个三维直角坐标系作为打印装置坐标系。Taking the endpoint of the nozzle of the printing device as the origin, the direction of ink output from the nozzle as the X axis, and the direction of the nozzle arrangement as the Y axis, a three-dimensional Cartesian coordinate system is established as the coordinate system of the printing device.
根据相机坐标系与打印装置坐标系之间的欧拉角和偏移量,利用公式构造打印装置上相机的位姿到打印装置位姿的位姿变换矩阵。其中,T4×4表示4×4维度的欧式变换矩阵,R3×3表示3×3维度的旋转矩阵,该旋转矩阵可由相机坐标系与打印装置坐标系之间的欧拉角得到,t3×1表示3×1维度的水平偏移向量,该水平偏移向量是相机坐标系与打印装置坐标系之间的水平偏移向量。According to the Euler angle and offset between the camera coordinate system and the printing device coordinate system, use the formula Construct the pose transformation matrix from the pose of the camera on the printing device to the pose of the printing device. Among them, T 4×4 represents the Euclidean transformation matrix of 4×4 dimensions, R 3×3 represents the rotation matrix of 3×3 dimensions, which can be obtained from the Euler angle between the camera coordinate system and the printing device coordinate system, t 3×1 represents a horizontal offset vector of 3×1 dimensions, and the horizontal offset vector is a horizontal offset vector between the camera coordinate system and the printing device coordinate system.
步骤7,实时计算打印装置位姿。
7.1)采用与步骤5.1)相同的方法,计算打印装置上的相机在世界坐标系中的位姿;7.1) Using the same method as step 5.1), calculate the pose of the camera on the printing device in the world coordinate system;
7.2)根据坐标系变换矩阵,利用位置计算公式Xb=TXa和姿态计算公式Rb=RRa计算打印装置上的相机在打印坐标系中的位姿。其中,Xb表示变换后的4×1维度的表示位置的齐次坐标向量,T表示4×4维度的欧式变换矩阵,Xa表示变换前的4×1维度的表示位置的齐次坐标向量,Ra表示变换后的3×3维度表示姿态的矩阵,R表示3×3维度的旋转变换矩阵,R矩阵是T矩阵左上3×3维度的分块矩阵,Ra表示变换前的3×3维度的表示姿态的矩阵,可根据变换矩阵T及其中的R对位姿进行变换。7.2) According to the coordinate system transformation matrix, use the position calculation formula X b =TX a and the attitude calculation formula R b =RR a to calculate the pose of the camera on the printing device in the printing coordinate system. Among them, X b represents the homogeneous coordinate vector representing the position of the transformed 4×1 dimension, T represents the Euclidean transformation matrix of the 4×4 dimension, and X a represents the homogeneous coordinate vector representing the position of the 4×1 dimension before transformation , R a represents the transformed 3×3 dimension matrix representing the attitude, R represents the 3×3 dimension rotation transformation matrix, the R matrix is the upper left 3×3 dimension block matrix of the T matrix, and R a represents the 3×3 dimension before the transformation A 3-dimensional matrix representing the pose, which can transform the pose according to the transformation matrix T and its R.
7.3)采用与步骤7.2)相同的方法,根据位姿变换矩阵计算打印装置在打印坐标系中的位置和姿态。7.3) Using the same method as step 7.2), calculate the position and attitude of the printing device in the printing coordinate system according to the pose transformation matrix.
下面参照附图2结合本发明的实施例对本发明的实现过程做进一步的描述。The implementation process of the present invention will be further described below in conjunction with the embodiments of the present invention with reference to FIG. 2 .
图2(a)是本发明步骤2构建的包含有标记图案的世界坐标系的示意图,其中,1表示标记图案,2表示世界坐标系,3表示标记图案上的标记点。Fig. 2(a) is a schematic diagram of the world coordinate system including the marking pattern constructed in
图2(b)是本发明步骤4构建的包含有手持移动打印装置的打印坐标系的示意图,其中,4表示打印区域,5表示打印坐标系,6表示手持移动打印装置,7表示手持移动打印装置上的相机,8表示手持移动打印装置上相机的视场角。Figure 2(b) is a schematic diagram of the printing coordinate system including the handheld mobile printing device constructed in
将标记物放置在手持移动打印装置上的相机前,使标记图案在相机的视场角范围内。标记物形状并不一定是矩形,使用矩形标记物便于计算标记点位置,此处以矩形标记物作示例。将矩形标记图案的左下角作为原点,将矩形的两边分别作为X轴和Y轴,将标记物的法向量作为Z轴,建立一个右手三维直角坐标系作为世界坐标系。因为标记点在标记图案上的位置是已知的,所以可以计算得到标记点在世界坐标系中的位置。Place the marker in front of the camera on the handheld mobile printing device so that the marker pattern is within the field of view of the camera. The shape of the marker does not have to be a rectangle, and the use of a rectangular marker is convenient for calculating the position of the marker point. Here, a rectangular marker is used as an example. The lower left corner of the rectangular marking pattern is taken as the origin, the two sides of the rectangle are taken as the X-axis and the Y-axis respectively, and the normal vector of the marker is taken as the Z-axis, and a right-handed three-dimensional Cartesian coordinate system is established as the world coordinate system. Since the position of the marker point on the marker pattern is known, the position of the marker point in the world coordinate system can be calculated.
用相机拍摄标记物后,标记点在图片上的位置与标记点在世界坐标系中的位置形成一对点,利用不少于4对点可以计算相机光心在世界坐标系中位置。若打印区域是矩形,矩形符合坐标轴相互垂直的特点,则在矩形的边角点O1、A1、B1处拍摄标记物,将O1作为原点,将和分别作为X轴和Y轴,将打印平面的法向量作为Z轴,建立打印坐标系。然后计算每次拍摄时光心之间的欧式距离,利用欧式距离和光心到打印平面的高度计算每次拍摄时光心在打印坐标系中的位置。若打印区域是非矩形,则在O2、A2、B2处拍摄标记物,将打印平面法向量作为Z轴,将作为X轴,将X轴与Z轴叉乘的结果作为Y轴,建立打印坐标系。然后计算每次拍摄时光心之间的欧式距离,利用欧式距离和光心到打印平面的高度计算每次拍摄时光心在打印坐标系中的位置。三次拍摄后相机光心在两个坐标系下的位置共形成了三个点对,根据三个点对可以计算坐标系转换矩阵。将坐标系转换矩阵应用于世界坐标系下的相机位姿可得到打印坐标系下的相机位姿。由于相机和打印装置之间的位置关系在制造时已经固定,因此可以根据相机和打印装置之间的欧拉角和偏移量确定位姿变换矩阵,将位姿变换矩阵应用于相机位姿可得到打印装置的位姿。After shooting the marker with the camera, the position of the marker point on the picture and the position of the marker point in the world coordinate system form a pair of points. Using no less than 4 pairs of points, the position of the camera optical center in the world coordinate system can be calculated. If the printing area is a rectangle, and the rectangle conforms to the characteristic that the coordinate axes are perpendicular to each other, the markers are photographed at the corner points O 1 , A 1 , and B 1 of the rectangle, and O 1 is taken as the origin, and the and As the X axis and Y axis respectively, the normal vector of the printing plane is used as the Z axis to establish the printing coordinate system. Then calculate the Euclidean distance between the light centers for each shooting, and use the Euclidean distance and the height from the light center to the printing plane to calculate the position of the light center in the printing coordinate system for each shooting. If the printing area is non-rectangular, take pictures of the markers at O 2 , A 2 , and B 2 , use the normal vector of the printing plane as the Z axis, and set As the X-axis, the result of the cross product of the X-axis and the Z-axis is used as the Y-axis to establish a printing coordinate system. Then calculate the Euclidean distance between the light centers for each shooting, and use the Euclidean distance and the height from the light center to the printing plane to calculate the position of the light center in the printing coordinate system for each shooting. After three shots, the positions of the optical center of the camera in the two coordinate systems form a total of three point pairs, and the coordinate system transformation matrix can be calculated according to the three point pairs. Applying the coordinate system transformation matrix to the camera pose in the world coordinate system results in the camera pose in the print coordinate system. Since the positional relationship between the camera and the printing device has been fixed at the time of manufacture, the pose transformation matrix can be determined according to the Euler angle and the offset between the camera and the printing device, and the pose transformation matrix can be applied to the camera pose. Get the pose of the printing device.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110403051.9A CN113112545B (en) | 2021-04-15 | 2021-04-15 | Handheld mobile printing device positioning method based on computer vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110403051.9A CN113112545B (en) | 2021-04-15 | 2021-04-15 | Handheld mobile printing device positioning method based on computer vision |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113112545A CN113112545A (en) | 2021-07-13 |
CN113112545B true CN113112545B (en) | 2023-03-21 |
Family
ID=76716953
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110403051.9A Active CN113112545B (en) | 2021-04-15 | 2021-04-15 | Handheld mobile printing device positioning method based on computer vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113112545B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114606541B (en) * | 2022-03-15 | 2023-03-24 | 南通大学 | Two-dimensional structure micro-nano scale rapid printing system and method based on glass microprobe |
CN116080290B (en) * | 2022-12-29 | 2024-08-27 | 上海魅奈儿科技有限公司 | Three-dimensional high-precision fixed-point printing method and device |
CN117495961B (en) * | 2023-11-01 | 2024-12-03 | 广州市森扬电子科技有限公司 | Detection method, equipment and storage medium for mark point positioning printing based on 2D vision |
CN118665053B (en) * | 2024-07-16 | 2025-01-07 | 广州市森扬电子科技有限公司 | Printer step calibration debugging method, device and storage medium |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015096806A1 (en) * | 2013-12-29 | 2015-07-02 | 刘进 | Attitude determination, panoramic image generation and target recognition methods for intelligent machine |
CN106101689A (en) * | 2016-06-13 | 2016-11-09 | 西安电子科技大学 | Utilize the method that mobile phone monocular cam carries out augmented reality to virtual reality glasses |
CN107449402A (en) * | 2017-07-31 | 2017-12-08 | 清华大学深圳研究生院 | A kind of measuring method of the relative pose of noncooperative target |
CN107977996A (en) * | 2017-10-20 | 2018-05-01 | 西安电子科技大学 | Space target positioning method based on target calibrating and positioning model |
CN109685913A (en) * | 2018-12-21 | 2019-04-26 | 西安电子科技大学 | Augmented reality implementation method based on computer vision positioning |
CN109895392A (en) * | 2019-02-15 | 2019-06-18 | 上海幂方电子科技有限公司 | A method of operating coordinates are marked and are accurately positioned in equipment working region |
CN110281664A (en) * | 2019-07-11 | 2019-09-27 | 森大(深圳)技术有限公司 | Print media positioning printing method, device, equipment, medium and flat-panel printer |
CN110686650A (en) * | 2019-10-29 | 2020-01-14 | 北京航空航天大学 | Monocular vision pose measuring method based on point characteristics |
CN111590899A (en) * | 2020-04-27 | 2020-08-28 | 蒋青 | Vision auxiliary positioning device for mechanical arm 3D printing and positioning method thereof |
CN111673735A (en) * | 2020-04-28 | 2020-09-18 | 平安科技(深圳)有限公司 | Mechanical arm control method and device based on monocular vision positioning |
CN111791589A (en) * | 2020-09-10 | 2020-10-20 | 季华实验室 | Inkjet printer-based positioning detection method, device, electronic device and medium |
CN111862238A (en) * | 2020-07-23 | 2020-10-30 | 中国民航大学 | A full-space monocular vision measurement method |
CN111968128A (en) * | 2020-07-10 | 2020-11-20 | 北京航空航天大学 | Unmanned aerial vehicle visual attitude and position resolving method based on image markers |
CN112066879A (en) * | 2020-09-11 | 2020-12-11 | 哈尔滨工业大学 | Device and method for pose measurement of air-floating motion simulator based on computer vision |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130259403A1 (en) * | 2012-04-03 | 2013-10-03 | Oluwatosin Osinusi | Flexible easy-to-use system and method of automatically inserting a photorealistic view of a two or three dimensional object into an image using a cd,dvd or blu-ray disc |
US9508146B2 (en) * | 2012-10-31 | 2016-11-29 | The Boeing Company | Automated frame of reference calibration for augmented reality |
WO2019090487A1 (en) * | 2017-11-07 | 2019-05-16 | 大连理工大学 | Highly dynamic wide-range any-contour-error monocular six-dimensional measurement method for numerical control machine tool |
-
2021
- 2021-04-15 CN CN202110403051.9A patent/CN113112545B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015096806A1 (en) * | 2013-12-29 | 2015-07-02 | 刘进 | Attitude determination, panoramic image generation and target recognition methods for intelligent machine |
CN106101689A (en) * | 2016-06-13 | 2016-11-09 | 西安电子科技大学 | Utilize the method that mobile phone monocular cam carries out augmented reality to virtual reality glasses |
CN107449402A (en) * | 2017-07-31 | 2017-12-08 | 清华大学深圳研究生院 | A kind of measuring method of the relative pose of noncooperative target |
CN107977996A (en) * | 2017-10-20 | 2018-05-01 | 西安电子科技大学 | Space target positioning method based on target calibrating and positioning model |
CN109685913A (en) * | 2018-12-21 | 2019-04-26 | 西安电子科技大学 | Augmented reality implementation method based on computer vision positioning |
CN109895392A (en) * | 2019-02-15 | 2019-06-18 | 上海幂方电子科技有限公司 | A method of operating coordinates are marked and are accurately positioned in equipment working region |
CN110281664A (en) * | 2019-07-11 | 2019-09-27 | 森大(深圳)技术有限公司 | Print media positioning printing method, device, equipment, medium and flat-panel printer |
CN110686650A (en) * | 2019-10-29 | 2020-01-14 | 北京航空航天大学 | Monocular vision pose measuring method based on point characteristics |
CN111590899A (en) * | 2020-04-27 | 2020-08-28 | 蒋青 | Vision auxiliary positioning device for mechanical arm 3D printing and positioning method thereof |
CN111673735A (en) * | 2020-04-28 | 2020-09-18 | 平安科技(深圳)有限公司 | Mechanical arm control method and device based on monocular vision positioning |
CN111968128A (en) * | 2020-07-10 | 2020-11-20 | 北京航空航天大学 | Unmanned aerial vehicle visual attitude and position resolving method based on image markers |
CN111862238A (en) * | 2020-07-23 | 2020-10-30 | 中国民航大学 | A full-space monocular vision measurement method |
CN111791589A (en) * | 2020-09-10 | 2020-10-20 | 季华实验室 | Inkjet printer-based positioning detection method, device, electronic device and medium |
CN112066879A (en) * | 2020-09-11 | 2020-12-11 | 哈尔滨工业大学 | Device and method for pose measurement of air-floating motion simulator based on computer vision |
Non-Patent Citations (4)
Title |
---|
Accuracy Analysis of Alignment Methods based on Reference Features for Robot-Based Optical Inspection Systems;Philipp Bauer等;《Procedia CIRP》;20201231;第93卷;1115-1120 * |
Inertial measurement unit aided extrinsic parameters calibration for stereo vision systems;Weiwu Feng等;《Optics and Lasers in Engineering》;20201130;第134卷;1-12 * |
基于增强现实的精准术前规划技术研究;张品;《中国优秀硕士学位论文全文数据库 医药卫生科技辑》;20200815;第2020年卷(第8期);E066-200 * |
面向自然特征的增强现实中高精度目标跟踪注册研究;张华等;《长春工程学院学报(自然科学版)》;20210331;第22卷(第1期);69-73 * |
Also Published As
Publication number | Publication date |
---|---|
CN113112545A (en) | 2021-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113112545B (en) | Handheld mobile printing device positioning method based on computer vision | |
CN110689581B (en) | Structured light module calibration method, electronic device, and computer-readable storage medium | |
US11039121B2 (en) | Calibration apparatus, chart for calibration, chart pattern generation apparatus, and calibration method | |
CN100557635C (en) | A Camera Calibration Method Based on Flexible Stereo Target | |
US9679385B2 (en) | Three-dimensional measurement apparatus and robot system | |
WO2021004416A1 (en) | Method and apparatus for establishing beacon map on basis of visual beacons | |
US20150178903A1 (en) | Image correction apparatus for correcting distortion of an image | |
KR20160116075A (en) | Image processing apparatus having a function for automatically correcting image acquired from the camera and method therefor | |
CN110838164B (en) | Monocular image three-dimensional reconstruction method, system and device based on object point depth | |
CN110889829A (en) | A monocular ranging method based on fisheye lens | |
CN112132907A (en) | A camera calibration method, device, electronic device and storage medium | |
CN110033407A (en) | A kind of shield tunnel surface image scaling method, joining method and splicing system | |
CN113744336A (en) | Auxiliary positioning method and device and computer readable storage medium | |
CN103824303A (en) | Image perspective distortion adjusting method and device based on position and direction of photographed object | |
CA3233222A1 (en) | Method, apparatus and device for photogrammetry, and storage medium | |
CN102914295A (en) | Computer vision cube calibration based three-dimensional measurement method | |
CN113329179B (en) | Shooting alignment method, device, equipment and storage medium | |
CN111383264B (en) | Positioning method, positioning device, terminal and computer storage medium | |
CN114998447A (en) | Multi-objective vision calibration method and system | |
CN114693782A (en) | Method and device for determining the conversion relationship between a three-dimensional scene model coordinate system and a physical coordinate system | |
CN109949249B (en) | Cylindrical image correction method and system | |
CN112950528A (en) | Certificate posture determining method, model training method, device, server and medium | |
CN105335959A (en) | Quick focusing method and device for imaging apparatus | |
KR101673144B1 (en) | Stereoscopic image registration method based on a partial linear method | |
CN109682312B (en) | Method and device for measuring length based on camera |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |