Hi guys, I'm currently working on pointclouds generated from LiDAR sensors. My goal is to detect the object and draw a bounding box around it.
I can calculate the coordinates of the corner points of the bounding box. However, I do not know how can I draw the bounding box dynamically into the pcplayer view that I'm visualizing my pointcloud.
How can I visualize both my pointcloud and also draw the bounding box dynamically on the same view?
Thanks in advance.
This is my code :
veloReader = velodyneFileReader('%pathtomypcapfile%','VLP16');
duration = 150; % seconds %
xlimits = [-60 60];
ylimits = [-60 60];
zlimits = [-5 50];
player = pcplayer(xlimits,ylimits,zlimits);
xlabel(player.Axes,'X (m)');
ylabel(player.Axes,'Y (m)');
zlabel(player.Axes,'Z (m)');
veloReader.CurrentTime = veloReader.StartTime + seconds(0.3);
while(hasFrame(veloReader) && player.isOpen() && (veloReader.CurrentTime < veloReader.StartTime + seconds(duration)))
ptCloud = readFrame(veloReader);
cornerpoints = myFunctionToCalculateBoundingBox(ptCloud);
view(player,ptCloud.Location,ptCloud.Intensity);
pause(0.05);
end
and myFunctionToCalculateBoundingBox returns points as 8x3 matrix :
>> cornerpoints
cornerpoints =
0.9205 25.9202 5.9978
0.9655 7.6629 0.1411
0.2301 7.6634 0.1338
0.1852 25.9207 5.9905
0.9206 25.9228 5.9896
0.9656 7.6655 0.1329
0.2302 7.6660 0.1256
0.1853 25.9233 5.9823

댓글 수: 5

Bram Surewaard
Bram Surewaard 2020년 12월 15일
Hey Mert,
I am looking for the same thing as you and I was wondering if you where able to find a solution?
Thanks!
Mert Saracoglu
Mert Saracoglu 2020년 12월 15일
Hey,
the solution is to use showShape function.
Check out this page : https://www.mathworks.com/help/vision/ref/showshape.html
Pavan Kumar B N
Pavan Kumar B N 2021년 5월 25일
편집: Pavan Kumar B N 2021년 6월 18일
@Mert Saracoglu Could you please share some details, how you achieved it?
view(player,ptCloud);
showShape('cuboid',cuboidPosition, ...
'Parent',player.Axes, ...
'Color','red', ...
'Opacity',0.10)
drawnow
Where,
cuboidPosition = [center_x center_y center_z length_x length_y length_z]
I think you can achieve the same thing by tweaking this code snippet.
Pavan Kumar B N
Pavan Kumar B N 2021년 6월 16일
편집: Pavan Kumar B N 2021년 6월 20일
@Mert Saracoglu Thank you for sharing!! I am also working on lidar-based object detection and tracking. Could you please provide details/source that how you have achieved? Thank you very much!!

댓글을 달려면 로그인하십시오.

답변 (1개)

Aditya Patil
Aditya Patil 2020년 9월 24일
편집: Aditya Patil 2020년 9월 24일

0 개 추천

In R2020b, we have released the Lidar labeler app that will allow you to visualize and label Lidar datasets. You can Get Started with the Lidar Labeler documentation.

카테고리

도움말 센터File Exchange에서 Specialized Messages에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2020년 9월 16일

편집:

2021년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by