detect command processes a directory of images, isolates objects that match a target color using HSV-space segmentation, and extracts geometric features for each detected contour.
Syntax
Options
Directory containing the input images to process. Short alias:
-i.Write results to this directory instead of creating a session (legacy mode). Short alias:
-o.When this flag is set, no session is created and the features.csv file is written to the parent of this directory.Create or resume a named session. Short alias:
-s.When provided, results are stored under the centralized session directory using the given name. If neither --session nor --output-dir is set, a session is created automatically using the input directory name.Target color for segmentation in hexadecimal format. Short alias:
-c.Objects whose dominant color falls within the HSV range derived from this hex value are selected as detections.Minimum contour area in pixels. Contours smaller than this value are discarded.
Maximum contour area in pixels. Contours larger than this value are discarded.
Output files
The command produces two categories of output:| File | Description |
|---|---|
features.csv | One row per detected object with columns: image_filename, contour_index, area, perimeter, centroid_x, centroid_y, circularity, aspect_ratio, solidity, extent |
<image>/01_hsv.png | HSV-converted source image (saved when save_intermediate=True) |
<image>/02_mask_initial.png | Raw color mask before morphological operations |
<image>/03_mask_closed.png | Mask after MORPH_CLOSE |
<image>/04_mask_morph_final.png | Mask after MORPH_OPEN |
<image>/05_raw_contours.png | All raw contours before area filtering (red outlines) |
<image>/06_filtered_contours_final.png | Contours that passed the area filter (green outlines) |
Session vs. legacy output mode
- Session mode (recommended)
- Legacy mode
Omit Session output layout:
--output-dir to use session-based storage. A session directory is created automatically under the centralized storage location, or you can name it explicitly with --session.