2013-04-08 137 views
1

我在Matlab中遇到了一些問題。 我正在努力嘗試使用這個參考:http://www.mathworks.com/help/vision/gs/object-detection-and-tracking.html 但是在最後一個Matlab版本中沒有名爲'transformPointsForward'的函數。 我可以替換它嗎? 塊,它在哪裏使用:在Matlab中替換函數'transformPointsForward'

boxPolygon = [1, 1;...       % top-left 
     size(boxImage, 2), 1;...     % top-right 
     size(boxImage, 2), size(boxImage, 1);... % bottom-right 
     1, size(boxImage, 1);...     % bottom-left 
     1, 1];     % top-left again to close the polygon 
    newBoxPolygon = transformPointsForward(tform, boxPolygon.Location); 
    figure; imshow(sceneImage); 

非常感謝!

+0

transformPointsFoward在2013a加入,據我所知。你有[圖像處理工具箱](http://www.mathworks.co.uk/products/image/)嗎?這是使用該功能所必需的。 – jam 2013-04-08 07:02:26

+0

糟糕!抱歉。我有Matlab 2012b。 – 2013-04-08 07:14:48

回答

4

transformPointsFoward僅在2013a之後可用。如果您使用的是舊版本,則您也可以從圖像處理工具箱中查看tformfwd

+0

如何在這種情況下使用它? – 2013-04-08 07:28:53

+0

那麼在2D情況下,它們非常相似。你叫'transformPointsFoward(tform,U)',其中U是一個2 * * n *矩陣。你只需要把它改成'tformfwd(tform,U)'。我認爲唯一的區別是你的由['maketform'](http://www.mathworks.co.uk/help/images/ref/maketform.html)構造的變換將使用2D表單。在頁面上有一個例子。 – jam 2013-04-08 07:40:17

+0

非常感謝您的幫助! – 2013-04-24 18:21:39