Manuscript Offprint
arXiv:2610.33107Fast Path, Exact Path: One Library of Hardwired Operators for Streaming and Exact Canny Edge Detection on a Low-Cost FPGA
Raj Mali
Independent Researcher
ORCID: 0009-0001-6351-0062
Abstract—Hysteresis edge tracking, the final stage of Canny edge detection, follows edge chains of unbounded length and therefore resists single-pass streaming; FPGA designs either approximate it or dedicate separate labelling hardware to it. We show that a single library of hardwired operators, each with an identical two-clock latency, delivers both a camera-rate approximation and exact hysteresis on a low-cost Artix-7 (XC7A35T). The fast path streams camera pixels through the operators and K local hysteresis stages and commits each edge decision 262.15–720.63 s after the pixel arrives ( ; system simulation with a datasheet camera model), that is, camera lines later and sooner than a frame-based processor can even begin at 30 frames per second. It provably never reports an edge that exact hysteresis rejects, recovers 76.6–96.1 % of exact edges at thresholds 20/40, and on the 200 BSDS500 test images retains at least 98.6 % of the exact path's boundary F-measure (ODS 0.470–0.477 versus 0.476). The exact path holds tiles in block RAM, is exact within each tile, and replaces two-buffer iteration with in-place forward and reverse sweeps built into the same operator. This reduces hysteresis from 38–82 passes to 3–7 on pattern and photo tiles, accelerating the hysteresis step on a worst-case tile) and a complete tile , with identical output. Both paths are bit-exact with software golden models at every pipeline stage and close timing at 50 MHz in at most 1455 LUTs. An optimised multi-core CPU remains faster on stored images, but it cannot begin until the frame is complete.
Index Terms—FPGA, Canny edge detection, hysteresis thresholding, streaming architecture, bit-exact verification
I. INTRODUCTION
Edge detection is the entry point of many vision systems, from inspection lines to robotic grasping, and Canny's detector [1] remains the reference because it yields thin, connected edges with few false responses. In embedded and industrial settings, however, the decisive figure is often not throughput but latency: when a decision becomes available, and how predictably.
Four of Canny's five stages, namely Gaussian smoothing, Sobel gradients [2], non-maximum suppression (NMS) and double thresholding, are local operations that map naturally onto a line-buffered FPGA pipeline. The fifth, hysteresis, is not: a weak pixel is an edge only if a chain of weak pixels links it to a strong one, however long that chain. Software follows chains with a stack [3], [4], which presupposes random access. FPGA designs therefore settle for one of three compromises. They approximate hysteresis within a fixed window, which is fast but inexact; they add a connected-component labelling unit, which is exact but separate hardware [5], [6]; or they store the frame and iterate a local rule to convergence, which is exact and reuses the local operator but is slow, because a chain grows by only one pixel per full-frame pass (up to 82 passes on a photo tile in our design).
CPU comparisons demand equal rigour, since weak baselines have inflated many reported speed-ups [7]. An optimised library on a modern CPU processes a stored frame in 0.603 ms (Section V-F), which no one-pixel-per-clock pipeline at 50 MHz can match. The FPGA's advantage lies elsewhere: it can decide before the frame is complete, at a latency fixed by its structure.
We argue that speed and exactness need not be engineered separately. A single library of hardwired operators serves two architectures: a fast path that decides within a few image lines and never adds a false edge, and an exact path that completes the weak chains the fast path may miss. A system can act on the fast answer and refine it with the exact one, much as fast reflexes and slower deliberate processing coexist in nervous systems. Our contributions are:
-
A library of Canny operators with a common two-clock latency that serves, unchanged except for one feedback-enable input, both a streaming fast path and a frame-buffered exact path (Fig. 1, Section III).
-
In-place forward/reverse hysteresis sweeps, a known technique for morphological reconstruction [8], built into the shared operator through a one-clock left-neighbour feedback and a row-above write-back into the window's line buffer. The output is identical to two-buffer iteration, while the hysteresis step runs faster on photo and pattern tiles (Section III-C).
-
A verification methodology in which every pipeline stage of both paths is compared byte for byte with bit-exact software models in RTL simulation, and on hardware for the exact path (Section IV).
-
Measurements of fast-path latency and accuracy as functions of K, including boundary accuracy on BSDS500, and a fair CPU comparison that reports where the CPU wins (Section V).
II. BACKGROUND AND RELATED WORK
Hysteresis in software. Canny's hysteresis retains a weak pixel only if it is 8-connected through weak pixels to a strong one [1]. OpenCV traces chains from each strong pixel with a stack, visiting each pixel roughly once [3], and a patent application describes the same seed-and-stack scheme [4]. The random access this requires suits a CPU, not a raster-order pipeline.
Canny on FPGAs. Early FPGA implementations stream the local stages through line buffers [9]. Xu et al. partition the frame into blocks processed in parallel with block-adaptive thresholds [10], and recent designs on low-cost devices report video-rate operation with modified Canny variants [11]. Other implementations parallelise the pipeline for real-time operation [12], reduce its hardware cost [13], adapt the Canny parameters to the estimated noise level [14], or combine edge and corner detection at several resolutions [15]. Stencil compilers such as Darkroom [16] and vendor libraries such as Vitis Vision [17] generate line-buffered pipelines automatically, and fully pipelined, line-buffered processing at one pixel per clock with deterministic latency also underlies recent low-latency line-segment detectors [18]. In streaming designs, hysteresis is typically omitted or confined to a local window.
Exact hysteresis in hardware. Hysteresis can be made exact in a single raster pass by recasting it as connected-component analysis: edge pixels receive provisional labels, equivalent labels are merged, and a component is retained if it contains a strong pixel [5], [6], building on single-pass connected-component architectures for FPGAs [19], which now label 4K video streams in real time [20]. These designs are exact and fast, but their label and equivalence storage and merge logic stand apart from the local operators of the rest of the pipeline. A recent HLS design follows chains with an explicit stack, as software does, at the cost of a large share of the block RAM [21].
Raster-scan propagation. Rosenfeld and Pfaltz showed that alternating forward and backward raster sweeps, in which each pixel sees values already updated within the same sweep, propagate information across an image in a few passes [22]; the idea underlies distance transforms and multipass connected-component labelling. Hysteresis is a binary morphological reconstruction (the weak mask reconstructed from the strong seeds), and Vincent's sequential reconstruction algorithm computes reconstruction with precisely such alternating raster and anti-raster sweeps [8]. Anacona-Mosquera et al. implemented sequential and hybrid grey-level reconstruction in FPGA hardware, running the anti-raster sweep through the same module with the pixel order reversed [23], [24]. We do not claim the sweeps themselves. Our contribution is how they are realised for Canny: inside the same two-clock hysteresis operator as the rest of the library, with a one-clock left-neighbour feedback and decisions written back into the window's row-above line buffer, so that each pass is a single streaming pass requiring no memory beyond the existing frame buffers.
Fair comparison. Following [7], [25], [26], our CPU baseline includes both an optimised multi-threaded library and a single-threaded port of our own algorithm, and we report the cases in which the CPU is faster.
Table I situates both paths among these approaches. None dominates on every criterion; our point is that the last three rows, two of them new, are all built from one set of operators.
TABLE I WAYS TO IMPLEMENT CANNY HYSTERESIS ON AN FPGA. PASS COUNTS ARE FOR OUR PATTERN AND PHOTO TILES (TABLE II).
| Approach | Exact | Extra hardware | Passes |
|---|---|---|---|
| Local window [9] | no | line buffers | 1, streaming |
| Labelling [5], [6] | yes | label tables, merge logic | 1 |
| Two-buffer (baseline) | yes | 2 frame buffers | 38–82 |
| In-place (ours) | yes | 2 frame buffers + 2 feedbacks | 3–7 |
| Fast path (ours) | no | 1 line buffer per stage | 1, streaming |
Never reports a false edge (Proposition 2).
A. Operator library
Every operator consumes a window and produces its output exactly two clocks later; validity flags, border flags and addresses travel outside the operators in matched delay lines. gauss computes [1 2 1; 2 4 2; 1 2 1]/16 with shifts and adds. sobel outputs and quantises the direction to 0, 45, 90 or 135 degrees by comparing with and (tangents of 22.5 and 67.5 degrees in Q8), so that no divider, square root or arctangent is required. nms retains the centre only if it is not smaller than both neighbours along the gradient. thresh classifies the centre as strong (255), weak (128) or suppressed (0) with run-time thresholds . hyst promotes a weak centre that has a strong 8-neighbour. Every stage forces its one-pixel frame border to zero. The two paths use the operators identically except for a single input of hyst, fb_en, which enables the in-place feedback of Section III-C; the fast path ties it to zero.
B. Exact path
The exact path holds a tile in eight block-RAM buffers (input, blur, magnitude, direction, NMS, classes and two hysteresis buffers) and executes each stage as one raster pass through a single shared window and the operator selected for that pass. Each pass zeroes its border, and this boundary effect propagates inward by one ring per stage; a 4-pixel halo therefore makes the core of every tile identical to whole-image processing for the first four stages. Hysteresis, in contrast, can cross tile boundaries, so tiled output differs from whole-image output on (20/40) and (50/100) of the pixels of our test image (model). Tiles enter and leave over a 2 Mbaud UART; a command byte returns any
Fast path: streaming, decision lines after the pixel

