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
| # cv2_canny_cpu_vs_opencl.py | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # Copyright (c) 2025 Yensong Ted Li | |
| # Licensed under the Apache License, Version 2.0 (see http://www.apache.org/licenses/LICENSE-2.0) | |
| # | |
| # About this script: | |
| # Microbenchmark of OpenCV Canny on the same image: CPU (multithreaded) vs GPU (OpenCL/UMat). | |
| # Uses preallocated buffers and blocked medians for stable per-frame latency (ms); | |
| # reports median/min/max/std and a CPU-GPU pixel-diff count; no GUI required. | |
| # Note: operator-level microbenchmark only — excludes I/O/transfer and end-to-end pipeline effects. |