Converting coordinates (x,y) and radius (r) from pixels to mm using a calibrated camera intrinsic and extrinsic parameters
10 次查看(过去 30 天)
显示 更早的评论
Hi,
I've got a series of coordinates (x,y) and radii that are represent the position and radius of circles in an image. The coordinates and radii are both measured in pixels but I'm looking to convert them to mm so I can extract information from it.
I've calibrated the camera that captures these images using the computer vision toolbox, this was so that I could correct for distortion in the image. This generated the intrinsic and extrinsic parameters for the camera.
I've tried to use the funtion 'pointsToWorld' to convert the coordinates from pixels to mm, however the results are wrong and I can't understand why.
I'm wondering if anyone knows of a differnet way to convert from pixels to mm, specifically using the intrinsic and extrinsic parameters.
I'm aware that I could calculate the spatial calibraiton factor a different way, however can this also be calucalted directly from the intrinsic and extrinsic parameters?
Any help would be much appriciated.
0 个评论
回答(1 个)
Simon Allosserie
2021-3-2
You can obtain the dpi of your image from the imfinfo structure
dpi = imfinfo(filepath).XResolution %analogous for YResolution
And then using the knowledge that 1 inch = 25.4 mm to calculate the pixel size
pix = 25.4/dpi %pixel size in mm
So if a radius is e.g. 10 pixels, then you know it's dimensions in mm are 10*pix mm.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Camera Calibration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!