Exact path: frame in BRAM, true hysteresis
in-place feedback: left neighbour (1 clk), row above (line buffer)

one raster pass per stage; hysteresis passes repeat until nothing changes
Fig. 1. One operator library, two architectures. Blue blocks are the shared operators, each with two clocks of latency; W is a line-buffered window. The fast path chains the operators with a window between stages; the exact path runs them as raster passes over block-RAM frame buffers.
intermediate buffer, and a status command reports the cycle count, the number of hysteresis passes and the mode of the last run.
C. In-place hysteresis
In the original two-buffer design, each hysteresis pass reads one buffer and writes the other, so a promotion becomes visible only in the following pass and a chain grows by a single pixel per pass. Reordering the updates is safe because of the following property. Let be the set of strong pixels after thresholding, the set of weak pixels, and the weak pixels joined to by an 8-connected path that runs through ; Canny's output is .
Proposition 1 (Order independence): Consider any procedure that (i) promotes a weak pixel only when one of its 8-neighbours is already strong, and (ii) stops only when no weak pixel has a strong 8-neighbour. When it stops, the strong pixels are exactly .
Proof: By (i), each promoted pixel is adjacent to a pixel that was strong before it, so by induction on the order of promotions every strong pixel lies in . Conversely, suppose some is still weak when the procedure stops. Walk along its path from S to p; the first pixel on the path that is still weak has a strong predecessor, which contradicts (ii).
Both the two-buffer scheme and the in-place scheme below satisfy (i) and (ii); they therefore produce identical edge maps and differ only in the number of passes. (Both also stop at a cap of 256 passes, which no tile in Table II reaches.)
In an in-place pass, each pixel sees the decisions already made earlier in the same pass, and successive passes alternate between forward and reverse raster order, as in [8], [22]. Two feedback paths are required, and both are inexpensive in a raster pipeline:
• Left neighbour. The decision for pixel leaves the operator's second stage one clock before that of pixel . Feeding this registered output back into the second stage (fb_en) promotes a weak pixel whose left neighbour has just been promoted. The loop is one clock long, and the operator's latency remains two clocks.

