videosource

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2022 License: AGPL-3.0 Imports: 45 Imported by: 0

Documentation

Overview

Package videosource defines various image sources typically registered as cameras in the API.

Index

Constants

View Source
const (
	// Null is a default value for the merge method.
	Null = MergeMethodType("")
	// Naive is the naive merge method.
	Naive = MergeMethodType("naive")
	// ICP is the ICP merge method.
	ICP = MergeMethodType("icp")
)

Variables

This section is empty.

Functions

func Discover

func Discover(ctx context.Context, getDrivers func() []driver.Driver) (*pb.Webcams, error)

Discover webcam attributes.

func NewServerSource

func NewServerSource(ctx context.Context, cfg *ServerAttrs, logger golog.Logger) (camera.Camera, error)

NewServerSource creates the VideoSource that streams color/depth data from an external server at a given URL.

func NewWebcamSource

func NewWebcamSource(ctx context.Context, attrs *WebcamAttrs, logger golog.Logger) (camera.Camera, error)

NewWebcamSource returns a new source based on a webcam discovered from the given attributes.

Types

type CameraConfig

type CameraConfig struct {
	Label      string
	Status     driver.State
	Properties []prop.Media
}

CameraConfig is collection of configuration options for a camera.

type JoinAttrs

type JoinAttrs struct {
	*camera.AttrConfig
	TargetFrame   string   `json:"target_frame"`
	SourceCameras []string `json:"source_cameras"`
	MergeMethod   string   `json:"merge_method"`
	// Closeness defines how close 2 points should be together to be considered the same point when merged.
	Closeness float64 `json:"closeness_mm"`
}

JoinAttrs is the attribute struct for joinPointCloudSource.

type MergeMethodType

type MergeMethodType string

MergeMethodType Defines which strategy is used for merging.

type MergeMethodUnsupportedError

type MergeMethodUnsupportedError error

MergeMethodUnsupportedError is returned when the merge method is not supported.

type ServerAttrs

type ServerAttrs struct {
	*camera.AttrConfig
	URL string `json:"url"`
}

ServerAttrs is the attribute struct for serverSource.

type StaticSource

type StaticSource struct {
	ColorImg image.Image
	DepthImg image.Image
	Proj     transform.Projector
}

StaticSource is a fixed, stored image. Used primarily for testing.

func (*StaticSource) Close

func (ss *StaticSource) Close(ctx context.Context) error

Close does nothing.

func (*StaticSource) NextPointCloud

func (ss *StaticSource) NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)

NextPointCloud returns the point cloud from projecting the rgb and depth image using the intrinsic parameters.

func (*StaticSource) Read

func (ss *StaticSource) Read(ctx context.Context) (image.Image, func(), error)

Read returns the stored image.

type WebcamAttrs

type WebcamAttrs struct {
	*camera.AttrConfig
	Format      string `json:"format"`
	Path        string `json:"path"`
	PathPattern string `json:"path_pattern"`
	Width       int    `json:"width_px"`
	Height      int    `json:"height_px"`
}

WebcamAttrs is the attribute struct for webcams.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL