如何在Matlab中将世界坐标转换为像素索引 [英] How to convert from world coordinates to pixel indices in Matlab

查看:240
本文介绍了如何在Matlab中将世界坐标转换为像素索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有512x512x313体积的dicom图像,并且有一个用世界坐标表示的点(57.7475 63.4184 83.1515),如何在Matlab中获取该世界坐标的相应像素坐标?

I have 512x512x313 volume of dicom images and i have a point represented in world coordinates say (57.7475 63.4184 83.1515), how could I get the corresponding pixel coordinate of that world coordinate in Matlab??

推荐答案

我讨厌破灭您的泡沫,但您要的是不可能的.我能想到的在现实世界中的坐标和像素坐标之间能够对应的唯一方法是校准用于捕获图像的相机.一旦知道了内在和外在参数,便有了一个转换矩阵,可以将现实世界的坐标映射到像素坐标.

I hate to burst your bubble, but what you are asking for is impossible. The only way that I can think of where you are able to get a correspondence between real-world co-ordinates and pixel co-ordinates is if you calibrate the camera that was used to capture the images. Once you know the intrinsic and extrinsic parameters, you then have a transformation matrix that can map real-world co-ordinates to pixel co-ordinates.

我假设您没有相机的校准信息,因此另一种方法是知道图像中的哪些像素映射到实际坐标.您将需要知道在真实世界和图像之间映射的那些点之间的点对应关系.一旦知道了这一点,便可以通过最小二乘法计算相机变换矩阵,然后使用该矩阵确定从现实世界到图像的点映射.

I'm assuming you don't have calibration information for your camera, and so an alternative approach would be knowing which pixels in your image map to which real-world co-ordinates. You would need to know point correspondences between those points that map between the real-world and to your image. Once you know this, you would then compute the camera transformation matrix through least-squares and then you would use this matrix to determine which points map from the real-world to your image.

除非您与每个现实世界坐标都有像素对应,否则您将无法完成自己要问的事情.

Unless you have pixel correspondences to each of your real-world co-ordinates, it is impossible to do what you're asking.

FWIW,如果您想查看有关如何获取转换矩阵的过程,请查看以下注释: http://www.peterhillman.org.uk/downloads/whitepapers/calibration.pdf .当我开始学习相机校准时,这对我来说是一个很好的起点.看一下第5节(第8页),因为我相信这是您正在寻找的....但是您将需要在真实坐标和图像之间建立对应关系.

FWIW, if you want to see the procedure on how to obtain the transformation matrix, check out these notes: http://www.peterhillman.org.uk/downloads/whitepapers/calibration.pdf. This was a great starting point for me when I started learning about camera calibration. Take a look at Section #5 (Page #8), as this is what I believe you are looking for.... but you will need to have correspondences between the real-world co-ordinates and your image.

祝你好运!

这篇关于如何在Matlab中将世界坐标转换为像素索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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