Fig. 2. In-place hysteresis datapath. With fb_en=1 the operator's own output is fed back into its second stage (left neighbour) and written into the row-above line buffer instead of the shifted input. Both loops are inside the existing pipeline; the operator's latency is unchanged.
• Row above. The window keeps the two previous rows in line buffers. In feedback mode, the row-above buffer is written with the pass's own decisions rather than with its input, so each row sees the updated row above it. Each decision is written back about W - 6 samples before it is next needed.
A reverse pass reads addresses and maps write addresses back through . Because promotion and the zero border are symmetric under a 180-degree rotation, the window and operators need no change. Frames still alternate between the two hysteresis buffers, so no pass reads and writes the same RAM, and the termination rule (stop after a pass that promotes nothing; cap at 256 passes) is unchanged. Fig. 2 shows both feedback paths.
D. Fast path
The fast path chains the same operators with a streaming window between stages: camera, grayscale conversion, Gaussian, Sobel, NMS, threshold and K local hysteresis stages, each a single plain (fb_en= 0) hysteresis iteration. The streaming window tolerates gaps in its input (the camera delivers a pixel every few clocks), supports widths that are not powers of two, and holds its two line buffers in one block RAM of words. Because NMS needs magnitude and direction together, its window is 10 bits wide. Every stage zeroes the frame border, exactly as in the exact path. The output is a 1-bit edge map in block RAM, scanned out to VGA at 60 Hz.
Each window delays the stream by one line and one pixel, so a decision emerges about lines after its pixel arrives. After the last pixel of a frame, zero samples are injected at full clock rate during vertical blanking to flush the pipeline. The camera's pixel-clock domain is crossed through a Gray-code FIFO, and a frame controller resets the pipeline at the start of each frame and pads short frames. Grayscale is computed as after expanding RGB565 to 8 bits per channel.
The accuracy of the fast path is bounded from one side:
Proposition 2 (No false edges): Let be the edge set produced by the fast path with local stages, and let be the weak pixels whose shortest path from through has at most steps. Then .
Proof: Every local stage satisfies condition (i) of Proposition 1, so the induction in that proof shows that every pixel the fast path promotes lies in E; weak pixels left at the end are discarded. This gives the upper bound. For the lower bound, each local stage reads only the previous stage's output and promotes every weak pixel that has a strong neighbour there, so after stage k all pixels of are strong.
The fast path therefore never reports an edge that the exact path rejects; it can only miss weak pixels lying more than K steps from a strong pixel. Because its error is one-sided, its precision relative to the exact result is 100 % by construction, and recall is the appropriate measure of its accuracy.
IV. VERIFICATION METHOD
A one-cycle misalignment shifts the image by a pixel yet still yields a plausible-looking edge map. Every check is therefore a byte-level comparison against a software model, never a visual inspection.
-
Golden models. canny_model.py mirrors the exact path operation for operation (shifts, truncation, tangent constants, zeroed borders, pass counting and cap) in both hysteresis modes; fast_model.py does the same for the fast path for every K, including the RGB565-to-gray conversion. A C++ port of the exact model is byte-identical to it on all our test images and serves as the CPU baseline.
-
RTL regression. Icarus Verilog testbenches dump every intermediate stage. The exact path is exercised on 8 tiles in both modes, with a lowered pass cap in both modes, and through the complete UART top level including the status command. The fast path is exercised on 5 frames of for (20 runs), including an RGB565 frame delivered with camera-like gaps. A continuous-integration job runs both regressions on every commit.
-
System simulation. The complete fast-path top level (capture, FIFO, frame controller, fast core and frame buffer) is simulated in Vivado's simulator against a behavioural OV7670 model that follows the datasheet's VGA RGB565 timing [27].
-
Implementation. Both designs are placed and routed in Vivado 2024.2 for the XC7A35T-1 and are required to close timing at 50 MHz.
-
Hardware. For the exact path, a link self-test first echoes a tile unchanged, and per-stage dumps then localise any mismatch. On the full test image, 0 of 345,600 output pixels differed from the model on the board (two-buffer mode).
V. RESULTS
Results labelled RTL simulation come from cycle-accurate simulation of the Verilog, with cycle counts converted to time at 50 MHz. Fast-path latency comes from the system simulation with the camera model, resources and timing from Vivado place and route, and CPU times from measurement; the full-image result of Section IV was obtained on the board.
A. Exact path and in-place hysteresis
Every stage of the exact path matches the model on all 8 tiles in both modes, and the pass counts of RTL and model agree. Table II quantifies the effect of in-place sweeps. On the pattern and photo tiles, the number of passes falls from 38–82 to 3–7, and the hardest photo tile drops from 28.42 to 2.97 ms. Since every hysteresis pass costs the same number of cycles, the hysteresis step itself becomes faster on these tiles ( on the hardest photo tile), and a complete tile, including the four fixed stages, becomes faster (last column of Table II). Compute time is now dominated by the four fixed stages rather than by hysteresis. The serpentine tile, a single weak chain winding through the whole tile, is the worst case for two-buffer iteration (120 passes) yet needs only 3 in place: fewer passes and a faster tile. Gains are modest only where chains are short to begin with (noise, flat image). Fig. 3 explains the high two-buffer pass count: most edges are found within the first few passes, but each long weak chain still grows by one pixel per pass, and this tail determines the number of passes. In-place sweeps eliminate the tail.

