Background technique
With the rapid growth of shopping at network, logistic industry also rapidly develops therewith.Logistics refer to object from supply to
Receive the flow process on ground, wherein the above process includes the links such as packaging, storage and the dispatching of object.In general, in object
Link is dispensed, it need to be according to the volume of object, generation group vehicle strategy, thus the maximum goods space for utilizing distribution vehicle;And in object
The storage link of body then needs to be that object distributes suitable goods yard according to the volume of object, so that the utilization rate in warehouse is maximum.
It can be seen that being both needed to the volume of measurement object in the dispatching of logistics and storage link.
In the prior art, the volume of object is generally calculated by manual type, it is specific as follows: staff's benefit first
With the length information of measuring tool (such as tape measure) metering object;Then volume calculation formula is utilized, the body of object is calculated
Product.
Due in large-scale logistics dispatching and storage center, physical quantities usually to be processed are more, and at this time if adopted
The mode of employment calculates the volume of object, and object will certainly be made longer in the processing time for dispensing and storing link, thus
Influence the normal operation of entire logistics progress.
Apply for content
A kind of object measuring method and device are provided in the embodiment of the present application, to improve the computational efficiency of object volume,
Accelerate object in the processing for dispensing and storing link, guarantees the normal operation of entire logistics progress.
In order to solve the above-mentioned technical problem, the embodiment of the present application discloses following technical solution:
This application discloses a kind of object measuring methods, comprising: obtains the depth image of target object, the depth image
It is made of multiple pixels, includes the depth information of the target object in each pixel;
According to the depth information, two-dimensional coordinate of each pixel under image coordinate system is converted in world coordinate system
Under three-dimensional coordinate, three-dimensional coordinate of all pixels under world coordinate system forms three-dimensional point cloud in the depth map;
Using the three-dimensional point cloud and preset algorithm, the bottom surface equation and top surface equation of the target object are obtained, it is described
Bottom surface equation is the equation that the bottom surface of the target object is constituted in world coordinate system, and the top surface equation is the target object
The equation that is constituted in world coordinate system of top surface;
According to the bottom surface equation and top surface equation, the length and width and height of the target object are calculated.
Optionally, according to the depth information, two-dimensional coordinate of each pixel under image coordinate system is converted to alive
Three-dimensional coordinate under boundary's coordinate system, comprising:
According to the depth information, two-dimensional coordinate of each pixel under image coordinate system in depth map is converted to
Three-dimensional coordinate under camera coordinate system;
Three-dimensional coordinate of each pixel under camera coordinate system in the depth map is converted in world coordinate system
Under three-dimensional coordinate.
Optionally, the preset algorithm obtains the object using three-dimensional point cloud and preset algorithm for RANSAC algorithm
The bottom surface equation and top surface equation of body, comprising:
Step a: RANSAC algorithm is called to obtain the bottom surface equation of the target object to the three-dimensional point cloud operation;
Step b: in the three-dimensional point cloud, the three-dimensional coordinate of the bottom surface dependence among equations connection is deleted;
Step c: calling RANSAC algorithm, to the three-dimensional point cloud operation after deletion three-dimensional coordinate, obtains the target object
A plane equation;
Step d: judge whether the plane equation and the angle of bottom surface equation are located at preset threshold section;
Step e1: if the angle is located at preset threshold section, it is determined that the plane equation is top surface equation;
Step e2: if the angle is not located at preset threshold section, the plane is deleted in the three-dimensional point cloud
The three-dimensional coordinate of dependence among equations connection, returns to the step c and continues cycling through execution.
Optionally, according to the bottom surface equation and top surface equation, the length and width and height of the target object are calculated, is wrapped
It includes:
The distance for calculating plane represented by plane represented by the top surface equation to the bottom surface equation, as the target
The height of object;
Judge at least two side equations that the target object whether can be obtained using the three-dimensional point cloud;
If it can, the linear equation intersected using the top surface equation with side equation, obtains the length of the target object
And width;
If it could not, the length and width of plane represented by the top surface equation are obtained, the length and width as the target object.
Optionally, the linear equation intersected using top surface equation with side equation, obtains the length of the target object
And width, comprising:
The first straight line equation that the top surface equation intersects with first side equation is obtained, the first straight line equation is calculated
The upper distance of multiple three-dimensional coordinates from each other, the length by value maximum in the distance as the target object;And
The second straight line equation that the top surface equation intersects with second side equation is obtained, the second straight line equation is calculated
The upper distance of multiple three-dimensional coordinates from each other, the width by value maximum in the distance as the target object.
Optionally, the length and width for obtaining plane represented by the top surface equation, as the target object length and
It is wide, comprising:
The first boundary straight line equation of plane represented by the top surface equation is obtained, the first boundary straight line equation is calculated
The upper distance of multiple three-dimensional coordinates from each other, the length by value maximum in the distance as the target object;And
The second boundary linear equation for obtaining plane represented by the top surface equation calculates the second boundary linear equation
The upper distance of multiple three-dimensional coordinates from each other, the width by value maximum in the distance as the target object.
Optionally, which is characterized in that the method also includes:
For coordinate points each in three-dimensional point cloud, the coordinate points are calculated when neighbours' number is equal to when presetting neighbours' number
Adjacent threshold value, neighbour's threshold value refer to the region near coordinate points in certain distance;
The calculated adjacent threshold value of all coordinate points institutes is averaging, adjacent threshold average value is obtained;
It is average successively to judge whether the calculated adjacent threshold value of each coordinate points institute in three-dimensional point cloud is greater than the adjacent threshold
Value;
The coordinate points that determining neighbour's threshold value is greater than the adjacent threshold average value are noise, and are made an uproar described in deletion in three-dimensional point cloud
Point.
Optionally, default neighbours' number is one of following: 10,20,30,40,50,60;And
Adjacent threshold value averaging calculated to all coordinate points institutes includes: to ask all calculated adjacent threshold values of coordinate points institute
Arithmetic average, to obtain the adjacent threshold average value.
Optionally, the method also includes:
According to the length and width and height of the target object, the volume of the target object is calculated, the volume is calculated
Are as follows: volume=long * wide * high.
Disclosed herein as well is a kind of object measuring devices, comprising:
First obtains module, and for obtaining the depth image of target object, the depth image is made of multiple pixels, often
It include the depth information of the target object in a pixel;
Conversion module, for according to the depth information, two-dimensional coordinate of each pixel under image coordinate system to be converted
For the three-dimensional coordinate under world coordinate system, three-dimensional coordinate composition three of all pixels under world coordinate system in the depth map
Dimension point cloud;
Obtain module, for utilize the three-dimensional point cloud and preset algorithm, obtain the target object bottom surface equation and
Top surface equation, the bottom surface equation are the equation that the bottom surface of the target object is constituted under world coordinate system, the top surface side
Journey is the equation that the top surface of the target object is constituted under world coordinate system;
Length, width and height computing module, for according to the bottom surface equation and top surface equation, calculate the target object length,
It is wide and high.
Optionally, the conversion module includes:
First converting unit is used for according to the depth information, by each pixel in depth map under image coordinate system
Two-dimensional coordinate be converted to the three-dimensional coordinate under camera coordinate system;
Second converting unit, for turning three-dimensional coordinate of each pixel under camera coordinate system in the depth map
The three-dimensional coordinate being changed under world coordinate system.
Optionally, the acquisition module includes:
First arithmetic element, to the three-dimensional point cloud operation, obtains the target object for calling RANSAC algorithm
Bottom surface equation;
First deletes unit, in the three-dimensional point cloud, deleting the three-dimensional coordinate of the bottom surface dependence among equations connection;
Second arithmetic element, to the three-dimensional point cloud operation after deletion three-dimensional coordinate, obtains institute for calling RANSAC algorithm
State a plane equation of target object;
First judging unit, for judging whether the plane equation and the angle of bottom surface equation are located at preset threshold area
Between;
Determination unit, for when the angle is located at the preset threshold section, determining that the plane equation is top surface
Equation;
Second deletes unit, for deleting the associated three-dimensional coordinate of the plane equation in the three-dimensional point cloud.
Optionally, the length, width and height computing module includes:
Computing unit, for calculate plane represented by plane represented by the top surface equation to the bottom surface equation away from
From height as the target object;
Second judgment unit, for judging whether at least two of the target object can be obtained using the three-dimensional point cloud
Side equation;
First obtains unit, for when the side equation of the target object can be obtained, using the top surface equation with
The linear equation of side equation intersection, obtains the length and width of the target object;
Second obtaining unit, for obtaining the top surface equation in the side equation that cannot obtain the target object
The length and width of represented plane, length and width as the target object.
Optionally, the first obtains unit, comprising:
First obtains subelement, the first straight line equation intersected for obtaining the top surface equation with first side equation;
First computation subunit, for calculating the distance of multiple three-dimensional coordinates from each other on the first straight line equation,
Length by value maximum in the distance as the target object;
Second obtains subelement, the second straight line equation intersected for obtaining the top surface equation with second side equation;
Second computation subunit, for calculating the distance of multiple three-dimensional coordinates from each other on the second straight line equation,
Width by value maximum in the distance as the target object.
Optionally, second obtaining unit includes:
Third obtains subelement, for obtaining the first boundary straight line equation of plane represented by the top surface equation;
Third computation subunit, for calculate multiple three-dimensional coordinates on the first boundary straight line equation from each other away from
From by the length being worth as the target object maximum in the distance;
4th obtains subelement, for obtaining the second boundary linear equation of plane represented by the top surface equation;
4th computation subunit, for calculate multiple three-dimensional coordinates on the second boundary linear equation from each other away from
From by the width being worth as the target object maximum in the distance.
Optionally, described device further include:
Adjacent threshold calculation module, for calculating the coordinate points when neighbours' number for coordinate points each in three-dimensional point cloud
Adjacent threshold value when equal to default neighbours' number, neighbour's threshold value refer to the region near coordinate points in certain distance;
Average computation block obtains adjacent threshold average value for being averaging to all calculated adjacent threshold values of coordinate points institute;
Judgment module, for successively judging whether the calculated adjacent threshold value of the institute of each coordinate points in three-dimensional point cloud is greater than
Neighbour's threshold average value;
Removing module, the coordinate points for adjacent threshold value to be greater than the adjacent threshold average value are determined as noise, and in three-dimensional point
The noise is deleted in cloud.
Optionally, described device further include:
Volume calculation module calculates the body of the target object for the length and width and height according to the target object
Product, the volume are calculated as: volume=long * wide * high.
Optionally, the object measuring device is further coupled to a target object image acquisition device, described in obtaining
The depth image of target object, the target object image acquisition device include:
Video camera,
Camera mount, and
Pedestal;The target object is placed on the pedestal,
Wherein, the placement location of the video camera is higher than the target object, so that the video camera can take institute
State the top surface of target object.
By above technical scheme as it can be seen that in the embodiment of the present application, obtaining the depth image of target object first;Then sharp
With the depth information of depth image, two-dimensional coordinate of the pixel each in depth image under plane of delineation coordinate system is converted to
Three-dimensional coordinate under world coordinate system, and three-dimensional coordinate of all pixels under world coordinate system in the depth image, composition
The three-dimensional point cloud of the depth image;The three-dimensional point cloud and preset algorithm are subsequently utilized, the bottom of the target object is obtained
Face equation and top surface equation and according to the bottom surface equation and top surface equation, calculate the target object length and width and
Height, and the length and width and height of target object are utilized, the volume of target object can be obtained.Therefore using the above method and
Device improves the computational efficiency of target object volume, to accelerate mesh compared to the artificial mode for calculating target object volume
Object is marked in the processing for dispensing and storing link, guarantees the normal operation of entire logistics progress.
Specific embodiment
The application provides a kind of object measuring method and device, to improve the computational efficiency of target object volume, accelerates mesh
Object is marked in the processing for dispensing and storing link, guarantees the normal operation of entire logistics progress.
Object measuring method provided by the embodiment of the present application is illustrated first, as shown in Figure 1, this method is at least wrapped
It includes:
Step S11: obtaining the depth image of target object, and the depth image is made of multiple pixels, in each pixel
Depth information including the target object;
In the embodiment of the present application, the depth image of target object is directly acquired using depth camera;It can also be used
The normal image of common camera acquisition target object;Then normal image is handled again (such as the side such as stereoscopic vision
Formula), obtain the depth image of target object.
In the embodiment of the present application, the pixel value of the depth image can indicate the depth information, the depth information
It can be specially target object at a distance from acquisition camera.
Step S12: according to the depth information, two-dimensional coordinate of each pixel under image coordinate system is converted to alive
Three-dimensional coordinate under boundary's coordinate system, three-dimensional coordinate of all pixels under world coordinate system forms three-dimensional point in the depth map
Cloud;
In the embodiment of the present application, described image coordinate system be specifically using the optical center of video camera as origin, established two
Dimensional plane rectangular coordinate system;The world coordinate system is specifically to be built using the intersection point of camera optical axis and the plane of delineation as origin
Vertical three-dimensional system of coordinate;The world coordinate system is absolute coordinate system, for describing the absolute position of target object.
In the embodiment of the present application, three-dimensional point cloud can specifically as shown in figure 11, can be clear using the coordinate in three-dimensional point cloud
It indicates target object (i.e. convex portion in Figure 11) and ground (i.e. large-area planar in Figure 11).
Step S13: the three-dimensional point cloud and preset algorithm are utilized, bottom surface equation and the top surface side of the target object are obtained
Journey, the equation that the bottom surface equation is made of under world coordinate system the bottom surface of the target object, the top surface equation are
The equation that the top surface of the target object is constituted under world coordinate system;
Step S14: according to the bottom surface equation and top surface equation, the length and width and height of the target object are calculated.
Therefore in the embodiment of the present application, the depth image of target object is obtained first;Then depth image is utilized
Depth information, two-dimensional coordinate of the pixel each in depth image under plane of delineation coordinate system is converted in world coordinate system
Under three-dimensional coordinate, and three-dimensional coordinate of all pixels under world coordinate system in the depth image form the depth map
The three-dimensional point cloud of picture;The three-dimensional point cloud and preset algorithm are subsequently utilized, bottom surface equation and the top of the target object are obtained
Face equation and according to the bottom surface equation and top surface equation, calculates the length and width and height of the target object, and utilizes mesh
The length and width and height for marking object, can obtain the volume of target object.Therefore using the above method and device, compared to
The artificial mode for calculating target object volume, improves the computational efficiency of target object volume, is matching to accelerate target object
The processing for sending and storing link guarantees the normal operation of entire logistics progress.
In another possible embodiments of the application, as shown in Fig. 2, the step S12 in above-mentioned all embodiments can include:
Step S21: according to the depth information, by two-dimensional coordinate of each pixel under image coordinate system in depth map
Be converted to the three-dimensional coordinate under camera coordinate system;
In the embodiment of the present application, the camera coordinate system is the three-dimensional established using the optical center of video camera as origin
Coordinate system, the X-axis and Y-axis of the camera coordinate system are parallel with the U axis of image coordinate system and V axis respectively, and Z axis is camera light
Axis.In the embodiment of the present application, the corresponding relationship between image coordinate system, camera coordinate system and world coordinate system, reference can be made to
Shown in Fig. 3.
In the embodiment of the present application, it is assumed that the origin O1 of plane of delineation coordinate system (U-V coordinate system) is sat in camera plane
Coordinate under mark system (X-Y-coordinate system) is (u0,v0), then any pixel is in U-V coordinate system and X-Y-coordinate in depth image
The transformational relation of system are as follows:
Above-mentioned equation (1) is indicated with homogeneous matrix, can be obtained:
Inverse transformation is carried out to matrix equation (2), can be obtained:
In the embodiment of the present application, it is assumed that coordinate of the pixel under image coordinate system is P (x, y), In in depth image
Coordinate under camera coordinate system is P (XC,YC,ZC), the coordinate under world coordinate system is P (XW,YW,ZW), then by P (x,
Y) P (X is converted toC,YC,ZC) detailed process is as follows:
A1: it according to the corresponding relationship of image coordinate system and camera coordinate system, can be obtained:
Wherein, f indicates the depth of pixel corresponding to P (x, y) coordinate;
B1: using homogeneous equation, indicates that above-mentioned equation (4) are available:
C1: above-mentioned equation (3), which is updated in equation (5), can be obtained:
D1: it is available that transformation is carried out to equation (6):
Two-dimensional coordinate P (x, y) of the pixel under image coordinate system pixel can be converted to using above-mentioned equation (7) taking the photograph
Three-dimensional coordinate P (X under camera coordinate systemC,YC,ZC)。
Step S22: three-dimensional coordinate of each pixel under camera coordinate system in the depth map is converted to alive
Three-dimensional coordinate under boundary's coordinate system.
In the embodiment of the present application, by P (XC,YC,ZC) be converted to P (XC,YC,ZC) detailed process is as follows:
A2: using translation vector t and spin matrix R, indicates the corresponding relationship of video camera and world coordinate system:
Wherein, R is the orthogonal matrices of 3*3, and t is D translation vector;
B2: will be in equation (8)It is substituting in equation (7)It obtains:
Wherein,
It can be coordinate P (X of the pixel under camera coordinate system using above-mentioned equation (9)C,YC,ZC) be converted to pixel and exist
Three-dimensional coordinate P (X under world coordinate systemW、YW、ZW)。
Therefore in the embodiment of the present application, can first by pixel each in depth map under image coordinate system two
Dimension coordinate be converted to the three-dimensional coordinate under camera coordinate system, then, then by each pixel under camera coordinate system three
Dimension coordinate is converted to the three-dimensional coordinate under world coordinate system.
In the embodiment of the present application, the preset algorithm in above-mentioned all embodiments can be specially RANSAC (RANdom
SAmple Consensus) algorithm;As shown in figure 4, the step S13 in above-mentioned all embodiments can include:
Step S41: RANSAC algorithm is called to obtain the bottom surface equation of the target object to the three-dimensional point cloud operation;
In the embodiment of the present application, RANSAC algorithm will carry out operation to three-dimensional point cloud according to following processes:
Any two three-dimensional coordinates in three-dimensional point cloud are taken first, establish a plane equation;Then, then judge its in three-dimensional point cloud
Its three-dimensional coordinate, it is whether associated with the plane equation;If associated, the plane side is adjusted using the three-dimensional coordinate
Journey;Finally, plane represented by the plane equation of acquisition is maximum for area in depth image, covering three-dimensional coordinate is most puts down
Face.Since during the actual acquisition of depth image, target object is typically placed in a plane, accordingly, it can be determined that area
Larger, covering three-dimensional coordinate is most planes are the bottom surface of target object.
Step S42: in the three-dimensional point cloud, removal belongs to the point on the ground, that is, deletes the bottom surface dependence among equations
The three-dimensional coordinate of connection;
In the embodiment of the present application, the constituted plane covering of the bottom surface equation can be deleted specifically in three-dimensional point cloud
Three-dimensional coordinate.
Step S43: calling RANSAC algorithm, carries out operation to the three-dimensional point cloud after deletion three-dimensional coordinate, obtains the mesh
Mark a plane equation of object;
In the embodiment of the present application, RANSAC algorithm is called, operation is carried out to the three-dimensional point cloud after deletion three-dimensional coordinate, is obtained
Obtain is that another covering surface is more maximum except the base in target object, covers the most plane of three-dimensional point cloud;Due to actually answering
It in, not can determine that whether current plane is the top surface of target object, therefore use step S44, to judge current plane side
Plane represented by journey whether be target object top surface.
Step S44: judge whether the plane equation and the angle of bottom surface equation are located at the first preset threshold section;If
It is located at, executes step S45, it is no to then follow the steps S46;
In the embodiment of the present application, first preset threshold section is [- 5 degree ,+5 degree].Theoretically, bottom surface equation is flat
Row is in top surface equation, and the angle of the two should be 0 degree, but find in actually calculating, and the performance of the size and plane of angle is that have
Error, therefore it is [- 5 degree ,+5 degree] that the first preset threshold section, which is arranged,.
In the embodiment of the present application, the normal that can respectively determine above-mentioned plane equation Yu bottom surface equation first, then finds out
The angle of two normals, the angle of as described plane equation and bottom surface equation.
Step S45: determine that the plane equation is top surface equation;
Step S46: in the three-dimensional point cloud, removal belongs to the point of the plane, that is, it is associated to delete the plane equation
Three-dimensional coordinate, then circulation execute step S43.
It in the embodiment of the present application, can be in three-dimensional if plane equation obtained is not the top surface equation of target object
Remove these points in point cloud, that is, delete the associated three-dimensional coordinate of the plane equation, then proceedes to call RANSAC algorithm, it is right
Three-dimensional point cloud carries out operation, until the top surface equation for obtaining target object.
Therefore using the above method, it may be determined that the bottom surface equation and top surface equation of target object.
In the another possible embodiments of the application, as shown in figure 5, the step S14 in above-mentioned all embodiments can include:
Step S51: calculating the distance of plane represented by plane represented by the top surface equation to the bottom surface equation, as
The height of the target object;
Due in practical applications, the bottom surface of target object be built by scattered three-dimensional coordinate point it is uneven flat
Face, therefore, in order to increase accuracy, can find out first all three-dimensional coordinate points in the top surface of target object to bottom surface equation away from
From, then average again to the distance, the height as the target object.But due to calculating object using aforesaid way
The height of body, the calculation amount spent is larger, therefore in order to improve computational efficiency, can be used and first sit to the three-dimensional of target object top surface
Punctuate is sampled, then three-dimensional coordinate point is asked to calculate the height of target object to the mode of bottom surface equation distance.
Step S52: judge at least two side equations that the target object whether can be obtained using the three-dimensional point cloud;
If so, step S53 is executed, it is no to then follow the steps S54;
In the embodiment of the present application, specifically, RANSAC algorithm can be called first, operation is carried out to three-dimensional point cloud, is obtained
One plane equation;Then judge whether the plane equation with bottom surface equation is orthogonal, that is, the angle of the two whether be 90 degree (can
Preset threshold section as described above [- 85 degree ,+95 degree] are further implemented as, or are embodied as other preferable orthogonal angles), such as
Fruit is orthogonal, it is determined that the plane equation is side equation;If non-orthogonal, side dependence among equations is deleted in three-dimensional point cloud
The three-dimensional coordinate of connection, and continue to execute and call RANSAC algorithm, operation is carried out to the three-dimensional point cloud after deletion three-dimensional coordinate, until
It obtains until three-dimensional coordinate is not present at least two side equations or three-dimensional cloud.
Step S53: the linear equation intersected using the top surface equation with side equation obtains the length of the target object
And width;
In order to obtain the length and width of the target object, need at least to adopt in the depth image collection process of target object
Collect two sides (as shown in the shade in Fig. 6) of target object, and the top surface of target object intersect with two sides it is straight
Line is actually two, straight line 1 shown in respectively Fig. 6 and straight line 2.In the embodiment of the present application, obtain straight line 1 with
After straight line 2, following manner can be used, obtain the length and width of target object:
Obtaining the first straight line equation that the top surface equation intersects with first side equation (can be the corresponding side of straight line 1
Journey), calculate the distance of multiple three-dimensional coordinates from each other on the first straight line equation, using value maximum in the distance as
The length (or as width) of the target object;And
Obtaining the second straight line equation that the top surface equation intersects with second side equation (can be side corresponding to straight line 2
Journey), calculate the distance of multiple three-dimensional coordinates from each other on the second straight line equation, using value maximum in the distance as
The width (or as length) of the target object.
Step S54: obtaining the length and width of plane represented by the top surface equation, the length and width as the target object.
In the embodiment of the present application, theoretically, using the available 4 boundary straight line equations of a top surface equation, but
In one embodiment, for simplicity, the boundary straight line equation of any two intersections of the top surface equation need to be only used,
The boundary straight line equation of this two intersections is considered as the length and width for defining plane represented by the equation of top surface.In an embodiment party
In formula, specific steps are as follows:
The first boundary straight line equation of plane represented by the top surface equation is obtained, the first boundary straight line equation is calculated
The upper distance of multiple three-dimensional coordinates from each other, length (or the conduct by value maximum in the distance as the target object
It is wide);And
The second boundary linear equation for obtaining plane represented by the top surface equation calculates the second boundary linear equation
The upper distance of multiple three-dimensional coordinates from each other, width (or the conduct by value maximum in the distance as the target object
It is long).
Therefore in the embodiment of the present application, it may be determined that the length and width of target object.
It will be appreciated by those skilled in the art that being led to due to factors such as the precision of acquisition camera itself and environmental disturbances
It crosses in depth image three-dimensional point cloud obtained and inevitably introduces some noises.Therefore, in the another feasible of the application
It, can be further by processing, to remove the noise in three-dimensional point cloud in embodiment.Have in this field a variety of pairs of three-dimensional point clouds into
The method of row denoising.
In a preferred embodiment, the application carries out at denoising according to the syntople of coordinate points in three-dimensional point cloud
Reason.It is formed by three-dimensional point cloud by depth camera, the coordinate points around some coordinate points a are considered this
" neighbours " of a coordinate points a." adjacent threshold " is the region near a coordinate points in certain distance, and the point can be in the area
With multiple " neighbours ".
Due to each coordinate points in three-dimensional point cloud can be viewed as be from other all coordinate points have it is different away from
From neighborhood.Therefore, it for some coordinate points a, can calculate when it has N (N is positive integer) a neighbours just
Adjacent threshold value.In an exemplary description, for example, when coordinate points a has 100 nearest neighbours, 100 neighbours
A furthermost neighbours placed in the middle are 20 coordinate units at a distance from coordinate points a, it may be considered that: this 100 neighbours exist
In the range of the adjacent threshold value 20 of coordinate points a.
Based on the situation, as shown in fig. 7, the method in all embodiments disclosed herein can include:
Step S71: for coordinate points each in three-dimensional point cloud, the coordinate points is calculated when its neighbours' number is equal to and preset neighbours
Adjacent threshold value when number, default neighbours' number can be set according to the actual situation, for example, root is it was found that can be by institute
State default neighbours' number and be set as 10,20,30,40,50 or 60, wherein take 30,40,50 for compared with
Good value;
Step S72: the adjacent threshold value calculated of above-mentioned all coordinate points is averaging, adjacent threshold average value is obtained;
In the embodiment of the present application, the arithmetic mean of instantaneous value of the adjacent threshold value calculated of above-mentioned all coordinate points can be specifically sought,
For example, the adjacent threshold value of all three coordinate points is respectively 10,20,30, then the calculating of adjacent threshold average value can specifically: (10+20
+ 30)/3=20.
Step S73: successively judging in three-dimensional point cloud, and whether the adjacent threshold value calculated of each coordinate points is greater than the adjacent threshold
Average value;If it does, executing step S74;Otherwise, terminate process;
Step S74: it determines that the coordinate points are noise, and deletes the noise in three-dimensional point cloud.
In another possible embodiments of the application, as shown in Figure 10, it may also include that
Step S15: according to the length and width and height of the target object, the volume of the target object, the volume are calculated
It is calculated as: volume=long * wide * high;
Therefore using method disclosed in the embodiment of the present application, the volume of target object can be also calculated.By above
Embodiment of the method description, it is apparent to those skilled in the art that the application can add by software it is required
The mode of general hardware platform is realized, naturally it is also possible to which by hardware, but in many cases, the former is more preferably embodiment.
Based on this understanding, substantially the part that contributes to existing technology can be with software in other words for the technical solution of the application
The form of product embodies, which is stored in a storage medium, including some instructions use so that
One computer equipment (can be personal computer, server or the network equipment etc.) executes each embodiment institute of the application
State all or part of the steps of method.And storage medium above-mentioned includes: read-only memory (ROM), random access memory
(RAM), the various media that can store program code such as magnetic or disk.
Present invention also provides a kind of devices for obtaining target object image, as shown in figure 8, described device, including camera shooting
Machine, camera mount and pedestal;Wherein, target object can be placed on pedestal, and the placement location of video camera is higher than object
Body, so that video camera can take the top surface of target object.
In practical applications, when the video camera is depth camera, object can be directly acquired using described device
The depth image of body;And when the video camera is common camera, it also needs to carry out device image obtained further
Processing, can just obtain the depth image of target object.
In the embodiment of the present application, the pedestal of the device can be replaced specifically with conveyer belt.
Corresponding with object measuring method embodiment provided by the present application, present invention also provides a kind of measurements of object to fill
Set, the object measuring device can implement within hardware, such as video camera processor, calculate reason processor and shifting
The processor etc. of dynamic terminal, also may be implemented be deployed in the long-range remote server communicated with network or client
On.The object measuring device is connect with the device shown in Fig. 8 for obtaining target object image, or passes through the modes such as network and Fig. 8
Shown in obtain target object image device telecommunication, the depth image of collected target object to receive.Such as
Shown in Fig. 9, the object measuring device is included at least:
First obtains module 91, and for obtaining the depth image of target object, the depth image is made of multiple pixels,
It include the depth information of the target object in each pixel;
Conversion module 92, for according to the depth information, two-dimensional coordinate of each pixel under image coordinate system to be turned
The three-dimensional coordinate being changed under world coordinate system, three-dimensional coordinate composition of all pixels under world coordinate system in the depth map
Three-dimensional point cloud;
Module 93 is obtained, for utilizing the three-dimensional point cloud and preset algorithm, obtains the bottom surface equation of the target object
The equation being made of under world coordinate system with top surface equation, the bottom surface equation the bottom surface of the target object, the top
The equation that face equation is made of under world coordinate system the top surface of the target object;
Length, width and height computing module 94, for calculating the target object according to the bottom surface equation and top surface equation
Length and width and height.
Therefore in the embodiment of the present application, the depth image of target object is obtained first;Then depth image is utilized
Depth information, two-dimensional coordinate of the pixel each in depth image under plane of delineation coordinate system is converted in world coordinate system
Under three-dimensional coordinate, and three-dimensional coordinate of all pixels under world coordinate system in the depth image form the depth map
The three-dimensional point cloud of picture;The three-dimensional point cloud and preset algorithm are subsequently utilized, bottom surface equation and the top of the target object are obtained
Face equation and according to the bottom surface equation and top surface equation, calculates the length and width and height of the target object;And then it can count
Calculate the volume of target object.Therefore it is mentioned using the above method and device compared to the artificial mode for calculating object volume
The high computational efficiency of object volume guarantees entire logistics progress to accelerate object in the processing for dispensing and storing link
Normal operation.
In another possible embodiments of the application, the conversion module 92 in above-mentioned all embodiments includes:
First converting unit is used for according to the depth information, by each pixel in depth map under image coordinate system
Two-dimensional coordinate be converted to the three-dimensional coordinate under camera coordinate system;
Second converting unit, for turning three-dimensional coordinate of each pixel under camera coordinate system in the depth map
The three-dimensional coordinate being changed under world coordinate system.
It therefore in the embodiment of the present application, can be by two dimension of each pixel under image coordinate system in depth map
Coordinate is converted to the three-dimensional coordinate under world coordinate system.
Acquisition module 93 in another possible embodiments of the application, in above-mentioned all embodiments can include:
First arithmetic element, to the three-dimensional point cloud operation, obtains the target object for calling RANSAC algorithm
Bottom surface equation;
First deletes unit, in the three-dimensional point cloud, deleting the three-dimensional coordinate of the bottom surface dependence among equations connection;
Second arithmetic element, to the three-dimensional point cloud operation after deletion three-dimensional coordinate, obtains institute for calling RANSAC algorithm
State a plane equation of target object;
First judging unit, for judging whether the plane equation and the angle of bottom surface equation are located at preset threshold area
Between;
Determination unit, for when the angle is located at the preset threshold section, determining that the plane equation is top surface
Equation;
Second deletes unit, for deleting the associated three-dimensional coordinate of the plane equation in the three-dimensional point cloud.
Therefore using above-mentioned apparatus, it may be determined that the bottom surface equation and top surface equation of target object.
Length, width and height computing module 94 in another possible embodiments of the application, in above-mentioned all embodiments can include:
Computing unit, for calculate plane represented by plane represented by the top surface equation to the bottom surface equation away from
From height as the target object;
Second judgment unit, for judging whether at least two of the target object can be obtained using the three-dimensional point cloud
Side equation;
First obtains unit, for when the side equation of the target object can be obtained, using the top surface equation with
The linear equation of side equation intersection, obtains the length and width of the target object;
In the embodiment of the present application, the first obtains unit, comprising: first obtains subelement, for obtaining the top
The first straight line equation that face equation intersects with first side equation;First computation subunit, for calculating the first straight line side
The distance of multiple three-dimensional coordinates from each other in journey, the length by value maximum in the distance as the target object;Second
Obtain subelement, the second straight line equation intersected for obtaining the top surface equation with second side equation;Second calculates son list
Member, for calculating the distance of multiple three-dimensional coordinates from each other on the second straight line equation, by value maximum in the distance
Width as the target object.
Second obtaining unit, for obtaining the top surface equation in the side equation that cannot obtain the target object
The length and width of represented plane, length and width as the target object.
In the embodiment of the present application, second obtaining unit, comprising: third obtains subelement, for obtaining the top
First boundary straight line equation of plane represented by the equation of face;Third computation subunit, for calculating the first boundary straight line side
The distance of multiple three-dimensional coordinates from each other in journey, the length by value maximum in the distance as the target object;4th
Subelement is obtained, for obtaining the second boundary linear equation of plane represented by the top surface equation;4th computation subunit is used
In calculating the distance of multiple three-dimensional coordinates from each other on the second boundary linear equation, value maximum in the distance is made
For the width of the target object.
Therefore using above-mentioned apparatus, the length of target object can be calculated.
In another possible embodiments of the application, the device in above-mentioned all embodiments may also include that
Adjacent threshold calculation module, for calculating the coordinate points when neighbours' number for coordinate points each in three-dimensional point cloud
Adjacent threshold value when equal to default neighbours' number, neighbour's threshold value refer to the region near coordinate points in certain distance;
Average computation block obtains adjacent threshold average value for being averaging to all calculated adjacent threshold values of coordinate points institute;
Judgment module, for successively judging in three-dimensional point cloud, whether each calculated adjacent threshold value of coordinate points institute is greater than institute
State adjacent threshold average value;
Removing module, the coordinate points for determining that adjacent threshold value is greater than the adjacent threshold average value are noise, and in three-dimensional point cloud
It is middle to delete the noise.
Therefore using above-mentioned apparatus, the noise in three-dimensional point cloud can be deleted.
In another possible embodiments of the application, the device in above-mentioned all embodiments may also include that
Volume calculation module calculates the body of the target object for the length and width and height according to the target object
Product, the volume are calculated as: volume=long * wide * high.
Therefore using the device of the application, the volume of target object can be also calculated.
It should be noted that, in this document, the relational terms of such as " first " and " second " or the like are used merely to one
A entity or operation with another entity or operate distinguish, without necessarily requiring or implying these entities or operation it
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to
Cover non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or setting
Standby intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in the process, method, article or apparatus that includes the element.
The above is only the specific embodiment of the application, is made skilled artisans appreciate that or realizing this Shen
Please.Various modifications to these embodiments will be apparent to one skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
The above is only the specific embodiment of the application, it is noted that for the ordinary skill people of the art
For member, under the premise of not departing from the application principle, several improvements and modifications can also be made, these improvements and modifications are also answered
It is considered as the protection scope of the application.