Object size acquisition method and device, computer equipment and storage medium

文档序号:1576046 发布日期:2020-01-31 浏览:14次 中文

阅读说明:本技术 物体尺寸获取方法、装置、计算机设备以及存储介质 (Object size acquisition method and device, computer equipment and storage medium ) 是由 于冬青 卢达 于 2019-10-24 设计创作,主要内容包括:本发明涉及计算机视觉技术领域,尤其涉及一种基于单目视觉的物体尺寸获取方法、装置、计算机设备以及存储介质。物体尺寸获取方法,包括如下步骤:获取预先设置的比对区的物理尺寸;获取比对区相同部位各自所在平面之间的距离;预先获取目标物体的物理三维尺寸中至少两个的比例关系;通过拍照设备获取至少一张视图;获取所述视图中两个比对区的图像尺寸;获取所述视图中目标物体的图像尺寸;预先获取第一个公式<Image he="136" wi="228" file="DDA0002246099090000011.GIF" imgContent="drawing" imgFormat="GIF" orientation="portrait" inline="no"></Image>第二个公式<Image he="135" wi="195" file="DDA0002246099090000012.GIF" imgContent="drawing" imgFormat="GIF" orientation="portrait" inline="no"></Image>第三个公式<Image he="126" wi="273" file="DDA0002246099090000013.GIF" imgContent="drawing" imgFormat="GIF" orientation="portrait" inline="no"></Image>将相应参数带入上述公式计算获得最终的物体目标尺寸。本方法整个流程简单方便,使用任何拍照设备都可以实现,而且测量获得的物体尺寸的精度也比较高。(The invention relates to the technical field of computer vision, in particular to a monocular vision-based object size obtaining method, a device, computer equipment and a storage medium, wherein the object size obtaining method comprises the following steps of obtaining the preset physical size of a comparison area, obtaining the distance between planes of the same parts of the comparison area, obtaining the proportional relation of at least two of the physical three-dimensional sizes of a target object in advance, obtaining at least views through photographing equipment, obtaining the image sizes of the two comparison areas in the views, obtaining the image size of the target object in the views, and obtaining a th formula in advance Second formula Third formula And substituting the corresponding parameters into the formula to calculate to obtain the final target size of the object. The method has the advantages that the whole process is simple and convenient, the method can be realized by using any photographing equipment, and the precision of the size of the object obtained by measurement is higher.)

1. The object size obtaining method is characterized in that the bottom of at least orthographic projection views of the object cannot be seen, and the method comprises the following steps:

acquiring the preset physical sizes of two comparison areas with the same orientation and shape and arranged in a staggered manner;

obtaining the distance between the planes of the same parts of the two comparison areas;

the method comprises the steps of obtaining the distance from the outermost side of a side wall to the lower end of the side wall in an orthographic projection view of the bottom of a target object in advance, wherein the outermost side of the side wall cannot be seen by the target object;

when the photographing equipment photographs the views with the target object, the lens of the photographing equipment is positioned above the bottom of the target object and is positioned above the bottom of the target object, and the distance from the outermost side of the side wall of the target object to the lower end of the side wall of the target object under the view is known in advance;

acquiring the image sizes of two comparison areas in the view;

acquiring the image size of a target object in the view;

obtain th formula in advance

Figure FDA0002246099060000011

and substituting the corresponding parameters into the formula to calculate to obtain the final target size of the object.

2. The method for obtaining the size of the object is characterized in that the object is a cuboid, a sphere, a cylinder, an ellipsoid, a quasi-cuboid, a quasi-sphere, a quasi-cylinder or a quasi-ellipsoid; the method comprises the following steps:

acquiring the preset physical sizes of two comparison areas with the same orientation and shape and arranged in a staggered manner;

obtaining the distance between the planes of the same parts of the two comparison areas;

the ratio of the size with the same direction as the comparison area in the physical three-dimensional size of the target object to the size of the object is obtained in advance;

