NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Measure Anything: Real-time, Multi-stage Vision-based Dimensional Measurement using Segment Anything

Yongkyu Lee, Shivam Kumar Panda, Wei Wang, Mohammad Khalid JawedarXiv 2024 · OpenReview

TL;DR

This paper introduces "Measure Anything," a novel vision-based framework that leverages the powerful Segment Anything Model (SAM) to accurately measure the dimensions (diameter, length, volume) of objects, particularly those with circular cross-sections. The system offers both interactive and automated prompting for segmentation, making it versatile for applications ranging from precision agriculture to robotic grasping.

What Problem Does This Paper Address?

Accurately measuring object dimensions from images is crucial for many applications, including precision agriculture (e.g., plant health monitoring), manufacturing quality control, and robotic manipulation. However, existing methods often struggle with cluttered environments, complex object geometries, and the need for precise segmentation. The challenge lies in reliably identifying objects, extracting their precise boundaries, and then transforming 2D image data into accurate 3D measurements, especially for thin, non-uniform objects like plant stems.

Methods

"Measure Anything" employs a multi-stage pipeline built upon the Segment Anything Model (SAM). The core steps are:

  1. Promptable Image Segmentation with SAM: The framework utilizes SAM's zero-shot generalization capabilities to segment target objects. It supports two prompting methods:
  2. Interactive: Users provide positive/negative point prompts directly on the image.
  3. Automated: A keypoint detection model (YOLOv8) automatically identifies points to guide SAM, enabling high scalability.
  4. Binary Mask Processing: Raw SAM masks are refined to remove noise, small disconnected components, and smooth contours, ensuring a cleaner input for subsequent steps.
  5. Skeleton Construction: This is a critical step tailored to object geometry:
  6. Rod-like Geometries: Standard skeletonization techniques are applied, followed by pruning, augmentation, and reordering to create an ordered skeleton that captures local slope information.
  7. General Geometries: Principal Component Analysis (PCA) is used to identify the object's axis of symmetry, guiding the skeleton construction.
  8. Line Segment and Depth Identification: Perpendicular line segments are identified along the skeleton. The algorithm searches outwards from skeleton pixels to the object's contour to find endpoints and retrieves their depth values, crucial for handling missing depth data at edges.
  9. 2D-3D Transform and Measurement: Using camera intrinsics and the identified 3D points, the system calculates diameter, length (by summing segment lengths), and volume (using a cone approximation for partial volumes between segments).

Datasets

  • Canola Stems: The framework was validated on images of Canola stems collected from agricultural fields. This dataset is noted as being challenging due to the thin and non-uniform nature of the stems.
  • Clubs Dataset: Used to demonstrate the application in robotic grasping, this dataset features cluttered images of common household objects.

The paper does not explicitly mention a newly introduced benchmark dataset for training or evaluation beyond these application-specific examples.

Key Insights and Ideas

  • SAM as a Foundation for Measurement: The paper highlights SAM's potential beyond simple segmentation, demonstrating its utility as a robust foundation for geometric measurement tasks, even with minimal or no task-specific training data.
  • Automated Prompting for Scalability: Integrating a keypoint detection model (YOLOv8) for automated prompting significantly enhances the framework's scalability for high-throughput applications like agricultural monitoring.
  • Geometry-Aware Skeletonization: The distinct skeleton construction approaches for rod-like vs. general geometries are key to accurately capturing the object's structure and enabling precise measurements.
  • Iterative Depth Retrieval: The method for simultaneously identifying line segments and retrieving depth values is crucial for overcoming depth map limitations, especially at object edges.
  • Versatility Beyond Measurement: The extracted geometric features are shown to be directly applicable to downstream tasks like robotic grasping, demonstrating the framework's broader utility.

Key Results

  • Canola Stem Diameter Measurement: The framework successfully estimated diameters of Canola stems, a task challenging for existing methods.
  • Length and Volume Consistency: For a wine bottle example, length and volume measurements showed consistency within ±10% of ground truth values across different camera positions.
  • Robotic Grasping: The framework successfully identified optimal grasp points on objects in cluttered scenes from the Clubs dataset, with the stability model prioritizing segments at concave surfaces and closer to the center of gravity.
  • YOLOv8 Performance: The keypoint detection model achieved an average mAP-95 score of 83.5% for Canola stem detection.

Limitations and Future Work

  • Occlusions and Shape Priors: The current segmentation model can be affected by occlusions. Future work aims to incorporate shape priors to improve robustness in such scenarios.
  • Circular Cross-Sections: The current pipeline is primarily designed for objects with circular cross-sections. Future iterations will integrate models to identify object types and handle non-circular shapes.
  • Deep Learning Grasping Integration: The authors plan to integrate "Measure Anything" with a deep learning grasping model to compare performance.
  • Language Model Integration: Exploring the integration of language models to enable obtaining dimensional measurements through natural language queries is a future direction.

Summary updated

BibTeX
@misc{lee2024measure,
  author = {Yongkyu Lee and Shivam Kumar Panda and Wei Wang and Mohammad Khalid Jawed},
  title = {{Measure Anything: Real-time, Multi-stage Vision-based Dimensional Measurement using Segment Anything}},
  year = {2024},
  eprint = {2412.03472},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.03472},
}
Figure