A C++ implementation of a bright spot detector.
- Detects bright spots in grayscale images (e.g., thermal/IR images)
- Configurable detection parameters
- Adjustable search ROI (region of interest)
- Returns all detected bounding boxes
- Based on OpenCV
- Works on Windows, Linux, macOS
- C++17 compiler (GCC 7+, Clang 5+, MSVC 2017+)
- OpenCV 4.x
- pkg-config (Linux/macOS)
- CMake 3.16+ (optional, for building with CMake)
macOS/Linux:
g++ -std=c++17 -Wall -Wextra -g3 main.cpp BrightSpotDetector.cpp -o detector `pkg-config --cflags --libs opencv4`Windows (MinGW/MSYS2):
g++ -std=c++17 -Wall -Wextra -g3 main.cpp BrightSpotDetector.cpp -o detector.exe `pkg-config --cflags --libs opencv4`- Place your image as test.png in the project root.
- Run the executable: macOS/Linux:
./detectorWindows (MinGW/MSYS2):
detector.exe| Parameter | Type | Default | Description |
|---|---|---|---|
crop_size_percent |
int | 28 | Percentage of image borders to exclude from search (0–49) |
erode_bbox |
int | 50 | Percentage to expand bbox for background brightness calculation |
min_brightness_factor |
float | 1.3 | Minimum brightness ratio to be considered a bright spot |
min_wh_percent |
float | 1.0 | Minimum object width/height as % of frame |
max_wh_percent |
int | 15 | Maximum object width/height as % of frame |
gaussian_sigma |
int | 10 | Gaussian penalty for distance from center |
This project is open-source and licensed under the MIT License. See the LICENSE file in the root repository for details.