the method comprises the steps that at least views are obtained through photographing equipment, wherein the views comprise two complete comparison areas and target objects, when the photographing equipment photographs all the views, the positions of the target objects and the comparison areas are fixed, the lowest ends of the target objects are located on the planes of the two comparison areas, which are located at the lower sides of the two comparison areas and have the same distance between the planes, and the heights of lenses of the photographing equipment are approximately the same when photographing is carried out, when the photographing equipment photographs the views with the target objects, the lenses of the photographing equipment are located above the target objects, and the sizes of the target objects facing the lens direction are in the proportional relation of the at least two acquired sizes;

acquiring the image sizes of two comparison areas in the view;

acquiring the image size of a target object in the view;

obtain th formula in advanceSecond formulaThird formula

Figure FDA0002246099060000023

and substituting the corresponding parameters into the formula to calculate to obtain the final target size of the object.

3. The object size acquisition method according to claim 1 or 2, wherein the comparison area is a planar figure or a three-dimensional structure.

4. The object size acquisition method according to claim 3, wherein the comparison area is circular or rectangular;

or;

the comparison area is a sphere or a cuboid.

5. An object size obtaining apparatus, wherein the bottom of at least orthographic views of the object cannot be seen, comprising:

an th obtaining unit, configured to obtain the preset physical sizes of two comparison areas that are the same in orientation and shape and are arranged in a staggered manner;

the second acquisition unit is used for acquiring the distance between the planes of the same parts of the two comparison areas;

a third acquisition unit configured to acquire in advance a distance from an outermost side of the side wall to a lower end thereof in an orthographic projection view in which the target object cannot see the bottom thereof;

the photographing device comprises a fourth acquisition unit, a second acquisition unit and a third acquisition unit, wherein the fourth acquisition unit is used for acquiring at least views through the photographing device, the views comprise two complete comparison areas and a target object, when the photographing device photographs all the views, the positions of the target object and the comparison areas are fixed, the lowest end of the target object is positioned on a plane where the two comparison areas are positioned on the lower side in the same position where the distance between the planes of the two comparison areas is acquired, the height of a lens of the photographing device is approximately the same when photographing is carried out each time, when the photographing device photographs the views with the target object, the lens is positioned above the bottom of the target object, and the distance from the outermost side of the side wall of the target object to the lower end of the side wall;

a fifth obtaining unit, configured to obtain image sizes of two comparison areas in the view;

a sixth acquisition unit configured to acquire an image size of a target object in the view;

a seventh obtaining unit for obtaining in advance the th formula

Figure FDA0002246099060000041

and , a processing unit for substituting the corresponding parameters into the above formula to calculate the final target size of the object.

6. The object size acquisition device is characterized in that the object is a cuboid, a sphere, a cylinder, an ellipsoid, a quasi-cuboid, a quasi-sphere, a quasi-cylinder or a quasi-ellipsoid; the method comprises the following steps:

the eighth acquiring unit is used for acquiring the preset physical sizes of the two comparison areas with the same orientation and shape and arranged in a staggered manner;

a ninth obtaining unit, configured to obtain a distance between planes where the same portions of the two comparison areas are located;

a tenth acquiring unit, configured to acquire in advance a ratio of a size of the target object that is the same as the orientation of the comparison area in the physical three-dimensional size to the determined object size;

the photographing device comprises a tenth acquiring unit, a photographing device and a control unit, wherein the tenth acquiring unit is used for acquiring at least views through the photographing device, the views comprise two complete comparison areas and a target object, when the photographing device photographs all the views, the positions of the target object and the comparison areas are fixed, the lowest end of the target object is positioned on a plane where the two comparison areas are positioned on the lower side in the same position where the distance between the planes of the two comparison areas is acquired, the height of lenses of the photographing device is approximately the same when photographing is carried out each time, when the photographing device photographs the views with the target object, the lenses of the photographing device are positioned above the target object, and the size of the target object facing the lens direction is in the proportional relation of the acquired at least two sizes;

