cameraRecord Analysis

Capturing seed images from the Digit machine camera for quality analysis

The Record Analysis screen is the core image acquisition interface. It connects to the Digit machine's Basler camera and ESP32 controller to capture individual seed images as they pass along the conveyor belt. Captured images are stored in the current HDF5 analysis file along with extracted features (area, color, shape).

Prerequisites

  • A new or open analysis file (created from the Home screen).

  • The Basler camera connected via USB and recognized by the system.

  • The ESP32 controller connected via USB serial for belt, feeder, and light control.

  • Acquisition Settings configured (pixel-to-cm calibration, area bounds, belt speed).

Screen Layout

The screen is divided into two panels:

  • Left panel: Live camera feed with real-time seed detection overlay.

  • Right panel: Device controls, counters, and action buttons.

Step-by-Step Walkthrough

1. Verify Hardware Connection

When the screen loads, check the hardware status indicators:

  • Camera: The live feed area shows the camera stream when connected. If no camera is detected, a placeholder message appears.

  • ESP32: The device control switches (Light, Belt, Feeder) become active when the controller is connected.

circle-exclamation

2. Start the Camera

Click Start Camera to begin the live video stream. The application launches the Python camera script (run_camera_stream_basler) which:

  1. Connects to the Basler camera using the configured parameters.

  2. Streams frames to the display in real time.

  3. Applies seed detection using the calibrated area bounds and pixel-to-cm ratio.

3. Control the Hardware

Use the device control switches on the right panel:

Control
Description

Light

Toggles the LED illumination for consistent imaging conditions

Belt

Starts or stops the conveyor belt motor

Feeder

Activates the vibration feeder that dispenses seeds onto the belt

The Feeder Speed slider (0–255) controls the vibration intensity of the feeder. Adjust it to achieve a steady, single-file flow of seeds.

circle-info

For best results, adjust the feeder speed so that seeds arrive one at a time with space between them. Overlapping seeds may not be detected correctly.

4. Monitor Seed Detection

As seeds pass through the camera's field of view, the counters on the right panel update:

  • Seeds Detected: Total number of seeds captured in the current session.

  • Seed Area: Area of the most recently detected seed (in cm²).

  • Seed Count: Running count displayed as a badge.

A red alert indicator appears if the detection rate drops unexpectedly, which may indicate a feeder or belt issue.

5. Record Moka (Peaberry) Beans

If your sample contains Peaberry (Moka) beans that need separate recording:

  1. Toggle the Record Moka switch on the right panel.

  2. The application marks all subsequent captures with the Moka flag.

  3. Moka beans are stored with a separate index (switch_to_moka) in the HDF5 file.

  4. Toggle the switch off when you return to regular bean recording.

circle-info

Moka beans have distinct density characteristics. Recording them separately ensures accurate weight estimation using dedicated density parameters.

6. Live Analysis Mode (Optional)

If you have configured rules on the Live Analysis screen, the Record screen can perform real-time classification during recording:

  • Model Mounting Status: Shows whether an ONNX model is loaded and ready.

  • Rejection Rules: Class-based or feature-based rules trigger actions in real time.

  • Stop Machine: If a rule's stop condition is met, the belt and feeder are halted automatically.

  • Eject: If ejection is configured, the solenoid activates to remove defective seeds.

7. Stop Recording

Click Stop Camera to end the recording session. The application:

  1. Stops the camera stream and hardware.

  2. Saves all captured data to the HDF5 file.

  3. Records the session duration to the working hours counter.

  4. Unlocks the sidebar for navigation.

A confirmation dialog appears asking whether you want to proceed to AI Classification to analyze the recorded images.

Working Hours Tracking

The application automatically tracks recording time. When you start the camera, a timer begins. When you stop, the elapsed time is added to the cumulative working hours counter visible on the Home screen.

Configuration Persistence

The Record Moka toggle state and PFS (Phenotyping Feature Set) path are persisted in the Electron Store, so your preferences are restored when you return to this screen.

Troubleshooting

Issue
Possible Cause
Solution

Camera feed shows no image

Camera not connected or in use by another application

Check USB connection; close any other camera software

Seeds not being detected

Area bounds too narrow or pixel calibration incorrect

Adjust min/max area and pixel2cm in Acquisition Settings

Belt or feeder not responding

ESP32 not connected or serial port busy

Check USB serial connection; restart the ESP32

Red alert appears frequently

Seeds overlapping or feeder speed too high

Reduce feeder speed for single-file seed flow

"No model mounted" warning

ONNX model not loaded for live analysis

Select a model on the AI Classification screen first

Last updated