P2DingoCV.HotspotLogic.HotSpotDetectorSubclasses.VisualDetector

Classes

VisualDetector(cam, exitPath[, config])

Hotspot detector that outputs visual frames with component-level metrics.

class P2DingoCV.HotspotLogic.HotSpotDetectorSubclasses.VisualDetector.VisualDetector(cam, exitPath, config=None)[source]

Bases: P2DingoCV.HotspotLogic.HotspotDetector.HotspotDetector

Hotspot detector that outputs visual frames with component-level metrics.

Processes each frame from the camera, detects hotspots, computes metrics for each component, and saves both visual outputs and JSON results. Visual output is enabled, but verbose component logging may be limited compared to MaximumDetector.

Inherits from HotspotDetector and overrides the execute method.

Example usage:

detector = VisualDetector(camera, outputPath=”output_dir”, config=”config.json”) detector.execute()

Parameters:
execute()[source]

Run hotspot detection and generate visual outputs for all frames.

For each frame: 1. Reads the frame from the camera. 2. Resets frame-specific data. 3. Performs per-frame hotspot detection and calculates metrics per component. 4. Stores a dictionary per component with the following metrics:

  • lbl: Component label/index

  • hotspotScore: Overall hotspot score

  • componentTemp: Component temperature

  • centroid: Centroid coordinates of the component

  • deltaPScore: Delta P score

  • deltaPRobust: Robust delta P score

  • zScore: Z-score

  • zScoreNorm: Normalized Z-score

  • compactness: Shape compactness

  • aspectRatioNorm: Normalized aspect ratio

  • eccentricity: Component eccentricity

  • area: Component area

  1. Saves visual outputs to a timestamped folder for each frame.

  2. Appends frame results to the overall results list.

  3. Continues until no frames remain or the user presses ‘q’.

Output:
  • JSON file ‘hotspotOutput.json’ in the specified outputPath

  • Visual outputs per frame in timestamped subdirectories

Example

detector = VisualDetector(camera, outputPath=”output_dir”, config=”config.json”) detector.execute()