Skip to content

Conversation

@Alpaca233
Copy link
Collaborator

  • search laser spot when it's out of range
  • new spot detection method (connected component)
  • fixes
    • apply Gaussian filter to both reference and measurement images
    • use Displacement Successful Window

Alpaca233 and others added 26 commits November 25, 2025 21:18
- Replace find_spot_location() with connected components algorithm using
  cv2.connectedComponentsWithStats() for improved robustness
- Add new CC parameters: cc_threshold, cc_min_area, cc_max_area, cc_row_tolerance
- Remove old line profile parameters and intensity profile RMSE check
- Update LaserAFConfig, UI widgets, and settings manager
- Simplify return signature to (x, y) tuple
- Add debug plot visualization for connected components detection
- Update tests for new implementation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ignore_row_tolerance parameter to _get_laser_spot_centroid() to
  disable row filtering during initialization when spot location is unknown
- Add piezo delay after each move in search loop to allow piezo to settle
  before attempting spot detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Save intermediate laser AF camera images when characterization_mode is enabled:
- Image after measurement (after search if triggered)
- Image used for cross-correlation verification

Images saved to /tmp/laser_af_{timestamp}_{step}.bmp

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove _3_after_restore debug image (already saved by acquisition)
- Fix failure_return_value type from np.array to float scalar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add self.debug_image for characterization mode (only set on successful detection)
- self.image always stores latest captured frame (for error debugging)
- Characterization mode saves (_1_measurement.bmp, _2_cc_verify.bmp) now use debug_image
- Fixes issue where trigger image was saved instead of successful detection image

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… displacement window

- Add cc_max_aspect_ratio parameter (default 2.5) to filter elongated shapes
- Change default filter_sigma from None to 1 (enable Gaussian blur)
- Rename displacement_success_window_um to displacement_success_window_pixels
- Set default displacement window to 300 pixels
- Update UI spinboxes for new parameters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add missing piezo delay after _move_z in move_to_target before CC verification
- Add missing if self.piezo check for calibration delay (line 219)
- Apply Gaussian filter to both reference and current crops in CC comparison
  when filter_sigma is configured

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changed spinbox key from displacement_success_window_um to
displacement_success_window_pixels to match the created spinbox name.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…cted peak

Previously, cross-correlation verification cropped around the detected spot
position, which allowed debris/contamination spots to pass the CC check if
their shape was consistent. Now we crop around the reference position, so
off-position spots will appear off-center in the crop, resulting in low
correlation and failing the check.

Also added warning log when detected spot is >20 pixels from reference,
indicating possible debris/contamination.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Alpaca233 Alpaca233 marked this pull request as draft January 24, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant