P2DingoCV.HotspotLogic.HotSpotDetectorSubclasses.MaximumDetector
Classes
|
Hotspot detector that outputs maximum information per frame. |
- class P2DingoCV.HotspotLogic.HotSpotDetectorSubclasses.MaximumDetector.MaximumDetector(cam, exitPath, config=None)[source]
Bases:
P2DingoCV.HotspotLogic.HotspotDetector.HotspotDetector
Hotspot detector that outputs maximum information per frame.
Processes each frame from the camera, detects hotspots, computes detailed metrics for each component, and saves both JSON results and visual outputs for every frame.
Inherits from HotspotDetector and overrides the execute method.
- Parameters:
exitPath (str)
config (str | None)
- execute()[source]
Run maximum-detail hotspot detection on all frames from the camera.
For each frame: 1. Reads the frame from the camera. 2. Resets frame-specific data. 3. Processes the frame to detect components and calculate metrics. 4. Stores detailed metrics per component in a JSON-compatible dictionary. 5. Saves visual outputs to a timestamped folder per frame. 6. Appends frame results to the overall results list. 7. Continues until no frames remain or user presses ‘q’.
- Metrics computed for each component include:
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
- Output:
JSON file ‘hotspotOutput.json’ in the specified outputPath
Visual outputs saved in timestamped subdirectories for each frame
Example
detector = MaximumDetector(camera, “output_dir”, “config.json”) detector.execute()