物体尺寸测量 [英] Object dimension measurement

查看:57
本文介绍了物体尺寸测量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下图是一枚硬币(供参考)和一颗药丸.我需要测量药丸的尺寸.这些物体被逆向照亮.

我关注了

解决方案

只需对这两种形状进行快速手动测量,我就会得到20.51毫米和9.89毫米的药丸尺寸.如果您的实际药丸尺寸是19.33毫米和9.43毫米,则您的硬币不是24.97毫米,或者物体厚度有问题.我认为相机校准与此无关.

这是厚度如何在表观物体尺寸中起作用的方法:首先请注意,您正在获得物体的投影.目标是创建一个大小与对象大小匹配的投影.但是,这并不容易!有两个作用.请参考下图.

  1. 焦距.如果相机相对靠近物体,则物体的前部比物体的后部更靠近相机.当投影回到对象所在的屏幕上时,对象的阴影会更大.这是下面以"A"表示的效果.如果硬币比药丸薄,则药丸的投影比硬币要大.要解决此问题,请将相机放置在很远的地方,并使用长焦距的镜头.在线肖像摄影有很多例子,

    The following image is of a coin (for reference) and a pill. I need to measure the pill's dimensions. The objects are back-illuminated.

    I followed pyimagesearch.com tutorial for object height and width measurement.

    The coin has a diameter of 24.97 mm, and the actual dimensions of the pill are 9.43 mm x 19.33 mm. I am getting results with some error ranging from 0.5 mm to 2 mm. As mentioned on the website this is because of distortion and it is to be corrected.

    Can someone help me in calibrating the camera to remove the distortion effect so that I can measure correct dimensions in mm?

    I have also tried camera calibration but that is also not working.

    解决方案

    Just doing a quick manual measurement of these two shapes, I get pill sizes of 20.51 mm and 9.89 mm. If your actual pill sizes are 19.33 mm and 9.43 mm, then either your coin is not 24.97 mm, or you have a problem with object thickness. I don't think camera calibration has anything to do with this.

    This is how thickness plays a role in apparent object size: Note first that you are obtaining a projection of the object. The goal is to create a projection whose size matches the object's size. This is however not easy! There are two effects playing a role. Please refer to the figure below.

    1. Focal length. If the camera is relatively close to the object, the front of the object is closer to the camera than the back of the object. The shadow of the object will be larger when projected back onto the screen the object is lying on. This is the effect illustrated as "A" below. If the coin is thinner than the pill, the pill will have a relatively larger projection than the coin. To correct for this, put the camera very far away, and use a lens with a long focal length. There are many examples of this for portrait photography online, for example here. Noses look way larger if the lens has a short focal length, because with a short focal length you need to be close to the face to take the picture, and then the distance of the noise to the camera is much closer, relatively, than the cheeks.

    2. Oblique angle. This is case "B" below. A tick object, when photographed at an angle, will produce a much larger projection than one photographed straight on. Make sure your camera is straight above the object to measure. I would suggest you first take a photograph of the coin, remove the coin and place the pill, then take the photograph of the pill. Of course, the camera has to be fixed (tripod) and not touched at all (trigger cable).

    这篇关于物体尺寸测量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