Fig. 3. Edges found after each hysteresis pass, as a fraction of the final edge set (model, bit-exact with the RTL). Both modes reach the same final set.
The same algorithmic change also pays off on a CPU: the single-threaded C++ port runs faster at 20/40 and faster at 50/100 (Table VII).
TABLE II HYSTERESIS PASSES AND COMPUTE PER 128 × 128 TILE AT 50 MHz, TWO-BUFFER VS. IN-PLACE (RTL SIMULATION; OUTPUTS IDENTICAL TO THE MODEL IN BOTH MODES)
| Tile (128 × 128) | Hysteresis passes | Compute per tile (ms) | ||||
|---|---|---|---|---|---|---|
| Two-buf. | In-place | Two-buf. | In-place | Speed-up | ||
| Synthetic pattern | 25/60 | 38 | 3 | 13.88 | 2.31 | 6.0× |
| Synthetic pattern | 50/100 | 65 | 3 | 22.80 | 2.31 | 9.9× |
| Photo, top-left | 20/40 | 46 | 7 | 16.52 | 3.63 | 4.5× |
| Photo, middle | 20/40 | 82 | 5 | 28.42 | 2.97 | 9.6× |
| Photo, middle | 50/100 | 65 | 4 | 22.80 | 2.64 | 8.6× |
| Uniform noise | 20/40 | 5 | 4 | 2.97 | 2.64 | 1.1× |
| Flat white | 20/40 | 1 | 1 | 1.65 | 1.65 | 1.0× |
| Serpentine chain | 2/60 | 120 | 3 | 40.97 | 2.31 | 17.7× |
B. Fast-path accuracy
The fast-path edge map equals the model's for every frame and every , and no run produced a single false edge. Table III and Fig. 4 report recall against exact hysteresis. Recall increases with and is higher at low thresholds, where strong pixels are denser and weak pixels lie closer to them: at 20/40 it rises from () to (), and at 50/100 from to . Fig. 5 shows what is missed: the long weak chains that only the exact path completes.
TABLE III FAST-PATH RECALL OF EXACT EDGE PIXELS (%), RTL SIMULATION. PRECISION IS 100 % IN EVERY CASE.
| Frame (640 × 480) | K = 1 | K = 2 | K = 4 | K = 8 |
|---|---|---|---|---|
| Photo, 20/40 | 76.6 | 83.6 | 90.9 | 96.1 |
| Photo, 50/100 | 38.3 | 48.3 | 63.1 | 79.9 |
| Camera RGB565, 20/40 | 77.7 | 84.5 | 91.6 | 96.6 |