a twelfth acquiring unit, configured to acquire image sizes of two comparison areas in the view;

a thirteenth acquiring unit configured to acquire an image size of the target object in the view;

a fourteenth obtaining unit for obtaining in advance the th formulaSecond formulaThird formula

Figure FDA0002246099060000061

and the second processing unit is used for substituting the corresponding parameters into the formula to calculate and obtain the final target size of the object.

Computer device of the kind 7, , comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the object size acquisition method of any of claims 1-4 and .

8, computer-readable storage media, wherein the computer-readable storage media stores or or more computer programs, the or or more computer programs being executable by or or more processors to implement the object size obtaining method according to any of claims 1-4.

Technical Field

The invention relates to the technical field of computer vision, in particular to monocular vision-based object size acquisition methods and devices, computer equipment and storage media.

Background

The method for measuring the physical dimension of an object with a fixed shape is usually a direct measurement by using a measuring tool, which is limited to a few measurements and cannot be inferred for industrial application.

The method for measuring the physical size of an object mainly comprises monocular vision, binocular vision, a structured light lens and a time of flight (TOF) depth of field lens, wherein the binocular vision measurement has the image registration problem, the structured light lens and the TOF depth of field lens determine the depth of field of the object by transmitting and receiving feedback light rays to a target, the object cannot work effectively due to the existence of obstacles, the current technical working range is small, and the effect on moving objects is poor, the monocular vision is divided into an uncalibrated camera measurement technology based on a projection geometric cross ratio invariant principle and a measurement technology based on camera calibration or field calibration in the measurement aspect, the monocular vision is divided into an uncalibrated camera measurement technology based on a projection geometric cross ratio invariant principle and a measurement technology based on camera calibration in the measurement aspect, and the measurement precision of the uncalibrated camera measurement technology and the measurement technology is not high.

The patent application No. CN201910290703.5, the patent name of which is a method and a system for positioning and measuring a space object based on computer vision, discloses schemes for measuring the physical size of a target object based on monocular vision, the schemes firstly collect parameters of the physical size of a comparison object or the target object and calibrate a camera to obtain a camera focal length f, the parameters are input into a parameter library of a data processing platform, then the collection platform collects an image or a video, the data processing platform calculates an object-image relation ratio lambda of the comparison object, and finally the physical size of the target object can be obtained according to the object-image relation ratio lambda and the image size of the target object in an image coordinate system.

Disclosure of Invention

In order to solve the defects of the prior art, the invention aims to provide monocular vision-based object size acquisition methods, apparatuses, computer devices and storage media, which solve the problems of high requirements on photographing equipment and low measurement accuracy.

In order to achieve the purpose, the technical scheme of the invention is as follows:

the method for obtaining the size of the object, wherein the bottom of the object cannot be seen in at least orthographic projection views, comprises the following steps:

acquiring the preset physical sizes of two comparison areas with the same orientation and shape and arranged in a staggered manner;

obtaining the distance between the planes of the same parts of the two comparison areas;

the method comprises the steps of obtaining the distance from the outermost side of a side wall to the lower end of the side wall in an orthographic projection view of the bottom of a target object in advance, wherein the outermost side of the side wall cannot be seen by the target object;

when the photographing equipment photographs the views with the target object, the lens of the photographing equipment is positioned above the bottom of the target object and is positioned above the bottom of the target object, and the distance from the outermost side of the side wall of the target object to the lower end of the side wall of the target object under the view is known in advance;

acquiring the image sizes of two comparison areas in the view;

acquiring the image size of a target object in the view;

obtain th formula in advance

Figure BDA0002246099070000031

Second formula

Figure BDA0002246099070000032

Third formula

Figure BDA0002246099070000033

