Why I did not get the projection image like in the "Estimate camera projection" example from Matlab site?

3 ビュー (過去 30 日間)
L
L 2019 年 7 月 20 日
コメント済み: L 2020 年 2 月 13 日
What is the problem with my code, because I didn't get the projection image?
Thank you.
Here is the code:
ptCloud=pcread('out142.ply');
[validPtCloud,validIndices] = removeInvalidPoints(ptCloud);
worldPoints = validPtCloud.Location;
indices = 1:ptCloud.Count;
[y,z] = ind2sub([size(ptCloud.Location,1),size(ptCloud.Location,2)],indices);
imagePoints = [y(validIndices)' z(validIndices)'];
projImage = zeros(max(imagePoints(:,1)),max(imagePoints(:,2)),3);
rgb = validPtCloud.Color;
for j = 1:length(rgb)
projImage(imagePoints(j,1),imagePoints(j,2),:) = rgb(j,:);
end
figure
subplot(1,2,1)
pcshow(ptCloud)
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Point Cloud Data','Color',[1 1 1])
subplot(1,2,2)
imshow(uint8(projImage))
title('2-D Image Projection','Color',[1 1 1])

回答 (1 件)

yang zhang
yang zhang 2020 年 2 月 13 日
Have you solved it?

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by