Skip to content

Feature/optimizations#5

Merged
DayUx merged 12 commits intomasterfrom
feature/Optimizations
Nov 11, 2025
Merged

Feature/optimizations#5
DayUx merged 12 commits intomasterfrom
feature/Optimizations

Conversation

@DayUx
Copy link
Member

@DayUx DayUx commented Nov 11, 2025

This pull request focuses on improving code clarity, performance, and safety in the image processing and impact detection modules. The main changes include better use of const and constexpr for variables, more efficient memory management, and safer mathematical operations. Additionally, there are refactorings to simplify logic and enhance code readability, especially in contour and ellipse processing.

Image and contour processing improvements:

  • Refactored contour and ellipse calculations in image_processing.cpp to use constexpr for constants, avoid unnecessary allocations, and improve angle and area checks for contour validation. Mathematical operations now use squared magnitudes for efficiency and safety, and memory reuse is implemented for temporary vectors. [1] [2]
  • Enhanced ellipse retrieval by using std::max_element for finding the largest contour and introducing an emptyEllipse variable for clearer fallback logic. All timing variables are now const, and the code is more robust against empty input.

Impact detection and drawing optimizations:

  • Refactored impact point calculations to use squared distances for performance, improved variable scoping with const, and replaced manual string construction with more efficient approaches. Drawing logic is now clearer and uses precomputed values for better maintainability.
  • Updated impact detection workflow to use const for results and intermediate variables, ensuring immutability and safer code.

General codebase improvements:

  • Removed unused includes from sheet_detection.cpp and standardized variable initialization and memory management practices throughout the file.
  • Improved sheet coordinate detection by using preallocated vectors, clearer variable naming, and consistent use of const for timing and mask variables. The function now throws more informative errors and logs processing time in a standardized way.

DayUx added 12 commits November 10, 2025 10:43
- Updated CMake configuration to append architecture suffix to .NET assembly outputs.
- Enhanced GitHub Actions workflow with matrix builds for x64 and x86 architectures.
- Updated README with revised build instructions and output details.
…image processing

- Added `constexpr` variables for better clarity and reduced runtime computations.
- Updated functions with `const` correctness and reduced memory allocations.
- Replaced redundant logic with optimized implementations in contour and coordinate processing.
- Enhanced debug logging for key functions.
# Conflicts:
#	.github/workflows/build-subvision-core.yml
#	CMakeLists.txt
@DayUx DayUx merged commit a09edd3 into master Nov 11, 2025
6 checks passed
@DayUx DayUx deleted the feature/Optimizations branch November 11, 2025 11:43
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

Comments