-
Notifications
You must be signed in to change notification settings - Fork 110
/
camera_system.go
32 lines (26 loc) · 1.03 KB
/
camera_system.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package transform
import (
"image"
"github.com/golang/geo/r3"
"go.viam.com/rdk/pointcloud"
"go.viam.com/rdk/rimage"
)
// Aligner aligns a color and depth image together.
type Aligner interface {
AlignColorAndDepthImage(*rimage.Image, *rimage.DepthMap) (*rimage.Image, *rimage.DepthMap, error)
}
// Projector can transform a scene between a 2D Image and DepthMap and a 3D pointcloud.
type Projector interface {
// Project a 2D RGBD image to 3D pointcloud. Can add an optional crop to the image before projection.
RGBDToPointCloud(*rimage.Image, *rimage.DepthMap, ...image.Rectangle) (pointcloud.PointCloud, error)
// Project a 3D pointcloud to a 2D RGBD image.
PointCloudToRGBD(pointcloud.PointCloud) (*rimage.Image, *rimage.DepthMap, error)
// Project a single pixel point to a given depth.
ImagePointTo3DPoint(image.Point, rimage.Depth) (r3.Vector, error)
}
// A CameraSystem stores the system of camera models, the intrinsic parameters of each camera,
// and the distortion model.
type CameraSystem interface {
Projector
Distorter
}