CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu...

39
CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept, , Turkey

Transcript of CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu...

Page 1: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

CENG 789 – Digital Geometry Processing

06- Rigid-Body Alignment

Asst. Prof. Yusuf Sahillioğlu

Computer Eng. Dept, , Turkey

Page 2: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid vs. Non-rigid2 / 39

Rigid shapes Non-rigid shape(Differ by rigid vs. (Differ by non-rigid transformatnstransformations = rigid + bending)= rotation & translation)

Page 3: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid vs. Non-rigid3 / 39

Rigid shapes Non-rigid shape(Easier to align/register vs. (Harder to align/registerdue to low degree- due to high DOF)of-freedom)

Page 4: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid vs. Non-rigid4 / 39

Rigid shapes Non-rigid shape(Main app: 3D scan registration) vs. (Main apps: shape completion &

attribute transfer via shape correspondence)

Page 5: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment5 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes.

Page 6: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment6 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Translation disambiguation handled by moving centers to the

origin.

Page 7: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment7 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

PCA on covariance matrix C that encodes variances between x,y,z coordinate pairs of all n shape points.

Page 8: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment8 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

PCA on covariance matrix C that encodes variances between x,y,z coordinate pairs of all n shape points.

Eigenvectors of C provide principal axes/directions (of variations) of the shape, which are then aligned w/ the standard Euclidean axes.

Same alignment is applied to the 2nd shape.

Page 9: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment9 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

Align principal axes w/ the standard Euclidean axes; e.g., align w/ y-axis.

Page 10: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment10 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

Align principal axes w/ the standard Euclidean axes; e.g., align w/ y-axis.

Page 11: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment11 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

Align principal axes w/ the standard Euclidean axes; e.g., align w/ y-axis.

Page 12: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment12 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

Align principal axes w/ the standard Euclidean axes; e.g., align w/ y-axis.

Blue (zAngle) and dark (xAngle) angles?

Page 13: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment13 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

Align principal axes w/ the standard Euclidean axes; e.g., align w/ y-axis.

Blue (zAngle) and dark (xAngle) angles?

Page 14: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment14 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

Align principal axes w/ the standard Euclidean axes; e.g., align w/ y-axis.

This was cool; but not exactly solving our alignment problem It rather moves object from one position to another within a single reference

frame. In our case we want switching coordinates from one system (principles) to

another (Euclidean); like this: Tables, chairs, and other furniture is defined in a local (modeling) coordinate

system. They can be placed into a room, defined in another coordinate system, by

transforming furniture (modeling) coordinates to room (world) coordinates.

Page 15: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment15 / 39

We will do rigid-body alignment this lecture. Easier scenario: Alignment of 2 complete shapes. Rotation disambiguation handled by PCA.

Align principal axes w/ the standard Euclidean axes; e.g., align w/ y-axis.

Switching coordinates from one system (principles) to another (Euclidean).

Page 16: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment16 / 39

We will do rigid-body alignment this lecture. Harder scenario: Alignment of 2 partial shapes. PCA-based solution is a global approach.

Based on variations on coordinates. Two shapes that partial overlapping will have different variations;

PCA fails.

Page 17: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment17 / 39

We will do rigid-body alignment this lecture. Harder scenario: Alignment of 2 partial shapes. Partial shapes arise frequently in life: 3D scans. Handle them using

Direct rotation computation (when map b/w 2 shapes known). Iterative Closest Point algorithm (when map unknown). RANSAC (when map unknown).

Page 18: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment18 / 39

If map/correspondences are known, we can derive rotation and translation that aligns the 1st shape with the 2nd.

Page 19: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment19 / 39

If map/correspondences are known, we can derive rotation and translation that aligns the 1st shape with the 2nd.

Page 20: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment20 / 39

If map/correspondences are known, we can derive rotation and translation that aligns the 1st shape with the 2nd.

Do energy functional minimization using matrix algebra. Take the derivative of E(x) w.r.t. x and search for its roots.

Page 21: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment21 / 39

Translation.

Page 22: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment22 / 39

Rotation.

Recall SVD:

Page 23: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment23 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown). Assume closest points correspond. Compute the rotation and translation based on this

correspondence/map.

Update coordinates and re-compute closest-point correspondences. Re-compute rotation and translation based on this map. Repeat.

Page 24: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment24 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Original ICP paper (Besl & McKay, A Method for Registration of 3-D Shapes, PAMI, 1992) uses closed-form solution to compute the rotations (unlike our least-squares solution in prev. slides).

Converges if starting point is close enough.

For efficiency, you can do sampling on point sets. Also, use k-d trees.

For accuracy, you can replace your matching criteria (point to plane).

Page 25: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment25 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Resulting ICP session; pretty robust:

Page 26: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment26 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Basic ICP algo; again:

Page 27: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment27 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Better correspondence estimation via feature points.

Page 28: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment28 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Better correspondence estimation via feature points. Goal is to identify when 2 points on different scans represent

the same feature. If this is done perfectly, you do not need to iterate (ICP). You

just compute rotations and translations in one shot.

Page 29: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment29 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Better correspondence estimation via feature points. Goal is to identify when 2 points on different scans represent

the same feature. Hint: Are the surroundings similar?

Page 30: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment30 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Better correspondence estimation via feature points. Goal is to identify when 2 points on different scans represent

the same feature. Hint: Are the surroundings similar? Recall rotation-invariant shape histograms descriptor.

Page 31: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment31 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Better correspondence estimation via feature points. Goal is to identify when 2 points on different scans represent

the same feature. Hint: Are the surroundings similar? Lots of descriptors defined over the years.

Page 32: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment32 / 39

Iterative Closest Point algorithm (when map b/w 2 shapes unknown).

Better correspondence estimation via feature points. Goal is to identify when 2 points on different scans represent

the same feature. Hint: Are the surroundings similar? One of my favorites: shape diameter function (for non-rigid

case).

Page 33: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment33 / 39

RANSAC (when map b/w 2 shapes unknown). ICP only needs 3 point pairs to define a rotation in 3D. RANSAC algo.

Pick a random pair of 3 points on 2 shapes. Estimate alignment (compute rotation translation) in the least-

squares sense. Check for the error of this alignment (e.g. sum of distnces b/w

matching pnts).

Page 34: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment34 / 39

RANSAC (when map b/w 2 shapes unknown). ICP only needs 3 point pairs to define a rotation in 3D. RANSAC algo.

Pick a random pair of 3 points on 2 shapes. Estimate alignment (compute rotation translation) in the least-

squares sense. Check for the error of this alignment (e.g. sum of distnces b/w

matching pnts).

Page 35: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment35 / 39

RANSAC (when map b/w 2 shapes unknown). ICP only needs 3 point pairs to define a rotation in 3D. RANSAC algo.

Pick a random pair of 3 points on 2 shapes. Estimate alignment (compute rotation translation) in the least-

squares sense. Check for the error of this alignment (e.g. sum of distnces b/w

matching pnts).

Page 36: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment36 / 39

RANSAC (when map b/w 2 shapes unknown). ICP only needs 3 point pairs to define a rotation in 3D. RANSAC algo.

Pick a random pair of 3 points on 2 shapes. Estimate alignment (compute rotation translation) in the least-

squares sense. Check for the error of this alignment (e.g. sum of distnces b/w

matching pnts).

Page 37: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment37 / 39

RANSAC (when map b/w 2 shapes unknown). ICP only needs 3 point pairs to define a rotation in 3D. RANSAC algo.

Pick a random pair of 3 points on 2 shapes. Estimate alignment (compute rotation translation) in the least-

squares sense. Check for the error of this alignment (e.g. sum of distnces b/w

matching pnts).

Random picks donot have to be exact.

Page 38: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment38 / 39

RANSAC (when map b/w 2 shapes unknown). ICP only needs 3 point pairs to define a rotation in 3D. Resulting RANSAC session:

Page 39: CENG 789 – Digital Geometry Processing 06- Rigid-Body Alignment Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.

Rigid Alignment39 / 39

RANSAC (when map b/w 2 shapes unknown). ICP only needs 3 point pairs to define a rotation in 3D. Resulting RANSAC session: