Skip to contents

Bridges 2D foundational segmentation models (SAM 2.1 / SAM 3.1) with 3D Gaussian Splatting. Projects 2D leaf or organ masks from photos onto 3D Gaussians via ray-splat correspondence, updating semantic class IDs and confidence scores in the 3D cloud.

Usage

gs_segment_sam(splat, camera, mask, class_id = 1, threshold = 0.05)

Arguments

splat

A gaussian_splat object.

camera

Camera list corresponding to the viewpoint of the photo.

mask

2D binary matrix or an Image object returned by image_segment_dl() where 1 represents the target leaf.

class_id

Integer. Semantic class ID to assign (e.g. 1 for leaf, 2 for stem). Defaults to 1.

threshold

Double. Minimum confidence score to accept semantic label. Defaults to 0.05.

Value

An updated gaussian_splat object with assigned 3D semantic classes.