3.4 The hierarchy of transformations#

Isometry#

Similar#

Affine#

3D Projective transformation#


3D Projective transformation은 2.4절에서 설명한 2D Projective transformation과 유사한 개념이다.
3D 공간에 대한 이동이 뒤따르는 선형 정칙 변환이다.

사영 변환은 불변량으로 평행성을 가지지 않는다. 따라서 사영 변환 이후에 평행성이 보장되지 않는다.

Example - 3D Projective transformation#

import open3d as o3d
import matplotlib.pyplot as plt
Jupyter environment detected. Enabling Open3D WebVisualizer.
[Open3D INFO] WebRTC GUI backend enabled.
[Open3D INFO] WebRTCWindowSystem: HTTP handshake server disabled.

Read Image

print("Read Redwood dataset")
redwood_rgbd = o3d.data.SampleRedwoodRGBDImages()
color_raw = o3d.io.read_image(redwood_rgbd.color_paths[0])
depth_raw = o3d.io.read_image(redwood_rgbd.depth_paths[0])
rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
    color_raw, depth_raw)
print(rgbd_image)
Read Redwood dataset
RGBDImage of size 
Color image : 640x480, with 1 channels.
Depth image : 640x480, with 1 channels.
Use numpy.asarray to access buffer data.

Visualize Original 3D image (point cloud)

pcd = o3d.geometry.PointCloud.create_from_rgbd_image(
    rgbd_image,
    o3d.camera.PinholeCameraIntrinsic(
        o3d.camera.PinholeCameraIntrinsicParameters.PrimeSenseDefault))
# Flip it, otherwise the pointcloud will be upside down
pcd.transform([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]])

o3d.visualization.draw_geometries([pcd])

Original Image :

Apply projective transformation

pcd.transform([[0.9, -0.25, 0.15, 0], [0.35, 1.3, -0.3, 0], [0.15, 0, 0.7, 0], [0, 0, 0, 1]])

o3d.visualization.draw_geometries([pcd])

3D projective transformed Image :