Wherein l1The image size of the comparison area at the lower side in the view; l2The image size of the comparison area at the upper side in the view; l0The distance between the planes of the same parts of the two comparison areas; l is the physical size of the preset comparison area; l3The image size of the target object in the view; l4Is the initial object target size; d is the final object target size; h is the distance between the planes on the lower side in the same parts of the two comparison areas where the distances between the planes are acquired by the photographing equipment; h is0The distance from the outermost side of the side wall to the lower end of the side wall in the orthographic projection view of the bottom of the target object cannot be seen;

and substituting the corresponding parameters into the formula to calculate to obtain the final target size of the object.

The staggered arrangement means that different comparison areas are not overlapped in the direction of the comparison areas, and the comparison areas have a height difference.

The image size refers to the number statistics of the pixels occupied by the contour map of the corresponding object in the view in the size direction; for example, the image size of the comparison area in the view refers to the number of pixels occupied by the profile of the comparison area in the view in the length direction.

The object size obtaining method mainly adopts a projection ratio principle of projection geometry. By adopting the processing steps, the whole process is simple and convenient, and can be realized by using any photographing equipment; especially by the initial object target size l4The correction is carried out through the formula, and the accuracy of the corresponding object size obtained through measurement is higher.

Specifically, the comparison area is a plane graph or a three-dimensional structure.

More specifically, the comparison area is circular or rectangular; or; the comparison area is a sphere or a cuboid.

The invention also provides another object size obtaining method, wherein the object is a cuboid, a sphere, a cylinder, an ellipsoid, a quasi-cuboid, a quasi-sphere, a quasi-cylinder or a quasi-ellipsoid, and the method comprises the following steps:

acquiring the preset physical sizes of two comparison areas with the same orientation and shape and arranged in a staggered manner;

obtaining the distance between the planes of the same parts of the two comparison areas;

the ratio of the size with the same direction as the comparison area in the physical three-dimensional size of the target object to the size of the object is obtained in advance;

the method comprises the steps that at least views are obtained through photographing equipment, wherein the views comprise two complete comparison areas and target objects, when the photographing equipment photographs all the views, the positions of the target objects and the comparison areas are fixed, the lowest ends of the target objects are located on the planes of the two comparison areas, which are located at the lower sides of the two comparison areas and have the same distance between the planes, and the heights of lenses of the photographing equipment are approximately the same when photographing is carried out, when the photographing equipment photographs the views with the target objects, the lenses of the photographing equipment are located above the target objects, and the sizes of the target objects facing the lens direction are in the proportional relation of the at least two acquired sizes;

acquiring the image sizes of two comparison areas in the view;

acquiring the image size of a target object in the view;

obtain th formula in advance

Figure BDA0002246099070000041

Second formula

Figure BDA0002246099070000042

Third formulaWherein l1The image size of the comparison area at the lower side in the view; l2Image size in view for the contrast area on the upper side;l0The distance between the planes of the same parts of the two comparison areas; l is the physical size of the preset comparison area; l3The image size of the target object in the view; l is the physical size of the preset comparison area; l4Is the initial object target size; d is the final object target size; h is the distance between the planes on the lower side in the same parts of the two comparison areas where the distances between the planes are acquired by the photographing equipment; h is0The height of any tangent points of the light emitted by the photographing equipment for the target object and the outline of the target object from the projection plane of the target object, and h when the target object is a cuboid or a quasi-cuboid, or the target object is a cylinder or a quasi-cylinder and the photographing equipment photographs the view from the axial direction thereof0For the dimension of the object in the direction towards the photographing apparatus, in this case the formula

Figure BDA0002246099070000051

Is composed of

Figure BDA0002246099070000052

x is the ratio of the size of the target object facing the photographing equipment to the size of the object; h when the target object is a sphere, spheroid, ellipsoid or spheroid-like body, or the target object is a cylinder or cylinder-like body and the photographing apparatus radially photographs the view therefrom0 half of the size in the direction toward the photographing apparatus, this time the formula

