- As per my understanding to calculate D1 and D2 Geometry PSNR in MATLAB, you need to calculate the Euclidean distance between corresponding points in the two point clouds for D1.
- For D2, fit planes to the point clouds and measure the perpendicular distance from each point to its corresponding plane. Then, calculate the mean squared error (MSE) between the original and reconstructed distances and use it to calculate the PSNR.
Calculating D1(point to point) and D2(point to plane) Geometry PSNR for point clouds in MATLAB
28 次查看(过去 30 天)
显示 更早的评论
I am working on the 3D point cloud. could you please guide me on how I can calculate D1(point to point) and D2(point to plane) Geometry PSNR in MATLAB
0 个评论
回答(1 个)
Maneet Kaur Bagga
2023-9-29
Hi Faranak,
Please refer to the code below to calculate D1:
% Number of points in clouds A and B
nA = 10;
nB = 15;
% Generating random coordinates for clouds
ptsA = randn(nA, 3) * 10;
ptsB = randn(nB, 3) * 5;
% Point Clouds A and B
ptCldA = pointCloud(ptsA);
ptCldB = pointCloud(ptsB);
% pcshow(ptCld1)
% Implementing D1 PSNR for point cloud A
D1_AB = 0;
for i = 1:nA
ptA = ptCldA.Location(i, :);
% Nearest point to the ith point A in point cloud B
[nearestPtB, ~] = findNearestNeighbors(ptCldB, ptA, 1);
% Square of l2 norm
d = norm(ptA - ptCldB.Location(nearestPtB, :)) ^ 2;
D1_AB = D1_AB + d;
end
D1_AB = D1_AB / nA;
disp(D1_AB);
Please refer to the following documentation for more information:
Point Cloud Processing
pointCloud function
findNearestNeighbors
Hope this helps!
Regards,
Maneet Bagga
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!