- Use the ‘pcdread’ function or any other appropriate method to read the original ‘.pcd’ file into MATLAB. This will give you a 3D matrix representing the point cloud data.
- Calculate the desired resolution for the channel image. In your case, you want to convert from [16, 1200, 5] to [64, 1856, 5]. Note the differences in the number of points along each dimension.
- Initialize a new matrix with the desired resolution using the zeros' function. For example, you can create an empty matrix of size [64, 1856, 5].
- Copy the original data from the loaded .pcd file into the corresponding positions in the new matrix. The dimensions that have a difference in resolution will have additional zeros.
- Use the ‘pcdwrite’ function or any other appropriate method to save the modified matrix as a ‘.pcd’ file.
How to Change .pcd file Resolution
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would Like to insert a varied amount of 0s depending on the .pcd file resolution in order to meet a certain condition. this means that a .pcd file with resolution [16, 1200, 5] can be converted/compatible with an algorithm that requires a .pcd input of [64, 1856, 5] resolution in terms of the channel image. How would I go about accomplishing this?
1 commentaire
Himanshu
le 22 Sep 2023
Hey,
I understand that you are trying to add zeroes to the .pcd files’ 3D matrix based on their resolution.
Follow the steps to add zeroes to .pcd files:
Réponses (1)
Milan Bansal
le 15 Nov 2023
Hi kevin harianto
It is my understanding that you want to convert the resolution of an organized point cloud which is initially in the format [16 1200 5] into a new resolution with the format [64 1856 5] to make it compatible with the algorithm.
This can be accomplished by converting the existing point cloud into unorganized point cloud using "removeInvalidPoints" function. The unorganized point can then be converted into the organized point cloud of desired format i.e. [64 1856 5] using "pcorganize" function. Set the lidar parameters in "pcorganize" as "lidarParameters('HDL64E', 1856)". Please refer to the below code snippet that illustrates the workflow.
% read the point cloud
pc = pcread("filename.pcd");
% convert to unorganized point cloud
pcUnorganized = removeInvalidPoints(pc);
% convert to organized point cloud
newPc = pcorganize(pcunorg,lidarParameters('HDL64E', 1856));
Please refer to the below documentation
- To learn more about "removeInvalidPoints" function.
- To learn more about "pcorganize" function.
Hope it helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Preprocessing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!