plot
説明
例
点群からの直方体の検出
関数 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
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]
入力引数
model
— 直方体モデル
cuboidModel
オブジェクト
直方体モデル。cuboidModel
オブジェクトとして指定します。
ax
— 出力座標軸
gca
(既定値) | Axes
オブジェクト
出力座標軸。直方体モデルを表示する Axes
オブジェクトとして指定します。プロパティのリストについては、Axes のプロパティを参照してください。
バージョン履歴
R2020b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)