フィルターのクリア

Original pixel position on undistorted image

1 回表示 (過去 30 日間)
Miguel Lopes
Miguel Lopes 2015 年 3 月 9 日
回答済み: Dima Lisin 2015 年 3 月 10 日
Hello,
I successfully calibrated a camera with matlab.
I undistorted the image using [newfoto, newOrigin] = undistortImage(origfoto,cameraParams);
But now, given a pixel in the origfoto (x1,y1) I wanted to know the position (x2, y2) of this pixel in the newfoto (undistorted). This newfoto has the same size as the oiginal, but some information is lost (due to distortion).
I thought the newOrigin vector would do the trick, but since the newfoto is of the same size as the origfoto, it gives the vector [0,0], so I don't think this newOrigin variable is what I need.
How can I do it??
I also tried to undistort a picture of the same size with only 1 non black pixel and the undistorted result was 4 non black pixels, so I'm guessing there is no exact position, but I need the approximate position!
Thanks!
  1 件のコメント
Miguel Lopes
Miguel Lopes 2015 年 3 月 9 日
So i managed to do this but in a real stupid way lol. Basically I create a foto with same size as the original one and only 1 white pixel in the position I want. Then I undistort the foto and find which pixel in the undistorted foto has the maximum value. This way is pretty accurate, but it's a really brute force way of doing this, so my question still stands! Thanks!

サインインしてコメントする。

回答 (1 件)

Dima Lisin
Dima Lisin 2015 年 3 月 10 日
Hi Miguel,
As of R2014b, there is a function called undistortPoints that does what you need.
The newOrigin output is only useful when you set 'OutputView' to 'full' or 'valid', because that returns an image of a different size from the original, and thus moves the origin of the image coordinates.

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by