How to measure a cylinder average diameter using Matlab Image Processing?
3 次查看(过去 30 天)
显示 更早的评论
<<
<<
<<
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148469/image.png)
>>
>>
>>
Hi, I would like to measure average diameter of cylinders (Diamater 7-15") using matlab image processing. I am using a checkerboard and using a V shape jig so I can place the cylinder's center align with checkerboard plane. I calibrate my camera and capture the edges of the cylinder and get an average of each edge and calculate the diameter. Then I can rotate the cylinder and repeat the process. I have two problems: 1.No matter from what direction you look, the cylinder has the same diameter, but the checkerboard angle is different, resulting in different diameters. 2. I have ensured that the checkerboard and cylinder are level but when I get the boundaries in world coordinate, my cylinder is tilted, any idea why? I greatly appreciate it if you have any better ideas on how to measure the diameter of the cylinder (not by looking at it from the top). Thank You Ario
0 个评论
采纳的回答
Tim Jackman
2015-9-2
If I understand your first question correctly, the issue is that if you take images from different camera positions, the diameter is the same but the checkerboard you use for calibration changes perspective and this alters the computed diameter of the cylinder. If this is the case, you should be able to perform a projective transformation of each subsequent image to your "gold standard" image. You could use "cpselect" to manually select the control points, "fitgeotrans" to create the transformation matrix, and "imwarp" to transform the image into the desired reference field.
Another potential consideration would be to use a cylinder of known diameter for calibration in place of the checkerboard. You may have reasons to not use a cylindrical calibration object that I haven't thought of yet, but it may be worth considering.
Regarding question #2, what do you mean when you say the cylinder is tilted? Tilted in which direction and with respect to what?
更多回答(1 个)
Image Analyst
2015-9-2
Did you see the camera calibrator app: http://www.mathworks.com/products/computer-vision/features.html#camera-calibration
Also, unless your checkerboard is in the plane of the max diameter or you have parallel light rays, you'll have a magnification. For this reason, telecentric lenses are often used in caliper/gauging industrial applications.
Here's an excellent description:
and some others:
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for USB Webcams 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!