Figure BDA0002246099070000053

Is composed of

Figure BDA0002246099070000054

x is the ratio of the size of the target object facing the photographing equipment to the size of the object;

and substituting the corresponding parameters into the formula to calculate to obtain the final target size of the object.

The staggered arrangement means that different comparison areas are not overlapped in the direction of the comparison areas, and the comparison areas have a height difference.

The image size refers to the number statistics of the pixels occupied by the contour map of the corresponding object in the view in the size direction; for example, the image size of the comparison area in the view refers to the number of pixels occupied by the profile of the comparison area in the view in the length direction.

The object size obtaining method mainly adopts a projection ratio principle of projection geometry. By adopting the processing steps, the whole process is simple and convenient, and can be realized by using any photographing equipment; especially by the initial object target size l4The accuracy of the corresponding object size obtained by measurement is higher by correcting through the formula, compared with the first schemes, the method is mainly applied to the estimation of the physical size of the object with a special shape.

Specifically, the comparison area is a plane graph or a three-dimensional structure.

More specifically, the comparison area is circular or rectangular; or; the comparison area is a sphere or a cuboid.

The invention also provides kinds of object size acquisition devices, wherein the bottom of the object can not be seen in at least orthographic projection views, and the device comprises:

an th obtaining unit, configured to obtain the preset physical sizes of two comparison areas that are the same in orientation and shape and are arranged in a staggered manner;

the second acquisition unit is used for acquiring the distance between the planes of the same parts of the two comparison areas;

a third acquisition unit configured to acquire in advance a distance from an outermost side of the side wall to a lower end thereof in an orthographic projection view in which the target object cannot see the bottom thereof;

the photographing device comprises a fourth acquisition unit, a second acquisition unit and a third acquisition unit, wherein the fourth acquisition unit is used for acquiring at least views through the photographing device, the views comprise two complete comparison areas and a target object, when the photographing device photographs all the views, the positions of the target object and the comparison areas are fixed, the lowest end of the target object is positioned on a plane where the two comparison areas are positioned on the lower side in the same position where the distance between the planes of the two comparison areas is acquired, the height of a lens of the photographing device is approximately the same when photographing is carried out each time, when the photographing device photographs the views with the target object, the lens is positioned above the bottom of the target object, and the distance from the outermost side of the side wall of the target object to the lower end of the side wall;

a fifth obtaining unit, configured to obtain image sizes of two comparison areas in the view;

a sixth acquisition unit configured to acquire an image size of a target object in the view;

a seventh obtaining unit for obtaining in advance the th formulaSecond formula

Figure BDA0002246099070000062

Third formula

Figure BDA0002246099070000063

Wherein l1The image size of the comparison area at the lower side in the view; l2The image size of the comparison area at the upper side in the view; l0The distance between the planes of the same parts of the two comparison areas; l is the physical size of the preset comparison area; l3The image size of the target object in the view; l4Is the initial object target size; d is the final object target size; h is the distance between the planes on the lower side in the same parts of the two comparison areas where the distances between the planes are acquired by the photographing equipment; h is0The distance from the outermost side of the side wall to the lower end of the side wall in the orthographic projection view of the bottom of the target object cannot be seen;

and , a processing unit for substituting the corresponding parameters into the above formula to calculate the final target size of the object.

The invention also provides another kinds of object size obtaining devices, wherein the object is a cuboid, a sphere, a cylinder, an ellipsoid, a quasi-cuboid, a quasi-sphere, a quasi-cylinder or a quasi-ellipsoid, and the device comprises:

the eighth acquiring unit is used for acquiring the preset physical sizes of the two comparison areas with the same orientation and shape and arranged in a staggered manner;

a ninth obtaining unit, configured to obtain a distance between planes where the same portions of the two comparison areas are located;

