Accelerate direct and fused Sobel - #49
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
u8tof32Why
The canonical CPU table showed standalone Sobel trailing OpenCV by 20.31x to 23.30x at large resolutions. The generic path allocated a full-image
f64separable intermediate, while the Python binding also copied packed input.Impact
CV_32F-compatible Sobel X is 1.88x faster at 1080p and 2.03x faster at 4K; VGA remains an OpenCV 1.07x winabs(Sobel X) > 96masks are 3.81x to 6.64x faster in allocate mode and 2.95x to 8.68x faster with caller-owned outputunsafe; generic Sobel remains the fallback for other kernels/orders/typesChecks
cargo test -p spatialrust-vision --features imgproc-filtercargo clippy -p spatialrust-vision --features imgproc-filter --benches -- -D warningscargo check --manifest-path crates/spatialrust-py/Cargo.toml.venv/Scripts/python.exe -m pytest crates/spatialrust-py/tests/test_bindings.py -q -k "advanced_filters or spatial_gradient or sobel".venv/Scripts/python.exe bench/opencv_sobel_threshold_comparison/performance.py --output target/opencv-sobel-threshold-performance.json.venv/Scripts/python.exe bench/opencv_vision_comparison/performance.py --profiles vga,1080p,4k --output target/opencv-comparison/vision-performance-sobel-direct.json