3D Bounding Boxの可視化がしたい

9 views (last 30 days)
尚輝 伊東
尚輝 伊東 on 6 Oct 2021
Commented: Kenta on 8 Oct 2021
Bounding Boxの可視化を3次元で行いたいです。
例えば、次のような8頂点の座標が与えられているとします。
[array([-35.89922945, 197.26166974, 17.43749083]),
array([-37.55457094, 88.89204521, 20.0512217 ]),
array([ 61.77622177, 97.12136408, 424.16114286]),
array([ 63.43156326, 205.49098861, 421.54741199]),
array([148.03557994, 84.95884208, -25.48700505]),
array([149.69092143, 193.32846662, -28.10073593]),
array([249.02171414, 201.55778549, 376.00918523]),
array([247.36637265, 93.18816096, 378.62291611])]
この時、それぞれの点を頂点とする直方体を3次元空間で可視化したいです。
Bounding Boxなので、点と点を線で結んだような枠組みのみの直方体を可視化したいです。
よろしくお願いします。
  2 Comments
尚輝 伊東
尚輝 伊東 on 8 Oct 2021
Ueno 様
ご回答ありがとうございます。
やはり今の条件だけでは厳しいようですね...
検討していただき、ありがとうございます。

Sign in to comment.

Accepted Answer

Kenta
Kenta on 6 Oct 2021
伊東さま、こんにちは、このようなイメージでしょうか?showshapeという関数で行えます。
またもう少しカスタマイズしたければ以下のファイルなどを参考に書き換えてみてもいいかもしれません。
https://jp.mathworks.com/matlabcentral/fileexchange/18264-minimal-bounding-box
pt=pcread('teapot.ply');
figure;pcshow(pt);hold on
pos = [0.3753 0 1.65 6 4 3 0 0 0];
showShape('cuboid',pos,'Color','green','Opacity',0.5)
  2 Comments
Kenta
Kenta on 8 Oct 2021
@尚輝 伊東 さま、ご連絡ありがとうございます。よかったです。
なるほど、これからどんどんカスタマイズされるのですね、スムーズに実装できるといいですね!

Sign in to comment.

More Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!