a tenth acquiring unit, configured to acquire in advance a proportional relationship between at least two of the physical three-dimensional sizes of the target object;

the photographing device comprises a tenth acquiring unit, a photographing device and a control unit, wherein the tenth acquiring unit is used for acquiring at least views through the photographing device, the views comprise two complete comparison areas and a target object, when the photographing device photographs all the views, the positions of the target object and the comparison areas are fixed, the lowest end of the target object is positioned on a plane where the two comparison areas are positioned on the lower side in the same position where the distance between the planes of the two comparison areas is acquired, the height of lenses of the photographing device is approximately the same when photographing is carried out each time, when the photographing device photographs the views with the target object, the lenses of the photographing device are positioned above the target object, and the size of the target object facing the lens direction is in the proportional relation of the acquired at least two sizes;

a twelfth acquiring unit, configured to acquire image sizes of two comparison areas in the view;

a thirteenth acquiring unit configured to acquire an image size of the target object in the view;

a fourteenth obtaining unit for obtaining in advance the th formula

Figure BDA0002246099070000081

Second formula

Figure BDA0002246099070000082

Third formula

Figure BDA0002246099070000083

Wherein l1The image size of the comparison area at the lower side in the view; l2The image size of the comparison area at the upper side in the view; l0The distance between the planes of the same parts of the two comparison areas; l is beforehandThe physical size of the set comparison region; l3The image size of the target object in the view; l is the physical size of the preset comparison area; l4Is the initial object target size; d is the final object target size; h is the distance between the planes on the lower side in the same parts of the two comparison areas where the distances between the planes are acquired by the photographing equipment; h is0The height of any tangent points of the light emitted by the photographing equipment for the target object and the outline of the target object from the projection plane of the target object, and h when the target object is a cuboid or a quasi-cuboid, or the target object is a cylinder or a quasi-cylinder and the photographing equipment photographs the view from the axial direction thereof0For the dimension of the object in the direction towards the photographing apparatus, in this case the formula

Figure BDA0002246099070000084

Is composed of

Figure BDA0002246099070000085

x is the ratio of the size of the target object facing the photographing equipment to the size of the object; h when the target object is a sphere, spheroid, ellipsoid or spheroid-like body, or the target object is a cylinder or cylinder-like body and the photographing apparatus radially photographs the view therefrom0 half of the size in the direction toward the photographing apparatus, this time the formula

Figure BDA0002246099070000086

Is composed of

Figure BDA0002246099070000087

x is the ratio of the size of the target object facing the photographing equipment to the size of the object;

and the second processing unit is used for substituting the corresponding parameters into the formula to calculate and obtain the final target size of the object.

The invention also provides computer devices, comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor when executing the computer program implements the food ripening size obtaining method as described above.

The present invention also provides computer-readable storage media storing or or more computer programs, which or or more computer programs are executable by or or more processors to implement the food ripening size acquisition method as described above.

The invention is further described with reference to the figures and the specific embodiments.

Drawings

Fig. 1 is a schematic flow chart of an object size acquisition method according to embodiment 1 of the present invention;

FIG. 2 is a schematic diagram illustrating the principle derivation of a calculation formula in the object size obtaining method according to embodiment 1 of the present invention;

fig. 3 is a schematic flow chart of an object size obtaining method according to embodiment 2 of the present invention;

fig. 4 is a schematic block diagram of an object size acquisition apparatus according to embodiment 3 of the present invention;

FIG. 5 is a schematic block diagram of an object size obtaining apparatus according to embodiment 4 of the present invention;

fig. 6 is a schematic structural diagram of 5 kinds of computer devices according to embodiment 5 of the present invention.

Detailed Description

In order to more fully understand the technical content of the present invention, the following description and illustration of the technical solution of the present invention is provided with reference to specific embodiments, but not limited thereto.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:反应堆探测器组件拆除装置机器视觉定位系统及定位方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!