Avoid using repmat in CPD registration algorithm

1 回表示 (過去 30 日間)
Mark
Mark 2012 年 10 月 24 日
Hi all,
I'm running a coherent point drift (CPD) registration algorithm and I'm having trouble running it on large point clouds because I keep exceeding the maximum variable size. The line of code that is giving me trouble is:
G=repmat(x,[1 1 m])-permute(repmat(y,[1 1 n]),[3 2 1]);
The error message is:
??? Maximum variable size allowed by the program is exceeded.
Error in ==> repmat at 104
B = A(subs{:});
I'm wondering if anyone has any suggestions as how to avoid using repmat so I can run the code on large data sets.
Thanks!
  2 件のコメント
Matt J
Matt J 2012 年 10 月 24 日
Perhaps. What are the dimensions of x and y?
Mark
Mark 2012 年 10 月 24 日
編集済み: Mark 2012 年 10 月 24 日
I'm not exactly sure as there can be significant deviation in the point clouds. Let's say the largest X will be is 70000 x 3 and the largest Y will be is 4000 x 3.

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

採用された回答

Sean de Wolski
Sean de Wolski 2012 年 10 月 24 日
bsxfun should be able to handle that.
Also, rather than using permute use reshape, permute is slow for big things.
G = bsxfun(@minus,x,reshape(y',1,3,[]))
  1 件のコメント
Mark
Mark 2012 年 10 月 24 日
Thanks for the suggestion Sean. I'll try it out and let you know if it works!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by