[go: up one dir, main page]

CN108537834A - A kind of volume measuring method, system and depth camera based on depth image - Google Patents

A kind of volume measuring method, system and depth camera based on depth image Download PDF

Info

Publication number
CN108537834A
CN108537834A CN201810225912.7A CN201810225912A CN108537834A CN 108537834 A CN108537834 A CN 108537834A CN 201810225912 A CN201810225912 A CN 201810225912A CN 108537834 A CN108537834 A CN 108537834A
Authority
CN
China
Prior art keywords
coordinates
measured
point cloud
depth camera
scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810225912.7A
Other languages
Chinese (zh)
Other versions
CN108537834B (en
Inventor
侯方超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Core Intelligent Technology Co Ltd
Original Assignee
Hangzhou Core Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Core Intelligent Technology Co Ltd filed Critical Hangzhou Core Intelligent Technology Co Ltd
Priority to CN201810225912.7A priority Critical patent/CN108537834B/en
Publication of CN108537834A publication Critical patent/CN108537834A/en
Application granted granted Critical
Publication of CN108537834B publication Critical patent/CN108537834B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

本发明属于物流和体积测量技术领域,具体涉及一种基于深度图像的体积测量方法、系统及深度相机,包括以下步骤:S1,获取含有待测物的场景深度图,得到场景点云坐标;S2,对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标;S3,对深度相机坐标系下的场景点云坐标进行处理,得到待测物的坐标集合;S4,根据待测物的坐标集合计算待测物的长度、宽度和高度,将长度、宽度和高度相乘得到待测物的体积。本发明相比于现有物流体积测量方案,在硬件方面,运用市面上普通的深度相机即可实现,成本较低;在相机倾斜状态下,仍能够实时准确测量待测物的体积。

The invention belongs to the technical field of logistics and volume measurement, and specifically relates to a volume measurement method, system and depth camera based on a depth image, comprising the following steps: S1, obtaining a scene depth map containing an object to be measured, and obtaining scene point cloud coordinates; S2 , to transform the coordinates of the scene point cloud to obtain the coordinates of the scene point cloud in the depth camera coordinate system; S3, to process the coordinates of the scene point cloud in the depth camera coordinate system to obtain the coordinate set of the object to be measured; S4, according to the The coordinate set of the object is used to calculate the length, width and height of the object to be measured, and the volume of the object to be measured is obtained by multiplying the length, width and height together. Compared with the existing logistics volume measurement scheme, the present invention can be realized by using a common depth camera on the market in terms of hardware, and the cost is low; when the camera is tilted, it can still accurately measure the volume of the object to be measured in real time.

Description

一种基于深度图像的体积测量方法、系统及深度相机A volume measurement method, system and depth camera based on depth image

技术领域technical field

本发明属于物流和体积测量技术领域,具体涉及一种基于深度图像的体积测量方法、系统及深度相机。The invention belongs to the technical field of logistics and volume measurement, and in particular relates to a volume measurement method, system and depth camera based on a depth image.

背景技术Background technique

近年来,随着经济全球化的快速发展,大量的物资需要在区域之间频繁流动,尤其是伴随着信息技术革命而产生的电子商务的兴起,使得物流行业获得急剧飞速发展,物流企业间的竞争也日趋激烈,怎样降低人力成本,高效的将快件发送到目的地是取得竞争优势的关键。In recent years, with the rapid development of economic globalization, a large amount of materials need to flow frequently between regions, especially the rise of e-commerce accompanied by the revolution of information technology, which has made the logistics industry develop rapidly, and the logistics enterprises Competition is also becoming increasingly fierce. How to reduce labor costs and efficiently send express shipments to their destinations is the key to gaining a competitive advantage.

在物流和仓储管理中,物品的体积属性对物流中心优化收货入库、拣选、包装和发运管理至关重要,因此通过对物品的尺寸、体积实现自动化的精准测量,能大大提高仓储物流的效率以及物流系统的智能和自动化水平。In logistics and warehousing management, the volume attribute of items is very important for the logistics center to optimize receipt, warehousing, picking, packaging and shipping management. Therefore, automatic and accurate measurement of the size and volume of items can greatly improve the efficiency of warehousing logistics. Efficiency and the level of intelligence and automation of logistics systems.

现有的体积测量设备多是基于光幕或线阵激光扫描,必须配合传送带编码器才能计算体积。这种技术虽然较为成熟,但价格昂贵,而且系统复杂度较高。Existing volume measurement equipment is mostly based on light curtain or linear array laser scanning, which must cooperate with the conveyor belt encoder to calculate the volume. Although this technology is relatively mature, it is expensive and the system complexity is high.

发明内容Contents of the invention

针对现有技术中的缺陷,本发明提供了一种基于深度图像的体积测量方法、系统及深度相机,相比于现有物流体积测量方案,在硬件方面,运用市面上普通的深度相机即可实现,成本较低;在相机倾斜状态下,仍能够实时准确测量待测物的体积。Aiming at the defects in the prior art, the present invention provides a volume measurement method, system and depth camera based on depth image. Compared with the existing logistics volume measurement scheme, in terms of hardware, the ordinary depth camera on the market can be used Realization, the cost is low; in the tilted state of the camera, the volume of the object to be measured can still be accurately measured in real time.

第一方面,本发明提供了一种基于深度图像的体积测量方法,包括以下步骤:In a first aspect, the present invention provides a method for volume measurement based on a depth image, comprising the following steps:

S1,获取含有待测物的场景深度图,得到场景点云坐标;S1, obtain the scene depth map containing the object to be measured, and obtain the scene point cloud coordinates;

S2,对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标;S2, transforming the coordinates of the scene point cloud to obtain the coordinates of the scene point cloud in the depth camera coordinate system;

S3,对深度相机坐标系下的场景点云坐标进行处理,得到待测物的坐标集合;S3, processing the scene point cloud coordinates in the depth camera coordinate system to obtain the coordinate set of the object to be measured;

S4,根据待测物的坐标集合计算待测物的长度、宽度和高度,将长度、宽度和高度相乘得到待测物的体积。S4. Calculate the length, width, and height of the object to be measured according to the coordinate set of the object to be measured, and multiply the length, width, and height to obtain the volume of the object to be measured.

优选地,所述步骤S2具体为:Preferably, the step S2 is specifically:

S21,设置场景深度图中的参考平面;S21, setting a reference plane in the scene depth map;

S22,根据所述参考平面计算深度相机的倾斜姿态数据;S22, calculating the tilt attitude data of the depth camera according to the reference plane;

S23,根据倾斜姿态数据对场景点云坐标进行变换,得到深度相机坐标系下S23. Transform the scene point cloud coordinates according to the tilt attitude data to obtain the depth camera coordinate system

的场景点云坐标。The scene point cloud coordinates of .

优选地,所述S22具体为:Preferably, the S22 is specifically:

S221,设置深度相机X轴、Y轴与参考平面法线的夹角范围,所述夹角范围内包括若干个X轴夹角θx和与Y轴夹角θyS221, setting the angle range between the X-axis and Y-axis of the depth camera and the reference plane normal, the angle range includes several X-axis angles θ x and Y-axis angles θ y ;

S222,遍历每一个X轴夹角和每一个Y轴夹角,利用坐标变换公式对参考平面内的ZCK坐标进行变换,得到若干变换后的ZCK坐标,所述变换公式为:S222, traversing each X-axis included angle and each Y-axis included angle, using a coordinate transformation formula to transform the Z CK coordinates in the reference plane to obtain several transformed Z CK coordinates, the transformation formula is:

Z'=Y0*sinθx+Z0cosθxZ'=Y 0 *sinθ x +Z 0 cosθ x ;

Zck=Z'*cosθy-X0sinθyZ ck =Z'*cosθ y -X 0 sinθ y ;

其中X0、Y0、Z0为参考平面的原始坐标点,ZCK为变换后的ZCK坐标;Among them, X 0 , Y 0 , and Z 0 are the original coordinate points of the reference plane, and Z CK is the transformed Z CK coordinate;

S223,计算所有变换后的ZCK坐标的平均值Zmean和最小方差Zsigma;S223, calculate the average value Zmean and minimum variance Zsigma of all transformed Z CK coordinates;

S224,将最小方差Zsigma对应的X轴夹角θx作为深度相机的X轴倾斜夹角αx,对应的Y轴夹角θy作为深度相机的Y轴倾斜夹角αy,从而得到倾斜姿态数据:ZCK坐标的平均值Zmean、最小方差Zsigma、X轴倾斜夹角αx和Y轴倾斜夹角αyS224, taking the X-axis angle θ x corresponding to the minimum variance Zsigma as the X-axis tilt angle α x of the depth camera, and the corresponding Y-axis angle θ y as the Y-axis tilt angle α y of the depth camera, so as to obtain the tilt attitude Data: the mean Zmean of the Z CK coordinates, the minimum variance Zsigma, the X-axis tilt angle α x and the Y-axis tilt angle α y .

优选地,所述S23具体为:Preferably, the S23 is specifically:

根据X轴倾斜夹角αx和Y轴倾斜夹角αy,利用变换公式对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标,变换公式为:According to the X-axis tilt angle α x and the Y-axis tilt angle α y , use the transformation formula to transform the scene point cloud coordinates to obtain the scene point cloud coordinates in the depth camera coordinate system. The transformation formula is:

Z'i=Yio*sinαx+ZiocosαxZ' i =Y io *sinα x +Z io cosα x ;

Xi=Z'i*sinαy+XiocosαyX i =Z' i *sinα y +X io cosα y ;

Yi=Yio*cosαy-ZiosinαyY i =Y io *cosα y -Z io sinα y ;

Zi=Z'i*cosαy-XiosinαyZ i =Z' i *cosα y -X io sinα y ;

其中Xio、Yio、Zio为原来的场景点云坐标,Xi、Yi、Zi为深度相机坐标系下的场景点云坐标。Among them, X io , Y io , Z io are the original scene point cloud coordinates, and Xi , Y i , Z i are the scene point cloud coordinates in the depth camera coordinate system.

优选地,所述S3具体为:Preferably, the S3 is specifically:

根据筛选公式,从深度相机坐标系下的场景云坐标中,筛选出符合条件的待测物的Xi、Yi、Zi坐标点集合,筛选公式为:According to the screening formula, from the scene cloud coordinates under the depth camera coordinate system, filter out the X i , Y i , and Zi coordinate point sets of the object to be measured that meet the conditions. The screening formula is:

|Zi-Zmean|>N*Zsigma,其中N为正数。|Zi-Zmean|>N*Zsigma, where N is a positive number.

优选地,所述S4具体为:Preferably, said S4 is specifically:

S41,按照预设的网格精度,计算待测物的Xi、Yi坐标点投影到参考平面内对应的网格区域,对网格区域进行连通区域标定、并统计每个连通区域大小;S41, according to the preset grid accuracy, calculate the X i , Y i coordinate points of the object to be measured and project them to the corresponding grid area in the reference plane, calibrate the connected area of the grid area, and count the size of each connected area;

S42,选取面积最大的连通区域对应的Xi、Yi坐标点集合,通过主成分分析法计算选取的Xi、Yi坐标点对应的最小外接长方形,得到待测物投影到参考平面内的长度和宽度;S42, select the X i , Y i coordinate point set corresponding to the connected region with the largest area, and calculate the minimum circumscribed rectangle corresponding to the selected X i , Y i coordinate point through the principal component analysis method, and obtain the projection of the object to be measured into the reference plane length and width;

S43,计算Zi与Zmean最大差异得到待测物的高度,将长度、宽度和高度相乘得到待测物体积。S43. Calculate the maximum difference between Zi and Zmean to obtain the height of the object to be measured, and multiply the length, width and height together to obtain the volume of the object to be measured.

第二方面,本发明提供了一种基于深度图像的体积测量系统,适用于第一方面所述的基于深度图像的体积测量方法,包括:In a second aspect, the present invention provides a depth image-based volume measurement system, which is suitable for the depth image-based volume measurement method described in the first aspect, including:

场景采集单元,用于获取含有待测物的场景深度图,得到场景点云坐标;The scene acquisition unit is used to obtain the scene depth map containing the object to be measured, and obtain the scene point cloud coordinates;

坐标变换单元,用于对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标;The coordinate transformation unit is used to transform the coordinates of the scene point cloud to obtain the coordinates of the scene point cloud under the depth camera coordinate system;

待测物提取单元,用于对深度相机坐标系下的场景点云坐标进行处理,得到待测物的坐标集合;The object to be measured extraction unit is used to process the scene point cloud coordinates under the depth camera coordinate system to obtain the coordinate set of the object to be measured;

体积计算单元,用于根据待测物的坐标集合计算待测物的长度、宽度和高度,将长度、宽度和高度相乘得到待测物的体积。The volume calculation unit is used to calculate the length, width and height of the test object according to the coordinate set of the test object, and multiply the length, width and height to obtain the volume of the test object.

第三方面,本发明提供了一种深度相机,包括处理器、输入设备、输出设备和存储器,所述处理器、输入设备、输出设备和存储器相互连接,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行如第一方面所述的方法。In a third aspect, the present invention provides a depth camera, including a processor, an input device, an output device, and a memory, the processor, the input device, the output device, and the memory are connected to each other, and the memory is used to store computer programs, so The computer program includes program instructions, and the processor is configured to invoke the program instructions to execute the method as described in the first aspect.

本发明的有益效果为:相比于现有物流体积测量方案,在硬件方面,运用市面上普通的深度相机即可实现,成本较低;在相机倾斜状态下,仍能够实时准确测量待测物的体积。The beneficial effects of the present invention are: compared with the existing logistics volume measurement scheme, in terms of hardware, it can be realized by using a common depth camera on the market, and the cost is low; when the camera is tilted, it can still accurately measure the object to be measured in real time volume of.

附图说明Description of drawings

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍。在所有附图中,类似的元件或部分一般由类似的附图标记标识。附图中,各元件或部分并不一定按照实际的比例绘制。In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the specific embodiments or the prior art. Throughout the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, elements or parts are not necessarily drawn in actual scale.

图1为本实施例中基于深度图像的体积测量方法的流程图;FIG. 1 is a flow chart of a volume measurement method based on a depth image in this embodiment;

图2为本实施例中基于深度图像的体积测量系统的结构图。FIG. 2 is a structural diagram of a volume measurement system based on a depth image in this embodiment.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the terms "comprising" and "comprises" indicate the presence of described features, integers, operations, elements and/or components, but do not exclude one or more The presence or addition of other features, integers, operations, elements, components and/or collections thereof.

还应当理解,在此本发明说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本发明。如在本发明说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terminology used in the description of the present invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the present invention. As used in this specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural referents unless the context clearly dictates otherwise.

还应当进一步理解,在本发明说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be further understood that the term "and/or" used in the description of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations .

实施例一:Embodiment one:

本实施例提供了一种基于深度图像的体积测量方法,如图1所示,包括以下S1、S2、S3、S4共四个步骤:This embodiment provides a volume measurement method based on a depth image, as shown in FIG. 1 , including the following four steps of S1, S2, S3, and S4:

S1,获取含有待测物的场景深度图,得到场景点云坐标。本实施例获取场景深度图可采用光飞行时间原理、结构光原理、双目测距原理等。深度图即深度Z轴的坐标集合,深度图也被称为距离影像,是指将从图像采集器到场景中各点的距离(深度)作为像素值的图像,它直接反映了场景中各物体可见表面的几何形状。深度图经过坐标转换可以计算为场景点云数据,本实施例的图像采集器为深度相机,深度相机采集深度图可应用光飞行时间原理、结构光原理、双目测距原理等。S1, obtain the depth map of the scene containing the object to be measured, and obtain the point cloud coordinates of the scene. In this embodiment, the principle of time-of-flight of light, the principle of structured light, and the principle of binocular ranging can be used to obtain the scene depth map. The depth map is the coordinate set of the depth Z axis. The depth map is also called the distance image, which refers to the image with the distance (depth) from the image collector to each point in the scene as the pixel value, which directly reflects the objects in the scene. The geometry of the visible surface. The depth map can be calculated as scene point cloud data after coordinate conversion. The image collector in this embodiment is a depth camera. The depth map collected by the depth camera can apply the principle of time-of-flight, structured light, and binocular distance measurement.

S2,对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标。S2. Transform the coordinates of the scene point cloud to obtain the coordinates of the scene point cloud in the depth camera coordinate system.

所述步骤S2具体包括S21、S22、S23共三个步骤:The step S2 specifically includes three steps of S21, S22, and S23:

S21,设置场景深度图中的参考平面。S21, setting a reference plane in the scene depth map.

S22,根据所述参考平面计算深度相机的倾斜姿态数据。所述S22具体包括S221、S222、S223、S224共四个步骤:S22. Calculate the tilt attitude data of the depth camera according to the reference plane. The S22 specifically includes four steps of S221, S222, S223, and S224:

S221,设置深度相机X轴、Y轴与参考平面法线的夹角范围,所述夹角范围内包括若干个X轴夹角θx和与Y轴夹角θyS221, setting the angle range between the X-axis and Y-axis of the depth camera and the reference plane normal, the angle range includes several X-axis angles θ x and Y-axis angles θ y ;

S222,遍历每一个X轴夹角和每一个Y轴夹角,利用坐标变换公式对参考平面内的ZCK坐标进行变换,得到若干变换后的ZCK坐标,所述变换公式为:S222, traversing each X-axis included angle and each Y-axis included angle, using a coordinate transformation formula to transform the Z CK coordinates in the reference plane to obtain several transformed Z CK coordinates, the transformation formula is:

Z'=Y0*sinθx+Z0cosθxZ'=Y 0 *sinθ x +Z 0 cosθ x ;

Zck=Z'*cosθy-X0sinθyZ ck =Z'*cosθ y -X 0 sinθ y ;

其中X0、Y0、Z0为参考平面的原始坐标点,ZCK为变换后的ZCK坐标;Among them, X 0 , Y 0 , and Z 0 are the original coordinate points of the reference plane, and Z CK is the transformed Z CK coordinate;

S223,计算所有变换后的ZCK坐标的平均值Zmean和最小方差Zsigma;S223, calculate the average value Zmean and minimum variance Zsigma of all transformed Z CK coordinates;

S224,将最小方差Zsigma对应的X轴夹角θx作为深度相机的X轴倾斜夹角αx,对应的Y轴夹角θy作为深度相机的Y轴倾斜夹角αy,从而得到倾斜姿态数据:ZCK坐标的平均值Zmean、最小方差Zsigma、X轴倾斜夹角αx和Y轴倾斜夹角αyS224, taking the X-axis angle θ x corresponding to the minimum variance Zsigma as the X-axis tilt angle α x of the depth camera, and the corresponding Y-axis angle θ y as the Y-axis tilt angle α y of the depth camera, so as to obtain the tilt attitude Data: the mean Zmean of the Z CK coordinates, the minimum variance Zsigma, the X-axis tilt angle α x and the Y-axis tilt angle α y .

本实施例中根据步骤S22得到深度相机与参考平面的X轴夹角、Y轴夹角、以及与参考平面的距离。In this embodiment, the X-axis angle, the Y-axis angle, and the distance from the reference plane between the depth camera and the reference plane are obtained according to step S22.

S23,根据倾斜姿态数据对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标。本步骤具体为:S23. Transform the scene point cloud coordinates according to the tilt attitude data to obtain the scene point cloud coordinates in the depth camera coordinate system. This step is specifically:

根据X轴倾斜夹角αx和Y轴倾斜夹角αy,利用变换公式对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标,变换公式为:According to the X-axis tilt angle α x and the Y-axis tilt angle α y , use the transformation formula to transform the scene point cloud coordinates to obtain the scene point cloud coordinates in the depth camera coordinate system. The transformation formula is:

Z'i=Yio*sinαx+ZiocosαxZ' i =Y io *sinα x +Z io cosα x ;

Xi=Z'i*sinαy+XiocosαyX i =Z' i *sinα y +X io cosα y ;

Yi=Yio*cosαy-ZiosinαyY i =Y io *cosα y -Z io sinα y ;

Zi=Z'i*cosαy-XiosinαyZ i =Z' i *cosα y -X io sinα y ;

其中Xio、Yio、Zio为原来的场景点云坐标,Xi、Yi、Zi为深度相机坐标系下的场景点云坐标。Among them, X io , Y io , Z io are the original scene point cloud coordinates, and Xi , Y i , Z i are the scene point cloud coordinates in the depth camera coordinate system.

S3,对深度相机坐标系下的场景点云坐标进行处理,得到待测物的坐标集合。本步骤具体为:S3. Process the scene point cloud coordinates in the depth camera coordinate system to obtain a coordinate set of the object to be measured. This step is specifically:

根据筛选公式,从深度相机坐标系下的场景云坐标中,筛选出符合条件的待测物的Xi、Yi、Zi坐标点集合,筛选公式为:According to the screening formula, from the scene cloud coordinates under the depth camera coordinate system, filter out the X i , Y i , and Zi coordinate point sets of the object to be measured that meet the conditions. The screening formula is:

|Zi-Zmean|>N*Zsigma,其中N为正数。|Zi-Zmean|>N*Zsigma, where N is a positive number.

本实施例步骤S3为去掉场景中其他的物体的相关信息,提取出待测物的坐标数据。Step S3 of this embodiment is to remove the relevant information of other objects in the scene, and extract the coordinate data of the object to be measured.

S4,根据待测物的坐标集合计算待测物的长度、宽度和高度,将长度、宽度和高度相乘得到待测物的体积。所述S4具体包括S41、S42两个步骤:S4. Calculate the length, width, and height of the object to be measured according to the coordinate set of the object to be measured, and multiply the length, width, and height to obtain the volume of the object to be measured. Said S4 specifically includes two steps of S41 and S42:

S41,按照预设的网格精度,计算待测物的Xi、Yi坐标点投影到参考平面内对应的网格区域,对网格区域进行连通区域标定、并统计每个连通区域大小;S41, according to the preset grid accuracy, calculate the X i , Y i coordinate points of the object to be measured and project them to the corresponding grid area in the reference plane, calibrate the connected area of the grid area, and count the size of each connected area;

S42,选取面积最大的连通区域对应的Xi、Yi坐标点集合,通过主成分分析法计算选取的Xi、Yi坐标点对应的最小外接长方形,得到待测物投影到参考平面内的长度和宽度;S42, select the X i , Y i coordinate point set corresponding to the connected region with the largest area, calculate the minimum circumscribed rectangle corresponding to the selected X i , Y i coordinate point through the principal component analysis method, and obtain the projection of the object to be measured into the reference plane length and width;

S43,计算Zi与Zmean最大差异得到待测物的高度,将长度、宽度和高度相乘得到待测物的体积。S43. Calculate the maximum difference between Zi and Zmean to obtain the height of the object to be measured, and multiply the length, width and height together to obtain the volume of the object to be measured.

综上所述,本实施例相比于现有物流体积测量方案,在硬件方面,运用市面上普通的深度相机即可实现,成本较低;在相机倾斜状态下,仍能够实时准确测量待测物的体积。本实施例提前标定相机倾斜姿态,在运行过程中只需要乘法,连通区域标定和主成分分析等关键步骤,即可计算待测物的长宽高,进而计算待测物体积,可以达到非常好的测量实时性。本实施例支持相机安装时存在倾斜,易于安装和扩大测量范围。现有市场上很多高精度深度相机输出的点云是非结构化的,本实施例对点云数据(点云坐标)的结构化没有要求,因此更容易进行测量设备选型。To sum up, compared with the existing logistics volume measurement scheme, this embodiment can be realized by using a common depth camera on the market in terms of hardware, and the cost is relatively low; when the camera is tilted, it can still accurately measure the volume to be measured in real time. volume of the object. In this embodiment, the tilt attitude of the camera is calibrated in advance. During the operation, only key steps such as multiplication, connected area calibration and principal component analysis are needed to calculate the length, width and height of the object to be measured, and then calculate the volume of the object to be measured, which can achieve very good results. real-time measurement. This embodiment supports the tilting of the camera during installation, which is easy to install and expands the measurement range. The point clouds output by many high-precision depth cameras in the existing market are unstructured. This embodiment does not require the structured point cloud data (point cloud coordinates), so it is easier to select the measurement equipment.

实施例二:Embodiment two:

本实施例提供了一种基于深度图像的体积测量系统,如图2所示,包括:This embodiment provides a volume measurement system based on depth images, as shown in Figure 2, including:

场景采集单元,用于获取含有待测物的场景深度图,得到场景点云坐标;The scene acquisition unit is used to obtain the scene depth map containing the object to be measured, and obtain the scene point cloud coordinates;

坐标变换单元,用于对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标;The coordinate transformation unit is used to transform the coordinates of the scene point cloud to obtain the coordinates of the scene point cloud under the depth camera coordinate system;

待测物提取单元,用于对深度相机坐标系下的场景点云坐标进行处理,得到待测物的坐标集合;The object to be measured extraction unit is used to process the scene point cloud coordinates under the depth camera coordinate system to obtain the coordinate set of the object to be measured;

体积计算单元,用于根据待测物的坐标集合计算待测物的长度、宽度和高度,将长度、宽度和高度相乘得到待测物的体积。The volume calculation unit is used to calculate the length, width and height of the test object according to the coordinate set of the test object, and multiply the length, width and height to obtain the volume of the test object.

本系统适用于实施例一所述的基于深度图像的体积测量方法,如图1所示,包括以下S1、S2、S3、S4共四个步骤:This system is applicable to the volume measurement method based on the depth image described in Embodiment 1, as shown in Figure 1, including the following four steps of S1, S2, S3, and S4:

S1,获取含有待测物的场景深度图,得到场景点云坐标。本实施例获取场景深度图可采用光飞行时间原理、结构光原理、双目测距原理等。深度图即深度Z轴的坐标集合,深度图也被称为距离影像,是指将从图像采集器到场景中各点的距离(深度)作为像素值的图像,它直接反映了场景中各物体可见表面的几何形状。深度图经过坐标转换可以计算为场景点云数据,本实施例的图像采集器为深度相机,深度相机采集深度图可应用光飞行时间原理、结构光原理、双目测距原理等。S1, obtain the depth map of the scene containing the object to be measured, and obtain the point cloud coordinates of the scene. In this embodiment, the principle of time-of-flight of light, the principle of structured light, and the principle of binocular ranging can be used to obtain the scene depth map. The depth map is the coordinate set of the depth Z axis. The depth map is also called the distance image, which refers to the image with the distance (depth) from the image collector to each point in the scene as the pixel value, which directly reflects the objects in the scene. The geometry of the visible surface. The depth map can be calculated as scene point cloud data after coordinate conversion. The image collector in this embodiment is a depth camera. The depth map collected by the depth camera can apply the principle of time-of-flight, structured light, and binocular distance measurement.

S2,对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标。S2. Transform the coordinates of the scene point cloud to obtain the coordinates of the scene point cloud in the depth camera coordinate system.

所述步骤S2具体包括S21、S22、S23共三个步骤:The step S2 specifically includes three steps of S21, S22, and S23:

S21,设置场景深度图中的参考平面。S21, setting a reference plane in the scene depth map.

S22,根据所述参考平面计算深度相机的倾斜姿态数据。所述S22具体包括S221、S222、S223、S224共四个步骤:S22. Calculate the tilt attitude data of the depth camera according to the reference plane. The S22 specifically includes four steps of S221, S222, S223, and S224:

S221,设置深度相机X轴、Y轴与参考平面法线的夹角范围,所述夹角范围内包括若干个X轴夹角θx和与Y轴夹角θyS221, setting the angle range between the X-axis and Y-axis of the depth camera and the reference plane normal, the angle range includes several X-axis angles θ x and Y-axis angles θ y ;

S222,遍历每一个X轴夹角和每一个Y轴夹角,利用坐标变换公式对参考平面内的ZCK坐标进行变换,得到若干变换后的ZCK坐标,所述变换公式为:S222, traversing each X-axis included angle and each Y-axis included angle, using a coordinate transformation formula to transform the Z CK coordinates in the reference plane to obtain several transformed Z CK coordinates, the transformation formula is:

Z'=Y0*sinθx+Z0cosθxZ'=Y 0 *sinθ x +Z 0 cosθ x ;

Zck=Z'*cosθy-X0sinθyZ ck =Z'*cosθ y -X 0 sinθ y ;

其中X0、Y0、Z0为参考平面的原始坐标点,ZCK为变换后的ZCK坐标;Among them, X 0 , Y 0 , and Z 0 are the original coordinate points of the reference plane, and Z CK is the transformed Z CK coordinate;

S223,计算所有变换后的ZCK坐标的平均值Zmean和最小方差Zsigma;S223, calculate the average value Zmean and minimum variance Zsigma of all transformed Z CK coordinates;

S224,将最小方差Zsigma对应的X轴夹角θx作为深度相机的X轴倾斜夹角αx,对应的Y轴夹角θy作为深度相机的Y轴倾斜夹角αy,从而得到倾斜姿态数据:ZCK坐标的平均值Zmean、最小方差Zsigma、X轴倾斜夹角αx和Y轴倾斜夹角αyS224, taking the X-axis angle θ x corresponding to the minimum variance Zsigma as the X-axis tilt angle α x of the depth camera, and the corresponding Y-axis angle θ y as the Y-axis tilt angle α y of the depth camera, so as to obtain the tilt attitude Data: the mean Zmean of the Z CK coordinates, the minimum variance Zsigma, the X-axis tilt angle α x and the Y-axis tilt angle α y .

本实施例中根据步骤S22得到深度相机与参考平面的X轴夹角、Y轴夹角、以及与参考平面的距离。In this embodiment, the X-axis angle, the Y-axis angle, and the distance from the reference plane between the depth camera and the reference plane are obtained according to step S22.

S23,根据倾斜姿态数据对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标。本步骤具体为:S23. Transform the scene point cloud coordinates according to the tilt attitude data to obtain the scene point cloud coordinates in the depth camera coordinate system. This step is specifically:

根据X轴倾斜夹角αx和Y轴倾斜夹角αy,利用变换公式对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标,变换公式为:According to the X-axis tilt angle α x and the Y-axis tilt angle α y , use the transformation formula to transform the scene point cloud coordinates to obtain the scene point cloud coordinates in the depth camera coordinate system. The transformation formula is:

Z'i=Yio*sinαx+ZiocosαxZ' i =Y io *sinα x +Z io cosα x ;

Xi=Z'i*sinαy+XiocosαyX i =Z' i *sinα y +X io cosα y ;

Yi=Yio*cosαy-ZiosinαyY i =Y io *cosα y -Z io sinα y ;

Zi=Z'i*cosαy-XiosinαyZ i =Z' i *cosα y -X io sinα y ;

其中Xio、Yio、Zio为原来的场景点云坐标,Xi、Yi、Zi为深度相机坐标系下的场景点云坐标。Among them, X io , Y io , Z io are the original scene point cloud coordinates, and Xi , Y i , Z i are the scene point cloud coordinates in the depth camera coordinate system.

S3,对深度相机坐标系下的场景点云坐标进行处理,得到待测物的坐标集合。本步骤具体为:S3. Process the scene point cloud coordinates in the depth camera coordinate system to obtain a coordinate set of the object to be measured. This step is specifically:

根据筛选公式,从深度相机坐标系下的场景云坐标中,筛选出符合条件的待测物的Xi、Yi、Zi坐标点集合,筛选公式为:According to the screening formula, from the scene cloud coordinates under the depth camera coordinate system, filter out the X i , Y i , and Zi coordinate point sets of the object to be measured that meet the conditions. The screening formula is:

|Zi-Zmean|>N*Zsigma,其中N为正数。|Zi-Zmean|>N*Zsigma, where N is a positive number.

本实施例步骤S3为去掉场景中其他的物体的相关信息,提取出待测物的坐标数据。Step S3 of this embodiment is to remove the relevant information of other objects in the scene, and extract the coordinate data of the object to be measured.

S4,根据待测物的坐标集合计算待测物的长度、宽度和高度,将长度、宽度和高度相乘得到待测物的体积。所述S4具体包括S41、S42两个步骤:S4. Calculate the length, width, and height of the object to be measured according to the coordinate set of the object to be measured, and multiply the length, width, and height to obtain the volume of the object to be measured. Said S4 specifically includes two steps of S41 and S42:

S41,按照预设的网格精度,计算待测物的Xi、Yi坐标点投影到参考平面内对应的网格区域,对网格区域进行连通区域标定、并统计每个连通区域大小;S41, according to the preset grid accuracy, calculate the X i , Y i coordinate points of the object to be measured and project them to the corresponding grid area in the reference plane, calibrate the connected area of the grid area, and count the size of each connected area;

S42,选取面积最大的连通区域对应的Xi、Yi坐标点集合,通过主成分分析法计算选取的Xi、Yi坐标点对应的最小外接长方形,得到待测物投影到参考平面内的长度和宽度;S42, select the X i , Y i coordinate point set corresponding to the connected region with the largest area, and calculate the minimum circumscribed rectangle corresponding to the selected X i , Y i coordinate point through the principal component analysis method, and obtain the projection of the object to be measured into the reference plane length and width;

S43,计算Zi与Zmean最大差异得到待测物的高度,将长度、宽度和高度相乘得到待测物的体积。S43. Calculate the maximum difference between Zi and Zmean to obtain the height of the object to be measured, and multiply the length, width and height together to obtain the volume of the object to be measured.

综上所述,本实施例相比于现有物流体积测量方案,在硬件方面,运用市面上普通的深度相机即可实现,成本较低;在相机倾斜状态下,仍能够实时准确测量待测物的体积。本实施例提前标定相机倾斜姿态,在运行过程中只需要乘法,连通区域标定和主成分分析等关键步骤,即可计算待测物的长宽高,进而计算待测物体积,可以达到非常好的测量实时性。本实施例支持相机安装时存在倾斜,易于安装和扩大测量范围。现有市场上很多高精度深度相机输出的点云是非结构化的,本实施例对点云数据(点云坐标)的结构化没有要求,因此更容易进行测量设备选型。To sum up, compared with the existing logistics volume measurement scheme, this embodiment can be realized by using a common depth camera on the market in terms of hardware, and the cost is relatively low; when the camera is tilted, it can still accurately measure the volume to be measured in real time. volume of the object. In this embodiment, the tilt attitude of the camera is calibrated in advance. During the operation, only key steps such as multiplication, connected area calibration and principal component analysis are needed to calculate the length, width and height of the object to be measured, and then calculate the volume of the object to be measured, which can achieve very good results. real-time measurement. This embodiment supports the tilting of the camera during installation, which is easy to install and expands the measurement range. The point clouds output by many high-precision depth cameras in the existing market are unstructured. This embodiment does not require the structured point cloud data (point cloud coordinates), so it is easier to select the measurement equipment.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and method steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the relationship between hardware and software Interchangeability. In the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.

在本申请所提供的几个实施例中,应该理解到,所揭露的方法和系统,可以通过其它的方式实现。例如,以上单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。上述单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例方案的目的。In the several embodiments provided in this application, it should be understood that the disclosed method and system may be implemented in other ways. For example, the division of the above units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored, or not implemented . The above units may or may not be physically separated, and components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.

实施例三:Embodiment three:

本实施例提供了一种深度相机,包括处理器、输入设备、输出设备和存储器,所述处理器、输入设备、输出设备和存储器相互连接,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行实施例一所述的方法。This embodiment provides a depth camera, including a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory are connected to each other, the memory is used to store a computer program, and the computer program It includes program instructions, and the processor is configured to invoke the program instructions to execute the method described in Embodiment 1.

本实施例相比于现有物流体积测量方案,在硬件方面,运用市面上普通的深度相机即可实现,成本较低;在相机倾斜状态下,仍能够实时准确测量待测物的体积。本实施例提前标定相机倾斜姿态,在运行过程中只需要乘法,连通区域标定和主成分分析等关键步骤,即可计算待测物的长宽高,进而计算待测物体积,可以达到非常好的测量实时性。本实施例支持相机安装时存在倾斜,易于安装和扩大测量范围。现有市场上很多高精度深度相机输出的点云是非结构化的,本实施例对点云数据(点云坐标)的结构化没有要求,因此更容易进行测量设备选型。Compared with the existing logistics volume measurement solution, this embodiment can be realized by using a common depth camera on the market in terms of hardware, and the cost is low; when the camera is tilted, it can still accurately measure the volume of the object to be measured in real time. In this embodiment, the tilt attitude of the camera is calibrated in advance. During the operation, only key steps such as multiplication, connected area calibration and principal component analysis are needed to calculate the length, width and height of the object to be measured, and then calculate the volume of the object to be measured, which can achieve very good results. real-time measurement. This embodiment supports the tilting of the camera during installation, which is easy to install and expands the measurement range. The point clouds output by many high-precision depth cameras in the existing market are unstructured. This embodiment does not require the structured point cloud data (point cloud coordinates), so it is easier to select the measurement equipment.

应当理解,在本实施例中,所称处理器可以是中央处理单元(Central ProcessingUnit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital SignalProcessor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that in this embodiment, the so-called processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.

输入设备可以包括图像采集设备,输出设备可以包括显示器(LCD等)、扬声器等。Input devices may include image capture devices, and output devices may include displays (LCD, etc.), speakers, and the like.

该存储器可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。The memory, which can include read only memory and random access memory, provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围,其均应涵盖在本发明的权利要求和说明书的范围当中。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. All of them should be covered by the scope of the claims and description of the present invention.

Claims (8)

1.一种基于深度图像的体积测量方法,其特征在于,包括以下步骤:1. A volume measurement method based on depth image, is characterized in that, comprises the following steps: S1,获取含有待测物的场景深度图,得到场景点云坐标;S1, obtain the scene depth map containing the object to be measured, and obtain the scene point cloud coordinates; S2,对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标;S2, transforming the coordinates of the scene point cloud to obtain the coordinates of the scene point cloud in the depth camera coordinate system; S3,对深度相机坐标系下的场景点云坐标进行处理,得到待测物的坐标集合;S3, processing the scene point cloud coordinates in the depth camera coordinate system to obtain the coordinate set of the object to be measured; S4,根据待测物的坐标集合计算待测物的长度、宽度和高度,将长度、宽度和高度相乘得到待测物的体积。S4. Calculate the length, width, and height of the object to be measured according to the coordinate set of the object to be measured, and multiply the length, width, and height to obtain the volume of the object to be measured. 2.根据权利1所述的一种基于深度图像的体积测量方法,其特征在于,所述步骤S2具体为:2. A method of volume measurement based on a depth image according to claim 1, wherein the step S2 is specifically: S21,设置场景深度图中的参考平面;S21, setting a reference plane in the scene depth map; S22,根据所述参考平面计算深度相机的倾斜姿态数据;S22, calculating the tilt attitude data of the depth camera according to the reference plane; S23,根据倾斜姿态数据对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标。S23. Transform the scene point cloud coordinates according to the tilt attitude data to obtain the scene point cloud coordinates in the depth camera coordinate system. 3.根据权利要求2所述的一种基于深度图像的体积测量方法,其特征在于,所述S22具体为:3. A kind of volume measurement method based on depth image according to claim 2, is characterized in that, described S22 is specifically: S221,设置深度相机X轴、Y轴与参考平面法线的夹角范围,所述夹角范围内包括若干个X轴夹角θx和与Y轴夹角θyS221, setting the angle range between the X-axis and Y-axis of the depth camera and the reference plane normal, the angle range includes several X-axis angles θ x and Y-axis angles θ y ; S222,遍历每一个X轴夹角和每一个Y轴夹角,利用坐标变换公式对参考平面内的ZCK坐标进行变换,得到若干变换后的ZCK坐标,所述变换公式为:S222, traversing each X-axis included angle and each Y-axis included angle, using a coordinate transformation formula to transform the Z CK coordinates in the reference plane to obtain several transformed Z CK coordinates, the transformation formula is: Z'=Y0*sinθx+Z0cosθxZ'=Y 0 *sinθ x +Z 0 cosθ x ; Zck=Z'*cosθy-X0sinθyZ ck =Z'*cosθ y -X 0 sinθ y ; 其中X0、Y0、Z0为参考平面的原始坐标点,ZCK为变换后的ZCK坐标;Among them, X 0 , Y 0 , and Z 0 are the original coordinate points of the reference plane, and Z CK is the transformed Z CK coordinate; S223,计算所有变换后的ZCK坐标的平均值Zmean和最小方差Zsigma;S223, calculate the average value Zmean and minimum variance Zsigma of all transformed Z CK coordinates; S224,将最小方差Zsigma对应的X轴夹角θx作为深度相机的X轴倾斜夹角αx,对应的Y轴夹角θy作为深度相机的Y轴倾斜夹角αy,从而得到倾斜姿态数据:ZCK坐标的平均值Zmean、最小方差Zsigma、X轴倾斜夹角αx和Y轴倾斜夹角αyS224, taking the X-axis angle θ x corresponding to the minimum variance Zsigma as the X-axis tilt angle α x of the depth camera, and the corresponding Y-axis angle θ y as the Y-axis tilt angle α y of the depth camera, so as to obtain the tilt attitude Data: the mean Zmean of the Z CK coordinates, the minimum variance Zsigma, the X-axis tilt angle α x and the Y-axis tilt angle α y . 4.根据权利要求3所述的一种基于深度图像的体积测量方法,其特征在于,所述S23具体为:4. A kind of volume measurement method based on depth image according to claim 3, is characterized in that, described S23 is specifically: 根据X轴倾斜夹角αx和Y轴倾斜夹角αy,利用变换公式对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标,变换公式为:According to the X-axis tilt angle α x and the Y-axis tilt angle α y , use the transformation formula to transform the scene point cloud coordinates to obtain the scene point cloud coordinates in the depth camera coordinate system. The transformation formula is: Z'i=Yio*sinαx+ZiocosαxZ' i =Y io *sinα x +Z io cosα x ; Xi=Z'i*sinαy+XiocosαyX i =Z' i *sinα y +X io cosα y ; Yi=Yio*cosαy-ZiosinαyY i =Y io *cosα y -Z io sinα y ; Zi=Z'i*cosαy-XiosinαyZ i =Z' i *cosα y -X io sinα y ; 其中Xio、Yio、Zio为原来的场景点云坐标,Xi、Yi、Zi为深度相机坐标系下的场景点云坐标。Among them, X io , Y io , Z io are the original scene point cloud coordinates, and Xi , Y i , Z i are the scene point cloud coordinates in the depth camera coordinate system. 5.根据权利要求4所述的一种基于深度图像的体积测量方法,其特征在于,所述S3具体为:5. A kind of volume measurement method based on depth image according to claim 4, is characterized in that, described S3 is specifically: 根据筛选公式,从深度相机坐标系下的场景云坐标中,筛选出符合条件的待测物的Xi、Yi、Zi坐标点集合,筛选公式为:According to the screening formula, from the scene cloud coordinates under the depth camera coordinate system, filter out the X i , Y i , and Zi coordinate point sets of the object to be measured that meet the conditions. The screening formula is: |Zi-Zmean|>N*Zsigma,其中N为正数。|Zi-Zmean|>N*Zsigma, where N is a positive number. 6.根据权利要求5所述的一种基于深度图像的体积测量方法,其特征在于,所述S4具体为:6. A kind of volume measurement method based on depth image according to claim 5, is characterized in that, described S4 is specifically: S41,按照预设的网格精度,计算待测物的Xi、Yi坐标点投影到参考平面内对应的网格区域,对网格区域进行连通区域标定、并统计每个连通区域大小;S41, according to the preset grid accuracy, calculate the X i , Y i coordinate points of the object to be measured and project them to the corresponding grid area in the reference plane, calibrate the connected area of the grid area, and count the size of each connected area; S42,选取面积最大的连通区域对应的Xi、Yi坐标点集合,通过主成分分析法计算选取的Xi、Yi坐标点对应的最小外接长方形,得到待测物投影到参考平面内的长度和宽度;S42, select the X i , Y i coordinate point set corresponding to the connected region with the largest area, and calculate the minimum circumscribed rectangle corresponding to the selected X i , Y i coordinate point through the principal component analysis method, and obtain the projection of the object to be measured into the reference plane length and width; S43,计算Zi与Zmean最大差异得到待测物的高度,将长度、宽度和高度相乘得到待测物体积。S43. Calculate the maximum difference between Zi and Zmean to obtain the height of the object to be measured, and multiply the length, width and height together to obtain the volume of the object to be measured. 7.一种基于深度图像的体积测量系统,适用于权利要求1-6任一项所述的基于深度图像的体积测量方法,包括:7. A volume measurement system based on a depth image, suitable for the volume measurement method based on a depth image according to any one of claims 1-6, comprising: 场景采集单元,用于获取含有待测物的场景深度图,得到场景点云坐标;The scene acquisition unit is used to obtain the scene depth map containing the object to be measured, and obtain the scene point cloud coordinates; 坐标变换单元,用于对场景点云坐标进行变换,得到深度相机坐标系下的场景点云坐标;The coordinate transformation unit is used to transform the coordinates of the scene point cloud to obtain the coordinates of the scene point cloud under the depth camera coordinate system; 待测物提取单元,用于对深度相机坐标系下的场景点云坐标进行处理,得到待测物的坐标集合;The object to be measured extraction unit is used to process the scene point cloud coordinates under the depth camera coordinate system to obtain the coordinate set of the object to be measured; 体积计算单元,用于根据待测物的坐标集合计算待测物的长宽高,将长宽高相乘得到待测物的体积。The volume calculation unit is used to calculate the length, width and height of the test object according to the coordinate set of the test object, and multiply the length, width and height to obtain the volume of the test object. 8.一种深度相机,其特征在于,包括处理器、输入设备、输出设备和存储器,所述处理器、输入设备、输出设备和存储器相互连接,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,其特征在于,所述处理器被配置用于调用所述程序指令,执行如权利要求1-6任一项所述的方法。8. A depth camera, characterized in that it includes a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory are connected to each other, the memory is used to store a computer program, and the computer The program includes program instructions, wherein the processor is configured to call the program instructions to execute the method according to any one of claims 1-6.
CN201810225912.7A 2018-03-19 2018-03-19 A depth image-based volume measurement method, system and depth camera Expired - Fee Related CN108537834B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810225912.7A CN108537834B (en) 2018-03-19 2018-03-19 A depth image-based volume measurement method, system and depth camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810225912.7A CN108537834B (en) 2018-03-19 2018-03-19 A depth image-based volume measurement method, system and depth camera

Publications (2)

Publication Number Publication Date
CN108537834A true CN108537834A (en) 2018-09-14
CN108537834B CN108537834B (en) 2020-05-01

Family

ID=63484983

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810225912.7A Expired - Fee Related CN108537834B (en) 2018-03-19 2018-03-19 A depth image-based volume measurement method, system and depth camera

Country Status (1)

Country Link
CN (1) CN108537834B (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376791A (en) * 2018-11-05 2019-02-22 北京旷视科技有限公司 Depth arithmetic accuracy calculation method, device, electronic equipment, readable storage medium storing program for executing
CN109448045A (en) * 2018-10-23 2019-03-08 南京华捷艾米软件科技有限公司 Plane polygon object measuring method and machine readable storage medium based on SLAM
CN109587875A (en) * 2018-11-16 2019-04-05 厦门盈趣科技股份有限公司 A kind of intelligent desk lamp and its adjusting method
CN109631764A (en) * 2018-11-22 2019-04-16 南京理工大学 Size Measuring System and method based on RealSense camera
CN109886961A (en) * 2019-03-27 2019-06-14 重庆交通大学 Depth image-based volume measurement method for medium and large cargoes
CN109916302A (en) * 2019-03-27 2019-06-21 青岛小鸟看看科技有限公司 A method and system for measuring the volume of a cargo box
CN109993785A (en) * 2019-03-27 2019-07-09 青岛小鸟看看科技有限公司 A cargo box volume measurement method and depth camera module
CN110006343A (en) * 2019-04-15 2019-07-12 Oppo广东移动通信有限公司 Method and device for measuring geometric parameters of object and terminal
CN110296747A (en) * 2019-08-12 2019-10-01 深圳市知维智能科技有限公司 The measurement method and system of the volume of storage content
CN110309561A (en) * 2019-06-14 2019-10-08 吉旗物联科技(上海)有限公司 Goods space volume measuring method and device
CN110310459A (en) * 2019-04-04 2019-10-08 桑尼环保(江苏)有限公司 Multi-parameter extract real-time system
CN110349205A (en) * 2019-07-22 2019-10-18 杭州光珀智能科技有限公司 A kind of measurement method and device of object volume
CN110425980A (en) * 2019-08-12 2019-11-08 深圳市知维智能科技有限公司 The measurement method and system of the volume of storage facilities content
CN110766744A (en) * 2019-11-05 2020-02-07 北京华捷艾米科技有限公司 MR volume measurement method and device based on 3D depth camera
CN111095024A (en) * 2018-09-18 2020-05-01 深圳市大疆创新科技有限公司 Height determination method, height determination device, electronic equipment and computer-readable storage medium
CN111561872A (en) * 2020-05-25 2020-08-21 中科微至智能制造科技江苏股份有限公司 Method, device and system for measuring package volume based on speckle coding structured light
CN111696152A (en) * 2020-06-12 2020-09-22 杭州海康机器人技术有限公司 Method, device, computing equipment, system and storage medium for detecting package stacking
CN111986250A (en) * 2019-05-22 2020-11-24 顺丰科技有限公司 Object volume measuring method, device, measuring equipment and storage medium
CN112254635A (en) * 2020-09-23 2021-01-22 洛伦兹(北京)科技有限公司 Volume measurement method, device and system
CN113418467A (en) * 2021-06-16 2021-09-21 厦门硅谷动能信息技术有限公司 Method for detecting general and black luggage size based on ToF point cloud data
CN114264277A (en) * 2021-12-31 2022-04-01 英特尔产品(成都)有限公司 Method and device for detecting flatness abnormality of chip substrate
CN114494404A (en) * 2022-02-14 2022-05-13 云从科技集团股份有限公司 Object volume measurement method, system, device and medium
CN115690062A (en) * 2022-11-08 2023-02-03 内蒙古中电物流路港有限责任公司赤峰铁路分公司 Rail surface damage state detection method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7037263B2 (en) * 2003-08-20 2006-05-02 Siemens Medical Solutions Usa, Inc. Computing spatial derivatives for medical diagnostic imaging methods and systems
CN101266131A (en) * 2008-04-08 2008-09-17 长安大学 An image-based volume measuring device and its measuring method
CN106225678A (en) * 2016-09-27 2016-12-14 北京正安维视科技股份有限公司 Dynamic object based on 3D camera location and volume measuring method
CN106813568A (en) * 2015-11-27 2017-06-09 阿里巴巴集团控股有限公司 object measuring method and device
CN106839975A (en) * 2015-12-03 2017-06-13 杭州海康威视数字技术股份有限公司 Volume measuring method and its system based on depth camera
CN107067394A (en) * 2017-04-18 2017-08-18 中国电子科技集团公司电子科学研究院 A kind of oblique photograph obtains the method and device of point cloud coordinate

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7037263B2 (en) * 2003-08-20 2006-05-02 Siemens Medical Solutions Usa, Inc. Computing spatial derivatives for medical diagnostic imaging methods and systems
CN101266131A (en) * 2008-04-08 2008-09-17 长安大学 An image-based volume measuring device and its measuring method
CN106813568A (en) * 2015-11-27 2017-06-09 阿里巴巴集团控股有限公司 object measuring method and device
CN106839975A (en) * 2015-12-03 2017-06-13 杭州海康威视数字技术股份有限公司 Volume measuring method and its system based on depth camera
CN106225678A (en) * 2016-09-27 2016-12-14 北京正安维视科技股份有限公司 Dynamic object based on 3D camera location and volume measuring method
CN107067394A (en) * 2017-04-18 2017-08-18 中国电子科技集团公司电子科学研究院 A kind of oblique photograph obtains the method and device of point cloud coordinate

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
BREWIN,MA ET AL: "《Accuracy of scaling and DLT reconstruction techniques for planar motion analyses》", 《JOURNAL OF APPLIED BIOMECHANICS》 *
D DOYLE ET AL: "《Optical flow background estimation for real-time pan/tilt camera object tracking》", 《MEASUREMENT》 *
丁亚林: "《基于像面旋转的画幅遥感相机姿态像移计算》", 《光学精密工程》 *
丁亚林: "《应用数学坐标变换方法计算航空相机像面旋转》", 《光学仪器》 *
丁立军: "《基于摄影原理的文物表面纹理重建技术研究》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
翟林培: "《考虑飞机姿态角时倾斜航空相机像移速度计算》", 《光学精密工程》 *

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111095024A (en) * 2018-09-18 2020-05-01 深圳市大疆创新科技有限公司 Height determination method, height determination device, electronic equipment and computer-readable storage medium
CN109448045A (en) * 2018-10-23 2019-03-08 南京华捷艾米软件科技有限公司 Plane polygon object measuring method and machine readable storage medium based on SLAM
CN109376791A (en) * 2018-11-05 2019-02-22 北京旷视科技有限公司 Depth arithmetic accuracy calculation method, device, electronic equipment, readable storage medium storing program for executing
CN109376791B (en) * 2018-11-05 2020-11-24 北京旷视科技有限公司 Depth algorithm precision calculation method and device, electronic equipment and readable storage medium
CN109587875A (en) * 2018-11-16 2019-04-05 厦门盈趣科技股份有限公司 A kind of intelligent desk lamp and its adjusting method
CN109631764A (en) * 2018-11-22 2019-04-16 南京理工大学 Size Measuring System and method based on RealSense camera
CN109886961A (en) * 2019-03-27 2019-06-14 重庆交通大学 Depth image-based volume measurement method for medium and large cargoes
CN109916302A (en) * 2019-03-27 2019-06-21 青岛小鸟看看科技有限公司 A method and system for measuring the volume of a cargo box
CN109993785A (en) * 2019-03-27 2019-07-09 青岛小鸟看看科技有限公司 A cargo box volume measurement method and depth camera module
CN109886961B (en) * 2019-03-27 2023-04-11 重庆交通大学 Medium and large cargo volume measuring method based on depth image
CN109993785B (en) * 2019-03-27 2020-11-17 青岛小鸟看看科技有限公司 Method for measuring volume of goods loaded in container and depth camera module
CN110310459A (en) * 2019-04-04 2019-10-08 桑尼环保(江苏)有限公司 Multi-parameter extract real-time system
CN110006343A (en) * 2019-04-15 2019-07-12 Oppo广东移动通信有限公司 Method and device for measuring geometric parameters of object and terminal
US12117284B2 (en) 2019-04-15 2024-10-15 Guangdong Oppo Mobile Telecommunications Corp. Ltd. Method and apparatus for measuring geometric parameter of object, and terminal
CN111986250A (en) * 2019-05-22 2020-11-24 顺丰科技有限公司 Object volume measuring method, device, measuring equipment and storage medium
CN111986250B (en) * 2019-05-22 2024-08-20 顺丰科技有限公司 Object volume measuring method, device, measuring equipment and storage medium
CN110309561A (en) * 2019-06-14 2019-10-08 吉旗物联科技(上海)有限公司 Goods space volume measuring method and device
CN110349205B (en) * 2019-07-22 2021-05-28 浙江光珀智能科技有限公司 Method and device for measuring volume of object
CN110349205A (en) * 2019-07-22 2019-10-18 杭州光珀智能科技有限公司 A kind of measurement method and device of object volume
CN110425980A (en) * 2019-08-12 2019-11-08 深圳市知维智能科技有限公司 The measurement method and system of the volume of storage facilities content
CN110296747A (en) * 2019-08-12 2019-10-01 深圳市知维智能科技有限公司 The measurement method and system of the volume of storage content
CN110766744A (en) * 2019-11-05 2020-02-07 北京华捷艾米科技有限公司 MR volume measurement method and device based on 3D depth camera
CN110766744B (en) * 2019-11-05 2022-06-10 北京华捷艾米科技有限公司 MR volume measurement method and device based on 3D depth camera
CN111561872A (en) * 2020-05-25 2020-08-21 中科微至智能制造科技江苏股份有限公司 Method, device and system for measuring package volume based on speckle coding structured light
CN111696152A (en) * 2020-06-12 2020-09-22 杭州海康机器人技术有限公司 Method, device, computing equipment, system and storage medium for detecting package stacking
CN112254635A (en) * 2020-09-23 2021-01-22 洛伦兹(北京)科技有限公司 Volume measurement method, device and system
CN112254635B (en) * 2020-09-23 2022-06-28 洛伦兹(北京)科技有限公司 Volume measurement method, device and system
CN113418467A (en) * 2021-06-16 2021-09-21 厦门硅谷动能信息技术有限公司 Method for detecting general and black luggage size based on ToF point cloud data
CN114264277A (en) * 2021-12-31 2022-04-01 英特尔产品(成都)有限公司 Method and device for detecting flatness abnormality of chip substrate
CN114494404A (en) * 2022-02-14 2022-05-13 云从科技集团股份有限公司 Object volume measurement method, system, device and medium
CN115690062A (en) * 2022-11-08 2023-02-03 内蒙古中电物流路港有限责任公司赤峰铁路分公司 Rail surface damage state detection method and device and electronic equipment

Also Published As

Publication number Publication date
CN108537834B (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN108537834A (en) A kind of volume measuring method, system and depth camera based on depth image
CN109000559B (en) A method, device, system and readable storage medium for measuring the volume of an object
CN111127422A (en) Image annotation method, device, system and host
CN117115233B (en) Dimension measurement method and device based on machine vision and electronic equipment
CN111539943A (en) Multi-camera-based lithium battery pole piece stacking position measuring method, device and system
CN113177988B (en) Spherical screen camera and laser calibration method, device, equipment and storage medium
CN111385558A (en) TOF camera module accuracy measurement method and system
US12380602B2 (en) Optical axis calibration method and apparatus of optical axis detection system, terminal, system, and medium
CN114862929A (en) Three-dimensional target detection method, device, computer-readable storage medium and robot
CN115100299A (en) Calibration method, device, equipment and storage medium
CN111915666A (en) Volume measurement method and device based on mobile terminal
CN113983951B (en) Measurement methods, devices, imagers and storage media for three-dimensional targets
CN115511718A (en) PCB image correction method and device, terminal equipment and storage medium
CN112991459A (en) Camera calibration method, device, equipment and storage medium
CN111311671B (en) Workpiece measuring method and device, electronic equipment and storage medium
CN115018735A (en) Fracture width identification method and system for correcting two-dimensional code image based on Hough transform
CN114972027A (en) An image stitching method, device, equipment, medium and computer product
WO2023010565A1 (en) Method and apparatus for calibrating monocular speckle structured light system, and terminal
CN115861443A (en) Method, device, electronic equipment and storage medium for multi-camera internal reference calibration
CN112985258B (en) Calibration method and measurement method of three-dimensional measurement system
CN108629840A (en) A kind of method, apparatus and equipment for establishing LOGO three-D profiles
CN109000560B (en) Method, Apparatus and Device for Detecting Package Size Based on 3D Camera
CN117781865A (en) Pile volume measurement methods, systems, equipment and media
CN117710597A (en) Three-dimensional modeling method and system based on oblique photographic data and electronic equipment
CN114913241A (en) Structured light 3D camera calibration method and device

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
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A volume measurement method, system and depth camera based on depth image

Effective date of registration: 20220412

Granted publication date: 20200501

Pledgee: Zhejiang Mintai Commercial Bank Co.,Ltd. Hangzhou Binjiang small and micro enterprise franchise sub branch

Pledgor: HANGZHOU AIXIN INTELLIGENT TECHNOLOGY CO.,LTD.

Registration number: Y2022330000495

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200501