Converting coordinates (x,y) and radius (r) from pixels to mm using a calibrated camera intrinsic and extrinsic parameters
조회 수: 3 (최근 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에서 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!