Fig. 4. Fast-path recall vs. number of local hysteresis stages . Solid: whole image (model). Dashed: frame from the same photograph through the RTL; the two nearly coincide.
C. Accuracy on a standard benchmark
Recall against our own exact path measures how much the fast path loses, not how good either path is. We therefore also score both paths on the 200 test images of the BSDS500 boundary benchmark [28], [29], using the bit-exact models, so the scores hold for the RTL. Each predicted boundary pixel is matched one-to-one to human-annotated boundaries within 0.75 % of the image diagonal, the benchmark's tolerance; we re-implement this matching rule in Python rather than run the original benchmark code, and apply it identically to every detector. Thresholds are swept with ; ODS is the F-measure at the best common threshold and OIS at the best threshold per image. As Table IV shows, the exact path achieves ODS F = 0.476, and OpenCV's Canny, which uses a different gradient scale and arithmetic, 0.508. The fast path scores between 0.470 and 0.477 for every K (0.477 with K = 1, 0.470 with K = 8), retaining at least 98.6 % of the exact path's score. The differences are not monotonic in K because each detector is scored at its own best threshold, where a detector that drops weak chains can afford a lower . On this benchmark, the edge pixels missed by local hysteresis therefore do not measurably reduce agreement with human-drawn boundaries. Both paths score below OpenCV, whose gradient arithmetic differs from ours; matching its accuracy is not a goal of this design.

Fast path,
Fast path,

