Comments (16)
@oqilipo just in case if you need the full program to produce the exact issue that I have raised. Here I have attached it: Full program and data.zip.
from matgeom.
Are you still looking for a solution?
from matgeom.
Yes, I am.
from matgeom.
Hi @oqilipo!
I've been in contact with preethamam by mail;
I have just had a quick look at the problem, but could not dig very deep... If you have time to check it, you're welcome!
I think I can have a closer look on Friday.
from matgeom.
@preethamam
Can you upload the data or some example data?
from matgeom.
What does the variable 'axes' contain in your code snippet?
mat1 = eulerAnglesToRotation3d(deg,axes);
I extended the example of orientedBox3d a little bit. Maybe this helps:
clearvars; close all
[v, f] = sphereMesh;
phi=-360+720*rand;
theta=-360+720*rand;
psi=-360+720*rand;
angles = [phi, theta, psi];
rotMat = eulerAnglesToRotation3d(angles);
rotMat(1:3,4) = randi([-100,100],3,1);
pts = transformPoint3d(bsxfun(@times, v, randi([1,10],1,3)), rotMat);
box3d = orientedBox3d(pts);
figure; drawPoint3d(pts, '.'); hold on;
axis equal;
h = drawCuboid(box3d);
set(h, 'facecolor', 'none');
pts2 = transformPoint3d(pts, inv(createTranslation3d(box3d(1:3))*eulerAnglesToRotation3d(box3d(7:9))));
figure; drawPoint3d(pts2, '.'); hold on;
axis equal;
from matgeom.
@oqilipo, axes is 'ZYX'
. Here is the data: Data.zip. Please let me know if anything is required.
from matgeom.
Hi preethamam
Please provide the point cloud as MAT file stored in a simple array.
Thank you
from matgeom.
@oqilipo here is the data: Data.zip
from matgeom.
Maybe this is what you want to do?
clearvars; close all
load('Data.mat')
% Target points
pts3 = figure3_tgtLocation;
ell3d3 = equivalentEllipsoid(pts3);
% Source points
pts1 = figure1_srcLocation;
ell3d1 = equivalentEllipsoid(pts1);
% Transform source to target
TFM1to3 = ...
createTranslation3d(ell3d3(1:3))*eulerAnglesToRotation3d(ell3d3(7:9))*...
inv(createTranslation3d(ell3d1(1:3))*eulerAnglesToRotation3d(ell3d1(7:9)));
pts1to3 = transformPoint3d(pts1, TFM1to3);
figure('color','w');
drawPoint3d(pts3, '.b')
hold on
drawPoint3d(pts1to3, '.g');
axis equal
legend({'target';'source2target'})
from matgeom.
@oqilipo what was wrong with oriented box 3D? Could you please help me with how can it be done with oriented box 3D? Because I feel it is easier to visualize the orientation of the box than an ellipsoid.
from matgeom.
Hi there,
I played a bit with the data, and here are few thoughts:
- the 2D projections of the two point clouds are nearly square. Therefore, it may bevery likely that resulting bounding boxes differ by a 90 degree rotation around an axis close to the vertical. I suspect there is such a difference in the result of "orientedBox3d" for the two point clouds
- using equivalent ellipsoid may sometimes be more "robust", in the sense that it is less dependent on extreme values. In point cloud 2 ('target'), there is a point with very low z-coordinates. This induces a large difference in oriented box, with the effect is negligible with ellipsoid
- However, I agree that the example is easier to visualize using oriented box than ellipsoid...
- I tried the same approach as @oqilipo for computing "TFM1to3" , but using angles of oriented boxes instead. I got an unwanted rotation by 180 degrees, making the final boxes to overlap, but not the points...
It seems to be difficult to find a generic and robust way to register point clouds based on global features alone... Maybe a more global algorihtm such a Iterative Closest Point could by more effective in this case?
Best,
David
from matgeom.
Hello Everybody,
Thank you for the suggestions and answers!
The intention of using the oriented box 3D for source and target point clouds is to move them as much closer into the same coordinate reference. Then, later to use Iterative Closest Point to fine register them. This has two advantages, to help ICP and to create ground-truth orientations that can train deep learning-based models.
I used the code posted by @oqilipo and plotted the ellipsoids. Here is what I got:
Why are some points are outside after fitting an equivalent ellipsoid? Also, it was quite difficult to understand the orientations of the axes. Shouldn't they be almost parallel to the XYZ axes, as the point clouds are already?
When I plot the point clouds, I see they are already close to each other in this example.
Would you please let me know if there are any other robust ways to align the point clouds parallel to XYZ axes?
from matgeom.
You may use equivalentEllipsoid for the registration of the source to the target (this is a sufficient prealligment for an rICP) and afterwards you use orientedbox3d to create a transformation to align the data with the XYZ planes. However, the latter might not be necessary.
from matgeom.
But, why are some points are outside after fitting an equivalent ellipsoid? How to understand the orientations of the axes. Shouldn't they be almost parallel to the XYZ axes, as the point clouds are already?
from matgeom.
equivalentEllipsoid uses a PCA. See Wikipedia for more information.
from matgeom.
Related Issues (20)
- Documentation on how to cite the work HOT 6
- [Question/ Enhancement] Possibility to dilate a geometry? HOT 2
- Octave install warning about verLessThan.m HOT 4
- getting started on octave HOT 4
- Standardization of the header HOT 20
- Move graphs\grSimplifyBranches_old.m to deprecated\graphs ? HOT 1
- Bugs in intersectEdges.m HOT 2
- Delete changelog.txt(s) ? HOT 4
- Move data files to subfolder or data folder? HOT 1
- clipPolygon3dHP is not fully implemented HOT 6
- medialAxisConvex is not fully implemented
- Plotting a vector of circles only plots the final circle in the vector HOT 4
- Rename clipPolygonHP to clipPolygonByLine? HOT 1
- Missing functions in Contents.m HOT 1
- Missing polygons2d.m HOT 4
- Rename clipMeshVertices to cutMeshVertices?
- vertexNormal duplicate of meshVertexNormals? HOT 1
- Rename polyhedronSlice to intersectPlaneConvexPolyhedron?
- Matgeom - verLessThan: package "matlab" is not installed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matgeom.