MATLAB ヘルプ センター
直方体モデルのプロット
plot(model)
plot(model,'Parent',ax)
H = plot(___)
plot(model) は、現在の Figure の座標軸範囲内に直方体モデルをプロットします。
model
例
plot(model,'Parent',ax) は、指定した出力座標軸上に直方体モデルをプロットします。
ax
H = plot(___) はさらに、直方体モデルのプロット (Figure) を patch オブジェクトとして返します。
H
patch
すべて折りたたむ
関数 pcfitcuboid を使用して点群から直方体を検出します。この関数は直方体のパラメーターを cuboidModel オブジェクトとして格納します。
pcfitcuboid
cuboidModel
点群データをワークスペースに読み取ります。
ptCloud = pcread('highwayScene.pcd');
指定した関心領域 (ROI) 内の点群を検索します。検出された点のみを含む点群を作成します。
roi = [-30 30 -20 30 -8 13]; in = findPointsInROI(ptCloud,roi); ptCloudIn = select(ptCloud,in);
検出された点の点群をプロットします。
figure pcshow(ptCloudIn.Location) xlabel('X(m)') ylabel('Y(m)') zlabel('Z(m)') title('Detected Points in ROI')
点群の指定した ROI に含まれる点のインデックスを調べます。
roi = [9.6 13.8 7.9 9.3 -2.5 3]; sampleIndices = findPointsInROI(ptCloudIn,roi);
点群の指定した点集合に直方体を当てはめます。
model = pcfitcuboid(ptCloudIn,sampleIndices); figure pcshow(ptCloudIn.Location) xlabel('X(m)') ylabel('Y(m)') zlabel('Z(m)') title('Detect a Cuboid in a Point Cloud')
点群の直方体のボックスをプロットします。
hold on plot(model)
cuboidModel オブジェクトの内部プロパティを表示します。
model = cuboidModel with properties: Parameters: [11.4873 8.5997 -1.6138 3.6713 1.3220 1.7576 0 0 0.9999] Center: [11.4873 8.5997 -1.6138] Dimensions: [3.6713 1.3220 1.7576] Orientation: [0 0 0.9999]
直方体モデル。cuboidModel オブジェクトとして指定します。
gca
Axes
出力座標軸。直方体モデルを表示する Axes オブジェクトとして指定します。プロパティのリストについては、Axes のプロパティを参照してください。
patch オブジェクト。patch オブジェクトとして返されます。
R2020b で導入
getCornerPoints
findPointsInModel
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
ヨーロッパ
アジア太平洋地域
最寄りの営業オフィスへのお問い合わせ