Fig. 5. Aerial photograph of a hairpin road ( crop, grayscale, thresholds 50/100), processed by the bit-exact models of both paths. The fast path reports only edges the exact path also reports. With K = 1 the long, low-contrast lane markings around the bend break into fragments; with K = 8 most of each curve is recovered.
D. Fast-path latency
Table V reports the time from the camera delivering the second byte of the marker pixel (row 240, column 320) to its edge decision leaving the fast core, measured in the system simulation with the camera's datasheet timing (24 MHz pixel clock, one line every ). The latency equals camera lines to within a few hundredths of a line, exactly as the architecture predicts: for and
TABLE IV
BSDS500 TEST SET (200 IMAGES), BOUNDARY PRECISION (P), RECALL (R) AND F-MEASURE (MODEL, BIT-EXACT WITH THE RTL). *OPENCV THRESHOLD ON , I.E. THE MODELS' SCALE.
| Detector | P | R | ODS F | OIS F | |
|---|---|---|---|---|---|
| Exact path (converged) | 64 | 0.360 | 0.704 | 0.476 | 0.510 |
| Fast path, | 50 | 0.360 | 0.706 | 0.477 | 0.512 |
| Fast path, | 64 | 0.385 | 0.608 | 0.472 | 0.507 |
| Fast path, | 64 | 0.371 | 0.639 | 0.470 | 0.504 |
| Fast path, | 64 | 0.363 | 0.668 | 0.470 | 0.504 |
| OpenCV Canny (L1) | 256* | 0.405 | 0.682 | 0.508 | 0.556 |
for . Because the pipeline contains no data-dependent control, the latency is independent of image content.
TABLE V
FAST-PATH LATENCY, CAMERA PIXEL TO EDGE DECISION (SYSTEM SIMULATION, OV7670 VGA TIMING)
| K | Latency (μs) | Camera lines | Expected 3 + K |
|---|---|---|---|
| 1 | 262.15 | 4.01 | 4 |
| 2 | 327.65 | 5.01 | 5 |
| 4 | 458.65 | 7.02 | 7 |
| 8 | 720.63 | 11.03 | 11 |
E. Resources
Table VI lists post-route utilisation. Both designs close timing at 50 MHz with positive slack. The exact path is dominated by its eight tile buffers (29 of 50 BRAM36). The fast path at K = 8, including camera capture, FIFO, frame buffer and VGA output, occupies 1455 of 20800 LUTs, and each stage costs one -word line buffer. Vivado's post-route power estimate is 0.108 W for the exact path and 0.300 W for the fast path (default switching activity; an estimate, not a measurement).
TABLE VI
POST-ROUTE UTILISATION ON XC7A35T-1 AT 50 MHz (VIVADO 2024.2)
| Design | LUT | FF | BRAM36 | BRAM18 | DSP | WNS (ns) |
|---|---|---|---|---|---|---|
| Exact path (UART, 128 × 128 tiles) | 720 | 660 | 29 | 0 | 2 | 8.408 |
| Fast path, K = 8 (camera to VGA) | 1455 | 2201 | 11 | 11 | 2 | 7.927 |
F. Comparison with a CPU
Table VII gives single-image times on a 12th Gen Intel Core i5-12500H laptop CPU (1000 timed runs after warm-up, image, Linux subsystem on Windows, g++ -O3 -march=native; on mains power, minimum processor state , single-thread runs pinned to one core). OpenCV's Canny with 16 threads takes 0.603 ms; on stored images, the CPU is clearly faster than our 50 MHz pipelines. The picture reverses when the image comes from a camera. A frame-based CPU program cannot start until the frame has arrived, which takes 33.3 ms at 30 frames per second: the first pixel of a frame waits that long before any processing begins, and only the last pixel experiences a latency close to the processing time. The fast path decides every pixel 0.26–0.72 ms after it arrives, with no operating system in the loop. For the first pixels of a frame, this is 46–127× sooner than a frame-based program can even start (derived: 33.3 ms divided by the measured latency). This comparison is with frame-based software; a CPU or microcontroller program written to process the image line by line could also start early, and what the pipeline adds is a latency fixed by its structure rather than by scheduling. The exact path offers the complementary trade-off: full hysteresis, bit-exact with a reference model, at a fixed and analysable cost per tile.
TABLE VII
CPU TIME PER 480 × 720 IMAGE (12TH GEN INTEL CORE I5-12500H)
| Implementation | Thr. | 20/40 (ms) | 50/100 (ms) | ||
|---|---|---|---|---|---|
| median | p99 | median | p99 | ||
| C++ port, two-buffer | 1 | 19.49 | 25.32 | 28.01 | 33.72 |
| C++ port, in-place | 1 | 8.23 | 9.88 | 6.32 | 8.79 |
| OpenCV | 1 | 3.88 | 4.92 | 3.00 | 3.95 |
| OpenCV | 16 | 0.60 | 0.87 | 0.51 | 0.71 |
VI. DISCUSSION AND LIMITATIONS
Latency, not throughput. At one pixel per clock and 50 MHz, neither path outperforms an optimised CPU on stored frames, and we do not claim otherwise. The fast path's value is a decision within a few lines of the pixel, at a latency fixed by the pipeline; the exact path's value is exact hysteresis that can be verified byte for byte.
Two answers from one library. The fast path delivers an early, conservative answer that never contains a false edge; the exact path completes the weak chains later. Because both paths share the same operators and the same models, the relation between their answers is known exactly: the fast result is always a subset of the exact one.
Limitations. The exact path processes tiles because larger buffers do not fit in the device's block RAM; this causes the tile seams quantified above, which external memory would remove. Tiles travel over a UART that is far slower than the computation, so the exact path serves as a verification and refinement engine rather than a video-rate one. The fast-path results derive from RTL and system simulation with a datasheet camera model and from Vivado implementation, and the in-place mode of the exact path has been verified in RTL simulation; confirming both on the board, together with measured power, remains future work. The CPU results cover a single laptop processor. Finally, a single global threshold pair cannot suit both dense texture and soft edges, a limitation inherent to Canny itself.
VII. CONCLUSION
A single library of hardwired operators, each with a two-clock latency, serves both a streaming fast path and an exact frame-buffered path for Canny edge detection on a low-cost Artix-7. Built into that library, in-place forward and reverse sweeps reduce exact hysteresis from up to 82 to at most 7 passes on photo and pattern tiles with identical output, accelerating the hysteresis step 6.6–21.7× and complete tiles 4.5–9.9× (17.7× on a worst-case tile). The fast path commits each edge decision 262.15–720.63 μs after the camera delivers the pixel, never reports a false edge, recovers up to 96.1 % of exact edges, and retains at least 98.6 % of the exact path's boundary accuracy on BSDS500. For systems that must act on a camera stream before the frame is complete, this provides early, provably conservative answers and exact refinement from the same verified hardware. All results trace to scripts and raw logs in the accompanying repository.
REFERENCES
[1] J. Canny, “A computational approach to edge detection,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. PAMI-8, no. 6, pp. 679–698, 1986.
[2] I. Sobel and G. Feldman, “A 3x3 isotropic gradient operator for image processing,” Stanford Artificial Intelligence Project, 1968.
[3] G. Bradski, “The OpenCV library,” Dr. Dobb’s Journal of Software Tools, 2000.
[4] D. J. Moore, “Fast hysteresis thresholding in Canny edge detection,” US Patent Application US 2011/0081087 A1 (Texas Instruments), filed Oct. 2009, 2011.
[5] M. Al Najjar, S. Karlapudi, and M. Bayoumi, “A compact single-pass architecture for hysteresis thresholding and component labeling,” in Proc. IEEE International Conference on Image Processing (ICIP), 2010, pp. 101–104.
[6] Y. Jang, J. Mun, Y. Nam, and J. Kim, “Novel hysteresis thresholding FPGA architecture for accurate Canny edge map,” in Proc. International Technical Conference on Circuits/Systems, Computers and Communications (ITC-CSCC), 2019, pp. 1–3.
[7] V. W. Lee, C. Kim, J. Chhugani, M. Deisher, D. Kim, A. D. Nguyen, N. Satish, M. Smelyanskiy, S. Chennupaty, P. Hammarlund, R. Singhal, and P. Dubey, “Debunking the 100X GPU vs. CPU myth: An evaluation of throughput computing on CPU and GPU,” in Proc. International Symposium on Computer Architecture (ISCA), 2010, pp. 451–460.
[8] L. Vincent, “Morphological grayscale reconstruction in image analysis: Applications and efficient algorithms,” IEEE Transactions on Image Processing, vol. 2, no. 2, pp. 176–201, 1993.
[9] H. S. Neoh and A. Hazanchuk, “Adaptive edge detection for real-time video processing using FPGAs,” in Global Signal Processing Expo (GSPx), 2004.
[10] Q. Xu, S. Varadarajan, C. Chakrabarti, and L. J. Karam, “A distributed Canny edge detector: Algorithm and FPGA implementation,” IEEE Transactions on Image Processing, vol. 23, no. 7, pp. 2944–2960, 2014.
[11] L. Guo and S. Wu, “FPGA implementation of a real-time edge detection system based on an improved Canny algorithm,” Applied Sciences, vol. 13, no. 2, p. 870, 2023.
[12] C. Gentsos, C.-L. Sotiropoulou, S. Nikolaidis, and N. Vassiliadis, “Real-time Canny edge detection parallel implementation for FPGAs,” in Proc. IEEE International Conference on Electronics, Circuits and Systems (ICECS), 2010, pp. 499–502.
[13] D. Sangeetha and P. Deepa, “FPGA implementation of cost-effective robust Canny edge detection algorithm,” Journal of Real-Time Image Processing, vol. 16, no. 4, pp. 957–970, 2019.
[14] M. Kalbasi and H. Nikmehr, “Noise-robust, reconfigurable Canny edge detection and its hardware realization,” IEEE Access, vol. 8, pp. 39934–39945, 2020.
[15] P. R. Possa, S. A. Mahmoudi, N. Harb, C. Valderrama, and P. Manneback, “A multi-resolution FPGA-based architecture for real-time edge and corner detection,” IEEE Transactions on Computers, vol. 63, no. 10, pp. 2376–2388, 2014.
[16] J. Hegarty, J. Brunhaver, Z. DeVito, J. Ragan-Kelley, N. Cohen, S. Bell, A. Vasilyev, M. Horowitz, and P. Hanrahan, “Darkroom: Compiling high-level image processing code into hardware pipelines,” ACM Transactions on Graphics, vol. 33, no. 4, 2014.
[17] AMD, “Vitis vision library,” https://docs.amd.com/r/en-US/Vitis_Libraries/vision/index.html, version 2026.1, accessed Oct. 2026.
[18] A. H. Jalilvand, P. Hassani Shariat Panahi, and M. H. Najafi, “A low-latency ASIC architecture for real-time line segment detection,” arXiv:2608.06439, 2026.
[19] N. Ma, D. G. Bailey, and C. T. Johnston, “Optimised single pass connected components analysis,” in Proc. International Conference on Field-Programmable Technology (FPT), 2008, pp. 185–192.
[20] M. Kowalczyk, P. Ciarach, D. Przewlocka-Rus, H. Szolc, and T. Kryjak, "Real-time FPGA implementation of parallel connected component labelling for a 4K video stream," Journal of Signal Processing Systems, vol. 93, no. 5, pp. 481–498, 2021.
[21] S. H. Khan Malik and S. Mirzaei, “An optimized FPGA based Canny edge detection system using high-level synthesis,” in Proc. IEEE International Systems Conference (SysCon), 2025, pp. 1–4.
[22] A. Rosenfeld and J. L. Pfaltz, “Sequential operations in digital picture processing,” Journal of the ACM, vol. 13, no. 4, pp. 471–494, 1966.
[23] O. Anacona-Mosquera, G. Teodoro, G. Vinhal, R. P. Jacobi, R. C. Sampaio, and C. H. Llanos, “Efficient hardware implementation of morphological reconstruction based on sequential reconstruction algorithm,” in Proc. Symposium on Integrated Circuits and Systems Design (SBCCI), 2017, pp. 162–167.
[24] O. Anacona-Mosquera, C. E. dos Santos, F. R. G. Cabral, R. C. Sampaio, G. Teodoro, R. P. Jacobi, and C. H. Llanos, “Hardware-based fast hybrid morphological reconstruction,” IEEE Design & Test, vol. 37, no. 3, pp. 30–39, 2020.
[25] M. Horowitz, “Computing’s energy problem (and what we can do about it),” in Proc. IEEE International Solid-State Circuits Conference (ISSCC), 2014, pp. 10–14.
[26] I. Kuon and J. Rose, “Measuring the gap between FPGAs and ASICs,” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 26, no. 2, pp. 203–215, 2007.
[27] OmniVision, “OV7670/OV7171 CMOS VGA (640x480) CameraChip sensor,” Preliminary datasheet, version 1.4, 2006.
[28] D. R. Martin, C. C. Fowlkes, and J. Malik, “Learning to detect natural image boundaries using local brightness, color, and texture cues,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 26, no. 5, pp. 530–549, 2004.
[29] P. Arbeláez, M. Maire, C. Fowlkes, and J. Malik, “Contour detection and hierarchical image segmentation,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 33, no. 5, pp. 898–916, 2011.